]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - shader_hlsl.h
fix loading "g"-less .obj files
[xonotic/darkplaces.git] / shader_hlsl.h
index f5d1dd8a9e915815dbfba4627613ab966877df53..f1e8ff27449097bf5925d6c80ec5b16d4b979ee9 100644 (file)
 "      color.rgb += half3(offsetMappedTexture2D(Texture_Pants).rgb) * Color_Pants + half3(offsetMappedTexture2D(Texture_Shirt).rgb) * Color_Shirt;\n"
 "#endif\n"
 "#ifdef USEVERTEXTEXTUREBLEND\n"
+"#ifdef USEBOTHALPHAS\n"
+"      half4 color2 = half4(tex2D(Texture_SecondaryColor, TexCoord2));\n"
+"      half terrainblend = clamp(half(gl_FrontColor.a) * color.a, half(1.0 - color2.a), half(1.0));\n"
+"      color.rgb = lerp(color2.rgb, color.rgb, terrainblend);\n"
+"#else\n"
 "      half terrainblend = clamp(half(gl_FrontColor.a) * color.a * 2.0 - 0.5, half(0.0), half(1.0));\n"
 "      //half terrainblend = min(half(gl_FrontColor.a) * color.a * 2.0, half(1.0));\n"
 "      //half terrainblend = half(gl_FrontColor.a) * color.a > 0.5;\n"
 "      color.a = 1.0;\n"
 "      //color = half4(lerp(float4(1, 0, 0, 1), color, terrainblend));\n"
 "#endif\n"
+"#endif\n"
 "\n"
 "      // get the surface normal\n"
 "#ifdef USEVERTEXTEXTUREBLEND\n"