|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Core utility class simplifying usage of framebuffer objects (FBO) with all GLProfiles.
More...
Classes | |
| class | Attachment |
| Common super class of all FBO attachments. More... | |
| class | ColorAttachment |
| Color render buffer FBO attachment More... | |
| interface | Colorbuffer |
Generic color buffer FBO attachment, either of type ColorAttachment or TextureAttachment. More... | |
| class | RenderAttachment |
| Other renderbuffer attachment which maybe a colorbuffer, depth or stencil. More... | |
| class | TextureAttachment |
| Texture FBO attachment. More... | |
Public Member Functions | |
| final Colorbuffer | getColorbuffer (final int attachmentPoint) |
Return the Colorbuffer attachment at attachmentPoint if it is attached to this FBO, otherwise null. More... | |
| final int | getColorbufferAttachmentPoint (final Colorbuffer ca) |
Finds the passed Colorbuffer within the valid range of attachment points using reference comparison only. More... | |
| final Colorbuffer | getColorbuffer (final Colorbuffer ca) |
Returns the passed Colorbuffer if it is attached to this FBO, otherwise null. More... | |
| final boolean | hasAttachmentUsingAlpha () |
Returns true if any attached Colorbuffer uses alpha, otherwise false. More... | |
| FBObject () | |
| Creates an uninitialized FBObject instance. More... | |
| void | init (final GL gl, final int newWidth, final int newHeight, final int newSamples) throws IllegalStateException, GLException |
| Initializes this FBO's instance. More... | |
| final boolean | reset (final GL gl, int newWidth, int newHeight, int newSamples) throws GLException, IllegalStateException |
| Resets this FBO's instance. More... | |
| final void | formatToGLCapabilities (final GLCapabilities caps) |
| Writes the internal format of the attachments to the given GLCapabilities object. More... | |
| final int | getStatus () |
| Note that the status may reflect an incomplete state during transition of attachments. More... | |
| final String | getStatusString () |
return the getStatus() as a string. More... | |
| final boolean | isStatusValid () |
| The status may even be valid if incomplete during transition of attachments. More... | |
| final TextureAttachment | attachTexture2D (final GL gl, final int attachmentPoint, final boolean alpha) throws GLException |
Attaches a Colorbuffer, i.e. More... | |
| final TextureAttachment | attachTexture2D (final GL gl, final int attachmentPoint, final boolean alpha, final int magFilter, final int minFilter, final int wrapS, final int wrapT) throws GLException |
Attaches a Colorbuffer, i.e. More... | |
| final TextureAttachment | attachTexture2D (final GL gl, final int attachmentPoint, final int internalFormat, final int dataFormat, final int dataType, final int magFilter, final int minFilter, final int wrapS, final int wrapT) throws GLException |
Attaches a Colorbuffer, i.e. More... | |
| final ColorAttachment | createColorAttachment (final boolean alpha) |
Creates a ColorAttachment, selecting the format automatically. More... | |
| final ColorAttachment | attachColorbuffer (final GL gl, final int attachmentPoint, final boolean alpha) throws GLException |
Attaches a newly created and initialized Colorbuffer, i.e. More... | |
| final ColorAttachment | attachColorbuffer (final GL gl, final int attachmentPoint, final int internalFormat) throws GLException, IllegalArgumentException |
Attaches a newly created and initialized Colorbuffer, i.e. More... | |
| final Colorbuffer | attachColorbuffer (final GL gl, final int attachmentPoint, final Colorbuffer colbuf) throws GLException |
Attaches a Colorbuffer at the given attachment point and initializes it, if not done yet. More... | |
| final void | attachRenderbuffer (final GL gl, final Attachment.Type atype, final int reqBits) throws GLException, IllegalArgumentException |
| Attaches one depth, stencil or packed-depth-stencil buffer to this FBO's instance, selecting the internalFormat automatically. More... | |
| final void | attachRenderbuffer (final GL gl, final int internalFormat) throws GLException, IllegalArgumentException |
Attaches one depth, stencil or packed-depth-stencil buffer to this FBO's instance, depending on the internalFormat. More... | |
| final Colorbuffer | detachColorbuffer (final GL gl, final int attachmentPoint, final boolean dispose) throws IllegalArgumentException |
Detaches a Colorbuffer, i.e. More... | |
| final void | detachRenderbuffer (final GL gl, final Attachment.Type atype, final boolean dispose) throws IllegalArgumentException |
| final boolean | isDepthStencilPackedFormat () |
| final void | detachAll (final GL gl) |
Detaches all ColorAttachments, TextureAttachments and RenderAttachments and disposes them. More... | |
| final void | detachAllColorbuffer (final GL gl) |
Detaches all ColorAttachments and TextureAttachments and disposes them. More... | |
| final void | detachAllTexturebuffer (final GL gl) |
Detaches all TextureAttachments and disposes them. More... | |
| final void | detachAllRenderbuffer (final GL gl) |
| final void | destroy (final GL gl) |
| final boolean | resetSamplingSink (final GL gl) throws GLException |
| Manually validates the MSAA sampling sink, if used. More... | |
| FBObject | setSamplingSink (final FBObject newSamplingSink) throws IllegalStateException, GLException |
| Setting this FBO sampling sink. More... | |
| final void | bind (final GL gl) throws GLException |
| Bind this FBO, i.e. More... | |
| final void | unbind (final GL gl) throws GLException |
| Unbind this FBO, i.e. More... | |
| final void | markUnbound () |
Method simply marks this FBO unbound w/o interfering w/ the bound framebuffer as perfomed by unbind(GL). More... | |
| final boolean | isBound (final GL gl) |
Returns true if framebuffer object is bound via bind(GL), otherwise false. More... | |
| final boolean | isBound () |
Returns true if framebuffer object is bound via bind(GL), otherwise false. More... | |
| final void | syncSamplingSink (final GL gl) |
If multisampling is being used and flagged dirty by a previous call of bind(GL) or after initialization, the msaa-buffers are sampled to it's sink getSamplingTextureSink(). More... | |
| final void | use (final GL gl, final TextureAttachment ta) throws IllegalArgumentException |
Synchronize the sampling sink and bind the given TextureAttachment, if not null. More... | |
| final void | unuse (final GL gl) |
| Unbind texture, ie bind 'non' texture 0. More... | |
| final boolean | hasFullFBOSupport () throws GLException |
| final boolean | supportsRGBA8 () throws GLException |
Returns true if renderbuffer accepts internal format GL#GL_RGB8 and GL#GL_RGBA8, otherwise false. More... | |
| final boolean | supportsDepth (final int bits) throws GLException |
Returns true if GL#GL_DEPTH_COMPONENT16, GL#GL_DEPTH_COMPONENT24 or GL#GL_DEPTH_COMPONENT32 is supported, otherwise false. More... | |
| final boolean | supportsStencil (final int bits) throws GLException |
Returns true if GL#GL_STENCIL_INDEX1, GL#GL_STENCIL_INDEX4, GL#GL_STENCIL_INDEX8 or GL2GL3#GL_STENCIL_INDEX16 is supported, otherwise false. More... | |
| final boolean | supportsPackedDepthStencil () throws GLException |
Returns true if GL#GL_DEPTH24_STENCIL8 is supported, otherwise false. More... | |
| final int | getMaxColorAttachments () throws GLException |
| Returns the maximum number of colorbuffer attachments. More... | |
| final int | getMaxTextureSize () throws GLException |
| final int | getMaxRenderbufferSize () throws GLException |
| final int | getMaxSamples () throws GLException |
| final boolean | isInitialized () |
Returns true if this instance has been initialized with reset(GL, int, int) or reset(GL, int, int, int, boolean), otherwise false More... | |
| final int | getWidth () |
| Returns the width. More... | |
| final int | getHeight () |
| Returns the height. More... | |
| final int | getNumSamples () |
| Returns the number of samples for multisampling (MSAA). More... | |
| final int | getWriteFramebuffer () |
| Returns the framebuffer name to render to. More... | |
| final int | getReadFramebuffer () |
| Returns the framebuffer name to read from. More... | |
| final int | getDefaultDrawBuffer () |
| final int | getDefaultReadBuffer () |
| final int | getColorbufferCount () |
Return the number of attached Colorbuffers. More... | |
| final int | getTextureAttachmentCount () |
Return the number of attached TextureAttachments. More... | |
| final RenderAttachment | getStencilAttachment () |
Return the stencil RenderAttachment attachment, if exist. More... | |
| final RenderAttachment | getDepthAttachment () |
Return the depth RenderAttachment attachment. More... | |
| final FBObject | getSamplingSinkFBO () |
Return the complete multisampling FBObject sink, if using multisampling. More... | |
| final Colorbuffer | getSamplingSink () |
Return the multisampling Colorbuffer sink, if using multisampling. More... | |
| final boolean | isSamplingBufferDirty () |
Returns true if the multisampling colorbuffer (msaa-buffer) has been flagged dirty by a previous call of bind(GL), otherwise false. More... | |
| final boolean | isModified () |
Returns true if size, sample-count or any attachment of this instance or its sampling-sink has been modified since last sync, use, reset or resetSamplingSink. More... | |
| final String | toString () |
Static Public Member Functions | |
| static final TextureAttachment | createColorTextureAttachment (final GL gl, final boolean alpha, final int width, final int height) |
Creates a color TextureAttachment, i.e. More... | |
| static final TextureAttachment | createColorTextureAttachment (final GL gl, final boolean alpha, final int width, final int height, final int magFilter, final int minFilter, final int wrapS, final int wrapT) |
Creates a color TextureAttachment, i.e. More... | |
| static final TextureAttachment | createColorTextureAttachment (final GL gl, final int internalFormat, final int width, final int height, final int magFilter, final int minFilter, final int wrapS, final int wrapT) |
| static final TextureAttachment | createColorTextureAttachment (final int internalFormat, final int width, final int height, final int dataFormat, final int dataType, final int magFilter, final int minFilter, final int wrapS, final int wrapT) |
Creates a color TextureAttachment, i.e. More... | |
| static final String | getStatusString (final int fbStatus) |
| static final ColorAttachment | createColorAttachment (final int internalFormat, final int samples, final int width, final int height) |
Creates a ColorAttachment, selecting the format automatically. More... | |
| static final RenderAttachment | createRenderAttachment (final Type type, final int internalFormat, final int samples, final int width, final int height) |
Static Public Attributes | |
| static final int | DEFAULT_BITS = 0 |
| Request default bit count for depth- or stencil buffer (depth 24 bits, stencil 8 bits), value {@value}. More... | |
| static final int | REQUESTED_BITS = -1 |
Request current context drawable's requested depth- or stencil-bits; value {@value}. More... | |
| static final int | CHOSEN_BITS = -2 |
Request current context drawable's chosen depth- or stencil-bits; value {@value}. More... | |
| static final int | MAXIMUM_BITS = -3 |
| Request maximum bit count for depth- or stencil buffer (depth 32 bits, stencil 16 bits), value {@value}. More... | |
Protected Member Functions | |
| final void | attachRenderbufferImpl (final GL gl, final Attachment.Type atype, final int internalFormat) throws GLException |
Static Protected Attributes | |
| static final boolean | DEBUG |
Core utility class simplifying usage of framebuffer objects (FBO) with all GLProfiles.
Supports on-the-fly reconfiguration of dimension and multisample buffers via reset(GL, int, int, int, boolean) while preserving the Attachment references.
Integrates default read/write framebuffers via GLContext#getDefaultReadFramebuffer() and GLContext#getDefaultReadFramebuffer(), which is being hooked at GL#glBindFramebuffer(int, int) when the default (zero) framebuffer is selected.
FIXME: Implement support for Type#DEPTH_TEXTURE, Type#STENCIL_TEXTURE .
Definition at line 53 of file FBObject.java.
| com.jogamp.opengl.FBObject.FBObject | ( | ) |
Creates an uninitialized FBObject instance.
Call init(GL, int, int, int) .. etc to use it.
Definition at line 954 of file FBObject.java.
| final ColorAttachment com.jogamp.opengl.FBObject.attachColorbuffer | ( | final GL | gl, |
| final int | attachmentPoint, | ||
| final boolean | alpha | ||
| ) | throws GLException |
Attaches a newly created and initialized Colorbuffer, i.e.
a ColorAttachment, at the given attachment point.
The ColorAttachment is created using alpha if true and current sample count and size.
Leaves the FBO bound.
| gl | the current GL context |
| attachmentPoint | the color attachment point ranging from [0..getMaxColorAttachments()-1] |
| alpha | set to true if you request alpha channel, otherwise false; |
| GLException | in case the colorbuffer couldn't be allocated |
Definition at line 1496 of file FBObject.java.
| final Colorbuffer com.jogamp.opengl.FBObject.attachColorbuffer | ( | final GL | gl, |
| final int | attachmentPoint, | ||
| final Colorbuffer | colbuf | ||
| ) | throws GLException |
Attaches a Colorbuffer at the given attachment point and initializes it, if not done yet.
Colorbuffer may be a ColorAttachment or TextureAttachment.
If Colorbuffer is a TextureAttachment and is uninitialized, i.e. it's texture name is zero, a new texture name is generated and setup w/ the texture parameter.
Otherwise, i.e. texture name is not zero, the passed TextureAttachment texA is considered complete and assumed matching this FBO requirement. A GL error may occur is the latter is untrue.
Leaves the FBO bound.
| gl | |
| attachmentPoint | the color attachment point ranging from [0..getMaxColorAttachments()-1] |
| colbuf | the to be attached Colorbuffer |
Colorbuffer instance if bound and configured successfully, otherwise GLException is thrown | GLException | in case the colorbuffer couldn't be allocated or MSAA has been chosen in case of a TextureAttachment |
Definition at line 1546 of file FBObject.java.
| final ColorAttachment com.jogamp.opengl.FBObject.attachColorbuffer | ( | final GL | gl, |
| final int | attachmentPoint, | ||
| final int | internalFormat | ||
| ) | throws GLException, IllegalArgumentException |
Attaches a newly created and initialized Colorbuffer, i.e.
a ColorAttachment, at the given attachment point.
The ColorAttachment is created using the given internalFormat and current sample count and size.
Leaves the FBO bound.
| gl | the current GL context |
| attachmentPoint | the color attachment point ranging from [0..getMaxColorAttachments()-1] |
| internalFormat | usually GL#GL_RGBA4, GL#GL_RGB5_A1, GL#GL_RGB565, GL#GL_RGB8 or GL#GL_RGBA8 |
| GLException | in case the colorbuffer couldn't be allocated |
| IllegalArgumentException | if internalFormat doesn't reflect a colorbuffer |
Definition at line 1516 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.attachRenderbuffer | ( | final GL | gl, |
| final Attachment.Type | atype, | ||
| final int | reqBits | ||
| ) | throws GLException, IllegalArgumentException |
Attaches one depth, stencil or packed-depth-stencil buffer to this FBO's instance, selecting the internalFormat automatically.
Stencil and depth buffer can be attached only once.
In case the bit-count is not supported, the next available one is chosen, i.e. next higher (preferred) or lower bit-count.
Use getDepthAttachment() and/or getStencilAttachment() to retrieve details about the attached buffer. The details cannot be returned, since it's possible 2 buffers are being created, depth and stencil.
Leaves the FBO bound.
| gl | |
| atype | either Type#DEPTH, Type#STENCIL or Type#DEPTH_STENCIL |
| reqBits | desired bits for depth or stencil, may use generic values DEFAULT_BITS, REQUESTED_BITS, CHOSEN_BITS or MAXIMUM_BITS. |
| GLException | in case the renderbuffer couldn't be allocated or one is already attached. |
| IllegalArgumentException |
Definition at line 1691 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.attachRenderbuffer | ( | final GL | gl, |
| final int | internalFormat | ||
| ) | throws GLException, IllegalArgumentException |
Attaches one depth, stencil or packed-depth-stencil buffer to this FBO's instance, depending on the internalFormat.
Stencil and depth buffer can be attached only once.
Use getDepthAttachment() and/or getStencilAttachment() to retrieve details about the attached buffer. The details cannot be returned, since it's possible 2 buffers are being created, depth and stencil.
Leaves the FBO bound.
| gl | the current GL context |
| internalFormat | GL#GL_DEPTH_COMPONENT16, GL#GL_DEPTH_COMPONENT24, GL#GL_DEPTH_COMPONENT32, GL#GL_STENCIL_INDEX1, GL#GL_STENCIL_INDEX4, GL#GL_STENCIL_INDEX8 or GL#GL_DEPTH24_STENCIL8 |
| GLException | in case the renderbuffer couldn't be allocated or one is already attached. |
| IllegalArgumentException |
Definition at line 1766 of file FBObject.java.
|
protected |
Definition at line 1774 of file FBObject.java.
| final TextureAttachment com.jogamp.opengl.FBObject.attachTexture2D | ( | final GL | gl, |
| final int | attachmentPoint, | ||
| final boolean | alpha | ||
| ) | throws GLException |
Attaches a Colorbuffer, i.e.
TextureAttachment, to this FBO's instance at the given attachment point, selecting the texture data type and format automatically.
Using default min/mag filter GL#GL_NEAREST and default wrapS/wrapT GL#GL_CLAMP_TO_EDGE.
Leaves the FBO bound.
| gl | the current GL context |
| attachmentPoint | the color attachment point ranging from [0..getMaxColorAttachments()-1] |
| alpha | set to true if you request alpha channel, otherwise false; |
| GLException | in case the texture colorbuffer couldn't be allocated or MSAA has been chosen |
Definition at line 1387 of file FBObject.java.
| final TextureAttachment com.jogamp.opengl.FBObject.attachTexture2D | ( | final GL | gl, |
| final int | attachmentPoint, | ||
| final boolean | alpha, | ||
| final int | magFilter, | ||
| final int | minFilter, | ||
| final int | wrapS, | ||
| final int | wrapT | ||
| ) | throws GLException |
Attaches a Colorbuffer, i.e.
TextureAttachment, to this FBO's instance at the given attachment point, selecting the texture data type and format automatically.
Leaves the FBO bound.
| gl | the current GL context |
| attachmentPoint | the color attachment point ranging from [0..getMaxColorAttachments()-1] |
| alpha | set to true if you request alpha channel, otherwise false; |
| magFilter | if > 0 value for GL#GL_TEXTURE_MAG_FILTER |
| minFilter | if > 0 value for GL#GL_TEXTURE_MIN_FILTER |
| wrapS | if > 0 value for GL#GL_TEXTURE_WRAP_S |
| wrapT | if > 0 value for GL#GL_TEXTURE_WRAP_T |
| GLException | in case the texture colorbuffer couldn't be allocated or MSAA has been chosen |
Definition at line 1409 of file FBObject.java.
| final TextureAttachment com.jogamp.opengl.FBObject.attachTexture2D | ( | final GL | gl, |
| final int | attachmentPoint, | ||
| final int | internalFormat, | ||
| final int | dataFormat, | ||
| final int | dataType, | ||
| final int | magFilter, | ||
| final int | minFilter, | ||
| final int | wrapS, | ||
| final int | wrapT | ||
| ) | throws GLException |
Attaches a Colorbuffer, i.e.
TextureAttachment, to this FBO's instance at the given attachment point.
Leaves the FBO bound.
| gl | the current GL context |
| attachmentPoint | the color attachment point ranging from [0..getMaxColorAttachments()-1] |
| internalFormat | internalFormat parameter to GL#glTexImage2D(int, int, int, int, int, int, int, int, long) |
| dataFormat | format parameter to GL#glTexImage2D(int, int, int, int, int, int, int, int, long) |
| dataType | type parameter to GL#glTexImage2D(int, int, int, int, int, int, int, int, long) |
| magFilter | if > 0 value for GL#GL_TEXTURE_MAG_FILTER |
| minFilter | if > 0 value for GL#GL_TEXTURE_MIN_FILTER |
| wrapS | if > 0 value for GL#GL_TEXTURE_WRAP_S |
| wrapT | if > 0 value for GL#GL_TEXTURE_WRAP_T |
| GLException | in case the texture colorbuffer couldn't be allocated or MSAA has been chosen |
Definition at line 1432 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.bind | ( | final GL | gl | ) | throws GLException |
Bind this FBO, i.e.
bind write framebuffer to getWriteFramebuffer().
If multisampling is used, it sets the read framebuffer to the sampling sink getWriteFramebuffer().
In case you have attached more than one color buffer, you may want to setup GL2ES3#glDrawBuffers(int, int[], int).
| gl | the current GL context |
| GLException |
Definition at line 2540 of file FBObject.java.
| final ColorAttachment com.jogamp.opengl.FBObject.createColorAttachment | ( | final boolean | alpha | ) |
Creates a ColorAttachment, selecting the format automatically.
For GLES3, sampling-sink Colorbuffer format must be equal w/ the sampling-source Colorbuffer. Implementation aligns w/ createColorTextureAttachment(GLProfile, boolean, int, int, int, int, int, int) and is enforced via sampleSinkExFormatMismatch(GL).
| alpha | set to true if you request alpha channel, otherwise false; |
Definition at line 1450 of file FBObject.java.
|
static |
Creates a ColorAttachment, selecting the format automatically.
For GLES3, sampling-sink Colorbuffer format must be equal w/ the sampling-source Colorbuffer. Implementation aligns w/ createColorTextureAttachment(GLProfile, boolean, int, int, int, int, int, int) and is enforced via sampleSinkExFormatMismatch(GL).
| alpha | set to true if you request alpha channel, otherwise false; |
Definition at line 1472 of file FBObject.java.
|
static |
Creates a color TextureAttachment, i.e.
type Type#COLOR_TEXTURE, selecting the texture data type and format automatically.
Using default min/mag filter GL#GL_NEAREST and default wrapS/wrapT GL#GL_CLAMP_TO_EDGE.
| gl | the used GLContext's GL object |
| alpha | set to true if you request alpha channel, otherwise false; |
| width | texture width |
| height | texture height |
TextureAttachment Definition at line 669 of file FBObject.java.
|
static |
Creates a color TextureAttachment, i.e.
type Type#COLOR_TEXTURE, selecting the texture data type and format automatically.
For GLES3, sampling-sink format must be equal w/ the sampling-source Colorbuffer, see details below. Implementation aligns w/ createColorAttachment(boolean) and is enforced via sampleSinkExFormatMismatch(GL).
ES3 BlitFramebuffer Requirements: OpenGL ES 3.0.2 p194: 4.3.2 Copying Pixels
If SAMPLE_BUFFERS for the read framebuffer is greater than zero, no copy is performed and an INVALID_OPERATION error is generated if the formats of the read and draw framebuffers are not identical or if the source and destination rectangles are not defined with the same (X0, Y 0) and (X1, Y 1) bounds.
Texture and Renderbuffer format details:
ES2 Base iFormat: OpenGL ES 2.0.24 p66: 3.7.1 Texture Image Specification, Table 3.8 ALPHA, LUMINANCE, LUMINANCE_ALPHA, RGB, RGBA ES3 Base iFormat: OpenGL ES 3.0.2 p125: 3.8.3 Texture Image Specification, Table 3.11 ALPHA, LUMINANCE, LUMINANCE_ALPHA, RGB, RGBA DEPTH_COMPONENT, STENCIL_COMPONENT, RED, RG ES3 Required Texture and Renderbuffer iFormat: OpenGL ES 3.0.2 p126: 3.8.3 Texture Image Specification
| gl | the used GLContext's GL object
|
| alpha | set to true if you request alpha channel, otherwise false;
|
| width | texture width |
| height | texture height |
| magFilter | if > 0 value for GL#GL_TEXTURE_MAG_FILTER
|
| minFilter | if > 0 value for GL#GL_TEXTURE_MIN_FILTER
|
| wrapS | if > 0 value for GL#GL_TEXTURE_WRAP_S
|
| wrapT | if > 0 value for GL#GL_TEXTURE_WRAP_T
|
TextureAttachment
Definition at line 718 of file FBObject.java.
|
static |
|
static |
Creates a color TextureAttachment, i.e.
type Type#COLOR_TEXTURE.
| internalFormat | internalFormat parameter to GL#glTexImage2D(int, int, int, int, int, int, int, int, long) |
| width | texture width |
| height | texture height |
| dataFormat | format parameter to GL#glTexImage2D(int, int, int, int, int, int, int, int, long) |
| dataType | type parameter to GL#glTexImage2D(int, int, int, int, int, int, int, int, long) |
| magFilter | if > 0 value for GL#GL_TEXTURE_MAG_FILTER |
| minFilter | if > 0 value for GL#GL_TEXTURE_MIN_FILTER |
| wrapS | if > 0 value for GL#GL_TEXTURE_WRAP_S |
| wrapT | if > 0 value for GL#GL_TEXTURE_WRAP_T |
TextureAttachment Definition at line 767 of file FBObject.java.
|
static |
Definition at line 1476 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.destroy | ( | final GL | gl | ) |
| gl | the current GL context |
Definition at line 2253 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.detachAll | ( | final GL | gl | ) |
Detaches all ColorAttachments, TextureAttachments and RenderAttachments and disposes them.
Leaves the FBO bound, if initialized!
An attached sampling sink texture will be detached as well, see getSamplingTextureSink().
| gl | the current GL context |
Definition at line 2149 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.detachAllColorbuffer | ( | final GL | gl | ) |
Detaches all ColorAttachments and TextureAttachments and disposes them.
Leaves the FBO bound, if initialized!
An attached sampling sink texture will be detached as well, see getSamplingTextureSink().
| gl | the current GL context |
Definition at line 2165 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.detachAllRenderbuffer | ( | final GL | gl | ) |
| final void com.jogamp.opengl.FBObject.detachAllTexturebuffer | ( | final GL | gl | ) |
Detaches all TextureAttachments and disposes them.
Leaves the FBO bound, if initialized!
An attached sampling sink texture will be detached as well, see getSamplingTextureSink().
| gl | the current GL context |
Definition at line 2180 of file FBObject.java.
| final Colorbuffer com.jogamp.opengl.FBObject.detachColorbuffer | ( | final GL | gl, |
| final int | attachmentPoint, | ||
| final boolean | dispose | ||
| ) | throws IllegalArgumentException |
Detaches a Colorbuffer, i.e.
ColorAttachment or TextureAttachment.
Leaves the FBO bound!
| gl | |
| attachmentPoint | |
| dispose | true if the Colorbuffer shall be disposed |
| IllegalArgumentException |
Definition at line 1857 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.detachRenderbuffer | ( | final GL | gl, |
| final Attachment.Type | atype, | ||
| final boolean | dispose | ||
| ) | throws IllegalArgumentException |
| gl | |
| dispose | true if the Colorbuffer shall be disposed |
| reqAType | Type#DEPTH, Type#DEPTH or Type#DEPTH_STENCIL |
Definition at line 1982 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.formatToGLCapabilities | ( | final GLCapabilities | caps | ) |
Writes the internal format of the attachments to the given GLCapabilities object.
| caps | the destination for format bits |
Definition at line 1240 of file FBObject.java.
| final Colorbuffer com.jogamp.opengl.FBObject.getColorbuffer | ( | final Colorbuffer | ca | ) |
Returns the passed Colorbuffer if it is attached to this FBO, otherwise null.
Implementation compares the reference only.
Note: Slow. Uses getColorbufferAttachmentPoint(Colorbuffer) to determine it's attachment point to be used for getColorbuffer(int)
Definition at line 923 of file FBObject.java.
| final Colorbuffer com.jogamp.opengl.FBObject.getColorbuffer | ( | final int | attachmentPoint | ) |
Return the Colorbuffer attachment at attachmentPoint if it is attached to this FBO, otherwise null.
Definition at line 886 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getColorbufferAttachmentPoint | ( | final Colorbuffer | ca | ) |
Finds the passed Colorbuffer within the valid range of attachment points using reference comparison only.
Note: Slow. Implementation uses a logN array search to save resources, i.e. not using a HashMap.
| ca | the Colorbuffer to look for. |
Colorbuffer could not be found, otherwise [0..getMaxColorAttachments()-1] Definition at line 900 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getColorbufferCount | ( | ) |
Return the number of attached Colorbuffers.
Definition at line 2770 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getDefaultDrawBuffer | ( | ) |
Definition at line 2765 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getDefaultReadBuffer | ( | ) |
Definition at line 2767 of file FBObject.java.
| final RenderAttachment com.jogamp.opengl.FBObject.getDepthAttachment | ( | ) |
Return the depth RenderAttachment attachment.
Maybe share the same Attachment#getName() as getStencilAttachment(), if packed depth-stencil is being used.
Definition at line 2776 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getHeight | ( | ) |
Returns the height.
Definition at line 2755 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getMaxColorAttachments | ( | ) | throws GLException |
Returns the maximum number of colorbuffer attachments.
| GLException | if init(GL) hasn't been called. |
Definition at line 2739 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getMaxRenderbufferSize | ( | ) | throws GLException |
Definition at line 2742 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getMaxSamples | ( | ) | throws GLException |
Definition at line 2745 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getMaxTextureSize | ( | ) | throws GLException |
Definition at line 2741 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getNumSamples | ( | ) |
Returns the number of samples for multisampling (MSAA).
zero if no multisampling is used.
Definition at line 2757 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getReadFramebuffer | ( | ) |
Returns the framebuffer name to read from.
Depending on multisampling, this may be a different framebuffer.
Definition at line 2761 of file FBObject.java.
| final Colorbuffer com.jogamp.opengl.FBObject.getSamplingSink | ( | ) |
Return the multisampling Colorbuffer sink, if using multisampling.
Definition at line 2782 of file FBObject.java.
| final FBObject com.jogamp.opengl.FBObject.getSamplingSinkFBO | ( | ) |
Return the complete multisampling FBObject sink, if using multisampling.
Definition at line 2779 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getStatus | ( | ) |
Note that the status may reflect an incomplete state during transition of attachments.
GL.GL_FRAMEBUFFER_COMPLETE if ok, otherwise return GL FBO error state or -1 Definition at line 1263 of file FBObject.java.
| final String com.jogamp.opengl.FBObject.getStatusString | ( | ) |
return the getStatus() as a string.
Definition at line 1268 of file FBObject.java.
|
static |
Definition at line 1272 of file FBObject.java.
| final RenderAttachment com.jogamp.opengl.FBObject.getStencilAttachment | ( | ) |
Return the stencil RenderAttachment attachment, if exist.
Maybe share the same Attachment#getName() as getDepthAttachment(), if packed depth-stencil is being used.
Definition at line 2774 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getTextureAttachmentCount | ( | ) |
Return the number of attached TextureAttachments.
Definition at line 2772 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getWidth | ( | ) |
Returns the width.
Definition at line 2753 of file FBObject.java.
| final int com.jogamp.opengl.FBObject.getWriteFramebuffer | ( | ) |
Returns the framebuffer name to render to.
Definition at line 2759 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.hasAttachmentUsingAlpha | ( | ) |
Returns true if any attached Colorbuffer uses alpha, otherwise false.
Definition at line 932 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.hasFullFBOSupport | ( | ) | throws GLException |
Definition at line 2690 of file FBObject.java.
| void com.jogamp.opengl.FBObject.init | ( | final GL | gl, |
| final int | newWidth, | ||
| final int | newHeight, | ||
| final int | newSamples | ||
| ) | throws IllegalStateException, GLException |
Initializes this FBO's instance.
The sampling sink is not initializes, allowing manual assignment via setSamplingSink(FBObject) if newSamples > 0.
Leaves the FBO bound
| gl | the current GL context |
| newWidth | the initial width, it's minimum is capped to 1 |
| newHeight | the initial height, it's minimum is capped to 1 |
| newSamples | if > 0, MSAA will be used, otherwise no multisampling. Will be capped to getMaxSamples(). |
| IllegalStateException | if already initialized |
| GLException | in case of an error, i.e. size too big, etc .. |
Definition at line 1008 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.isBound | ( | ) |
Returns true if framebuffer object is bound via bind(GL), otherwise false.
Definition at line 2601 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.isBound | ( | final GL | gl | ) |
Returns true if framebuffer object is bound via bind(GL), otherwise false.
Method verifies the bound state via GL#getBoundFramebuffer(int).
| gl | the current GL context |
Definition at line 2595 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.isDepthStencilPackedFormat | ( | ) |
| final boolean com.jogamp.opengl.FBObject.isInitialized | ( | ) |
Returns true if this instance has been initialized with reset(GL, int, int) or reset(GL, int, int, int, boolean), otherwise false
Definition at line 2751 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.isModified | ( | ) |
Returns true if size, sample-count or any attachment of this instance or its sampling-sink has been modified since last sync, use, reset or resetSamplingSink.
Otherwise method returns false.
Definition at line 2800 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.isSamplingBufferDirty | ( | ) |
Returns true if the multisampling colorbuffer (msaa-buffer) has been flagged dirty by a previous call of bind(GL), otherwise false.
Definition at line 2789 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.isStatusValid | ( | ) |
The status may even be valid if incomplete during transition of attachments.
Definition at line 1313 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.markUnbound | ( | ) |
Method simply marks this FBO unbound w/o interfering w/ the bound framebuffer as perfomed by unbind(GL).
Only use this method if a subsequent unbind(GL), use(GL, TextureAttachment) or bind(GL) follows on any FBO.
Definition at line 2584 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.reset | ( | final GL | gl, |
| int | newWidth, | ||
| int | newHeight, | ||
| int | newSamples | ||
| ) | throws GLException, IllegalStateException |
Resets this FBO's instance.
In case the new parameters are compatible with the current ones no action will be performed and method returns immediately.
Otherwise all attachments will be recreated to match the new given parameters.
resetSamplingSink(GL) is being issued immediately to match the new configuration.
Leaves the FBO bound state untouched
| gl | the current GL context |
| newWidth | the new width, it's minimum is capped to 1 |
| newHeight | the new height, it's minimum is capped to 1 |
| newSamples | if > 0, MSAA will be used, otherwise no multisampling. Will be capped to getMaxSamples(). |
true if this instance has been modified, otherwise false. | IllegalStateException | if not initialized via init(GL, int, int, int). |
| GLException | in case of an error, i.e. size too big, etc .. |
Definition at line 1140 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.resetSamplingSink | ( | final GL | gl | ) | throws GLException |
Manually validates the MSAA sampling sink, if used.
If MSAA is being used and no sampling sink is attached via setSamplingSink(FBObject) a new sampling sink is being created.
If the sampling sink size or attributes differs from the source, its attachments are reset to match the source.
Automatically called by reset(GL, int, int, int, boolean) and syncSamplingSink(GL).
It is recommended to call this method after initializing the FBO and attaching renderbuffer etc for the 1st time if access to sampling sink resources is required.
Leaves the FBO bound state untouched
| gl | the current GL context |
true if this instance has been modified, otherwise false. | GLException | in case of an error, i.e. size too big, etc .. |
Definition at line 2345 of file FBObject.java.
| FBObject com.jogamp.opengl.FBObject.setSamplingSink | ( | final FBObject | newSamplingSink | ) | throws IllegalStateException, GLException |
Setting this FBO sampling sink.
| newSamplingSink | the new and initialized FBO sampling sink to use, or null to remove current sampling sink |
| GLException | if this FBO doesn't use MSAA or the given sink uses MSAA itself |
| IllegalStateException | if the newSamplingSink is not null and not initialized |
Definition at line 2505 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.supportsDepth | ( | final int | bits | ) | throws GLException |
Returns true if GL#GL_DEPTH_COMPONENT16, GL#GL_DEPTH_COMPONENT24 or GL#GL_DEPTH_COMPONENT32 is supported, otherwise false.
| bits | 16, 24 or 32 bits |
| GLException | if init(GL) hasn't been called. |
Definition at line 2703 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.supportsPackedDepthStencil | ( | ) | throws GLException |
Returns true if GL#GL_DEPTH24_STENCIL8 is supported, otherwise false.
| GLException | if init(GL) hasn't been called. |
Definition at line 2733 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.supportsRGBA8 | ( | ) | throws GLException |
Returns true if renderbuffer accepts internal format GL#GL_RGB8 and GL#GL_RGBA8, otherwise false.
| GLException | if init(GL) hasn't been called. |
Definition at line 2696 of file FBObject.java.
| final boolean com.jogamp.opengl.FBObject.supportsStencil | ( | final int | bits | ) | throws GLException |
Returns true if GL#GL_STENCIL_INDEX1, GL#GL_STENCIL_INDEX4, GL#GL_STENCIL_INDEX8 or GL2GL3#GL_STENCIL_INDEX16 is supported, otherwise false.
| bits | 1, 4, 8 or 16 bits |
| GLException | if init(GL) hasn't been called. |
Definition at line 2718 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.syncSamplingSink | ( | final GL | gl | ) |
If multisampling is being used and flagged dirty by a previous call of bind(GL) or after initialization, the msaa-buffers are sampled to it's sink getSamplingTextureSink().
Method also resets the sampling sink configuration via resetSamplingSink(GL) if used and required.
Method is called automatically by use(GL, TextureAttachment).
Method always resets the framebuffer binding to default in the end. If full FBO is supported, sets the read and write framebuffer individually to default after sampling, hence not disturbing an optional operating MSAA FBO, see GLBase#getDefaultReadFramebuffer() and GLBase#getDefaultDrawFramebuffer()
In case you use this FBO w/o the GLFBODrawable and intend to employ glReadPixels(..) you may want to call glBindFramebuffer(GL2ES3#GL_READ_FRAMEBUFFER, getReadFramebuffer());
Leaves the FBO unbound.
| gl | the current GL context |
| ta | TextureAttachment to use, prev. attached w/ attachTexture2D(..) |
| IllegalArgumentException |
Definition at line 2627 of file FBObject.java.
| final String com.jogamp.opengl.FBObject.toString | ( | ) |
| final void com.jogamp.opengl.FBObject.unbind | ( | final GL | gl | ) | throws GLException |
Unbind this FBO, i.e.
bind read and write framebuffer to default, see GLBase#getDefaultDrawFramebuffer().
If full FBO is supported, sets the read and write framebuffer individually to default, hence not disturbing an optional operating MSAA FBO, see GLBase#getDefaultReadFramebuffer() and GLBase#getDefaultDrawFramebuffer()
| gl | the current GL context |
| GLException |
Definition at line 2563 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.unuse | ( | final GL | gl | ) |
Unbind texture, ie bind 'non' texture 0.
Leaves the FBO unbound.
Definition at line 2684 of file FBObject.java.
| final void com.jogamp.opengl.FBObject.use | ( | final GL | gl, |
| final TextureAttachment | ta | ||
| ) | throws IllegalArgumentException |
Synchronize the sampling sink and bind the given TextureAttachment, if not null.
If using a TextureAttachment and multiple texture units, ensure you call GL#glActiveTexture(int) first!
syncSamplingSink(GL) is being called
Leaves the FBO unbound!
| gl | the current GL context |
| ta | TextureAttachment to use, prev. attached w/ attachTexture2D(..), may be null in case no TextureAttachment is used. |
| IllegalArgumentException |
Definition at line 2672 of file FBObject.java.
|
static |
Request current context drawable's chosen depth- or stencil-bits; value {@value}.
Definition at line 1658 of file FBObject.java.
|
staticprotected |
Definition at line 54 of file FBObject.java.
|
static |
Request default bit count for depth- or stencil buffer (depth 24 bits, stencil 8 bits), value {@value}.
Definition at line 1648 of file FBObject.java.
|
static |
Request maximum bit count for depth- or stencil buffer (depth 32 bits, stencil 16 bits), value {@value}.
Definition at line 1661 of file FBObject.java.
|
static |
Request current context drawable's requested depth- or stencil-bits; value {@value}.
Definition at line 1653 of file FBObject.java.