Package net.minecraft.client.gui.render
Class GuiRenderer
java.lang.Object
net.minecraft.client.gui.render.GuiRenderer
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class(package private) static final record(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Object, GuiRenderer.AtlasPosition> private BufferBuilderprivate final MultiBufferSource.BufferSourceprivate final ByteBufferBuilderprivate intstatic final intstatic final intprivate final List<GuiRenderer.Draw> private static final Comparator<GuiElementRenderState> private intprivate intstatic final intstatic final intprivate static final floatprivate final CachedOrthoProjectionMatrixBufferprivate intprivate intprivate GpuTextureprivate GpuTextureprivate GpuTextureViewprivate GpuTextureViewprivate final CachedOrthoProjectionMatrixBufferprivate static final org.slf4j.Loggerprivate static final floatprivate static final intprivate final List<GuiRenderer.MeshToDraw> private static final floatprivate static final intprivate final Map<Object, OversizedItemRenderer> private final Map<Class<? extends PictureInPictureRenderState>, PictureInPictureRendererPool<?>> private final Set<PictureInPictureRenderState> private RenderPipelineprivate ScreenRectangleprivate TextureSetup(package private) final GuiRenderStateprivate static final Comparator<ScreenRectangle> private static final Comparator<TextureSetup> private final Map<VertexFormat, MappableRingBuffer> -
Constructor Summary
ConstructorsConstructorDescriptionGuiRenderer(GuiRenderState pRenderState, MultiBufferSource.BufferSource pBufferSource, List<PictureInPictureRendererRegistration<?>> pPictureInPictureRenderers) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddElementsToMeshes(GuiRenderState.TraverseRange pTraverseRange) private voidaddElementToMesh(GuiElementRenderState p_419849_, int p_419994_) private intcalculateAtlasSizeInPixels(int pItemWidth) private it.unimi.dsi.fastutil.objects.Object2IntMap<VertexFormat> private voidvoidclose()private voidcreateAtlasTextures(int pAtlasSize) private voiddraw(GpuBufferSlice pFogUniforms) private voidenableScissor(ScreenRectangle pScissorArea, RenderPass pRenderPass) private voidprivate voidexecuteDraw(GuiRenderer.Draw pDraw, RenderPass pRenderPass, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType) private voidexecuteDrawRange(Supplier<String> pDebugGroup, RenderTarget pRenderTarget, GpuBufferSlice pFogUniforms, GpuBufferSlice pDynamicTransforms, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType, int pStart, int pEnd) private BufferBuildergetBufferBuilder(RenderPipeline pPipeline) private intvoidprivate voidprivate voidprepare()private voidprivate voidprivate <T extends PictureInPictureRenderState>
booleanpreparePictureInPictureState(T p_415554_, int p_415565_, boolean firstPass) private voidprivate voidprivate voidrecordMesh(BufferBuilder pBufferBuilder, RenderPipeline pPipeline, TextureSetup pTextureSetup, ScreenRectangle pScissorArea) voidrender(GpuBufferSlice pBufferSlice) private voidrenderItemToAtlas(TrackingItemStackRenderState pRenderState, PoseStack pPoseStack, int pX, int pY, int pSize) private booleanscissorChanged(ScreenRectangle pScissorArea, ScreenRectangle pOldScissorArea) private voidsubmitBlitFromItemAtlas(GuiItemRenderState pRenderState, float pX, float pY, int pItemSize, int pAtlasSize)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_GUI_Z
private static final float MAX_GUI_Z- See Also:
-
MIN_GUI_Z
private static final float MIN_GUI_Z- See Also:
-
GUI_Z_NEAR
private static final float GUI_Z_NEAR- See Also:
-
GUI_3D_Z_FAR
public static final int GUI_3D_Z_FAR- See Also:
-
GUI_3D_Z_NEAR
public static final int GUI_3D_Z_NEAR- See Also:
-
DEFAULT_ITEM_SIZE
public static final int DEFAULT_ITEM_SIZE- See Also:
-
MINIMUM_ITEM_ATLAS_SIZE
private static final int MINIMUM_ITEM_ATLAS_SIZE- See Also:
-
MAXIMUM_ITEM_ATLAS_SIZE
private static final int MAXIMUM_ITEM_ATLAS_SIZE -
CLEAR_COLOR
public static final int CLEAR_COLOR- See Also:
-
SCISSOR_COMPARATOR
-
TEXTURE_COMPARATOR
-
ELEMENT_SORT_COMPARATOR
-
atlasPositions
-
oversizedItemRenderers
-
renderState
-
draws
-
meshesToDraw
-
byteBufferBuilder
-
vertexBuffers
-
firstDrawIndexAfterBlur
private int firstDrawIndexAfterBlur -
guiProjectionMatrixBuffer
-
itemsProjectionMatrixBuffer
-
bufferSource
-
pictureInPictureRendererPools
private final Map<Class<? extends PictureInPictureRenderState>,PictureInPictureRendererPool<?>> pictureInPictureRendererPools -
pictureInPictureRenderStatesScratch
-
itemsAtlas
-
itemsAtlasView
-
itemsAtlasDepth
-
itemsAtlasDepthView
-
itemAtlasX
private int itemAtlasX -
itemAtlasY
private int itemAtlasY -
cachedGuiScale
private int cachedGuiScale -
frameNumber
private int frameNumber -
previousScissorArea
-
previousPipeline
-
previousTextureSetup
-
bufferBuilder
-
-
Constructor Details
-
GuiRenderer
public GuiRenderer(GuiRenderState pRenderState, MultiBufferSource.BufferSource pBufferSource, List<PictureInPictureRendererRegistration<?>> pPictureInPictureRenderers)
-
-
Method Details
-
incrementFrameNumber
public void incrementFrameNumber() -
render
-
clearUnusedOversizedItemRenderers
private void clearUnusedOversizedItemRenderers() -
prepare
private void prepare() -
addElementsToMeshes
-
draw
-
executeDrawRange
private void executeDrawRange(Supplier<String> pDebugGroup, RenderTarget pRenderTarget, GpuBufferSlice pFogUniforms, GpuBufferSlice pDynamicTransforms, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType, int pStart, int pEnd) -
addElementToMesh
-
prepareText
private void prepareText() -
prepareItemElements
private void prepareItemElements() -
preparePictureInPicture
private void preparePictureInPicture() -
preparePictureInPictureState
private <T extends PictureInPictureRenderState> boolean preparePictureInPictureState(T p_415554_, int p_415565_, boolean firstPass) -
renderItemToAtlas
private void renderItemToAtlas(TrackingItemStackRenderState pRenderState, PoseStack pPoseStack, int pX, int pY, int pSize) -
submitBlitFromItemAtlas
private void submitBlitFromItemAtlas(GuiItemRenderState pRenderState, float pX, float pY, int pItemSize, int pAtlasSize) -
createAtlasTextures
private void createAtlasTextures(int pAtlasSize) -
calculateAtlasSizeInPixels
private int calculateAtlasSizeInPixels(int pItemWidth) -
getGuiScaleInvalidatingItemAtlasIfChanged
private int getGuiScaleInvalidatingItemAtlasIfChanged() -
invalidateItemAtlas
private void invalidateItemAtlas() -
recordDraws
private void recordDraws() -
ensureVertexBufferSizes
private void ensureVertexBufferSizes() -
calculatedRequiredVertexBufferSizes
private it.unimi.dsi.fastutil.objects.Object2IntMap<VertexFormat> calculatedRequiredVertexBufferSizes() -
executeDraw
private void executeDraw(GuiRenderer.Draw pDraw, RenderPass pRenderPass, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType) -
getBufferBuilder
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-