What is dot3 lighting?

Blitz3D Forums/Blitz3D Programming/What is dot3 lighting?

Rogue Vector(Posted 2005) [#1]
What is dot3 lighting?

Rob Cummings at Redflame (http://www.redflame.net) has a normal map demo - written in Blitz3D, which refers to it.

However, I can't find anything on the Internet that explains it in terms that I can understand.

Regards,

Rogue Vector


sswift(Posted 2005) [#2]
Bumpmapping is putting a texture on a model where each texel's brightness defines the height of that texel.

The height of each texel is then used to perturb the lighting across the surface.

Normal mapping is putting a texture on a model where each texel's color is really three values that define the direction that location on the surface points.

A color of (255, 0, 0) for example, might mean that the surface at that location points down the positive X axis.

In other words, each texel is a normal.


The Dot3 name comes from what you actually do with these normals.

Let's say you have a vector which points in the direction your light source points. And let's say you have the vector which is the normal at a specific texel on your model that tells you which direction that texel points.

If you do a simple math equation called a "dot product" on these two normal vectors, like so:

Dot = N1x*N2x + N1y*N2y + N1z*N2z

Then the resulting value is a number which tells you how much those two vectors point in the same direction.

If the value is -1, then they point in opposite directions, which actually means that the texel is pointing at the light source, and the light source is pointing at the texel, so the texel should be lit.

If the value is 1, then they point in the same direction, which means the texel is pointing away from the light source.

And if the value is 0, then one of the vectors points at 90 degrees relative to the other. Ie: If you are standing on the ground looking forward, then your view vector is 90 degrees relative to the normal of the ground which points up.


OverDozing(Posted 2005) [#3]
Thx !