#Removing Faces From An Array Mesh

10 messages · Page 1 of 1 (latest)

frank sequoia
#

i’m writing a plugin that lets the user edit mesh data (verts and faces), and one of the features i want to add is the ability to remove faces from a mesh. what’s the best way to do this? is this kind of culling even necessary on modern computers?

jovial wind
#

It depends on how many faces there are, and also what is causing a mesh to be expensive. Backface culling is automatic and will hide all triangles facing away from the camera in any case.

#

If there aren't many triangles, it isn't even worth it.

#

Also, vertex and triangle count isn't the only thing which can make a mesh expensive. Fill rate (due to the complexity of the shader), transparency and overdraw can have an impact as well.

#

Relatedly, voxel engines like Minecraft's will avoid generating internal faces whenever possible, because you can't see them (except where there's transparency) and it would greatly increase the amount of data being stored in the meshes if every internal face were represented.

jovial wind
#

Oh, definitely not worth it, then.

#

If you want to add face removal, you pretty much have to rebuild the mesh without it.

#

There is another approach, which is appropriate for runtime alterations of meshes, and that is to collapse faces by putting all their vertices at the same point in space.

#

That's helpful at runtime because you don't have to change the number of vertices (and thus all the vertex arrays) on the fly.