PDA

View Full Version : LIGHTING ATTENUATION problem...



nullspace
05-28-2002, 10:56 AM
Hello,
i'm making a 3D scene, with a light at the center.
Given that i want a "nice light" (sorry for my poor english i'm french) i use the LIGHT_ATTENUATION function but it doesn't works !!

I tried 0.000001 and 9999999999999 for the paramater, i always have the same result.

And obviously, it's a positional light.
Can someone help me?

Thank you.

nb : I suppose it's not an advanced problem but it's very hard for me to understand where is the problem !!
nullspace@vraifauxrum.com

Richard sancenot

AdrianD
05-28-2002, 11:06 AM
try this one:

glEnable(GL_LIGHT0);
glLightf(GL_LIGHT0, GL_QUADRIC_ATTENUATION,1.0f/radius);

the "radius" variable does not directly correspond to the radius of your attenuation. but use it as a hint: bigger values in this var gives a bigger attenuation radius.
hope this helps you.


[This message has been edited by AdrianD (edited 05-28-2002).]

nullspace
05-28-2002, 01:09 PM
Thank you for replying.

It doesn't change something, i set all the values i imagined without viewing any change.

If someone have an easy sample that shows that effect, it would be cool for me.

NB : i have a Voodoo4 and my part of code is :

glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
GL_QUADRATIC_ATTENUATION, (GLfloat)1.0f/100000.0f);

if you have any idea...

chowe6685
05-28-2002, 04:45 PM
are you tessalating your objects sufficiently, you might not see the results you want unless you do

AdrianD
05-29-2002, 04:11 AM
just use this:
http://www.opengl.org/developers/code/samplecode.html