17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-01 13:44:49 +01:00

Draw volumetric clouds, their shadows, a volumetric fog and catalogue stars from a new weather system in the GL 4.6 renderer

This commit is contained in:
2026-10-16 21:44:47 +02:00
parent d509775269
commit 2be85410ce
47 changed files with 5092 additions and 74 deletions

View File

@@ -62,15 +62,17 @@ vec3 apply_lights_sunless(vec3 fragcolor, vec3 fragnormal, vec3 texturecolor, fl
// surfaces (uses SUN_NDOTL_SHARPNESS from light_common.glsl).
float sun_NdotL = pow(sunlight.x, SUN_NDOTL_SHARPNESS);
float diffuseamount = sun_NdotL * lights[0].intensity;
// the clouds hold back the sun where their shadow falls, as the shadow map does
float cloudsun = cloud_shadow(mat3(inv_view) * f_pos.xyz);
fragcolor += envcolor * reflectivity;
float specularamount = (sunlight.y * param[1].y * specularity) * lights[0].intensity;
float specularamount = (sunlight.y * param[1].y * specularity) * lights[0].intensity * cloudsun;
glossiness = abs(param[1].w);
fragcolor = add_headlights(fragcolor, fragnormal);
if (shadowtone < 1.0)
{
float shadow = calc_shadow();
float shadow = max(calc_shadow(), 1.0 - cloudsun);
specularamount *= clamp(1.0 - shadow, 0.0, 1.0);
fragcolor = mix(fragcolor, fragcolor * shadowtone, clamp(diffuseamount * shadow + specularamount, 0.0, 1.0));
}