diff options
author | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2013-12-29 14:15:41 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-30 14:47:13 +0100 |
commit | 309e9b03d24eb6b0b8fff04d883329c2f93a6a1c (patch) | |
tree | 5a028865572eeb20ffeac87ac0ad856a8d1e36f7 | |
parent | 437b7907f3f5c4ff2c3433a8d0cd4afa86b67fdf (diff) | |
download | qtwayland-309e9b03d24eb6b0b8fff04d883329c2f93a6a1c.tar.gz qtwayland-309e9b03d24eb6b0b8fff04d883329c2f93a6a1c.tar.bz2 qtwayland-309e9b03d24eb6b0b8fff04d883329c2f93a6a1c.zip |
Fix ConstrastEffect in qml-compositor
Specify precision to make the shader working.
Change-Id: I055fe47e1073403dc981274236fa82e091e0eca4
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
-rw-r--r-- | examples/qml-compositor/ContrastEffect.qml | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/qml-compositor/ContrastEffect.qml b/examples/qml-compositor/ContrastEffect.qml index 5159950d..c284b290 100644 --- a/examples/qml-compositor/ContrastEffect.qml +++ b/examples/qml-compositor/ContrastEffect.qml @@ -75,15 +75,15 @@ ShaderEffect { vertexShader: source && source.isYInverted ? vShaderInvertedY : vShader fragmentShader: " - uniform sampler2D source; - uniform float qt_Opacity; - uniform vec4 color; - uniform float blend; + uniform lowp sampler2D source; + uniform highp float qt_Opacity; + uniform highp vec4 color; + uniform highp float blend; varying highp vec2 qt_TexCoord0; void main() { - vec4 sourceColor = texture2D(source, qt_TexCoord0); - vec3 delta = sourceColor.rgb - vec3(0.5); - vec3 lowerContrast = vec3(0.5) + 0.4 * delta; + highp vec4 sourceColor = texture2D(source, qt_TexCoord0); + highp vec3 delta = sourceColor.rgb - vec3(0.5); + highp vec3 lowerContrast = vec3(0.5) + 0.4 * delta; gl_FragColor = qt_Opacity * mix(sourceColor, color * sourceColor.a * dot(lowerContrast, vec3(11, 16, 5) * (1. / 32.)), blend); } " |