Skip to content

Commit

Permalink
Remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yilmaz4 committed Jun 21, 2024
1 parent 0e8c1ac commit 3882a1f
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions shaders/bloom/upsample.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 3882a1f

Please sign in to comment.