Visible surfaces are gathered in processing (gathering) render phase and lightmaps drawn before rendering

This commit is contained in:
RaveYard 2023-09-09 17:56:46 +02:00 committed by Magnus Norddahl
commit d96d1aeffc
4 changed files with 61 additions and 59 deletions

View file

@ -347,11 +347,6 @@ void HWWall::DrawWall(HWDrawInfo *di, FRenderState &state, bool translucent)
MakeVertices(di, state, !!(flags & HWWall::HWF_TRANSLUCENT));
}
if (lightmap)
{
state.PushVisibleSurface(lightmap - &seg->Subsector->sector->Level->levelMesh->Surfaces[0], lightmap);
}
state.SetNormal(glseg.Normal());
if (!translucent)
{
@ -1270,6 +1265,10 @@ void HWWall::DoTexture(HWDrawInfo *di, FRenderState& state, int _type,seg_t * se
if (seg->sidedef->lightmap && type >= RENDERWALL_TOP && type <= RENDERWALL_BOTTOM)
{
lightmap = seg->sidedef->lightmap[type - RENDERWALL_TOP];
if (lightmap)
{
state.PushVisibleSurface(lightmap - &seg->Subsector->sector->Level->levelMesh->Surfaces[0], lightmap);
}
}
else
{