Top Description Inners Fields Constructors Methods
com.jogamp.graph.curve.opengl

public Class RegionRenderer

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.Iterator, com.jogamp.opengl.GL, .GL2ES2, .GLES2, .GLException, .GLExtensions, com.jogamp.opengl.fixedfunc.GLMatrixFunc, jogamp.graph.curve.opengl.shader.AttributeNames, .UniformNames, com.jogamp.opengl.util.glsl.ShaderCode, .ShaderProgram, com.jogamp.opengl.util.texture.TextureSequence, com.jogamp.opengl.util.PMVMatrix, com.jogamp.common.os.Platform, com.jogamp.common.util.IntObjectHashMap, com.jogamp.graph.curve.Region

OpenGL Region renderer

All OpenGL related operations regarding Regions are passed through an instance of this class.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
private static enum

Field Summary

Modifier and TypeField and Description
protected static final boolean
protected static final boolean
public static final RegionRenderer.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.

public static final RegionRenderer.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.

private final RegionRenderer.GLCallback
private final RegionRenderer.GLCallback
private static final String
private static final String
private static String
private static String
private static String
private static String
private static String
private static final int
private boolean
private final RenderState
private static final String
private static final String
private final IntObjectHashMap
private static final int
private boolean
private int
private int

Constructor Summary

AccessConstructor and Description
protected
RegionRenderer(final RenderState
the used RenderState
rs
,
final RegionRenderer.GLCallback enableCallback, final RegionRenderer.GLCallback disableCallback)

Method Summary

Modifier and TypeMethod and Description
public static RegionRenderer

Returns:

an instance of Region Renderer
create
(final RenderState
the used RenderState
rs
,
final RegionRenderer.GLCallback
optional GLCallback, if not null will be issued at init(gl) and enable(gl, true).
enableCallback
,
final RegionRenderer.GLCallback
optional GLCallback, if not null will be issued at enable(gl, false).
disableCallback
)

Create a Hardware accelerated Region Renderer.

public final void
destroy(final GL2ES2 gl)

public final void
enable(final GL2ES2 gl, final boolean enable)

Enabling or disabling the RenderState's shader program.

private final String
public final int
getHeight()

Return height of current viewport

public final PMVMatrix
public final RenderState
private String
public final int
getWidth()

Return width of current viewport

public final void
init(final GL2ES2
referencing the current GLContext to which the ShaderState is bound to
gl
,
final int renderModes)

Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext if not initialized yet.

public final boolean
public final boolean
public final void
reshapeNotify(final int width, final int height)

No PMVMatrix operation is performed here.

public final void
reshapeOrtho(final int width, final int height, final float near, final float far)

public final void
reshapePerspective(final float angle, final int width, final int height, final float near, final float far)

public final boolean

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.
useShaderProgram
(final GL2ES2 gl, final int renderModes, final boolean pass1, final int quality, final int sampleCount, final TextureSequence colorTexSeq)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEBUGback to summary
protected static final boolean DEBUG
DEBUG_INSTANCEback to summary
protected static final boolean DEBUG_INSTANCE
defaultBlendDisableback to summary
public static final RegionRenderer.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.

Implementation also clears RenderState's blending bit-hint.

See Also
create(RenderState, GLCallback, GLCallback), enable(GL2ES2, boolean)
defaultBlendEnableback to summary
public static final RegionRenderer.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.

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(RenderState, GLCallback, GLCallback), enable(GL2ES2, boolean)
disableCallbackback to summary
private final RegionRenderer.GLCallback disableCallback
enableCallbackback to summary
private final RegionRenderer.GLCallback enableCallback
es2_precision_fpback to summary
private static final String es2_precision_fp
gcuTexture2Dback to summary
private static final String gcuTexture2D
GLSL_CONST_SAMPLE_COUNTback to summary
private static String GLSL_CONST_SAMPLE_COUNT
GLSL_DEF_SAMPLE_COUNTback to summary
private static String GLSL_DEF_SAMPLE_COUNT
GLSL_MAIN_BEGINback to summary
private static String GLSL_MAIN_BEGIN
GLSL_USE_COLOR_CHANNELback to summary
private static String GLSL_USE_COLOR_CHANNEL
GLSL_USE_COLOR_TEXTUREback to summary
private static String GLSL_USE_COLOR_TEXTURE
HIGH_MASKback to summary
private static final int HIGH_MASK
initializedback to summary
private boolean initialized
rsback to summary
private final RenderState rs
SHADER_BIN_SUBback to summary
private static final String SHADER_BIN_SUB
SHADER_SRC_SUBback to summary
private static final String SHADER_SRC_SUB
shaderProgramsback to summary
private final IntObjectHashMap shaderPrograms
TWO_PASS_BITback to summary
private static final int TWO_PASS_BIT
vboSupportedback to summary
private boolean vboSupported
vp_heightback to summary
private int vp_height
vp_widthback to summary
private int vp_width

Constructor Detail

RegionRendererback to summary
protected RegionRenderer(final RenderState rs, final RegionRenderer.GLCallback enableCallback, final RegionRenderer.GLCallback disableCallback)
Parameters
rs:RenderState

the used RenderState

Method Detail

createback to summary
public static RegionRenderer create(final RenderState rs, final RegionRenderer.GLCallback enableCallback, final RegionRenderer.GLCallback disableCallback)

Create a Hardware accelerated Region Renderer.

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
rs:RenderState

the used RenderState

enableCallback:RegionRenderer.GLCallback

optional GLCallback, if not null will be issued at init(gl) and enable(gl, true).

disableCallback:RegionRenderer.GLCallback

optional GLCallback, if not null will be issued at enable(gl, false).

Returns:RegionRenderer

an instance of Region Renderer

See Also
enable(GL2ES2, boolean)
destroyback to summary
public final void destroy(final GL2ES2 gl)
enableback to summary
public final void enable(final GL2ES2 gl, final boolean enable)

Enabling or disabling the RenderState's shader program.

In case enable and disable GLCallbacks are setup via create(RenderState, GLCallback, GLCallback), they will be called before toggling the shader program.

See Also
create(RenderState, GLCallback, GLCallback)
getFragmentShaderPrecisionback to summary
private final String getFragmentShaderPrecision(final GL2ES2 gl)
getHeightback to summary
public final int getHeight()

Return height of current viewport

getMatrixback to summary
public final PMVMatrix getMatrix()
getRenderStateback to summary
public final RenderState getRenderState()
getVersionedShaderNameback to summary
private String getVersionedShaderName()
getWidthback to summary
public final int getWidth()

Return width of current viewport

initback to summary
public final void init(final GL2ES2 gl, final int renderModes) throws GLException

Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext if not initialized yet.

Leaves the renderer enabled, ie ShaderState.

Shall be called by a draw() method, e.g. RegionRenderer#draw(GL2ES2, Region, int)

Parameters
gl:GL2ES2

referencing the current GLContext to which the ShaderState is bound to

Exceptions
GLException:
if initialization failed
isInitializedback to summary
public final boolean isInitialized()
isVBOSupportedback to summary
public final boolean isVBOSupported()
reshapeNotifyback to summary
public final void reshapeNotify(final int width, final int height)

No PMVMatrix operation is performed here. PMVMatrix is marked dirty.

reshapeOrthoback to summary
public final void reshapeOrtho(final int width, final int height, final float near, final float far)
reshapePerspectiveback to summary
public final void reshapePerspective(final float angle, final int width, final int height, final float near, final float far)
useShaderProgramback to summary
public final boolean useShaderProgram(final GL2ES2 gl, final int renderModes, final boolean pass1, final int quality, final int sampleCount, final TextureSequence colorTexSeq)
Returns:boolean

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.

com.jogamp.graph.curve.opengl back to summary

public Interface RegionRenderer.GLCallback


May be passed to RegionRenderer ctor, e.g.

Method Summary

Modifier and TypeMethod and Description
public void
run(GL
a current GL object
gl
,
RegionRenderer
RegionRenderer calling this method.
renderer
)

Method Detail

runback to summary
public void run(GL gl, RegionRenderer renderer)
Parameters
gl:GL

a current GL object

renderer:RegionRenderer

RegionRenderer calling this method.

com.jogamp.graph.curve.opengl back to summary

private final Enum RegionRenderer.ShaderModeSelector1

extends Enum<RegionRenderer.ShaderModeSelector1>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final RegionRenderer.ShaderModeSelector1
PASS1_SIMPLE

Pass-1: Curve Simple

public static final RegionRenderer.ShaderModeSelector1
PASS1_WEIGHT

Pass-1: Curve Varying Weight

public static final RegionRenderer.ShaderModeSelector1
PASS2_MSAA

Pass-2: MSAA

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL0_SAMPLES1

Pass-2: VBAA Flipquad3, 1 sample

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL0_SAMPLES2

Pass-2: VBAA Flipquad3, 2 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL0_SAMPLES4

Pass-2: VBAA Flipquad3, 4 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL0_SAMPLES8

Pass-2: VBAA Flipquad3, 8 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL1_SAMPLES1

Pass-2: VBAA Brute-Force, Odd, 1 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL1_SAMPLES2

Pass-2: VBAA Brute-Force, Even, 2 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL1_SAMPLES3

Pass-2: VBAA Brute-Force, Odd, 3 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL1_SAMPLES4

Pass-2: VBAA Brute-Force, Even, 4 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL1_SAMPLES5

Pass-2: VBAA Brute-Force, Odd, 5 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL1_SAMPLES6

Pass-2: VBAA Brute-Force, Even, 6 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL1_SAMPLES7

Pass-2: VBAA Brute-Force, Odd, 7 samples

public static final RegionRenderer.ShaderModeSelector1
PASS2_VBAA_QUAL1_SAMPLES8

Pass-2: VBAA Brute-Force, Even, 8 samples

public final int
public final String
public final String

Constructor Summary

AccessConstructor and Description
private
ShaderModeSelector1(final String tech, final String sub, final int sampleCount)

Method Summary

Modifier and TypeMethod and Description
public static RegionRenderer.ShaderModeSelector1
selectPass1(final int renderModes)

public static RegionRenderer.ShaderModeSelector1
selectPass2(final int renderModes, final int quality, final int sampleCount)

public static RegionRenderer.ShaderModeSelector1
public static RegionRenderer.ShaderModeSelector1[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

PASS1_SIMPLEback to summary
public static final RegionRenderer.ShaderModeSelector1 PASS1_SIMPLE

Pass-1: Curve Simple

PASS1_WEIGHTback to summary
public static final RegionRenderer.ShaderModeSelector1 PASS1_WEIGHT

Pass-1: Curve Varying Weight

PASS2_MSAAback to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_MSAA

Pass-2: MSAA

PASS2_VBAA_QUAL0_SAMPLES1back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL0_SAMPLES1

Pass-2: VBAA Flipquad3, 1 sample

PASS2_VBAA_QUAL0_SAMPLES2back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL0_SAMPLES2

Pass-2: VBAA Flipquad3, 2 samples

PASS2_VBAA_QUAL0_SAMPLES4back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL0_SAMPLES4

Pass-2: VBAA Flipquad3, 4 samples

PASS2_VBAA_QUAL0_SAMPLES8back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL0_SAMPLES8

Pass-2: VBAA Flipquad3, 8 samples

PASS2_VBAA_QUAL1_SAMPLES1back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL1_SAMPLES1

Pass-2: VBAA Brute-Force, Odd, 1 samples

PASS2_VBAA_QUAL1_SAMPLES2back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL1_SAMPLES2

Pass-2: VBAA Brute-Force, Even, 2 samples

PASS2_VBAA_QUAL1_SAMPLES3back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL1_SAMPLES3

Pass-2: VBAA Brute-Force, Odd, 3 samples

PASS2_VBAA_QUAL1_SAMPLES4back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL1_SAMPLES4

Pass-2: VBAA Brute-Force, Even, 4 samples

PASS2_VBAA_QUAL1_SAMPLES5back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL1_SAMPLES5

Pass-2: VBAA Brute-Force, Odd, 5 samples

PASS2_VBAA_QUAL1_SAMPLES6back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL1_SAMPLES6

Pass-2: VBAA Brute-Force, Even, 6 samples

PASS2_VBAA_QUAL1_SAMPLES7back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL1_SAMPLES7

Pass-2: VBAA Brute-Force, Odd, 7 samples

PASS2_VBAA_QUAL1_SAMPLES8back to summary
public static final RegionRenderer.ShaderModeSelector1 PASS2_VBAA_QUAL1_SAMPLES8

Pass-2: VBAA Brute-Force, Even, 8 samples

sampleCountback to summary
public final int sampleCount
subback to summary
public final String sub
techback to summary
public final String tech

Constructor Detail

ShaderModeSelector1back to summary
private ShaderModeSelector1(final String tech, final String sub, final int sampleCount)

Method Detail

selectPass1back to summary
public static RegionRenderer.ShaderModeSelector1 selectPass1(final int renderModes)
selectPass2back to summary
public static RegionRenderer.ShaderModeSelector1 selectPass2(final int renderModes, final int quality, final int sampleCount)
valueOfback to summary
public static RegionRenderer.ShaderModeSelector1 valueOf(String name)
valuesback to summary
public static RegionRenderer.ShaderModeSelector1[] values()