Sign in to follow this  
AntiGuy

Light Radius

Recommended Posts

AntiGuy    267
Does anyone know a good method of establishing the radius of the light source? There doesn't seem to be a function for it. I thought of using glScalef but the result's a bit funny. Any ideas? Thanks in advance!

Share this post


Link to post
Share on other sites
AntiGuy    267
Okay I know this might sound weird but I solved the problem! The light radius is made by how far away from 0 it is. I just have to translate it instead of giving it a world position! Okay maybe that doesn't sound weird but it did to me at first. Case closed! [smile]

Share this post


Link to post
Share on other sites
AntiGuy    267
I should probably make sure things work before I say I have them figured out. It seems translation doesn't work with glLightfv. Any suggestions? I'm beginning to think normals are the issue but that still wouldn't explain how a radius is done.

Share this post


Link to post
Share on other sites
duke    107
You need to to set the attenuation factors for the light. This will give it a radius (assuming it is a point light)

Share this post


Link to post
Share on other sites
AntiGuy    267
But 1 last thing so I can stop making so many posts.[grin] Could I get a bit of help setting up an omni light? It seems that it must point 1 direction when it's away from the matrix and my normals are just outlandish. Is it even possible to do normals with quad planes?

Share this post


Link to post
Share on other sites
zedzeek    529
due to the forumla used for light calculation (check the spec)
for all lights the radius is always infinite
ie a vertex far away from the light may get 0.0000001

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