diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-04-20 10:02:04 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-04-20 10:02:04 +0200 |
| commit | c0a6bb6ae6db8f4de39b630a2f5e20c3f976e6a9 (patch) | |
| tree | f97941afc96ab415bbe16d63345704a0c4b9764a /shaders/tone_mapping.frag | |
| parent | 30f1e58efb3910a41cee30ff89a1028fba97c3c1 (diff) | |
wiptests
Diffstat (limited to 'shaders/tone_mapping.frag')
| -rw-r--r-- | shaders/tone_mapping.frag | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/shaders/tone_mapping.frag b/shaders/tone_mapping.frag index 5c4d752..fcbd5e4 100644 --- a/shaders/tone_mapping.frag +++ b/shaders/tone_mapping.frag @@ -12,7 +12,7 @@ layout (set = 0, binding = 0) uniform UBO { } ubo; layout (input_attachment_index = 0, set = 1, binding = 4) uniform subpassInputMS samplerHDR; -layout (set = 0, binding = 8) uniform sampler2D samplerUI; +//layout (set = 0, binding = 8) uniform sampler2D samplerUI; layout (location = 0) in vec2 inUV; layout (location = 0) out vec4 outColor; @@ -53,10 +53,10 @@ vec3 SRGBtoLINEAR(vec3 srgbIn) void main() { vec4 hdrColor = subpassLoad(samplerHDR, gl_SampleID); - vec4 ui = texture(samplerUI, inUV); - outColor = (hdrColor.a - ui.a) * vec4(SRGBtoLINEAR(tonemap(hdrColor.rgb)), 1.0) + ui; - /* + //vec4 ui = texture(samplerUI, inUV); + //outColor = (hdrColor.a - ui.a) * vec4(SRGBtoLINEAR(tonemap(hdrColor.rgb)), 1.0) + ui; + vec3 mapped = vec3(1.0) - exp(-hdrColor.rgb * ubo.exposure); mapped = pow(mapped, vec3(1.0 / ubo.gamma)); - outColor = vec4(mapped, hdrColor.a);*/ + outColor = vec4(mapped, hdrColor.a); }
\ No newline at end of file |