Do hidden polys affect framerate

Blitz3D Forums/Blitz3D Beginners Area/Do hidden polys affect framerate

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.

The sort answer is YES.

If you are looking at a solid wall, but there is a staircase behind it the camera can see it just fine, and it is drawing it, but you can't see it, because you only get to see the finished scene.

When polygons are drawn, the distance to each pixel is compared to the pixel in the zbuffer at that position. If there is no pixel, or if the pixel there is farther away than the pixel you're triyng to draw, then a new distance is saved for that pixel, and the pixel color overwrites the old pixel color there.

So, the stairs get drawn, and then the wall is drawn over them. So they're invisible to you, bu tthe camera had to draw them anyway.

Even if the stairs get drawn last, the camera still has to compare them to the zbuffer, so they'll still slow things down.

Therefore you can speed things up greatly if you can figure out which parts of your level can safely be hidden. I would do this by making each room a seperate entity, and then for each room making a list of all other rooms which can be seen from that room. Then you can hide all rooms that are not potentially visible.

(You would want to figure out which room a player is in by creating bounding boxes and figuring out which bounding box the camera is in.)


Also, even if the polygons aren't on the screen, Blitz may still attempt to draw them if they are in front of the camera. I don't know exactly what it does, but I do know that if you create a large 2D-like plain of entities in a grid pattern and you can only see one of them, others will also get drawn even if they are off the screen. I made a 3D starfield that used this technique, and I found that it was much faster if I actually told Blitz which entities to show than if I just let it try to figure it out on it's own.


So you should definitely try to hide stuff you know isn't visible from a particular location, even if you think the camera can't see it.