Lights, loops, and tangent space

Started by
3 comments, last by harveypekar 16 years, 2 months ago
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?
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.
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?
... We pass our information about world-space to the pixel shader, and do the math there. =)
Sorry for misunderstanding , I've never bumped before ;)

This topic is closed to new replies.

Advertisement