Class DepthRenderTargetMixin

java.lang.Object
dev.cammiescorner.velvet.mixin.client.gl.DepthRenderTargetMixin
All Implemented Interfaces:
ReadableDepthRenderTarget

public abstract class DepthRenderTargetMixin extends Object implements ReadableDepthRenderTarget
  • Field Details

    • useDepth

      public boolean useDepth
    • width

      public int width
    • height

      public int height
  • Constructor Details

    • DepthRenderTargetMixin

      public DepthRenderTargetMixin()
  • Method Details

    • bindWrite

      public abstract void bindWrite(boolean boolean_1)
    • getStillDepthMap

      public int getStillDepthMap()
      Description copied from interface: ReadableDepthRenderTarget
      Returns a still of this render target's depth texture. For most intents and purposes, this is the texture that API consumers should read from.

      This texture is updated only when ReadableDepthRenderTarget.freezeDepthMap() is called. For the main render target, it is updated automatically right before PostLevelRenderCallback.EVENT is fired. Note that the content of the main render target's depth texture depends on the graphic quality setting. With GraphicsStatus.FABULOUS, no translucent object will appear on the main depth texture, so consumers may need to also use the depth textures from the various layers used by the LevelRenderer's transparency shader.

      Because this texture is independent from the render target's actual depth texture, it is safe to use anytime (whereas using the actual depth texture may cause corruption if it is simultaneously written to).

      The returned value may be -1 if the render target does not have a depth attachment. This should never be the case for the main render target.

      Specified by:
      getStillDepthMap in interface ReadableDepthRenderTarget
      Returns:
      a still of this render target's depth texture
    • freezeDepthMap

      public void freezeDepthMap()
      Description copied from interface: ReadableDepthRenderTarget
      Freezes the current depth texture for use in ReadableDepthRenderTarget.getStillDepthMap().

      This is called by default on the Minecraft.getMainRenderTarget() main render target once every frame, right before PostLevelRenderCallback is fired.

      Calling this method will bind this render target.

      Specified by:
      freezeDepthMap in interface ReadableDepthRenderTarget