Interface RenderJob
public interface RenderJob
A render job defines the logic on how to render a scene into an image. Can be used with
ImageHelper.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final floatstatic final float -
Method Summary
Modifier and TypeMethodDescriptiondefault com.mojang.blaze3d.ProjectionTypeGets the projection type to use.intheight()The image height in pixels.voidrender(com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer) Renders the actual scene.default voidrenderGui(net.minecraft.client.gui.GuiGraphicsExtractor graphics) Renders GUI content (item icons, text, sprites, ...) for this scene using the modernGuiGraphicsExtractor-based GUI pipeline.default voidrenderOverlay(com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer, RenderJob.Projector projector) Renders an overlay over the scene.default Matrix4fThe modelView matrix to use.default Matrix4fThe projection matrix to use.default voidsetupTransformation(com.mojang.blaze3d.vertex.PoseStack poseStack) Sets up initial transformation on thePoseStack.default booleanusesGui()Gets whether this render job usesrenderGui(GuiGraphicsExtractor).default booleanGets whether this render job uses an overlay.intwidth()The image width in pixels.
-
Field Details
-
GUI_Z_NEAR
static final float GUI_Z_NEAR- See Also:
-
GUI_Z_RANGE
static final float GUI_Z_RANGE- See Also:
-
GUI_Z_TRANSLATION
static final float GUI_Z_TRANSLATION- See Also:
-
-
Method Details
-
width
int width()The image width in pixels. -
height
int height()The image height in pixels. -
setupProjectionMatrix
The projection matrix to use. By default, creates an orthographic projection with a scale of 1. (Everything from 0 to image width/height is projected onto the image). -
getProjectionType
default com.mojang.blaze3d.ProjectionType getProjectionType()Gets the projection type to use. Defaults toProjectionType.ORTHOGRAPHIC. -
setupModelViewMatrix
The modelView matrix to use. Do not confuse with the transformation matrix.This is applied to
RenderSystem's global model-view matrix stack and is required to place content submitted throughrender(PoseStack, MultiBufferSource)into the visible Z range ofsetupProjectionMatrix(). It does not affectrenderGui(GuiGraphicsExtractor)- the model-view matrix stack is reset to identity for the duration of that call.- See Also:
-
setupTransformation
default void setupTransformation(com.mojang.blaze3d.vertex.PoseStack poseStack) Sets up initial transformation on thePoseStack. These transformations will be accounted for when projecting points inrenderOverlay(PoseStack, MultiBufferSource, Projector).- See Also:
-
render
void render(com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer) Renders the actual scene. -
usesOverlay
default boolean usesOverlay()Gets whether this render job uses an overlay.- See Also:
-
renderOverlay
default void renderOverlay(com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer, RenderJob.Projector projector) Renders an overlay over the scene. This is useful if the scene used a non-orthographic projection matrix (ie a 3d scene). This method is always called with an orthographic projection matrix to render a 2d overlay over the scene. The viewport ranges from (0,0) to (width,height). In order for this to be called,usesOverlay()must returntrue- Parameters:
projector- A point projector that can project points in the 3 dimensional space used inrender(PoseStack, MultiBufferSource)to the two-dimensional space after projection.- See Also:
-
renderGui
default void renderGui(net.minecraft.client.gui.GuiGraphicsExtractor graphics) Renders GUI content (item icons, text, sprites, ...) for this scene using the modernGuiGraphicsExtractor-based GUI pipeline. This is called once per invocation of this render job, afterrender(PoseStack, MultiBufferSource)(andrenderOverlay(PoseStack, MultiBufferSource, Projector)ifusesOverlay()) have both completed. The extractor is backed by an isolatedGuiRenderState/GuiRendererpair scoped to render jobs — it does not interact with the real screen's GUI state. The viewport for this extractor ranges from (0,0) to (width,height). In order for this to be called,usesGui()must returntrue- See Also:
-
usesGui
default boolean usesGui()Gets whether this render job usesrenderGui(GuiGraphicsExtractor).
-