create new mesh, rebuild mesh or deform mesh?

Blitz3D Forums/Blitz3D Programming/create new mesh, rebuild mesh or deform mesh?

Andy(Posted 2005) [#1]
Which is faster?

1) to delete the mesh, create a new mesh+surface+vertices+triangles.

2) to clearsurface the mesh and then add vertices+triangles

3) to simply deform the current mesh using VertexCoords


Andy


Ross C(Posted 2005) [#2]
I think number 3 is the fastest in general. Deforming a very high vertex count mesh, i'm not sure, but for everything else, option 3. Rebuilding a mesh is quite slow.


Andy(Posted 2005) [#3]
>Deforming a very high vertex count mesh, i'm not sure, but
>for everything else, option 3. Rebuilding a mesh is quite
>slow.

It will be a single surface hi-poly mesh... I'm not sure how many poly's though!

Andy


Beaker(Posted 2005) [#4]
It will turn out at pretty similar speeds, but 2 is probably the quickest.

NB. They all have to re-upload ALL the data to the gfx card, which is the real bottleneck.


Ross C(Posted 2005) [#5]
I think you'll find that number 1 is actually pretty slow, in blitz anyway, i don't know much about the tech side of that. I mind a couple of people creating single surface particle systems, who were rebuilding their mesh every frame, and it was slooow.


DH(Posted 2005) [#6]
I rebuild the mesh in my cloud system, my particle system, and my grass system and it is the best way I found to do what I needed to.

It all depends on what your doing.

If you're re-mapping a terrain (height and what not), it's easier to just deform.

If your resorting for Alpha, easier to rebuild (cause the calculations are going to kill you on the deform).

If your changing UVs or Normals, easier to deform

If your emulating sprites in a particle situation, easier to do both deforming and rebuilding.

What is the case in which you need? What are you doing with the mesh, and why do you need to change it is the question!