[iortcw] 63/89: All: Remove legacy cg_shadows 4

Simon McVittie smcv at debian.org
Fri Sep 8 10:44:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to tag 1.51b
in repository iortcw.

commit 0347e5b3bfb8e6dc89a037eefc8bdbaa49f5f82b
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Fri Jul 21 06:38:02 2017 -0400

    All: Remove legacy cg_shadows 4
    
    FIXME: Rend2 version crashes game
---
 MP/code/rend2/glsl/pshadow_fp.glsl | 44 +++++++++++---------------------------
 MP/code/rend2/tr_animation.c       |  4 ----
 MP/code/rend2/tr_backend.c         |  8 +++----
 MP/code/rend2/tr_fbo.c             |  6 +++---
 MP/code/rend2/tr_image.c           |  9 ++++----
 MP/code/rend2/tr_main.c            |  2 +-
 MP/code/rend2/tr_mesh.c            |  5 -----
 MP/code/rend2/tr_model_iqm.c       |  5 -----
 MP/code/renderer/tr_animation.c    |  4 ----
 MP/code/renderer/tr_cmesh.c        |  6 ------
 MP/code/renderer/tr_mesh.c         |  5 -----
 MP/code/renderer/tr_model_iqm.c    |  5 -----
 SP/code/rend2/glsl/pshadow_fp.glsl | 44 +++++++++++---------------------------
 SP/code/rend2/tr_animation.c       |  4 ----
 SP/code/rend2/tr_backend.c         |  8 +++----
 SP/code/rend2/tr_fbo.c             |  6 +++---
 SP/code/rend2/tr_image.c           |  9 ++++----
 SP/code/rend2/tr_main.c            |  2 +-
 SP/code/rend2/tr_mesh.c            |  5 -----
 SP/code/rend2/tr_model_iqm.c       |  5 -----
 SP/code/renderer/tr_animation.c    |  4 ----
 SP/code/renderer/tr_cmesh.c        |  6 ------
 SP/code/renderer/tr_mesh.c         |  5 -----
 SP/code/renderer/tr_model_iqm.c    |  5 -----
 24 files changed, 48 insertions(+), 158 deletions(-)

diff --git a/MP/code/rend2/glsl/pshadow_fp.glsl b/MP/code/rend2/glsl/pshadow_fp.glsl
index b152971..c196f48 100644
--- a/MP/code/rend2/glsl/pshadow_fp.glsl
+++ b/MP/code/rend2/glsl/pshadow_fp.glsl
@@ -8,12 +8,6 @@ uniform float     u_LightRadius;
 varying vec3      var_Position;
 varying vec3      var_Normal;
 
-float sampleDistMap(sampler2D texMap, vec2 uv, float scale)
-{
-	vec3 distv = texture2D(texMap, uv).xyz;
-	return dot(distv, vec3(1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) * scale;
-}
-
 void main()
 {
 	vec3 lightToPos = var_Position - u_LightOrigin.xyz;
@@ -57,42 +51,28 @@ void main()
 #endif
 
 	intensity *= fade;
-#if defined(USE_PCF)
-	float part;
-	
-	dist = sampleDistMap(u_ShadowMap, st + vec2(-1.0/512.0, -1.0/512.0), u_LightRadius);
-	part =  max(sign(lightDist - dist), 0.0);
-
-	dist = sampleDistMap(u_ShadowMap, st + vec2( 1.0/512.0, -1.0/512.0), u_LightRadius);
-	part += max(sign(lightDist - dist), 0.0);
 
-	dist = sampleDistMap(u_ShadowMap, st + vec2(-1.0/512.0,  1.0/512.0), u_LightRadius);
-	part += max(sign(lightDist - dist), 0.0);
-
-	dist = sampleDistMap(u_ShadowMap, st + vec2( 1.0/512.0,  1.0/512.0), u_LightRadius);
-	part += max(sign(lightDist - dist), 0.0);
+	float part;
+#if defined(USE_PCF)
+	part  = float(texture2D(u_ShadowMap, st + vec2(-1.0/512.0, -1.0/512.0)).r != 1.0);
+	part += float(texture2D(u_ShadowMap, st + vec2( 1.0/512.0, -1.0/512.0)).r != 1.0);
+	part += float(texture2D(u_ShadowMap, st + vec2(-1.0/512.0,  1.0/512.0)).r != 1.0);
+	part += float(texture2D(u_ShadowMap, st + vec2( 1.0/512.0,  1.0/512.0)).r != 1.0);
+#else
+	part  = float(texture2D(u_ShadowMap, st).r != 1.0);
+#endif
 
-  #if defined(USE_DISCARD)
 	if (part <= 0.0)
 	{
 		discard;
 	}
-  #endif
 
+#if defined(USE_PCF)
 	intensity *= part * 0.25;
 #else
-	dist = sampleDistMap(u_ShadowMap, st, u_LightRadius);
-
-  #if defined(USE_DISCARD)
-	if (lightDist - dist <= 0.0)
-	{
-		discard;
-	}
-  #endif
-			
-	intensity *= max(sign(lightDist - dist), 0.0);
+	intensity *= part;
 #endif
-		
+
 	gl_FragColor.rgb = vec3(0);
 	gl_FragColor.a = clamp(intensity, 0.0, 0.75);
 }
diff --git a/MP/code/rend2/tr_animation.c b/MP/code/rend2/tr_animation.c
index 170b843..92bcf0d 100644
--- a/MP/code/rend2/tr_animation.c
+++ b/MP/code/rend2/tr_animation.c
@@ -1637,10 +1637,6 @@ void R_MDRAddAnimSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, qfalse, 0 );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 )
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, qfalse, 0 );
-
 		if ( !personalModel )
 			R_AddDrawSurf( (void *)surface, shader, fogNum, qfalse, qfalse, cubemapIndex );
 
diff --git a/MP/code/rend2/tr_backend.c b/MP/code/rend2/tr_backend.c
index d0eb075..5e9b271 100644
--- a/MP/code/rend2/tr_backend.c
+++ b/MP/code/rend2/tr_backend.c
@@ -1890,13 +1890,13 @@ const void *RB_PostProcess(const void *data)
 	if (0 && r_shadows->integer == 4)
 	{
 		ivec4_t dstBox;
-		VectorSet4(dstBox, 0, glConfig.vidHeight - 128, 128, 128);
+		VectorSet4(dstBox, 512 + 0, glConfig.vidHeight - 128, 128, 128);
 		FBO_BlitFromTexture(tr.pshadowMaps[0], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
-		VectorSet4(dstBox, 128, glConfig.vidHeight - 128, 128, 128);
+		VectorSet4(dstBox, 512 + 128, glConfig.vidHeight - 128, 128, 128);
 		FBO_BlitFromTexture(tr.pshadowMaps[1], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
-		VectorSet4(dstBox, 256, glConfig.vidHeight - 128, 128, 128);
+		VectorSet4(dstBox, 512 + 256, glConfig.vidHeight - 128, 128, 128);
 		FBO_BlitFromTexture(tr.pshadowMaps[2], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
-		VectorSet4(dstBox, 384, glConfig.vidHeight - 128, 128, 128);
+		VectorSet4(dstBox, 512 + 384, glConfig.vidHeight - 128, 128, 128);
 		FBO_BlitFromTexture(tr.pshadowMaps[3], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
 	}
 
diff --git a/MP/code/rend2/tr_fbo.c b/MP/code/rend2/tr_fbo.c
index 54dc8fe..98c5b50 100644
--- a/MP/code/rend2/tr_fbo.c
+++ b/MP/code/rend2/tr_fbo.c
@@ -322,14 +322,14 @@ void FBO_Init(void)
 		R_CheckFBO(tr.sunRaysFbo);
 	}
 
-	// FIXME: Don't use separate color/depth buffers for a shadow buffer
 	if (MAX_DRAWN_PSHADOWS && tr.pshadowMaps[0])
 	{
 		for( i = 0; i < MAX_DRAWN_PSHADOWS; i++)
 		{
 			tr.pshadowFbos[i] = FBO_Create(va("_shadowmap%d", i), tr.pshadowMaps[i]->width, tr.pshadowMaps[i]->height);
-			FBO_AttachImage(tr.pshadowFbos[i], tr.pshadowMaps[i], GL_COLOR_ATTACHMENT0, 0);
-			FBO_CreateBuffer(tr.pshadowFbos[i], GL_DEPTH_COMPONENT24_ARB, 0, 0);
+			// FIXME: this next line wastes 16mb with 16x512x512 sun shadow maps, skip if OpenGL 4.3+ or ARB_framebuffer_no_attachments
+			FBO_CreateBuffer(tr.pshadowFbos[i], GL_RGBA8, 0, 0);
+			FBO_AttachImage(tr.pshadowFbos[i], tr.pshadowMaps[i], GL_DEPTH_ATTACHMENT, 0);
 			R_CheckFBO(tr.pshadowFbos[i]);
 		}
 	}
diff --git a/MP/code/rend2/tr_image.c b/MP/code/rend2/tr_image.c
index 314ac89..3ef2053 100644
--- a/MP/code/rend2/tr_image.c
+++ b/MP/code/rend2/tr_image.c
@@ -2887,12 +2887,11 @@ void R_CreateBuiltinImages( void ) {
 			tr.screenSsaoImage = R_CreateImage("*screenSsao", NULL, width / 2, height / 2, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_RGBA8);
 		}
 
-		if (r_shadows->integer == 4)
+		for( x = 0; x < MAX_DRAWN_PSHADOWS; x++)
 		{
-			for( x = 0; x < MAX_DRAWN_PSHADOWS; x++)
-			{
-				tr.pshadowMaps[x] = R_CreateImage(va("*shadowmap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_RGBA8);
-			}
+			tr.pshadowMaps[x] = R_CreateImage(va("*shadowmap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24);
+			//qglTextureParameterfEXT(tr.pshadowMaps[x]->texnum, GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
+			//qglTextureParameterfEXT(tr.pshadowMaps[x]->texnum, GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
 		}
 
 		if (r_sunlightMode->integer)
diff --git a/MP/code/rend2/tr_main.c b/MP/code/rend2/tr_main.c
index 6d85f68..43e3c1f 100644
--- a/MP/code/rend2/tr_main.c
+++ b/MP/code/rend2/tr_main.c
@@ -2297,7 +2297,7 @@ void R_RenderPshadowMaps(const refdef_t *fd)
 		if (glRefConfig.framebufferObject)
 			shadowParms.targetFbo = tr.pshadowFbos[i];
 
-		shadowParms.flags = VPF_SHADOWMAP | VPF_DEPTHSHADOW | VPF_NOVIEWMODEL;
+		shadowParms.flags = VPF_DEPTHSHADOW | VPF_NOVIEWMODEL;
 		shadowParms.zFar = shadow->lightRadius;
 
 		VectorCopy(shadow->lightOrigin, shadowParms.or.origin);
diff --git a/MP/code/rend2/tr_mesh.c b/MP/code/rend2/tr_mesh.c
index 538fe1e..9b8f59e 100644
--- a/MP/code/rend2/tr_mesh.c
+++ b/MP/code/rend2/tr_mesh.c
@@ -433,11 +433,6 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)&model->vaoSurfaces[i], tr.projectionShadowShader, 0, qfalse, qfalse, 0 );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)&model->vaoSurfaces[i], tr.projectionShadowShader, 0, qfalse, qfalse, 0 );
-		}
-
 		// don't add third_person objects if not viewing through a portal
 		if ( !personalModel ) {
 			R_AddDrawSurf( (void *)&model->vaoSurfaces[i], shader, fogNum, qfalse, qfalse, cubemapIndex );
diff --git a/MP/code/rend2/tr_model_iqm.c b/MP/code/rend2/tr_model_iqm.c
index 507158c..670165f 100644
--- a/MP/code/rend2/tr_model_iqm.c
+++ b/MP/code/rend2/tr_model_iqm.c
@@ -936,11 +936,6 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, 0, 0, 0 );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, qfalse, 0 );
-		}
-
 		if( !personalModel ) {
 			R_AddDrawSurf( (void *)surface, shader, fogNum, 0, 0, cubemapIndex );
 		}
diff --git a/MP/code/renderer/tr_animation.c b/MP/code/renderer/tr_animation.c
index 2aa751a..3fe0678 100644
--- a/MP/code/renderer/tr_animation.c
+++ b/MP/code/renderer/tr_animation.c
@@ -1635,10 +1635,6 @@ void R_MDRAddAnimSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 )
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse );
-
 		if ( !personalModel )
 			R_AddDrawSurf( (void *)surface, shader, fogNum, qfalse );
 
diff --git a/MP/code/renderer/tr_cmesh.c b/MP/code/renderer/tr_cmesh.c
index de5d24b..13c1f7c 100644
--- a/MP/code/renderer/tr_cmesh.c
+++ b/MP/code/renderer/tr_cmesh.c
@@ -421,12 +421,6 @@ void R_AddMDCSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse );
 		}
 
-//----(SA)	for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse );
-		}
-//----(SA)	done testing
-
 		// don't add third_person objects if not viewing through a portal
 		if ( !personalModel ) {
 			R_AddDrawSurf( (void *)surface, shader, fogNum, qfalse );
diff --git a/MP/code/renderer/tr_mesh.c b/MP/code/renderer/tr_mesh.c
index 8cf262c..45775d7 100644
--- a/MP/code/renderer/tr_mesh.c
+++ b/MP/code/renderer/tr_mesh.c
@@ -429,11 +429,6 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse );
-		}
-
 		// don't add third_person objects if not viewing through a portal
 		if ( !personalModel ) {
 			R_AddDrawSurf( (void *)surface, shader, fogNum, qfalse );
diff --git a/MP/code/renderer/tr_model_iqm.c b/MP/code/renderer/tr_model_iqm.c
index 370fc45..f9b75a9 100644
--- a/MP/code/renderer/tr_model_iqm.c
+++ b/MP/code/renderer/tr_model_iqm.c
@@ -932,11 +932,6 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, 0 );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse );
-		}
-
 		if( !personalModel ) {
 			R_AddDrawSurf( (void *)surface, shader, fogNum, 0 );
 		}
diff --git a/SP/code/rend2/glsl/pshadow_fp.glsl b/SP/code/rend2/glsl/pshadow_fp.glsl
index b152971..c196f48 100644
--- a/SP/code/rend2/glsl/pshadow_fp.glsl
+++ b/SP/code/rend2/glsl/pshadow_fp.glsl
@@ -8,12 +8,6 @@ uniform float     u_LightRadius;
 varying vec3      var_Position;
 varying vec3      var_Normal;
 
-float sampleDistMap(sampler2D texMap, vec2 uv, float scale)
-{
-	vec3 distv = texture2D(texMap, uv).xyz;
-	return dot(distv, vec3(1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) * scale;
-}
-
 void main()
 {
 	vec3 lightToPos = var_Position - u_LightOrigin.xyz;
@@ -57,42 +51,28 @@ void main()
 #endif
 
 	intensity *= fade;
-#if defined(USE_PCF)
-	float part;
-	
-	dist = sampleDistMap(u_ShadowMap, st + vec2(-1.0/512.0, -1.0/512.0), u_LightRadius);
-	part =  max(sign(lightDist - dist), 0.0);
-
-	dist = sampleDistMap(u_ShadowMap, st + vec2( 1.0/512.0, -1.0/512.0), u_LightRadius);
-	part += max(sign(lightDist - dist), 0.0);
 
-	dist = sampleDistMap(u_ShadowMap, st + vec2(-1.0/512.0,  1.0/512.0), u_LightRadius);
-	part += max(sign(lightDist - dist), 0.0);
-
-	dist = sampleDistMap(u_ShadowMap, st + vec2( 1.0/512.0,  1.0/512.0), u_LightRadius);
-	part += max(sign(lightDist - dist), 0.0);
+	float part;
+#if defined(USE_PCF)
+	part  = float(texture2D(u_ShadowMap, st + vec2(-1.0/512.0, -1.0/512.0)).r != 1.0);
+	part += float(texture2D(u_ShadowMap, st + vec2( 1.0/512.0, -1.0/512.0)).r != 1.0);
+	part += float(texture2D(u_ShadowMap, st + vec2(-1.0/512.0,  1.0/512.0)).r != 1.0);
+	part += float(texture2D(u_ShadowMap, st + vec2( 1.0/512.0,  1.0/512.0)).r != 1.0);
+#else
+	part  = float(texture2D(u_ShadowMap, st).r != 1.0);
+#endif
 
-  #if defined(USE_DISCARD)
 	if (part <= 0.0)
 	{
 		discard;
 	}
-  #endif
 
+#if defined(USE_PCF)
 	intensity *= part * 0.25;
 #else
-	dist = sampleDistMap(u_ShadowMap, st, u_LightRadius);
-
-  #if defined(USE_DISCARD)
-	if (lightDist - dist <= 0.0)
-	{
-		discard;
-	}
-  #endif
-			
-	intensity *= max(sign(lightDist - dist), 0.0);
+	intensity *= part;
 #endif
-		
+
 	gl_FragColor.rgb = vec3(0);
 	gl_FragColor.a = clamp(intensity, 0.0, 0.75);
 }
diff --git a/SP/code/rend2/tr_animation.c b/SP/code/rend2/tr_animation.c
index d7c9d7c..e683c64 100644
--- a/SP/code/rend2/tr_animation.c
+++ b/SP/code/rend2/tr_animation.c
@@ -1631,10 +1631,6 @@ void R_MDRAddAnimSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, qfalse, 0, ATI_TESS_TRUFORM );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 )
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, qfalse, 0, ATI_TESS_TRUFORM );
-
 		if ( !personalModel )
 			R_AddDrawSurf( (void *)surface, shader, fogNum, qfalse, qfalse, cubemapIndex, ATI_TESS_TRUFORM );
 
diff --git a/SP/code/rend2/tr_backend.c b/SP/code/rend2/tr_backend.c
index 34be98d..103052e 100644
--- a/SP/code/rend2/tr_backend.c
+++ b/SP/code/rend2/tr_backend.c
@@ -2141,13 +2141,13 @@ const void *RB_PostProcess(const void *data)
 	if (0 && r_shadows->integer == 4)
 	{
 		ivec4_t dstBox;
-		VectorSet4(dstBox, 0, glConfig.vidHeight - 128, 128, 128);
+		VectorSet4(dstBox, 512 + 0, glConfig.vidHeight - 128, 128, 128);
 		FBO_BlitFromTexture(tr.pshadowMaps[0], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
-		VectorSet4(dstBox, 128, glConfig.vidHeight - 128, 128, 128);
+		VectorSet4(dstBox, 512 + 128, glConfig.vidHeight - 128, 128, 128);
 		FBO_BlitFromTexture(tr.pshadowMaps[1], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
-		VectorSet4(dstBox, 256, glConfig.vidHeight - 128, 128, 128);
+		VectorSet4(dstBox, 512 + 256, glConfig.vidHeight - 128, 128, 128);
 		FBO_BlitFromTexture(tr.pshadowMaps[2], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
-		VectorSet4(dstBox, 384, glConfig.vidHeight - 128, 128, 128);
+		VectorSet4(dstBox, 512 + 384, glConfig.vidHeight - 128, 128, 128);
 		FBO_BlitFromTexture(tr.pshadowMaps[3], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
 	}
 
diff --git a/SP/code/rend2/tr_fbo.c b/SP/code/rend2/tr_fbo.c
index 54dc8fe..98c5b50 100644
--- a/SP/code/rend2/tr_fbo.c
+++ b/SP/code/rend2/tr_fbo.c
@@ -322,14 +322,14 @@ void FBO_Init(void)
 		R_CheckFBO(tr.sunRaysFbo);
 	}
 
-	// FIXME: Don't use separate color/depth buffers for a shadow buffer
 	if (MAX_DRAWN_PSHADOWS && tr.pshadowMaps[0])
 	{
 		for( i = 0; i < MAX_DRAWN_PSHADOWS; i++)
 		{
 			tr.pshadowFbos[i] = FBO_Create(va("_shadowmap%d", i), tr.pshadowMaps[i]->width, tr.pshadowMaps[i]->height);
-			FBO_AttachImage(tr.pshadowFbos[i], tr.pshadowMaps[i], GL_COLOR_ATTACHMENT0, 0);
-			FBO_CreateBuffer(tr.pshadowFbos[i], GL_DEPTH_COMPONENT24_ARB, 0, 0);
+			// FIXME: this next line wastes 16mb with 16x512x512 sun shadow maps, skip if OpenGL 4.3+ or ARB_framebuffer_no_attachments
+			FBO_CreateBuffer(tr.pshadowFbos[i], GL_RGBA8, 0, 0);
+			FBO_AttachImage(tr.pshadowFbos[i], tr.pshadowMaps[i], GL_DEPTH_ATTACHMENT, 0);
 			R_CheckFBO(tr.pshadowFbos[i]);
 		}
 	}
diff --git a/SP/code/rend2/tr_image.c b/SP/code/rend2/tr_image.c
index 82abd2b..23a5176 100644
--- a/SP/code/rend2/tr_image.c
+++ b/SP/code/rend2/tr_image.c
@@ -2891,12 +2891,11 @@ void R_CreateBuiltinImages( void ) {
 			tr.screenSsaoImage = R_CreateImage("*screenSsao", NULL, width / 2, height / 2, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_RGBA8);
 		}
 
-		if (r_shadows->integer == 4)
+		for( x = 0; x < MAX_DRAWN_PSHADOWS; x++)
 		{
-			for( x = 0; x < MAX_DRAWN_PSHADOWS; x++)
-			{
-				tr.pshadowMaps[x] = R_CreateImage(va("*shadowmap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_RGBA8);
-			}
+			tr.pshadowMaps[x] = R_CreateImage(va("*shadowmap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24);
+			//qglTextureParameterfEXT(tr.pshadowMaps[x]->texnum, GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
+			//qglTextureParameterfEXT(tr.pshadowMaps[x]->texnum, GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
 		}
 
 		if (r_sunlightMode->integer)
diff --git a/SP/code/rend2/tr_main.c b/SP/code/rend2/tr_main.c
index 8f94895..d607d38 100644
--- a/SP/code/rend2/tr_main.c
+++ b/SP/code/rend2/tr_main.c
@@ -2339,7 +2339,7 @@ void R_RenderPshadowMaps(const refdef_t *fd)
 		if (glRefConfig.framebufferObject)
 			shadowParms.targetFbo = tr.pshadowFbos[i];
 
-		shadowParms.flags = VPF_SHADOWMAP | VPF_DEPTHSHADOW | VPF_NOVIEWMODEL;
+		shadowParms.flags = VPF_DEPTHSHADOW | VPF_NOVIEWMODEL;
 		shadowParms.zFar = shadow->lightRadius;
 
 		VectorCopy(shadow->lightOrigin, shadowParms.or.origin);
diff --git a/SP/code/rend2/tr_mesh.c b/SP/code/rend2/tr_mesh.c
index bbfbc69..10105a9 100644
--- a/SP/code/rend2/tr_mesh.c
+++ b/SP/code/rend2/tr_mesh.c
@@ -450,11 +450,6 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)&model->vaoSurfaces[i], tr.projectionShadowShader, 0, qfalse, qfalse, 0, tr.currentModel->ATI_tess );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)&model->vaoSurfaces[i], tr.projectionShadowShader, 0, qfalse, qfalse, 0, tr.currentModel->ATI_tess );
-		}
-
 		// don't add third_person objects if not viewing through a portal
 		if ( !personalModel ) {
 // GR - tessellate according to model capabilities
diff --git a/SP/code/rend2/tr_model_iqm.c b/SP/code/rend2/tr_model_iqm.c
index 5274c0e..f5c204b 100644
--- a/SP/code/rend2/tr_model_iqm.c
+++ b/SP/code/rend2/tr_model_iqm.c
@@ -936,11 +936,6 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, 0, 0, 0, ATI_TESS_TRUFORM );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, qfalse, 0, ATI_TESS_TRUFORM );
-		}
-
 		if( !personalModel ) {
 			R_AddDrawSurf( (void *)surface, shader, fogNum, 0, 0, cubemapIndex, ATI_TESS_TRUFORM );
 		}
diff --git a/SP/code/renderer/tr_animation.c b/SP/code/renderer/tr_animation.c
index 8b31d55..def43d1 100644
--- a/SP/code/renderer/tr_animation.c
+++ b/SP/code/renderer/tr_animation.c
@@ -1626,10 +1626,6 @@ void R_MDRAddAnimSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, ATI_TESS_TRUFORM );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 )
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, ATI_TESS_TRUFORM );
-
 		if ( !personalModel )
 			R_AddDrawSurf( (void *)surface, shader, fogNum, qfalse, ATI_TESS_TRUFORM );
 
diff --git a/SP/code/renderer/tr_cmesh.c b/SP/code/renderer/tr_cmesh.c
index 23550ad..70acbfd 100644
--- a/SP/code/renderer/tr_cmesh.c
+++ b/SP/code/renderer/tr_cmesh.c
@@ -441,12 +441,6 @@ void R_AddMDCSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, tr.currentModel->ATI_tess );
 		}
 
-//----(SA)	for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, tr.currentModel->ATI_tess );
-		}
-//----(SA)	done testing
-
 		// don't add third_person objects if not viewing through a portal
 		if ( !personalModel ) {
 // GR - tessellate according to model capabilities
diff --git a/SP/code/renderer/tr_mesh.c b/SP/code/renderer/tr_mesh.c
index 5390c57..c20aab6 100644
--- a/SP/code/renderer/tr_mesh.c
+++ b/SP/code/renderer/tr_mesh.c
@@ -446,11 +446,6 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, tr.currentModel->ATI_tess );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, tr.currentModel->ATI_tess );
-		}
-
 		// don't add third_person objects if not viewing through a portal
 		if ( !personalModel ) {
 // GR - tessellate according to model capabilities
diff --git a/SP/code/renderer/tr_model_iqm.c b/SP/code/renderer/tr_model_iqm.c
index b1ab522..240b1d5 100644
--- a/SP/code/renderer/tr_model_iqm.c
+++ b/SP/code/renderer/tr_model_iqm.c
@@ -932,11 +932,6 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, 0, ATI_TESS_TRUFORM );
 		}
 
-		// for testing polygon shadows (on /all/ models)
-		if ( r_shadows->integer == 4 ) {
-			R_AddDrawSurf( (void *)surface, tr.projectionShadowShader, 0, qfalse, ATI_TESS_TRUFORM );
-		}
-
 		if( !personalModel ) {
 			R_AddDrawSurf( (void *)surface, shader, fogNum, 0, ATI_TESS_TRUFORM );
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list