Vertex Normal Recalculation Issues
Posted: Wed Mar 06, 2019 5:26 pm
Hello there! I have a question regarding recalculating vertex normals after offsetting vertices. I'm using a heightmap to displace vertices around level geo, but I'd like to then inflate the verts a bit in the direction perpendicular to their tangents after the initial displacement. There is an example in the Amplify asset of recalculating vertices for a waving flag that I've used as a starting point, but when I try to displace the verts along their new normals they don't move in the correct direction.
My current shader calculates a new vertex position using a heightmap which is then added to new normals which are being multiplied by an inflation amount => (newVertexPosition + (newNormals * inflationAmount)).
Here is my system for the initial vertex displacement:
Here's a screenshot of the initial vert displacement (the red plane mesh has the shader applied and is conforming to level geo):
Here's a screenshot of the inflated verts being translated along their new normals after the initial displacement using the method in the included flag example:
One solution I tried was to use the "newVertexPosition" variable to calculate the Delta-X and Delta-Y rather than the Vertex Position node, but this only scaled them vertically along the y-axis when trying to inflate.
Any help would be greatly appreciated!
My current shader calculates a new vertex position using a heightmap which is then added to new normals which are being multiplied by an inflation amount => (newVertexPosition + (newNormals * inflationAmount)).
Here is my system for the initial vertex displacement:
Here's a screenshot of the initial vert displacement (the red plane mesh has the shader applied and is conforming to level geo):
Here's a screenshot of the inflated verts being translated along their new normals after the initial displacement using the method in the included flag example:
One solution I tried was to use the "newVertexPosition" variable to calculate the Delta-X and Delta-Y rather than the Vertex Position node, but this only scaled them vertically along the y-axis when trying to inflate.
Any help would be greatly appreciated!