Sign in to follow this  
shodanjr_gr

Normal Mapping and Displacement Mapping in a shader

Recommended Posts

I am working on a shader that displaces a surface based on some Perlin Noise (the noise is calculated on the GPU). I also use the noise to perturb a normal for each vertex on the surface. Of course in order to do lighting calculations i need to transform the light vector into tangent space. But i fail to see how i can calculate the new tangent space inside the shader...i dont have any connectivity information about each vertex and precalculating the tangent space on the CPU would be futile since i assume the displacement would make the old tanget vector invalid... Any ideas?

Share this post


Link to post
Share on other sites
Quote:
Original post by i_luv_cplusplus
try this http://www.ozone3d.net/tutorials/mesh_deformer.php


Thanks for the reply. I am aware of this tutorial, the thing is, i cant figure out WHY it works...(if it does). If i am reading it correctly, the guy used the old normal to produce a tangent and bitangent and then uses then to make a NEW normal, based on the Jacobian matrix...How does this work if the tangent and bitangent define the OLD tangent space?


[Edited by - shodanjr_gr on July 5, 2008 3:21:17 PM]

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