Fix Bloom in rare cases

BloomColor was not initialized with a value and therefore could incorrectly bloom non-bright pixels.

Maybe... since the issue randomly started to happen on my system (i5-4570, GTX 760) without any hardware or software changes I know of. Even older versions of my program then suddenly had this problem and this was the only working fix which was mentioned in the comments section on the tutorial: https://learnopengl.com/#!Advanced-Lighting/Bloom#comment-2693931521)
This commit is contained in:
stfx
2017-08-19 16:57:49 +02:00
committed by GitHub
parent c6b404915d
commit dc4dee3f82

View File

@@ -43,7 +43,7 @@ void main()
float brightness = dot(result, vec3(0.2126, 0.7152, 0.0722));
if(brightness > 1.0)
BrightColor = vec4(result, 1.0);
// else
// BloomColor = vec4(0.0, 0.0, 0.0, 1.0);
else
BloomColor = vec4(0.0, 0.0, 0.0, 1.0);
FragColor = vec4(result, 1.0);
}
}