Sign in to follow this  

Lights, loops, and tangent space

This topic is 3592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone, I have hit a wall when trying to implement bump mapping for a small amount of lights. I would like to take advantage of the loop instruction in later shader models, but when I use bump mapping I naturally have to pass the light information between VS and FS. Is there a way to combine looping and accessing the lights info from TEXCOORDS?

Share this post


Link to post
Share on other sites
It might be easier for you to just pass the TBN->World matrix into your pixel shader and transform the tangent space normal into world space, and do your lighting there. A constant 3 texcoords used, as opposed to n coords for n lights.

Share this post


Link to post
Share on other sites
Wouldn't that be inefficient? I get good quality with the interpolators, and I would rather unroll the loop myself, and just take the hit in program size? How is everyone here passing their lighting information for tangent space calculations?

Share this post


Link to post
Share on other sites

This topic is 3592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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