sceneMgr->sortLights(false) ;

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1869
Joined: Sun Mar 08, 2009 5:25 am
x 19

sceneMgr->sortLights(false) ;

Post by mkultra333 » Thu Aug 13, 2009 5:25 pm

I'd like a function that turns off sorting lights. I don't need it, it gets in the way. Something like sceneMgr->sortLights(false) ; would be ideal.

I've gotten around it using sortLightsAffectingFrustum (see http://www.ogre3d.org/forums/viewtopic.php?f=2&t=51901). Setting up the listener and stuff seems a bit too much work to disable such a simple thing, but it looks as if it is working. My version looks like this:

Code: Select all

      bool sortLightsAffectingFrustum(LightList & lightList )
      {
         return true ;         
      }
This seems to disable sorting and leaves the lights in the oder I created them (which is what I want, I exercise lots of control over the lights on more than a frame by frame basis and my shaders are sensitive to which light is which.) However the api (http://www.ogre3d.org/docs/api/html/cla ... b8aa819494) doesn't confirm that the light order won't be modified, so I don't know if I can absolutely rely on this behaviour.

If I use the above sortLightsAffectingFrustum function, can I rely on it not changing the order of my lights?
0 x
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.

Post Reply