Maximum Lights/Destroying Lights

Blitz3D Forums/Blitz3D Programming/Maximum Lights/Destroying Lights

John Blackledge(Posted 2003) [#1]
Maybe only Mark can answer this, maybe someone else.
If most cards can only guarantee up to 8 lights I'd like to (a)move (b)not use (c)reconfigure some of my lights as I move from one 'sector' to another.
Question 1: If 8 lights exist but 5 are switched off (rgb 0,0,0) then is Blitz still calculating each pixel against every on of the eight lights?
Question 2: (Based on the above) if so, what is the bast way of stopping this? - FreeEntity on the unneeded lights?


fredborg(Posted 2003) [#2]
1: Yes!
2: HideEntity

Fredborg


John Blackledge(Posted 2003) [#3]
That sounds great, and basically very easy to implement.
But before I scrap a 100 lines of code for a rewrite, dare I ask err... are you sure that HideEntity on a light will stop Mark calculating using that light???
Cheers and thanks for the help.


fredborg(Posted 2003) [#4]
Yup, I'm pretty sure about that :)

Fredborg


John Blackledge(Posted 2003) [#5]
Thanks, Fred.


Warren(Posted 2003) [#6]
Why not just add a bright light to the scene, hide it and see what happens? :)


smilertoo(Posted 2003) [#7]
Geforce4 claimed 8 lights but i noticed a performance hit after 5.


Mustang(Posted 2003) [#8]
Geforce4 claimed 8 lights but i noticed a performance hit after 5.


8 is DX MAX... using 5 lights is overkill, you should never use more than 2-3 active real-time lights at the same time (if you want reasonable fps).


Shambler(Posted 2003) [#9]
After running a test it seems Blitz lets you create as many lights as you want!

After you reach your graphics cards limit though, the call to createlight() still keeps returning an entity id number ( i.e. not '0' ) and lets you set the properties/colour/position etc of these non existant lights.

8 lights is the most I am aware of any graphics card supporting but since createlight() never fails there is no way you can test in your program.

To be precise the DX limit is dependant on your graphics card, and the limit is only on the number of active lights so you can create many lights but make sure you stick to the limit of how many can be on at once.

But as Mustang says, every hardware light you use is a light too many =)

Try using static/dynamic lightmapping and just 1 or 2 hardware lights.


John Blackledge(Posted 2003) [#10]
"After running a test it seems Blitz lets you create as many lights as you want!"

- Yup. Copy that. I guess it's better than a crash, but a bit confusing to a newbie.

"every hardware light you use is a light too many =) "
- I hear you. But I need flaming torches, at least 4 in one scene. So hiding/showing will be done, and I'll use as few as possible otherwise.

Thanks all for the comments. As usual you've saved me days of testing. Cheers.