fix: openxr swapchain banding

This commit is contained in:
galister
2024-07-11 19:17:41 +09:00
parent a991c6b84a
commit 5575e4f49f
3 changed files with 32 additions and 8 deletions

View File

@@ -97,7 +97,7 @@ pub mod frag_screen {
// linear to srgb
bvec4 cutoff = lessThan(out_color, vec4(0.0031308));
vec4 higher = (pow(out_color, vec4(0.41666)) * vec4(1.055)) - vec4(0.055);
vec4 higher = (pow(out_color, vec4(0.4166667)) * vec4(1.055)) - vec4(0.055);
vec4 lower = out_color*vec4(12.92);
out_color = mix(higher, lower, cutoff);
out_color.a = 1.0;
@@ -135,3 +135,26 @@ pub mod frag_srgb {
",
}
}
pub mod frag_swapchain {
vulkano_shaders::shader! {
ty: "fragment",
src: r"#version 310 es
precision highp float;
layout (location = 0) in vec2 in_uv;
layout (location = 0) out vec4 out_color;
layout (set = 0, binding = 0) uniform sampler2D in_texture;
layout (set = 1, binding = 0) uniform AlphaBlock {
uniform float alpha;
};
void main()
{
out_color = texture(in_texture, in_uv);
out_color.a = alpha;
}
",
}
}