Page 1 of 1

sceneMgr->sortLights(false) ;

Posted: Thu Aug 13, 2009 5:25 pm
by mkultra333
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 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 ( ... 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?