Skip to content

Commit

Permalink
load zeroed UVs as fallback in gltf loader (#1803)
Browse files Browse the repository at this point in the history
fixes a lot of gltf loading failures (see #1802)
  • Loading branch information
jakobhellermann committed May 6, 2021
1 parent 73ae6af commit cf8ef76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf8ef76

Please sign in to comment.