Package net.minecraft.client.renderer
Class LevelRenderer
java.lang.Object
net.minecraft.client.renderer.LevelRenderer
- All Implemented Interfaces:
AutoCloseable,PreparableReloadListener,ResourceManagerReloadListener
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier, PreparableReloadListener.SharedState, PreparableReloadListener.StateKey<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockEntityRenderDispatcherprivate Frustumprivate booleanprivate final CloudRendererfinal DebugRendererprivate final it.unimi.dsi.fastutil.ints.Int2ObjectMap<BlockDestructionProgress> private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<SortedSet<BlockDestructionProgress>> private static final ResourceLocationprivate RenderTargetprivate final EntityRenderDispatcherprivate final FeatureRenderDispatcherstatic final intprivate intprivate intprivate intprivate BlockPosprivate intprivate ClientLevel(package private) final LevelRenderStateprivate static final org.slf4j.Loggerprivate final Minecraftprivate static final intstatic final intprivate final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> private final ParticlesRenderStateprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate final RenderBuffersstatic final intprivate final SectionOcclusionGraphprivate SectionRenderDispatcherprivate final SkyRendererprivate final SubmitNodeStorageprivate final LevelTargetBundleprivate intprivate intprivate static final ResourceLocationprivate ViewAreaprivate final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> private final WeatherEffectRendererprivate final WorldBorderRenderer -
Constructor Summary
ConstructorsConstructorDescriptionLevelRenderer(Minecraft pMinecraft, EntityRenderDispatcher pEntityRenderDispatcher, BlockEntityRenderDispatcher pBlockEntityRenderDispatcher, RenderBuffers pRenderBuffers, LevelRenderState pLevelRenderState, FeatureRenderDispatcher pFeatureRenderDispatcher) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddCloudsPass(FrameGraphBuilder pFrameGraphBuilder, CloudStatus pCloudStatus, Vec3 pCameraPosition, float pTicks, int pCloudColor, float pCloudHeight) Deprecated.private voidaddCloudsPass(FrameGraphBuilder pFrameGraphBuilder, CloudStatus pCloudStatus, Vec3 pCameraPosition, float pTicks, int pCloudColor, float pCloudHeight, Matrix4f modelViewMatrix) private voidaddLateDebugPass(FrameGraphBuilder pFrameGraphBuilder, Vec3 pCameraPosition, GpuBufferSlice pShaderFog, Frustum pFrustum) private voidaddMainPass(FrameGraphBuilder pFrameGraphBuilder, Frustum pFrustum, Matrix4f pFrustumMatrix, GpuBufferSlice pShaderFog, boolean pRenderBlockOutline, LevelRenderState pRenderState, DeltaTracker pDeltaTracker, ProfilerFiller pProfier) private voidaddParticlesPass(FrameGraphBuilder pFrameGraphBuilder, GpuBufferSlice pShaderFog) Deprecated.Neo: useaddParticlesPass(FrameGraphBuilder, GpuBufferSlice, Matrix4f)insteadprivate voidaddParticlesPass(FrameGraphBuilder pFrameGraphBuilder, GpuBufferSlice pShaderFog, Matrix4f modelViewMatrix) voidaddRecentlyCompiledSection(SectionRenderDispatcher.RenderSection pRenderSection) private voidaddSkyPass(FrameGraphBuilder pFrameGraphBuilder, Camera pCamera, GpuBufferSlice pShaderFog) Deprecated.Neo: useaddSkyPass(FrameGraphBuilder, Camera, GpuBufferSlice, Matrix4f)insteadprivate voidaddSkyPass(FrameGraphBuilder pFrameGraphBuilder, Camera pCamera, GpuBufferSlice pShaderFog, Matrix4f modelViewMatrix) private voidaddWeatherPass(FrameGraphBuilder pFrameGraphBuilder, Vec3 pCameraPosition, GpuBufferSlice pShaderFog) Deprecated.Neo: useaddWeatherPass(FrameGraphBuilder, Vec3, GpuBufferSlice, Matrix4f)insteadprivate voidaddWeatherPass(FrameGraphBuilder pFrameGraphBuilder, Vec3 pCameraPosition, GpuBufferSlice pShaderFog, Matrix4f modelViewMatrix) voidprivate voidapplyFrustum(Frustum pFrustum) voidblockChanged(BlockGetter pLevel, BlockPos pPos, BlockState pOldState, BlockState pNewState, int pFlags) voidprivate voidcheckPoseStack(PoseStack pPoseStack) Asserts that the specifiedposeStackis.invalid reference
clear
private voidvoidclose()private voidcompileSections(Camera pCamera) intprivate voidcullTerrain(Camera pCamera, Frustum pFrustum, boolean pSpectator) voiddestroyBlockProgress(int pBreakerId, BlockPos pPos, int pProgress) voidprivate booleandoesMobEffectBlockSky(Camera pCamera) voidendFrame()private voidextractBlockDestroyAnimation(Camera pCamera, LevelRenderState pRenderState) private voidextractBlockOutline(Camera pCamera, LevelRenderState pRenderState) private EntityRenderStateextractEntity(Entity pEntity, float pPartialTick) private voidextractVisibleBlockEntities(Camera pCamera, float pPartialTick, LevelRenderState pRenderState) Deprecated.private voidextractVisibleBlockEntities(Camera pCamera, float pPartialTick, LevelRenderState pRenderState, Frustum frustum) private voidextractVisibleEntities(Camera pCamera, Frustum pFrustum, DeltaTracker pDeltaTracker, LevelRenderState pRenderState) doublestatic intgetLightColor(LevelRenderer.BrightnessGetter pBrightnessGetter, BlockAndTintGetter pLevel, BlockState pState, BlockPos pPos) static intgetLightColor(BlockAndTintGetter pLevel, BlockPos pPos) Iterable<? extends IRenderableSection> intgetTicks()doubleprivate PostChainit.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> booleanvoidbooleanisSectionCompiled(BlockPos pPos) voiditerateVisibleBlockEntities(Consumer<BlockEntity> blockEntityConsumer) voidvoidstatic FrustumoffsetFrustum(Frustum pFrustum) voidonChunkReadyToRender(ChunkPos pChunkPos) voidonResourceManagerReload(ResourceManager pResourceManager) voidonSectionBecomingNonEmpty(long pSectionPos) private ChunkSectionsToRenderprepareChunkRenders(Matrix4fc pFrustumMatrix, double pX, double pY, double pZ) private FrustumprepareCullFrustum(Matrix4f pFrustumMatrix, Matrix4f pProjectionMatrix, Vec3 pCameraPosition) private voidprivate voidremoveProgress(BlockDestructionProgress pProgress) private voidrenderBlockDestroyAnimation(PoseStack pPoseStack, MultiBufferSource.BufferSource pBufferSource, LevelRenderState pRenderState) private voidrenderBlockOutline(MultiBufferSource.BufferSource pBufferSource, PoseStack pPoseStack, boolean pTranslucent, LevelRenderState pRenderState) private voidrenderHitOutline(PoseStack pPoseStack, VertexConsumer pConsumer, double pCamX, double pCamY, double pCamZ, BlockOutlineRenderState pOutlineRenderState, int pColor) voidrenderLevel(GraphicsResourceAllocator pGraphicsResourceAllocator, DeltaTracker pDeltaTracker, boolean pRenderBlockOutline, Camera pCamera, Matrix4f pFrustumMatrix, Matrix4f pProjectionMatrix, Matrix4f pCullingProjectionMatrix, GpuBufferSlice pShaderFog, Vector4f pFogColor, boolean pRenderSky) voidresize(int pWidth, int pHeight) private voidscheduleResort(SectionRenderDispatcher.RenderSection pSection, TranslucencyPointOfView pPointOfView, Vec3 pCameraPosition, boolean pForce, boolean pIgnoreAxisAlignment) private voidscheduleTranslucentSectionResort(Vec3 pCameraPosition) private voidsetBlockDirty(BlockPos pPos, boolean pReRenderOnMainThread) voidsetBlockDirty(BlockPos pPos, BlockState pOldState, BlockState pNewState) voidsetBlocksDirty(int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ) Re-renders all blocks in the specified range.voidsetLevel(ClientLevel pLevel) voidsetSectionDirty(int pSectionX, int pSectionY, int pSectionZ) private voidsetSectionDirty(int pSectionX, int pSectionY, int pSectionZ, boolean pReRenderOnMainThread) voidsetSectionDirtyWithNeighbors(int pSectionX, int pSectionY, int pSectionZ) voidsetSectionRangeDirty(int pMinY, int pMinX, int pMinZ, int pMaxY, int pMaxX, int pMaxZ) booleanprivate voidsubmitBlockEntities(PoseStack pPoseStack, LevelRenderState pRenderState, SubmitNodeStorage pNodeStorage) private voidsubmitEntities(PoseStack pPoseStack, LevelRenderState pRenderState, SubmitNodeCollector pNodeCollector) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName, prepareSharedStateMethods inherited from interface net.minecraft.server.packs.resources.ResourceManagerReloadListener
reload
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TRANSPARENCY_POST_CHAIN_ID
-
ENTITY_OUTLINE_POST_CHAIN_ID
-
SECTION_SIZE
public static final int SECTION_SIZE- See Also:
-
HALF_SECTION_SIZE
public static final int HALF_SECTION_SIZE- See Also:
-
NEARBY_SECTION_DISTANCE_IN_BLOCKS
public static final int NEARBY_SECTION_DISTANCE_IN_BLOCKS- See Also:
-
MINIMUM_TRANSPARENT_SORT_COUNT
private static final int MINIMUM_TRANSPARENT_SORT_COUNT- See Also:
-
minecraft
-
entityRenderDispatcher
-
blockEntityRenderDispatcher
-
renderBuffers
-
skyRenderer
-
cloudRenderer
-
worldBorderRenderer
-
weatherEffectRenderer
-
particlesRenderState
-
debugRenderer
-
gameTestBlockHighlightRenderer
-
level
-
sectionOcclusionGraph
-
visibleSections
private final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> visibleSections -
nearbyVisibleSections
private final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> nearbyVisibleSections -
viewArea
-
ticks
private int ticks -
destroyingBlocks
-
destructionProgress
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<SortedSet<BlockDestructionProgress>> destructionProgress -
entityOutlineTarget
-
targets
-
lastCameraSectionX
private int lastCameraSectionX -
lastCameraSectionY
private int lastCameraSectionY -
lastCameraSectionZ
private int lastCameraSectionZ -
prevCamX
private double prevCamX -
prevCamY
private double prevCamY -
prevCamZ
private double prevCamZ -
prevCamRotX
private double prevCamRotX -
prevCamRotY
private double prevCamRotY -
sectionRenderDispatcher
-
lastViewDistance
private int lastViewDistance -
captureFrustum
private boolean captureFrustum -
capturedFrustum
-
lastTranslucentSortBlockPos
-
translucencyResortIterationIndex
private int translucencyResortIterationIndex -
levelRenderState
-
submitNodeStorage
-
featureRenderDispatcher
-
-
Constructor Details
-
LevelRenderer
public LevelRenderer(Minecraft pMinecraft, EntityRenderDispatcher pEntityRenderDispatcher, BlockEntityRenderDispatcher pBlockEntityRenderDispatcher, RenderBuffers pRenderBuffers, LevelRenderState pLevelRenderState, FeatureRenderDispatcher pFeatureRenderDispatcher)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
onResourceManagerReload
- Specified by:
onResourceManagerReloadin interfaceResourceManagerReloadListener
-
initOutline
public void initOutline() -
getTransparencyChain
-
doEntityOutline
public void doEntityOutline() -
shouldShowEntityOutlines
public boolean shouldShowEntityOutlines() -
setLevel
- Parameters:
pLevel- the level to set, ornullto clear
-
clearVisibleSections
private void clearVisibleSections() -
allChanged
public void allChanged() -
resize
public void resize(int pWidth, int pHeight) -
getSectionStatistics
-
getSectionRenderDispatcher
-
getTotalSections
public double getTotalSections() -
getLastViewDistance
public double getLastViewDistance() -
countRenderedSections
public int countRenderedSections() -
getEntityStatistics
-
cullTerrain
-
offsetFrustum
-
applyFrustum
-
addRecentlyCompiledSection
-
prepareCullFrustum
-
renderLevel
public void renderLevel(GraphicsResourceAllocator pGraphicsResourceAllocator, DeltaTracker pDeltaTracker, boolean pRenderBlockOutline, Camera pCamera, Matrix4f pFrustumMatrix, Matrix4f pProjectionMatrix, Matrix4f pCullingProjectionMatrix, GpuBufferSlice pShaderFog, Vector4f pFogColor, boolean pRenderSky) -
addMainPass
private void addMainPass(FrameGraphBuilder pFrameGraphBuilder, Frustum pFrustum, Matrix4f pFrustumMatrix, GpuBufferSlice pShaderFog, boolean pRenderBlockOutline, LevelRenderState pRenderState, DeltaTracker pDeltaTracker, ProfilerFiller pProfier) -
addParticlesPass
@Deprecated private void addParticlesPass(FrameGraphBuilder pFrameGraphBuilder, GpuBufferSlice pShaderFog) Deprecated.Neo: useaddParticlesPass(FrameGraphBuilder, GpuBufferSlice, Matrix4f)instead -
addParticlesPass
private void addParticlesPass(FrameGraphBuilder pFrameGraphBuilder, GpuBufferSlice pShaderFog, Matrix4f modelViewMatrix) -
addCloudsPass
@Deprecated private void addCloudsPass(FrameGraphBuilder pFrameGraphBuilder, CloudStatus pCloudStatus, Vec3 pCameraPosition, float pTicks, int pCloudColor, float pCloudHeight) Deprecated. -
addCloudsPass
private void addCloudsPass(FrameGraphBuilder pFrameGraphBuilder, CloudStatus pCloudStatus, Vec3 pCameraPosition, float pTicks, int pCloudColor, float pCloudHeight, Matrix4f modelViewMatrix) -
addWeatherPass
@Deprecated private void addWeatherPass(FrameGraphBuilder pFrameGraphBuilder, Vec3 pCameraPosition, GpuBufferSlice pShaderFog) Deprecated.Neo: useaddWeatherPass(FrameGraphBuilder, Vec3, GpuBufferSlice, Matrix4f)instead -
addWeatherPass
private void addWeatherPass(FrameGraphBuilder pFrameGraphBuilder, Vec3 pCameraPosition, GpuBufferSlice pShaderFog, Matrix4f modelViewMatrix) -
addLateDebugPass
private void addLateDebugPass(FrameGraphBuilder pFrameGraphBuilder, Vec3 pCameraPosition, GpuBufferSlice pShaderFog, Frustum pFrustum) -
extractVisibleEntities
private void extractVisibleEntities(Camera pCamera, Frustum pFrustum, DeltaTracker pDeltaTracker, LevelRenderState pRenderState) -
submitEntities
private void submitEntities(PoseStack pPoseStack, LevelRenderState pRenderState, SubmitNodeCollector pNodeCollector) -
extractVisibleBlockEntities
@Deprecated private void extractVisibleBlockEntities(Camera pCamera, float pPartialTick, LevelRenderState pRenderState) Deprecated. -
extractVisibleBlockEntities
private void extractVisibleBlockEntities(Camera pCamera, float pPartialTick, LevelRenderState pRenderState, @Nullable Frustum frustum) -
submitBlockEntities
private void submitBlockEntities(PoseStack pPoseStack, LevelRenderState pRenderState, SubmitNodeStorage pNodeStorage) -
extractBlockDestroyAnimation
-
renderBlockDestroyAnimation
private void renderBlockDestroyAnimation(PoseStack pPoseStack, MultiBufferSource.BufferSource pBufferSource, LevelRenderState pRenderState) -
extractBlockOutline
-
renderBlockOutline
private void renderBlockOutline(MultiBufferSource.BufferSource pBufferSource, PoseStack pPoseStack, boolean pTranslucent, LevelRenderState pRenderState) -
checkPoseStack
Asserts that the specifiedposeStackis.invalid reference
clear
- Throws:
IllegalStateException- if the specifiedposeStackis not clear
-
extractEntity
-
scheduleTranslucentSectionResort
-
scheduleResort
private void scheduleResort(SectionRenderDispatcher.RenderSection pSection, TranslucencyPointOfView pPointOfView, Vec3 pCameraPosition, boolean pForce, boolean pIgnoreAxisAlignment) -
prepareChunkRenders
private ChunkSectionsToRender prepareChunkRenders(Matrix4fc pFrustumMatrix, double pX, double pY, double pZ) -
endFrame
public void endFrame() -
captureFrustum
public void captureFrustum() -
killFrustum
public void killFrustum() -
tick
-
removeBlockBreakingProgress
private void removeBlockBreakingProgress() -
removeProgress
-
addSkyPass
@Deprecated private void addSkyPass(FrameGraphBuilder pFrameGraphBuilder, Camera pCamera, GpuBufferSlice pShaderFog) Deprecated.Neo: useaddSkyPass(FrameGraphBuilder, Camera, GpuBufferSlice, Matrix4f)instead -
addSkyPass
private void addSkyPass(FrameGraphBuilder pFrameGraphBuilder, Camera pCamera, GpuBufferSlice pShaderFog, Matrix4f modelViewMatrix) -
doesMobEffectBlockSky
-
compileSections
-
renderHitOutline
private void renderHitOutline(PoseStack pPoseStack, VertexConsumer pConsumer, double pCamX, double pCamY, double pCamZ, BlockOutlineRenderState pOutlineRenderState, int pColor) -
blockChanged
public void blockChanged(BlockGetter pLevel, BlockPos pPos, BlockState pOldState, BlockState pNewState, int pFlags) -
setBlockDirty
-
setBlocksDirty
public void setBlocksDirty(int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ) Re-renders all blocks in the specified range. -
setBlockDirty
-
setSectionDirtyWithNeighbors
public void setSectionDirtyWithNeighbors(int pSectionX, int pSectionY, int pSectionZ) -
setSectionRangeDirty
public void setSectionRangeDirty(int pMinY, int pMinX, int pMinZ, int pMaxY, int pMaxX, int pMaxZ) -
setSectionDirty
public void setSectionDirty(int pSectionX, int pSectionY, int pSectionZ) -
setSectionDirty
private void setSectionDirty(int pSectionX, int pSectionY, int pSectionZ, boolean pReRenderOnMainThread) -
onSectionBecomingNonEmpty
public void onSectionBecomingNonEmpty(long pSectionPos) -
destroyBlockProgress
-
hasRenderedAllSections
public boolean hasRenderedAllSections() -
onChunkReadyToRender
-
needsUpdate
public void needsUpdate() -
getLightColor
-
getLightColor
public static int getLightColor(LevelRenderer.BrightnessGetter pBrightnessGetter, BlockAndTintGetter pLevel, BlockState pState, BlockPos pPos) -
isSectionCompiled
-
entityOutlineTarget
-
getTranslucentTarget
-
getItemEntityTarget
-
getParticlesTarget
-
getWeatherTarget
-
getCloudsTarget
-
getVisibleSections
public it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> getVisibleSections() -
getSectionOcclusionGraph
-
getCapturedFrustum
-
getCloudRenderer
-
getTicks
public int getTicks() -
iterateVisibleBlockEntities
-
getRenderableSections
-
addCloudsPass(FrameGraphBuilder, CloudStatus, Vec3, float, int, float, Matrix4f)instead