Jump to content
  • Advertisement
Sign in to follow this  
Kitasia

Light Radius

This topic is 4789 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!