Performance tips?

BlitzMax Forums/MiniB3D Module/Performance tips?

Kryzon(Posted 2010) [#1]
Hello,

I'd like to ask a few questions regarding the way MiniB3D handles the rendering (and management) of things.
Coming from a Blitz3D background, you're prone to find some tricks you can use to boost things up and optimize the gameplay, like using Single-Surface meshes and separating levels into multiple hierarchical "sectors", so as to display only those possibly visible to the user.
Since my OpenGL knowledge is close to zero, I'm not sure if the same techniques apply in MiniB3D also.

With that in mind, and judging by MB3D's source code...

1) Do single-surface meshes improve performance with MB3D as well?

2) What would be the best way to treat really huge levels with MiniB3D?

3) Is MB3D's LinePick faster than B3D's? if not, is there a way to improve it?

Any other game-related general performance tips you have in your mind, please don't hesitate to share.

Thanks!


Dreamora(Posted 2010) [#2]
1) They do it with any engine, because single surface means no requirement to rebind textures (or in modern engines much more impacting: rebind shaders)

2) Same as with blitz3d: Split the level into usefull chunks so only the chunks within the view frustum are rendered.
That naturally if you don't implement an own PVS system for indoor / oct tree with PVS for outdoor / general to enhance the chunk rendering over the "full view frustum" approach

3) Its impossible to really compare them because pure math in bm is significantly faster than in Blitz3D so hard to say if the linepick function itself is faster. But I would assume that dedicated physics / collision solutions that generate spatial trees etc from your models might be even faster. But the effort just for this single feature would be totally out of scale.
Do you technically really need it? if not I would recommend to leave that point out until you know that linepick is your main bottleneck.


Generally MiniB3D already has the potential be significantly faster, just because the hardware acceleration of opengl is much better than back in the good old DX7 days. max 2d benchmarks of the glmax2d vs d3d7max2d should give you an idea on that.

Coming from Blitz3D, you just need to refine your skills in BM enough to stop using the Blitz3D thinking, otherwise you will bury the performance just due to working actively against BM (strict - superstrict are a good start against that)


Kryzon(Posted 2010) [#3]
Great post, thanks.

If anybody has any more tips, please do share.


kfprimm(Posted 2010) [#4]
MiniB3D uses the exact same picking code (written in C++, by the way) as Blitz3D so the performance SHOULD be the same.