Light shapes

Is there an easy way to have say an elliptical spot light? I.e. I’d like to apply something like a non uniform scale to the light. Thanks for any help.

You could use a cubemap. On one of the cubemap faces have your ellipse image, going from black in the center to white on the edges. Then using either a vertex program or the texture matrix, rotate the cubemap so that this ellipse is facing in the direction of the light. A good source to look at would be Ron Frazier’s advanced perpixel lighting demo. It’s on nvidia’s dev site.


You can use shadow volumes and reverse the effect of the lamp and use it as a spot volume instead. This way you can easily set up the shape of your lamp.

u could use a projected texture, see the redbook/glut for examples

Shadow volumes won’t work because they don’t have diffuse edges.

Cube maps won’t work, either in NORMAL_MAP mode or REFLECTION_MAP mode, because they don’t properly factor in the locality of a spot light.

Projected texturing is the correct solution, although you probably want to somehow make sure you don’t draw it on triangles that face away from the light – a projected texture coupled with a shadow volume or depth shadow map would be the “ideal” solution.