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 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 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.- 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:
-