Single Surface?

Blitz3D Forums/Blitz3D Programming/Single Surface?

Rage_Matrix(Posted 2004) [#1]
I keep reading about single surface particle systems and single surface this-and-that. Someone want to explain to me what this is all about?

Sorry for it being such a generalised question. :)


poopla(Posted 2004) [#2]
Well, a surface houses a texture in a mesh. The more you have, the slower things will run. So what this single surface jargon is about, it the effort to combine as many mesh's with the same texture into one surface. In the case of the single surface particle system, you are sharing a texture/surface among many particles(quads), rather then each particle having it's own surface.


Gabriel(Posted 2004) [#3]
For some reason, which appears to be specific to Blitz ( at least there are many similar languages/API's which do not exhibit this behaviour ) there is a pause when going from rendering triangles with one set of material properties ( texture, etc ) to triangles which use a different set.

At first it's not really noticeable and you usually don't notice the difference between 10 surfaces and 20 surfaces. But beyond a certain threshold ( which will vary wildly between cards ) each new surface really starts hitting your speed. General concensus seems to be that you shouldn't go beyond 100 surfaces at a time, and the lower the better.

So if you've got a particle effect on screen which displays 250 particles, you've got 250 potential surfaces from that alone. Now usually Blitz will auto-manage these things if you use CopyEntity or CopyMesh ( can't remember which.. entity I think ) but it doesn't seem completely reliable.

So to be sure you know how many surfaces are being used, you go over to a single surface system and ensure you have no more than you need. I haven't tried them ( I have my own which do all I need for the time being ) but Rob's single surface particle and entity systems seem like a good starting point. You can always modify them to suit your needs if there's something specific you need later.


Rage_Matrix(Posted 2004) [#4]
Okay...thanks guys. :)


Rob(Posted 2004) [#5]
surfaces are really a blitz specific invention! it's a way for mark to keep things organised.

whats happening is a state change, and while blitz attempts to group these at renderworld, you can minimise how many hiccups the graphics card gets.

keeping it well oiled is the key to speed