summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-09-13 20:31:08 -0700
committerRomain Guy <romainguy@google.com>2012-09-14 10:50:51 -0700
commita938f569ce206c1ed68d736181016b5b708c0084 (patch)
tree5a607bc80af329334757c13e978f7c9b978122a8 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parent494ac35c27a0960f57b00bf8457f1956ecf149a2 (diff)
Fix modulation and gamma correction issues
Modulation is normally enabled in a shader when drawing with an alpha mask (A8 texture.) Modulation is used to do one of two things: - Colorize the primitive (to draw text in red for instance) - Apply extra translucency (50% translucent circle filled with a bitmap) The current implementation has four issues: 1. Unnecessary work is performed by assigning the modulation color to vec4 fragColor early in the shader 2. The modulation color's alpha is applied twice when the primitive is drawn with an SkShader 3. The decision to modulate is wrong and triggers when any of the RGB channels is < 1.0. Only the alpha channel needs to be taken into account to make the decision 4. Gamma correction is not applied properly This change addresses all four issues above. Change-Id: I73fcc74efc4b094bf2d1b835f10ffaa2ea4b9eb9
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions