Culling offscreen meshes

Blitz3D Forums/Blitz3D Programming/Culling offscreen meshes

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Holy crap!

I was looking at my render statistics, and noticed something funny. Here I am looking straight up at the sky, with no meshes directly in view. According to the stats, there are 61 meshes directly around me, but few polygons are being rendered:

61 staticmeshes
240 polygons
16 msecs

Look at the staticmesh render time! 16 msecs to render a couple hundred polys!!! That is slow as hell.



Now I lower the camera. Look at the stats. 8000 polys are drawn in a couple msecs more than it took to not render them in the previous shot.


61 staticmeshes
7905 polygons
18 msecs

What is happening? I am assuming the slowdown from the first shot was from checking every triangle in the surface to see if it was in the camera view frustum. This process must be so slow, that it is almost as slow as just rendering the mesh! I can do a box render test that's a million times faster than this. There needs to be a brushfx flag that forces a render if a mesh is shown. The per-triangle surface check is totally self-defeating. As the above shots show, it takes about as long to NOT render something in Blitz as it does to just draw it! Probably another reason multiple surfaces are so slow.