From: havoc Date: Thu, 24 Dec 2009 13:09:03 +0000 (+0000) Subject: removed r_shadow_culltriangles - the only useful part of it (shadow X-Git-Tag: xonotic-v0.1.0preview~977 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=ae7659147186f943237a932345fb9a2b88a8983e removed r_shadow_culltriangles - the only useful part of it (shadow caster culling on dlights when using shadow volumes) is preserved, the nasty part (changes in lighting) are gone git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9671 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rsurf.c b/gl_rsurf.c index 53f69414..a3d96475 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -1177,13 +1177,12 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface dp_model_t *model = ent->model; const msurface_t *surface; int i, k, kend, l, m, mend, endsurface, batchnumsurfaces, batchnumtriangles, batchfirstvertex, batchlastvertex, batchfirsttriangle; - qboolean usebufferobject, culltriangles; + qboolean usebufferobject; const int *element3i; static msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES]; static int batchelements[BATCHSIZE*3]; texture_t *tex; CHECKGLERROR - culltriangles = r_shadow_culltriangles.integer && !(ent->flags & RENDER_NOSELFSHADOW); element3i = rsurface.modelelement3i; // this is a double loop because non-visible surface skipping has to be // fast, and even if this is not the world model (and hence no visibility @@ -1252,14 +1251,6 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface continue; } } - else if (culltriangles) - { - if (r_shadow_frontsidecasting.integer && !PointInfrontOfTriangle(rsurface.entitylightorigin, rsurface.vertex3f + element3i[m*3+0]*3, rsurface.vertex3f + element3i[m*3+1]*3, rsurface.vertex3f + element3i[m*3+2]*3)) - { - usebufferobject = false; - continue; - } - } if (batchnumtriangles >= BATCHSIZE) { r_refdef.stats.lights_lighttriangles += batchnumtriangles; diff --git a/r_shadow.c b/r_shadow.c index 1609a42f..92eaf999 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -316,7 +316,6 @@ cvar_t r_shadow_shadowmapping_nearclip = {CVAR_SAVE, "r_shadow_shadowmapping_nea cvar_t r_shadow_shadowmapping_bias = {CVAR_SAVE, "r_shadow_shadowmapping_bias", "0.03", "shadowmap bias parameter (this is multiplied by nearclip * 1024 / lodsize)"}; cvar_t r_shadow_shadowmapping_polygonfactor = {CVAR_SAVE, "r_shadow_shadowmapping_polygonfactor", "2", "slope-dependent shadowmapping bias"}; cvar_t r_shadow_shadowmapping_polygonoffset = {CVAR_SAVE, "r_shadow_shadowmapping_polygonoffset", "0", "constant shadowmapping bias"}; -cvar_t r_shadow_culltriangles = {0, "r_shadow_culltriangles", "0", "performs more expensive tests to remove unnecessary triangles of lit surfaces (looks bad when using shadowmapping or shadowless lights)"}; cvar_t r_shadow_polygonfactor = {0, "r_shadow_polygonfactor", "0", "how much to enlarge shadow volume polygons when rendering (should be 0!)"}; cvar_t r_shadow_polygonoffset = {0, "r_shadow_polygonoffset", "1", "how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)"}; cvar_t r_shadow_texture3d = {0, "r_shadow_texture3d", "1", "use 3D voxel textures for spherical attenuation rather than cylindrical (does not affect OpenGL 2.0 render path)"}; @@ -711,7 +710,6 @@ void R_Shadow_Init(void) Cvar_RegisterVariable(&r_shadow_shadowmapping_bias); Cvar_RegisterVariable(&r_shadow_shadowmapping_polygonfactor); Cvar_RegisterVariable(&r_shadow_shadowmapping_polygonoffset); - Cvar_RegisterVariable(&r_shadow_culltriangles); Cvar_RegisterVariable(&r_shadow_polygonfactor); Cvar_RegisterVariable(&r_shadow_polygonoffset); Cvar_RegisterVariable(&r_shadow_texture3d); @@ -3341,8 +3339,9 @@ void R_Shadow_DrawWorldShadow_ShadowVolume(int numsurfaces, int *surfacelist, co } CHECKGLERROR } - else if (numsurfaces && r_refdef.scene.worldmodel->brush.shadowmesh && r_shadow_culltriangles.integer) + else if (numsurfaces && r_refdef.scene.worldmodel->brush.shadowmesh) { + // use the shadow trispvs calculated earlier by GetLightInfo to cull world triangles on this dynamic light R_Shadow_PrepareShadowMark(r_refdef.scene.worldmodel->brush.shadowmesh->numtriangles); for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++) { diff --git a/r_shadow.h b/r_shadow.h index 20f1e5c4..1c11ae82 100644 --- a/r_shadow.h +++ b/r_shadow.h @@ -32,7 +32,6 @@ extern cvar_t r_shadow_realtime_world_compileshadow; extern cvar_t r_shadow_realtime_world_compilesvbsp; extern cvar_t r_shadow_realtime_world_compileportalculling; extern cvar_t r_shadow_scissor; -extern cvar_t r_shadow_culltriangles; extern cvar_t r_shadow_polygonfactor; extern cvar_t r_shadow_polygonoffset; extern cvar_t r_shadow_singlepassvolumegeneration;