Original Post
Hi,
Not sure if this really is a math problem or common knowledge, but it''s really bugging me :/
I have a vertex shader that uses a Perlin noise function which, based on user input, displaces each vertex along its normal (basically newPos = oldPos + normal*noiseVal). This, however, doesn''t change the direction of the vertex normals.
When apply shading, the vertex normals are not transformed, and the lighting calculations won''t give me correct results. I somehow need to recalculate the directions of the vertex normals, but since the vertex shader operates on only one vertex at a time, I don''t know how this would be possible.
Any takers?