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.setAnisotropy
(float anisotropy) Sets the anisotropic filtering value.setCompareFunction
(TextureFilter.CompareFunction compareFunction) Sets the compare function to use.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.setEdgeColor
(int edgeColor) Sets the color to get when sampling the texture out of bounds when usingTextureFilter.Wrap.CLAMP_TO_BORDER
.setFilter
(boolean blur, boolean mipmap) Sets the sampling mode for textures.setFilter
(TextureFilter filter) Sets the texture filtering options to match the specified filter.setFormat
(int format, int internalFormat) Sets the format to use for texture attachments.Sets the format to use for texture attachments.setLevels
(int levels) Sets the number of samples to use for render buffer and texture attachments.Sets the uniform name for textures.setWrap
(int wrapS, int wrapT) Sets the clamping for the X and Y axis on the texture.setWrap
(TextureFilter.Wrap wrapS, TextureFilter.Wrap wrapT) Sets the clamping for the X and Y axis on the texture.setWrapS
(int wrapS) Sets the clamping for the X axis on the texture.setWrapS
(TextureFilter.Wrap wrapS) Sets the clamping for the X axis on the texture.setWrapT
(int wrapT) Sets the clamping for the Y axis on the texture.setWrapT
(TextureFilter.Wrap wrapT) Sets the clamping for the Y axis on the texture.
-
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
-
setLevels
Sets the number of samples to use for render buffer and texture attachments.1
is the default for single sample buffers.- Parameters:
levels
- 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.GL11C.GL_RGBA
is the default.- Parameters:
format
- The new format to useinternalFormat
- The new internal format to use
-
setFilter
Sets the sampling mode for textures.- Parameters:
blur
- Whether linear filtering should be usedmipmap
- Whether the framebuffer has any mipmaps that should be respected
-
setAnisotropy
Sets the anisotropic filtering value. Set toFloat.MAX_VALUE
to set to the platform maximum.- Parameters:
anisotropy
- The value to use. Any value >1 is considered to be enabled
-
setCompareFunction
public AdvancedFbo.Builder setCompareFunction(@Nullable TextureFilter.CompareFunction compareFunction) Sets the compare function to use. Only valid for depth textures.- Parameters:
compareFunction
- The compare function to use
-
setWrapS
Sets the clamping for the X axis on the texture.- Parameters:
wrapS
- The wrap mode
-
setWrapS
Sets the clamping for the X axis on the texture.- Parameters:
wrapS
- The wrap mode
-
setWrapT
Sets the clamping for the Y axis on the texture.- Parameters:
wrapT
- The wrap mode
-
setWrapT
Sets the clamping for the Y axis on the texture.- Parameters:
wrapT
- The wrap mode
-
setWrap
Sets the clamping for the X and Y axis on the texture.- Parameters:
wrapS
- The X wrap modewrapT
- The Y wrap mode
-
setWrap
Sets the clamping for the X and Y axis on the texture.- Parameters:
wrapS
- The X wrap modewrapT
- The Y wrap mode
-
setEdgeColor
Sets the color to get when sampling the texture out of bounds when usingTextureFilter.Wrap.CLAMP_TO_BORDER
.- Parameters:
edgeColor
- The new edge color in ARGB
-
setFilter
Sets the texture filtering options to match the specified filter.- Parameters:
filter
- The texture filtering options
-
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.
-