Class AdvancedFboTextureAttachment

java.lang.Object
net.minecraft.client.renderer.texture.AbstractTexture
foundry.veil.api.client.render.framebuffer.AdvancedFboTextureAttachment
All Implemented Interfaces:
AdvancedFboAttachment, AutoCloseable, Cloneable, org.lwjgl.system.NativeResource
Direct Known Subclasses:
AdvancedFboMutableTextureAttachment

public class AdvancedFboTextureAttachment extends net.minecraft.client.renderer.texture.AbstractTexture implements AdvancedFboAttachment
An attachment for an AdvancedFboImpl that represents a color texture buffer.
  • Field Summary

    Fields inherited from class net.minecraft.client.renderer.texture.AbstractTexture

    blur, id, mipmap, NOT_ASSIGNED
  • Constructor Summary

    Constructors
    Constructor
    Description
    AdvancedFboTextureAttachment(int attachmentType, int format, int texelFormat, int dataType, int width, int height, int mipmapLevels, boolean linear, @Nullable String name)
    Creates a new attachment that adds a texture.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    attach(int attachment)
    Attaches this attachment to the provided target under the specified attachment point.
    void
    Binds this attachment.
    boolean
     
     
    void
    Creates the attachment and initializes it with the default properties.
    void
     
    int
    Returns the OpenGL attachment point.
    int
     
    int
     
    int
     
    @Nullable String
     
    int
     
    void
    load(net.minecraft.server.packs.resources.ResourceManager manager)
     
    void
    Unbinds this attachment.

    Methods inherited from class net.minecraft.client.renderer.texture.AbstractTexture

    bind, close, getId, releaseId, reset, setFilter

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close
  • Constructor Details

    • AdvancedFboTextureAttachment

      public AdvancedFboTextureAttachment(int attachmentType, int format, int texelFormat, int dataType, int width, int height, int mipmapLevels, boolean linear, @Nullable @Nullable String name)
      Creates a new attachment that adds a texture.
      Parameters:
      attachmentType - The attachment point to put this on
      format - The format of the image data
      texelFormat - The format of the image texel data
      dataType - The type of data to store in the texture
      width - The width of the attachment
      height - The height of the attachment
      mipmapLevels - The number of mipmaps levels to have
      name - The custom name of this attachment for shader references
  • 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
    • clone

      Specified by:
      clone in interface AdvancedFboAttachment
      Overrides:
      clone in class Object
      Returns:
      A new identical attachment to this one
    • 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
    • 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
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface AdvancedFboAttachment
      Returns:
      The width of this attachment
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface AdvancedFboAttachment
      Returns:
      The height of 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#
    • free

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

      public void load(net.minecraft.server.packs.resources.ResourceManager manager)
      Specified by:
      load in class net.minecraft.client.renderer.texture.AbstractTexture