Use a faster way to find the closest light probe

Fix light probe not being applied to psprite
This commit is contained in:
Magnus Norddahl 2021-10-14 05:43:35 +02:00
commit 764a08752f
8 changed files with 103 additions and 28 deletions

View file

@ -172,6 +172,12 @@ void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
di->GetDynSpriteLight(gl_light_sprites ? actor : nullptr, gl_light_particles ? particle : nullptr, out);
state.SetDynLight(out[0], out[1], out[2]);
}
else if (di->Level->LightProbes.Size() > 0)
{
LightProbe* probe = FindLightProbe(di->Level, actor->X(), actor->Y(), actor->Center());
if (probe)
state.SetDynLight(probe->Red, probe->Green, probe->Blue);
}
}
sector_t *cursec = actor ? actor->Sector : particle ? particle->subsector->sector : nullptr;
if (cursec != nullptr)