Class AdvancedFbo.Builder
java.lang.Object
foundry.veil.api.client.render.framebuffer.AdvancedFbo.Builder
- Enclosing interface:
AdvancedFbo
A builder used to attach buffers to an
AdvancedFbo
.- Since:
- 2.4.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttachments
(com.mojang.blaze3d.pipeline.RenderTarget parent) Adds copies of the buffers inside the specified fbo.addAttachments
(AdvancedFbo parent) Adds copies of the buffers inside the specified fbo.addColorBuffer
(AdvancedFboAttachment attachment) Adds the specified color attachment.Adds a color render buffer with the size of the framebuffer and 1 sample.addColorRenderBuffer
(int width, int height) Adds a color render buffer with the specified size and the specified samples.Adds a color texture buffer with the size of the framebuffer andGL_UNSIGNED_BYTE
as the format.addColorTextureBuffer
(int dataType) Adds a color texture buffer with the specified data type.addColorTextureBuffer
(int width, int height) Adds a color texture buffer with the specified size andGL_UNSIGNED_BYTE
as the format.addColorTextureBuffer
(int width, int height, int dataType) Adds a color texture buffer with the specified size and data type.addColorTextureWrapper
(int textureId) Adds the specified texture as a texture attachment.addColorTextureWrapper
(int textureId, int layer) Adds the specified texture as a texture attachment.build
(boolean create) Constructs a newAdvancedFbo
with the specified attachments.setDepthBuffer
(@Nullable AdvancedFboAttachment attachment) Sets the depth buffer to the specified attachment.Sets the depth texture buffer to the size of the framebuffer and 1 sample.setDepthRenderBuffer
(int width, int height) Sets the depth texture buffer to the specified size and the specified samples.Sets the depth texture buffer to the size of the framebuffer andGL_FLOAT
as the format.setDepthTextureBuffer
(int dataType) Sets the depth texture buffer to the size of the framebuffer and specified data type.setDepthTextureBuffer
(int width, int height) Sets the depth texture buffer to the specified size andGL_FLOAT
as the format.setDepthTextureBuffer
(int width, int height, int dataType) Sets the depth texture buffer to the specified size and data type.setDepthTextureWrapper
(int textureId) Adds the specified texture as a texture attachment.setDepthTextureWrapper
(int textureId, int layer) Adds the specified texture as a texture attachment.setFormat
(int format, int internalFormat) Sets the format to use for texture attachments.Sets the format to use for texture attachments.setLinear
(boolean linear) Sets the sampling mode for textures.setMipmaps
(int mipmaps) Sets the number of mipmaps levels to use for texture attachments.Sets the uniform name for textures.setSamples
(int samples) Sets the number of samples to use for render buffer attachments.
-
Constructor Details
-
Builder
public Builder(int width, int height) Creates a new builder of the specified size.- Parameters:
width
- The width of the framebufferheight
- The height of the framebuffer
-
-
Method Details
-
addAttachments
Adds copies of the buffers inside the specified fbo.- Parameters:
parent
- The parent to add the attachments for
-
addAttachments
Adds copies of the buffers inside the specified fbo.- Parameters:
parent
- The parent to add the attachments for
-
setMipmaps
Sets the number of mipmaps levels to use for texture attachments.0
is the default for none.- Parameters:
mipmaps
- The levels to have
-
setSamples
Sets the number of samples to use for render buffer attachments.1
is the default for single sample buffers.- Parameters:
samples
- The samples to have
-
setFormat
Sets the format to use for texture attachments.- Parameters:
format
- The new format to use
-
setFormat
Sets the format to use for texture attachments.GL11.GL_RGBA
is the default.- Parameters:
format
- The new format to useinternalFormat
- The new internal format to use
-
setLinear
Sets the sampling mode for textures.- Parameters:
linear
- Whether linear filtering should be used
-
setName
Sets the uniform name for textures.- Parameters:
name
- The custom name to use for the sampler in shaders
-
addColorBuffer
Adds the specified color attachment.- Parameters:
attachment
- The attachment to add
-
addColorTextureWrapper
Adds the specified texture as a texture attachment.- Parameters:
textureId
- The id of the texture to add
-
addColorTextureWrapper
Adds the specified texture as a texture attachment.- Parameters:
textureId
- The id of the texture to addlayer
- The layer of the texture to use
-
addColorTextureBuffer
Adds a color texture buffer with the size of the framebuffer andGL_UNSIGNED_BYTE
as the format. -
addColorTextureBuffer
Adds a color texture buffer with the specified size andGL_UNSIGNED_BYTE
as the format.- Parameters:
width
- The width of the texture bufferheight
- The height of the texture buffer
-
addColorTextureBuffer
Adds a color texture buffer with the specified data type.- Parameters:
dataType
- The format of the data internally
-
addColorTextureBuffer
Adds a color texture buffer with the specified size and data type.- Parameters:
width
- The width of the texture bufferheight
- The height of the texture bufferdataType
- The format of the data internally
-
addColorRenderBuffer
Adds a color render buffer with the size of the framebuffer and 1 sample.
NOTE: COLOR RENDER BUFFERS CAN ONLY BE COPIED TO OTHER FRAMEBUFFERS
-
addColorRenderBuffer
Adds a color render buffer with the specified size and the specified samples.
NOTE: COLOR RENDER BUFFERS CAN ONLY BE COPIED TO OTHER FRAMEBUFFERS
- Parameters:
width
- The width of the render bufferheight
- The height of the render buffer
-
setDepthBuffer
Sets the depth buffer to the specified attachment.- Parameters:
attachment
- The attachment to add
-
setDepthTextureWrapper
Adds the specified texture as a texture attachment.- Parameters:
textureId
- The id of the texture to add
-
setDepthTextureWrapper
Adds the specified texture as a texture attachment.- Parameters:
textureId
- The id of the texture to addlayer
- The layer of the texture to use
-
setDepthTextureBuffer
Sets the depth texture buffer to the size of the framebuffer andGL_FLOAT
as the format. -
setDepthTextureBuffer
Sets the depth texture buffer to the specified size andGL_FLOAT
as the format.- Parameters:
width
- The width of the texture bufferheight
- The height of the texture buffer
-
setDepthTextureBuffer
Sets the depth texture buffer to the size of the framebuffer and specified data type.- Parameters:
dataType
- The format of the data internally
-
setDepthTextureBuffer
Sets the depth texture buffer to the specified size and data type.- Parameters:
width
- The width of the texture bufferheight
- The height of the texture bufferdataType
- The format of the data internally
-
setDepthRenderBuffer
Sets the depth texture buffer to the size of the framebuffer and 1 sample.
NOTE: DEPTH RENDER BUFFERS CAN ONLY BE COPIED TO OTHER FRAMEBUFFERS
-
setDepthRenderBuffer
Sets the depth texture buffer to the specified size and the specified samples.
NOTE: DEPTH RENDER BUFFERS CAN ONLY BE COPIED TO OTHER FRAMEBUFFERS
- Parameters:
width
- The width of the render bufferheight
- The height of the render buffer
-
build
Constructs a newAdvancedFbo
with the specified attachments.- Parameters:
create
- Whether to immediately create the buffer- Returns:
- A new
AdvancedFbo
with the specified builder properties.
-