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

Thread: Scene lights reset

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    595

    Scene lights reset

    I've read confusing posts on the web, claiming that light parameters, set with e.g. glLightfv() need to be refreshed (set again), each frame. Is this accurate? Also, if I switch lighting off or a light off and then back on will the light parameters still be there?

    Are there any cases where light parameters need to be refreshed?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    941

    Re: Scene lights reset

    Light parameters do not need to be refreshed except the position.
    I haven't used built-in OpenGL lights for about a decade now but as I remember light positions are not transformed by the modelview matrix on each frame but only applies the current modelview matrix to the light position when glLight* is called for specifying the position.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    595

    Re: Scene lights reset

    Thanks, so this is something for a modelview_matrix_change() handler. Good point.

Posting Permissions

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