Class DynamicRenderTargetTexture

java.lang.Object
net.minecraft.client.renderer.texture.AbstractTexture
foundry.veil.render.texture.DynamicRenderTargetTexture
All Implemented Interfaces:
AutoCloseable

public class DynamicRenderTargetTexture extends net.minecraft.client.renderer.texture.AbstractTexture
  • Field Details

  • Constructor Details

    • DynamicRenderTargetTexture

      public DynamicRenderTargetTexture(net.minecraft.resources.ResourceLocation resourceLocation, int width, int height, Consumer<DynamicRenderTargetTexture> textureDrawingFunction)
    • DynamicRenderTargetTexture

      public DynamicRenderTargetTexture(net.minecraft.resources.ResourceLocation resourceLocation, int size, Consumer<DynamicRenderTargetTexture> textureDrawingFunction)
  • Method Details

    • initialize

      public void initialize()
    • redraw

      public void redraw()
      Force redraw using provided render function. You can also redraw manually
    • isInitialized

      public boolean isInitialized()
      Call to register this texture
    • load

      public void load(net.minecraft.server.packs.resources.ResourceManager manager)
      Specified by:
      load in class net.minecraft.client.renderer.texture.AbstractTexture
    • getFrameBuffer

      public com.mojang.blaze3d.pipeline.RenderTarget getFrameBuffer()
    • bindWrite

      public void bindWrite()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getTextureLocation

      public net.minecraft.resources.ResourceLocation getTextureLocation()
    • getId

      public int getId()
      Overrides:
      getId in class net.minecraft.client.renderer.texture.AbstractTexture
    • releaseId

      public void releaseId()
      Overrides:
      releaseId in class net.minecraft.client.renderer.texture.AbstractTexture
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class net.minecraft.client.renderer.texture.AbstractTexture
    • getPixels

      public com.mojang.blaze3d.platform.NativeImage getPixels()
    • download

      public void download()
      Downloads the GPU texture to CPU for edit
    • upload

      public void upload()
      Uploads the image to GPU and closes its CPU side one
    • saveTextureToFile

      public List<Path> saveTextureToFile(Path texturesDir) throws IOException
      Throws:
      IOException
    • saveTextureToFile

      public List<Path> saveTextureToFile(Path texturesDir, String name) throws IOException
      Throws:
      IOException