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