mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
28060f3180
# Objective according to [khronos](https://github.com/KhronosGroup/glTF/issues/1697), gltf nodes with inverted scales should invert the winding order of the mesh data. this is to allow negative scale to be used for mirrored geometry. ## Solution in the gltf loader, create a separate material with `cull_mode` set to `Face::Front` when the node scale is negative. note/alternatives: this applies for nodes where the scale is negative at gltf import time. that seems like enough for the mentioned use case of mirrored geometry. it doesn't help when scales dynamically go negative at runtime, but you can always set double sided in that case. i don't think there's any practical difference between using front-face culling and setting a clockwise winding order explicitly, but winding order is supported by wgpu so we could add the field to StandardMaterial/StandardMaterialKey and set it directly on the pipeline descriptor if there's a reason to. it wouldn't help with dynamic scale adjustments anyway, and would still require a separate material. fixes #4738, probably fixes #7901. --------- Co-authored-by: François <mockersf@gmail.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |