r_surfacelist[numsurfacelist++] = surfaces + j;
}
// update lightmaps if needed
- if (update)
+ if (model->brushq1.firstrender)
+ {
+ model->brushq1.firstrender = false;
+ for (j = model->firstmodelsurface, endj = model->firstmodelsurface + model->nummodelsurfaces;j < endj;j++)
+ if (update[j])
+ R_BuildLightMap(r_refdef.scene.worldentity, surfaces + j);
+ }
+ else if (update)
{
- int updated = 0;
for (j = model->firstmodelsurface, endj = model->firstmodelsurface + model->nummodelsurfaces;j < endj;j++)
- {
if (r_refdef.viewcache.world_surfacevisible[j])
- {
if (update[j])
- {
- updated++;
R_BuildLightMap(r_refdef.scene.worldentity, surfaces + j);
- }
- }
- }
}
// don't do anything if there were no surfaces
if (!numsurfacelist)
loadmodel->num_surfaces = count;
+ loadmodel->brushq1.firstrender = true;
loadmodel->brushq1.lightmapupdateflags = (unsigned char *)Mem_Alloc(loadmodel->mempool, count*sizeof(unsigned char));
totalverts = 0;
// this contains bytes that are 1 if a surface needs its lightmap rebuilt
unsigned char *lightmapupdateflags;
+ qboolean firstrender; // causes all surface lightmaps to be loaded in first frame
}
model_brushq1_t;