Bumpmap texture
Blitz3D Forums/Blitz3D Programming/Bumpmap texture
| ||
Hi, I've tried to get the structure of how a bumpmap texture is built, but can't seem to find the real meaning for the RGB values. RGB = same value, means level of brightness of bumpmap(?) RGB = different values between R, G and B, = bump angles(?) Anyone has a real definition on that? |
| ||
So far, I found this tutorial: http://www.paulsprojects.net/tutorials/simplebump/simplebump.html Since they are unit length, (x*x)+(y*y)+(z*z)=1. Thus x, y and z lie between -1 and 1. We can represent these in a texture map by letting the red, green and blue components of the texture equal x, y and z respectively. The color components which we will use to represent the vector must lie between 0 and 1. So, we put: r = (x+1)/2; g = (y+1)/2; b = (z+1)/2; Take a minute to convince yourselves that every possible unit normal can be stored in a color this way. The normals we enclose in the texture map will be in tangent space. In tangent space, the usual normal points in the z direction. Hence the RGB color for the straight up normal is (0.5, 0.5, 1.0). This is why normal maps are a blueish color. |