mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
feat: deferred lighting (WIP)
This commit is contained in:
parent
2ad076bec3
commit
e849d5e9b7
10 changed files with 105 additions and 12 deletions
11
res/shaders/effects/deferred_lighting.glsl
Normal file
11
res/shaders/effects/deferred_lighting.glsl
Normal file
|
|
@ -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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue