![]() |
Plasma Engine
2.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 | |
| plReflectionProbeMapping (plUInt32 uiAtlasSize) | |
| Creates a reflection probe atlas and mapping of the given size. | |
Probe management | |
| void | AddProbe (plReflectionProbeId probe, plBitflags< plProbeFlags > flags) |
| Adds a probe that will be considered for mapping into the atlas. | |
| void | UpdateProbe (plReflectionProbeId probe, plBitflags< plProbeFlags > flags) |
| Marks previously added probe as dirty and potentially changes its flags. | |
| void | ProbeUpdateFinished (plReflectionProbeId probe) |
| Should be called once a requested plReflectionProbeMappingEvent::Type::ProbeUpdateRequested event has been completed. | |
| void | RemoveProbe (plReflectionProbeId probe) |
| Removes a probe. If the probe was mapped, plReflectionProbeMappingEvent::Type::ProbeUnmapped will be fired when calling this function. | |
Render helpers | |
| plInt32 | GetReflectionIndex (plReflectionProbeId probe, bool bForExtraction=false) const |
| Returns the index at which a given probe is mapped. | |
| plGALTextureHandle | 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 (plReflectionProbeId 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 plReflectionProbeMappingEvent events to map / unmap or request updates of probes. | |
Public Attributes | |
| plEvent< const plReflectionProbeMappingEvent & > | m_Events |
This class creates a reflection probe atlas and controls the mapping of added probes to the available atlas indices.
| plReflectionProbeMapping::plReflectionProbeMapping | ( | plUInt32 | uiAtlasSize | ) |
Creates a reflection probe atlas and mapping of the given size.
| uiAtlasSize | How many probes the atlas can contain. |
| plInt32 plReflectionProbeMapping::GetReflectionIndex | ( | plReflectionProbeId | 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 plReflectionProbeMapping::ProbeUpdateFinished | ( | plReflectionProbeId | probe | ) |
Should be called once a requested plReflectionProbeMappingEvent::Type::ProbeUpdateRequested event has been completed.
| probe | The probe that has finished its update. |