aboutsummaryrefslogtreecommitdiffstats
path: root/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-shaders.qdoc
blob: 2232020c60cab8dc3e933f6b1fb523681186555e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Design Studio.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \page studio-3d-custom-shaders.html
    \previouspage studio-3d-effects.html
    \nextpage studio-3d-custom-effects-materials.html

    \title Using Custom Shaders

    You can use the Qt Quick 3D shader utilities and commands to create your own
    effects and materials.

    For more information on using the shaders, see
    \l {Creating Custom Effects and Materials}.

    See the following tables for available shader utilities and commands.

    \section1 Available Custom Shader Utilities
    \table
    \header
        \li Custom Shader
        \li Description

    \row
        \li \l Buffer
        \li A buffer to be used for a pass of a Custom Material or an Effect.

            Specify attributes for the buffer by defining the \uicontrol Name
            and \uicontrol Format and \uicontrol {Allocation Flags} properties.

            The \uicontrol Filter property specifies the filter operation when a
            render pass is reading the buffer that differs in size in comparison
            to the current output buffer.

            The \uicontrol {Coordinate Operation} property specifies the texture
            coordinate operation for coordinates outside [0, 1] range.

            You can also specify the \uicontrol {Size Multiplier} of the buffer.
            Value of 1.0 creates buffer with the same size while 0.5 creates
            buffer with width and height halved.

    \row
        \li \l {CustomMaterial} {Custom Material}
        \li The base component for creating custom materials used to shade
            models.

            Specify the attributes of the \uicontrol {Custom Material} by
            defining the \uicontrol Transparency, \uicontrol Refraction and
            \uicontrol {Always Dirty} properties. The \uicontrol Passes property
            contains a list of render passes implemented by the material.
            The \uicontrol {Shader Info} specifies the shader info of the
            material. For more information, see \l {Creating Custom Effects and
            Materials}.

    \row
        \li \l Effect
        \li A base component for creating post-processing effects.

            The \uicontrol Passes property contains a list of render passes
            implemented by the effect. For more information, see
            \l {Creating Custom Effects and Materials}.

    \row
        \li \l Pass
        \li A render pass in a Custom Material or an Effect.

            The \uicontrol Commands property specifies the list of render
            commands of the pass. You can further define a render pass by using
            the \uicontrol Buffer and \uicontrol Shaders properties.

    \row
        \li \l Shader
        \li A container component for defining shader code used by Custom
            Materials and Effects.

            Define the \uicontrol Shader attributes by specifying the
            \uicontrol Source and \uicontrol Stage properties.

    \row
        \li \l {ShaderInfo} {Shader Info}
        \li Basic information about custom shader code for Custom Materials.

            The \uicontrol Version property specifies the shader code version,
            while the \uicontrol Type property defines the shader code type.
            The \uicontrol Key property specifies the options used by the shader
            using the combination of shader key values, such as diffuse or
            specular lighting, refraction, transparency, displacement,
            transmissiveness, glossiness, and alpha cutout.

    \row
        \li \l {TextureInput} {Texture Input}
        \li A texture channel for a Custom Material or an Effect.

        The \uicontrol Texture property specifies the texture to input, while
        the \uicontrol Enabled determines whether the texture is enabled.

    \endtable


    \section1 Available Custom Shader Commands
    \table
    \header
        \li Command
        \li Description

    \row
        \li \l Blending
        \li A pass command that specifies the source blending function.

            Use the \uicontrol Source and \uicontrol Destination to further
            define the function.

    \row
        \li \l {BufferBlit} {Buffer Blit}
        \li A copy operation between two buffers in a pass of a Custom Material
            or an Effect.

            Define the source and the destination buffer of the copy-operation
            by using the \uicontrol Source and \uicontrol Destination
            properties.

    \row
        \li \l {BufferInput} {Buffer Input}
        \li An input buffer to be used for a pass of a Custom Material or an
            Effect.

            The \uicontrol Buffer property specifies the buffer used for the
            parameter. The \uicontrol Parameter specifies the name of the input
            parameter in the shader.

    \row
        \li \l {CullMode} {Cull Mode}
        \li A culling mode for a render pass.

            The \uicontrol Mode specifies the culling mode in a pass when the
            \uicontrol {State} property of the \uicontrol {Render State} is
            set to \uicontrol CullFace.

    \row
        \li \l {DepthInput} {Depth Input}
        \li An output texture for the depth buffer.

            The \uicontrol Parameter property specifies the name of the texture
            the depth buffer will bind to.

    \row
        \li \l {RenderState} {Render State}
        \li The render state to be enabled or disabled in a pass of a Custom
            Material or an Effect.

            The \uicontrol State property specifies the render state to
            enable or disable in a pass.

    \row
        \li \l {SetUniformValue} {Set Uniform Value}
        \li A value to be set during a single pass.

            The \uicontrol Target property specifies the name of the uniform
            that will have its value changed during the pass, while the
            \uicontrol Value specifies the value that will be set on the target
            uniform.
    \endtable


*/