I’m generating a new mesh each frame, but the mesh may not have the same number of triangles from frame to frame. Since I don’t want to allocate a brand new triangle array each frame, I just set the unused triangle indices to zero, effectively drawing zero-size triangles. This seems to work fine but are there any known problems with this approach - e.g. could it cause problems with certain graphic cards/drivers?
Not that I know of. You can also call Mesh.Optimize() which will remove such superfluous sets of data. But this would just cost you extra performance since the next frame you create a new mesh anyway.
1 Like
The vertex shader would still be processed for their vertices, but if two vertices of a triangle have the same position the triangle is killed before being sent further down the pipeline, AFAIK.
2 Likes