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 2 of 2

Thread: ppl attenuation on 3 axis

  1. #1
    Intern Newbie
    Join Date
    Mar 2004
    Location
    Craiova,Dolj,Romania
    Posts
    40

    ppl attenuation on 3 axis

    Attenuation doesn`t work if brightness is different on one of the 3 axis.

    I use
    texCoords.x = lightVector.x/(light->brightness.x * 8) + 0.5f;
    texCoords.y = lightVector.y/(light->brightness.y * 2) + 0.5f;
    texCoords.z = lightVector.z/(light->brightness.z * 2) + 0.5f;

    where lightVector is the tangent space vector of the light ( non tangent light vec = ligh.origin - vertex )

    Now if x isn`t equal to y and z the attenuation is not correct, what is wrong ?

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,971

    Re: ppl attenuation on 3 axis

    You don't attenuate light by changing the length of the light vector.

    You use attenuation as a factor to modulate either the light illumination or the final dot product.

Posting Permissions

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