Using Custom Shaders
You can use the 3D shader utilities and commands available in Library > Components > QtQuick3D > Custom Shader Utils to create your own effects and materials.
Additional 3D shader utilities include the Effect, which you can find in Library > QtQuick3D Effects > Qt Quick 3D Custom Shader Utils, and Custom Material, available in Library > QtQuick3D Materials > Qt Quick 3D Custom Shader Utils.
If the custom shader utilities are not displayed in Library, add the QtQuick3D module to your project, as described in Adding and Removing Modules.
For more information on using the shaders, see Creating Custom Effects and Materials.
See the following tables for available shader utilities and commands.
|Buffer||A buffer to be used for a pass of a Custom Material or an Effect.|
Specify attributes for the buffer by defining the Name and Format and Allocation Flags properties.
The 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 Coordinate Operation property specifies the texture coordinate operation for coordinates outside [0, 1] range.
You can also specify the 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.
|Custom Material||The base component for creating custom materials used to shade models.|
Specify the attributes of the Custom Material by defining the Transparency, Refraction and Always Dirty properties. The Passes property contains a list of render passes implemented by the material. The Shader Info specifies the shader info of the material. For more information, see Creating Custom Effects and Materials.
|Effect||A base component for creating post-processing effects.|
The Passes property contains a list of render passes implemented by the effect. For more information, see Creating Custom Effects and Materials.
|Pass||A render pass in a Custom Material or an Effect.|
The Commands property specifies the list of render commands of the pass. You can further define a render pass by using the Buffer and Shaders properties.
|Shader||A container component for defining shader code used by Custom Materials and Effects.|
Define the Shader attributes by specifying the Source and Stage properties.
|Shader Info||Basic information about custom shader code for Custom Materials.|
The Version property specifies the shader code version, while the Type property defines the shader code type. The 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.
|Texture Input||A texture channel for a Custom Material or an Effect.|
The Texture property specifies the texture to input, while the Enabled determines whether the texture is enabled.
|Blending||A pass command that specifies the source blending function.|
Use the Source and Destination to further define the function.
|Buffer Blit||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 Source and Destination properties.
|Buffer Input||An input buffer to be used for a pass of a Custom Material or an Effect.|
The Buffer property specifies the buffer used for the parameter. The Parameter specifies the name of the input parameter in the shader.
|Cull Mode||A culling mode for a render pass.|
The Mode specifies the culling mode in a pass when the State property of the Render State is set to CullFace.
|Depth Input||An output texture for the depth buffer.|
The Parameter property specifies the name of the texture the depth buffer will bind to.
|Render State||The render state to be enabled or disabled in a pass of a Custom Material or an Effect.|
The State property specifies the render state to enable or disable in a pass.
|Set Uniform Value||A value to be set during a single pass.|
The Target property specifies the name of the uniform that will have its value changed during the pass, while the Value specifies the value that will be set on the target uniform.
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.