]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added diffuse texture alpha support to GLSL shader (dot3 and vertex still need updating)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Feb 2006 13:52:17 +0000 (13:52 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Feb 2006 13:52:17 +0000 (13:52 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5958 d7cf8633-e32d-0410-b094-e92efae38249

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"