Package foundry.veil.render.texture
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 Summary
FieldsFields inherited from class net.minecraft.client.renderer.texture.AbstractTexture
blur, id, mipmap, NOT_ASSIGNED -
Constructor Summary
ConstructorsConstructorDescriptionDynamicRenderTargetTexture(net.minecraft.resources.ResourceLocation resourceLocation, int width, int height, Consumer<DynamicRenderTargetTexture> textureDrawingFunction) DynamicRenderTargetTexture(net.minecraft.resources.ResourceLocation resourceLocation, int size, Consumer<DynamicRenderTargetTexture> textureDrawingFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()voiddownload()Downloads the GPU texture to CPU for editcom.mojang.blaze3d.pipeline.RenderTargetintintgetId()com.mojang.blaze3d.platform.NativeImagenet.minecraft.resources.ResourceLocationintgetWidth()voidbooleanCall to register this texturevoidload(net.minecraft.server.packs.resources.ResourceManager manager) voidredraw()Force redraw using provided render function.voidsaveTextureToFile(Path texturesDir) saveTextureToFile(Path texturesDir, String name) voidupload()Uploads the image to GPU and closes its CPU side oneMethods inherited from class net.minecraft.client.renderer.texture.AbstractTexture
bind, reset, restoreLastBlurMipmap, setBlurMipmap, setFilter
-
Field Details
-
drawingFunction
-
-
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:
loadin classnet.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:
getIdin classnet.minecraft.client.renderer.texture.AbstractTexture
-
releaseId
public void releaseId()- Overrides:
releaseIdin classnet.minecraft.client.renderer.texture.AbstractTexture
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classnet.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
- Throws:
IOException
-
saveTextureToFile
- Throws:
IOException
-