Skip to content

Commit

Permalink
Merge remote-tracking branch 'nash/lightmaps2' into lightmaps2
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Oct 22, 2021
2 parents adda5da + b657478 commit b52aea5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/rendering/hwrenderer/scene/hw_decal.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit b52aea5

Please sign in to comment.