Package foundry.veil.render.texture
Class RenderedTexturesManager
java.lang.Object
foundry.veil.render.texture.RenderedTexturesManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voiddrawAsInGUI(DynamicRenderTargetTexture tex, Consumer<com.mojang.blaze3d.vertex.PoseStack> drawFunction) Utility method that sets up an environment akin to gui rendering with a box from 0 t0 16.static voiddrawAsInWorld(DynamicRenderTargetTexture tex, Consumer<com.mojang.blaze3d.vertex.PoseStack> drawFunction) Coordinates here are from 0 to 1static voiddrawTexture(DynamicRenderTargetTexture tex, net.minecraft.resources.ResourceLocation texture) static DynamicRenderTargetTexturerequestTexture(net.minecraft.resources.ResourceLocation id, int textureSize, Consumer<DynamicRenderTargetTexture> textureDrawingFunction, boolean updateEachFrame) Gets a texture object on which you'll be able to directly draw onto as its in essence a frame buffer Remember to call isInitialized() as the returned texture might be empty For practical purposes you are only interested to call something like buffer.getBuffer(RenderType.entityCutout(texture.getTextureLocation()));
-
Constructor Details
-
RenderedTexturesManager
public RenderedTexturesManager()
-
-
Method Details
-
clearCache
public static void clearCache() -
requestTexture
public static DynamicRenderTargetTexture requestTexture(net.minecraft.resources.ResourceLocation id, int textureSize, Consumer<DynamicRenderTargetTexture> textureDrawingFunction, boolean updateEachFrame) Gets a texture object on which you'll be able to directly draw onto as its in essence a frame buffer Remember to call isInitialized() as the returned texture might be empty For practical purposes you are only interested to call something like buffer.getBuffer(RenderType.entityCutout(texture.getTextureLocation()));- Parameters:
id- id of this texture. must be uniquetextureSize- dimensiontextureDrawingFunction- this is the function responsible to draw things onto this textureupdateEachFrame- if this texture should be redrawn each frame. Useful if you are drawing an entity or animated item- Returns:
- texture instance
-
drawAsInWorld
public static void drawAsInWorld(DynamicRenderTargetTexture tex, Consumer<com.mojang.blaze3d.vertex.PoseStack> drawFunction) Coordinates here are from 0 to 1 -
drawAsInGUI
public static void drawAsInGUI(DynamicRenderTargetTexture tex, Consumer<com.mojang.blaze3d.vertex.PoseStack> drawFunction) Utility method that sets up an environment akin to gui rendering with a box from 0 t0 16. If you render an item at 0,0 it will be centered -
drawTexture
public static void drawTexture(DynamicRenderTargetTexture tex, net.minecraft.resources.ResourceLocation texture)
-