PDA

View Full Version : Spotlights



Rodrix
02-01-2006, 06: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! ;)

dorbie
02-02-2006, 01: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.

Rodrix
02-03-2006, 09: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?!?!

Thanks!

dorbie
02-06-2006, 11:15 AM
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