info.pvs = info.model->brush.GetPVS(info.model, info.relativelightorigin);
else
info.pvs = NULL;
- R_UpdateAllTextureInfo(ent);
+ if (ent != r_refdef.worldentity)
+ R_UpdateAllTextureInfo(ent);
if (r_shadow_frontsidecasting.integer && r_shadow_compilingrtlight && r_shadow_realtime_world_compileportalculling.integer)
{
// check the box in modelspace, it was already checked in worldspace
if (!BoxesOverlap(model->normalmins, model->normalmaxs, lightmins, lightmaxs))
return;
- R_UpdateAllTextureInfo(ent);
+ if (ent != r_refdef.worldentity)
+ R_UpdateAllTextureInfo(ent);
if (ent->model->brush.submodel)
GL_PolygonOffset(r_refdef.shadowpolygonfactor + r_polygonoffset_submodel_factor.value, r_refdef.shadowpolygonoffset + r_polygonoffset_submodel_offset.value);
if (model->brush.shadowmesh)
int batchelements[BATCHSIZE*3];
texture_t *tex;
CHECKGLERROR
- RSurf_ActiveModelEntity(ent, true, true);
- R_UpdateAllTextureInfo(ent);
+ if (ent == r_refdef.worldentity)
+ RSurf_ActiveWorldEntity();
+ else
+ {
+ RSurf_ActiveModelEntity(ent, true, true);
+ R_UpdateAllTextureInfo(ent);
+ }
CHECKGLERROR
culltriangles = r_shadow_culltriangles.integer && !(ent->flags & RENDER_NOSELFSHADOW);
element3i = rsurface.modelelement3i;