ezEngine Release 26.3
Loading...
Searching...
No Matches
ezRenderSortingFunctions Struct Reference

#include <SortingFunctions.h>

Inheritance diagram for ezRenderSortingFunctions:

Public Types

enum  Enum { ByRenderDataThenFrontToBack , BackToFrontThenByRenderData , ByDepthOffsetOnly , Default = ByRenderDataThenFrontToBack }
 
using StorageType = ezUInt8
 
using Func = ezUInt64(*)(const ezRenderData *, const ezCamera &)
 

Static Public Member Functions

static ezUInt64 ByRenderDataThenFrontToBackFunc (const ezRenderData *pRenderData, const ezCamera &camera)
 Sorts by render data type first, then by render data sorting key, then by depth front-to-back.
 
static ezUInt64 BackToFrontThenByRenderDataFunc (const ezRenderData *pRenderData, const ezCamera &camera)
 Sorts by depth back-to-front, then by render data type, then by render data sorting key.
 
static ezUInt64 ByDepthOffsetOnlyFunc (const ezRenderData *pRenderData, const ezCamera &camera)
 Sorts only by the render data's depth offset back-to-front, meaning render data with a higher depth offset is rendered first.
 
static Func GetFunction (Enum sortingFunction)
 Returns the sorting function corresponding to the given enum value.
 

Detailed Description

Provides sorting functions for render data.

These functions generate 64-bit sorting keys used to order render data for optimal rendering. Different sorting strategies are used for different render passes (opaque vs transparent).

Member Function Documentation

◆ BackToFrontThenByRenderDataFunc()

ezUInt64 ezRenderSortingFunctions::BackToFrontThenByRenderDataFunc ( const ezRenderData pRenderData,
const ezCamera camera 
)
static

Sorts by depth back-to-front, then by render data type, then by render data sorting key.

Used for transparent geometry to ensure correct blending order.

◆ ByDepthOffsetOnlyFunc()

ezUInt64 ezRenderSortingFunctions::ByDepthOffsetOnlyFunc ( const ezRenderData pRenderData,
const ezCamera camera 
)
static

Sorts only by the render data's depth offset back-to-front, meaning render data with a higher depth offset is rendered first.

This can be used for special cases like full-screen effects where the render order needs to be fully deterministic.

◆ ByRenderDataThenFrontToBackFunc()

ezUInt64 ezRenderSortingFunctions::ByRenderDataThenFrontToBackFunc ( const ezRenderData pRenderData,
const ezCamera camera 
)
static

Sorts by render data type first, then by render data sorting key, then by depth front-to-back.

Used for opaque geometry to minimize state changes and benefit from early-z rejection.


The documentation for this struct was generated from the following files: