update advanced shading

This commit is contained in:
MihailRis 2026-09-27 23:13:45 +03:00
parent 9ca0b5154d
commit 771c72324c

View file

@ -26,8 +26,12 @@ vec4 effect() {
float emission = texture(u_emission, v_uv).r;
float rg = 1.0;
#ifdef ENABLE_SHADOWS
light *= calc_shadow(modelpos, normal, length(pos));
float shadow_mul = calc_shadow(modelpos, normal, length(pos));
light *= shadow_mul;
rg *= min(1.0, shadow_mul + emission);
light *= 2.0;
#endif
light = max(light, emission);
@ -40,5 +44,5 @@ vec4 effect() {
mix(1.0, CLOUDS_FOG_FACTOR_MUL, emission),
mix(1.0, CLOUDS_FOG_CURVE_MUL, emission)
);
return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0), fogColor, fog), 1.0);
return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0) * vec3(rg, 0.5 + rg * 0.5, 1.0), fogColor, fog), 1.0);
}