diff --git a/assets/voxygen/shaders/duel-downsample-frag.glsl b/assets/voxygen/shaders/duel-downsample-frag.glsl index 51e9f3129f..fb8cfdf9dc 100644 --- a/assets/voxygen/shaders/duel-downsample-frag.glsl +++ b/assets/voxygen/shaders/duel-downsample-frag.glsl @@ -5,7 +5,10 @@ uniform texture2D t_src_color; layout(set = 0, binding = 1) uniform sampler s_src_color; layout(set = 0, binding = 2) -uniform vec2 halfpixel; +// TODO: refactor in rust +uniform u_locals { + vec2 halfpixel; +}; layout(location = 0) in vec2 uv; diff --git a/assets/voxygen/shaders/duel-upsample-frag.glsl b/assets/voxygen/shaders/duel-upsample-frag.glsl index 6224f29927..10d1b1fdc6 100644 --- a/assets/voxygen/shaders/duel-upsample-frag.glsl +++ b/assets/voxygen/shaders/duel-upsample-frag.glsl @@ -5,7 +5,9 @@ uniform texture2D t_src_color; layout(set = 0, binding = 1) uniform sampler s_src_color; layout(set = 0, binding = 2) -uniform vec2 halfpixel; +uniform u_locals { + vec2 halfpixel; +}; layout(location = 0) in vec2 uv; diff --git a/assets/voxygen/shaders/postprocess-frag.glsl b/assets/voxygen/shaders/postprocess-frag.glsl index 947019bc06..8bcc1f6acd 100644 --- a/assets/voxygen/shaders/postprocess-frag.glsl +++ b/assets/voxygen/shaders/postprocess-frag.glsl @@ -32,7 +32,7 @@ uniform sampler s_src_color; layout(location = 0) in vec2 uv; -layout (std140, set = 1, binding = 2) +layout (std140, set = 1, binding = 3) uniform u_locals { mat4 proj_mat_inv; mat4 view_mat_inv; @@ -185,7 +185,7 @@ void main() { vec4 aa_color = aa_apply(t_src_color, s_src_color, uv * screen_res.xy, screen_res.xy); // Bloom - vec4 bloom = textureLod(sampler2D(t_src_bloom, s_src_color), uv, 0) * 0.05; + vec4 bloom = textureLod(sampler2D(t_src_bloom, s_src_color), uv, 0) * 0.75; aa_color += bloom; // Tonemapping diff --git a/voxygen/src/render/pipelines/postprocess.rs b/voxygen/src/render/pipelines/postprocess.rs index f990f81dcb..4efac906f1 100644 --- a/voxygen/src/render/pipelines/postprocess.rs +++ b/voxygen/src/render/pipelines/postprocess.rs @@ -50,7 +50,7 @@ impl PostProcessLayout { // TODO: make optional // src bloom wgpu::BindGroupLayoutEntry { - binding: 0, + binding: 1, visibility: wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::Texture { sample_type: wgpu::TextureSampleType::Float { filterable: true }, @@ -60,7 +60,7 @@ impl PostProcessLayout { count: None, }, wgpu::BindGroupLayoutEntry { - binding: 1, + binding: 2, visibility: wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::Sampler { filtering: true, @@ -70,7 +70,7 @@ impl PostProcessLayout { }, // Locals wgpu::BindGroupLayoutEntry { - binding: 2, + binding: 3, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::Buffer { ty: wgpu::BufferBindingType::Uniform, @@ -105,15 +105,15 @@ impl PostProcessLayout { // TODO: if there is no upscaling we can do the last bloom upsampling in post // process to save a pass and the need for the final full size bloom render target wgpu::BindGroupEntry { - binding: 0, + binding: 1, resource: wgpu::BindingResource::TextureView(src_bloom), }, wgpu::BindGroupEntry { - binding: 1, + binding: 2, resource: wgpu::BindingResource::Sampler(sampler), }, wgpu::BindGroupEntry { - binding: 2, + binding: 3, resource: locals.buf().as_entire_binding(), }, ], diff --git a/voxygen/src/render/renderer/shaders.rs b/voxygen/src/render/renderer/shaders.rs index eb3a148a89..21ac844627 100644 --- a/voxygen/src/render/renderer/shaders.rs +++ b/voxygen/src/render/renderer/shaders.rs @@ -68,6 +68,9 @@ impl assets::Compound for Shaders { "lod-terrain-frag", "clouds-vert", "clouds-frag", + "duel-downsample-frag", + "duel-upsample-frag", + "clouds-frag", "postprocess-vert", "postprocess-frag", "blit-vert",