}
if ((ambientscale + diffusescale) * VectorLength2(lightcolorbase) + specularscale * VectorLength2(lightcolorbase) < (1.0f / 1048576.0f))
return;
- GL_DepthRange(0, (rsurface.texture->currentmaterialflags & MATERIALFLAG_SHORTDEPTHRANGE) ? 0.0625 : 1);
- GL_PolygonOffset(rsurface.texture->currentpolygonfactor, rsurface.texture->currentpolygonoffset);
- GL_DepthTest(!(rsurface.texture->currentmaterialflags & MATERIALFLAG_NODEPTHTEST));
- GL_CullFace((rsurface.texture->currentmaterialflags & MATERIALFLAG_NOCULLFACE) ? GL_NONE : r_view.cullface_back);
+ RSurf_SetupDepthAndCulling();
nmap = rsurface.texture->currentskinframe->nmap;
if (gl_lightmaps.integer)
nmap = r_texture_blanknormalmap;
r_refdef.worldmodel->DrawLight(r_refdef.worldentity, numsurfaces, surfacelist, trispvs);
}
-void R_Shadow_DrawEntityLight(entity_render_t *ent, int numsurfaces, int *surfacelist)
+void R_Shadow_DrawEntityLight(entity_render_t *ent)
{
model_t *model = ent->model;
if (!model->DrawLight)
// draw lighting in the unmasked areas
R_Shadow_RenderMode_Lighting(true, false);
for (i = 0;i < numlightentities_noselfshadow;i++)
- R_Shadow_DrawEntityLight(lightentities_noselfshadow[i], numsurfaces, surfacelist);
+ R_Shadow_DrawEntityLight(lightentities_noselfshadow[i]);
// optionally draw the illuminated areas
// for performance analysis by level designers
{
R_Shadow_RenderMode_VisibleLighting(!r_showdisabledepthtest.integer, false);
for (i = 0;i < numlightentities_noselfshadow;i++)
- R_Shadow_DrawEntityLight(lightentities_noselfshadow[i], numsurfaces, surfacelist);
+ R_Shadow_DrawEntityLight(lightentities_noselfshadow[i]);
}
R_Shadow_RenderMode_StencilShadowVolumes(false);
if (numsurfaces)
R_Shadow_DrawWorldLight(numsurfaces, surfacelist, lighttrispvs);
for (i = 0;i < numlightentities;i++)
- R_Shadow_DrawEntityLight(lightentities[i], numsurfaces, surfacelist);
+ R_Shadow_DrawEntityLight(lightentities[i]);
// optionally draw the illuminated areas
// for performance analysis by level designers
if (numsurfaces)
R_Shadow_DrawWorldLight(numsurfaces, surfacelist, lighttrispvs);
for (i = 0;i < numlightentities;i++)
- R_Shadow_DrawEntityLight(lightentities[i], numsurfaces, surfacelist);
+ R_Shadow_DrawEntityLight(lightentities[i]);
}
}
}
if (numsurfaces)
R_Shadow_DrawWorldLight(numsurfaces, surfacelist, lighttrispvs);
for (i = 0;i < numlightentities;i++)
- R_Shadow_DrawEntityLight(lightentities[i], numsurfaces, surfacelist);
+ R_Shadow_DrawEntityLight(lightentities[i]);
for (i = 0;i < numlightentities_noselfshadow;i++)
- R_Shadow_DrawEntityLight(lightentities_noselfshadow[i], numsurfaces, surfacelist);
+ R_Shadow_DrawEntityLight(lightentities_noselfshadow[i]);
// optionally draw the illuminated areas
// for performance analysis by level designers
if (numsurfaces)
R_Shadow_DrawWorldLight(numsurfaces, surfacelist, lighttrispvs);
for (i = 0;i < numlightentities;i++)
- R_Shadow_DrawEntityLight(lightentities[i], numsurfaces, surfacelist);
+ R_Shadow_DrawEntityLight(lightentities[i]);
for (i = 0;i < numlightentities_noselfshadow;i++)
- R_Shadow_DrawEntityLight(lightentities_noselfshadow[i], numsurfaces, surfacelist);
+ R_Shadow_DrawEntityLight(lightentities_noselfshadow[i]);
}
}
}