Plasma Engine  2.0
Loading...
Searching...
No Matches
ClusteredDataExtractor.h
1#pragma once
2
3#include <Foundation/Types/UniquePtr.h>
4#include <RendererCore/Pipeline/Extractor.h>
5
6struct plPerLightData;
7struct plPerDecalData;
8struct plPerReflectionProbeData;
9struct plPerClusterData;
10
12{
13 PL_ADD_DYNAMIC_REFLECTION(plClusteredDataCPU, plRenderData);
14
15public:
18
19 enum
20 {
21 MAX_LIGHT_DATA = 1024,
22 MAX_DECAL_DATA = 1024,
23 MAX_REFLECTION_PROBE_DATA = 1024,
24 MAX_ITEMS_PER_CLUSTER = 256
25 };
26
29 plArrayPtr<plPerReflectionProbeData> m_ReflectionProbeData;
30 plArrayPtr<plPerClusterData> m_ClusterData;
31 plArrayPtr<plUInt32> m_ClusterItemList;
32
33 plUInt32 m_uiSkyIrradianceIndex = 0;
34 plEnum<plCameraUsageHint> m_cameraUsageHint = plCameraUsageHint::Default;
35
36 float m_fFogHeight = 0.0f;
37 float m_fFogHeightFalloff = 0.0f;
38 float m_fFogDensityAtCameraPos = 0.0f;
39 float m_fFogDensity = 0.0f;
40 float m_fFogInvSkyDistance = 0.0f;
41 plColor m_FogColor = plColor::Black;
42};
43
44class PL_RENDERERCORE_DLL plClusteredDataExtractor : public plExtractor
45{
46 PL_ADD_DYNAMIC_REFLECTION(plClusteredDataExtractor, plExtractor);
47
48public:
49 plClusteredDataExtractor(const char* szName = "ClusteredDataExtractor");
51
52 virtual void PostSortAndBatch(
53 const plView& view, const plDynamicArray<const plGameObject*>& visibleObjects, plExtractedRenderData& ref_extractedRenderData) override;
54 virtual plResult Serialize(plStreamWriter& inout_stream) const override;
55 virtual plResult Deserialize(plStreamReader& inout_stream) override;
56
57private:
58 void FillItemListAndClusterData(plClusteredDataCPU* pData);
59
60 template <plUInt32 MaxData>
61 struct TempCluster
62 {
63 PL_DECLARE_POD_TYPE();
64
65 plUInt32 m_BitMask[MaxData / 32];
66 };
67
74 plDynamicArray<plUInt32> m_TempClusterItemList;
75
77};
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition ClusteredDataExtractor.h:12
Definition ClusteredDataExtractor.h:45
plColor represents an RGBA color in linear color space. Values are stored as float,...
Definition Color.h:44
static const plColor Black
#000000
Definition Color.h:57
Definition DynamicArray.h:81
Definition ExtractedRenderData.h:10
Definition Extractor.h:9
Base class for all render data. Render data must contain all information that is needed to render the...
Definition RenderData.h:14
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
Encapsulates a view on the given world through the given camera and rendered with the specified Rende...
Definition View.h:21
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54