Sign in to follow this  
maya18222

Tangents for heightmap

Recommended Posts

Im working on a water shader, that displaces the vertices of a plane in the vertex shader, via a few height maps running in different directions animated over time. But with the verices varying in height over time, the tangents are going to vary and need to be calculated each frame. But how can i do this if i dont have access to the other 2 vertices in the triangle?

Share this post


Link to post
Share on other sites
as you're animating the vertices probably in worldspace, tangentsspace is also in worldspace, so you can calculate the height for the vertex left/right/top/bottom of the current vertex, although that might rise the computatoin amount quite a lot.
depending on the formular you're using to calculate the height, you could calculate the tangentspace using the derivered formular.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this