![]() |
XII Release 0.1.0
|
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< xiiGALTexture > | GetTexture () 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 |
This class creates a reflection probe atlas and controls the mapping of added probes to the available atlas indices.
xiiReflectionProbeMapping::xiiReflectionProbeMapping | ( | xiiUInt32 | uiAtlasSize | ) |
Creates a reflection probe atlas and mapping of the given size.
uiAtlasSize | How many probes the atlas can contain. |
xiiInt32 xiiReflectionProbeMapping::GetReflectionIndex | ( | xiiReflectionProbeId | probe, |
bool | bForExtraction = false ) const |
Returns the index at which a given probe is mapped.
probe | The probe that is being queried. |
bForExtraction | If 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. |
|
inline |
Returns the atlas texture.
void xiiReflectionProbeMapping::ProbeUpdateFinished | ( | xiiReflectionProbeId | probe | ) |
Should be called once a requested xiiReflectionProbeMappingEvent::Type::ProbeUpdateRequested event has been completed.
probe | The probe that has finished its update. |