aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/shadereffects/doc/src/shadereffects.qdoc
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-06-28 17:12:09 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2016-06-29 12:00:09 +0000
commit15849d78b7cca848b87badcfee33db1db70b8b52 (patch)
tree1f0055732564f36c0427176f5853c4375ac0b21d /examples/quick/shadereffects/doc/src/shadereffects.qdoc
parentf552d99f3d937ee9a8938673cd22246edbe70317 (diff)
Migrate shadereffects example to be cross-backend
...while demonstrating best practices like file selectors. Task-number: QTBUG-52914 Change-Id: Ibf7bca77b7b142f5ccb956e05efc5be974d53c79 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/quick/shadereffects/doc/src/shadereffects.qdoc')
-rw-r--r--examples/quick/shadereffects/doc/src/shadereffects.qdoc15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/quick/shadereffects/doc/src/shadereffects.qdoc b/examples/quick/shadereffects/doc/src/shadereffects.qdoc
index dc2a2681f5..7b1d68ebb5 100644
--- a/examples/quick/shadereffects/doc/src/shadereffects.qdoc
+++ b/examples/quick/shadereffects/doc/src/shadereffects.qdoc
@@ -51,6 +51,21 @@
shader:
\snippet shadereffects/shadereffects.qml fragment
+ In order to support multiple graphics APIs, not just OpenGL, the shader
+ source is not embedded into QML. Instead, file selectors are used to select
+ the correct variant at runtime. Based on the Qt Quick backend in use, Qt
+ will automatically select either \c{shaders/wobble.frag} with the GLSL
+ source code or \c{shaders/+hlsl/wobble.frag} with the HLSL source code.
+
+ \note For simplicity shader source code is used in all variants of the
+ files. However, with the Direct3D backend of Qt Quick pre-compiled shaders
+ are also supported. For example, try the following commands in the
+ \c{content/shaders/+hlsl} directory: \c{move wobble.frag wobble.frag.src}
+ followed by \c{fxc /E main /T ps_5_0 /Fo wobble.frag wobble.frag.src}. Now
+ \c wobble.frag contains Direct3D bytecode and that is what gets shipped
+ with the application instead of the shader source. Further changes are not
+ necessary, the application will function like before.
+
You can use any custom property on the ShaderEffect in your shader. This
makes animated shader code very easy:
\snippet shadereffects/shadereffects.qml properties