3#include <RendererCore/RendererCorePCH.h>
5#include <RendererCore/Lights/Implementation/ReflectionProbeData.h>
6#include <RendererFoundation/RendererFoundationDLL.h>
81 struct plProbeMappingFlags
83 using StorageType = plUInt8;
87 SkyLight = plProbeFlags::SkyLight,
88 HasCustomCubeMap = plProbeFlags::HasCustomCubeMap,
89 Sphere = plProbeFlags::Sphere,
90 Box = plProbeFlags::Box,
91 Dynamic = plProbeFlags::Dynamic,
99 StorageType SkyLight : 1;
100 StorageType HasCustomCubeMap : 1;
101 StorageType Sphere : 1;
103 StorageType Dynamic : 1;
104 StorageType Dirty : 1;
105 StorageType Usable : 1;
113 PL_DECLARE_POD_TYPE();
115 PL_ALWAYS_INLINE
bool operator<(
const SortedProbes& other)
const
117 if (m_fPriority > other.m_fPriority)
120 return m_uiIndex < other.m_uiIndex;
124 float m_fPriority = 0.0f;
127 struct ProbeDataInternal
130 plInt32 m_uiReflectionIndex = -1;
131 float m_fPriority = 0.0f;
143 plUInt32 m_uiAtlasSize = 32;
Definition DynamicArray.h:81
Definition RendererFoundationDLL.h:411
This class creates a reflection probe atlas and controls the mapping of added probes to the available...
Definition ReflectionProbeMapping.h:25
plReflectionProbeMapping(plUInt32 uiAtlasSize)
Creates a reflection probe atlas and mapping of the given size.
Definition ReflectionProbeMapping.cpp:8
void AddProbe(plReflectionProbeId probe, plBitflags< plProbeFlags > flags)
Adds a probe that will be considered for mapping into the atlas.
Definition ReflectionProbeMapping.cpp:41
plGALTextureHandle GetTexture() const
Returns the atlas texture.
Definition ReflectionProbeMapping.h:60
void PostExtraction()
Should be called in the PostExtraction phase. This will compute the best probe mapping and potentiall...
Definition ReflectionProbeMapping.cpp:140
void PreExtraction()
Should be called in the PreExtraction phase. This will reset all probe weights.
Definition ReflectionProbeMapping.cpp:115
plInt32 GetReflectionIndex(plReflectionProbeId probe, bool bForExtraction=false) const
Returns the index at which a given probe is mapped.
Definition ReflectionProbeMapping.cpp:105
void UpdateProbe(plReflectionProbeId probe, plBitflags< plProbeFlags > flags)
Marks previously added probe as dirty and potentially changes its flags.
Definition ReflectionProbeMapping.cpp:56
void ProbeUpdateFinished(plReflectionProbeId probe)
Should be called once a requested plReflectionProbeMappingEvent::Type::ProbeUpdateRequested event has...
Definition ReflectionProbeMapping.cpp:68
void RemoveProbe(plReflectionProbeId probe)
Removes a probe. If the probe was mapped, plReflectionProbeMappingEvent::Type::ProbeUnmapped will be ...
Definition ReflectionProbeMapping.cpp:86
void AddWeight(plReflectionProbeId probe, float fPriority)
Adds weight to a probe. Should be called during extraction of the probe. The mapping will map the pro...
Definition ReflectionProbeMapping.cpp:134
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
Definition ReflectionProbeMapping.h:98
Event generated on mapping changes.
Definition ReflectionProbeMapping.h:11
Type
Definition ReflectionProbeMapping.h:13
@ ProbeMapped
The given probe was mapped to the atlas.
@ ProbeUnmapped
The given probe was unmapped from the atlas.
@ ProbeUpdateRequested
The given probe needs to be updated after which plReflectionProbeMapping::ProbeUpdateFinished must be...