[Merged by Bors] - load zeroed UVs as fallback in gltf loader#1803
[Merged by Bors] - load zeroed UVs as fallback in gltf loader#1803jakobhellermann wants to merge 3 commits intobevyengine:mainfrom
Conversation
|
a message should be logged to notify the user of the change, and let them know if they want to fix it in their modelling tool |
0659508 to
dc45e44
Compare
I added a log. |
crates/bevy_gltf/src/loader.rs
Outdated
| } else { | ||
| let len = mesh.count_vertices(); | ||
| let uvs = vec![[0.0, 0.0]; len]; | ||
| bevy_log::warn!("missing `TEXCOORD_0` vertex attribute, loading zeroed out UVs"); |
There was a problem hiding this comment.
Warnings (and to a lesser extent, info logs) in Bevy must be actionable/fixable. But there will be cases where users won't be able to modify models (ex: they bought them on an asset store). I think we should consider "uv-less" models a "happy path" case.
Can we make this a debug log instead?
dc45e44 to
b58a85b
Compare
|
I'm going to hold off on merging this until we have this conversation: #1808 (comment) We should sort out a short term and long term plan for "missing vertex attributes". Long term I'd like to support loading "minimal" meshes without generating vertex attributes when they aren't needed, or warning/logging unnecessarily. |
|
Short term these changes are super valuable / make gltf loading more usable, so I'm willing to make concessions. I just want to be thoughtful about our first steps. |
|
The two possible solutions are
In #1010 it seemed like you preferred zeroed buffers as the solution. Am I missing any alternatives? |
b58a85b to
cf04c24
Compare
|
(sorry for the delay) I think generating UVs is probably the right call, but as I called out here, I think long term this should probably be a "mesh transform" users opt in to rather than something that happens implicitly. I expect there to be a class of meshes that don't need certain vertex attributes. Rather than bloat them with those attributes, I'd rather detect cases of "shader expected attributes that the mesh doesn't have", then enable the user to opt-in to generating things like "zeroed out uvs". Currently we don't support "asset config", so theres no good way to opt in to these transformations. For now, I'm down to merge this. |
|
bors r+ |
fixes a lot of gltf loading failures (see #1802)
|
Pull request successfully merged into main. Build succeeded: |
fixes a lot of gltf loading failures (see bevyengine#1802)
fixes a lot of gltf loading failures (see #1802)