PDA

View Full Version : fixed function normal mapping



supagu
10-10-2004, 02:59 AM
been looking at some fixed function normal mapping tutorials, and they all manually calculate a vector from the vertex to the light, to get a tangent space light vector, im wondering if than can be achived with some form of texture matrix? ie. do i dont have to manually update each vertex as im trying to use vertex buffers in my engine and dont want to end up becomming CPU bound.

CrazyButcher
10-10-2004, 11:02 PM
dont think it can be done via texmatrix cause its individual to each vertex.
if you really want to unload CPU use a VertexProgram, while leaving fixed function there, it is very well supported on most drivers (on old cards it will be emulated by cpu)

jwatte
10-11-2004, 11:25 AM
You can approximate the light with a direction per-object, then you can use the fixed function. Just put the light direction into the texture environment color. You could even bake (per-object) attennuation into the "length" of that direction vector.