Class SamplerObject

java.lang.Object
foundry.veil.api.client.render.texture.SamplerObject
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource

public class SamplerObject extends Object implements org.lwjgl.system.NativeResource
Sampler objects allow shaders to sample from the same texture storage in different ways depending on what samplers are bound.
  • Method Details

    • create

      public static SamplerObject create()
      Creates a single new sampler object.
      Returns:
      A new sampler
    • create

      public static SamplerObject[] create(int count)
      Creates an array of sampler objects.
      Parameters:
      count - The number of samplers to create
      Returns:
      An array of new sampler objects
    • create

      public static void create(SamplerObject[] fill)
      Replaces each element of the specified array with a new sampler object.
      Parameters:
      fill - The array to fill
    • bind

      public void bind(int unit)
      Binds this sampler to the specified texture unit.
      Parameters:
      unit - The unit to bind to
    • unbind

      public static void unbind(int unit)
    • getId

      public int getId()
    • setFilter

      public void setFilter(TextureFilter filter)
    • setFilter

      public void setFilter(boolean blur, boolean mipmap)
    • setAnisotropy

      public void setAnisotropy(float value)
    • setCompareFunc

      public void setCompareFunc(@Nullable TextureFilter.CompareFunction compareFunction)
    • setWrapX

      public void setWrapX(TextureFilter.Wrap wrap)
    • setWrapY

      public void setWrapY(TextureFilter.Wrap wrap)
    • setWrapZ

      public void setWrapZ(TextureFilter.Wrap wrap)
    • setWrap

      public void setWrap(TextureFilter.Wrap wrapX, TextureFilter.Wrap wrapY, TextureFilter.Wrap wrapZ)
    • setBorderColor

      public void setBorderColor(float red, float green, float blue, float alpha)
    • setBorderColor

      public void setBorderColor(int red, int green, int blue, int alpha)
    • setBorderColor

      public void setBorderColor(int color)
    • setBorderColorI

      public void setBorderColorI(int red, int green, int blue, int alpha)
    • setBorderColorI

      public void setBorderColorI(int color)
    • setBorderColorUI

      public void setBorderColorUI(int red, int green, int blue, int alpha)
    • setBorderColorUI

      public void setBorderColorUI(int color)
    • setCubeMapSeamless

      public void setCubeMapSeamless(boolean seamless)
      Allows filtering to work across faces of cubemaps.
      Parameters:
      seamless - Whether to enable seamless cube maps
    • free

      public void free()
      Specified by:
      free in interface org.lwjgl.system.NativeResource