Class Region
- java.lang.Object
-
- com.jogamp.graph.curve.Region
-
-
Field Summary
Fields Modifier and Type Field Description static intAA_RENDERING_MASK2-pass rendering bit-mask includingMSAA_RENDERING_BITandVBAA_RENDERING_BIT.static intCOLORCHANNEL_RENDERING_BITRendering-Mode bit forRegionto optionally enable a color-channel per vertex.static intCOLORTEXTURE_RENDERING_BITRendering-Mode bit forRegionstatic booleanDEBUGDebug flag for [com.]jogamp.graph.curve.* incl.static booleanDEBUG_ALL_EVENTstatic booleanDEBUG_INSTANCEstatic intDEFAULT_AA_QUALITYDefault pass2 AA-quality rendering 1 for Graph Region AArender-modes:VBAA_RENDERING_BIT.static intDEFAULT_AA_SAMPLE_COUNTDefault pass2 AA sample count 4 for Graph Region AArender-modes:VBAA_RENDERING_BITorMSAA_RENDERING_BIT.static intDEFAULT_TWO_PASS_TEXTURE_UNITstatic intMAX_AA_QUALITYMaximum pass2 AA-quality rendering 1 for Graph Region AArender-modes:VBAA_RENDERING_BIT.static intMAX_AA_SAMPLE_COUNTMaximum pass2 AA sample count 8 for Graph Region AArender-modes:VBAA_RENDERING_BITorMSAA_RENDERING_BIT.static intMIN_AA_QUALITYMinimum pass2 AA-quality rendering 0 for Graph Region AArender-modes:VBAA_RENDERING_BIT.static intMIN_AA_SAMPLE_COUNTMinimum pass2 AA sample count 1 for Graph Region AArender-modes:VBAA_RENDERING_BITorMSAA_RENDERING_BIT.static intMSAA_RENDERING_BITRendering-Mode bit forRegionstatic intNORM_RENDERING_BITRendering-Mode bit forRegionstatic intVARWEIGHT_RENDERING_BITRendering-Mode bit forRegionstatic intVBAA_RENDERING_BITRendering-Mode bit forRegion
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddOutlineShape(OutlineShape shape, com.jogamp.math.geom.plane.AffineTransform t, com.jogamp.math.Vec4f rgbaColor)Add the givenOutlineShapeto this region with the given optionalAffineTransform.voidaddOutlineShapes(List<OutlineShape> shapes, com.jogamp.math.geom.plane.AffineTransform transform, com.jogamp.math.Vec4f rgbaColor)Add the given list ofOutlineShapes to this region with the given optionalAffineTransform.static intclipAAQuality(int v)Returns clipped AA quality value to [MIN_AA_QUALITY..MAX_AA_QUALITY]static intclipAASampleCount(int v)Returns clipped AA sample-count to [MIN_AA_SAMPLE_COUNT..MAX_AA_SAMPLE_COUNT]static int[]countOutlineShape(OutlineShape shape, int[] vertIndexCount)Count required number of vertices and indices adding to given int[2] `vertIndexCount` array.static int[]countOutlineShapes(List<OutlineShape> shapes, int[] vertIndexCount)Count required number of vertices and indices adding to given int[2] `vertIndexCount` array.com.jogamp.math.geom.AABBoxgetBounds()com.jogamp.math.geom.FrustumgetFrustum()intgetRenderModes()Returns bit-field of render modes, seecreate(..).static StringgetRenderModeString(int renderModes)Returns a unique technical description string for renderModes as follows:static StringgetRenderModeString(int renderModes, int graphAAQuality, int graphSampleCount, int fsaaSampleCount)Return a unique technical description string for renderModes and sample counts as follows:abstract booleangrowBuffer(int verticesCount, int indicesCount)Increase the renderer buffers if necessary to add given counts of vertices- and index elements.booleanhasColorChannel()Returns true ifgetRenderModes()has a color channel, i.e.static booleanhasColorChannel(int renderModes)Returns true if render mode has a color channel, i.e.booleanhasColorTexture()Returns true if render mode has a color texture, i.e.static booleanhasColorTexture(int renderModes)Returns true if render mode has a color texture, i.e.booleanhasVariableWeight()Returns true if capable of variable weights, otherwise false.static booleanhasVariableWeight(int renderModes)Returns true if render mode capable of variable weights, i.e.static booleanisGraphAA(int renderModes)Returns true if givenrenderModeshas any ofAA_RENDERING_MASKset.booleanisMSAA()Returns true if capable of two pass rendering - MSAA, otherwise false.static booleanisMSAA(int renderModes)Returns true if givenrenderModeshasMSAA_RENDERING_BITset.booleanisRenderModeSet(int mask)static booleanisRenderModeSet(int renderModes, int mask)booleanisShapeDirty()Returns true if this region's shape are dirty, seemarkShapeDirty().booleanisStateDirty()Returns true if this region's state is dirty, seemarkStateDirty().static booleanisTwoPass(int renderModes)Returns true if givenrenderModeshas any ofAA_RENDERING_MASKset.booleanisVBAA()Returns true if capable of two pass rendering - VBAA, otherwise false.static booleanisVBAA(int renderModes)Returns true if givenrenderModeshasVBAA_RENDERING_BITset.voidmarkShapeDirty()Mark this region's shape dirty, i.e.voidmarkStateDirty()Mark this region's render-state dirty, i.e.PerfCounterCtrlperfCounter()abstract voidprintBufferStats(PrintStream out)Print implementation buffer stats like detailed and total size and capacity in bytes etcabstract booleansetBufferCapacity(int verticesCount, int indicesCount)Set the renderer buffers pre-emptively for given vertices- and index counts.voidsetFrustum(com.jogamp.math.geom.Frustum frustum)SetFrustumculling for#addOutlineShape(OutlineShape, AffineTransform, float[]).static intsetRenderMode(int renderModes, int mask, boolean v)StringtoString()booleanusesI32Idx()Returns true if implementation uses `int32_t` sized indices implying at least aGLProfile.isGL2ES3()alike context.
-
-
-
Field Detail
-
DEBUG_ALL_EVENT
public static final boolean DEBUG_ALL_EVENT
-
DEBUG_INSTANCE
public static final boolean DEBUG_INSTANCE
-
DEBUG
public static final boolean DEBUG
Debug flag for [com.]jogamp.graph.curve.* incl. Region (graph.curve)
-
NORM_RENDERING_BIT
public static final int NORM_RENDERING_BIT
Rendering-Mode bit forRegionOne pass `norm` rendering either using no AA or underlying full-screen AA (fsaa).
This mode-bit is a shader-key.
- See Also:
- Constant Field Values
-
MSAA_RENDERING_BIT
public static final int MSAA_RENDERING_BIT
Rendering-Mode bit forRegionMSAA based Anti-Aliasing, a two pass region rendering, slower and more resource hungry (FBO with sample buffer), but providing fast MSAA in case the whole scene is not rendered with MSAA.
In case sample count is 1, no FBO sample buffer is used but a simple bilinear texture filter.
This mode-bit is a shader-key.
- See Also:
- Constant Field Values
-
VBAA_RENDERING_BIT
public static final int VBAA_RENDERING_BIT
Rendering-Mode bit forRegionView based Anti-Aliasing, a two pass region rendering, slower and more resource hungry (FBO), but AA is perfect. Otherwise the default fast one pass MSAA region rendering is being used.
In case sample count is 1, no FBO supersampling is performed but a simple bilinear texture filter used.
Depending on AA-quality,
MAX_AA_QUALITYdenotes full 4x billinear filtering per sample and0denotes 1x flipquad filtering per sample.This mode-bit is a shader-key.
- See Also:
- Constant Field Values
-
AA_RENDERING_MASK
public static final int AA_RENDERING_MASK
2-pass rendering bit-mask includingMSAA_RENDERING_BITandVBAA_RENDERING_BIT.- See Also:
- Constant Field Values
-
VARWEIGHT_RENDERING_BIT
public static final int VARWEIGHT_RENDERING_BIT
Rendering-Mode bit forRegionUse non uniform weights [0.0 .. 1.9] for curve region rendering. Otherwise the default weight 1.0 for uniform curve region rendering is being applied.
This mode-bit is a shader-key.
- See Also:
- Constant Field Values
-
COLORCHANNEL_RENDERING_BIT
public static final int COLORCHANNEL_RENDERING_BIT
Rendering-Mode bit forRegionto optionally enable a color-channel per vertex.If set, a color channel attribute per vertex is added to the stream via
#addOutlineShape(OutlineShape, AffineTransform, float[]), otherwisestatic colorcan being used for a monotonic color.This mode-bit is a shader-key.
- See Also:
getRenderModes(),hasColorChannel(),#addOutlineShape(OutlineShape, AffineTransform, float[]),com.jogamp.graph.curve.opengl.RegionRenderer#setColorStatic(com.jogamp.opengl.GL2ES2, float, float, float, float), Constant Field Values
-
COLORTEXTURE_RENDERING_BIT
public static final int COLORTEXTURE_RENDERING_BIT
Rendering-Mode bit forRegionIf set, a color texture is used to determine the color via {#link TextureSequence} passed to implementation, e.g. GLRegion.
This mode-bit is a shader-key.
-
MIN_AA_QUALITY
public static final int MIN_AA_QUALITY
Minimum pass2 AA-quality rendering 0 for Graph Region AArender-modes:VBAA_RENDERING_BIT.- See Also:
- Constant Field Values
-
MAX_AA_QUALITY
public static final int MAX_AA_QUALITY
Maximum pass2 AA-quality rendering 1 for Graph Region AArender-modes:VBAA_RENDERING_BIT.- See Also:
- Constant Field Values
-
DEFAULT_AA_QUALITY
public static final int DEFAULT_AA_QUALITY
Default pass2 AA-quality rendering 1 for Graph Region AArender-modes:VBAA_RENDERING_BIT.- See Also:
- Constant Field Values
-
MIN_AA_SAMPLE_COUNT
public static final int MIN_AA_SAMPLE_COUNT
Minimum pass2 AA sample count 1 for Graph Region AArender-modes:VBAA_RENDERING_BITorMSAA_RENDERING_BIT.- See Also:
- Constant Field Values
-
MAX_AA_SAMPLE_COUNT
public static final int MAX_AA_SAMPLE_COUNT
Maximum pass2 AA sample count 8 for Graph Region AArender-modes:VBAA_RENDERING_BITorMSAA_RENDERING_BIT.- See Also:
- Constant Field Values
-
DEFAULT_AA_SAMPLE_COUNT
public static final int DEFAULT_AA_SAMPLE_COUNT
Default pass2 AA sample count 4 for Graph Region AArender-modes:VBAA_RENDERING_BITorMSAA_RENDERING_BIT.- See Also:
- Constant Field Values
-
DEFAULT_TWO_PASS_TEXTURE_UNIT
public static final int DEFAULT_TWO_PASS_TEXTURE_UNIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
clipAAQuality
public static final int clipAAQuality(int v)
Returns clipped AA quality value to [MIN_AA_QUALITY..MAX_AA_QUALITY]
-
clipAASampleCount
public static final int clipAASampleCount(int v)
Returns clipped AA sample-count to [MIN_AA_SAMPLE_COUNT..MAX_AA_SAMPLE_COUNT]
-
isRenderModeSet
public static final boolean isRenderModeSet(int renderModes, int mask)
-
setRenderMode
public static final int setRenderMode(int renderModes, int mask, boolean v)
-
isVBAA
public static boolean isVBAA(int renderModes)
Returns true if givenrenderModeshasVBAA_RENDERING_BITset.
-
isMSAA
public static boolean isMSAA(int renderModes)
Returns true if givenrenderModeshasMSAA_RENDERING_BITset.
-
isGraphAA
public static boolean isGraphAA(int renderModes)
Returns true if givenrenderModeshas any ofAA_RENDERING_MASKset.
-
isTwoPass
public static boolean isTwoPass(int renderModes)
Returns true if givenrenderModeshas any ofAA_RENDERING_MASKset.
-
hasVariableWeight
public static boolean hasVariableWeight(int renderModes)
Returns true if render mode capable of variable weights, i.e. the bitVARWEIGHT_RENDERING_BITis set, otherwise false.
-
hasColorChannel
public static boolean hasColorChannel(int renderModes)
Returns true if render mode has a color channel, i.e. the bitCOLORCHANNEL_RENDERING_BITis set, otherwise false.
-
hasColorTexture
public static boolean hasColorTexture(int renderModes)
Returns true if render mode has a color texture, i.e. the bitCOLORTEXTURE_RENDERING_BITis set, otherwise false.
-
getRenderModeString
public static String getRenderModeString(int renderModes)
Returns a unique technical description string for renderModes as follows:(vbaa|msaa|norm)[-curve][-cols][-ctex]- Parameters:
renderModes- Graph renderModes, seecreate(..)
-
getRenderModeString
public static String getRenderModeString(int renderModes, int graphAAQuality, int graphSampleCount, int fsaaSampleCount)
Return a unique technical description string for renderModes and sample counts as follows:getRenderModeString(int)-q{AA-quality}-s{sampleCount}-fsaa{CapsNumSamples}- Parameters:
renderModes- the used Graph renderModes, seecreate(..)graphAAQuality- Graph AA quality, seeDEFAULT_AA_QUALITY, set to negative value to mark undefinedgraphSampleCount- Graph sample count forVBAA_RENDERING_BITorMSAA_RENDERING_BITfsaaSampleCount- full-screen AA (fsaa) sample count, retrieved e.g. viaGLCapabilitiesImmutable.getNumSamples()
-
printBufferStats
public abstract void printBufferStats(PrintStream out)
Print implementation buffer stats like detailed and total size and capacity in bytes etc
-
usesI32Idx
public final boolean usesI32Idx()
Returns true if implementation uses `int32_t` sized indices implying at least aGLProfile.isGL2ES3()alike context. Otherwise method returns false onGLProfile.isGLES2()using `uint16_t` sized indices.
-
growBuffer
public abstract boolean growBuffer(int verticesCount, int indicesCount)Increase the renderer buffers if necessary to add given counts of vertices- and index elements.Buffers will not change if remaining free slots, capacity less position, satisfy count elements.
- Parameters:
verticesCount- number of vertex elements to add if necessaryindicesCount- number of index elements to add if necessary- Returns:
- true if buffer size has changed, i.e. grown. Otherwise false.
- See Also:
setBufferCapacity(int, int),countOutlineShape(OutlineShape, int[]),countOutlineShapes(List, int[])
-
setBufferCapacity
public abstract boolean setBufferCapacity(int verticesCount, int indicesCount)Set the renderer buffers pre-emptively for given vertices- and index counts.Buffers will not change if given count elements is lower or equal current capacity.
- Parameters:
verticesCount- number of vertices to holdindicesCount- number of indices to hold- Returns:
- true if buffer size has changed, i.e. grown. Otherwise false.
- See Also:
growBuffer(int, int),countOutlineShape(OutlineShape, int[]),countOutlineShapes(List, int[])
-
getRenderModes
public final int getRenderModes()
Returns bit-field of render modes, seecreate(..).
-
isRenderModeSet
public final boolean isRenderModeSet(int mask)
-
isVBAA
public final boolean isVBAA()
Returns true if capable of two pass rendering - VBAA, otherwise false.- See Also:
getRenderModes()
-
isMSAA
public final boolean isMSAA()
Returns true if capable of two pass rendering - MSAA, otherwise false.- See Also:
getRenderModes()
-
hasVariableWeight
public final boolean hasVariableWeight()
Returns true if capable of variable weights, otherwise false.- See Also:
getRenderModes()
-
hasColorChannel
public final boolean hasColorChannel()
Returns true ifgetRenderModes()has a color channel, i.e.COLORCHANNEL_RENDERING_BITis set. Otherwise returns false.- See Also:
COLORCHANNEL_RENDERING_BIT,getRenderModes(),#addOutlineShape(OutlineShape, AffineTransform, float[]),com.jogamp.graph.curve.opengl.RegionRenderer#setColorStatic(com.jogamp.opengl.GL2ES2, float, float, float, float)
-
hasColorTexture
public final boolean hasColorTexture()
Returns true if render mode has a color texture, i.e. the bitCOLORTEXTURE_RENDERING_BITis set, otherwise false.- See Also:
getRenderModes(),#isColorTextureLetterbox()
-
getFrustum
public final com.jogamp.math.geom.Frustum getFrustum()
-
setFrustum
public final void setFrustum(com.jogamp.math.geom.Frustum frustum)
SetFrustumculling for#addOutlineShape(OutlineShape, AffineTransform, float[]).
-
perfCounter
public PerfCounterCtrl perfCounter()
-
countOutlineShape
public static final int[] countOutlineShape(OutlineShape shape, int[] vertIndexCount)
Count required number of vertices and indices adding to given int[2] `vertIndexCount` array.The region's buffer can be either set using
setBufferCapacity(int, int),GLRegion ctor w/ initial capacitiesor grown usinggrowBuffer(int, int).Method is utilized in
GLRegion ctor w/ font + text, computing the initial capacity.- Parameters:
shape- theOutlineShapeto countvertIndexCount- the int[2] storage where the counted vertices and indices are added, vertices at [0] and indices at [1]- Returns:
- the given int[2] storage for chaining
- See Also:
setBufferCapacity(int, int),growBuffer(int, int)
-
countOutlineShapes
public static final int[] countOutlineShapes(List<OutlineShape> shapes, int[] vertIndexCount)
Count required number of vertices and indices adding to given int[2] `vertIndexCount` array.The region's buffer can be either set using
setBufferCapacity(int, int),GLRegion ctor w/ initial capacitiesor grown usinggrowBuffer(int, int).- Parameters:
shapes- list ofOutlineShapeto countvertIndexCount- the int[2] storage where the counted vertices and indices are added, vertices at [0] and indices at [1]- Returns:
- the given int[2] storage for chaining
- See Also:
setBufferCapacity(int, int),growBuffer(int, int)
-
addOutlineShape
public final void addOutlineShape(OutlineShape shape, com.jogamp.math.geom.plane.AffineTransform t, com.jogamp.math.Vec4f rgbaColor)
Add the givenOutlineShapeto this region with the given optionalAffineTransform.In case
frustum culling is set, theOutlineShapeis dropped if it'sbounding-boxis fully outside of the frustum. The optionalAffineTransformis applied to the bounding-box beforehand.- Parameters:
shape- theOutlineShapeto addt- the optionalAffineTransformto be applied on each vertexrgbaColor- ifhasColorChannel()RGBA color must be passed, otherwise value is ignored.
-
addOutlineShapes
public final void addOutlineShapes(List<OutlineShape> shapes, com.jogamp.math.geom.plane.AffineTransform transform, com.jogamp.math.Vec4f rgbaColor)
Add the given list ofOutlineShapes to this region with the given optionalAffineTransform.In case
frustum culling is set, theOutlineShapes are dropped if it'sbounding-boxis fully outside of the frustum. The optionalAffineTransformis applied to the bounding-box beforehand.- Parameters:
shapes- list ofOutlineShapeto addt- the optionalAffineTransformto be applied on each vertexrgbaColor- ifhasColorChannel()RGBA color must be passed, otherwise value is ignored.
-
getBounds
public final com.jogamp.math.geom.AABBox getBounds()
- Returns:
- the AxisAligned bounding box of current region
-
markShapeDirty
public final void markShapeDirty()
Mark this region's shape dirty, i.e. its vertices, triangles, lines and/or color-texture coordinates changed.The data will be re-uploaded to the GPU at next
draw(..).In 2-pass mode, this implies updating the FBO itself as well.
-
isShapeDirty
public final boolean isShapeDirty()
Returns true if this region's shape are dirty, seemarkShapeDirty().
-
markStateDirty
public final void markStateDirty()
Mark this region's render-state dirty, i.e. re-selecting a shader program regarding color-texture and -channel, and rendering the region into the FBO in 2-pass mode.In 1-pass mode, re-selection of the shader-program is based on color-texture and -channel only.
-
isStateDirty
public final boolean isStateDirty()
Returns true if this region's state is dirty, seemarkStateDirty().
-
-