Adds a temporary hack for grass lighting.

The hack uses per-vertex lighting for translucent objects. In the
future we need to use a separate shader.
This commit is contained in:
Vladislav Belov 2025-01-09 01:48:56 +01:00
parent 3727c9dd3d
commit cf9bc03ee9
No known key found for this signature in database
GPG key ID: 353545E45DB9CCB3
2 changed files with 2 additions and 2 deletions

View file

@ -11,5 +11,5 @@
<shader effect="model_transparent"/>
<uniform name="windData" value="6.0 6.0"/>
<!-- TODO: use a separate material for translucent models. -->
<uniform name="effectSettings" value="0.0 50.0 0.0075"/>
<uniform name="effectSettings" value="0.0 50.0 0.0075 1.0"/>
</material>

View file

@ -84,7 +84,7 @@ void main()
#if USE_INSTANCING && USE_NORMAL_MAP
normal = calculateNormal(normal, SAMPLE_2D(GET_DRAW_TEXTURE_2D(normTex), coord).rgb, tbn, effectSettings.x);
vec3 sundiffuse = max(dot(-sunDir, normal), 0.0) * sunColor;
vec3 sundiffuse = mix(max(dot(-sunDir, normal), 0.0) * sunColor, v_lighting.rgb, effectSettings.w);
#else
vec3 sundiffuse = v_lighting.rgb;
#endif