terraed and culling

Blitz3D Forums/Blitz3D Programming/terraed and culling

ryan scott(Posted 2004) [#1]
i'm using terraed, and it's difficult to get ahold of objects handles unless you turn culling off... well in the code it seems like the culling routines are not using ShowEntity and HideEntity but instead, when it culls it uses FreeEntity, then when it has to show it, it recreates it using CopyMesh and a bunch of other stuff to put it back. This method of course is destroying entities, so you can't rely on them being there. makes coding much harder.

So my question is really about culling in general -

why would you do it the way terraed does instead of just using HideEntity and ShowEntity?


Filax(Posted 2004) [#2]
Blitz have FPS problem with entity number, many entity in scene cause
fps lag ! and Hide Entity/Show Entity don't resolve this problem.


John Blackledge(Posted 2004) [#3]
Filax, sorry but you're wrong.
HideEntity/ShowEntity methods show a massive increase in fps.


aCiD2(Posted 2004) [#4]
Yes, you are wrong, my fps system culls terrain segments, along with entities on them, and looking at the sky gives on emega fps increase :P


Filax(Posted 2004) [#5]
Yes ShowEntity and Hide entity resolve a little bit the FPS but
freeentity is better, because blitz don't work with many entity.

I have made some many test. Believe me :)


aCiD2(Posted 2004) [#6]
Filax: would you mind showing us a test where this comes into effect? I've just tryed, and recreating an entity when in view is slower on my system - which is old.


ryan scott(Posted 2004) [#7]
it seems to me that running through all objects and doing copymesh all the time is going to be slower, but i don't know...

but more importantly the code the programmer has to use to get around the fact that the entities don't exist unless they are in full view is a huge pain in the butt.


Filax(Posted 2004) [#8]
Coding with this method is not very difficult :) look on the
3dgametool.com forum, you will find tips and help for use it :)


SabataRH(Posted 2004) [#9]
Filax is reffering to the mysterious blitz3d object pool.
A game with many many entites, regardless if they are shown or hidden, will run slow.

Removing the entities from the entity pool will increase preformace drastically.

I've only really noticed this method as being useful if the entity count is well into the 10k's, but i'm certain it's PC specific as some comps cap at a much larger number ...


Eole(Posted 2004) [#10]
This methode is very usefull, it's me who write this algo, for trium III, you can add some good optimisation by calculate the 2D angle between the entity and the camera ... that you can choose in witch angle an entity is visible (never forget to test an circle arround the player, or when you go back the collission not work)

But there is one big probleme, when you test if an entity is visible to know is must replace it by the original, sometime the test with the sprite return false but if he was the real 3d model the camera can see it.

In my Terrain Demo with 2000 Tree of 450 Poly, I use this algo + child system, When you hide an entity all his child are hide (you find find the source code of tis system in this forum)

The demo of the complete occuling system
http://www.blitzbasic.com/Community/posts.php?topic=33472

Source code of the terrain system
http://www.blitzbasic.com/Community/posts.php?topic=34155


Eole(Posted 2004) [#11]
An other example of this culling system with my terrain system

http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=seyhajin07122004191942&comments=no

This example is write by seyhajin


Filax(Posted 2004) [#12]
Mais oui tinkiet pas on le sait :)