From 91a8c7c62913c2597e3bf5a6d59d2ed5fc7ba4e0 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Tue, 12 Aug 2014 14:31:35 -0700 Subject: 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 --- libs/hwui/AmbientShadow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libs/hwui/AmbientShadow.cpp') diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp index 181230ad7547..9cc83ed68755 100644 --- a/libs/hwui/AmbientShadow.cpp +++ b/libs/hwui/AmbientShadow.cpp @@ -117,10 +117,13 @@ void AmbientShadow::createAmbientShadow(bool isCasterOpaque, // 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) { -- cgit v1.2.3-59-g8ed1b