Record Class TextureFilter

java.lang.Object
java.lang.Record
foundry.veil.api.client.render.texture.TextureFilter
Record Components:
blur - Whether to blur the image
mipmap - Whether to respect the mipmap levels of the image
anisotropy - Sets the anisotropic filtering value. Any value >1 is considered to be enabled. Set to Float.MAX_VALUE to set to the platform maximum
compareFunction - The depth compare function to use or null for default
wrapX - The clamping for the X axis on the texture
wrapY - The clamping for the Y axis on the texture
wrapZ - The clamping for the Z axis on the texture
edgeColor - The color to get when sampling the texture out of bounds when using TextureFilter.Wrap.CLAMP_TO_BORDER
edgeType - The type of data the edge color should be referenced in
seamless - Whether the texture should be considered seamless if using a cubemap

public record TextureFilter(boolean blur, boolean mipmap, float anisotropy, @Nullable TextureFilter.CompareFunction compareFunction, TextureFilter.Wrap wrapX, TextureFilter.Wrap wrapY, TextureFilter.Wrap wrapZ, int edgeColor, TextureFilter.EdgeType edgeType, boolean seamless) extends Record
Specifies the full texture filter state of a texture or sampler object.
  • Field Details

    • REPEAT_DEFAULT_CODEC

      public static final com.mojang.serialization.Codec<TextureFilter> REPEAT_DEFAULT_CODEC
    • CLAMP_DEFAULT_CODEC

      public static final com.mojang.serialization.Codec<TextureFilter> CLAMP_DEFAULT_CODEC
    • REPEAT

      public static final TextureFilter REPEAT
    • CLAMP

      public static final TextureFilter CLAMP
  • Constructor Details

    • TextureFilter

      public TextureFilter(boolean blur, boolean mipmap, float anisotropy, @Nullable @Nullable TextureFilter.CompareFunction compareFunction, TextureFilter.Wrap wrapX, TextureFilter.Wrap wrapY, TextureFilter.Wrap wrapZ, int edgeColor, TextureFilter.EdgeType edgeType, boolean seamless)
      Creates an instance of a TextureFilter record class.
      Parameters:
      blur - the value for the blur record component
      mipmap - the value for the mipmap record component
      anisotropy - the value for the anisotropy record component
      compareFunction - the value for the compareFunction record component
      wrapX - the value for the wrapX record component
      wrapY - the value for the wrapY record component
      wrapZ - the value for the wrapZ record component
      edgeColor - the value for the edgeColor record component
      edgeType - the value for the edgeType record component
      seamless - the value for the seamless record component
  • Method Details

    • minFilter

      public int minFilter()
      Returns:
      The OpenGl filter to use when making the image smaller (minification)
    • magFilter

      public int magFilter()
      Returns:
      The OpenGl filter to use when making the image larger (magnification)
    • applyToTextureTarget

      public void applyToTextureTarget(int target)
      Applies the filtering options to the specified texture target.
      Parameters:
      target - The target to apply filtering to
    • applyToTexture

      public void applyToTexture(int texture)
      Applies the filtering options to the specified texture object. Only valid if VeilRenderSystem.directStateAccessSupported() is true.
      Parameters:
      texture - The texture to apply filtering to
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • blur

      public boolean blur()
      Returns the value of the blur record component.
      Returns:
      the value of the blur record component
    • mipmap

      public boolean mipmap()
      Returns the value of the mipmap record component.
      Returns:
      the value of the mipmap record component
    • anisotropy

      public float anisotropy()
      Returns the value of the anisotropy record component.
      Returns:
      the value of the anisotropy record component
    • compareFunction

      @Nullable public @Nullable TextureFilter.CompareFunction compareFunction()
      Returns the value of the compareFunction record component.
      Returns:
      the value of the compareFunction record component
    • wrapX

      public TextureFilter.Wrap wrapX()
      Returns the value of the wrapX record component.
      Returns:
      the value of the wrapX record component
    • wrapY

      public TextureFilter.Wrap wrapY()
      Returns the value of the wrapY record component.
      Returns:
      the value of the wrapY record component
    • wrapZ

      public TextureFilter.Wrap wrapZ()
      Returns the value of the wrapZ record component.
      Returns:
      the value of the wrapZ record component
    • edgeColor

      public int edgeColor()
      Returns the value of the edgeColor record component.
      Returns:
      the value of the edgeColor record component
    • edgeType

      public TextureFilter.EdgeType edgeType()
      Returns the value of the edgeType record component.
      Returns:
      the value of the edgeType record component
    • seamless

      public boolean seamless()
      Returns the value of the seamless record component.
      Returns:
      the value of the seamless record component