Skip to content

Commit 6b6df6d

Browse files
committed
fixing conflicets with main
1 parent 5af7464 commit 6b6df6d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/2d/mesh2d_manual.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ fn star(
7070
// Set the position attribute
7171
star.insert_attribute(Mesh::ATTRIBUTE_POSITION, v_pos);
7272
// And a RGB color attribute as well
73-
let mut v_color: Vec<u32> = vec![Color::BLACK.as_linear_rgba_u32()];
74-
v_color.extend_from_slice(&[Color::YELLOW.as_linear_rgba_u32(); 10]);
73+
let mut v_color: Vec<u32> = vec![bytemuck::cast([0 as u8, 0 as u8, 0 as u8, 255 as u8])];
74+
v_color.extend_from_slice(&[bytemuck::cast([255 as u8, 255 as u8, 0 as u8, 255 as u8]); 10]);
7575
star.insert_attribute(Mesh::ATTRIBUTE_COLOR, v_color);
7676

7777
// Now, we specify the indices of the vertex that are going to compose the
@@ -230,7 +230,6 @@ fn vertex(vertex: Vertex) -> VertexOutput {
230230
var out: VertexOutput;
231231
// Project the world position of the mesh into screen position
232232
out.clip_position = view.view_proj * mesh.model * vec4<f32>(vertex.position, 1.0);
233-
// Unpack the `u32` from the vertex buffer into the `vec4<f32>` used by the fragment shader
234233
out.color = vec4<f32>((vec4<u32>(vertex.color) >> vec4<u32>(0u, 8u, 16u, 24u)) & vec4<u32>(255u)) / 255.0;
235234
return out;
236235
}

0 commit comments

Comments
 (0)