Spotlights

Hi everyone! :slight_smile:
Thanks for always answering newbie’s questions like mine so fast and so well! I hope you all had a great weekend! :slight_smile:

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 :frowning: ), 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! :smiley: haha )

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

Thank you so much! :wink:

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.

Hi! Thanks for your reply :slight_smile:

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!!!

Thanks!

http://www.r3.nu/

http://developer.nvidia.com/object/Projective_Texture_Mapping.html

http://www.nps.navy.mil/cs/sullivan/MV4470/resources/shadow_mapping.doc

http://www1.cs.columbia.edu/~ravir/6160/papers/shadow_mapping.pdf