Filters¶
Filters collect and reorganize 3D nodes in your Kanzi project. You can use filters to determine which 3D nodes to render in different render passes.
After you set one or more filters or object sources, a filter collects and outputs a set of 3D nodes that match the requirements you define in that filter.
Use filters to adjust the rendering for the whole or parts of your Kanzi application. To use a filter, either:
In a Draw Objects Render Pass or Draw Objects With Material Render Pass set the Object Source property so that the render pass renders only those nodes that the filter passes to the render pass.
In a Node List Render Pass set the Filter property so that the Node List Render Pass holds only those nodes that the filter passes to that Node List Render Pass.
Use a Node List Render Pass when you want to filter anything but the 3D nodes that you want to render, such as Light nodes. Draw Objects Render Pass, Draw Objects With Material Render Pass, and Gather Lights Render Pass render passes can use the result node list of the same Node List Render Pass.
See Rendering.
For example, you can use filters to:
Create reflections for nodes. See Tutorial: Create reflections.
Apply a stencil to 3D content. See Tutorial: Apply a stencil to 3D content.
Distribute rendering across several frames. See Tutorial: Progressive rendering.
Render only transparent nodes. See Rendering partially transparent nodes.
These filters are available in Kanzi Studio in the Library > Rendering > Object Sources:
Contains Property Filter collects 3D nodes that contain, or do not contain a specific property.
Object Type Filter collects 3D nodes based on their type. See Using the Object Type Filter.
Property Is Equal Filter collects 3D nodes that contain, or do not contain a specific property the value of which matches a specific value.
Sorting Filter either orders 3D nodes by their position on the z axis or groups them by their material type.
Tag Filter collects 3D nodes that have a specific tag assigned.
See Using the Tag Filter.
Using filters in the API¶
For details, see the FilterObjectSource
class in the Kanzi Engine API reference.