mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
load zeroed UVs as fallback in gltf loader (#1803)
fixes a lot of gltf loading failures (see https://github.com/bevyengine/bevy/issues/1802)
This commit is contained in:
parent
73ae6af6ef
commit
cf8ef7660c
1 changed files with 5 additions and 0 deletions
|
@ -140,6 +140,11 @@ async fn load_gltf<'a, 'b>(
|
|||
.map(|v| VertexAttributeValues::Float32x2(v.into_f32().collect()))
|
||||
{
|
||||
mesh.set_attribute(Mesh::ATTRIBUTE_UV_0, vertex_attribute);
|
||||
} else {
|
||||
let len = mesh.count_vertices();
|
||||
let uvs = vec![[0.0, 0.0]; len];
|
||||
bevy_log::debug!("missing `TEXCOORD_0` vertex attribute, loading zeroed out UVs");
|
||||
mesh.set_attribute(Mesh::ATTRIBUTE_UV_0, uvs);
|
||||
}
|
||||
|
||||
if let Some(vertex_attribute) = reader
|
||||
|
|
Loading…
Reference in a new issue