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
ConstructorDescriptionAdvancedFboTextureAttachment
(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 TypeMethodDescriptionvoid
attach
(int attachment) Attaches this attachment to the provided target under the specified attachment point.void
Binds this attachment.boolean
clone()
void
create()
Creates the attachment and initializes it with the default properties.void
free()
int
Returns the OpenGL attachment point.int
int
@Nullable String
getName()
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 onformat
- The format of the image datatexelFormat
- The format of the image texel datadataType
- The type of data to store in the texturewidth
- The width of the attachmentheight
- The height of the attachmentmipmapLevels
- The number of mipmaps levels to havename
- 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 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
-
clone
- Specified by:
clone
in interfaceAdvancedFboAttachment
- Overrides:
clone
in classObject
- Returns:
- A new identical attachment to this one
-
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
-
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#
-
free
public void free()- Specified by:
free
in interfaceorg.lwjgl.system.NativeResource
-
load
public void load(net.minecraft.server.packs.resources.ResourceManager manager) - Specified by:
load
in classnet.minecraft.client.renderer.texture.AbstractTexture
-