mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
Do not update every visible lightmap every frame.
This takes nq from ~25fps to 65-72 fps on Unforgiven's start map.
This commit is contained in:
parent
d18aa2fe3e
commit
2595251162
1 changed files with 17 additions and 1 deletions
|
@ -317,6 +317,22 @@ R_ClearElements (void)
|
|||
release_elementss ();
|
||||
}
|
||||
|
||||
static void
|
||||
update_lightmap (msurface_t *surf)
|
||||
{
|
||||
int maps;
|
||||
|
||||
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++)
|
||||
if (d_lightstylevalue[surf->styles[maps]] != surf->cached_light[maps])
|
||||
goto dynamic;
|
||||
|
||||
if ((surf->dlightframe == r_framecount) || surf->cached_dlight) {
|
||||
dynamic:
|
||||
if (r_dynamic->int_val)
|
||||
R_BuildLightMap (surf);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
chain_surface (msurface_t *surf, vec_t *transform)
|
||||
{
|
||||
|
@ -335,7 +351,7 @@ chain_surface (msurface_t *surf, vec_t *transform)
|
|||
tex = R_TextureAnimation (surf);
|
||||
CHAIN_SURF_F2B (surf, tex->tex_chain);
|
||||
|
||||
R_BuildLightMap (surf);
|
||||
update_lightmap (surf);
|
||||
}
|
||||
if (!(is = surf->instsurf))
|
||||
is = surf->tinst;
|
||||
|
|
Loading…
Reference in a new issue