summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_image.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2014-07-31 21:01:57 -0700
committerTim Angus <tim@ngus.net>2014-08-28 11:13:04 +0100
commitd2c5e367fcd4a9e1cf39d74638dc80b2af29361a (patch)
treeb470e3e8f16e5102eea02a3c96fb98c295daa64f /src/renderergl2/tr_image.c
parent6f6faa4cb4a2be5fc0a30125e44f6dcd74509fd4 (diff)
OpenGL2: Add fourth cascade for sun shadows, and adjust sun shadow cvar defaults.
Diffstat (limited to 'src/renderergl2/tr_image.c')
-rw-r--r--src/renderergl2/tr_image.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/renderergl2/tr_image.c b/src/renderergl2/tr_image.c
index b7237f53..75626531 100644
--- a/src/renderergl2/tr_image.c
+++ b/src/renderergl2/tr_image.c
@@ -2931,9 +2931,14 @@ void R_CreateBuiltinImages( void ) {
if (r_sunlightMode->integer)
{
- for ( x = 0; x < 3; x++)
+ for ( x = 0; x < 4; x++)
{
tr.sunShadowDepthImage[x] = R_CreateImage(va("*sunshadowdepth%i", x), NULL, r_shadowMapSize->integer, r_shadowMapSize->integer, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24_ARB);
+ GL_Bind(tr.sunShadowDepthImage[x]);
+ qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+ qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
+ qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
}
tr.screenShadowImage = R_CreateImage("*screenShadow", NULL, width, height, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_RGBA8);