From 7c005bf5b1582ad7e401f71291539d8ad6b2c734 Mon Sep 17 00:00:00 2001 From: eihrul Date: Tue, 9 Mar 2010 02:03:47 +0000 Subject: [PATCH] fixed bug in vsdct in cg git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10047 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 2 +- r_shadow.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 39b2d3a3..4dda5da6 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -2303,7 +2303,7 @@ const char *builtincgshaderstring = " float3 adir = abs(dir);\n" " float2 aparams = ShadowMap_Parameters.xy / max(max(adir.x, adir.y), adir.z);\n" " float4 proj = texCUBE(Texture_CubeProjection, dir);\n" -" return float3(lerp(dir.xy, proj.xy, dir.zz) * aparams.x + proj.zw * ShadowMap_Parameters.z, aparams.y + ShadowMap_Parameters.w);\n" +" return float3(lerp(dir.xy, dir.zz, proj.xy) * aparams.x + proj.zw * ShadowMap_Parameters.z, aparams.y + ShadowMap_Parameters.w);\n" "}\n" "# else\n" "float3 GetShadowMapTC2D(float3 dir, float4 ShadowMap_Parameters)\n" diff --git a/r_shadow.c b/r_shadow.c index e4f4c101..8dc758f2 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -373,7 +373,7 @@ skinframe_t *r_editlights_sprselection; void R_Shadow_SetShadowMode(void) { r_shadow_shadowmapmaxsize = bound(1, r_shadow_shadowmapping_maxsize.integer, (int)vid.maxtexturesize_2d / 4); - r_shadow_shadowmapvsdct = r_shadow_shadowmapping_vsdct.integer && !vid.cgcontext; + r_shadow_shadowmapvsdct = r_shadow_shadowmapping_vsdct.integer != 0; r_shadow_shadowmapfilterquality = r_shadow_shadowmapping_filterquality.integer; r_shadow_shadowmaptexturetype = r_shadow_shadowmapping_texturetype.integer; r_shadow_shadowmapdepthbits = r_shadow_shadowmapping_depthbits.integer; @@ -4075,7 +4075,7 @@ void R_Shadow_PrepareLights(void) if (r_shadow_shadowmapmaxsize != bound(1, r_shadow_shadowmapping_maxsize.integer, (int)vid.maxtexturesize_2d / 4) || (r_shadow_shadowmode != R_SHADOW_SHADOWMODE_STENCIL) != (r_shadow_shadowmapping.integer || r_shadow_deferred.integer) || - r_shadow_shadowmapvsdct != (r_shadow_shadowmapping_vsdct.integer && !vid.cgcontext) || + r_shadow_shadowmapvsdct != (r_shadow_shadowmapping_vsdct.integer != 0) || r_shadow_shadowmaptexturetype != r_shadow_shadowmapping_texturetype.integer || r_shadow_shadowmapfilterquality != r_shadow_shadowmapping_filterquality.integer || r_shadow_shadowmapdepthbits != r_shadow_shadowmapping_depthbits.integer || -- 2.39.2