]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
don't R_UpdateAllTextureInfo when doing shadows or lighting on world,
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 17 Dec 2007 08:51:45 +0000 (08:51 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 17 Dec 2007 08:51:45 +0000 (08:51 +0000)
because its texture info only really needs to be updated once per frame,
it doesn't change because it is not instanced and can not have alternate
textures or colormod

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7814 d7cf8633-e32d-0410-b094-e92efae38249

gl_rsurf.c

index b333d16f4a70361b9ad3cf7dd063df6f92a2f676..9dd089fed970d5449ce5a277eb8e8b8ed63b01d1 100644 (file)
@@ -899,7 +899,8 @@ void R_Q1BSP_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, floa
                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)
        {
@@ -962,7 +963,8 @@ void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin,
        // 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)
@@ -1042,8 +1044,13 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface
        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;