Class AdvancedFboRenderAttachment

java.lang.Object
foundry.veil.api.client.render.framebuffer.AdvancedFboRenderAttachment
All Implemented Interfaces:
AdvancedFboAttachment, AutoCloseable, Cloneable, org.lwjgl.system.NativeResource

public class AdvancedFboRenderAttachment extends Object implements AdvancedFboAttachment
An attachment for an AdvancedFboImpl that represents a depth render buffer.
  • Field Details

    • MAX_SAMPLES

      public static final int MAX_SAMPLES
  • Constructor Details

    • AdvancedFboRenderAttachment

      public AdvancedFboRenderAttachment(int attachmentType, int attachmentFormat, int width, int height, int samples)
      Creates a new attachment that adds a renderbuffer.
      Parameters:
      attachmentType - The attachment point to put this on
      attachmentFormat - The format of the attachment data
      width - The width of the attachment
      height - The height of the attachment
      samples - The number of samples to have. It must be between1 and MAX_SAMPLES
  • Method Details

    • create

      public void create()
      Description copied from interface: AdvancedFboAttachment
      Creates the attachment and initializes it with the default properties.
      Specified by:
      create in interface AdvancedFboAttachment
    • attach

      public void attach(int attachment)
      Description copied from interface: AdvancedFboAttachment
      Attaches this attachment to the provided target under the specified attachment point.
      Specified by:
      attach in interface AdvancedFboAttachment
      Parameters:
      attachment - The attachment point to add this attachment to
    • bindAttachment

      public void bindAttachment()
      Description copied from interface: AdvancedFboAttachment
      Binds this attachment.
      Specified by:
      bindAttachment in interface AdvancedFboAttachment
    • unbindAttachment

      public void unbindAttachment()
      Description copied from interface: AdvancedFboAttachment
      Unbinds this attachment.
      Specified by:
      unbindAttachment in interface AdvancedFboAttachment
    • getId

      public int getId()
      Returns:
      The OpenGL renderbuffer id of this attachment
    • getAttachmentType

      public int getAttachmentType()
      Description copied from interface: AdvancedFboAttachment
      Returns the OpenGL attachment point. One of:
      All possible OpenGL attachment points
      COLOR_ATTACHMENT0 COLOR_ATTACHMENT1 COLOR_ATTACHMENT2 COLOR_ATTACHMENT3
      COLOR_ATTACHMENT4 COLOR_ATTACHMENT5 COLOR_ATTACHMENT6 COLOR_ATTACHMENT7
      COLOR_ATTACHMENT8 COLOR_ATTACHMENT9 COLOR_ATTACHMENT10 COLOR_ATTACHMENT11
      COLOR_ATTACHMENT12 COLOR_ATTACHMENT13 COLOR_ATTACHMENT14 COLOR_ATTACHMENT15
      COLOR_ATTACHMENT16 COLOR_ATTACHMENT17 COLOR_ATTACHMENT18 COLOR_ATTACHMENT19
      COLOR_ATTACHMENT20 COLOR_ATTACHMENT21 COLOR_ATTACHMENT22 COLOR_ATTACHMENT23
      COLOR_ATTACHMENT24 COLOR_ATTACHMENT25 COLOR_ATTACHMENT26 COLOR_ATTACHMENT27
      COLOR_ATTACHMENT28 COLOR_ATTACHMENT29 COLOR_ATTACHMENT30 COLOR_ATTACHMENT31
      DEPTH_ATTACHMENT STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT
      Specified by:
      getAttachmentType in interface AdvancedFboAttachment
      Returns:
      OpenGL attachment point
    • getFormat

      public int getFormat()
      Specified by:
      getFormat in interface AdvancedFboAttachment
      Returns:
      The OpenGL format for this attachment
    • getLevels

      public int getLevels()
      Specified by:
      getLevels in interface AdvancedFboAttachment
      Returns:
      Texture targets return mipmaps and render targets return samples.
    • canSample

      public boolean canSample()
      Specified by:
      canSample in interface AdvancedFboAttachment
      Returns:
      Whether this attachment can be read from
    • getName

      @Nullable public @Nullable String getName()
      Specified by:
      getName in interface AdvancedFboAttachment
      Returns:
      The custom name of this attachment or null to use DiffuseSampler#
    • clone

      @NotNull public @NotNull AdvancedFboAttachment clone()
      Specified by:
      clone in interface AdvancedFboAttachment
      Overrides:
      clone in class Object
      Returns:
      A new identical attachment to this one
    • free

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