LeviLamina
Loading...
Searching...
No Matches
LevelRenderer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/renderer/debug/DebugRenderer.h"
7#include "mc/client/renderer/game/LevelBuilder.h"
8#include "mc/client/renderer/game/ShadowCascadeState.h"
9#include "mc/client/renderer/scripting/Renderer.h"
10#include "mc/deps/application/AppPlatformListener.h"
11#include "mc/deps/application/LowMemorySeverity.h"
12#include "mc/deps/core/math/Color.h"
13#include "mc/deps/core/utility/NonOwnerPointer.h"
14#include "mc/deps/core/utility/pub_sub/Subscription.h"
15#include "mc/deps/ecs/WeakEntityRef.h"
16#include "mc/deps/game_refs/OwnerPtr.h"
17#include "mc/deps/game_refs/StackRefResult.h"
18#include "mc/deps/minecraft_renderer/renderer/TexturePtr.h"
19#include "mc/world/level/BlockChangedEventTarget.h"
20#include "mc/world/level/LevelListener.h"
21#include "mc/world/level/Tick.h"
22
23// auto generated forward declare list
24// clang-format off
25class Actor;
28class Block;
30class BlockPos;
31class BlockSource;
35class GameRenderer;
37class GeometryGroup;
38class IClientInstance;
40class LevelChunk;
45class OptionRegistry;
46class ParticleEngine;
51class ScreenContext;
52class SoundMapping;
54class TaskGroup;
55class Tessellator;
56class TextureAtlas;
64namespace ClientBlockPipeline { class SchematicsRepository; }
65namespace LightPropagation { class LightPropagationCoordinator; }
66namespace LightPropagation { class LightVolumeManager; }
67namespace PointLighting { class PointLightCoordinator; }
68namespace PointLighting { class PointLightShadowProbeManager; }
69namespace Scripting::RenderHelper { class RendererInterface; }
70namespace cg { class ImageBuffer; }
71namespace mce { class Mesh; }
72namespace mce { class TextureGroup; }
73namespace mce { struct TextureResourceService; }
74// clang-format on
75
77public:
78 // member variables
79 // NOLINTBEGIN
80 ::ll::TypedStorage<8, 64, ::std::unordered_map<::DimensionType, ::OwnerPtr<::RenderChunkCoordinator>>>
81 mRenderChunkCoordinators;
82 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PointLighting::PointLightCoordinator>> mPointLightCoordinator;
83 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PointLighting::PointLightShadowProbeManager>>
84 mPointLightShadowProbeManager;
85 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mPointLightLODOptionSubscription;
86 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mPointLightShadowOptionSubscription;
87 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LightPropagation::LightVolumeManager>> mLightVolumeManager;
88 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LightPropagation::LightPropagationCoordinator>>
89 mLightPropagationCoordinator;
90 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::TextureGroup>> mTextureGroup;
91 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mShadowCylinder;
92 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mShadowOverlayCube;
93 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mShadowDisc;
94 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mSkyMesh;
95 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mStarsMesh;
96 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mEndSkyMesh;
97 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mSunMesh;
98 ::ll::TypedStorage<8, 128, ::std::shared_ptr<::mce::Mesh>[8]> mMoonMesh;
99 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mNameplateBackgroundMesh;
100 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mAtlasTexture;
101 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mBrightnessTex;
102 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mSunTex;
103 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mSunTexVibrantVisuals;
104 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mMoonTex;
105 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mEndSkyTex;
106 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mEndFlashTex;
107 ::ll::TypedStorage<8, 24, ::std::vector<::mce::TexturePtr>> mCrackFrames;
108 ::ll::TypedStorage<1, 1, ::DebugRenderer> mDebugRenderer;
109 ::ll::TypedStorage<8, 192, ::Scripting::RenderHelper::Renderer> mScriptDebugRenderer;
110 ::ll::TypedStorage<8, 8, ::Tick> mTicks;
111 ::ll::TypedStorage<8, 8, ::BlockActorRenderDispatcher&> mBlockEntityRenderDispatcher;
112 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockTessellator>> mLocalRenderer;
113 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ParticleEngine>> mParticleEngine;
114 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ParticleSystemEngine>> mParticleSystemEngine;
115 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GeometryEditorGui>> mGeometryEditorGui;
116 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mTaskGroup;
117 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mSyncTaskGroup;
118 ::ll::TypedStorage<8, 8, ::GameRenderer&> mGameRenderer;
119 ::ll::TypedStorage<8, 8, ::MultiPlayerLevel&> mLevel;
120 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::OptionRegistry>> mOptions;
121 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClientInstance;
122 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mLocalUser;
123 ::ll::TypedStorage<8, 64, ::std::function<void()>> mReleaseParticleSystemInterfaceProxyCallback;
124 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelRendererPlayer>> mLevelRendererPlayer;
125 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelRendererShadowCamera>> mLevelRendererShadowCamera;
126 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelRendererShadowCamera>> mLevelRendererCloudShadowCamera;
127 ::ll::TypedStorage<4, 4, ::ShadowCascadeState> mShadowCascadeState;
128 ::ll::TypedStorage<1, 1, bool> mTextureShiftsEnabled;
129 ::ll::TypedStorage<8, 1456, ::LevelBuilder> mLevelBuilder;
130 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelRendererProxy>> mProxy;
131 ::ll::TypedStorage<4, 16, ::mce::Color> mClearBufferColor;
132 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::PlayerRenderView>> mPlayerView;
133 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DataDrivenRendererV2RequiredData>> mDataDrivenRendererV2RequiredData;
134 // NOLINTEND
135
136public:
137 // prevent constructor by default
138 LevelRenderer& operator=(LevelRenderer const&);
139 LevelRenderer(LevelRenderer const&);
140 LevelRenderer();
141
142public:
143 // virtual functions
144 // NOLINTBEGIN
145 virtual ~LevelRenderer() /*override*/;
146
147 virtual void onAppSuspended() /*override*/;
148
149 virtual void onAppResumed() /*override*/;
150
151 virtual void onDeviceLost() /*override*/;
152
153 virtual void onLowMemory(::LowMemorySeverity) /*override*/;
154
155 virtual void onBlockChanged(
156 ::BlockSource& source,
157 ::BlockPos const& pos,
158 uint layer,
159 ::Block const& block,
160 ::Block const& oldBlock,
161 int updateFlags,
162 ::ActorBlockSyncMessage const* syncMsg,
163 ::BlockChangedEventTarget eventTarget,
164 ::Actor* blockChangeSource
165 ) /*override*/;
166
167 virtual void onChunkUnloaded(::LevelChunk& levelChunk) /*override*/;
168
169 virtual void takePicture(
170 ::cg::ImageBuffer& outImage,
171 ::Actor* camera,
172 ::Actor* target,
173 ::ScreenshotOptions& screenshotOptions,
174 ::std::function<void(::cg::ImageBuffer&, ::ScreenshotOptions&)> completedScreenshotCallback
175 ) /*override*/;
176 // NOLINTEND
177
178public:
179 // member functions
180 // NOLINTBEGIN
181 MCAPI LevelRenderer(
182 ::IClientInstance& clientInstance,
183 ::MultiPlayerLevel& level,
184 ::std::shared_ptr<::OptionRegistry> options,
185 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
186 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> const& terrainTexture,
187 ::WeakEntityRef localUser,
188 ::GameRenderer& gameRenderer,
189 ::Bedrock::NotNullNonOwnerPtr<::SoundPlayerInterface> const& soundPlayer,
190 ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup> const& geometryGroup,
191 ::SoundMapping const& sounds,
192 ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const> const& actorResourceDefinitionGroup,
193 ::Bedrock::NotNullNonOwnerPtr<::TextureShiftManager const>& textureShiftManager
194 );
195
196 MCAPI void _createMeshes(::Tessellator& tessellator);
197
198 MCAPI void _createParticleEngines();
199
200 MCAPI void _debugDrawClientSideChunkGenBlockDifferences();
201
202 MCAPI void _initPipelineTessellatorResources(
203 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> textureAtlas,
204 ::Bedrock::NotNullNonOwnerPtr<::TextureShiftManager const> textureShiftManager
205 );
206
207 MCAPI void _initResources();
208
209 MCAPI void _resetMeshes();
210
211 MCAPI void _setLevelRendererCameras();
212
213 MCAPI void endFrame(::mce::TextureResourceService& textureResourceService);
214
215 MCAPI void frameUpdate(::ClientFrameUpdateContext& clientFrameUpdateContext);
216
217 MCAPI ::BlockTessellator& getBlockRenderer();
218
219 MCAPI ::mce::Color const& getClearBufferColor() const;
220
221 MCAPI ::DataDrivenRendererV2RequiredData* getDataDrivenRendererV2RequiredData();
222
223 MCAPI ::std::shared_ptr<::ActorRenderDispatcher> getEntityRenderDispatcher();
224
225 MCAPI ::std::shared_ptr<::LevelRendererShadowCamera> getLevelRendererCloudShadowCamera();
226
227 MCFOLD ::LevelRendererPlayer const& getLevelRendererPlayer() const;
228
229 MCFOLD ::LevelRendererPlayer& getLevelRendererPlayer();
230
231 MCAPI ::std::shared_ptr<::LevelRendererShadowCamera> getLevelRendererShadowCamera();
232
233 MCAPI ::std::weak_ptr<::LightPropagation::LightPropagationCoordinator> getLightPropagationCoordinator();
234
235 MCFOLD ::std::weak_ptr<::LightPropagation::LightVolumeManager> getLightVolumeManager();
236
237 MCFOLD ::std::weak_ptr<::LightPropagation::LightVolumeManager const> getLightVolumeManagerConst() const;
238
239 MCAPI ::ParticleEngine& getParticleEngine() const;
240
241 MCAPI ::ParticleSystemEngine& getParticleSystemEngine() const;
242
243 MCAPI ::StackRefResult<::RenderChunkCoordinator> getRenderChunkCoordinator(::DimensionType dimID);
244
245 MCAPI ::IRenderChunkGarbageCollection& getRenderChunkGarbageCollection();
246
247 MCAPI ::Bedrock::NotNullNonOwnerPtr<::ClientBlockPipeline::SchematicsRepository> getSchematicsRepository() const;
248
249 MCFOLD ::Scripting::RenderHelper::RendererInterface& getScriptRendererInterface();
250
251 MCAPI bool getTextureShiftsEnabled() const;
252
253 MCFOLD ::Tick const& getTicks() const;
254
255 MCAPI ::DataDrivenRendererContinuousData* getV2ContinuousData();
256
257 MCAPI ::ProcessedDataDrivenRenderers const* getV2ProcessedDataDrivenRenderers() const;
258
259 MCAPI bool getV2ShouldRenderActorsWithAttachables() const;
260
261 MCAPI void onDimensionChanged();
262
263 MCAPI void onOptionsChanged();
264
265 MCAPI void onWillChangeDimension();
266
267 MCAPI void preRenderUpdate(
268 ::ScreenContext& screenContext,
269 ::LevelRenderPreRenderUpdateParameters& levelRenderPreRenderUpdateParameters
270 );
271
272 MCAPI void rebuildAllDDRv2Geometry();
273
274 MCAPI void rebuildAllRenderChunkGeometry();
275
276 MCAPI void reinit(
277 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> const& terrainTexture,
278 ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup> const& geometryGroup,
279 ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const> const& actorResourceDefinitionGroup
280 );
281
282 MCAPI void relightAllRenderChunkGeometry();
283
284 MCAPI void renderLevel(::ScreenContext& screenContext, ::FrameRenderObject const& renderObj);
285
286 MCAPI void resetCameras();
287
288 MCAPI void resetLightVolumeManager(::std::weak_ptr<::RuntimeLocalLightingConfig const> runtimeLocalLightingConfig);
289
290 MCAPI void resetLightingConfig(::std::weak_ptr<::RuntimeLocalLightingConfig const> runtimeLocalLightingConfig);
291
292 MCAPI void resetPointLighting();
293
294 MCAPI void tickLevelRenderer();
295 // NOLINTEND
296
297public:
298 // static variables
299 // NOLINTBEGIN
300 MCAPI static float const& Z_NEAR();
301 // NOLINTEND
302
303public:
304 // constructor thunks
305 // NOLINTBEGIN
306 MCAPI void* $ctor(
307 ::IClientInstance& clientInstance,
308 ::MultiPlayerLevel& level,
309 ::std::shared_ptr<::OptionRegistry> options,
310 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
311 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> const& terrainTexture,
312 ::WeakEntityRef localUser,
313 ::GameRenderer& gameRenderer,
314 ::Bedrock::NotNullNonOwnerPtr<::SoundPlayerInterface> const& soundPlayer,
315 ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup> const& geometryGroup,
316 ::SoundMapping const& sounds,
317 ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const> const& actorResourceDefinitionGroup,
318 ::Bedrock::NotNullNonOwnerPtr<::TextureShiftManager const>& textureShiftManager
319 );
320 // NOLINTEND
321
322public:
323 // destructor thunk
324 // NOLINTBEGIN
325 MCAPI void $dtor();
326 // NOLINTEND
327
328public:
329 // virtual function thunks
330 // NOLINTBEGIN
331 MCAPI void $onAppSuspended();
332
333 MCAPI void $onAppResumed();
334
335 MCAPI void $onDeviceLost();
336
337 MCAPI void $onLowMemory(::LowMemorySeverity);
338
339 MCAPI void $onBlockChanged(
340 ::BlockSource& source,
341 ::BlockPos const& pos,
342 uint layer,
343 ::Block const& block,
344 ::Block const& oldBlock,
345 int updateFlags,
346 ::ActorBlockSyncMessage const* syncMsg,
347 ::BlockChangedEventTarget eventTarget,
348 ::Actor* blockChangeSource
349 );
350
351 MCAPI void $onChunkUnloaded(::LevelChunk& levelChunk);
352
353 MCAPI void $takePicture(
354 ::cg::ImageBuffer& outImage,
355 ::Actor* camera,
356 ::Actor* target,
357 ::ScreenshotOptions& screenshotOptions,
358 ::std::function<void(::cg::ImageBuffer&, ::ScreenshotOptions&)> completedScreenshotCallback
359 );
360 // NOLINTEND
361
362public:
363 // vftables
364 // NOLINTBEGIN
365 MCNAPI static void** $vftableForLevelListener();
366
367 MCNAPI static void** $vftableForAppPlatformListener();
368 // NOLINTEND
369};
Definition ActorRenderDispatcher.h:5
Definition ActorResourceDefinitionGroup.h:5
Definition Actor.h:123
Definition AppPlatformListener.h:15
Definition BlockActorRenderDispatcher.h:5
Definition BlockPos.h:21
Definition BlockSource.h:72
Definition BlockTessellator.h:5
Definition Block.h:69
Definition SchematicsRepository.h:7
Definition ClientFrameUpdateContext.h:5
Definition DataDrivenRendererV2RequiredData.h:5
Definition GameRenderer.h:5
Definition GeometryEditorGui.h:5
Definition GeometryGroup.h:5
Definition IClientInstance.h:5
Definition IRenderChunkGarbageCollection.h:5
Definition LevelChunk.h:87
Definition LevelListener.h:28
Definition LevelRendererPlayer.h:5
Definition LevelRendererProxy.h:5
Definition LevelRendererShadowCamera.h:5
Definition LevelRenderer.h:5
static MCAPI void ** $vftableForLevelListener()
static MCAPI void ** $vftableForAppPlatformListener()
Definition LightPropagationCoordinator.h:7
Definition LightVolumeManager.h:7
Definition MultiPlayerLevel.h:5
Definition OptionRegistry.h:5
Definition ParticleEngine.h:5
Definition ParticleSystemEngine.h:5
Definition PlayerRenderView.h:5
Definition PointLightCoordinator.h:7
Definition PointLightShadowProbeManager.h:7
Definition RenderChunkCoordinator.h:5
Definition RuntimeLocalLightingConfig.h:5
Definition ScreenContext.h:5
Definition RendererInterface.h:7
Definition SoundMapping.h:5
Definition SoundPlayerInterface.h:22
Definition TaskGroup.h:55
Definition Tessellator.h:5
Definition TextureAtlas.h:5
Definition TextureShiftManager.h:5
Definition ImageBuffer.h:16
Definition Mesh.h:7
Definition TextureGroup.h:7
Definition ActorBlockSyncMessage.h:8
Definition DataDrivenRendererContinuousData.h:5
Definition FrameRenderObject.h:5
Definition LevelRenderPreRenderUpdateParameters.h:5
Definition ProcessedDataDrivenRenderers.h:5
Definition ScreenshotOptions.h:9
Definition TextureResourceService.h:7