Record Class SamplerDescriptor

java.lang.Object
java.lang.Record
dev.engine.graphics.sampler.SamplerDescriptor
Record Components:
minFilter - minification filter (includes mipmap mode)
magFilter - magnification filter (NEAREST or LINEAR only)
wrapS - horizontal wrap mode
wrapT - vertical wrap mode
wrapR - depth/layer wrap mode (for 3D/cube/array textures)
minLod - minimum level of detail (0.0 = highest resolution mip)
maxLod - maximum level of detail (1000.0 = use all mips)
lodBias - LOD bias added to the computed mip level
maxAnisotropy - maximum anisotropy level (1.0 = disabled, 16.0 = max quality)
compareFunc - comparison function for shadow samplers (null = disabled)
borderColor - border color for CLAMP_TO_BORDER wrap mode

public record SamplerDescriptor(FilterMode minFilter, FilterMode magFilter, WrapMode wrapS, WrapMode wrapT, WrapMode wrapR, float minLod, float maxLod, float lodBias, float maxAnisotropy, CompareFunc compareFunc, BorderColor borderColor) extends Record
Describes a GPU sampler configuration.

Covers all sampler features common to OpenGL, Vulkan, and WebGPU: filtering, wrapping, LOD control, anisotropy, comparison, and border color.

  • Constructor Details

    • SamplerDescriptor

      public SamplerDescriptor(FilterMode minFilter, FilterMode magFilter, WrapMode wrapS, WrapMode wrapT)
      Backward-compatible 4-arg constructor.
    • SamplerDescriptor

      public SamplerDescriptor(FilterMode minFilter, FilterMode magFilter, WrapMode wrapS, WrapMode wrapT, WrapMode wrapR, float minLod, float maxLod, float lodBias, float maxAnisotropy, CompareFunc compareFunc, BorderColor borderColor)
      Creates an instance of a SamplerDescriptor record class.
      Parameters:
      minFilter - the value for the minFilter record component
      magFilter - the value for the magFilter record component
      wrapS - the value for the wrapS record component
      wrapT - the value for the wrapT record component
      wrapR - the value for the wrapR record component
      minLod - the value for the minLod record component
      maxLod - the value for the maxLod record component
      lodBias - the value for the lodBias record component
      maxAnisotropy - the value for the maxAnisotropy record component
      compareFunc - the value for the compareFunc record component
      borderColor - the value for the borderColor record component
  • Method Details

    • linear

      public static SamplerDescriptor linear()
    • nearest

      public static SamplerDescriptor nearest()
    • trilinear

      public static SamplerDescriptor trilinear()
    • anisotropic

      public static SamplerDescriptor anisotropic(float maxAnisotropy)
    • shadow

      public static SamplerDescriptor shadow()
    • withWrap

      public SamplerDescriptor withWrap(WrapMode wrap)
    • withAnisotropy

      public SamplerDescriptor withAnisotropy(float max)
    • withLodRange

      public SamplerDescriptor withLodRange(float min, float max)
    • withLodBias

      public SamplerDescriptor withLodBias(float bias)
    • withCompare

      public SamplerDescriptor withCompare(CompareFunc func)
    • withBorderColor

      public SamplerDescriptor withBorderColor(BorderColor color)
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • minFilter

      public FilterMode minFilter()
      Returns the value of the minFilter record component.
      Returns:
      the value of the minFilter record component
    • magFilter

      public FilterMode magFilter()
      Returns the value of the magFilter record component.
      Returns:
      the value of the magFilter record component
    • wrapS

      public WrapMode wrapS()
      Returns the value of the wrapS record component.
      Returns:
      the value of the wrapS record component
    • wrapT

      public WrapMode wrapT()
      Returns the value of the wrapT record component.
      Returns:
      the value of the wrapT record component
    • wrapR

      public WrapMode wrapR()
      Returns the value of the wrapR record component.
      Returns:
      the value of the wrapR record component
    • minLod

      public float minLod()
      Returns the value of the minLod record component.
      Returns:
      the value of the minLod record component
    • maxLod

      public float maxLod()
      Returns the value of the maxLod record component.
      Returns:
      the value of the maxLod record component
    • lodBias

      public float lodBias()
      Returns the value of the lodBias record component.
      Returns:
      the value of the lodBias record component
    • maxAnisotropy

      public float maxAnisotropy()
      Returns the value of the maxAnisotropy record component.
      Returns:
      the value of the maxAnisotropy record component
    • compareFunc

      public CompareFunc compareFunc()
      Returns the value of the compareFunc record component.
      Returns:
      the value of the compareFunc record component
    • borderColor

      public BorderColor borderColor()
      Returns the value of the borderColor record component.
      Returns:
      the value of the borderColor record component