[gl] Draw sky chains before brush entities

Drawing sky chains first ensures that sky surfaces correctly block parts
of the map that should not be visible (by writing the correct depth to
the depth buffer when doing box or dome skies). Writing brush models
first means that the models (ammo boxes etc) could be visible when they
should not be.
This commit is contained in:
Bill Currie 2022-03-07 08:40:39 +09:00
parent 71c1b4e0c4
commit 9514ad1ae4

View file

@ -739,6 +739,11 @@ gl_R_DrawWorld (void)
bctx.entity = &r_worldentity;
R_VisitWorldNodes (&bctx);
gl_R_CalcLightmaps ();
gl_R_DrawSkyChain (sky_chain);
if (r_drawentities->int_val) {
for (size_t i = 0; i < r_ent_queue->ent_queues[mod_brush].size; i++) { \
entity_t *ent = r_ent_queue->ent_queues[mod_brush].a[i]; \
@ -746,10 +751,6 @@ gl_R_DrawWorld (void)
}
}
gl_R_CalcLightmaps ();
gl_R_DrawSkyChain (sky_chain);
if (!gl_Fog_GetDensity ()
|| (gl_fb_bmodels->int_val && gl_mtex_fullbright)
|| gl_mtex_active_tmus > 1) {