Merge "When the incoming light source is invalid, don\'t generate any shadow" into mnc-dr-dev am: 76d20b4a5c am: 1c7fbe0efb am: d829ab7683

am: dfaf23f846

* commit 'dfaf23f84669b2f45da892f49b2d8c07f161f7a2':
  When the incoming light source is invalid, don't generate any shadow
This commit is contained in:
Tenghui Zhu
2015-11-05 21:18:00 +00:00
committed by android-build-merger

View File

@@ -76,6 +76,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