Hide/Show optimization

Blitz3D Forums/Blitz3D Programming/Hide/Show optimization

Craig H. Nisbet(Posted 2003) [#1]
Hi all.

I'm wondering. would there be a speed increase in a Blitz 3D game that is programmed to tell the meshs that are not in view to hide when not in view, and vice versa. Or does the hardware, or Blitz, take care of this "culling" for you?


jfk EO-11110(Posted 2003) [#2]
From what I heared there is a small speed increase, but this might be due to the Collison that is skipped. But note: when you walk backward and Things in your back are hidden then Collisions don't work...


Techlord(Posted 2003) [#3]
Craig,

No hardware occlusion. I highly recommend implementing some form of occlusion to hide meshes not in view. I would also recommend implementing some form Level Of Detail to display mesh with reduce poly counts further from the camera. Combined these optimizations will allow you display more details maintaining high performance.

Collision can get tricky when playing with these techniques. Collision management will be important when implementing these techniques.


Rob(Posted 2003) [#4]
I recommend a large collision proxy mesh. Not only does this allow you to collide easier with stairs (they are ramps!) it can also be lower poly. There's many benefits.

Don't be too afraid of the polygon counts of sphere-> poly since it is fairly optimised in blitz to local tris I think... which is why it's bog slow when you are near too many triangles at once with a large radius.


Neo Genesis10(Posted 2003) [#5]
Just a thought, but wouldnt the actual routine to check whether or not something is visible take up more cycles than Blitz's native routines drawing it in? You would have to use your own method, presumably as EntityInView is far too slow.


Boiled Sweets(Posted 2003) [#6]
[quote] Just a thought, but wouldnt the actual routine to check whether or not something is visible take up more cycles than Blitz's native routines drawing it in? You would have to use your own method, presumably as EntityInView is far too slow. [\unquote]

I agree, I setup a function to read thru my entities and work whether they are near the camera using entitydistance(), if they are a certain distance away then I hide them else I show them. I call this rountine every 50th times round my game loop. Also I setup comaera fog so that they disappear into the fog. Using this my FPS has gone from 10 to 50 and it works and looks great.


Craig H. Nisbet(Posted 2003) [#7]
Yeah, I'd been working on an Octree space partitioning system to do figure this out. I was sure if I was wasting my time do to a feature that was already in Blitz.


poopla(Posted 2003) [#8]
Rob's on the right track. Plasma will be using proxy mesh's for collisions, I believe this is how unreal 2's engine works. It's the higher polygon detail meshes contained withing the proxy collision mesh's that I will hide. The lower polygon count on world geometry should also help increase speed significantly as it keeps the number of possible collision planes that have to be checked down. At least that's the idea in theory :].


Craig H. Nisbet(Posted 2003) [#9]
How do you define a lower poly collision mesh to an entity?


jfk EO-11110(Posted 2003) [#10]
Turn off Collision of the original Mesh and use a Lowpoly Meshs Collision with EntityAlpha 0.0


Ice9(Posted 2003) [#11]
Yes I hide all meshes outside the viewing area and turn collision off on all meshes that are not in the immediate area of the player controlled mesh. both of those give me a very noticable optimization


FlameDuck(Posted 2003) [#12]
You know Blitz already does View Frustrum culling. It does this on an Entity level, that is only entities within the view frustrum are draw. This means that entities that are behind a camera, or "out-of-range" of the camera aren't rendered. Sub-dividing your level mesh intelligently is in my experience alot more effective than custom occlusion routines.


Ice9(Posted 2003) [#13]
I think even though entities can't be seen there is still some processing going on for those entitities. Hiding the entities out of range seems to take it completely out of that pipeline and if you are dealing with hundreds of entitities that's where you will see the difference. I do know that entities that are not hidden are still considered in collision.


Beaker(Posted 2003) [#14]
You only need to look at the simple portal example that comes with Quill3D to see the potential speed gain from Hiding stuff.