Fix redundant 2D shadowmap test for lightmap lights
This commit is contained in:
parent
c66b809d4e
commit
c72092ffed
1 changed files with 2 additions and 2 deletions
|
|
@ -158,7 +158,7 @@ void HWDrawInfo::GetDynSpriteLight(AActor *self, float x, float y, float z, FLig
|
|||
dist = (float)L.LengthSquared();
|
||||
radius = light->GetRadius();
|
||||
|
||||
if (dist < radius * radius)
|
||||
if (radius > 0 && dist < radius * radius)
|
||||
{
|
||||
dist = sqrtf(dist); // only calculate the square root if we really need it.
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ void HWDrawInfo::GetDynSpriteLight(AActor *self, float x, float y, float z, FLig
|
|||
frac *= (float)smoothstep(light->pSpotOuterAngle->Cos(), light->pSpotInnerAngle->Cos(), cosDir);
|
||||
}
|
||||
|
||||
if (frac > 0 && (!light->shadowmapped || (light->GetRadius() > 0 && screen->mShadowMap->ShadowTest(light->Pos, { x, y, z }))))
|
||||
if (frac > 0 && (!light->shadowmapped || light->Trace() || screen->mShadowMap->ShadowTest(light->Pos, { x, y, z })))
|
||||
{
|
||||
lr = light->GetRed() / 255.0f;
|
||||
lg = light->GetGreen() / 255.0f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue