From 14535d4bd2a4f966f9438e9af00c8fa51c71afac Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 23 Nov 2010 14:57:34 +0100 Subject: Updated the ShaderEffectItem examples. --- .../shadereffectitem/Effectoids/Box4PointBlur.qml | 53 ++++++------ examples/shadereffectitem/Effectoids/Colorize.qml | 26 +++--- .../Effectoids/Directional4PointBlur.qml | 57 ++++++------- .../Effectoids/Directional8PointBlur.qml | 98 +++++++++++----------- .../shadereffectitem/Effectoids/DropShadow.qml | 59 +++++++------ examples/shadereffectitem/test-boxblur-4point.qml | 43 +++++++++- examples/shadereffectitem/test-colorize.qml | 1 + .../shadereffectitem/test-directional-4point.qml | 13 ++- .../shadereffectitem/test-directional-8point.qml | 13 ++- examples/shadereffectitem/test-dropshadow.qml | 6 +- 10 files changed, 214 insertions(+), 155 deletions(-) (limited to 'examples') diff --git a/examples/shadereffectitem/Effectoids/Box4PointBlur.qml b/examples/shadereffectitem/Effectoids/Box4PointBlur.qml index f64fbe7..64cd727 100644 --- a/examples/shadereffectitem/Effectoids/Box4PointBlur.qml +++ b/examples/shadereffectitem/Effectoids/Box4PointBlur.qml @@ -48,39 +48,44 @@ ShaderEffectItem "varying highp vec2 my_TexCoord2; \n" + "varying highp vec2 my_TexCoord3; \n" + "varying highp vec2 my_TexCoord4; \n" + - "uniform sampler2D source; \n" + + "uniform lowp sampler2D source; \n" + + "uniform highp float qt_Opacity; \n" + "void main() { \n" + - " gl_FragColor = (texture2D(source, qt_TexCoord) \n" + - " + texture2D(source, my_TexCoord2) \n" + - " + texture2D(source, my_TexCoord3) \n" + - " + texture2D(source, my_TexCoord4)) * 0.25; \n" + + " gl_FragColor = qt_Opacity * (texture2D(source, qt_TexCoord) \n" + + " + texture2D(source, my_TexCoord2) \n" + + " + texture2D(source, my_TexCoord3) \n" + + " + texture2D(source, my_TexCoord4)) * 0.25; \n" + "}" vertexShader: - "attribute highp vec4 qt_VertexPosition; \n" + - "attribute highp vec2 qt_VertexTexCoord; \n" + - "uniform highp mat4 qt_Matrix; \n" + - "uniform highp float xOffset; \n" + - "uniform highp float yOffset; \n" + - "varying highp vec2 qt_TexCoord; \n" + - "varying highp vec2 my_TexCoord2; \n" + - "varying highp vec2 my_TexCoord3; \n" + - "varying highp vec2 my_TexCoord4; \n" + - "void main() { \n" + - " highp vec2 s1 = vec2(xOffset, yOffset); \n" + - " highp vec2 s2 = vec2(-xOffset, yOffset); \n" + - " qt_TexCoord = qt_VertexTexCoord + s1; \n" + - " my_TexCoord2 = qt_VertexTexCoord - s1; \n" + - " my_TexCoord3 = qt_VertexTexCoord + s2; \n" + - " my_TexCoord4 = qt_VertexTexCoord - s2; \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" + + "uniform highp float xOffset; \n" + + "uniform highp float yOffset; \n" + + "uniform highp vec2 _normMargins; \n" + + "varying highp vec2 qt_TexCoord; \n" + + "varying highp vec2 my_TexCoord2; \n" + + "varying highp vec2 my_TexCoord3; \n" + + "varying highp vec2 my_TexCoord4; \n" + + "void main() { \n" + + " highp vec2 s1 = vec2(xOffset, yOffset); \n" + + " highp vec2 s2 = vec2(-xOffset, yOffset); \n" + + " highp vec2 tcoord = mix(_normMargins, \n" + + " qt_MultiTexCoord0 - _normMargins, qt_MultiTexCoord0); \n" + + " qt_TexCoord = tcoord + s1; \n" + + " my_TexCoord2 = tcoord - s1; \n" + + " my_TexCoord3 = tcoord + s2; \n" + + " my_TexCoord4 = tcoord - s2; \n" + + " gl_Position = qt_Matrix * qt_Vertex; \n" + "}" property variant source; property real xOffset: 0.5 / width property real yOffset: 0.5 / height + property variant _normMargins: Qt.size(margins.width / (2 * margins.width + width), margins.height / (2 * margins.height + height)) + property variant margins: "margins" in source ? source.margins : Qt.size(0, 0) active: true blending: true - smooth: true - + property variant source } 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 } diff --git a/examples/shadereffectitem/Effectoids/Directional4PointBlur.qml b/examples/shadereffectitem/Effectoids/Directional4PointBlur.qml index d5ab6f9..4478dec 100644 --- a/examples/shadereffectitem/Effectoids/Directional4PointBlur.qml +++ b/examples/shadereffectitem/Effectoids/Directional4PointBlur.qml @@ -44,36 +44,37 @@ import QtQuick 2.0 ShaderEffectItem { fragmentShader: - "varying highp vec2 qt_TexCoord; \n" + - "varying highp vec2 qt_TexCoord2; \n" + - "varying highp vec2 qt_TexCoord3; \n" + - "varying highp vec2 qt_TexCoord4; \n" + - "uniform sampler2D source; \n" + - "void main() { \n" + - " gl_FragColor = ( 2. / 6. * texture2D(source, qt_TexCoord) \n" + - " + 1. / 6. * texture2D(source, qt_TexCoord2) \n" + - " + 2. / 6. * texture2D(source, qt_TexCoord3) \n" + - " + 1. / 6. * texture2D(source, qt_TexCoord4)); \n" + + "varying highp vec2 qt_TexCoord; \n" + + "varying highp vec2 qt_TexCoord2; \n" + + "varying highp vec2 qt_TexCoord3; \n" + + "varying highp vec2 qt_TexCoord4; \n" + + "uniform lowp sampler2D source; \n" + + "uniform highp float qt_Opacity; \n" + + "void main() { \n" + + " gl_FragColor = qt_Opacity * (2. / 6. * texture2D(source, qt_TexCoord) \n" + + " + 1. / 6. * texture2D(source, qt_TexCoord2) \n" + + " + 2. / 6. * texture2D(source, qt_TexCoord3) \n" + + " + 1. / 6. * texture2D(source, qt_TexCoord4)); \n" + "}" vertexShader: - "attribute highp vec4 qt_VertexPosition; \n" + - "attribute highp vec2 qt_VertexTexCoord; \n" + - "uniform highp mat4 qt_Matrix; \n" + - "uniform highp float xStep; \n" + - "uniform highp float yStep; \n" + - "uniform highp float spread; \n" + - "varying highp vec2 qt_TexCoord; \n" + - "varying highp vec2 qt_TexCoord2; \n" + - "varying highp vec2 qt_TexCoord3; \n" + - "varying highp vec2 qt_TexCoord4; \n" + - "void main() { \n" + - " highp vec2 shift = vec2(xStep, yStep); \n" + - " qt_TexCoord = 0.7 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord2 = 2.7 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord3 = -0.7 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord4 = -2.7 * spread * shift + 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" + + "uniform highp float xStep; \n" + + "uniform highp float yStep; \n" + + "uniform highp float spread; \n" + + "varying highp vec2 qt_TexCoord; \n" + + "varying highp vec2 qt_TexCoord2; \n" + + "varying highp vec2 qt_TexCoord3; \n" + + "varying highp vec2 qt_TexCoord4; \n" + + "void main() { \n" + + " highp vec2 shift = vec2(xStep, yStep) * spread; \n" + + " qt_TexCoord = 0.7 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord2 = 2.7 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord3 = -0.7 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord4 = -2.7 * shift + qt_MultiTexCoord0; \n" + + " gl_Position = qt_Matrix * qt_Vertex; \n" + "}" @@ -81,8 +82,8 @@ ShaderEffectItem property real spread: 1; property real xStep: 0 / width; property real yStep: 1 / height; + property variant source active: spread > 0 - anchors.fill: source smooth: true } diff --git a/examples/shadereffectitem/Effectoids/Directional8PointBlur.qml b/examples/shadereffectitem/Effectoids/Directional8PointBlur.qml index 3aaaa18..940c50d 100644 --- a/examples/shadereffectitem/Effectoids/Directional8PointBlur.qml +++ b/examples/shadereffectitem/Effectoids/Directional8PointBlur.qml @@ -44,61 +44,59 @@ import QtQuick 2.0 ShaderEffectItem { fragmentShader: - "varying highp vec2 qt_TexCoord; \n" + - "varying highp vec2 qt_TexCoord2; \n" + - "varying highp vec2 qt_TexCoord3; \n" + - "varying highp vec2 qt_TexCoord4; \n" + - "varying highp vec2 qt_TexCoord5; \n" + - "varying highp vec2 qt_TexCoord6; \n" + - "varying highp vec2 qt_TexCoord7; \n" + - "varying highp vec2 qt_TexCoord8; \n" + - "uniform sampler2D source; \n" + - "void main() { \n" + - " gl_FragColor = \n" + - " (4. / 20. * texture2D(source, qt_TexCoord) \n" + - " + 3. / 20. * texture2D(source, qt_TexCoord2) \n" + - " + 2. / 20. * texture2D(source, qt_TexCoord3) \n" + - " + 1. / 20. * texture2D(source, qt_TexCoord4) \n" + - " + 4. / 20. * texture2D(source, qt_TexCoord5) \n" + - " + 3. / 20. * texture2D(source, qt_TexCoord6) \n" + - " + 2. / 20. * texture2D(source, qt_TexCoord7) \n" + - " + 1. / 20. * texture2D(source, qt_TexCoord8)); \n" + + "varying highp vec2 qt_TexCoord; \n" + + "varying highp vec2 qt_TexCoord2; \n" + + "varying highp vec2 qt_TexCoord3; \n" + + "varying highp vec2 qt_TexCoord4; \n" + + "varying highp vec2 qt_TexCoord5; \n" + + "varying highp vec2 qt_TexCoord6; \n" + + "varying highp vec2 qt_TexCoord7; \n" + + "varying highp vec2 qt_TexCoord8; \n" + + "uniform lowp sampler2D source; \n" + + "uniform highp float qt_Opacity; \n" + + "void main() { \n" + + " gl_FragColor = qt_Opacity * (4. / 20. * texture2D(source, qt_TexCoord) \n" + + " + 3. / 20. * texture2D(source, qt_TexCoord2) \n" + + " + 2. / 20. * texture2D(source, qt_TexCoord3) \n" + + " + 1. / 20. * texture2D(source, qt_TexCoord4) \n" + + " + 4. / 20. * texture2D(source, qt_TexCoord5) \n" + + " + 3. / 20. * texture2D(source, qt_TexCoord6) \n" + + " + 2. / 20. * texture2D(source, qt_TexCoord7) \n" + + " + 1. / 20. * texture2D(source, qt_TexCoord8)); \n" + "}" vertexShader: - "attribute highp vec4 qt_VertexPosition; \n" + - "attribute highp vec2 qt_VertexTexCoord; \n" + - "uniform highp mat4 qt_Matrix; \n" + - "uniform highp float xStep; \n" + - "uniform highp float yStep; \n" + - "uniform highp float spread; \n" + - "varying highp vec2 qt_TexCoord; \n" + - "varying highp vec2 qt_TexCoord2; \n" + - "varying highp vec2 qt_TexCoord3; \n" + - "varying highp vec2 qt_TexCoord4; \n" + - "varying highp vec2 qt_TexCoord5; \n" + - "varying highp vec2 qt_TexCoord6; \n" + - "varying highp vec2 qt_TexCoord7; \n" + - "varying highp vec2 qt_TexCoord8; \n" + - "void main() { \n" + - " highp vec2 shift = vec2(xStep, yStep); \n" + - " qt_TexCoord = 0.66 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord2 = 2.5 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord3 = 4.5 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord4 = 6.5 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord5 = -0.66 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord6 = -2.5 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord7 = -4.5 * spread * shift + qt_VertexTexCoord; \n" + - " qt_TexCoord8 = -6.5 * spread * shift + 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" + + "uniform highp float xStep; \n" + + "uniform highp float yStep; \n" + + "uniform highp float spread; \n" + + "varying highp vec2 qt_TexCoord; \n" + + "varying highp vec2 qt_TexCoord2; \n" + + "varying highp vec2 qt_TexCoord3; \n" + + "varying highp vec2 qt_TexCoord4; \n" + + "varying highp vec2 qt_TexCoord5; \n" + + "varying highp vec2 qt_TexCoord6; \n" + + "varying highp vec2 qt_TexCoord7; \n" + + "varying highp vec2 qt_TexCoord8; \n" + + "void main() { \n" + + " highp vec2 shift = vec2(xStep, yStep) * spread; \n" + + " qt_TexCoord = 0.66 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord2 = 2.5 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord3 = 4.5 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord4 = 6.5 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord5 = -0.66 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord6 = -2.5 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord7 = -4.5 * shift + qt_MultiTexCoord0; \n" + + " qt_TexCoord8 = -6.5 * shift + qt_MultiTexCoord0; \n" + + " gl_Position = qt_Matrix * qt_Vertex; \n" + "}" - property variant source; - property real spread: 1; - property real xStep: 0 / width; - property real yStep: 1 / height; + property real spread: 1 + property real xStep: 0 / width + property real yStep: 1 / height + property variant source active: spread > 0 - anchors.fill: source smooth: true - } diff --git a/examples/shadereffectitem/Effectoids/DropShadow.qml b/examples/shadereffectitem/Effectoids/DropShadow.qml index b28a6ef..f93bf15 100644 --- a/examples/shadereffectitem/Effectoids/DropShadow.qml +++ b/examples/shadereffectitem/Effectoids/DropShadow.qml @@ -49,39 +49,39 @@ ShaderEffectItem "varying highp vec2 my_TexCoord2; \n" + "varying highp vec2 my_TexCoord3; \n" + "varying highp vec2 my_TexCoord4; \n" + - "uniform sampler2D source; \n" + + "uniform sampler2D source; \n" + "void main() { \n" + - " lowp vec4 pix = texture2D(source, qt_TexCoord); \n" + - " lowp float shadow = (texture2D(source, my_TexCoord1).w \n" + - " + texture2D(source, my_TexCoord2).w \n" + - " + texture2D(source, my_TexCoord3).w \n" + + " lowp vec4 pix = texture2D(source, qt_TexCoord); \n" + + " lowp float shadow = (texture2D(source, my_TexCoord1).w \n" + + " + texture2D(source, my_TexCoord2).w \n" + + " + texture2D(source, my_TexCoord3).w \n" + " + texture2D(source, my_TexCoord4).w) * 0.1; \n" + - " gl_FragColor = mix(vec4(0, 0, 0, shadow), pix, pix.w); \n" + + " gl_FragColor = mix(vec4(0, 0, 0, shadow), pix, pix.w); \n" + "}" vertexShader: - "attribute highp vec4 qt_VertexPosition; \n" + - "attribute highp vec2 qt_VertexTexCoord; \n" + - "uniform highp mat4 qt_Matrix; \n" + - "uniform highp float xOffset; \n" + - "uniform highp float xDisplacement; \n" + - "uniform highp float yOffset; \n" + - "uniform highp float yDisplacement; \n" + - "varying highp vec2 qt_TexCoord; \n" + - "varying highp vec2 my_TexCoord1; \n" + - "varying highp vec2 my_TexCoord2; \n" + - "varying highp vec2 my_TexCoord3; \n" + - "varying highp vec2 my_TexCoord4; \n" + - "void main() { \n" + - " highp vec2 s1 = vec2(xOffset, yOffset); \n" + - " highp vec2 s2 = vec2(-xOffset, yOffset); \n" + - " qt_TexCoord = qt_VertexTexCoord; \n" + - " vec2 shadowPos = qt_VertexTexCoord + vec2(-xDisplacement, yDisplacement); \n" + - " my_TexCoord1 = shadowPos + s1; \n" + - " my_TexCoord2 = shadowPos - s1; \n" + - " my_TexCoord3 = shadowPos + s2; \n" + - " my_TexCoord4 = shadowPos - s2; \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" + + "uniform highp float xOffset; \n" + + "uniform highp float xDisplacement; \n" + + "uniform highp float yOffset; \n" + + "uniform highp float yDisplacement; \n" + + "varying highp vec2 qt_TexCoord; \n" + + "varying highp vec2 my_TexCoord1; \n" + + "varying highp vec2 my_TexCoord2; \n" + + "varying highp vec2 my_TexCoord3; \n" + + "varying highp vec2 my_TexCoord4; \n" + + "void main() { \n" + + " highp vec2 s1 = vec2(xOffset, yOffset); \n" + + " highp vec2 s2 = vec2(-xOffset, yOffset); \n" + + " qt_TexCoord = qt_MultiTexCoord0; \n" + + " vec2 shadowPos = qt_MultiTexCoord0 + vec2(-xDisplacement, yDisplacement); \n" + + " my_TexCoord1 = shadowPos + s1; \n" + + " my_TexCoord2 = shadowPos - s1; \n" + + " my_TexCoord3 = shadowPos + s2; \n" + + " my_TexCoord4 = shadowPos - s2; \n" + + " gl_Position = qt_Matrix * qt_Vertex; \n" + "}" property variant source; @@ -89,7 +89,6 @@ ShaderEffectItem property real yOffset: 0.66 / height; property real xDisplacement: 10 / width; property real yDisplacement: 12 / height; - anchors.fill: source + property variant source smooth: true - } diff --git a/examples/shadereffectitem/test-boxblur-4point.qml b/examples/shadereffectitem/test-boxblur-4point.qml index c1b727b..59d9e51 100644 --- a/examples/shadereffectitem/test-boxblur-4point.qml +++ b/examples/shadereffectitem/test-boxblur-4point.qml @@ -48,14 +48,51 @@ Item { height: 540 Box4PointBlur { - source: box + source: ShaderEffectSource { + sourceItem: box + filtering: ShaderEffectSource.Linear + } anchors.fill: box - xOffset: 0.5 / width; - yOffset: 0.5 / height; + xOffset: knob.progress / width; + yOffset: knob.progress / height; + smooth: true } MovingBox { id: box } + Rectangle { + id: slider + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: 32 + color: "black" + opacity: 0.5 + } + + Item { + id: knob + x: 0.5 * (slider.width - knob.width) + anchors.top: slider.top + anchors.bottom: slider.bottom + width: height * 1.5 + Rectangle { + anchors.fill: parent + anchors.margins: 2 + radius: height / 2 + color: "white" + border.width: 2 + border.color: "black" + } + property real progress: x / (slider.width - knob.width) + MouseArea { + anchors.fill: parent + drag.target: parent + drag.axis: Drag.XAxis + drag.minimumX: 0 + drag.maximumX: slider.width - knob.width + } + } } diff --git a/examples/shadereffectitem/test-colorize.qml b/examples/shadereffectitem/test-colorize.qml index 06f26f8..a991108 100644 --- a/examples/shadereffectitem/test-colorize.qml +++ b/examples/shadereffectitem/test-colorize.qml @@ -48,6 +48,7 @@ Item { height: 540 Colorize { + anchors.fill: effectRoot source: effectRoot id: colorizeEffect color: "#c0c0ff" diff --git a/examples/shadereffectitem/test-directional-4point.qml b/examples/shadereffectitem/test-directional-4point.qml index f04976a..08357a8 100644 --- a/examples/shadereffectitem/test-directional-4point.qml +++ b/examples/shadereffectitem/test-directional-4point.qml @@ -48,6 +48,7 @@ Item { height: 540 Directional4PointBlur { + anchors.fill: parent id: blurEffect yStep: 0 @@ -55,8 +56,10 @@ Item { blending: false spread: 0 - source: effectRoot - + source: ShaderEffectSource { + sourceItem: effectRoot + filtering: ShaderEffectSource.Linear + } } Item { @@ -65,7 +68,11 @@ Item { height: 540 Directional4PointBlur { - source: innerEffectRoot + anchors.fill: parent + source: ShaderEffectSource { + sourceItem: innerEffectRoot + filtering: ShaderEffectSource.Linear + } spread: blurEffect.spread blending: false yStep: 1 / height diff --git a/examples/shadereffectitem/test-directional-8point.qml b/examples/shadereffectitem/test-directional-8point.qml index e9019c9..0946eb7 100644 --- a/examples/shadereffectitem/test-directional-8point.qml +++ b/examples/shadereffectitem/test-directional-8point.qml @@ -49,14 +49,17 @@ Item { Directional8PointBlur { id: blurEffect + anchors.fill: parent yStep: 0 xStep: 1 / width blending: false spread: 0 - source: effectRoot - + source: ShaderEffectSource { + sourceItem: effectRoot + filtering: ShaderEffectSource.Linear + } } Item { @@ -65,7 +68,11 @@ Item { height: 540 Directional8PointBlur { - source: innerEffectRoot + anchors.fill: parent + source: ShaderEffectSource { + sourceItem: innerEffectRoot + filtering: ShaderEffectSource.Linear + } spread: blurEffect.spread blending: false yStep: 1 / height diff --git a/examples/shadereffectitem/test-dropshadow.qml b/examples/shadereffectitem/test-dropshadow.qml index 109a13f..f245890 100644 --- a/examples/shadereffectitem/test-dropshadow.qml +++ b/examples/shadereffectitem/test-dropshadow.qml @@ -81,7 +81,11 @@ Image { DropShadow { - source: effectRoot + anchors.fill: effectRoot + source: ShaderEffectSource { + sourceItem: effectRoot + filtering: ShaderEffectSource.Linear + } blending: true } -- cgit v1.2.3