void R_Shadow_DrawWorldLightShadowVolume(matrix4x4_t *matrix, worldlight_t *light);
-extern void R_Model_Brush_DrawLightForSurfaceList(entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativeeyeorigin, float lightradius, float *lightcolor, msurface_t **surflist, int numsurfaces, const matrix4x4_t *matrix_modeltofilter, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz);
void R_ShadowVolumeLighting(int visiblevolumes)
{
int i;
if (!visiblevolumes)
R_Shadow_Stage_ShadowVolumes();
ent = &cl_entities[0].render;
- if (wl->shadowvolume && r_shadow_staticworldlights.integer)
- R_Shadow_DrawWorldLightShadowVolume(&ent->matrix, wl);
+ if (r_shadow_staticworldlights.integer)
+ R_Shadow_DrawStaticWorldLight_Shadow(wl, &ent->matrix);
else
R_TestAndDrawShadowVolume(ent, wl->origin, cullradius, lightradius, wl->mins, wl->maxs, clipmins, clipmaxs, true);
if (r_drawentities.integer)
Matrix4x4_Concat(&matrix_modeltofilter, &matrix_worldtofilter, &ent->matrix);
Matrix4x4_Concat(&matrix_modeltoattenuationxyz, &matrix_worldtoattenuationxyz, &ent->matrix);
Matrix4x4_Concat(&matrix_modeltoattenuationz, &matrix_worldtoattenuationz, &ent->matrix);
- if (wl->numsurfaces)
- R_Model_Brush_DrawLightForSurfaceList(ent, relativelightorigin, relativeeyeorigin, lightradius, lightcolor, wl->surfaces, wl->numsurfaces, &matrix_modeltofilter, &matrix_modeltoattenuationxyz, &matrix_modeltoattenuationz);
+ if (r_shadow_staticworldlights.integer)
+ R_Shadow_DrawStaticWorldLight_Light(wl, &ent->matrix, relativelightorigin, relativeeyeorigin, lightradius, lightcolor, &matrix_modeltofilter, &matrix_modeltoattenuationxyz, &matrix_modeltoattenuationz);
else
ent->model->DrawLight(ent, relativelightorigin, relativeeyeorigin, lightradius / ent->scale, lightcolor, &matrix_modeltofilter, &matrix_modeltoattenuationxyz, &matrix_modeltoattenuationz);
}
cullradius = RadiusFromBoundsAndOrigin(clipmins, clipmaxs, rd->origin);
VectorScale(rd->light, (1.0f / 4096.0f), lightcolor);
- if (gl_stencil || visiblevolumes)
+ if (r_shadow_shadows.integer && (gl_stencil || visiblevolumes))
{
if (!visiblevolumes)
R_Shadow_Stage_ShadowVolumes();
if (!visiblevolumes)
{
- if (gl_stencil)
+ if (r_shadow_shadows.integer && gl_stencil)
R_Shadow_Stage_LightWithShadows();
else
R_Shadow_Stage_LightWithoutShadows();
{
if (!gl_stencil)
{
- Con_Printf("Stencil not enabled, turning off r_shadow_realtime_world, please type vid_stencil 1;vid_bitsperpixel 32;vid_restart and try again\n");
+ Con_Printf("Realtime world lighting requires 32bit color turning off r_shadow_realtime_world, please type vid_bitsperpixel 32;vid_restart and try again\n");
Cvar_SetValueQuick(&r_shadow_realtime_world, 0);
}
}
R_TimeReport("markentity");
GL_SetupView_ViewPort(r_refdef.x, r_refdef.y, r_refdef.width, r_refdef.height);
- if (r_shadow_realtime_world.integer || gl_stencil)
+ if ((r_shadow_realtime_world.integer || r_shadow_shadows.integer) && gl_stencil)
GL_SetupView_Mode_PerspectiveInfiniteFarClip(r_refdef.fov_x, r_refdef.fov_y, 1.0f);
else
GL_SetupView_Mode_Perspective(r_refdef.fov_x, r_refdef.fov_y, 1.0f, r_farclip);