Class AdvancedFboRenderAttachment
java.lang.Object
foundry.veil.api.client.render.framebuffer.AdvancedFboRenderAttachment
- All Implemented Interfaces:
AdvancedFboAttachment
,AutoCloseable
,Cloneable
,org.lwjgl.system.NativeResource
An attachment for an
AdvancedFboImpl
that represents a depth render buffer.-
Field Summary
-
Constructor Summary
ConstructorDescriptionAdvancedFboRenderAttachment
(int attachmentType, int attachmentFormat, int width, int height, int samples) Creates a new attachment that adds a renderbuffer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
attach
(int attachment) Attaches this attachment to the provided target under the specified attachment point.void
Binds this attachment.boolean
@NotNull AdvancedFboAttachment
clone()
void
create()
Creates the attachment and initializes it with the default properties.void
free()
int
Returns the OpenGL attachment point.int
int
getId()
int
@Nullable String
getName()
void
Unbinds this attachment.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
-
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 onattachmentFormat
- The format of the attachment datawidth
- The width of the attachmentheight
- The height of the attachmentsamples
- The number of samples to have. It must be between1
andMAX_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 interfaceAdvancedFboAttachment
-
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 interfaceAdvancedFboAttachment
- 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 interfaceAdvancedFboAttachment
-
unbindAttachment
public void unbindAttachment()Description copied from interface:AdvancedFboAttachment
Unbinds this attachment.- Specified by:
unbindAttachment
in interfaceAdvancedFboAttachment
-
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 interfaceAdvancedFboAttachment
- Returns:
- OpenGL attachment point
-
getFormat
public int getFormat()- Specified by:
getFormat
in interfaceAdvancedFboAttachment
- Returns:
- The OpenGL format for this attachment
-
getLevels
public int getLevels()- Specified by:
getLevels
in interfaceAdvancedFboAttachment
- Returns:
- Texture targets return mipmaps and render targets return samples.
-
canSample
public boolean canSample()- Specified by:
canSample
in interfaceAdvancedFboAttachment
- Returns:
- Whether this attachment can be read from
-
getName
- Specified by:
getName
in interfaceAdvancedFboAttachment
- Returns:
- The custom name of this attachment or
null
to useDiffuseSampler#
-
clone
- Specified by:
clone
in interfaceAdvancedFboAttachment
- Overrides:
clone
in classObject
- Returns:
- A new identical attachment to this one
-
free
public void free()- Specified by:
free
in interfaceorg.lwjgl.system.NativeResource
-