diff options
Diffstat (limited to 'examples/shadereffectitem/Effectoids/Colorize.qml')
-rw-r--r-- | examples/shadereffectitem/Effectoids/Colorize.qml | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/shadereffectitem/Effectoids/Colorize.qml b/examples/shadereffectitem/Effectoids/Colorize.qml index 4d6ad53..dead5cf 100644 --- a/examples/shadereffectitem/Effectoids/Colorize.qml +++ b/examples/shadereffectitem/Effectoids/Colorize.qml @@ -45,23 +45,24 @@ ShaderEffectItem { fragmentShader: "varying highp vec2 qt_TexCoord; \n" + - "uniform sampler2D source; \n" + + "uniform lowp sampler2D source; \n" + "uniform lowp vec4 color; \n" + "uniform lowp float intensity; \n" + + "uniform lowp float qt_Opacity; \n" + "void main() { \n" + - " lowp vec4 pix = texture2D(source, qt_TexCoord); \n" + - " lowp float gray = dot(pix.rgb, vec3(0.5, 0.5, 0.5)); \n" + - " gl_FragColor = mix(pix, color * (gray * pix.w), intensity); \n" + + " lowp vec4 pix = texture2D(source, qt_TexCoord); \n" + + " lowp float gray = dot(pix.xyz, vec3(0.5, 0.5, 0.5)); \n" + + " gl_FragColor = qt_Opacity * mix(pix, vec4(color.xyz * gray, pix.w), intensity); \n" + "}" vertexShader: - "attribute highp vec4 qt_VertexPosition; \n" + - "attribute highp vec2 qt_VertexTexCoord; \n" + - "uniform highp mat4 qt_Matrix; \n" + - "varying highp vec2 qt_TexCoord; \n" + - "void main() { \n" + - " qt_TexCoord = qt_VertexTexCoord; \n" + - " gl_Position = qt_Matrix * qt_VertexPosition; \n" + + "attribute highp vec4 qt_Vertex; \n" + + "attribute highp vec2 qt_MultiTexCoord0; \n" + + "uniform highp mat4 qt_Matrix; \n" + + "varying highp vec2 qt_TexCoord; \n" + + "void main() { \n" + + " qt_TexCoord = qt_MultiTexCoord0; \n" + + " gl_Position = qt_Matrix * qt_Vertex; \n" + "}" property variant source; @@ -69,6 +70,5 @@ ShaderEffectItem property color color; property real intensity; active: intensity > 0 - anchors.fill: source - + property variant source } |