]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - shader_glsl.h
Made RENDERPATH_GL20 require fbo support and always use it.
[xonotic/darkplaces.git] / shader_glsl.h
index 90d5d770db2fe73fc52326f6e4dcb1479dc51a28..36542c53810ab34c673013cdc3d583e3ce4a7d7d 100644 (file)
@@ -37,6 +37,9 @@
 "# endif\n",
 "#endif\n",
 "\n",
+"#if (defined(GLSL120) || defined(GLSL130) || defined(GLSL140) || defined(GLES)) && defined(VERTEX_SHADER)\n"
+"invariant gl_Position; // fix for lighting polygons not matching base surface\n",
+"# endif\n",
 "#if defined(GLSL130) || defined(GLSL140)\n",
 "precision highp float;\n",
 "# ifdef VERTEX_SHADER\n",
 "uniform sampler2D Texture_ReflectMask;\n",
 "uniform samplerCube Texture_ReflectCube;\n",
 "#endif\n",
-"#ifdef MODE_LIGHTDIRECTION\n",
-"uniform myhalf3 LightColor;\n",
-"#endif\n",
-"#ifdef MODE_LIGHTSOURCE\n",
-"uniform myhalf3 LightColor;\n",
-"#endif\n",
 "#ifdef USEBOUNCEGRID\n",
 "uniform sampler3D Texture_BounceGrid;\n",
 "uniform float BounceGridIntensity;\n",
 "#else\n",
 "      color.rgb = diffusetex * Color_Ambient;\n",
 "#endif\n",
-"      color.rgb *= LightColor;\n",
 "      color.rgb *= cast_myhalf(dp_texture2D(Texture_Attenuation, vec2(length(CubeVector), 0.0)));\n",
 "#if defined(USESHADOWMAP2D)\n",
 "      color.rgb *= ShadowMapCompare(CubeVector);\n",
 "      #ifdef USEDIFFUSE\n",
 "              myhalf3 lightnormal = cast_myhalf3(normalize(LightVector));\n",
 "      #endif\n",
-"      #define lightcolor LightColor\n",
+"      #define lightcolor 1\n",
 "#endif // MODE_LIGHTDIRECTION\n",
 "#ifdef MODE_LIGHTDIRECTIONMAP_MODELSPACE\n",
 "   #define SHADING\n",
 "#ifdef MODE_FAKELIGHT\n",
 "      #define SHADING\n",
 "      myhalf3 lightnormal = cast_myhalf3(normalize(EyeVectorFogDepth.xyz));\n",
-"      myhalf3 lightcolor = cast_myhalf3(1.0);\n",
+"      #define lightcolor 1\n",
 "#endif // MODE_FAKELIGHT\n",
 "\n",
 "\n",