Sign in to follow this  
CoMaNdore

hw, omni lights ?

Recommended Posts

CoMaNdore    223
Hey I got gl ligtning question for ya all. What params do I have to set to create a onmi light with a limited distance of N ? I want to limit the size of the sphere of light that the omni light create.

Share this post


Link to post
Share on other sites
Forfaox    1217
use glLight() with a target of GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION or GL_QUADRATIC_ATTENUATION to set those attenuation constants. That should limit your light's influence.

Share this post


Link to post
Share on other sites
Coluna    314
Hello...i use this setup to do that
GLuint ind_light = GL_LIGHT0;

glLightf(ind_light, GL_CONSTANT_ATTENUATION, 0.f);
glLightf(ind_light, GL_LINEAR_ATTENUATION,0.f );
glLightf(ind_light, GL_QUADRATIC_ATTENUATION, 1 / radius_of_light);

hope it helps!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this