Class ShaderBindingProcessor

java.lang.Object
foundry.veil.api.client.render.shader.processor.ShaderLineProcessor
foundry.veil.api.client.render.shader.processor.ShaderBindingProcessor
All Implemented Interfaces:
ShaderPreProcessor

public class ShaderBindingProcessor extends ShaderLineProcessor
Adds support for layout(binding = #) in the shader source without needing shader version 420.
  • Constructor Details

    • ShaderBindingProcessor

      public ShaderBindingProcessor()
  • Method Details

    • modify

      @NotNull public @NotNull String modify(@NotNull @NotNull ShaderPreProcessor.Context context, String source) throws IOException
      Description copied from interface: ShaderPreProcessor
      Modifies the specified shader source input.
      Specified by:
      modify in interface ShaderPreProcessor
      Overrides:
      modify in class ShaderLineProcessor
      Parameters:
      context - Context for modifying shaders
      source - The GLSL source code to modify
      Returns:
      The modified source or the input if nothing changed
      Throws:
      IOException - If any error occurs while editing the source
    • modify

      public void modify(@NotNull @NotNull ShaderPreProcessor.Context context, @NotNull @NotNull String original, @NotNull @NotNull List<String> line) throws IOException
      Description copied from class: ShaderLineProcessor
      Modifies a single line in a shader source.
      Specified by:
      modify in class ShaderLineProcessor
      Parameters:
      context - Context for modifying shaders
      original - A copy of the original source
      line - The data to use as the current line. The original source is the first element and can be modified as necessary. The source can be replaced by clearing the list and adding new source.
      Throws:
      IOException - If any error occurs while editing the source