PDA

View Full Version : Implementing torch-like light



marchesedelgrillo
03-31-2008, 04:30 AM
Hi guys,
I thank you in advance for any help you'll give me.

I have a little problem implementing a light that simulates a torch on camera. The problem is that the torch doesn't illuminate the floor, but illuminates in the right way the other objects in the scene (a cube, some textured walls etc.). I think that the problem is that the floor is too big and the vertex are too far from each others. Can this be possible? If it is like this how can i do to solve this stuff?

Sorry for my english. ;)

Relic
03-31-2008, 05:24 AM
Yes, if you light per vertex, that would be the case.
The solution would be to either tesselate higher or light in fragment space.
Flash lights and the like in games are normally done with a projected texture map. Here's a link on the theory:
http://developer.nvidia.com/object/Projective_Texture_Mapping.html

GeForce
03-31-2008, 05:27 AM
Hi, I think you might be trying to attach spotlight by vertex shader. Try to implement using fragment shader.

marchesedelgrillo
04-01-2008, 09:40 AM
Thank you guys for your help!