Package foundry.veil.render.pipeline
Class VeilRenderSystem
java.lang.Object
foundry.veil.render.pipeline.VeilRenderSystem
Additional functionality for
RenderSystem.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidbind(ShaderBlock<?> block) Binds the specified block into the next available binding spot and updates all shaders if the binding index has changed.static voidbind(CharSequence name, ShaderBlock<?> block) Binds the specified block into the next available binding spot and updates all shaders if the binding index has changed.static voidbindVertexArray(int vao) Binds the specified vertex array and invalidates the vanilla MC immediate buffer state.static voidclose()static voidendFrame()static voidClears all pending shader errors and re-queues uniform block ids to shaders.static @Nullable ShaderProgramstatic voidinit()static intstatic intstatic intstatic intstatic VeilRendererrenderer()static voidrenderPost(float partialTicks) static Executorstatic voidresize(int width, int height) static voidsetShader(@Nullable ShaderProgram shader) Sets the shader instance to a specific instance of a shader.static voidsetShader(Supplier<ShaderProgram> shader) Sets the shader instance to a specific instance reference of a shader.static voidsetShader(net.minecraft.resources.ResourceLocation shader) Sets the shader instance to be a reference to the shader manager.static voidstatic voidPrints an error to console about the current shader.static voidunbind(ShaderBlock<?> block) Unbinds the specified block and frees the binding it occupied.
-
Method Details
-
init
@Internal public static void init() -
setShader
public static void setShader(net.minecraft.resources.ResourceLocation shader) Sets the shader instance to be a reference to the shader manager.- Parameters:
shader- The name of the shader to use
-
setShader
Sets the shader instance to a specific instance of a shader.setShader(ResourceLocation)should be used in most cases.- Parameters:
shader- The shader instance to use
-
setShader
Sets the shader instance to a specific instance reference of a shader.setShader(ResourceLocation)should be used in most cases.- Parameters:
shader- The reference to the shader to use
-
finalizeShaderCompilation
public static void finalizeShaderCompilation()Clears all pending shader errors and re-queues uniform block ids to shaders. -
throwShaderError
public static void throwShaderError()Prints an error to console about the current shader. This is useful to debug if a shader has an error while trying to be used. -
maxColorAttachments
public static int maxColorAttachments()- Returns:
- The GL maximum amount of color attachments a framebuffer can have
-
maxUniformBuffersBindings
public static int maxUniformBuffersBindings()- Returns:
- The GL maximum amount of uniform buffers bindings available
-
maxFramebufferWidth
public static int maxFramebufferWidth()- Returns:
- The GL maximum width of framebuffers
-
maxFramebufferHeight
public static int maxFramebufferHeight()- Returns:
- The GL maximum width of framebuffers
-
bind
Binds the specified block into the next available binding spot and updates all shaders if the binding index has changed.
Make sure this is called before trying to use the block on this frame as it may have been overwritten.
- Parameters:
block- The block to bind
-
bind
Binds the specified block into the next available binding spot and updates all shaders if the binding index has changed.
Make sure this is called before trying to use the block on this frame as it may have been overwritten.
This binds the block and assigns it to shader values.
- Parameters:
name- The name of the block in shader codeblock- The block to bind
-
unbind
Unbinds the specified block and frees the binding it occupied. It isn't strictly necessary to unbind blocks, but they should not be referenced anymore after being deleted.- Parameters:
block- The block to unbind
-
bindVertexArray
public static void bindVertexArray(int vao) Binds the specified vertex array and invalidates the vanilla MC immediate buffer state.- Parameters:
vao- The vao to bind
-
renderer
- Returns:
- The veil renderer instance
-
renderThreadExecutor
- Returns:
- An executor for the main render thread
-
getShader
- Returns:
- The actual shader reference to use while rendering or
nullif no shader is selected or the selected shader is from Vanilla Minecraft
-
beginFrame
@Internal public static void beginFrame() -
endFrame
@Internal public static void endFrame() -
shaderUpdate
@Internal public static void shaderUpdate() -
resize
@Internal public static void resize(int width, int height) -
close
@Internal public static void close() -
renderPost
@Internal public static void renderPost(float partialTicks)
-