mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
glTF: added color attribute support (#1775)
This commit is contained in:
parent
0fce6f0406
commit
8f1eaa6db5
1 changed files with 7 additions and 0 deletions
|
@ -142,6 +142,13 @@ async fn load_gltf<'a, 'b>(
|
|||
mesh.set_attribute(Mesh::ATTRIBUTE_UV_0, vertex_attribute);
|
||||
}
|
||||
|
||||
if let Some(vertex_attribute) = reader
|
||||
.read_colors(0)
|
||||
.map(|v| VertexAttributeValues::Float4(v.into_rgba_f32().collect()))
|
||||
{
|
||||
mesh.set_attribute(Mesh::ATTRIBUTE_COLOR, vertex_attribute);
|
||||
}
|
||||
|
||||
if let Some(indices) = reader.read_indices() {
|
||||
mesh.set_indices(Some(Indices::U32(indices.into_u32().collect())));
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue