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
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
     
    static final float
     
    static final float
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default com.mojang.blaze3d.ProjectionType
    Gets the projection type to use.
    int
    The image height in pixels.
    void
    render(com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer)
    Renders the actual scene.
    default void
    renderGui(net.minecraft.client.gui.GuiGraphicsExtractor graphics)
    Renders GUI content (item icons, text, sprites, ...) for this scene using the modern GuiGraphicsExtractor-based GUI pipeline.
    default void
    renderOverlay(com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource buffer, RenderJob.Projector projector)
    Renders an overlay over the scene.
    default Matrix4f
    The modelView matrix to use.
    default Matrix4f
    The projection matrix to use.
    default void
    setupTransformation(com.mojang.blaze3d.vertex.PoseStack poseStack)
    Sets up initial transformation on the PoseStack.
    default boolean
    Gets whether this render job uses renderGui(GuiGraphicsExtractor).
    default boolean
    Gets whether this render job uses an overlay.
    int
    The image width in pixels.
  • Field Details

  • Method Details

    • width

      int width()
      The image width in pixels.
    • height

      int height()
      The image height in pixels.
    • setupProjectionMatrix

      default Matrix4f 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 to ProjectionType.ORTHOGRAPHIC.
    • setupModelViewMatrix

      default Matrix4f 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 through render(PoseStack, MultiBufferSource) into the visible Z range of setupProjectionMatrix(). It does not affect renderGui(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 the PoseStack. These transformations will be accounted for when projecting points in renderOverlay(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 return true
      Parameters:
      projector - A point projector that can project points in the 3 dimensional space used in render(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 modern GuiGraphicsExtractor-based GUI pipeline. This is called once per invocation of this render job, after render(PoseStack, MultiBufferSource) (and renderOverlay(PoseStack, MultiBufferSource, Projector) if usesOverlay()) have both completed. The extractor is backed by an isolated GuiRenderState/ GuiRenderer pair 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 return true
      See Also:
    • usesGui

      default boolean usesGui()
      Gets whether this render job uses renderGui(GuiGraphicsExtractor).