View Full Version : Light source equals the place that we see

03-29-2011, 02:03 PM
I was trying to play with the light source of my OpenGL project in order to make a DIFFUSE REFLECTION light that its light source would be from the place that we are currently looking at on the screen..
if anyone could help me do so or point me to a good tutorial i will be very thankful

Thanks a lot :)

03-29-2011, 06:14 PM
How are you planning to implement lighting in your program? Using the fixed openGL pipeline or shaders?

It is two different ways of doing the same thing but the fixed pipeline has been deprecated some time now.

If you are interested in the fixed pipeline the 6th Chapter of the Red Book (http://fly.cc.fer.hr/~unreal/theredbook/chapter06.html) will be sufficient for you. But bear in mind that all this has been deprecated and it is a VERY old way of doing things.

To see some good tutorial on GLSL shaders which will accomplish that effect I recommend the Lighthouse GLSL lighting tutorials (http://www.lighthouse3d.com/opengl/glsl/index.php/index.php?ogldir1) .

Hope that helps