Record Class VolumeTexture

java.lang.Object
java.lang.Record
gaiasky.render.gdx.graphics.VolumeTexture
Record Components:
texture - The volume's voxels.
width - The grid's extent on the texture's first axis.
height - The grid's extent on the texture's second axis.
depth - The grid's extent on the texture's third axis.
type - The storage format, which fixes where the density channel is.
boundsMin - The box, in texture order. See VolumeTextureLoader.glBounds.
boundsMax - The other corner of the box.
occupancy - The brick occupancy grid of the same box, or null when there is none.

public record VolumeTexture(com.badlogic.gdx.graphics.Texture3D texture, int width, int height, int depth, VolumeType type, com.badlogic.gdx.math.Vector3 boundsMin, com.badlogic.gdx.math.Vector3 boundsMax, com.badlogic.gdx.graphics.Texture3D occupancy) extends Record
A loaded 3D volume: the voxels, the box they live in, and the occupancy grid that says where in that box there is anything at all.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VolumeTexture(com.badlogic.gdx.graphics.Texture3D texture, int width, int height, int depth, VolumeType type, com.badlogic.gdx.math.Vector3 boundsMin, com.badlogic.gdx.math.Vector3 boundsMax, com.badlogic.gdx.graphics.Texture3D occupancy)
    Creates an instance of a VolumeTexture record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.badlogic.gdx.math.Vector3
    Returns the value of the boundsMax record component.
    com.badlogic.gdx.math.Vector3
    Returns the value of the boundsMin record component.
    int
    Returns the value of the depth record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the height record component.
    com.badlogic.gdx.graphics.Texture3D
    Returns the value of the occupancy record component.
    com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D>
    The volume's own occupancy grid, or the fallback, ready to hand to the texture binder.
    static com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D>
    occupancyDescriptor(com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancy)
    The occupancy texture to bind to a volume slot: the volume's own, or a 1x1x1 volume of ones when it has none.
    com.badlogic.gdx.graphics.Texture3D
    Returns the value of the texture record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the type record component.
    int
    Returns the value of the width record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • VolumeTexture

      public VolumeTexture(com.badlogic.gdx.graphics.Texture3D texture, int width, int height, int depth, VolumeType type, com.badlogic.gdx.math.Vector3 boundsMin, com.badlogic.gdx.math.Vector3 boundsMax, com.badlogic.gdx.graphics.Texture3D occupancy)
      Creates an instance of a VolumeTexture record class.
      Parameters:
      texture - the value for the texture record component
      width - the value for the width record component
      height - the value for the height record component
      depth - the value for the depth record component
      type - the value for the type record component
      boundsMin - the value for the boundsMin record component
      boundsMax - the value for the boundsMax record component
      occupancy - the value for the occupancy record component
  • Method Details

    • occupancyDescriptor

      public static com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancyDescriptor(com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancy)
      The occupancy texture to bind to a volume slot: the volume's own, or a 1x1x1 volume of ones when it has none.

      A slot has no occupancy grid when its volume carries no density to measure (a colour-only volume) or was loaded before the grid existed. The shader's uniform is unconditional - it has no per-slot flag to switch it off - so the fallback has to be something the empty-brick test can read and be told "not empty" by. A single texel of 1, clamped to the whole box, is exactly that, and says the do-nothing thing for one R8 fetch per step.

    • occupancyDescriptor

      public com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancyDescriptor()
      The volume's own occupancy grid, or the fallback, ready to hand to the texture binder.
    • 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.
    • texture

      public com.badlogic.gdx.graphics.Texture3D texture()
      Returns the value of the texture record component.
      Returns:
      the value of the texture record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • depth

      public int depth()
      Returns the value of the depth record component.
      Returns:
      the value of the depth record component
    • type

      public VolumeType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • boundsMin

      public com.badlogic.gdx.math.Vector3 boundsMin()
      Returns the value of the boundsMin record component.
      Returns:
      the value of the boundsMin record component
    • boundsMax

      public com.badlogic.gdx.math.Vector3 boundsMax()
      Returns the value of the boundsMax record component.
      Returns:
      the value of the boundsMax record component
    • occupancy

      public com.badlogic.gdx.graphics.Texture3D occupancy()
      Returns the value of the occupancy record component.
      Returns:
      the value of the occupancy record component