|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
OpenGL Region renderer.
More...
Classes | |
| interface | GLCallback |
May be passed to RegionRenderer ctor, e.g. More... | |
Public Member Functions | |
| final boolean | isInitialized () |
| final Recti | getViewport (final Recti target) |
| Copies the current Rect4i viewport in given target and returns it for chaining. More... | |
| final Recti | getViewport () |
| Borrows the current Rect4i viewport w/o copying. More... | |
| final int | getWidth () |
| Return width of current viewport. More... | |
| final int | getHeight () |
| Return height of current viewport. More... | |
| final boolean | isVBOSupported () |
| final void | init (final GL2ES2 gl) throws GLException |
| Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext if not initialized yet. More... | |
| final void | destroy (final GL2ES2 gl) |
Deletes all ShaderPrograms and nullifies its references including RenderState#destroy(GL2ES2). More... | |
| final RenderState | getRenderState () |
Return the RenderState composition. More... | |
| final PMVMatrix4f | getMatrix () |
Borrow the current PMVMatrix4f. More... | |
| final float | getWeight () |
| final void | setWeight (final float v) |
| final Vec4f | getColorStatic (final Vec4f rgbaColor) |
| final void | setColorStatic (final Vec4f rgbaColor) |
| final void | setColorStatic (final float r, final float g, final float b, final float a) |
| final int | setAAQuality (final int v) |
Sets pass2 AA-quality rendering value clipped to the range [Region#MIN_AA_QUALITY..Region#MAX_AA_QUALITY] for Graph Region AA render-modes: Region#VBAA_RENDERING_BIT. More... | |
| final int | getAAQuality () |
Returns pass2 AA-quality rendering value for Graph Region AA render-modes: Region#VBAA_RENDERING_BIT. More... | |
| final int | setSampleCount (final int v) |
Sets pass2 AA sample count clipped to the range [Region#MIN_AA_SAMPLE_COUNT..Region#MAX_AA_SAMPLE_COUNT] for Graph Region AA render-modes: VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT. More... | |
| final int | getSampleCount () |
Returns pass2 AA sample count for Graph Region AA render-modes: VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT. More... | |
| final void | setClipFrustum (final Frustum clipFrustum) |
Set the optional clipping Frustum, which shall be pre-multiplied with the Mv-matrix or null to disable. More... | |
| final Frustum | getClipFrustum () |
Returns the optional Mv-premultiplied clipping Frustum or null if unused. More... | |
| final boolean | hintBitsSet (final int mask) |
| final void | setHintBits (final int mask) |
| final void | clearHintBits (final int mask) |
| final void | enable (final GL2ES2 gl, final boolean enable) |
Enabling or disabling the RenderState's current shader program. More... | |
| final void | enable (final GL2ES2 gl, final boolean enable, final GLCallback enableCB, final GLCallback disableCB) |
Same as enable(GL2ES2, boolean) but allowing to force GLCallbacks off. More... | |
| final void | reshapeNotify (final int x, final int y, final int width, final int height) |
| No PMVMatrix4f operation is performed here. More... | |
| final void | reshapePerspective (final float angle_rad, final int width, final int height, final float near, final float far) |
Perspective projection, method also calls reshapeNotify(int, int, int, int). More... | |
| final void | reshapeOrtho (final int width, final int height, final float near, final float far) |
Orthogonal projection, method also calls reshapeNotify(int, int, int, int). More... | |
| final boolean | useShaderProgram (final GL2ES2 gl, final int renderModes, final boolean pass1, final TextureSequence colorTexSeq) |
Generate, selects and caches the desired Curve-Graph ShaderProgram according to the given parameters. More... | |
Static Public Member Functions | |
| static RegionRenderer | create () |
Create a hardware accelerated RegionRenderer including its RenderState composition. More... | |
| static RegionRenderer | create (final GLCallback enableCallback, final GLCallback disableCallback) |
Create a hardware accelerated RegionRenderer including its RenderState composition. More... | |
| static RegionRenderer | create (final PMVMatrix4f sharedPMVMatrix, final GLCallback enableCallback, final GLCallback disableCallback) |
Create a hardware accelerated RegionRenderer including its RenderState composition. More... | |
Static Public Attributes | |
| static final GLCallback | defaultBlendEnable |
Default GL#GL_BLEND enable GLCallback, turning-off depth writing via GL#glDepthMask(boolean) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set and turning-on the GL#GL_BLEND state. More... | |
| static final GLCallback | defaultBlendDisable |
Default GL#GL_BLEND disable GLCallback, simply turning-off the GL#GL_BLEND state and turning-on depth writing via GL#glDepthMask(boolean) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set. More... | |
Protected Member Functions | |
| RegionRenderer (final GLCallback enableCallback, final GLCallback disableCallback) | |
| RegionRenderer (final PMVMatrix4f sharedPMVMatrix, final GLCallback enableCallback, final GLCallback disableCallback) | |
Static Protected Attributes | |
| static final boolean | DEBUG = Region.DEBUG |
| static final boolean | DEBUG_ALL_EVENT = Region.DEBUG_ALL_EVENT |
| static final boolean | DEBUG_INSTANCE = Region.DEBUG_INSTANCE |
OpenGL Region renderer.
All Region rendering operations utilize a RegionRenderer.
The RegionRenderer owns its RenderState, a composition.
The RegionRenderer manages and own all used ShaderPrograms, a composition.
At its destruction, all ShaderPrograms and its RenderState will be destroyed and released.
Definition at line 68 of file RegionRenderer.java.
|
protected |
|
protected |
Definition at line 227 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.clearHintBits | ( | final int | mask | ) |
|
static |
Create a hardware accelerated RegionRenderer including its RenderState composition.
The optional GLCallbacks enableCallback and disableCallback maybe used to issue certain tasks at enable(GL2ES2, boolean).
For example, instances defaultBlendEnable and defaultBlendDisable can be utilized to enable and disable GL#GL_BLEND.
Definition at line 152 of file RegionRenderer.java.
|
static |
Create a hardware accelerated RegionRenderer including its RenderState composition.
The optional GLCallbacks enableCallback and disableCallback maybe used to issue certain tasks at enable(GL2ES2, boolean).
For example, instances defaultBlendEnable and defaultBlendDisable can be utilized to enable and disable GL#GL_BLEND.
| enableCallback | optional GLCallback, if not null will be issued at init(gl) and enable(gl, true). |
| disableCallback | optional GLCallback, if not null will be issued at enable(gl, false). |
Definition at line 171 of file RegionRenderer.java.
|
static |
Create a hardware accelerated RegionRenderer including its RenderState composition.
The optional GLCallbacks enableCallback and disableCallback maybe used to issue certain tasks at enable(GL2ES2, boolean).
For example, instances defaultBlendEnable and defaultBlendDisable can be utilized to enable and disable GL#GL_BLEND.
| sharedPMVMatrix | optional shared PMVMatrix4f to be used for the RenderState composition. |
| enableCallback | optional GLCallback, if not null will be issued at init(gl) and enable(gl, true). |
| disableCallback | optional GLCallback, if not null will be issued at enable(gl, false). |
Definition at line 191 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.destroy | ( | final GL2ES2 | gl | ) |
Deletes all ShaderPrograms and nullifies its references including RenderState#destroy(GL2ES2).
Definition at line 279 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.enable | ( | final GL2ES2 | gl, |
| final boolean | enable | ||
| ) |
Enabling or disabling the RenderState's current shader program.
useShaderProgram(GL2ES2, int, boolean, TextureSequence) generates, selects and caches the desired Curve-Graph ShaderProgram and sets it current in the RenderState composition.
In case enable and disable GLCallbacks are setup via create(Vertex.Factory<? extends Vertex>, RenderState, GLCallback, GLCallback), they will be called before toggling the shader program.
| gl | current GL object |
| enable | if true enable the current ShaderProgram, otherwise disable. |
Definition at line 364 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.enable | ( | final GL2ES2 | gl, |
| final boolean | enable, | ||
| final GLCallback | enableCB, | ||
| final GLCallback | disableCB | ||
| ) |
Same as enable(GL2ES2, boolean) but allowing to force GLCallbacks off.
| gl | current GL object |
| enable | if true enable the current ShaderProgram, otherwise disable. |
| enableCB | explicit GLCallback for enable |
| disableCB | explicit GLCallback for disable |
Definition at line 376 of file RegionRenderer.java.
| final int com.jogamp.graph.curve.opengl.RegionRenderer.getAAQuality | ( | ) |
Returns pass2 AA-quality rendering value for Graph Region AA render-modes: Region#VBAA_RENDERING_BIT.
Definition at line 327 of file RegionRenderer.java.
| final Frustum com.jogamp.graph.curve.opengl.RegionRenderer.getClipFrustum | ( | ) |
Returns the optional Mv-premultiplied clipping Frustum or null if unused.
Definition at line 337 of file RegionRenderer.java.
| final int com.jogamp.graph.curve.opengl.RegionRenderer.getHeight | ( | ) |
Return height of current viewport.
Definition at line 219 of file RegionRenderer.java.
| final PMVMatrix4f com.jogamp.graph.curve.opengl.RegionRenderer.getMatrix | ( | ) |
Borrow the current PMVMatrix4f.
Definition at line 312 of file RegionRenderer.java.
| final RenderState com.jogamp.graph.curve.opengl.RegionRenderer.getRenderState | ( | ) |
Return the RenderState composition.
Definition at line 305 of file RegionRenderer.java.
| final int com.jogamp.graph.curve.opengl.RegionRenderer.getSampleCount | ( | ) |
Returns pass2 AA sample count for Graph Region AA render-modes: VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT.
Definition at line 332 of file RegionRenderer.java.
| final Recti com.jogamp.graph.curve.opengl.RegionRenderer.getViewport | ( | ) |
Borrows the current Rect4i viewport w/o copying.
Definition at line 213 of file RegionRenderer.java.
Copies the current Rect4i viewport in given target and returns it for chaining.
Definition at line 208 of file RegionRenderer.java.
| final float com.jogamp.graph.curve.opengl.RegionRenderer.getWeight | ( | ) |
Definition at line 314 of file RegionRenderer.java.
| final int com.jogamp.graph.curve.opengl.RegionRenderer.getWidth | ( | ) |
Return width of current viewport.
Definition at line 217 of file RegionRenderer.java.
| final boolean com.jogamp.graph.curve.opengl.RegionRenderer.hintBitsSet | ( | final int | mask | ) |
Definition at line 339 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.init | ( | final GL2ES2 | gl | ) | throws GLException |
Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext if not initialized yet.
Disables the renderer via enable(GL2ES2, boolean) to remove any side-effects, ie ShaderState incl. shader program.
Shall be called once before at initialization before a draw() method, e.g. RegionRenderer#draw(GL2ES2, Region)
| gl | referencing the current GLContext to which the ShaderState is bound to |
| GLException | if initialization failed |
Definition at line 253 of file RegionRenderer.java.
| final boolean com.jogamp.graph.curve.opengl.RegionRenderer.isInitialized | ( | ) |
| final boolean com.jogamp.graph.curve.opengl.RegionRenderer.isVBOSupported | ( | ) |
| final void com.jogamp.graph.curve.opengl.RegionRenderer.reshapeNotify | ( | final int | x, |
| final int | y, | ||
| final int | width, | ||
| final int | height | ||
| ) |
No PMVMatrix4f operation is performed here.
Definition at line 395 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.reshapeOrtho | ( | final int | width, |
| final int | height, | ||
| final float | near, | ||
| final float | far | ||
| ) |
Orthogonal projection, method also calls reshapeNotify(int, int, int, int).
| width | viewport width |
| height | viewport height |
| near | projection z-near |
| far | projection z-far |
Definition at line 422 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.reshapePerspective | ( | final float | angle_rad, |
| final int | width, | ||
| final int | height, | ||
| final float | near, | ||
| final float | far | ||
| ) |
Perspective projection, method also calls reshapeNotify(int, int, int, int).
| angle_rad | perspective angle in radians |
| width | viewport width |
| height | viewport height |
| near | projection z-near |
| far | projection z-far |
Definition at line 407 of file RegionRenderer.java.
| final int com.jogamp.graph.curve.opengl.RegionRenderer.setAAQuality | ( | final int | v | ) |
Sets pass2 AA-quality rendering value clipped to the range [Region#MIN_AA_QUALITY..Region#MAX_AA_QUALITY] for Graph Region AA render-modes: Region#VBAA_RENDERING_BIT.
Definition at line 325 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.setClipFrustum | ( | final Frustum | clipFrustum | ) |
Set the optional clipping Frustum, which shall be pre-multiplied with the Mv-matrix or null to disable.
Definition at line 335 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.setColorStatic | ( | final float | r, |
| final float | g, | ||
| final float | b, | ||
| final float | a | ||
| ) |
| final void com.jogamp.graph.curve.opengl.RegionRenderer.setColorStatic | ( | final Vec4f | rgbaColor | ) |
Definition at line 320 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.setHintBits | ( | final int | mask | ) |
Definition at line 341 of file RegionRenderer.java.
| final int com.jogamp.graph.curve.opengl.RegionRenderer.setSampleCount | ( | final int | v | ) |
Sets pass2 AA sample count clipped to the range [Region#MIN_AA_SAMPLE_COUNT..Region#MAX_AA_SAMPLE_COUNT] for Graph Region AA render-modes: VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT.
Definition at line 330 of file RegionRenderer.java.
| final void com.jogamp.graph.curve.opengl.RegionRenderer.setWeight | ( | final float | v | ) |
Definition at line 316 of file RegionRenderer.java.
| final boolean com.jogamp.graph.curve.opengl.RegionRenderer.useShaderProgram | ( | final GL2ES2 | gl, |
| final int | renderModes, | ||
| final boolean | pass1, | ||
| final TextureSequence | colorTexSeq | ||
| ) |
Generate, selects and caches the desired Curve-Graph ShaderProgram according to the given parameters.
The newly generated or cached ShaderProgram is set current in the RenderState composition and can be retrieved via RenderState#getShaderProgram().
| gl | |
| renderModes | |
| pass1 | |
| colorTexSeq |
Definition at line 662 of file RegionRenderer.java.
|
staticprotected |
Definition at line 69 of file RegionRenderer.java.
|
staticprotected |
Definition at line 70 of file RegionRenderer.java.
|
staticprotected |
Definition at line 71 of file RegionRenderer.java.
|
static |
Default GL#GL_BLEND disable GLCallback, simply turning-off the GL#GL_BLEND state and turning-on depth writing via GL#glDepthMask(boolean) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set.
Implementation also clears RenderState's blending bit-hint.
Definition at line 128 of file RegionRenderer.java.
|
static |
Default GL#GL_BLEND enable GLCallback, turning-off depth writing via GL#glDepthMask(boolean) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set and turning-on the GL#GL_BLEND state.
Implementation also sets RenderState's blending bit-hint, which will cause GLRegion's draw-method to set the proper blend-function and the clear-color to transparent-black in case of multipass FBO rendering.
Definition at line 104 of file RegionRenderer.java.