Jump to content
  • Advertisement
Sign in to follow this  
harveypekar

Lights, loops, and tangent space

This topic is 3899 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!