Class ManagedUniform

java.lang.Object
dev.cammiescorner.velvet.impl.ManagedUniformBase
dev.cammiescorner.velvet.impl.ManagedUniform
All Implemented Interfaces:
Uniform1f, Uniform1i, Uniform2f, Uniform2i, Uniform3f, Uniform3i, Uniform4f, Uniform4i, UniformMat4

public final class ManagedUniform extends ManagedUniformBase implements Uniform1i, Uniform2i, Uniform3i, Uniform4i, Uniform1f, Uniform2f, Uniform3f, Uniform4f, UniformMat4
  • Field Summary

    Fields inherited from class dev.cammiescorner.velvet.impl.ManagedUniformBase

    name
  • Constructor Summary

    Constructors
    Constructor
    Description
    ManagedUniform(String name, int count)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    findUniformTarget(net.minecraft.client.renderer.ShaderInstance shader)
     
    boolean
    findUniformTargets(List<net.minecraft.client.renderer.PostPass> shaders)
     
    void
    set(float value)
    Sets the value of a uniform
    void
    set(float value0, float value1)
    Sets the value of a uniform declared in json
    void
    set(float value0, float value1, float value2)
    Sets the value of a uniform declared in json
    void
    set(float value0, float value1, float value2, float value3)
    Sets the value of a uniform declared in json
    void
    set(int value)
    Sets the value of this uniform
    void
    set(int value0, int value1)
    Sets the value of a uniform
    void
    set(int value0, int value1, int value2)
    Sets the value of a uniform
    void
    set(int value0, int value1, int value2, int value3)
    Sets the value of a uniform declared in json
    void
    set(org.joml.Matrix4f value)
    Sets the value of a 4x4 matrix uniform
    void
    set(org.joml.Vector2f value)
    Sets the value of a uniform declared in json
    void
    set(org.joml.Vector3f value)
    Sets the value of a uniform declared in json
    void
    set(org.joml.Vector4f value)
    Sets the value of a uniform declared in json
    void
    setFromArray(float[] values)
    Sets the value of a 4x4 matrix uniform through a float array

    Methods inherited from class dev.cammiescorner.velvet.impl.ManagedUniformBase

    getName

    Methods inherited from class java.lang.Object

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

    • ManagedUniform

      public ManagedUniform(String name, int count)
  • Method Details

    • findUniformTargets

      public boolean findUniformTargets(List<net.minecraft.client.renderer.PostPass> shaders)
      Specified by:
      findUniformTargets in class ManagedUniformBase
    • findUniformTarget

      public boolean findUniformTarget(net.minecraft.client.renderer.ShaderInstance shader)
      Specified by:
      findUniformTarget in class ManagedUniformBase
    • set

      public void set(int value)
      Description copied from interface: Uniform1i
      Sets the value of this uniform
      Specified by:
      set in interface Uniform1i
      Parameters:
      value - int value
    • set

      public void set(int value0, int value1)
      Description copied from interface: Uniform2i
      Sets the value of a uniform
      Specified by:
      set in interface Uniform2i
      Parameters:
      value0 - int value
      value1 - int value
    • set

      public void set(int value0, int value1, int value2)
      Description copied from interface: Uniform3i
      Sets the value of a uniform
      Specified by:
      set in interface Uniform3i
      Parameters:
      value0 - int value
      value1 - int value
      value2 - int value
    • set

      public void set(int value0, int value1, int value2, int value3)
      Description copied from interface: Uniform4i
      Sets the value of a uniform declared in json
      Specified by:
      set in interface Uniform4i
      Parameters:
      value0 - int value
      value1 - int value
      value2 - int value
      value3 - int value
    • set

      public void set(float value)
      Description copied from interface: Uniform1f
      Sets the value of a uniform
      Specified by:
      set in interface Uniform1f
      Parameters:
      value - float value
    • set

      public void set(float value0, float value1)
      Description copied from interface: Uniform2f
      Sets the value of a uniform declared in json
      Specified by:
      set in interface Uniform2f
      Parameters:
      value0 - float value
      value1 - float value
    • set

      public void set(org.joml.Vector2f value)
      Description copied from interface: Uniform2f
      Sets the value of a uniform declared in json

      The vector's value is read once when this method is called. Further mutations to the vector will have no effect on this uniform's value.

      Specified by:
      set in interface Uniform2f
      Parameters:
      value - the vector of new values
    • set

      public void set(float value0, float value1, float value2)
      Description copied from interface: Uniform3f
      Sets the value of a uniform declared in json
      Specified by:
      set in interface Uniform3f
      Parameters:
      value0 - float value
      value1 - float value
      value2 - float value
    • set

      public void set(org.joml.Vector3f value)
      Description copied from interface: Uniform3f
      Sets the value of a uniform declared in json

      The vector's value is read once when this method is called. Further mutations to the vector will have no effect on this uniform's value.

      Specified by:
      set in interface Uniform3f
      Parameters:
      value - the vector of new values
    • set

      public void set(float value0, float value1, float value2, float value3)
      Description copied from interface: Uniform4f
      Sets the value of a uniform declared in json
      Specified by:
      set in interface Uniform4f
      Parameters:
      value0 - float value
      value1 - float value
      value2 - float value
      value3 - float value
    • set

      public void set(org.joml.Vector4f value)
      Description copied from interface: Uniform4f
      Sets the value of a uniform declared in json

      The vector's value is read once when this method is called. Further mutations to the vector will have no effect on this uniform's value.

      Specified by:
      set in interface Uniform4f
      Parameters:
      value - the vector of new values
    • set

      public void set(org.joml.Matrix4f value)
      Description copied from interface: UniformMat4
      Sets the value of a 4x4 matrix uniform
      Specified by:
      set in interface UniformMat4
      Parameters:
      value - a matrix
    • setFromArray

      public void setFromArray(float[] values)
      Description copied from interface: UniformMat4
      Sets the value of a 4x4 matrix uniform through a float array

      The values array must have a length of 16, and contain the matrix elements in column-major order.

      Specified by:
      setFromArray in interface UniformMat4
      Parameters:
      values - an array representing a 4x4 matrix