feat: water effects (#19)

* feat(shaders): add lighting to block accumulation OIT shaders

* feat(renderer): add water rendering with OIT and new shaders

* feat(water): implement screen-space reflection and refraction for water with depth fade and perturbation

* refactor(shader): replace glUniform calls with generic set_loc and remove cached locations

* feat(water): add noise-based caustics and configurable fog density

* fix(water shader): update depth fade and remove underwater check

- Increase DEPTH_FADE_DISTANCE from 8 to 10
- Remove conditional so depth fade always applies
- Darken deepColor from (0, 0.08, 0.15) to (0, 0.015, 0.045)

* feat(underwater): add volume scattering and shadow mapping for light shafts
This commit is contained in:
zhenyan121
2026-06-20 09:04:09 +08:00
committed by GitHub
parent ca3fc5e3bf
commit a8d2ddbacd
16 changed files with 813 additions and 126 deletions

View File

@@ -46,7 +46,7 @@ float fbm(vec2 p) {
return v;
}
void main(void) {
vec3 computeSkyColor(vec3 dir) {
vec3 sund = normalize(sunDir);
float t =
@@ -88,6 +88,13 @@ void main(void) {
sky += glow * sunColor;
return sky;
}
void main(void) {
vec3 sky = computeSkyColor(dir);
frag_color = vec4(sky, 1.0);
//frag_color = vec4(vec3(sunAmount), 1.0);
//frag_color = vec4(t,0,0,1);