From 6d55999e421d3d1ec73c3f056c3198258ef0deaf Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 23 Feb 2011 17:02:03 +0000 Subject: [PATCH] oops, forgot to include the shader code for the r_shadow_bouncegrid feature git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10857 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gl_rmain.c b/gl_rmain.c index 67ebbd2e..61be332b 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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" -- 2.39.2