Class LevelRenderer
java.lang.Object
net.minecraft.client.renderer.LevelRenderer
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtlasManagerprivate final BlockEntityRenderDispatcherprivate static final floatprivate @Nullable GpuSamplerprivate final CloudRendererprivate static final Vector4fcprivate static final Identifierprivate final RenderTargetprivate final EntityRenderDispatcherprivate final FeatureRenderDispatcherprivate LevelRenderer.FinalizedGizmosprivate final GameRenderer(package private) final LevelRenderStateprivate static final intprivate final ModelManagerprivate final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> private final OptionsRenderStateprivate final RenderBuffersprivate final SimpleGizmoCollectorprivate static final Vector4fcprivate final SectionOcclusionGraphprivate @Nullable SectionRenderDispatcherprivate final ShaderManagerprivate @Nullable SkyRendererprivate final SubmitNodeStorageprivate final LevelTargetBundleprivate final TextureManagerprivate intprivate static final Identifierprivate final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> private final WeatherEffectRendererprivate final WorldBorderRenderer -
Constructor Summary
ConstructorsConstructorDescriptionLevelRenderer(EntityRenderDispatcher entityRenderDispatcher, BlockEntityRenderDispatcher blockEntityRenderDispatcher, ModelManager modelManager, TextureManager textureManager, AtlasManager atlasManager, ShaderManager shaderManager, GameRenderer gameRenderer, int width, int height) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddAlwaysOnTopPass(FrameGraphBuilder frame, FeatureRenderDispatcher.PreparedFrame featureFrame, GpuBufferSlice fog) private voidaddCloudsPass(FrameGraphBuilder frame, CloudStatus cloudStatus, Vec3 cameraPosition, long gameTime, float partialTicks, int cloudColor, float cloudHeight, int cloudRange) Deprecated.private voidaddCloudsPass(FrameGraphBuilder frame, CloudStatus cloudStatus, Vec3 cameraPosition, long gameTime, float partialTicks, int cloudColor, float cloudHeight, int cloudRange, Matrix4fc modelViewMatrix) private voidaddMainPass(FrameGraphBuilder frame, FeatureRenderDispatcher.PreparedFrame featureFrame, GpuBufferSlice terrainFog, LevelRenderState levelRenderState, ProfilerFiller profiler, ChunkSectionsToRender chunkSectionsToRender) private voidaddMainPass(FrameGraphBuilder frame, FeatureRenderDispatcher.PreparedFrame featureFrame, GpuBufferSlice terrainFog, LevelRenderState levelRenderState, ProfilerFiller profiler, ChunkSectionsToRender chunkSectionsToRender, Matrix4fc modelViewMatrix) voidaddMainThreadGizmos(List<SimpleGizmoCollector.GizmoInstance> mainThreadGizmos) private voidaddSkyPass(FrameGraphBuilder frame, CameraRenderState cameraState, GpuBufferSlice skyFog) Deprecated.private voidaddSkyPass(FrameGraphBuilder frame, CameraRenderState cameraState, GpuBufferSlice skyFog, Matrix4fc modelViewMatrix) private voidaddWeatherPass(FrameGraphBuilder frame, GpuBufferSlice fog) Deprecated.Neo: useaddWeatherPass(FrameGraphBuilder, GpuBufferSlice, Matrix4fc)insteadprivate voidaddWeatherPass(FrameGraphBuilder frame, GpuBufferSlice fog, Matrix4fc modelViewMatrix) private voidcheckPoseStack(PoseStack poseStack) voidvoidclose()private voidcompileSections(CameraRenderState camera) voidvoidendFrame()it.unimi.dsi.fastutil.longs.LongCollectionprivate voidbooleanvoidinvalidateCompiledGeometry(ClientLevel level, Options options, Camera camera, BlockColors blockColors) booleanisSectionCompiledAndVisible(BlockPos blockPos) it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> prepareChunkRenders(Matrix4fc modelViewMatrix) voidrender(GraphicsResourceAllocator resourceAllocator, DeltaTracker deltaTracker, boolean renderOutline, CameraRenderState cameraState, Matrix4fc modelViewMatrix, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky) private voidrepositionCamera(CameraRenderState camera) voidvoidresize(int width, int height) private voidscheduleResort(SectionRenderDispatcher.RenderSection section, TranslucencyPointOfView pointOfView, Vec3 cameraPos, boolean blockPosChanged, boolean isNearby) private voidscheduleTranslucentSectionResort(Vec3 cameraPos) private voidsubmitBlockDestroyAnimation(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, LevelRenderState levelRenderState) private voidsubmitBlockEntities(PoseStack poseStack, LevelRenderState levelRenderState, SubmitNodeCollector submitNodeCollector) private voidsubmitBlockOutline(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, LevelRenderState levelRenderState) private voidsubmitEntities(PoseStack poseStack, LevelRenderState levelRenderState, SubmitNodeCollector output) private voidsubmitFeatures(LevelRenderState levelRenderState, SubmitNodeCollector submitNodeCollector, boolean renderOutline) private voidsubmitHitOutline(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, RenderType renderType, BlockOutlineRenderState state, int color, float width, boolean afterTerrain) viewArea()it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection>
-
Field Details
-
TRANSPARENCY_POST_CHAIN_ID
-
ENTITY_OUTLINE_POST_CHAIN_ID
-
MINIMUM_TRANSPARENT_SORT_COUNT
private static final int MINIMUM_TRANSPARENT_SORT_COUNT- See Also:
-
CHUNK_VISIBILITY_THRESHOLD
private static final float CHUNK_VISIBILITY_THRESHOLD- See Also:
-
SCREEN_SIZE_TARGET_CLEAR_COLOR
-
ENTITY_OUTLINE_CLEAR_COLOR
-
gameRenderer
-
entityRenderDispatcher
-
blockEntityRenderDispatcher
-
renderBuffers
-
featureRenderDispatcher
-
submitNodeStorage
-
modelManager
-
textureManager
-
atlasManager
-
shaderManager
-
levelRenderState
-
optionsRenderState
-
skyRenderer
-
cloudRenderer
-
worldBorderRenderer
-
weatherEffectRenderer
-
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
-
entityOutlineTarget
-
targets
-
sectionRenderDispatcher
-
lastTranslucentSortBlockPos
-
translucencyResortIterationIndex
private int translucencyResortIterationIndex -
chunkLayerSampler
-
renderThreadGizmos
-
finalizedGizmos
-
-
Constructor Details
-
LevelRenderer
public LevelRenderer(EntityRenderDispatcher entityRenderDispatcher, BlockEntityRenderDispatcher blockEntityRenderDispatcher, ModelManager modelManager, TextureManager textureManager, AtlasManager atlasManager, ShaderManager shaderManager, GameRenderer gameRenderer, int width, int height)
-
-
Method Details
-
render
public void render(GraphicsResourceAllocator resourceAllocator, DeltaTracker deltaTracker, boolean renderOutline, CameraRenderState cameraState, Matrix4fc modelViewMatrix, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky) -
submitFeatures
private void submitFeatures(LevelRenderState levelRenderState, SubmitNodeCollector submitNodeCollector, boolean renderOutline) -
repositionCamera
-
addSkyPass
@Deprecated private void addSkyPass(FrameGraphBuilder frame, CameraRenderState cameraState, GpuBufferSlice skyFog) Deprecated. -
addSkyPass
private void addSkyPass(FrameGraphBuilder frame, CameraRenderState cameraState, GpuBufferSlice skyFog, Matrix4fc modelViewMatrix) -
addMainPass
@Deprecated private void addMainPass(FrameGraphBuilder frame, FeatureRenderDispatcher.PreparedFrame featureFrame, GpuBufferSlice terrainFog, LevelRenderState levelRenderState, ProfilerFiller profiler, ChunkSectionsToRender chunkSectionsToRender) -
addMainPass
private void addMainPass(FrameGraphBuilder frame, FeatureRenderDispatcher.PreparedFrame featureFrame, GpuBufferSlice terrainFog, LevelRenderState levelRenderState, ProfilerFiller profiler, ChunkSectionsToRender chunkSectionsToRender, Matrix4fc modelViewMatrix) -
addCloudsPass
@Deprecated private void addCloudsPass(FrameGraphBuilder frame, CloudStatus cloudStatus, Vec3 cameraPosition, long gameTime, float partialTicks, int cloudColor, float cloudHeight, int cloudRange) Deprecated. -
addCloudsPass
private void addCloudsPass(FrameGraphBuilder frame, CloudStatus cloudStatus, Vec3 cameraPosition, long gameTime, float partialTicks, int cloudColor, float cloudHeight, int cloudRange, Matrix4fc modelViewMatrix) -
addWeatherPass
Deprecated.Neo: useaddWeatherPass(FrameGraphBuilder, GpuBufferSlice, Matrix4fc)instead -
addWeatherPass
-
addAlwaysOnTopPass
private void addAlwaysOnTopPass(FrameGraphBuilder frame, FeatureRenderDispatcher.PreparedFrame featureFrame, GpuBufferSlice fog) -
prepareChunkRenders
-
compileSections
-
checkPoseStack
-
submitEntities
private void submitEntities(PoseStack poseStack, LevelRenderState levelRenderState, SubmitNodeCollector output) -
submitBlockEntities
private void submitBlockEntities(PoseStack poseStack, LevelRenderState levelRenderState, SubmitNodeCollector submitNodeCollector) -
submitBlockDestroyAnimation
private void submitBlockDestroyAnimation(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, LevelRenderState levelRenderState) -
submitBlockOutline
private void submitBlockOutline(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, LevelRenderState levelRenderState) -
submitHitOutline
private void submitHitOutline(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, RenderType renderType, BlockOutlineRenderState state, int color, float width, boolean afterTerrain) -
resize
public void resize(int width, int height) -
endFrame
public void endFrame() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
doEntityOutline
public void doEntityOutline() -
invalidateCompiledGeometry
public void invalidateCompiledGeometry(ClientLevel level, Options options, Camera camera, BlockColors blockColors) -
getTransparencyChain
-
scheduleTranslucentSectionResort
-
scheduleResort
private void scheduleResort(SectionRenderDispatcher.RenderSection section, TranslucencyPointOfView pointOfView, Vec3 cameraPos, boolean blockPosChanged, boolean isNearby) -
clearVisibleSections
public void clearVisibleSections() -
resetLevelRenderData
public void resetLevelRenderData() -
hasRenderedAllSections
public boolean hasRenderedAllSections() -
isSectionCompiledAndVisible
-
sectionRenderDispatcher
-
entityRenderDispatcher
-
blockEntityRenderDispatcher
-
entityOutlineTarget
-
translucentTarget
-
itemEntityTarget
-
particlesTarget
-
weatherTarget
-
cloudsTarget
-
cloudRenderer
-
skyRenderer
-
weatherEffectRenderer
-
worldBorderRenderer
-
viewArea
-
visibleSections
public it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> visibleSections() -
nearbyVisibleSections
public it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> nearbyVisibleSections() -
expectedChunks
public it.unimi.dsi.fastutil.longs.LongCollection expectedChunks() -
sectionOcclusionGraph
-
collectPerFrameRenderThreadGizmos
-
finalizeGizmoCollection
private void finalizeGizmoCollection() -
addMainThreadGizmos
-
addCloudsPass(FrameGraphBuilder, CloudStatus, Vec3, long, float, int, float, int, Matrix4fc)instead