Record Class TextureFilter
java.lang.Object
java.lang.Record
foundry.veil.api.client.render.texture.TextureFilter
- Record Components:
blur- Whether to blur the imagemipmap- Whether to respect the mipmap levels of the imageanisotropy- Sets the anisotropic filtering value. Any value >1 is considered to be enabled. Set toFloat.MAX_VALUEto set to the platform maximumcompareFunction- The depth compare function to use ornullfor defaultwrapX- The clamping for the X axis on the texturewrapY- The clamping for the Y axis on the texturewrapZ- The clamping for the Z axis on the textureborderColor- The color to get when sampling the texture out of bounds when usingTextureFilter.Wrap.CLAMP_TO_BORDERborderType- The type of data the border color should be referenced inseamless- 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 borderColor, TextureFilter.EdgeType borderType, boolean seamless)
extends Record
Specifies the full texture filter state of a texture or sampler object.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDepth-texture compare functions.static enumEdge color data types.static enumTexture wrap modes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TextureFilterstatic final com.mojang.serialization.Codec<TextureFilter> static final TextureFilterstatic final com.mojang.serialization.Codec<TextureFilter> -
Constructor Summary
ConstructorsConstructorDescriptionTextureFilter(boolean blur, boolean mipmap, float anisotropy, @Nullable TextureFilter.CompareFunction compareFunction, TextureFilter.Wrap wrapX, TextureFilter.Wrap wrapY, TextureFilter.Wrap wrapZ, int borderColor, TextureFilter.EdgeType borderType, boolean seamless) Creates an instance of aTextureFilterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of theanisotropyrecord component.voidapplyToTexture(int texture) Applies the filtering options to the specified texture object.voidapplyToTextureTarget(int target) Applies the filtering options to the specified texture target.booleanblur()Returns the value of theblurrecord component.intReturns the value of theborderColorrecord component.Returns the value of theborderTyperecord component.@Nullable TextureFilter.CompareFunctionReturns the value of thecompareFunctionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intintbooleanmipmap()Returns the value of themipmaprecord component.booleanseamless()Returns the value of theseamlessrecord component.final StringtoString()Returns a string representation of this record class.wrapX()Returns the value of thewrapXrecord component.wrapY()Returns the value of thewrapYrecord component.wrapZ()Returns the value of thewrapZrecord component.
-
Field Details
-
REPEAT_DEFAULT_CODEC
-
CLAMP_DEFAULT_CODEC
-
REPEAT
-
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 borderColor, TextureFilter.EdgeType borderType, boolean seamless) Creates an instance of aTextureFilterrecord class.- Parameters:
blur- the value for theblurrecord componentmipmap- the value for themipmaprecord componentanisotropy- the value for theanisotropyrecord componentcompareFunction- the value for thecompareFunctionrecord componentwrapX- the value for thewrapXrecord componentwrapY- the value for thewrapYrecord componentwrapZ- the value for thewrapZrecord componentborderColor- the value for theborderColorrecord componentborderType- the value for theborderTyperecord componentseamless- the value for theseamlessrecord component
-
-
Method Details
-
anisotropy
public float anisotropy()Returns the value of theanisotropyrecord component.- Returns:
- the value of the
anisotropyrecord component
-
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 ifVeilRenderSystem.directStateAccessSupported()istrue.- Parameters:
texture- The texture to apply filtering to
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
blur
public boolean blur()Returns the value of theblurrecord component.- Returns:
- the value of the
blurrecord component
-
mipmap
public boolean mipmap()Returns the value of themipmaprecord component.- Returns:
- the value of the
mipmaprecord component
-
compareFunction
Returns the value of thecompareFunctionrecord component.- Returns:
- the value of the
compareFunctionrecord component
-
wrapX
Returns the value of thewrapXrecord component.- Returns:
- the value of the
wrapXrecord component
-
wrapY
Returns the value of thewrapYrecord component.- Returns:
- the value of the
wrapYrecord component
-
wrapZ
Returns the value of thewrapZrecord component.- Returns:
- the value of the
wrapZrecord component
-
borderColor
public int borderColor()Returns the value of theborderColorrecord component.- Returns:
- the value of the
borderColorrecord component
-
borderType
Returns the value of theborderTyperecord component.- Returns:
- the value of the
borderTyperecord component
-
seamless
public boolean seamless()Returns the value of theseamlessrecord component.- Returns:
- the value of the
seamlessrecord component
-