summaryrefslogtreecommitdiff
path: root/libs/hwui/ProgramCache.cpp
diff options
context:
space:
mode:
author ztenghui <ztenghui@google.com> 2015-04-09 17:48:59 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-04-09 17:49:00 +0000
commit3f6d5aa5dd39ec326b60ba0e3b2742a2abaab69a (patch)
tree3856269d998f1c4bd5ef0e769b59a24c00dc1c56 /libs/hwui/ProgramCache.cpp
parent52f57de9f618f4b3303fb9b59084e775f5312984 (diff)
parentecf091e171012831cddea59f1f64a46e87ee8c4f (diff)
Merge "Update the shadow fall off function from cosine to gaussian."
Diffstat (limited to 'libs/hwui/ProgramCache.cpp')
-rw-r--r--libs/hwui/ProgramCache.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index e9b22e20bc18..41adda15f367 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -240,8 +240,9 @@ const char* gFS_Main_ModulateColor =
const char* gFS_Main_ApplyVertexAlphaLinearInterp =
" fragColor *= alpha;\n";
const char* gFS_Main_ApplyVertexAlphaShadowInterp =
- " fragColor *= (1.0 - cos(alpha)) / 2.0;\n";
-
+ // Use a gaussian function for the shadow fall off. Note that alpha here
+ // is actually (1.0 - alpha) for saving computation.
+ " fragColor *= exp(- alpha * alpha * 4.0) - 0.018;\n";
const char* gFS_Main_FetchTexture[2] = {
// Don't modulate
" fragColor = texture2D(baseSampler, outTexCoords);\n",