cvar_t r_editlights_rtlightssizescale = {CVAR_SAVE, "r_editlights_rtlightssizescale", "0.7"};
cvar_t r_editlights_rtlightscolorscale = {CVAR_SAVE, "r_editlights_rtlightscolorscale", "2"};
-int c_rt_lights, c_rt_clears, c_rt_scissored;
-int c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris;
-int c_rtcached_shadowmeshes, c_rtcached_shadowtris;
-
float r_shadow_attenpower, r_shadow_attenscale;
rtlight_t *r_shadow_compilingrtlight;
qglEnable(GL_CULL_FACE);
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
r_shadowstage = SHADOWSTAGE_NONE;
-
- c_rt_lights = c_rt_clears = c_rt_scissored = 0;
- c_rt_shadowmeshes = c_rt_shadowtris = c_rt_lightmeshes = c_rt_lighttris = 0;
- c_rtcached_shadowmeshes = c_rtcached_shadowtris = 0;
}
void R_Shadow_Stage_ShadowVolumes(void)
VectorCopy(rtlight->cullmins, cullmins);
VectorCopy(rtlight->cullmaxs, cullmaxs);
}
- else if (cl.worldmodel && cl.worldmodel->GetLightInfo)
+ else if (r_refdef.worldmodel && r_refdef.worldmodel->GetLightInfo)
{
// dynamic light, world available and can receive realtime lighting
// if the light box is offscreen, skip it right away
if (R_CullBox(cullmins, cullmaxs))
return;
// calculate lit surfaces and clusters
- R_Shadow_EnlargeClusterBuffer(cl.worldmodel->brush.num_pvsclusters);
- R_Shadow_EnlargeSurfaceBuffer(cl.worldmodel->nummodelsurfaces);
- cl.worldmodel->GetLightInfo(&cl_entities[0].render, rtlight->shadoworigin, rtlight->radius, cullmins, cullmaxs, r_shadow_buffer_clusterlist, r_shadow_buffer_clusterpvs, &numclusters, r_shadow_buffer_surfacelist, r_shadow_buffer_surfacepvs, &numsurfaces);
+ R_Shadow_EnlargeClusterBuffer(r_refdef.worldmodel->brush.num_pvsclusters);
+ R_Shadow_EnlargeSurfaceBuffer(r_refdef.worldmodel->nummodelsurfaces);
+ r_refdef.worldmodel->GetLightInfo(&cl_entities[0].render, rtlight->shadoworigin, rtlight->radius, cullmins, cullmaxs, r_shadow_buffer_clusterlist, r_shadow_buffer_clusterpvs, &numclusters, r_shadow_buffer_surfacelist, r_shadow_buffer_surfacepvs, &numsurfaces);
clusterlist = r_shadow_buffer_clusterlist;
clusterpvs = r_shadow_buffer_clusterpvs;
surfacelist = r_shadow_buffer_surfacelist;
{
if (!BoxesOverlap(ent->mins, ent->maxs, cullmins, cullmaxs))
continue;
- if (cl.worldmodel != NULL && cl.worldmodel->brush.BoxTouchingPVS != NULL && !cl.worldmodel->brush.BoxTouchingPVS(cl.worldmodel, clusterpvs, ent->mins, ent->maxs))
+ if (r_refdef.worldmodel != NULL && r_refdef.worldmodel->brush.BoxTouchingPVS != NULL && !r_refdef.worldmodel->brush.BoxTouchingPVS(r_refdef.worldmodel, clusterpvs, ent->mins, ent->maxs))
continue;
}
if (!(ent->flags & RENDER_SHADOW) || !ent->model || !ent->model->DrawShadowVolume)
dlight_t *light;
rmeshstate_t m;
- if (cl.worldmodel && strncmp(cl.worldmodel->name, r_shadow_mapname, sizeof(r_shadow_mapname)))
+ if (r_refdef.worldmodel && strncmp(r_refdef.worldmodel->name, r_shadow_mapname, sizeof(r_shadow_mapname)))
R_Shadow_EditLights_Reload_f();
if (visiblevolumes)
int n, a, style, shadow, flags;
char name[MAX_QPATH], cubemapname[MAX_QPATH], *lightsstring, *s, *t;
float origin[3], radius, color[3], angles[3], corona, coronasizescale, ambientscale, diffusescale, specularscale;
- if (cl.worldmodel == NULL)
+ if (r_refdef.worldmodel == NULL)
{
Con_Print("No map loaded.\n");
return;
}
- FS_StripExtension (cl.worldmodel->name, name, sizeof (name));
+ FS_StripExtension (r_refdef.worldmodel->name, name, sizeof (name));
strlcat (name, ".rtlights", sizeof (name));
lightsstring = FS_LoadFile(name, tempmempool, false);
if (lightsstring)
char line[1024];
if (!r_shadow_worldlightchain)
return;
- if (cl.worldmodel == NULL)
+ if (r_refdef.worldmodel == NULL)
{
Con_Print("No map loaded.\n");
return;
}
- FS_StripExtension (cl.worldmodel->name, name, sizeof (name));
+ FS_StripExtension (r_refdef.worldmodel->name, name, sizeof (name));
strlcat (name, ".rtlights", sizeof (name));
bufchars = bufmaxchars = 0;
buf = NULL;
int n, a, style;
char name[MAX_QPATH], *lightsstring, *s, *t;
float origin[3], radius, color[3], subtract, spotdir[3], spotcone, falloff, distbias;
- if (cl.worldmodel == NULL)
+ if (r_refdef.worldmodel == NULL)
{
Con_Print("No map loaded.\n");
return;
}
- FS_StripExtension (cl.worldmodel->name, name, sizeof (name));
+ FS_StripExtension (r_refdef.worldmodel->name, name, sizeof (name));
strlcat (name, ".lights", sizeof (name));
lightsstring = FS_LoadFile(name, tempmempool, false);
if (lightsstring)
float origin[3], angles[3], radius, color[3], light[4], fadescale, lightscale, originhack[3], overridecolor[3], vec[4];
char key[256], value[1024];
- if (cl.worldmodel == NULL)
+ if (r_refdef.worldmodel == NULL)
{
Con_Print("No map loaded.\n");
return;
}
// try to load a .ent file first
- FS_StripExtension (cl.worldmodel->name, key, sizeof (key));
+ FS_StripExtension (r_refdef.worldmodel->name, key, sizeof (key));
strlcat (key, ".ent", sizeof (key));
data = entfiledata = FS_LoadFile(key, tempmempool, true);
// and if that is not found, fall back to the bsp file entity string
if (!data)
- data = cl.worldmodel->brush.entities;
+ data = r_refdef.worldmodel->brush.entities;
if (!data)
return;
for (entnum = 0;COM_ParseToken(&data, false) && com_token[0] == '{';entnum++)
}
else if (!strcmp("style", key))
style = atoi(value);
- else if (cl.worldmodel->type == mod_brushq3)
+ else if (r_refdef.worldmodel->type == mod_brushq3)
{
if (!strcmp("scale", key))
lightscale = atof(value);
void R_Shadow_EditLights_Reload_f(void)
{
- if (!cl.worldmodel)
+ if (!r_refdef.worldmodel)
return;
- strlcpy(r_shadow_mapname, cl.worldmodel->name, sizeof(r_shadow_mapname));
+ strlcpy(r_shadow_mapname, r_refdef.worldmodel->name, sizeof(r_shadow_mapname));
R_Shadow_ClearWorldLights();
R_Shadow_LoadWorldLights();
if (r_shadow_worldlightchain == NULL)
void R_Shadow_EditLights_Save_f(void)
{
- if (!cl.worldmodel)
+ if (!r_refdef.worldmodel)
return;
R_Shadow_SaveWorldLights();
}