-
Light source on random position in the world
Examples i have seen so far are always about lighting one object, when i tried to apply this on a terrain generator example, things were changed. I am setting a position for light, applying attenuation, calculating things but light source is like following me. Calculations are done according to the light position and gl_vertex position. but i'm like the light source. Can you share glsl lighting examples that contains some wide area instead of lighting one object ?
-
Senior Member
OpenGL Guru
Look at the MODELVIEW active when you register the light source position and direction. That positions the light source.
-
i think the problem was about w coordinate of light. i have just set it to 1.0 and it seems to be static now :P
edit: yep it works great. i dont know why w fixed it
Last edited by artariel; 06-29-2012 at 08:40 PM.
-
Senior Member
OpenGL Guru
w=0 is a vector (directional light source). w=1 is a position (point light source).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules