Class ShaderLineProcessor

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

public abstract class ShaderLineProcessor extends Object implements ShaderPreProcessor
Processes shader sources line by line.
  • Constructor Details

    • ShaderLineProcessor

      public ShaderLineProcessor()
  • 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
      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 abstract void modify(@NotNull @NotNull ShaderPreProcessor.Context context, @NotNull @NotNull String original, @NotNull @NotNull List<String> line) throws IOException
      Modifies a single line in a shader source.
      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