Package org.moddingx.libx.render.target
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 -
Method Summary
Modifier and TypeMethodDescriptiondefault com.mojang.blaze3d.vertex.VertexSortingGets the vertex sorting 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.
-
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). -
getVertexSorting
default com.mojang.blaze3d.vertex.VertexSorting getVertexSorting()Gets the vertex sorting to use. Defaults toVertexSorting.ORTHOGRAPHIC_Z. -
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:
-