3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/renderer/chunks/point_lighting/ILightLODResourceProvider.h"
7#include "mc/client/renderer/chunks/point_lighting/PointLightShadowAtlasHysteresis.h"
8#include "mc/client/renderer/chunks/point_lighting/PointLightShadowBatchProcessor.h"
9#include "mc/deps/minecraft_renderer/framebuilder/PointLightParameters.h"
10#include "mc/external/render_dragon/rendering/TextureCubeFace.h"
11#include "mc/world/level/BlockPos.h"
28namespace PointLighting {
31:
public ::PointLighting::ILightLODResourceProvider<::PointLighting::AnalyticLightResources> {
44 ::ll::TypedStorage<8, 8, uint64> mActiveProbeCount;
45 ::ll::TypedStorage<8, 8, uint64> mAllocatedFaceCount;
46 ::ll::TypedStorage<4, 4, uint> mGrowCount;
47 ::ll::TypedStorage<4, 4, uint> mShrinkCount;
48 ::ll::TypedStorage<4, 4, uint> mInvalidateCount;
49 ::ll::TypedStorage<4, 4, uint> mNewCount;
50 ::ll::TypedStorage<4, 4, uint> mConsecutiveFailureFrames;
51 ::ll::TypedStorage<1, 1, bool> mAtlasFull;
59 ::ll::TypedStorage<4, 4, uint> mConsecutiveFailureFrames;
60 ::ll::TypedStorage<1, 1, bool> mWasFullFlag;
61 ::ll::TypedStorage<1, 1, bool> mFailedThisFrame;
65 using ShadowProbeIndex = int;
67 using ProbeMap = ::std::unordered_map<::BlockPos, ::PointLighting::PointLightShadowProbe>;
72 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::dragon::atlas::IAtlasUserOperations>> mAtlasOps;
73 ::ll::TypedStorage<8, 64, ::std::unordered_map<::BlockPos, ::PointLighting::PointLightShadowProbe>> mActiveProbes;
77 ::std::_List_const_iterator<::std::_List_val<
78 ::std::_List_simple_types<::std::pair<::BlockPos const, ::PointLighting::PointLightShadowProbe>>>>>
80 ::ll::TypedStorage<8, 88, ::PointLighting::PointLightShadowBatchProcessor> mBatchProcessor;
81 ::ll::TypedStorage<1, 1, ::PointLighting::PointLightShadowAtlasHysteresis> mAtlasHysteresis;
82 ::ll::TypedStorage<4, 8, ::PointLighting::PointLightShadowProbeManager::AtlasPressureState> mAtlasState;
83 ::ll::TypedStorage<8, 136, ::mce::framebuilder::PointLightParameters> mLastParameters;
84 ::ll::TypedStorage<8, 24, ::std::vector<::AABB>> mBlockRegionChanges;
85 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::dragon::atlas::IAtlasHandle>> mShadowAtlas;
86 ::ll::TypedStorage<8, 40, ::PointLighting::PointLightShadowProbeManager::ProbeDebugStats> mLastFrameStats;
92 virtual ~PointLightShadowProbeManager() =
default;
94 virtual bool atCapacity() const ;
96 virtual
bool canReserve(::BlockPos const&) const ;
98 virtual
bool acquired(::BlockPos const&) const ;
100 virtual
void reserve(
102 ::mce::PointLightParameters const&,
104 ::PointLighting::AnalyticLightResources&
107 virtual
void release(::BlockPos const&, ::PointLighting::AnalyticLightResources&) ;
109 virtual
void advance(::BlockPos const&, ::PointLighting::AnalyticLightResources&,
float) ;
111 virtual
void refresh(::BlockPos const&, ::PointLighting::AnalyticLightResources&) ;
113 virtual
void finalize(::BlockPos const&, ::PointLighting::AnalyticLightResources&) ;
119 MCAPI
void _allocateProbeTile(
120 ::PointLighting::PointLightShadowProbe& probe,
121 ::dragon::rendering::TextureCubeFace face,
126 _invalidateProbeTile(::PointLighting::PointLightShadowProbe& probe, ::dragon::rendering::TextureCubeFace face);
128 MCAPI
bool _isProbeRendered(::PointLighting::PointLightShadowProbe const& probe) const;
130 MCAPI
void _processProbes(
131 ::mce::framebuilder::PointLightParameters const& pointLightParameters,
132 ::glm::vec3 const& worldOrigin,
133 ::FrustumCuller const& frustumCuller,
134 ::glm::vec3 const& cameraForward
137 MCAPI
void _reconfigureAtlasIfNeeded(::mce::framebuilder::PointLightParameters const& pointLightParameters);
139 MCAPI
bool _resizeProbeFace(
140 ::PointLighting::PointLightShadowProbe& probe,
141 ::dragon::rendering::TextureCubeFace face,
146 MCAPI ::mce::framebuilder::ShadowAtlasFrameDescription
147 getShadowFrameData(::mce::framebuilder::PointLightParameters const& pointLightParameters);
149 MCAPI
void onBlockChanged(
150 ::BlockSource& source,
151 ::BlockPos const& blockPos,
152 ::Block const& block,
153 ::Block const& oldBlock,
154 ::mce::framebuilder::PointLightParameters const& pointLightParameters
157 MCAPI ::std::vector<::mce::framebuilder::ActiveShadowTileInfo> prepareActiveTiles(::glm::vec3 const& worldOrigin);
Definition BlockSource.h:71
Definition FrustumCuller.h:5
Definition PointLightShadowProbeManager.h:7
Definition PointLightShadowProbe.h:7
Definition IAtlasHandle.h:7
Definition IAtlasUserOperations.h:7
Definition AnalyticLightResources.h:7
Definition PointLightShadowProbeManager.h:18
Definition PointLightShadowProbeManager.h:16
Definition PointLightParameters.h:7
Definition ActiveShadowTileInfo.h:7
Definition ShadowAtlasFrameDescription.h:7