How to do really fast EntityVisible commands

Blitz3D Forums/Blitz3D Programming/How to do really fast EntityVisible commands

I tried randomly placing 30 lens flares in the stratus map, which each do one visibility check per loop. I got 2FPS. Then I tried checking just the level, without the static meshes, and it was very fast.

I wrote a fastentityvisible() function that first checks just the level. If the entities are occluded, you know you can return false.

Then it goes through each static mesh and checks visibility with the mesh's box. If the box of the mesh occludes the entities, then it checks against the mesh's actual polygons.

This allowed me to run 30 flares at the maximum framerate, in a pretty high-poly map.


This will included in the public code I release.