Render features have several phases.
The collect phase determines what needs to be processed and rendered. It's usually driven by the graphics compositor.
The collect phase:
- creates render views, and updating them with the most recent data such as view and projection matrices
- creates and setting up render stages
- performes visibility culling and sorting
This should be as fast as possible and avoid heavy computations since game update and scripts are blocked. Heavy computations should be deferred to Prepare.
Currently, Xenko doesn't parallelize game updates and scripts, so they won't be resumed until the prepare and draw phases are finished.
- copying object matrices
- copying material parameters
- computing lighting data and structures
- filling constant buffers and resource tables
The draw phase fills the GPU command list.
- setting up render textures
- drawing combinations of render stage with render view.
A typical example of views and stages created during collect phase, used during the draw phase:
Pipeline processors are classes called when creating the pipeline state. This lets you do things such as enable alpha blending or wireframe rendering in a specific render stage.
Xenko includes several predefined pipeline processors. You can also create your own.