1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Fix tree shadows when TreeAnim flag is used

This commit is contained in:
Petr Mikheev 2023-05-26 00:46:04 +02:00
parent bf49855d9f
commit 115f1e9800

View File

@ -5,6 +5,7 @@ varying vec2 diffuseMapUV;
varying float alphaPassthrough;
uniform int colorMode;
uniform bool useTreeAnim;
uniform bool useDiffuseMapForShadowAlpha = true;
uniform bool alphaTestShadows = true;
@ -20,7 +21,7 @@ void main(void)
else
diffuseMapUV = vec2(0.0); // Avoid undefined behaviour if running on hardware predating the concept of dynamically uniform expressions
if (colorMode == 2)
alphaPassthrough = gl_Color.a;
alphaPassthrough = useTreeAnim ? 1.0 : gl_Color.a;
else
// This is uniform, so if it's too low, we might be able to put the position/clip vertex outside the view frustum and skip the fragment shader and rasteriser
alphaPassthrough = gl_FrontMaterial.diffuse.a;