How Do I keep the Framerate High?

Blitz3D Forums/Blitz3D Beginners Area/How Do I keep the Framerate High?

Hotshot2005(Posted 2008) [#1]
Hiya all,

I have made the terrain and 1,000 3D Tree Models(there are two different trees in there). I am please that the FPS is 75FPS but when I move ..the FPS drop to 37FPS.

My questions is if I put shorter camera range, would the FPS keep to 75FPS?

I put the camera range to see everythings on the screen which why the FPS drop to 37FPS when I move.

Had anyone got good tips to keep FPS high as possible.

cheers


kragoth74(Posted 2008) [#2]
- Try shortening the camera range and using some fog to cover the clipping, or use EntityAutoFade to hide the trees at some distance.
- Reduce the number of polys per tree, or even use sprites.


SLotman(Posted 2008) [#3]
Also, use LOD - the more distant trees can have less polygons, can be turned into billboards (sprites), etc - since they are so far away you won´t see them detailed anyway. Just make an "EntityVisible" to see if the tree is on screen, then an "EntityDistance" and swap the meshes accordinly to how far they are from the camera.

Also, dont do that every loop, just once every xxx millisecs, or otherwise it may slow down even more your game, instead of speeding it up.


Stevie G(Posted 2008) [#4]
Instead of entityvisible and entitydistance you could also do ...

tformpoint entityx(tree), entityy(tree), entityz(tree), 0, camera

and check the returned tformedz() ( assuming >0 ) to see how far in front of the camera the tree is for lod / hiding. It may be a bit faster than a combination of the other two.

Stevie


Beaker(Posted 2008) [#5]
Alternatively, combine nearby tree meshes into clusters of about 10 trees per cluster, should help a little.


chwaga(Posted 2008) [#6]
I suggest you use camera fog, reduce the tree polycount, and if you don't want fog, put in a basic LOD manager for the trees (if the camera gets far enough from the trees, replace them with sprites).