View Full Version : Spotlights and vertex programs

Roman Grigoriev
03-23-2003, 09:44 PM
Hi guys!
I found tons of point light per-pixel attenuation samples that use vertex programs but can find any examples that simulate spotlights in vertex programs. I'm not expirienced in opengl math so maybe someone did it. If someone knows where can I find code please answer me
Thanx in advance

03-24-2003, 12:24 AM
Dot product the vertex pos and your spotlight matrix.

DP4 outTexture.x, mtx[0], inPosition;
DP4 outTexture.y, mtx[1], inPosition;
DP4 outTexture.z, mtx[2], inPosition;
DP4 outTexture.w, mtx[3], inPosition;


Roman Grigoriev
03-24-2003, 12:47 AM
Could you please give me source code
and shader?