View Single Post
  #10  
Old 12-10-2004, 10:06 AM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

Well, I *believe* that the normal textures have per-pixel normal vectors with the (x, y, z) components of the packed into the (r, g, b) components of the texture bitmap using

r = 128 + 127 * x; // Where x varies from -1.0 to 1.0
And the same for the g and b components.

This is farily standard for this kind of thing from what I can gather. The simple bump mapping requires something different to be stored in the "bump" bitmaps.

And it's very easy to set up the rendering states to work with this.
The problem is that I need to calculate the light direction vector in the same coordinate system as the normal vectors in each bitmap. I think you'd have to do the same with the simple bump mapping system too. And it's that that I'm having trouble getting my head around. It's too many years since I did any real mathematics As I said, will just take some time. I could probaby borrow a funtion from somewhere but I want to understand it.
Reply With Quote