- Qt 6.11
- Qt Quick 3D
- QML Types
- RenderPass
- Qt Quick 3D | Commercial or GPLv3

# RenderPass QML Type

The RenderPass type defines a custom render pass for rendering 3D content. More...

Import Statement: | `import QtQuick3D`
Since: | Qt 6.11
Inherits: | Object3D

- List of all members, including inherited members

## Properties

- augmentShader : url
- clearColor : color
- commands : list<RenderCommand>
- depthClearValue : real
- materialMode : RenderPass::MaterialModes
- overrideMaterial : Material
- passMode : RenderPass::PassMode
- renderTargetFlags : RenderPass::RenderTargetFlags
- stencilClearValue : int

## Detailed Description

A RenderPass allows you to define a custom rendering step in the rendering pipeline. You can specify various properties such as clear color, material mode, and override materials. Additionally, you can define a list of render commands that dictate how the rendering should be performed.

## Exposing data to the shaders

As with Effects and Custom Materials, the RenderPass will expose, and update, user defined properties to the shader automatically.

## Property Documentation

### augmentShader : url

This property holds the augment shader URL for the render pass when materialMode is set to `AugmentMaterial`.

The shader file should contain a function with the following signature:

     void MAIN_FRAGMENT_AUGMENT() {
         // Custom shader code here
     }

This function will be combined with the existing fragment shader of the material being used by the object being rendered in this render pass. Allowing users to augment the existing material shader with custom code.

### clearColor : color `[default: Qt.black]`

This property holds the clear color for the render pass.

### commands : list<RenderCommand>

This property holds the list of render commands for the render pass.

The commands in the list are executed in the order they appear in the list.

Note: The commands for RenderPass and Effects are similar but not the same, only those marked as compatible can be used with this RenderPass.

See also renderTargetBlend, PipelineStateOverride, RenderablesFilter, RenderPassTexture, ColorAttachment, DepthTextureAttachment, DepthStencilAttachment, and AddDefine.

### depthClearValue : real `[default: 1.0]`

This property holds the depth clear value for the render pass.

### materialMode : RenderPass::MaterialModes `[default: RenderPass.OriginalMaterial]`

This property holds the material mode for the render pass.

Constant | Description
--- | ---
`RenderPass.OriginalMaterial` | Use the original material of the object.
`RenderPass.AugmentMaterial` | Augment the original material with custom shader code.
`RenderPass.OverrideMaterial` | Override the original material with a user specified material.

### overrideMaterial : Material

This property holds the override material for the render pass when materialMode is set to `OverrideMaterial`.

### passMode : RenderPass::PassMode `[default: RenderPass.UserPass]`

This property holds the pass mode for the render pass.

In addition to standard user render passes, Qt Quick 3D supports users to manually triggering internal render passes for rendering the skybox and 2D items.

Constant | Description
--- | ---
`RenderPass.UserPass` | A user specified render pass.
`RenderPass.SkyboxPass` | Qt Quick 3D's built-in skybox render pass.
`RenderPass.Item2DPass` | Qt Quick 3D's built-in 2D item render pass.

### renderTargetFlags : RenderPass::RenderTargetFlags `[default: RenderPass.RenderTargetFlags.None]`

This property holds the render target flags for the render pass.

Possible values are:

Constant | Description
--- | ---
`RenderPass.RenderTargetFlags.None` | No special behavior.
`RenderPass.RenderTargetFlags.PreserveColorContents` | Preserve the color contents of the render target between frames.
`RenderPass.RenderTargetFlags.PreserveDepthStencilContents` | Preserve the depth and stencil contents of the render target between frames.
`RenderPass.RenderTargetFlags.DoNotStoreDepthStencilContents` | Do not store the depth and stencil contents of the render target after rendering.

See also QRhiTextureRenderTarget::Flags.

### stencilClearValue : int `[default: 0]`

This property holds the stencil clear value for the render pass.