Record Class StencilTest

java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.stencil.StencilTest
Record Components:
front - The stencil test settings for front-faces (based on vertex winding).
back - The stencil test settings for back-faces (based on vertex winding).
readMask - the bitmask to apply to the current stencil buffer value before it is used in the stencil test.
writeMask - the bitmask to apply to the stencil buffer value before writing it back to the stencil buffer after the test.
referenceValue - The reference value that will be used in comparisons and written to the stencil buffer (depending on settings). Shaders can overwrite this per-fragment.

public record StencilTest(StencilPerFaceTest front, StencilPerFaceTest back, int readMask, int writeMask, int referenceValue) extends Record
Describes the stencil test state for the render pipeline.
  • Field Details

    • front

      private final StencilPerFaceTest front
      The field for the front record component.
    • back

      private final StencilPerFaceTest back
      The field for the back record component.
    • readMask

      private final int readMask
      The field for the readMask record component.
    • writeMask

      private final int writeMask
      The field for the writeMask record component.
    • referenceValue

      private final int referenceValue
      The field for the referenceValue record component.
    • DEFAULT_READ_MASK

      public static int DEFAULT_READ_MASK
    • DEFAULT_WRITE_MASK

      public static int DEFAULT_WRITE_MASK
    • DEFAULT_REFERENCE_VALUE

      public static int DEFAULT_REFERENCE_VALUE
  • Constructor Details

    • StencilTest

      public StencilTest(StencilPerFaceTest test, int readMask, int writeMask, int referenceValue)
    • StencilTest

      public StencilTest(StencilPerFaceTest front, StencilPerFaceTest back, int readMask, int writeMask, int referenceValue)
      Creates an instance of a StencilTest record class.
      Parameters:
      front - the value for the front record component
      back - the value for the back record component
      readMask - the value for the readMask record component
      writeMask - the value for the writeMask record component
      referenceValue - the value for the referenceValue record component
  • Method Details

    • 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.
    • front

      public StencilPerFaceTest front()
      Returns the value of the front record component.
      Returns:
      the value of the front record component
    • back

      public StencilPerFaceTest back()
      Returns the value of the back record component.
      Returns:
      the value of the back record component
    • readMask

      public int readMask()
      Returns the value of the readMask record component.
      Returns:
      the value of the readMask record component
    • writeMask

      public int writeMask()
      Returns the value of the writeMask record component.
      Returns:
      the value of the writeMask record component
    • referenceValue

      public int referenceValue()
      Returns the value of the referenceValue record component.
      Returns:
      the value of the referenceValue record component