JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.graph.curve.opengl.RegionRenderer Class Reference

OpenGL Region renderer. More...

Collaboration diagram for com.jogamp.graph.curve.opengl.RegionRenderer:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RegionRenderer() [1/2]

com.jogamp.graph.curve.opengl.RegionRenderer.RegionRenderer ( final GLCallback  enableCallback,
final GLCallback  disableCallback 
)
protected

Definition at line 223 of file RegionRenderer.java.

Here is the caller graph for this function:

◆ RegionRenderer() [2/2]

com.jogamp.graph.curve.opengl.RegionRenderer.RegionRenderer ( final PMVMatrix4f  sharedPMVMatrix,
final GLCallback  enableCallback,
final GLCallback  disableCallback 
)
protected

Definition at line 227 of file RegionRenderer.java.

Member Function Documentation

◆ clearHintBits()

final void com.jogamp.graph.curve.opengl.RegionRenderer.clearHintBits ( final int  mask)

Definition at line 343 of file RegionRenderer.java.

Here is the call graph for this function:

◆ create() [1/3]

static RegionRenderer com.jogamp.graph.curve.opengl.RegionRenderer.create ( )
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.

Returns
an instance of Region Renderer
See also
enable(GL2ES2, boolean)

Definition at line 152 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/3]

static RegionRenderer com.jogamp.graph.curve.opengl.RegionRenderer.create ( final GLCallback  enableCallback,
final GLCallback  disableCallback 
)
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.

Parameters
enableCallbackoptional GLCallback, if not null will be issued at init(gl) and enable(gl, true).
disableCallbackoptional GLCallback, if not null will be issued at enable(gl, false).
Returns
an instance of Region Renderer
See also
enable(GL2ES2, boolean)

Definition at line 171 of file RegionRenderer.java.

Here is the call graph for this function:

◆ create() [3/3]

static RegionRenderer com.jogamp.graph.curve.opengl.RegionRenderer.create ( final PMVMatrix4f  sharedPMVMatrix,
final GLCallback  enableCallback,
final GLCallback  disableCallback 
)
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.

Parameters
sharedPMVMatrixoptional shared PMVMatrix4f to be used for the RenderState composition.
enableCallbackoptional GLCallback, if not null will be issued at init(gl) and enable(gl, true).
disableCallbackoptional GLCallback, if not null will be issued at enable(gl, false).
Returns
an instance of Region Renderer
See also
enable(GL2ES2, boolean)

Definition at line 191 of file RegionRenderer.java.

Here is the call graph for this function:

◆ destroy()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable() [1/2]

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.

Parameters
glcurrent GL object
enableif true enable the current ShaderProgram, otherwise disable.
See also
create(Vertex.Factory<? extends Vertex>, RenderState, GLCallback, GLCallback)
useShaderProgram(GL2ES2, int, boolean, TextureSequence)
RenderState::setShaderProgram(GL2ES2, ShaderProgram)
RenderState::getShaderProgram()

Definition at line 364 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable() [2/2]

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.

Parameters
glcurrent GL object
enableif true enable the current ShaderProgram, otherwise disable.
enableCBexplicit GLCallback for enable
disableCBexplicit GLCallback for disable
See also
enable(GL2ES2, boolean)

Definition at line 376 of file RegionRenderer.java.

Here is the call graph for this function:

◆ getAAQuality()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClipFrustum()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getColorStatic()

final Vec4f com.jogamp.graph.curve.opengl.RegionRenderer.getColorStatic ( final Vec4f  rgbaColor)

Definition at line 318 of file RegionRenderer.java.

Here is the call graph for this function:

◆ getHeight()

final int com.jogamp.graph.curve.opengl.RegionRenderer.getHeight ( )

Return height of current viewport.

Definition at line 219 of file RegionRenderer.java.

Here is the caller graph for this function:

◆ getMatrix()

final PMVMatrix4f com.jogamp.graph.curve.opengl.RegionRenderer.getMatrix ( )

Borrow the current PMVMatrix4f.

Definition at line 312 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRenderState()

final RenderState com.jogamp.graph.curve.opengl.RegionRenderer.getRenderState ( )

Return the RenderState composition.

Definition at line 305 of file RegionRenderer.java.

Here is the caller graph for this function:

◆ getSampleCount()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getViewport() [1/2]

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.

◆ getViewport() [2/2]

final Recti com.jogamp.graph.curve.opengl.RegionRenderer.getViewport ( final Recti  target)

Copies the current Rect4i viewport in given target and returns it for chaining.

Definition at line 208 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWeight()

final float com.jogamp.graph.curve.opengl.RegionRenderer.getWeight ( )

Definition at line 314 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWidth()

final int com.jogamp.graph.curve.opengl.RegionRenderer.getWidth ( )

Return width of current viewport.

Definition at line 217 of file RegionRenderer.java.

Here is the caller graph for this function:

◆ hintBitsSet()

final boolean com.jogamp.graph.curve.opengl.RegionRenderer.hintBitsSet ( final int  mask)

Definition at line 339 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

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)

Parameters
glreferencing the current GLContext to which the ShaderState is bound to
Exceptions
GLExceptionif initialization failed

Definition at line 253 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInitialized()

final boolean com.jogamp.graph.curve.opengl.RegionRenderer.isInitialized ( )

Definition at line 205 of file RegionRenderer.java.

Here is the caller graph for this function:

◆ isVBOSupported()

final boolean com.jogamp.graph.curve.opengl.RegionRenderer.isVBOSupported ( )

Definition at line 242 of file RegionRenderer.java.

Here is the caller graph for this function:

◆ reshapeNotify()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reshapeOrtho()

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).

Parameters
widthviewport width
heightviewport height
nearprojection z-near
farprojection z-far

Definition at line 422 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reshapePerspective()

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).

Parameters
angle_radperspective angle in radians
widthviewport width
heightviewport height
nearprojection z-near
farprojection z-far

Definition at line 407 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAAQuality()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setClipFrustum()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColorStatic() [1/2]

final void com.jogamp.graph.curve.opengl.RegionRenderer.setColorStatic ( final float  r,
final float  g,
final float  b,
final float  a 
)

Definition at line 322 of file RegionRenderer.java.

Here is the call graph for this function:

◆ setColorStatic() [2/2]

final void com.jogamp.graph.curve.opengl.RegionRenderer.setColorStatic ( final Vec4f  rgbaColor)

Definition at line 320 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHintBits()

final void com.jogamp.graph.curve.opengl.RegionRenderer.setHintBits ( final int  mask)

Definition at line 341 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSampleCount()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWeight()

final void com.jogamp.graph.curve.opengl.RegionRenderer.setWeight ( final float  v)

Definition at line 316 of file RegionRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ useShaderProgram()

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().

Parameters
gl
renderModes
pass1
colorTexSeq
Returns
true if a new shader program is being used and hence external uniform-data and -location, as well as the attribute-location must be updated, otherwise false.
See also
enable(GL2ES2, boolean)
RenderState::setShaderProgram(GL2ES2, ShaderProgram)
RenderState::getShaderProgram()

Definition at line 662 of file RegionRenderer.java.

Here is the call graph for this function:

Member Data Documentation

◆ DEBUG

final boolean com.jogamp.graph.curve.opengl.RegionRenderer.DEBUG = Region.DEBUG
staticprotected

Definition at line 69 of file RegionRenderer.java.

◆ DEBUG_ALL_EVENT

final boolean com.jogamp.graph.curve.opengl.RegionRenderer.DEBUG_ALL_EVENT = Region.DEBUG_ALL_EVENT
staticprotected

Definition at line 70 of file RegionRenderer.java.

◆ DEBUG_INSTANCE

final boolean com.jogamp.graph.curve.opengl.RegionRenderer.DEBUG_INSTANCE = Region.DEBUG_INSTANCE
staticprotected

Definition at line 71 of file RegionRenderer.java.

◆ defaultBlendDisable

final GLCallback com.jogamp.graph.curve.opengl.RegionRenderer.defaultBlendDisable
static
Initial value:
= new GLCallback() {
@Override
public void run(final GL gl, final RegionRenderer renderer) {
renderer.clearHintBits(RenderState.BITHINT_BLENDING_ENABLED);
gl.glDisable(GL.GL_BLEND);
if( renderer.hintBitsSet(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
gl.glDepthMask(true);
}
}
}
RegionRenderer(final GLCallback enableCallback, final GLCallback disableCallback)

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.

See also
create(GLCallback, GLCallback)
enable(GL2ES2, boolean)

Definition at line 128 of file RegionRenderer.java.

◆ defaultBlendEnable

final GLCallback com.jogamp.graph.curve.opengl.RegionRenderer.defaultBlendEnable
static
Initial value:
= new GLCallback() {
@Override
public void run(final GL gl, final RegionRenderer renderer) {
if( renderer.hintBitsSet(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
gl.glDepthMask(false);
}
gl.glEnable(GL.GL_BLEND);
gl.glBlendEquation(GL.GL_FUNC_ADD);
renderer.setHintBits(RenderState.BITHINT_BLENDING_ENABLED);
}
}
The RenderState is owned by RegionRenderer.
static final int BITHINT_BLENDING_ENABLED
Bitfield hint, if set stating enabled GL#GL_BLEND, otherwise disabled.
static final int GL_BLEND
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_BLEND" with expressio...
Definition: GL.java:704
static final int GL_FUNC_ADD
GL_ARB_imaging, GL_ES_VERSION_2_0, GL_VERSION_1_4, GL_EXT_blend_minmax, GL_OES_blend_subtract Alias f...
Definition: GL.java:428

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.

See also
create(GLCallback, GLCallback)
enable(GL2ES2, boolean)

Definition at line 104 of file RegionRenderer.java.


The documentation for this class was generated from the following file: