render: SSAO
This commit is contained in:
20
internal/asset/shader/world/ssao_blur.frag
Normal file
20
internal/asset/shader/world/ssao_blur.frag
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 330
|
||||
|
||||
uniform sampler2D input;
|
||||
uniform vec2 screenSize;
|
||||
|
||||
|
||||
in vec2 fragPosScreen;
|
||||
layout (location = 0) out float output;
|
||||
|
||||
|
||||
void main() {
|
||||
output = 0;
|
||||
|
||||
for (int i = -3; i <= 3; i++)
|
||||
for (int j = -3; j <= 3; j++)
|
||||
output += texture(input, fragPosScreen + vec2(i, j) / screenSize).r;
|
||||
|
||||
output /= 49.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user