16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 09:19:18 +02:00

improve shaders once more

This commit is contained in:
2026-04-26 00:49:45 +02:00
parent 76effe72df
commit 7923f7d857
4 changed files with 43 additions and 15 deletions

View File

@@ -37,7 +37,9 @@ uniform sampler2D specgloss;
vec3 apply_lights_sunless(vec3 fragcolor, vec3 fragnormal, vec3 texturecolor, float reflectivity, float specularity, float shadowtone)
{
vec3 basecolor = param[0].rgb;
fragcolor *= basecolor;
// Cab interior: dim ambient less than the exterior path - ambient
// is the dominant indoor illumination, but it was still too bright.
fragcolor *= basecolor * 0.80;
vec3 emissioncolor = basecolor * emission;
@@ -61,8 +63,8 @@ vec3 apply_lights_sunless(vec3 fragcolor, vec3 fragnormal, vec3 texturecolor, fl
vec2 sunlight = calc_dir_light(lights[0], fragnormal);
// Sharpen N.L for stronger contrast between lit and shaded cab
// surfaces (matches light_common.glsl apply_lights).
float sun_NdotL = pow(sunlight.x, 1.25);
// surfaces (uses SUN_NDOTL_SHARPNESS from light_common.glsl).
float sun_NdotL = pow(sunlight.x, SUN_NDOTL_SHARPNESS);
float diffuseamount = sun_NdotL * param[1].x * lights[0].intensity;
float specularamount = sunlight.y * param[1].y * specularity * lights[0].intensity;