Single surface question

Blitz3D Forums/Blitz3D Programming/Single surface question

gburgess(Posted 2004) [#1]
I've noticed a lot of single-surface particle systems use nulls for the locations of the particles, and manually construct polygons each frame.

Would there be any serious issues with me using AddMesh to combine my particle meshes together, wiping them all then rebuilding again each frame? And would AddMesh automatically combine surfaces of the same name (or would I have losts of particles with different surfaces in the same mesh, defeating the point)? Would the alpha state of each particle be kept intact? (I'm guessing not).


jfk EO-11110(Posted 2004) [#2]
Copymesh does not make use of optimised Surface count. AddMEsh does. But AddMEsh requires to use only Mesh-Commands to rotate and position the meshes until you AddMEsh them together (So don't use PositionEntity or RotateEntity etc.). AddMesh is pretty useful since it will optimize Surface count automaticly.


N(Posted 2004) [#3]
I'd just add the meshes through your own procedures. That way there's a guarantee that it'll be single surface.


poopla(Posted 2004) [#4]
The only reason you should destroy/recreate polygons in a single surface system, every frame, is when you do Z sorting for alpha blending. Other then that, you should avoid it if possible.


sswift(Posted 2004) [#5]
You don't need to clear the polygons to do alpha sorting. You just need to swap which particles use which vertices. But then you have to reset the alpha, color, etc, even if they haven't changed for a particular particle. But I'm not sure there's even really a speed hit associated with that. And I'm not convinced there is a speed hit for clearing the polyogns from a mesh either. Blitz seems to update the whole mesh regardless of whetehr you change one vertex or all of them, so there may be no speed hit at all from clearing the polygons.


gburgess(Posted 2004) [#6]
Just to clarify, where I said copymesh in the original post, I meant AddMesh. Silly me. Fixed now.