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

fix(shaders): the highlight of the sun is multiplied by the cosine of its light, so surfaces no longer glare milky white under a low sun; headlights light a surface with 1.35 of its diffuse colour and add a GGX highlight of their own scaled by specgloss and param_specular instead of multiplying the whole light by one plus param_specular; normalmap, parallax, detail, shadowless, sunless and default_detail materials read param_glossiness as a Phong exponent, roughness = (2 / (n + 2))^1/4, instead of 1 - 1/n or a fixed mirror

This commit is contained in:
maj00r
2026-10-14 21:42:33 +02:00
parent 806dde70bf
commit 8df87d42cf
8 changed files with 23 additions and 9 deletions

View File

@@ -63,6 +63,7 @@ void main()
float reflectivity = reflblend > 1.0 ? param[1].z * 1.0 : param[1].z * reflblend;
float specularity = (tex_color.r + tex_color.g + tex_color.b) * 0.5;
glossiness = phong_glossiness();
fragcolor = apply_lights(fragcolor, fragnormal, tex_color.rgb, reflectivity, specularity, shadow_tone);
vec4 color = vec4(apply_fog(fragcolor), tex_color.a * alpha_mult);
#if POSTFX_ENABLED