]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_shadow.c
added diffuse texture alpha support to GLSL shader (dot3 and vertex still need updating)
[xonotic/darkplaces.git] / r_shadow.c
index 8eb69cbfd82d5f6b35b6fa75f5ba04510ad5cdac..ad68adb7b474bda6ad03560f2eca2d9fea9364ce 100644 (file)
@@ -434,7 +434,9 @@ const char *builtinshader_light_frag =
 "\n"
 "      // calculate shading\n"
 "      myhvec3 diffusenormal = myhvec3(normalize(LightVector));\n"
-"      myhvec3 color = myhvec3(texture2D(Texture_Color, TexCoord));\n"
+"      myhvec4 texturecolor = myhvec4(texture2D(Texture_Color, TexCoord));\n"
+"      colorscale *= texturecolor.a;\n"
+"      myhvec3 color = myhvec3(texturecolor);\n"
 "#ifdef USECOLORMAPPING\n"
 "      color += myhvec3(texture2D(Texture_Pants, TexCoord)) * Color_Pants + myhvec3(texture2D(Texture_Shirt, TexCoord)) * Color_Shirt;\n"
 "#endif\n"