diff options
author | Jonas Karlsson <jonas.karlsson@qt.io> | 2020-06-23 13:25:39 +0200 |
---|---|---|
committer | Jonas Karlsson <jonas.karlsson@qt.io> | 2020-06-29 15:24:12 +0200 |
commit | bd1c28a82c2ff955e0d154fac2e2df8d5a110dd7 (patch) | |
tree | 499f56b6a1d39f7ceb202b53a3f8a4d0bd530eb9 /src/quick/doc | |
parent | a059aa2e2812fab98dc11da73a6241ba6937dce1 (diff) |
Reimplement UniformAnimator for ShaderEffect
Fixes: QTBUG-83976
Change-Id: I307e96be0d3d2edeb8d9065d100c1ef38c8824c7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/doc')
-rw-r--r-- | src/quick/doc/snippets/qml/animators.qml | 82 |
1 files changed, 33 insertions, 49 deletions
diff --git a/src/quick/doc/snippets/qml/animators.qml b/src/quick/doc/snippets/qml/animators.qml index 87684f2792..73c8097974 100644 --- a/src/quick/doc/snippets/qml/animators.qml +++ b/src/quick/doc/snippets/qml/animators.qml @@ -219,55 +219,39 @@ Rectangle { } } //! [opacity target] -//![shaderon] -// Uniform animators are not yet ported to Qt 6 -//ShaderEffect { -// width: 50 -// height: 50 -// property variant t; -// UniformAnimator on t { -// from: 0 -// to: 1 -// duration: 1000 -// } -// fragmentShader: -// " -// uniform lowp float t; -// varying highp vec2 qt_TexCoord0; -// void main() { -// lowp float c = qt_TexCoord0.y; -// gl_FragColor = vec4(c * t, 0, 0, 1); -// } -// " -//} -//![shaderon] -//![shader target] -// Uniform animators are not yet ported to Qt 6 -//ShaderEffect { -// id: shader -// width: 50 -// height: 50 -// property variant t; -// UniformAnimator { -// target: shader -// uniform: "t" -// from: 0 -// to: 1 -// duration: 1000 -// running: true -// } -// fragmentShader: -// " -// uniform lowp float t; -// varying highp vec2 qt_TexCoord0; -// void main() { -// lowp float c = qt_TexCoord0.y; -// gl_FragColor = vec4(0, 0, c * t, 1); -// } -// " -//} -//![shader target] -//![mixed] +//! [shaderon] +ShaderEffect { + width: 50 + height: 50 + property variant t; + UniformAnimator on t { + from: 0 + to: 1 + duration: 1000 + } + fragmentShader: "qrc:shader.frag.qsb" +} + +//! [shaderon] +//! [shader target] +ShaderEffect { + id: shader + width: 50 + height: 50 + property variant t; + UniformAnimator { + target: shader + uniform: "t" + from: 0 + to: 1 + duration: 1000 + running: true + } + fragmentShader: "qrc:shader.frag.qsb" +} + +//! [shader target] +//! [mixed] Rectangle { id: mixBox width: 50 |