]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixes for GLSL syntax errors in the deferred geometry shader
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 Mar 2011 17:34:47 +0000 (17:34 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 Mar 2011 17:34:47 +0000 (17:34 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10927 d7cf8633-e32d-0410-b094-e92efae38249

shader_glsl.h

index 8dee89669c70dedf7d3888f59c30ce15dd37cadf..15f95df3e26a77dcafa403439b8c64016264de52 100644 (file)
 "uniform highp mat4 ModelViewMatrix;\n"
 "void main(void)\n"
 "{\n"
-"      TexCoordSurfaceLightmap.xy = vec4((TexMatrix * Attrib_TexCoord0).xy, 0.0, 0.0);\n"
+"      TexCoordSurfaceLightmap = vec4((TexMatrix * Attrib_TexCoord0).xy, 0.0, 0.0);\n"
 "#ifdef USEVERTEXTEXTUREBLEND\n"
 "      VertexColor = Attrib_Color;\n"
 "      TexCoord2 = vec2(BackgroundTexMatrix * Attrib_TexCoord0);\n"
 "      EyeVectorFogDepth.w = 0.0;\n"
 "#endif\n"
 "\n"
-"      VectorS = (ModelViewMatrix * vec4(Attrib_TexCoord1.xyz, 0)).xyz;\n"
-"      VectorT = (ModelViewMatrix * vec4(Attrib_TexCoord2.xyz, 0)).xyz;\n"
-"      VectorR = (ModelViewMatrix * vec4(Attrib_TexCoord3.xyz, 0)).xyz;\n"
+"      VectorS = (ModelViewMatrix * vec4(Attrib_TexCoord1.xyz, 0));\n"
+"      VectorT = (ModelViewMatrix * vec4(Attrib_TexCoord2.xyz, 0));\n"
+"      VectorR = (ModelViewMatrix * vec4(Attrib_TexCoord3.xyz, 0));\n"
 "      gl_Position = ModelViewProjectionMatrix * Attrib_Position;\n"
 "}\n"
 "#endif // VERTEX_SHADER\n"
 "      float a = offsetMappedTexture2D(Texture_Gloss).a;\n"
 "#endif\n"
 "\n"
-"      dp_FragColor = vec4(normalize(surfacenormal.x * VectorS + surfacenormal.y * VectorT + surfacenormal.z * VectorR) * 0.5 + vec3(0.5, 0.5, 0.5), a);\n"
+"      dp_FragColor = vec4(normalize(surfacenormal.x * VectorS.xyz + surfacenormal.y * VectorT.xyz + surfacenormal.z * VectorR.xyz) * 0.5 + vec3(0.5, 0.5, 0.5), a);\n"
 "}\n"
 "#endif // FRAGMENT_SHADER\n"
 "#else // !MODE_DEFERREDGEOMETRY\n"