mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
Add light probes to wall decals
This commit is contained in:
parent
96383792fa
commit
ea560172f7
1 changed files with 13 additions and 0 deletions
|
@ -61,6 +61,19 @@ void HWDecal::DrawDecal(HWDrawInfo *di, FRenderState &state)
|
|||
state.SetObjectColor(DecalColor);
|
||||
|
||||
state.SetLightIndex(dynlightindex);
|
||||
|
||||
// add light probe contribution
|
||||
if (di->Level->LightProbes.Size() > 0)
|
||||
{
|
||||
double x, y;
|
||||
decal->GetXY(decal->Side, x, y);
|
||||
LightProbe *probe = FindLightProbe(di->Level, x, y, decal->GetRealZ(decal->Side) * 0.5);
|
||||
if (probe)
|
||||
{
|
||||
state.SetDynLight(probe->Red, probe->Green, probe->Blue);
|
||||
}
|
||||
}
|
||||
|
||||
state.SetTextureMode(decal->RenderStyle);
|
||||
state.SetRenderStyle(decal->RenderStyle);
|
||||
state.SetMaterial(texture, UF_Sprite, 0, CLAMP_XY, decal->Translation, -1);
|
||||
|
|
Loading…
Reference in a new issue