- Qt 6.9
- Qt Quick 3D
- QML Types
- Shader
- Qt Quick 3D | Commercial or GPLv3

# Shader QML Type

Container component for defining shader code used by post-processing effects. More...

Import Statement: | `import QtQuick3D`

- List of all members, including inherited members

## Properties

- shader : url
- stage : enumeration

## Detailed Description

The Shader type is used for populating the shaders list in the render pass of an Effect.

A shader is code which is executed directly on the graphic hardware at a particular stage of the rendering pipeline.

See also Effect.

## Property Documentation

shader : url

Specifies the name of the shader source file. For details on how to write shader code, see the Effect documentation.

Warning: Shader snippets are assumed to be trusted content. Application developers are advised to carefully consider the potential implications before allowing the loading of user-provided content that is not part of the application.

stage : enumeration

Specifies the stage of the rendering pipeline when the shader code will be executed. The default is `Shader.Fragment`

Constant | Description
--- | ---
`Shader.Vertex` | The shader is a vertex shader. This code is run once per vertex in the input geometry and can be used to modify it before the geometry is rasterized (scan converted). In the case of effects, the input geometry is always a quad (four vertexes representing the corners of the render target).

`Shader.Fragment`

The shader is a fragment shader. After vertex processing, the modified geometry is turned into fragments (rasterization). Then a fragment shader is executed for each fragment, assigning a color to it. Fragments are a related concept to pixels, but with additional information attached. Also, as a result of some anti-aliasing strategies, there may be more than one fragment for each pixel in the output.