feat: deferred lighting (WIP)

This commit is contained in:
MihailRis
2025-06-14 22:43:18 +03:00
parent 2ad076bec3
commit e849d5e9b7
10 changed files with 105 additions and 12 deletions
@@ -0,0 +1,11 @@
vec4 effect() {
float ssao = 0.0;
for (int y = -1; y <= 1; y++) {
for (int x = -1; x <= 1; x++) {
vec2 offset = vec2(x, y) / u_screenSize;
ssao += texture(u_ssao, v_uv + offset * 2.0).r;
}
}
ssao /= 9.0;
return vec4(texture(u_screen, v_uv).rgb * mix(1.0, ssao, 1.0), 1.0);
}