XII Release 0.1.0
Loading...
Searching...
No Matches
xiiReflectionProbeMapping Class Reference

This class creates a reflection probe atlas and controls the mapping of added probes to the available atlas indices. More...

#include <ReflectionProbeMapping.h>

Public Member Functions

 xiiReflectionProbeMapping (xiiUInt32 uiAtlasSize)
 Creates a reflection probe atlas and mapping of the given size.
 
Probe management
void AddProbe (xiiReflectionProbeId probe, xiiBitflags< xiiProbeFlags > flags)
 Adds a probe that will be considered for mapping into the atlas.
 
void UpdateProbe (xiiReflectionProbeId probe, xiiBitflags< xiiProbeFlags > flags)
 Marks previously added probe as dirty and potentially changes its flags.
 
void ProbeUpdateFinished (xiiReflectionProbeId probe)
 Should be called once a requested xiiReflectionProbeMappingEvent::Type::ProbeUpdateRequested event has been completed.
 
void RemoveProbe (xiiReflectionProbeId probe)
 Removes a probe. If the probe was mapped, xiiReflectionProbeMappingEvent::Type::ProbeUnmapped will be fired when calling this function.
 
Render helpers
xiiInt32 GetReflectionIndex (xiiReflectionProbeId probe, bool bForExtraction=false) const
 Returns the index at which a given probe is mapped.
 
xiiSharedPtr< xiiGALTextureGetTexture () const
 Returns the atlas texture.
 
Compute atlas mapping
void PreExtraction ()
 Should be called in the PreExtraction phase. This will reset all probe weights.
 
void AddWeight (xiiReflectionProbeId probe, float fPriority)
 Adds weight to a probe. Should be called during extraction of the probe. The mapping will map the probes with the highest weights in the atlas over time. This can be called multiple times in a frame for a probe if it is visible in multiple views. The maximum weight is then taken.
 
void PostExtraction ()
 Should be called in the PostExtraction phase. This will compute the best probe mapping and potentially fire xiiReflectionProbeMappingEvent events to map / unmap or request updates of probes.
 

Public Attributes

xiiEvent< const xiiReflectionProbeMappingEvent & > m_Events
 

Detailed Description

This class creates a reflection probe atlas and controls the mapping of added probes to the available atlas indices.

Constructor & Destructor Documentation

◆ xiiReflectionProbeMapping()

xiiReflectionProbeMapping::xiiReflectionProbeMapping ( xiiUInt32 uiAtlasSize)

Creates a reflection probe atlas and mapping of the given size.

Parameters
uiAtlasSizeHow many probes the atlas can contain.

Member Function Documentation

◆ GetReflectionIndex()

xiiInt32 xiiReflectionProbeMapping::GetReflectionIndex ( xiiReflectionProbeId probe,
bool bForExtraction = false ) const

Returns the index at which a given probe is mapped.

Parameters
probeThe probe that is being queried.
bForExtractionIf set, returns whether the index can be used for using the probe during rendering. If the probe was just mapped but not updated yet, -1 will be returned for bForExtraction = true but a valid index for bForExtraction = false so that the index can be rendered into.
Returns
Returns the mapped index in the atlas or -1 of the probe is not mapped.

◆ GetTexture()

xiiSharedPtr< xiiGALTexture > xiiReflectionProbeMapping::GetTexture ( ) const
inline

Returns the atlas texture.

Returns
The texture handle of the cube map atlas.

◆ ProbeUpdateFinished()

void xiiReflectionProbeMapping::ProbeUpdateFinished ( xiiReflectionProbeId probe)

Should be called once a requested xiiReflectionProbeMappingEvent::Type::ProbeUpdateRequested event has been completed.

Parameters
probeThe probe that has finished its update.

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