better but still bad

This commit is contained in:
aiden 2023-06-20 19:30:36 +01:00
parent 18ce5cde06
commit 8481f8d529
Signed by: aiden
GPG Key ID: EFA9C74AEBF806E0
2 changed files with 7 additions and 7 deletions

@ -410,12 +410,12 @@ impl State {
// (the camera should rotate around the player,
// and the player should also rotate so that
// its back is facing the camera.)
render_pass.set_pipeline(&(self.render_pipeline));
let mesh = &(skin.meshes[1]);
render_pass.set_bind_group(1, &(skin.materials[mesh.material].bind_group), &[]);
render_pass.set_vertex_buffer(0, mesh.vertex_buffer.slice(..));
render_pass.set_index_buffer(mesh.index_buffer.slice(..), wgpu::IndexFormat::Uint32);
render_pass.draw_indexed(0..mesh.num_elements, 0, 0..1);
for mesh in &(skin.meshes) {
render_pass.set_bind_group(1, &(skin.materials[mesh.material].bind_group), &[]);
render_pass.set_vertex_buffer(0, mesh.vertex_buffer.slice(..));
render_pass.set_index_buffer(mesh.index_buffer.slice(..), wgpu::IndexFormat::Uint32);
render_pass.draw_indexed(0..mesh.num_elements, 0, 0..1);
}
drop(render_pass);

@ -25,7 +25,7 @@ impl Texture {
mip_level_count: 1,
sample_count: 1,
dimension: wgpu::TextureDimension::D2,
format: wgpu::TextureFormat::R8Unorm,
format: wgpu::TextureFormat::Rgba8UnormSrgb,
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
view_formats: &[],
}));