Switch to cos interpolation of shadow alpha
bug:16852257
Updates default shadow opacities to compensate.
Also, update variable/constant naming related to vertex alpha.
Change-Id: I9055b4ac3c9ac305ca9d515f21b52d6aa6dc9c5c
diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp
index 181230a..9cc83ed 100644
--- a/libs/hwui/AmbientShadow.cpp
+++ b/libs/hwui/AmbientShadow.cpp
@@ -117,10 +117,13 @@
// inner ring of points
float opacity = 1.0 / (1 + rayHeight[rayIndex] * heightFactor);
+ // NOTE: Shadow alpha values are transformed when stored in alphavertices,
+ // so that they can be consumed directly by gFS_Main_ApplyVertexAlphaShadowInterp
+ float transformedOpacity = acos(1.0f - 2.0f * opacity);
AlphaVertex::set(&shadowVertices[rays + rayIndex],
intersection.x,
intersection.y,
- opacity);
+ transformedOpacity);
}
if (isCasterOpaque) {