Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: LIGHTING ATTENUATION problem...

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2001
    Location
    france
    Posts
    20

    LIGHTING ATTENUATION problem...

    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

  2. #2
    Member Regular Contributor
    Join Date
    Feb 2002
    Location
    Hamburg, Germany
    Posts
    415

    Re: LIGHTING ATTENUATION problem...

    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).]

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2001
    Location
    france
    Posts
    20

    Re: LIGHTING ATTENUATION problem...

    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...

  4. #4
    Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    391

    Re: LIGHTING ATTENUATION problem...

    are you tessalating your objects sufficiently, you might not see the results you want unless you do

  5. #5
    Member Regular Contributor
    Join Date
    Feb 2002
    Location
    Hamburg, Germany
    Posts
    415

    Re: LIGHTING ATTENUATION problem...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •