Package foundry.veil.api.client.render
Interface VeilRenderBridge
public interface VeilRenderBridge
Bridges between Minecraft and Veil render classes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MatrixStackcreate(com.mojang.blaze3d.vertex.PoseStack poseStack) Creates a matrix stack wrapper for the specified post stack.static CullFrustumcreate(net.minecraft.client.renderer.culling.Frustum frustum) Creates a cull frustum helper from the specified vanilla frustum.static VeilRenderTypeBuildercreate(net.minecraft.client.renderer.RenderType.CompositeState.CompositeStateBuilder builder) Creates a render type builder helper from the specified vanilla composite state builder.static net.minecraft.client.renderer.RenderStateShardstatic net.minecraft.client.renderer.RenderStateShardDeprecated.This is a deprecated OpenGL feature and should be implemented using shadersstatic net.minecraft.client.renderer.RenderStateShardDeprecated.This is a deprecated OpenGL feature and should be implemented using shaders ormultisampleState()static net.minecraft.client.renderer.RenderStateShardstatic net.minecraft.client.renderer.RenderStateShard.OutputStateShardoutputState(AdvancedFbo framebuffer) Creates a new output state that draws into the specified Veil framebuffer.static net.minecraft.client.renderer.RenderStateShard.OutputStateShardoutputState(Supplier<AdvancedFbo> framebuffer) Creates a new output state that draws into the specified Veil framebuffer.static net.minecraft.client.renderer.RenderStateShard.OutputStateShardoutputState(net.minecraft.resources.ResourceLocation framebuffer) Creates a new output state that draws into the specified Veil framebuffer.static net.minecraft.client.renderer.RenderStateShardpatchState(int patchVertices) Creates a new render state shard for tesselation patch size.static net.minecraft.client.renderer.RenderStateShardstatic net.minecraft.client.renderer.RenderStateShard.ShaderStateShardshaderState(net.minecraft.resources.ResourceLocation shader) Creates a new shader state that points to the specified Veil shader name.static net.minecraft.client.renderer.ShaderInstancetoShaderInstance(ShaderProgram program) Wraps the specified shader with a vanilla Minecraft shader instance wrapper.static @Nullable ShaderProgramtoShaderProgram(net.minecraft.client.renderer.ShaderInstance instance) Attempts to convert a vanilla Minecraft shader instance into a Veil shader.static AdvancedFbowrap(com.mojang.blaze3d.pipeline.RenderTarget renderTarget) Wraps the specified render target in a new advanced fbo.static AdvancedFboWraps the specified render target in a new advanced fbo.
-
Method Details
-
toShaderInstance
Wraps the specified shader with a vanilla Minecraft shader instance wrapper. There are a few special properties about the shader wrapper.
- The shader instance cannot be used to free the shader program.
NativeResource.free()must be called separately. If the shader is loaded throughShaderManagerthen there is no need to free the shader. ShaderInstance.attachToProgram()is unsupported- Calling
Uniform.upload()will do nothing since the values are uploaded when the appropriate methods are called - Uniforms are lazily wrapped and will not crash when the wrong method is called.
Uniform.set(int, float)is not supported and will throw anUnsupportedOperationException.Uniform.setMat4x2(float, float, float, float, float, float, float, float)is not supported and will throw anUnsupportedOperationException.Uniform.set(float[])only works for 1, 2, 3, and 4 float elements. Any other size will throw anUnsupportedOperationException.
- Parameters:
program- The program to create a shader instance from- Returns:
- A lazily loaded shader instance wrapper for this program
- The shader instance cannot be used to free the shader program.
-
toShaderProgram
@Nullable static @Nullable ShaderProgram toShaderProgram(net.minecraft.client.renderer.ShaderInstance instance) Attempts to convert a vanilla Minecraft shader instance into a Veil shader. Only works if the shader instance is wrapped withtoShaderInstance(ShaderProgram).- Parameters:
instance- The program to convert- Returns:
- The wrapped shader program or
nullif the program is not a wrapped Veil shader - Since:
- 3.4.0
-
create
Creates a cull frustum helper from the specified vanilla frustum.- Parameters:
frustum- The frustum to use for the cull frustum- Returns:
- The cull frustum
-
create
static VeilRenderTypeBuilder create(net.minecraft.client.renderer.RenderType.CompositeState.CompositeStateBuilder builder) Creates a render type builder helper from the specified vanilla composite state builder.- Parameters:
builder- The state builder to wrap- Returns:
- The render type builder
-
create
Creates a matrix stack wrapper for the specified post stack.- Parameters:
poseStack- The pose stack to wrap- Returns:
- The matrix stack representation
-
wrap
Wraps the specified render target in a new advanced fbo.- Parameters:
renderTarget- The render target instance- Returns:
- A new advanced fbo that wraps the target in the api
-
wrap
Wraps the specified render target in a new advanced fbo.- Parameters:
renderTargetSupplier- The supplier to the render target instance- Returns:
- A new advanced fbo that wraps the target in the api
-
shaderState
static net.minecraft.client.renderer.RenderStateShard.ShaderStateShard shaderState(net.minecraft.resources.ResourceLocation shader) Creates a new shader state that points to the specified Veil shader name.- Parameters:
shader- The name of the shader to point to.- Returns:
- A new shader state shard for that shader
-
outputState
static net.minecraft.client.renderer.RenderStateShard.OutputStateShard outputState(net.minecraft.resources.ResourceLocation framebuffer) Creates a new output state that draws into the specified Veil framebuffer.- Parameters:
framebuffer- The framebuffer to use- Returns:
- A new shader state shard for that shader
-
outputState
static net.minecraft.client.renderer.RenderStateShard.OutputStateShard outputState(AdvancedFbo framebuffer) Creates a new output state that draws into the specified Veil framebuffer.- Parameters:
framebuffer- The framebuffer to use- Returns:
- A new shader state shard for that shader
-
outputState
static net.minecraft.client.renderer.RenderStateShard.OutputStateShard outputState(Supplier<AdvancedFbo> framebuffer) Creates a new output state that draws into the specified Veil framebuffer.- Parameters:
framebuffer- A supplier to the framebuffer to use- Returns:
- A new shader state shard for that shader
-
patchState
static net.minecraft.client.renderer.RenderStateShard patchState(int patchVertices) Creates a new render state shard for tesselation patch size.- Parameters:
patchVertices- The number of vertices per patch- Returns:
- A new patch state
-
depthClampState
static net.minecraft.client.renderer.RenderStateShard depthClampState()- Returns:
- A render state shard to enable depth clamp
- Since:
- 2.0.0
-
ditherState
@ScheduledForRemoval(inVersion="4.0.0") @Deprecated static net.minecraft.client.renderer.RenderStateShard ditherState()Deprecated.This is a deprecated OpenGL feature and should be implemented using shaders- Returns:
- A render state shard to enable color dithering
- Since:
- 2.0.0
-
lineSmoothState
@ScheduledForRemoval(inVersion="4.0.0") @Deprecated static net.minecraft.client.renderer.RenderStateShard lineSmoothState()Deprecated.This is a deprecated OpenGL feature and should be implemented using shaders ormultisampleState()- Returns:
- A render state shard to enable smooth line rendering
- Since:
- 2.0.0
-
multisampleState
static net.minecraft.client.renderer.RenderStateShard multisampleState()- Returns:
- A render state shard to enable multisampling
- Since:
- 2.0.0
-
seamlessCubeMapState
static net.minecraft.client.renderer.RenderStateShard seamlessCubeMapState()- Returns:
- A render state shard to enable seamless cube map textures
- Since:
- 2.0.0
-