View Full Version : Spotlights

02-01-2006, 05:52 PM
Hi everyone! :)
Thanks for always answering newbie's questions like mine so fast and so well! I hope you all had a great weekend! :)

Let's see if someone can help on this one:
I got a great big floor with dozens of chairs and sets of tables, and I have tesellated the floor plane, and I have placed a single source light: a spotlight.

However, even though I have tesellated the floor doing like 7 iterations (consisting of a file of 10 mb for a lame floor that doesnt even cover my whole room :( ), I still get a spotlight light that looks like a circle cutted with a broken scissor by a 2 year-old child who cuts while travelling in a car. (well almost that awful! :D haha )

Is there an intelligent way for getting a better looking rounder spotlight circle? :)

Thank you so much! ;)

02-02-2006, 12:47 PM
Yes there is a better way.

Your current code does a vertex based spotlight giving you a change in lighting only at each vertex and making things slightly worse the OpenGL spotlight cone has no soft edge, just an overall exponent and a sharp cutoff.

What you need to do is use projective texture spotlights where you use texgen, a projective matrix on the texture matrix stack to define the cone of projection and an texture image of the light falloff accross the spotlight.

02-03-2006, 08:32 AM
Hi! Thanks for your reply :)

However, the last line seems a bit like chinese to me... Could you explain it in more detail please? Or send me a link to a page that explains it?

...Are you telling me that you can impose a texture to the projection of the light source?!?!


02-06-2006, 10:15 AM