How to create and use displacement maps?

I would obviously like to learn to create displacement maps…is there a free to do that??

But most importantly I have a couple…how do I plug them into unreal…and sense they’re molding the texture to the model will the normal.map still be important??? or would it be unnessecary at that point??

Any help would be great. Im trying to learn more complex texturing.

1 Like

Hi AttemptD -

Displacement Maps are an addition to the Normal map setup that allows you to create actual depth offset as opposed to the light angles that are created by a Normal map. You would still want to have a normal map, they are still the most efficient way to add a sense of depth to objects as they actual effect the way in which light is rendered across an object. Displacement maps can be tricky to use to try to match the effect of a normal map, because you need vertexes in order to get the offset displacement and this is where DX11’s tessellation comes into play. This sort of workflow though is not always efficient in a game environment, but in a limited capacity it can look really amazing.

Here is just a normal map -

Here is just a displacement Map, tessellation is on and set to Flat Triangles (PNTriangles would work as well) -

1 Like

And here it is with both,

Here is the wireframe to give you an idea of the cost of using a lot of displacement with tessellation -

Displacement maps are really nothing but Black and White gradient maps as well so you should be able to develop these using your normal texture generation methods.

Thank You

Eric Ketchum

Thank you ao much for your help. I see how they work and also how to wire them up in the material BP. Could you use the alpha from the normal and plug it into the world displacement? Would you get a similar effect?

Assuming you have the height map in your Alpha channel, then yes it should work.

Eric Ketchum

I’m not sure what you mean…All I have is a diffuse a normal a specular and a glossy map…I was trying to create a displacement map or at least the effect…Is there a way I can create the displacement map?? Or like I said will plugging the alpha of the normal into the world displacement work??

Hey AttemptD -

I would always suggest developing your own displacement map in Photoshop which would be a greyscale map based on your normal. You can however take the Red and Green Channels from your Normal (which make up the Height info anyway) and add them together to get a height map then use that as the displacement map to LERP between you low and high values.

Eric Ketchum

That sounds like EXACTLY what I need to do.
So I would add the green and red together out of the normal and plug it into the world displacement input??? Where does the LERP come into play??

You are using the Displacement Map as an Alpha input of a LERP which is moving from the lowest height to the highest height (2 scalar values).

Eric Ketchum

So adding the green and red together. Plugging that into the alpha if a LERP and into the world displacement. …what else would be plugged into the lerp??? Anything? ??? Thank you so much for your help.

Here you go:

Eric Ketchum

Perfect :slight_smile: THANKS!!!

One minor Correction - Instead of the Scalar value use a constant 3 vector value. then adjust the 3 value (B/Z) to raise or lower the height.

Good Luck

Eric Ketchum

So both of those constants shoutd be vector 3 constants?

Yes, this way you are telling the displacement in what actual direction to take your mesh (0,0,-10) would be -10 on the Z axis.

Is there a way to have displacements work in object space? I’d like to displace normal to surface.

Hey hyperjams -

You may want to look at electricsuace’s Vector Displacement Map Math found here:

Vector displacement map - Rendering - Epic Developer Community Forums

Thank You

Eric Ketchum

Actually, This link helps a lot!

https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/MaterialNodes/1_11/index.html

The VertexNormalWS node fixed the problem.

Yes -

As an update to my original answer this is a much more efficient and easier setup for a Displacement Map setup:

Thank You

Eric Ketchum

What exactly is the red node in this setup??