diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-21 22:00:39 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-21 22:00:39 +0100 |
commit | 12bf2f3302efc9042f12ca17104928c35700c229 (patch) | |
tree | 7abf77d5b94308993c9d67f65413f8a8d698c685 /client/src/scene_render.rs | |
parent | 20d5d575ad84da3d37bd581425fc335016f33c82 (diff) | |
download | weareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar weareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar.bz2 weareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar.zst |
split shaders to individual files
Diffstat (limited to 'client/src/scene_render.rs')
-rw-r--r-- | client/src/scene_render.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/client/src/scene_render.rs b/client/src/scene_render.rs index 2100d28..3698ff7 100644 --- a/client/src/scene_render.rs +++ b/client/src/scene_render.rs @@ -38,7 +38,10 @@ pub struct ScenePipeline { impl ScenePipeline { pub fn new(device: &Device, format: TextureFormat) -> (Self, BindGroupLayout, BindGroupLayout) { - let module = device.create_shader_module(include_wgsl!("shader.wgsl")); + let fragment_pbr = device.create_shader_module(include_wgsl!("shaders/fragment_pbr.wgsl")); + let vertex_world = device.create_shader_module(include_wgsl!("shaders/vertex_world.wgsl")); + let _vertex_world_skin = + device.create_shader_module(include_wgsl!("shaders/vertex_world_skin.wgsl")); let texture_bgl = device.create_bind_group_layout(&BindGroupLayoutDescriptor { entries: &[ @@ -87,8 +90,8 @@ impl ScenePipeline { label: None, layout: Some(&pipeline_layout), fragment: Some(FragmentState { - module: &module, - entry_point: Some("fs_main"), + module: &fragment_pbr, + entry_point: Some("main"), targets: &[Some(ColorTargetState { blend: Some(BlendState::PREMULTIPLIED_ALPHA_BLENDING), format, @@ -97,8 +100,8 @@ impl ScenePipeline { compilation_options: PipelineCompilationOptions::default(), }), vertex: VertexState { - module: &module, - entry_point: Some("vs_main"), + module: &vertex_world, + entry_point: Some("main"), buffers: &[ // position VertexBufferLayout { |