From a72f6f27c85222d5646a3cd8077de4d5c5817b80 Mon Sep 17 00:00:00 2001 From: thilo Date: Sun, 27 Apr 2008 21:09:03 +0000 Subject: - change default value for stereo seperation - make clearing buffer use black for clearing when changing anaglyphmode - Make sure that dlights are greyscale, too. git-svn-id: svn://svn.icculus.org/quake3/trunk@1331 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/renderer/tr_cmds.c | 1 + code/renderer/tr_init.c | 2 +- code/renderer/tr_shade.c | 33 +++++++++++++++++++++++++++------ 3 files changed, 29 insertions(+), 7 deletions(-) (limited to 'code/renderer') diff --git a/code/renderer/tr_cmds.c b/code/renderer/tr_cmds.c index 8986be2..06a18e8 100644 --- a/code/renderer/tr_cmds.c +++ b/code/renderer/tr_cmds.c @@ -435,6 +435,7 @@ void RE_BeginFrame( stereoFrame_t stereoFrame ) { { // clear both, front and backbuffer. qglColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + qglClearColor(0.0f, 0.0f, 0.0f, 1.0f); qglDrawBuffer(GL_FRONT); qglClear(GL_COLOR_BUFFER_BIT); diff --git a/code/renderer/tr_init.c b/code/renderer/tr_init.c index 0fe686a..d838c61 100644 --- a/code/renderer/tr_init.c +++ b/code/renderer/tr_init.c @@ -959,7 +959,7 @@ void R_Register( void ) r_znear = ri.Cvar_Get( "r_znear", "4", CVAR_CHEAT ); AssertCvarRange( r_znear, 0.001f, 200, qtrue ); r_zproj = ri.Cvar_Get( "r_zproj", "64", CVAR_ARCHIVE ); - r_stereoSeparation = ri.Cvar_Get( "r_stereoSeparation", "32", CVAR_ARCHIVE ); + r_stereoSeparation = ri.Cvar_Get( "r_stereoSeparation", "64", CVAR_ARCHIVE ); r_ignoreGLErrors = ri.Cvar_Get( "r_ignoreGLErrors", "1", CVAR_ARCHIVE ); r_fastsky = ri.Cvar_Get( "r_fastsky", "0", CVAR_ARCHIVE ); r_inGameVideo = ri.Cvar_Get( "r_inGameVideo", "1", CVAR_ARCHIVE ); diff --git a/code/renderer/tr_shade.c b/code/renderer/tr_shade.c index 8eb60a6..33a7f2b 100644 --- a/code/renderer/tr_shade.c +++ b/code/renderer/tr_shade.c @@ -455,9 +455,19 @@ static void ProjectDlightTexture_altivec( void ) { radius = dl->radius; scale = 1.0f / radius; - floatColor[0] = dl->color[0] * 255.0f; - floatColor[1] = dl->color[1] * 255.0f; - floatColor[2] = dl->color[2] * 255.0f; + if(r_greyscale->integer) + { + float luminance; + + luminance = (dl->color[0] * 255.0f + dl->color[1] * 255.0f + dl->color[2] * 255.0f) / 3; + floatColor[0] = floatColor[1] = floatColor[2] = luminance; + } + else + { + floatColor[0] = dl->color[0] * 255.0f; + floatColor[1] = dl->color[1] * 255.0f; + floatColor[2] = dl->color[2] * 255.0f; + } floatColorVec0 = vec_ld(0, floatColor); floatColorVec1 = vec_ld(11, floatColor); floatColorVec0 = vec_perm(floatColorVec0,floatColorVec0,floatColorVecPerm); @@ -599,9 +609,20 @@ static void ProjectDlightTexture_scalar( void ) { radius = dl->radius; scale = 1.0f / radius; - floatColor[0] = dl->color[0] * 255.0f; - floatColor[1] = dl->color[1] * 255.0f; - floatColor[2] = dl->color[2] * 255.0f; + if(r_greyscale->integer) + { + float luminance; + + luminance = (dl->color[0] * 255.0f + dl->color[1] * 255.0f + dl->color[2] * 255.0f) / 3; + floatColor[0] = floatColor[1] = floatColor[2] = luminance; + } + else + { + floatColor[0] = dl->color[0] * 255.0f; + floatColor[1] = dl->color[1] * 255.0f; + floatColor[2] = dl->color[2] * 255.0f; + } + for ( i = 0 ; i < tess.numVertexes ; i++, texCoords += 2, colors += 4 ) { int clip = 0; vec3_t dist; -- cgit v1.2.3