>I m a little confused about AddMeshToSurface.
>
>If I have 20 enemies on screen at once that are identical to each
>other,
>can I use AddMeshToSurface to speed up rendering?
>
>If thats the case, Im pretty unclear how I would do that with your
>code. any hints? Or, is this more for static objects, because they end
>up being tied to each other somehow?
You should only really combine meshes if you need to, and generally you
only need to for static objects. I would not recommend doing it for
enemies, unless you are doing something crazy and have a hundred onscreen
at once, and they're all low poly. Particles are an exception to the rule,
as there are generally tons of them, but you should use a custom particle
system for that as there's no sense in recreating triangles and you don't
need to copy normals and stuff.
And keep in mind that combining meshes removes the ability to do individual
collision detection on them. You could use a pivot as an "impostor" for
that though.
>Is it sort of like you could have 1 master entity with its mesh, and
>the
>other entities rather than having their own mesh, point to the master entity?
You have one mesh, and if your other entities are made from the same mesh
you'd just add as many copies of it as you need to the main mesh. But keep
in mind that meshes take up video ram, whereas copies of entities do
not. Copies of entities use just one copy of a mesh in video ram.
I recommend you only use addmesh to surface for combining things like trees
or buildings that are near eachother.
>
>If I have 20 enemies on screen at once that are identical to each
>other,
>can I use AddMeshToSurface to speed up rendering?
>
>If thats the case, Im pretty unclear how I would do that with your
>code. any hints? Or, is this more for static objects, because they end
>up being tied to each other somehow?
You should only really combine meshes if you need to, and generally you
only need to for static objects. I would not recommend doing it for
enemies, unless you are doing something crazy and have a hundred onscreen
at once, and they're all low poly. Particles are an exception to the rule,
as there are generally tons of them, but you should use a custom particle
system for that as there's no sense in recreating triangles and you don't
need to copy normals and stuff.
And keep in mind that combining meshes removes the ability to do individual
collision detection on them. You could use a pivot as an "impostor" for
that though.
>Is it sort of like you could have 1 master entity with its mesh, and
>the
>other entities rather than having their own mesh, point to the master entity?
You have one mesh, and if your other entities are made from the same mesh
you'd just add as many copies of it as you need to the main mesh. But keep
in mind that meshes take up video ram, whereas copies of entities do
not. Copies of entities use just one copy of a mesh in video ram.
I recommend you only use addmesh to surface for combining things like trees
or buildings that are near eachother.