what's funtion of eliminate "degenerate triangle"

I’m not familiar with geometry mathematics,so I post the question to get help,my question is : Can I eliminate the code in a 3D Engine that eliminate degenerate triangle? “Eliminating degenerate
triangle” is a optimization technology,or a rendering technology?

“Degenerate triangle” is a triangle that have 2 or 3 of the vertices with the same coordinates : so the surface should not be visible. Removing such triangles should not change the rendering, so it is more an “optimization”.

Optimization, well it depends, sometimes it is better to keep some degenerates triangles at the right places to keep going a long triangle strip for example : it means more triangles, but specified in a more efficient way.

Sometimes such degenerate triangles are generated on purpose to let the vertex shader dynamically move the coordinates, the triangle can then become visible. Eg. for shadow volumes, billboarding, etc.

This may be a bad idea.

Degenerates can be bad but they also serve a purpose.

  1. Degenerates can be undesirable zero area triangles that are generated as an artifact of the modelling process.

  2. Degenerates can be zero area triangles for extrusion into shadow volumes.

  3. Non silhouette degenerates can remain after 2 in which case they are undesirable.

  4. Degenerates can be zero area triangles to link triangle strips together for efficient batch dispatch at almost no extra cost.

  5. Degenerates can be used in triangle strips to give hardware generalized tristrip ability (“swapmesh” to strip off the other triangle edge).

So it really depends on what you’re doing. It might be dangerous to eliminate it, but more likely it will just impact performance, on the performance issue it may be VERY database dependent.