From 12bf2f3302efc9042f12ca17104928c35700c229 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 21 Jan 2025 22:00:39 +0100 Subject: split shaders to individual files --- client/src/scene_render.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'client/src/scene_render.rs') 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 { -- cgit v1.2.3-70-g09d2