mgsx-dev/gdx-gltf

add mesh mirroring support

mgsx-dev opened this issue · 0 comments

Currently, mesh nodes with negative scaling appears with normal flipped which is wrong as per GLTF spec. :

When a mesh primitive uses any triangle-based topology (i.e., triangles, triangle strip, or triangle fan), the determinant of the node’s global transform defines the winding order of that primitive. If the determinant is a positive value, the winding order triangle faces is counterclockwise; in the opposite case, the winding order is clockwise.
Implementation Note : Switching the winding order to clockwise enables mirroring geometry via negative scale transforms.

The best way to implement it would be to add winding order state management to the RenderContext (libgdx core).