mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-10 02:23:23 +08:00
Zero out memory from color variable
According to [here](https://www.khronos.org/opengl/wiki/Type_Qualifier_(GLSL)#Fragment_shader_outputs) memory of a fragment shader variable is initialized with undefined values. Therefore it should be zeroed out.
This commit is contained in:
@@ -13,6 +13,9 @@ uniform bool shake;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
// zero out memory since an out variable is initialized with undefined values by default
|
||||||
|
color = vec4(0.0f);
|
||||||
|
|
||||||
vec3 sample[9];
|
vec3 sample[9];
|
||||||
// sample from texture offsets if using convolution matrix
|
// sample from texture offsets if using convolution matrix
|
||||||
if(chaos || shake)
|
if(chaos || shake)
|
||||||
|
|||||||
Reference in New Issue
Block a user