summaryrefslogtreecommitdiff
path: root/client/src/scene_render.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-11 13:28:44 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-11 13:28:44 +0100
commita8c689a9f11badbdd10748d247e60ec47725dc36 (patch)
tree7a17933607a9cdf82be8e69dae4b0c0e3c277551 /client/src/scene_render.rs
parente9e5df5ff1e09356bf2ad0bcc82bbaee6a2acc0d (diff)
downloadweareserver-a8c689a9f11badbdd10748d247e60ec47725dc36.tar
weareserver-a8c689a9f11badbdd10748d247e60ec47725dc36.tar.bz2
weareserver-a8c689a9f11badbdd10748d247e60ec47725dc36.tar.zst
add normal map bind group
Diffstat (limited to 'client/src/scene_render.rs')
-rw-r--r--client/src/scene_render.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/client/src/scene_render.rs b/client/src/scene_render.rs
index bc9fc52..7b2f653 100644
--- a/client/src/scene_render.rs
+++ b/client/src/scene_render.rs
@@ -62,7 +62,7 @@ impl ScenePipeline {
});
let pipeline_layout = device.create_pipeline_layout(&PipelineLayoutDescriptor {
label: None,
- bind_group_layouts: &[&bind_group_layout],
+ bind_group_layouts: &[&bind_group_layout, &bind_group_layout],
push_constant_ranges: &[PushConstantRange {
range: 0..(4 * 4 * size_of::<f32>() as u32),
stages: ShaderStages::VERTEX,
@@ -187,13 +187,14 @@ impl ScenePipeline {
* Mat4::from_mat3a(affine.matrix3);
let projection = part_projection.to_cols_array().map(|v| v.to_le_bytes());
- rpass.set_bind_group(0, &*part.texture, &[]);
+ rpass.set_bind_group(0, &*part.tex_albedo, &[]);
+ rpass.set_bind_group(1, &*part.tex_normal, &[]);
rpass.set_pipeline(&self.pipeline);
rpass.set_push_constants(ShaderStages::VERTEX, 0, projection.as_flattened());
rpass.set_index_buffer(part.index.slice(..), IndexFormat::Uint16);
- rpass.set_vertex_buffer(0, part.position.slice(..));
- rpass.set_vertex_buffer(1, part.normal.slice(..));
- rpass.set_vertex_buffer(2, part.texcoord.slice(..));
+ rpass.set_vertex_buffer(0, part.va_position.slice(..));
+ rpass.set_vertex_buffer(1, part.va_normal.slice(..));
+ rpass.set_vertex_buffer(2, part.va_texcoord.slice(..));
rpass.draw_indexed(0..part.index_count, 0, 0..1);
}
}