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 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default com.mojang.blaze3d.vertex.VertexSorting
    Gets the vertex sorting 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
    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 an overlay.
    int
    The image width in pixels.
  • 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).
    • getVertexSorting

      default com.mojang.blaze3d.vertex.VertexSorting getVertexSorting()
      Gets the vertex sorting to use. Defaults to VertexSorting.ORTHOGRAPHIC_Z.
    • setupModelViewMatrix

      default Matrix4f 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 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: