Skip to content
LeviMC
English
AutoLightDark
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/chunks/render_chunk_vertex_streaming/RenderChunkVertexStreamPlanRegistry.h"
7#include "mc/client/renderer/debug/DebugRenderer.h"
8#include "mc/client/renderer/game/LevelBuilder.h"
9#include "mc/client/renderer/game/ShadowCascadeState.h"
10#include "mc/client/renderer/scripting/Renderer.h"
11#include "mc/deps/application/AppPlatformListener.h"
12#include "mc/deps/application/LowMemorySeverity.h"
13#include "mc/deps/core/math/Color.h"
14#include "mc/deps/core/utility/NonOwnerPointer.h"
15#include "mc/deps/core/utility/pub_sub/Subscription.h"
16#include "mc/deps/ecs/WeakEntityRef.h"
17#include "mc/deps/game_refs/OwnerPtr.h"
18#include "mc/deps/game_refs/StackRefResult.h"
19#include "mc/deps/minecraft_renderer/renderer/TexturePtr.h"
20#include "mc/world/level/BlockChangedEventTarget.h"
21#include "mc/world/level/LevelListener.h"
22#include "mc/world/level/Tick.h"
23#include "mc/world/level/dimension/DimensionType.h"
24
25// auto generated forward declare list
26// clang-format off
27class Actor;
30class Block;
32class BlockPos;
33class BlockSource;
36class ClientLevel;
39class GameRenderer;
41class GeometryGroup;
42class HashedString;
43class IClientInstance;
44class LevelChunk;
49class OptionRegistry;
50class ParticleEngine;
55class ScreenContext;
56class SoundMapping;
58class TaskGroup;
59class Tessellator;
60class TextureAtlas;
67namespace LightPropagation { class LightPropagationCoordinator; }
68namespace LightPropagation { class LightVolumeManager; }
69namespace PointLighting { class PointLightCoordinator; }
70namespace PointLighting { class PointLightShadowProbeManager; }
71namespace PointLighting { class StaticLightTransitionManager; }
72namespace cg { class ImageBuffer; }
73namespace dragon::atlas { class IAtlasUserOperations; }
74namespace mce { class Mesh; }
75namespace mce { class TextureGroup; }
76// clang-format on
77
79public:
80 LLAPI void rebuildAllRenderChunkGeometry();
81
82public:
83 // member variables
84 // NOLINTBEGIN
85 ::ll::TypedStorage<8, 64, ::std::unordered_map<::DimensionType, ::OwnerPtr<::RenderChunkCoordinator>>>
86 mRenderChunkCoordinators;
87 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PointLighting::PointLightCoordinator>> mPointLightCoordinator;
88 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PointLighting::PointLightShadowProbeManager>>
89 mPointLightShadowProbeManager;
90 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PointLighting::StaticLightTransitionManager>>
91 mStaticLightTransitionManager;
92 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LightPropagation::LightVolumeManager>> mLightVolumeManager;
93 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LightPropagation::LightPropagationCoordinator>>
94 mLightPropagationCoordinator;
95 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mLightVolumeOptionSubscription;
96 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::TextureGroup>> mTextureGroup;
97 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mShadowCylinder;
98 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mShadowOverlayCube;
99 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mShadowDisc;
100 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mSkyMesh;
101 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mStarsMesh;
102 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mEndSkyMesh;
103 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mSunMesh;
104 ::ll::TypedStorage<8, 128, ::std::shared_ptr<::mce::Mesh>[8]> mMoonMesh;
105 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Mesh>> mNameplateBackgroundMesh;
106 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mAtlasTexture;
107 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mBrightnessTex;
108 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mSunTex;
109 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mSunTexVibrantVisuals;
110 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mMoonTex;
111 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mEndSkyTex;
112 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mEndFlashTex;
113 ::ll::TypedStorage<8, 24, ::std::vector<::mce::TexturePtr>> mCrackFrames;
114 ::ll::TypedStorage<1, 1, ::DebugRenderer> mDebugRenderer;
115 ::ll::TypedStorage<8, 192, ::Scripting::RenderHelper::Renderer> mScriptDebugRenderer;
116 ::ll::TypedStorage<8, 8, ::Tick> mTicks;
117 ::ll::TypedStorage<8, 8, ::BlockActorRenderDispatcher&> mBlockEntityRenderDispatcher;
118 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockTessellator>> mLocalRenderer;
119 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ParticleEngine>> mParticleEngine;
120 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ParticleSystemEngine>> mParticleSystemEngine;
121 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GeometryEditorGui>> mGeometryEditorGui;
122 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mTaskGroup;
123 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mSyncTaskGroup;
124 ::ll::TypedStorage<8, 8, ::GameRenderer&> mGameRenderer;
125 ::ll::TypedStorage<8, 8, ::ClientLevel&> mLevel;
126 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::OptionRegistry>> mOptions;
127 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClientInstance;
128 ::ll::TypedStorage<8, 8, ::AtomicClientEntityDefinitionGroup&> mAtomicClientEntityDefinitionGroup;
129 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mLocalUser;
130 ::ll::TypedStorage<8, 64, ::std::function<void()>> mReleaseParticleSystemInterfaceProxyCallback;
131 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelRendererPlayer>> mLevelRendererPlayer;
132 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelRendererShadowCamera>> mLevelRendererShadowCamera;
133 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelRendererShadowCamera>> mLevelRendererCloudShadowCamera;
134 ::ll::TypedStorage<4, 4, ::ShadowCascadeState> mShadowCascadeState;
135 ::ll::TypedStorage<1, 1, bool> mTextureShiftsEnabled;
136 ::ll::TypedStorage<8, 152, ::RenderChunkVertexStreaming::RenderChunkVertexStreamPlanRegistry>
137 mRenderChunkVertexStreamPlanRegistry;
138 ::ll::TypedStorage<8, 1456, ::LevelBuilder> mLevelBuilder;
139 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelRendererProxy>> mProxy;
140 ::ll::TypedStorage<4, 16, ::mce::Color> mClearBufferColor;
141 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::PlayerRenderView>> mPlayerView;
142 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DataDrivenRendererV2RequiredData>> mDataDrivenRendererV2RequiredData;
143 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UniversalEntityRenderer>> mUniversalEntityRenderer;
144 // NOLINTEND
145
146public:
147 // prevent constructor by default
148 LevelRenderer& operator=(LevelRenderer const&);
149 LevelRenderer(LevelRenderer const&);
150 LevelRenderer();
151
152public:
153 // virtual functions
154 // NOLINTBEGIN
155 virtual ~LevelRenderer() /*override*/ = default;
156
157 virtual void onAppSuspended() /*override*/;
158
159 virtual void onAppResumed() /*override*/;
160
161 virtual void onDeviceLost() /*override*/;
162
163 virtual void onLowMemory(::LowMemorySeverity) /*override*/;
164
165 virtual void onBlockChanged(
166 ::BlockSource& source,
167 ::BlockPos const& blockPosition,
168 uint layer,
169 ::Block const& block,
170 ::Block const& oldBlock,
171 int updateFlags,
172 ::ActorBlockSyncMessage const* syncMsg,
173 ::BlockChangedEventTarget eventTarget,
174 ::Actor* blockChangeSource
175 ) /*override*/;
176
177 virtual void onChunkUnloaded(::LevelChunk& levelChunk) /*override*/;
178
179 virtual void takePicture(
180 ::cg::ImageBuffer& outImage,
181 ::Actor* camera,
182 ::Actor* target,
183 ::ScreenshotOptions& screenshotOptions,
184 ::std::function<void(::cg::ImageBuffer&, ::ScreenshotOptions&)> completedScreenshotCallback
185 ) /*override*/;
186 // NOLINTEND
187
188public:
189 // member functions
190 // NOLINTBEGIN
192 ::IClientInstance& clientInstance,
193 ::ClientLevel& level,
194 ::std::shared_ptr<::OptionRegistry> options,
195 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
196 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> const& terrainTexture,
197 ::WeakEntityRef localUser,
198 ::GameRenderer& gameRenderer,
199 ::Bedrock::NotNullNonOwnerPtr<::SoundPlayerInterface> const& soundPlayer,
200 ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup> const& geometryGroup,
201 ::SoundMapping const& sounds,
202 ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const> const& actorResourceDefinitionGroup,
203 ::Bedrock::NotNullNonOwnerPtr<::TextureShiftManager const>& textureShiftManager,
204 ::std::weak_ptr<::dragon::atlas::IAtlasUserOperations> atlasOps,
205 ::AtomicClientEntityDefinitionGroup& atomicClientEntityDefinitionGroup
206 );
207
208 MCNAPI void _createMeshes(::Tessellator& tessellator);
209
211 ::std::unordered_map<::HashedString, ::std::shared_ptr<::DataDrivenRenderer>> const& renderers,
212 ::MinecraftGameplayGraphicsResources& graphicsResources
213 );
214
216
217 MCNAPI void frameUpdate(::ClientFrameUpdateContext& clientFrameUpdateContext);
218
219 MCNAPI ::BlockTessellator& getBlockRenderer();
220
221 MCAPI ::StackRefResult<::RenderChunkCoordinator> getRenderChunkCoordinator(::DimensionType dimID);
222
223 MCNAPI void onDimensionChanged();
224
225 MCNAPI void onOptionsChanged();
226
227 MCAPI void preRenderUpdate(
228 ::ScreenContext& screenContext,
229 ::LevelRenderPreRenderUpdateParameters& levelRenderPreRenderUpdateParameters
230 );
231
233
234 MCNAPI void reinit(
235 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> const& terrainTexture,
236 ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup> const& geometryGroup,
237 ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const> const& actorResourceDefinitionGroup
238 );
239
240 MCAPI void renderLevel(::ScreenContext& screenContext, ::FrameRenderObject const& renderObj);
241
242 MCNAPI void resetLightVolumeManager(::std::weak_ptr<::RuntimeLocalLightingConfig const> runtimeLocalLightingConfig);
243
244 MCNAPI void resetLightingConfig(::std::weak_ptr<::RuntimeLocalLightingConfig const> runtimeLocalLightingConfig);
245
246 MCNAPI void resetPointLighting(::std::weak_ptr<::dragon::atlas::IAtlasUserOperations> atlasUserOps);
247
248 MCNAPI void tickLevelRenderer();
249 // NOLINTEND
250
251public:
252 // constructor thunks
253 // NOLINTBEGIN
254 MCNAPI void* $ctor(
255 ::IClientInstance& clientInstance,
256 ::ClientLevel& level,
257 ::std::shared_ptr<::OptionRegistry> options,
258 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
259 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> const& terrainTexture,
260 ::WeakEntityRef localUser,
261 ::GameRenderer& gameRenderer,
262 ::Bedrock::NotNullNonOwnerPtr<::SoundPlayerInterface> const& soundPlayer,
263 ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup> const& geometryGroup,
264 ::SoundMapping const& sounds,
265 ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const> const& actorResourceDefinitionGroup,
266 ::Bedrock::NotNullNonOwnerPtr<::TextureShiftManager const>& textureShiftManager,
267 ::std::weak_ptr<::dragon::atlas::IAtlasUserOperations> atlasOps,
268 ::AtomicClientEntityDefinitionGroup& atomicClientEntityDefinitionGroup
269 );
270 // NOLINTEND
271
272public:
273 // virtual function thunks
274 // NOLINTBEGIN
275 MCNAPI void $onAppSuspended();
276
277 MCNAPI void $onAppResumed();
278
279 MCNAPI void $onDeviceLost();
280
281 MCNAPI void $onLowMemory(::LowMemorySeverity);
282
283 MCNAPI void $onBlockChanged(
284 ::BlockSource& source,
285 ::BlockPos const& blockPosition,
286 uint layer,
287 ::Block const& block,
288 ::Block const& oldBlock,
289 int updateFlags,
290 ::ActorBlockSyncMessage const* syncMsg,
291 ::BlockChangedEventTarget eventTarget,
292 ::Actor* blockChangeSource
293 );
294
295 MCNAPI void $onChunkUnloaded(::LevelChunk& levelChunk);
296
297 MCNAPI void $takePicture(
298 ::cg::ImageBuffer& outImage,
299 ::Actor* camera,
300 ::Actor* target,
301 ::ScreenshotOptions& screenshotOptions,
302 ::std::function<void(::cg::ImageBuffer&, ::ScreenshotOptions&)> completedScreenshotCallback
303 );
304 // NOLINTEND
305};
Definition ActorResourceDefinitionGroup.h:5
Definition Actor.h:116
Definition AppPlatformListener.h:16
Definition AtomicClientEntityDefinitionGroup.h:12
Definition BlockActorRenderDispatcher.h:5
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition BlockTessellator.h:5
Definition Block.h:42
Definition ClientFrameUpdateContext.h:5
Definition ClientLevel.h:5
Definition DataDrivenRendererV2RequiredData.h:5
Definition DataDrivenRenderer.h:5
Definition GameRenderer.h:5
Definition GeometryEditorGui.h:5
Definition GeometryGroup.h:5
Definition HashedString.h:5
Definition IClientInstance.h:5
Definition LevelChunk.h:76
Definition LevelListener.h:28
Definition LevelRendererPlayer.h:5
Definition LevelRendererProxy.h:5
Definition LevelRendererShadowCamera.h:5
Definition LevelRenderer.h:5
MCAPI LevelRenderer(::IClientInstance &clientInstance, ::ClientLevel &level, ::std::shared_ptr<::OptionRegistry > options, ::std::shared_ptr<::mce::TextureGroup > textureGroup, ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const > const &terrainTexture, ::WeakEntityRef localUser, ::GameRenderer &gameRenderer, ::Bedrock::NotNullNonOwnerPtr<::SoundPlayerInterface > const &soundPlayer, ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup > const &geometryGroup, ::SoundMapping const &sounds, ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const > const &actorResourceDefinitionGroup, ::Bedrock::NotNullNonOwnerPtr<::TextureShiftManager const > &textureShiftManager, ::std::weak_ptr<::dragon::atlas::IAtlasUserOperations > atlasOps, ::AtomicClientEntityDefinitionGroup &atomicClientEntityDefinitionGroup)
MCAPI void $onAppResumed()
MCAPI void $onAppSuspended()
MCAPI void reinit(::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const > const &terrainTexture, ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup > const &geometryGroup, ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const > const &actorResourceDefinitionGroup)
MCAPI void * $ctor(::IClientInstance &clientInstance, ::ClientLevel &level, ::std::shared_ptr<::OptionRegistry > options, ::std::shared_ptr<::mce::TextureGroup > textureGroup, ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const > const &terrainTexture, ::WeakEntityRef localUser, ::GameRenderer &gameRenderer, ::Bedrock::NotNullNonOwnerPtr<::SoundPlayerInterface > const &soundPlayer, ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup > const &geometryGroup, ::SoundMapping const &sounds, ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const > const &actorResourceDefinitionGroup, ::Bedrock::NotNullNonOwnerPtr<::TextureShiftManager const > &textureShiftManager, ::std::weak_ptr<::dragon::atlas::IAtlasUserOperations > atlasOps, ::AtomicClientEntityDefinitionGroup &atomicClientEntityDefinitionGroup)
MCAPI void _initDataDrivenRendererResources(::std::unordered_map<::HashedString, ::std::shared_ptr<::DataDrivenRenderer > > const &renderers, ::MinecraftGameplayGraphicsResources &graphicsResources)
MCAPI void _setLevelRendererCameras()
MCAPI void _createMeshes(::Tessellator &tessellator)
MCAPI void $onChunkUnloaded(::LevelChunk &levelChunk)
MCAPI void $onDeviceLost()
MCAPI void $onBlockChanged(::BlockSource &source, ::BlockPos const &blockPosition, uint layer, ::Block const &block, ::Block const &oldBlock, int updateFlags, ::ActorBlockSyncMessage const *syncMsg, ::BlockChangedEventTarget eventTarget, ::Actor *blockChangeSource)
MCAPI void resetLightVolumeManager(::std::weak_ptr<::RuntimeLocalLightingConfig const > runtimeLocalLightingConfig)
MCAPI void tickLevelRenderer()
MCAPI void onDimensionChanged()
MCAPI void frameUpdate(::ClientFrameUpdateContext &clientFrameUpdateContext)
MCAPI void rebuildAllDDRv2Geometry()
MCAPI void resetLightingConfig(::std::weak_ptr<::RuntimeLocalLightingConfig const > runtimeLocalLightingConfig)
MCAPI void $onLowMemory(::LowMemorySeverity)
MCAPI::BlockTessellator & getBlockRenderer()
MCAPI void $takePicture(::cg::ImageBuffer &outImage, ::Actor *camera, ::Actor *target, ::ScreenshotOptions &screenshotOptions, ::std::function< void(::cg::ImageBuffer &, ::ScreenshotOptions &)> completedScreenshotCallback)
MCAPI void onOptionsChanged()
MCAPI void resetPointLighting(::std::weak_ptr<::dragon::atlas::IAtlasUserOperations > atlasUserOps)
Definition LightPropagationCoordinator.h:7
Definition LightVolumeManager.h:7
Definition MinecraftGameplayGraphicsResources.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 StaticLightTransitionManager.h:7
Definition RenderChunkCoordinator.h:5
Definition RuntimeLocalLightingConfig.h:5
Definition ScreenContext.h:5
Definition SoundMapping.h:5
Definition SoundPlayerInterface.h:24
Definition TaskGroup.h:85
Definition Tessellator.h:5
Definition TextureAtlas.h:5
Definition TextureShiftManager.h:5
Definition UniversalEntityRenderer.h:5
Definition WeakEntityRef.h:14
Definition ImageBuffer.h:16
Definition IAtlasUserOperations.h:7
Definition Mesh.h:7
Definition TextureGroup.h:7
Definition ActorBlockSyncMessage.h:8
Definition DimensionType.h:5
Definition FrameRenderObject.h:5
Definition LevelRenderPreRenderUpdateParameters.h:5
Definition ScreenshotOptions.h:5