Announcement

Collapse
No announcement yet.

World Displacement - how it works?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    World Displacement - how it works?

    Hello there!

    My friend and I are trying to understand how a displacement map affect a model in UE4. We didn't find anything deep enough to truly understand how the World Displacement works in UE4.
    In 3DMAX, 50% gray is zero, so we can have negative displacement. But, in our test, it seems that in UE4, black is zero displacement. Is there a way to use the same displacement map we had generated in 3DMAX? We've tried to change the contrast of the image, but what color does the black should turn? It can't be black.
    Also, it seems that it isn't a linear displacement. In our test (attached image) we used a multiplier 6 and the colors white 100%, gray 50% and black 0%, we could notice that the white map with the black and gray details creates almost the same distortion. Shouldn't the black detail create a "hole" bigger than the gray detail?
    Can anyone help us, please?

    Thank you very much!
    Attached Files

    #2
    World Displacement is based on world units. Red is X, Green is Y, Blue is Z. For example, if you feed the constant 0,0,500 into World Displacement it will appear to move your entire object up 5 meters. You can use negative numbers, though in terms of color displayed in the material editor, negatives are treated as 0 in their color channel. If you want to know the value at a specific point in world/texture/normal space, you can feed a constant value where your function takes coordinates as input, then use DebugFloat3Values(or BreakOutFloat3Components and use 3 DebugScalarValues because it's easier to read) and preview it in a node like Add 0, multiply 1, etc. Since black, grey and white are equal in three dimensions, applying them directly will displace in x y and z equally, by 0, 0.5 and 1 respectively. If you want to make it so that example texture will not displace the surface where it's grey, make it concave where it's black and convex where it's white do this: If your grey is 0.5,0.5,0.5, subtract 0.5 from the texture. If you multiply the result by 2, the original black will now be -1,-1,-1 and white will be 1,1,1 again, but you can use any scale factor. Since you want displacement it to be relative to the surface normal, multiply this by VertexNormalWS and feed that into World Displacement.

    Comment


      #3
      Thank you very much for helping us!!!

      Comment

      Working...
      X