- Qt 6.6
- Qt 3D
- QML Types
- Qt3D.Render
- LayerFilter
- Qt 6.6.0 Reference Documentation

# LayerFilter QML Type

Controls layers drawn in a frame graph branch. More...

Import Statement: | import Qt3D.Render 2.6
Instantiates: | QLayerFilter
Inherits: | FrameGraphNode

- List of all members, including inherited members

## Properties

- filterMode : enumeration
- layers : list<Layer>

## Detailed Description

A LayerFilter can be used to instruct the renderer as to which layer(s) to draw in that branch of the frame graph. The LayerFilter selects which entities to draw based on the Layer instances added to the LayerFilter and as components to the Entity.

The LayerFilter can be configured to select or discard entities with a specific Layer depending on the filterMode property. By default, entities referencing one of the Layer objects that are also being referenced by the LayerFilter are selected (AcceptAnyMatchingLayers).

Within the FrameGraph tree, multiple LayerFilter nodes can be nested within a branch going from root to a leaf. In that case the filtering will first operate on all entities of the scene using the filtering method specified by the first declared LayerFilter. Then the filtered subset of entities will be filtered again based on the filtering method set on the second LayerFilter declared. This is then repeated until all LayerFilter nodes of the branch have been consumed.

## Property Documentation

filterMode : enumeration

Holds the filter mode specifying the entities to select for drawing.

The default value is `LayerFilter.AcceptMatchingLayers`.

Constant | Description
--- | ---
`LayerFilter.AcceptAnyMatchingLayers` | Accept entities that reference one or more Layer objects added to this LayerFilter. This is the default
`LayerFilter.AcceptAllMatchingLayers` | Accept entities that reference all the Layer objects added to this LayerFilter
`LayerFilter.DiscardAnyMatchingLayers` | Discard entities that reference one or more Layer objects added to this LayerFilter
`LayerFilter.DiscardAllMatchingLayers` | Discard entities that reference all Layer objects added to this LayerFilter

[read-only] layers : list<Layer>

Holds a list of layers specifying the layers to select for drawing.