]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
oops, forgot to include the shader code for the r_shadow_bouncegrid feature
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Feb 2011 17:02:03 +0000 (17:02 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Feb 2011 17:02:03 +0000 (17:02 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10857 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 67ebbd2e424e72c5a6b7258ef745205cf3ea7e04..61be332ba818d46883dea73babec4b5dc49de4f5 100644 (file)
@@ -1077,6 +1077,11 @@ static const char *builtinshaderstring =
 "varying mediump vec3 ShadowMapTC;\n"
 "#endif\n"
 "\n"
+"#ifdef USEBOUNCEGRID\n"
+"varying mediump vec3 BounceGridTexCoord;\n"
+"#endif\n"
+"\n"
+"\n"
 "\n"
 "\n"
 "\n"
@@ -1540,6 +1545,9 @@ static const char *builtinshaderstring =
 "#ifdef USESHADOWMAPORTHO\n"
 "uniform highp mat4 ShadowMapMatrix;\n"
 "#endif\n"
+"#ifdef USEBOUNCEGRID\n"
+"uniform highp mat4 BounceGridMatrix;\n"
+"#endif\n"
 "void main(void)\n"
 "{\n"
 "#if defined(MODE_VERTEXCOLOR) || defined(USEVERTEXTEXTUREBLEND)\n"
@@ -1554,6 +1562,10 @@ static const char *builtinshaderstring =
 "      TexCoordLightmap = vec2(Attrib_TexCoord4);\n"
 "#endif\n"
 "\n"
+"#ifdef USEBOUNCEGRID\n"
+"      BounceGridTexCoord = vec3(BounceGridMatrix * Attrib_Position);\n"
+"#endif\n"
+"\n"
 "#ifdef MODE_LIGHTSOURCE\n"
 "      // transform vertex position into light attenuation/cubemap space\n"
 "      // (-1 to +1 across the light box)\n"
@@ -1642,6 +1654,10 @@ static const char *builtinshaderstring =
 "#ifdef MODE_LIGHTSOURCE\n"
 "uniform myhalf3 LightColor;\n"
 "#endif\n"
+"#ifdef USEBOUNCEGRID\n"
+"uniform sampler3D Texture_BounceGrid;\n"
+"uniform float BounceGridIntensity;\n"
+"#endif\n"
 "void main(void)\n"
 "{\n"
 "#ifdef USEOFFSETMAPPING\n"
@@ -1817,6 +1833,10 @@ static const char *builtinshaderstring =
 "      color.rgb += glosstex.rgb * myhalf3(texture2D(Texture_ScreenSpecular, ScreenTexCoord)) * DeferredMod_Specular;\n"
 "#endif\n"
 "\n"
+"#ifdef USEBOUNCEGRID\n"
+"      color.rgb += diffusetex * myhalf3(texture3D(Texture_BounceGrid, BounceGridTexCoord)) * BounceGridIntensity;\n"
+"#endif\n"
+"\n"
 "#ifdef USEGLOW\n"
 "#ifdef USEVERTEXTEXTUREBLEND\n"
 "      color.rgb += mix(myhalf3(texture2D(Texture_SecondaryGlow, TexCoord2)), myhalf3(texture2D(Texture_Glow, TexCoord)), terrainblend) * Color_Glow;\n"