diff options
Diffstat (limited to 'examples/quick/shadereffects/doc/src/shadereffects.qdoc')
-rw-r--r-- | examples/quick/shadereffects/doc/src/shadereffects.qdoc | 15 |
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 |