diff --git a/shaders/bloom/upsample.glsl b/shaders/bloom/upsample.glsl index 6764b8a..6885e32 100644 --- a/shaders/bloom/upsample.glsl +++ b/shaders/bloom/upsample.glsl @@ -8,7 +8,6 @@ in vec2 texCoord; out vec4 fragColor; void main() { - // Calculate the coordinates of the four neighboring texels vec2 srcTexSize = textureSize(srcTexture, 0); vec2 pixelSize = 1.0 / srcTexSize; @@ -17,21 +16,17 @@ void main() { vec2 coord01 = coord00 + vec2(0.0, pixelSize.y); vec2 coord11 = coord00 + pixelSize; - // Calculate the fractional part of the texCoord vec2 f = fract(texCoord * srcTexSize); - // Sample the texture at the four neighboring texels vec3 color00 = texture(srcTexture, coord00).rgb; vec3 color10 = texture(srcTexture, coord10).rgb; vec3 color01 = texture(srcTexture, coord01).rgb; vec3 color11 = texture(srcTexture, coord11).rgb; - // Perform bilinear interpolation vec3 color0 = mix(color00, color10, f.x); vec3 color1 = mix(color01, color11, f.x); vec3 interpolatedColor = mix(color0, color1, f.y); - // Apply exposure and gamma correction if depth is 2 if (depth == 2) { interpolatedColor = vec3(1.0) - exp(-interpolatedColor * exposure); const float gamma = 2.2;