rename shader variables to avoid keywords

This commit is contained in:
2022-02-16 20:33:16 +08:00
parent 565e0390f3
commit ff838b8e85
3 changed files with 9 additions and 9 deletions

View File

@ -25,7 +25,7 @@ float fragDepthView;
in vec2 fragPosScreen;
layout (location = 0) out float output;
layout (location = 0) out float outputColor;
// A random number generator from the web.
@ -74,5 +74,5 @@ void main() {
occlusion += (sampleDepth >= viewpos.z/viewpos.w + bias ? 1.0 : 0.0) * rangeCheck;
}
output = 1.0 - (occlusion / SSAO_SAMPLE_COUNT);
outputColor = 1.0 - (occlusion / SSAO_SAMPLE_COUNT);
}

View File

@ -1,21 +1,21 @@
#version 330
uniform sampler2D input;
uniform sampler2D tex;
uniform vec2 screenSize;
in vec2 fragPosScreen;
layout (location = 0) out float output;
layout (location = 0) out float outputColor;
void main() {
output = 0;
outputColor = 0;
for (int i = -3; i <= 3; i++)
for (int j = -3; j <= 3; j++)
output += texture(input, fragPosScreen + vec2(i, j) / screenSize).r;
outputColor += texture(tex, fragPosScreen + vec2(i, j) / screenSize).r;
output /= 49.0;
output *= output;
outputColor /= 49.0;
outputColor *= outputColor;
}