Class ToucanShaders

java.lang.Object
com.jvn.toucanlib.neoforge.client.ToucanShaders

public final class ToucanShaders extends Object
NeoForge shader registration and uniform helpers.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    register(net.neoforged.neoforge.client.event.RegisterShadersEvent event, net.minecraft.resources.ResourceLocation id, com.mojang.blaze3d.vertex.VertexFormat vertexFormat, Consumer<net.minecraft.client.renderer.ShaderInstance> shaderConsumer)
    Registers a shader and passes the loaded instance to shaderConsumer.
    static void
    setRgbUniforms(net.minecraft.client.renderer.ShaderInstance shader, String redName, String greenName, String blueName, int color)
    Sets packed RGB color channels as separate float uniforms when they exist on the shader.
    static void
    setUniform(net.minecraft.client.renderer.ShaderInstance shader, String name, boolean value)
    Sets an integer-like uniform value when it exists on the shader.
    static void
    setUniform(net.minecraft.client.renderer.ShaderInstance shader, String name, float value)
    Sets a float uniform when it exists on the shader.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • register

      public static void register(net.neoforged.neoforge.client.event.RegisterShadersEvent event, net.minecraft.resources.ResourceLocation id, com.mojang.blaze3d.vertex.VertexFormat vertexFormat, Consumer<net.minecraft.client.renderer.ShaderInstance> shaderConsumer)
      Registers a shader and passes the loaded instance to shaderConsumer.
    • setUniform

      public static void setUniform(net.minecraft.client.renderer.ShaderInstance shader, String name, float value)
      Sets a float uniform when it exists on the shader.
    • setUniform

      public static void setUniform(net.minecraft.client.renderer.ShaderInstance shader, String name, boolean value)
      Sets an integer-like uniform value when it exists on the shader.
    • setRgbUniforms

      public static void setRgbUniforms(net.minecraft.client.renderer.ShaderInstance shader, String redName, String greenName, String blueName, int color)
      Sets packed RGB color channels as separate float uniforms when they exist on the shader.