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
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;
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)"};
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);
}
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++)
{
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;