Updated mesh paints first two triangles black.

I’m updating a mesh every frame, moving a front edge forward and the back edge up to match.
All the mesh renders correctly, even the moving back edge, but the front two triangles come up black.

It doesn’t matter if I assign a color to the material or a texture - everything will get it except that leading rectangle.

To save time, none of these are the error:

  • the polgyon triangles are all in clockwise order.
  • the mesh bounds is being recomputed.
  • uv coordinates are all correct.
  • vertices are being assigned back to the mesh.
  • the size of the mesh is not changing (necessitating a clear()) - just two vertices are moving forward.

the vertices are also all moving as expected… everything looks fine but the leading two… so bizarre.

Fixed. In case anyone wants to know, if the points of a polygon ever meet up - giving the polygon zero area, the rendering will be broken even when you eventually draw those points out.

I had figured since the polygon eventually grew out in size, and I was seeing them grow, that they were being treated normally… but if they started squished to begin with, you arent getting the rendering back.