mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
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:
parent
3727c9dd3d
commit
cf9bc03ee9
2 changed files with 2 additions and 2 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue