How to compute normals when displacing vertex with height map?

Hello community,

I wanted to know if I was missing a step to get the normals to be computed correctly when using a height map to displace the vertices in a material.

I know that when you displace vertices in a vertex shader, an extra step is required to re-compute the normals. I know how to implement such a solution, but I find it a bit weird that the built-in vertices displacement does not provide this features.

Am I missing a step ?

I provided a very basic example that demonstrates the issue:
touch-displace-height.toe (5.5 KB)

1 Like

Hey @ciphrd,

you can use the Normal TOP to create a texture that can be used as the Normal Map in your pbr MAT.

Does this help?
Cheers
Markus

3 Likes

Thank you for your answer.
I think sometimes some parts of my brain just turn off.
Yes, it helped a lot,

Best regards,
ciphrd

I was wondering, how to go about cases when heightmap displaces vertices of a non-flat geometry, for example a sphere? What is a way to calculate new normals that takes into account the original normals of the sphere SOP and the normals of the displacement map?

I am attaching an example where lighting is wrongly computed. It is similar to the case of displacement with Noise SOP I posted here, where the solution was to compute new normals with Attribute Create SOP. Is there a built in solution for displacement with height map?

What I am wondering is if there’s a way to calculate normals for the height map in a way that this look:


Can be corrected to look like this:

sphere_displace_with_height_maps.toe (6.5 KB)