diff options
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/GBuffPbrInstanced.vert | 5 | ||||
| -rw-r--r-- | shaders/tone_mapping.frag | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/shaders/GBuffPbrInstanced.vert b/shaders/GBuffPbrInstanced.vert index 9a91cfc..1095beb 100644 --- a/shaders/GBuffPbrInstanced.vert +++ b/shaders/GBuffPbrInstanced.vert @@ -28,10 +28,11 @@ out gl_PerVertex void main() { vec4 locPos = ubo.model * inModel * vec4(inPos, 1.0); + //locPos.y = -locPos.y; outNormal = normalize(transpose(inverse(mat3(ubo.model * inModel))) * inNormal); outColor = inColor; outWorldPos = locPos.xyz; outUV0 = inUV0; - outUV1 = inUV1; - gl_Position = ubo.projection * ubo.view * vec4(outWorldPos, 1.0); + outUV1 = inUV1; + gl_Position = ubo.projection * ubo.view * vec4(outWorldPos, 1.0); } 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 |