3#include "mc/_HeaderOutputPredefine.h"
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"
72namespace mce {
class Mesh; }
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;
139 LevelRenderer& operator=(LevelRenderer
const&);
140 LevelRenderer(LevelRenderer
const&);
146 virtual ~LevelRenderer() ;
148 virtual void onAppSuspended() ;
150 virtual void onAppResumed() ;
152 virtual void onDeviceLost() ;
154 virtual void onLowMemory(::LowMemorySeverity) ;
156 virtual void onBlockChanged(
157 ::BlockSource& source,
158 ::BlockPos
const& pos,
160 ::Block
const& block,
161 ::Block
const& oldBlock,
163 ::ActorBlockSyncMessage
const* syncMsg,
164 ::BlockChangedEventTarget eventTarget,
165 ::Actor* blockChangeSource
168 virtual void onChunkUnloaded(::LevelChunk& levelChunk) ;
170 virtual void takePicture(
171 ::cg::ImageBuffer& outImage,
174 ::ScreenshotOptions& screenshotOptions,
175 ::std::function<
void(::cg::ImageBuffer&, ::ScreenshotOptions&)> completedScreenshotCallback
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
197 MCAPI
void _createMeshes(::Tessellator& tessellator);
199 MCAPI
void _createParticleEngines();
201 MCAPI
void _debugDrawClientSideChunkGenBlockDifferences();
203 MCAPI
void _initPipelineTessellatorResources(
204 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> textureAtlas,
205 ::Bedrock::NotNullNonOwnerPtr<::TextureShiftManager const> textureShiftManager
208 MCAPI
void _initResources();
210 MCAPI
void _resetMeshes();
212 MCAPI
void _setLevelRendererCameras();
214 MCAPI
void endFrame(::mce::TextureResourceService& textureResourceService);
216 MCAPI
void frameUpdate(::ClientFrameUpdateContext& clientFrameUpdateContext);
218 MCAPI ::BlockTessellator& getBlockRenderer();
220 MCAPI ::mce::Color
const& getClearBufferColor()
const;
222 MCAPI ::DataDrivenRendererV2RequiredData* getDataDrivenRendererV2RequiredData();
224 MCAPI ::std::shared_ptr<::ActorRenderDispatcher> getEntityRenderDispatcher();
226 MCAPI ::std::shared_ptr<::LevelRendererShadowCamera> getLevelRendererCloudShadowCamera();
228 MCFOLD ::LevelRendererPlayer
const& getLevelRendererPlayer()
const;
230 MCFOLD ::LevelRendererPlayer& getLevelRendererPlayer();
232 MCAPI ::std::shared_ptr<::LevelRendererShadowCamera> getLevelRendererShadowCamera();
234 MCAPI ::std::weak_ptr<::LightPropagation::LightPropagationCoordinator> getLightPropagationCoordinator();
236 MCFOLD ::std::weak_ptr<::LightPropagation::LightVolumeManager> getLightVolumeManager();
238 MCFOLD ::std::weak_ptr<::LightPropagation::LightVolumeManager const> getLightVolumeManagerConst()
const;
240 MCAPI ::ParticleEngine& getParticleEngine()
const;
242 MCAPI ::ParticleSystemEngine& getParticleSystemEngine()
const;
244 MCAPI ::StackRefResult<::RenderChunkCoordinator> getRenderChunkCoordinator(::DimensionType dimID);
246 MCAPI ::IRenderChunkGarbageCollection& getRenderChunkGarbageCollection();
248 MCAPI ::Bedrock::NotNullNonOwnerPtr<::ClientBlockPipeline::SchematicsRepository> getSchematicsRepository()
const;
250 MCFOLD ::Scripting::RenderHelper::RendererInterface& getScriptRendererInterface();
252 MCAPI
bool getTextureShiftsEnabled()
const;
254 MCFOLD ::Tick
const& getTicks()
const;
256 MCAPI ::DataDrivenRendererContinuousData* getV2ContinuousData();
258 MCAPI ::ProcessedDataDrivenRenderers
const* getV2ProcessedDataDrivenRenderers()
const;
260 MCAPI
bool getV2ShouldRenderActorsWithAttachables()
const;
262 MCAPI
void onDimensionChanged();
264 MCAPI
void onOptionsChanged();
266 MCAPI
void onWillChangeDimension();
268 MCAPI
void preRenderUpdate(
269 ::ScreenContext& screenContext,
270 ::LevelRenderPreRenderUpdateParameters& levelRenderPreRenderUpdateParameters
273 MCAPI
void rebuildAllDDRv2Geometry();
275 MCAPI
void rebuildAllRenderChunkGeometry();
278 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const>
const& terrainTexture,
279 ::Bedrock::NotNullNonOwnerPtr<::GeometryGroup>
const& geometryGroup,
280 ::Bedrock::NotNullNonOwnerPtr<::ActorResourceDefinitionGroup const>
const& actorResourceDefinitionGroup
283 MCAPI
void relightAllRenderChunkGeometry();
285 MCAPI
void renderLevel(::ScreenContext& screenContext, ::FrameRenderObject
const& renderObj);
287 MCAPI
void resetCameras();
289 MCAPI
void resetLightVolumeManager(::std::weak_ptr<::RuntimeLocalLightingConfig const> runtimeLocalLightingConfig);
291 MCAPI
void resetLightingConfig(::std::weak_ptr<::RuntimeLocalLightingConfig const> runtimeLocalLightingConfig);
293 MCAPI
void resetPointLighting();
295 MCAPI
void tickLevelRenderer();
301 MCAPI
static float const& Z_NEAR();
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
332 MCAPI
void $onAppSuspended();
334 MCAPI
void $onAppResumed();
336 MCAPI
void $onDeviceLost();
338 MCAPI
void $onLowMemory(::LowMemorySeverity);
340 MCAPI
void $onBlockChanged(
341 ::BlockSource& source,
342 ::BlockPos
const& pos,
344 ::Block
const& block,
345 ::Block
const& oldBlock,
347 ::ActorBlockSyncMessage
const* syncMsg,
348 ::BlockChangedEventTarget eventTarget,
349 ::Actor* blockChangeSource
352 MCAPI
void $onChunkUnloaded(::LevelChunk& levelChunk);
354 MCAPI
void $takePicture(
355 ::cg::ImageBuffer& outImage,
358 ::ScreenshotOptions& screenshotOptions,
359 ::std::function<
void(::cg::ImageBuffer&, ::ScreenshotOptions&)> completedScreenshotCallback
Definition ActorRenderDispatcher.h:5
Definition ActorResourceDefinitionGroup.h:5
Definition BlockActorRenderDispatcher.h:5
Definition BlockSource.h:73
Definition BlockTessellator.h:5
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 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