17cupsofcoffee / tetra

🎮 A simple 2D game framework written in Rust
MIT License
909 stars 63 forks source link

Store vertex winding order in Mesh #233

Closed 17cupsofcoffee closed 3 years ago

17cupsofcoffee commented 3 years ago

Summary: Currently, if you want to change the vertex winding order, you have to do it globally, and remember to switch it back when you're done. This is silly, because everything except custom meshes will always be counter-clockwise vertices, so 99% of the time, that's what you want.

It would make more sense to define the winding order as part of an individual Mesh, and automatically switch as appropriate. This would also be more compatible with the idea of 'render passes' that's used in WGPU/Vulkan/etc, if we ever get around to using those in Tetra.

Why is this needed?

To reduce the amount of global state bookkeeping that users have to do.

17cupsofcoffee commented 3 years ago

Done on the 0.6 branch.