Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76cb25b6 authored by Teng-Hui Zhu's avatar Teng-Hui Zhu Committed by The Android Automerger
Browse files

When the incoming light source is invalid, don't generate any shadow

b/25417885

Change-Id: I4b87e35ca68091fd0409cb9fe9b9400af860a507
parent 12412ce8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -80,6 +80,11 @@ void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque,
    ALOGD("light center %f %f %f %d",
            adjustedLightCenter.x, adjustedLightCenter.y, adjustedLightCenter.z, lightRadius);
#endif
    if (isnan(adjustedLightCenter.x)
            || isnan(adjustedLightCenter.y)
            || isnan(adjustedLightCenter.z)) {
        return;
    }

    // light position (because it's in local space) needs to compensate for receiver transform
    // TODO: should apply to light orientation, not just position