Class BlitPostStage

java.lang.Object
foundry.veil.api.client.render.post.stage.FramebufferPostStage
foundry.veil.api.client.render.post.stage.BlitPostStage
All Implemented Interfaces:
PostPipeline, MutableUniformAccess, UniformAccess, AutoCloseable, org.lwjgl.system.NativeResource

public class BlitPostStage extends FramebufferPostStage
A basic stage that draws a quad to the output using a specified shader.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<BlitPostStage> CODEC
  • Constructor Details

    • BlitPostStage

      public BlitPostStage(net.minecraft.resources.ResourceLocation shader, Map<String,UniformValue> uniforms, @Nullable @Nullable net.minecraft.resources.ResourceLocation in, net.minecraft.resources.ResourceLocation out, boolean clear)
      Creates a new blit post stage that applies the specified shader.
      Parameters:
      shader - The shader to apply
      in - The framebuffer to use as DiffuseSampler0-DiffuseSampler7 and DiffuseDepthSampler
      out - The framebuffer to write into
      clear - Whether to clear the output before drawing
  • Method Details

    • apply

      public void apply(PostPipeline.Context context)
      Description copied from interface: PostPipeline
      Applies this post effect. PostProcessingManager.runPipeline(PostPipeline) should be called to run this pipeline.
      Parameters:
      context - The context to use when running this pipeline.
    • getType

      Returns:
      The type of post effect this is
    • hasUniform

      public boolean hasUniform(CharSequence name)
      Description copied from interface: UniformAccess
      Checks if the specified uniform exists in the shader.
      Parameters:
      name - The name of the uniform to check
      Returns:
      Whether that uniform can be set
    • getUniform

      @Nullable public @Nullable ShaderUniformAccess getUniform(CharSequence name)
      Description copied from interface: UniformAccess
      Retrieves a uniform by name.
      Parameters:
      name - The name of the uniform to get
      Returns:
      The uniform with that name or null if the uniform does not exist
    • getUniformSafe

      public ShaderUniformAccess getUniformSafe(CharSequence name)
      Description copied from interface: UniformAccess
      Retrieves a uniform by name.
      Parameters:
      name - The name of the uniform to get
      Returns:
      The uniform with that name
    • getOrCreateUniform

      public ShaderUniformAccess getOrCreateUniform(CharSequence name)
      Description copied from interface: UniformAccess
      Retrieves a uniform by name or creates a reference to one that may exist in the future.
      Parameters:
      name - The name of the uniform to get
      Returns:
      The uniform instance
    • hasUniformBlock

      public boolean hasUniformBlock(CharSequence name)
      Description copied from interface: UniformAccess
      Checks if the specified uniform block exists in the shader.
      Parameters:
      name - The name of the uniform block to check
      Returns:
      Whether that uniform block can be set
    • hasStorageBlock

      public boolean hasStorageBlock(CharSequence name)
      Description copied from interface: UniformAccess
      Checks if the specified storage block exists in the shader.
      Parameters:
      name - The name of the storage block to check
      Returns:
      Whether that storage block can be set
    • setUniformBlock

      public void setUniformBlock(CharSequence name, int binding)
      Description copied from interface: MutableUniformAccess
      Sets the binding to use for the specified uniform block.
      Parameters:
      name - The name of the block to set
      binding - The binding to use for that block
    • setStorageBlock

      public void setStorageBlock(CharSequence name, int binding)
      Description copied from interface: MutableUniformAccess
      Sets the binding to use for the specified storage block.
      Parameters:
      name - The name of the block to set
      binding - The binding to use for that block
    • getShader

      @Nullable public @Nullable ShaderProgram getShader()
      Returns:
      The shader this stage should use
    • getShaderId

      public net.minecraft.resources.ResourceLocation getShaderId()
      Returns:
      The name of the shader this stage should use
    • getUniforms

      public Map<String,UniformValue> getUniforms()
      Returns:
      A view of all uniform values set by this stage