r1331 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Apr 27 17:09:03 EDT 2008


Author: thilo
Date: 2008-04-27 17:09:03 -0400 (Sun, 27 Apr 2008)
New Revision: 1331

Modified:
   trunk/code/renderer/tr_cmds.c
   trunk/code/renderer/tr_init.c
   trunk/code/renderer/tr_shade.c
Log:
- change default value for stereo seperation
- make clearing buffer use black for clearing when changing anaglyphmode
- Make sure that dlights are greyscale, too.


Modified: trunk/code/renderer/tr_cmds.c
===================================================================
--- trunk/code/renderer/tr_cmds.c	2008-04-27 19:07:57 UTC (rev 1330)
+++ trunk/code/renderer/tr_cmds.c	2008-04-27 21:09:03 UTC (rev 1331)
@@ -435,6 +435,7 @@
 			{
 				// 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);

Modified: trunk/code/renderer/tr_init.c
===================================================================
--- trunk/code/renderer/tr_init.c	2008-04-27 19:07:57 UTC (rev 1330)
+++ trunk/code/renderer/tr_init.c	2008-04-27 21:09:03 UTC (rev 1331)
@@ -959,7 +959,7 @@
 	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 );

Modified: trunk/code/renderer/tr_shade.c
===================================================================
--- trunk/code/renderer/tr_shade.c	2008-04-27 19:07:57 UTC (rev 1330)
+++ trunk/code/renderer/tr_shade.c	2008-04-27 21:09:03 UTC (rev 1331)
@@ -455,9 +455,19 @@
 		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 @@
 		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;




More information about the quake3-commits mailing list