LIGHTS ON/OFF

Blitz3D Forums/Blitz3D Programming/LIGHTS ON/OFF

Naughty Alien(Posted 2006) [#1]
Hidenetity Light will turn light OFF and Showentity Light will turn ON light source?? Or is there any other approach?

What in case light range is set to zero? Is that mean light source is automatically OFF? I'm creating system for huge number of supported lights, so Im wondering about fastest way to turn on/off light source..


DJWoodgate(Posted 2006) [#2]
IF you have a huge number of lights, the speed of turning them on off may be the least of your concerns. Each one impacts performance. Lightrange has no effect at all on directional lights which have infinite range. You could set lightcolor to 0 but this has no effect on the specular component.

Ideally DX would select the 8 (or 16) most significant lights and ignore the rest. However this does not seem to be how it works here. The first 8 (or 16) lights created are used to light the scene. The only way to get other lights to be used is to use HideEntity and ShowEntity as you suggest.

Blitz does not provide an easy way of telling how many lights are actually supported though so you will have to assume 8 as the maximum unless you include a test render as part of your application.

To get more lights than the maximum to contribute to a scene you will have to multipass render.


Naughty Alien(Posted 2006) [#3]
DJ, thats ok..I'm building system for automatic switch on/ off lights in the closest area for player(max 3 lights on)...I'm just interesting what command will turn on/of lights .. and how many different ways for that we have..hideentity or similar...


DJWoodgate(Posted 2006) [#4]
Hidentity/Showentity is the only way I know of. You can optimise this by having the lights you want to hide parented to a pivot that is hidden. That way blitz will not have to consider them at all when it renders the scene. Probably only a small speed up mind you.