Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Al_N_
Beginner
123 Views

Displacement map uncertainties

Hello and thank you for providing such a wonderful kernel. However, I have some questions... 1. How can we preserve the original shape of the mesh if a displacement function is not provided? 2. Setting the levels to zero still subdivide the mesh and the original shape is not preserved. For testing, I did the above 2 and the test cube did not come out as a cube but as a partially rounded cube! If I have a cube with a brick displacement map for example, the cube doesn't look anything like a cube with bricks on it. First, the cube is almost round as in the displacement example you provided, second, the bricks on it are somewhat distorted and not displaced correctly. I was under the impression that if the displacement function doesn't alter (or simply return) the values for px,py,pz that the surface will remain flat and so the edges as well, resulting in the original un-displaced mesh shape, like the cube for example. But it is not the case, what am I missing? How do I get a cube with a brick pattern on it (using a brick displacement map) to remain a cube (except of course the edges should reflect the brick geometry) and have the bricks on the cube elevated and sunken so they look like brinks on a cube?
0 Kudos
7 Replies
BenthinC_Intel
Employee
123 Views

The input mesh is internally treated as a Catmull-Clark subdivision surface so it is possible that parts or everything of the original shape is modified, in particular when triangle primitives or features like creases are present in the input mesh.

You could preserve the cube by "tagging" the edges of the cube as  "hard crease edges", however, it seems that you only what to modify the input mesh itself by applying displacements, right? Or you might want to tessellate the input geometry without actually applying any subdivision rules at all?

In that case it might be "easier" to do all tessellation and displacement of the input geometry in your application and just transfer all generated geometry data per frame to Embree (as a standard triangle object).

Al_N_
Beginner
123 Views

I guess the Catmull-Clark is the problem because a cube, sub-divided enough will end up in a sphere and for displacement mapping, such as a brick wall for example, is not what I was looking for. I wish Embree could have a function to turn off Catmull-Clark or be able to use the displacement function alone so as to get the result such as the following without coding it myself since Embree is already capable of doing it. https://udn.epicgames.com/Three/rsrc/Three/TessellationDX11/DyanmicDisplacement.jpg If I try to use the above model in Embree and use a displacement map, the whole figure is completely out of shape and doesn't look anything like the original. I wish I could obtain the same result as the above. Do you think it will ever be possible in Embree?
BenthinC_Intel
Employee
123 Views

I guess the DX11 example does not use any subdivision surfaces at all but basically tessellates each input primitive (triangle,quad) based on the edge levels and then applies the displacement function. Our "subdivision object" in Embree implies Catmull-Clark subdivision so you will need hard crease edges to preserve the original shape and therefore emulate your use case. A future version of Embree could support this "planar tessellation" case more efficiently (needs discussion within the Embree team). Another option would be to do the tessellation + displacement entirely in the application and just transfer the geometry to Embree but that's probably too inconvenient.

It's an interesting use case for sure. Could you give us a bit more details (here or offline) for what you need the displaced surfaces exactly?

Thanks.

 

Al_N_
Beginner
123 Views

What I really need it to do is to keep the original mesh shape, like a corner brick wall for example, but use a displacement map (or a height map?) to change the height of the hit point at the normal, if the returned height is zero, the mesh shape stays the same. Basically, the bricks (like a normal map) will not only appear raised/sunken but will actually be (geometry wise), and the corner of the wall will not be a straight line (like it is the case with bump/normal map) but follow the brick pattern (geometry wise). I suppose it's called displacement mapping using a height map?
Al_N_
Beginner
123 Views

Do you think it will ever be possible in Embree what I've explained in my previous post?
BenthinC_Intel
Employee
123 Views

Sure, does not sound that tricky to support. Can't tell you when we'll support it but is on the "feature request" list.

Al_N_
Beginner
123 Views

Great, thank you :)
Reply