Package foundry.veil.render.framebuffer
Class AdvancedFboRenderAttachment
java.lang.Object
foundry.veil.render.framebuffer.AdvancedFboRenderAttachment
- All Implemented Interfaces:
AdvancedFboAttachment,AutoCloseable,org.lwjgl.system.NativeResource
An attachment for an
AdvancedFboImpl that represents a depth render buffer.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAdvancedFboRenderAttachment(int attachmentType, int attachmentFormat, int width, int height, int samples) Creates a new attachment that adds a renderbuffer. -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(int target, int attachment) Attaches this attachment to the provided target under the specified attachment id.voidBinds this attachment.booleanvoidcreate()Creates the attachment and initializes it with the default properties.@NotNull AdvancedFboAttachmentvoidfree()intReturns the OpenGL attachment point.intintintgetId()int@Nullable StringgetName()intgetWidth()voidUnbinds this attachment.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 between1andMAX_SAMPLES
-
-
Method Details
-
create
public void create()Description copied from interface:AdvancedFboAttachmentCreates the attachment and initializes it with the default properties.- Specified by:
createin interfaceAdvancedFboAttachment
-
attach
public void attach(int target, int attachment) Description copied from interface:AdvancedFboAttachmentAttaches this attachment to the provided target under the specified attachment id.- Specified by:
attachin interfaceAdvancedFboAttachment- Parameters:
target- The target to attach this attachment toattachment- The attachment to attach this attachment under
-
bindAttachment
public void bindAttachment()Description copied from interface:AdvancedFboAttachmentBinds this attachment.- Specified by:
bindAttachmentin interfaceAdvancedFboAttachment
-
unbindAttachment
public void unbindAttachment()Description copied from interface:AdvancedFboAttachmentUnbinds this attachment.- Specified by:
unbindAttachmentin interfaceAdvancedFboAttachment
-
getId
public int getId()- Returns:
- The OpenGL renderbuffer id of this attachment
-
getAttachmentType
public int getAttachmentType()Description copied from interface:AdvancedFboAttachmentReturns the OpenGL attachment point. One of:
All possible OpenGL attachment points COLOR_ATTACHMENT0COLOR_ATTACHMENT1COLOR_ATTACHMENT2COLOR_ATTACHMENT3COLOR_ATTACHMENT4COLOR_ATTACHMENT5COLOR_ATTACHMENT6COLOR_ATTACHMENT7COLOR_ATTACHMENT8COLOR_ATTACHMENT9COLOR_ATTACHMENT10COLOR_ATTACHMENT11COLOR_ATTACHMENT12COLOR_ATTACHMENT13COLOR_ATTACHMENT14COLOR_ATTACHMENT15COLOR_ATTACHMENT16COLOR_ATTACHMENT17COLOR_ATTACHMENT18COLOR_ATTACHMENT19COLOR_ATTACHMENT20COLOR_ATTACHMENT21COLOR_ATTACHMENT22COLOR_ATTACHMENT23COLOR_ATTACHMENT24COLOR_ATTACHMENT25COLOR_ATTACHMENT26COLOR_ATTACHMENT27COLOR_ATTACHMENT28COLOR_ATTACHMENT29COLOR_ATTACHMENT30COLOR_ATTACHMENT31DEPTH_ATTACHMENTSTENCIL_ATTACHMENTDEPTH_STENCIL_ATTACHMENT- Specified by:
getAttachmentTypein interfaceAdvancedFboAttachment- Returns:
- OpenGL attachment point
-
getFormat
public int getFormat()- Specified by:
getFormatin interfaceAdvancedFboAttachment- Returns:
- The OpenGL format for this attachment
-
getWidth
public int getWidth()- Specified by:
getWidthin interfaceAdvancedFboAttachment- Returns:
- The width of this attachment
-
getHeight
public int getHeight()- Specified by:
getHeightin interfaceAdvancedFboAttachment- Returns:
- The height of this attachment
-
getLevels
public int getLevels()- Specified by:
getLevelsin interfaceAdvancedFboAttachment- Returns:
- Texture targets return mipmaps and render targets return samples.
-
canSample
public boolean canSample()- Specified by:
canSamplein interfaceAdvancedFboAttachment- Returns:
- Whether this attachment can be read from
-
getName
- Specified by:
getNamein interfaceAdvancedFboAttachment- Returns:
- The custom name of this attachment or
nullto useDiffuseSampler#
-
createCopy
- Specified by:
createCopyin interfaceAdvancedFboAttachment- Returns:
- A new identical attachment to this one
-
free
public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-