Class Region
- java.lang.Object
-
- com.jogamp.graph.curve.Region
-
-
Field Summary
Fields Modifier and Type Field Description static int
COLORCHANNEL_RENDERING_BIT
Rendering-Mode bit forRegion
to optionally enable a color-channel per vertex.static int
COLORTEXTURE_RENDERING_BIT
Rendering-Mode bit forRegion
static boolean
DEBUG
Debug flag for region impl (graph.curve)static boolean
DEBUG_INSTANCE
static int
DEFAULT_TWO_PASS_TEXTURE_UNIT
static int
MAX_QUALITY
Default maximumquality
, 1.static int
MSAA_RENDERING_BIT
Rendering-Mode bit forRegion
static int
NORM_RENDERING_BIT
Rendering-Mode bit forRegion
static int
VARWEIGHT_RENDERING_BIT
Rendering-Mode bit forRegion
static int
VBAA_RENDERING_BIT
Rendering-Mode bit forRegion
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addOutlineShape(OutlineShape shape, AffineTransform t, Vec4f rgbaColor)
Add the givenOutlineShape
to this region with the given optionalAffineTransform
.void
addOutlineShapes(List<OutlineShape> shapes, AffineTransform transform, Vec4f rgbaColor)
Add the given list ofOutlineShape
s to this region with the given optionalAffineTransform
.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.AABBox
getBounds()
Frustum
getFrustum()
int
getQuality()
SeeMAX_QUALITY
int
getRenderModes()
Returns bit-field of render modes, seecreate(..)
.static String
getRenderModeString(int renderModes)
Returns a unique technical description string for renderModes as follows:static String
getRenderModeString(int renderModes, int graphSampleCount, int fsaaSampleCount)
Return a unique technical description string for renderModes and sample counts as follows:abstract boolean
growBuffer(int verticesCount, int indicesCount)
Increase the renderer buffers if necessary to add given counts of vertices- and index elements.boolean
hasColorChannel()
Returns true ifgetRenderModes()
has a color channel, i.e.static boolean
hasColorChannel(int renderModes)
Returns true if render mode has a color channel, i.e.boolean
hasColorTexture()
Returns true if render mode has a color texture, i.e.static boolean
hasColorTexture(int renderModes)
Returns true if render mode has a color texture, i.e.boolean
hasVariableWeight()
Returns true if capable of variable weights, otherwise false.static boolean
hasVariableWeight(int renderModes)
Returns true if render mode capable of variable weights, i.e.boolean
isMSAA()
Returns true if capable of two pass rendering - MSAA, otherwise false.static boolean
isMSAA(int renderModes)
boolean
isShapeDirty()
Returns true if this region's shape are dirty, seemarkShapeDirty()
.boolean
isStateDirty()
Returns true if this region's state is dirty, seemarkStateDirty()
.static boolean
isTwoPass(int renderModes)
boolean
isVBAA()
Returns true if capable of two pass rendering - VBAA, otherwise false.static boolean
isVBAA(int renderModes)
void
markShapeDirty()
Mark this region's shape dirty, i.e.void
markStateDirty()
Mark this region's render-state dirty, i.e.PerfCounterCtrl
perfCounter()
abstract void
printBufferStats(PrintStream out)
Print implementation buffer stats like detailed and total size and capacity in bytes etcabstract boolean
setBufferCapacity(int verticesCount, int indicesCount)
Set the renderer buffers pre-emptively for given vertices- and index counts.void
setFrustum(Frustum frustum)
SetFrustum
culling for#addOutlineShape(OutlineShape, AffineTransform, float[])
.void
setQuality(int q)
SeeMAX_QUALITY
String
toString()
boolean
usesI32Idx()
Returns true if implementation uses `int32_t` sized indices implying at least aGLProfile.isGL2ES3()
alike context.
-
-
-
Field Detail
-
DEBUG
public static final boolean DEBUG
Debug flag for region impl (graph.curve)
-
DEBUG_INSTANCE
public static final boolean DEBUG_INSTANCE
-
NORM_RENDERING_BIT
public static final int NORM_RENDERING_BIT
Rendering-Mode bit forRegion
One pass `norm` rendering either using no AA or underlying full-screen AA (fsaa).
- See Also:
- Constant Field Values
-
MSAA_RENDERING_BIT
public static final int MSAA_RENDERING_BIT
Rendering-Mode bit forRegion
MSAA based Anti-Aliasing, a two pass region rendering, slower and more resource hungry (FBO), but providing fast MSAA in case the whole scene is not rendered with MSAA.
- See Also:
- Constant Field Values
-
VBAA_RENDERING_BIT
public static final int VBAA_RENDERING_BIT
Rendering-Mode bit forRegion
View 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.
- See Also:
- Constant Field Values
-
VARWEIGHT_RENDERING_BIT
public static final int VARWEIGHT_RENDERING_BIT
Rendering-Mode bit forRegion
Use 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.
- See Also:
- Constant Field Values
-
COLORCHANNEL_RENDERING_BIT
public static final int COLORCHANNEL_RENDERING_BIT
Rendering-Mode bit forRegion
to 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 color
can being used for a monotonic color.- 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 forRegion
If set, a color texture is used to determine the color.
- See Also:
- Constant Field Values
-
MAX_QUALITY
public static final int MAX_QUALITY
Default maximumquality
, 1.- 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
-
isVBAA
public static boolean isVBAA(int renderModes)
-
isMSAA
public static boolean isMSAA(int renderModes)
-
isTwoPass
public static boolean isTwoPass(int renderModes)
-
hasVariableWeight
public static boolean hasVariableWeight(int renderModes)
Returns true if render mode capable of variable weights, i.e. the bitVARWEIGHT_RENDERING_BIT
is set, otherwise false.
-
hasColorChannel
public static boolean hasColorChannel(int renderModes)
Returns true if render mode has a color channel, i.e. the bitCOLORCHANNEL_RENDERING_BIT
is set, otherwise false.
-
hasColorTexture
public static boolean hasColorTexture(int renderModes)
Returns true if render mode has a color texture, i.e. the bitCOLORTEXTURE_RENDERING_BIT
is 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 graphSampleCount, int fsaaSampleCount)
Return a unique technical description string for renderModes and sample counts as follows:getRenderModeString(int)
-s{sampleCount}-fsaa{CapsNumSamples}- Parameters:
renderModes
- the used Graph renderModes, seecreate(..)
graphSampleCount
- Graph sample count forVBAA_RENDERING_BIT
orMSAA_RENDERING_BIT
fsaaSampleCount
- 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(..)
.
-
getQuality
public final int getQuality()
SeeMAX_QUALITY
-
setQuality
public final void setQuality(int q)
SeeMAX_QUALITY
-
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_BIT
is 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_BIT
is set, otherwise false.- See Also:
getRenderModes()
-
getFrustum
public final Frustum getFrustum()
-
setFrustum
public final void setFrustum(Frustum frustum)
SetFrustum
culling 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 capacities
or grown usinggrowBuffer(int, int)
.Method is utilized in
GLRegion ctor w/ font + text
, computing the initial capacity.- Parameters:
shape
- theOutlineShape
to 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 capacities
or grown usinggrowBuffer(int, int)
.- Parameters:
shapes
- list ofOutlineShape
to 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, AffineTransform t, Vec4f rgbaColor)
Add the givenOutlineShape
to this region with the given optionalAffineTransform
.In case
frustum culling is set
, theOutlineShape
is dropped if it'sbounding-box
is fully outside of the frustum. The optionalAffineTransform
is applied to the bounding-box beforehand.- Parameters:
shape
- theOutlineShape
to addt
- the optionalAffineTransform
to be applied on each vertexrgbaColor
- ifhasColorChannel()
RGBA color must be passed, otherwise value is ignored.
-
addOutlineShapes
public final void addOutlineShapes(List<OutlineShape> shapes, AffineTransform transform, Vec4f rgbaColor)
Add the given list ofOutlineShape
s to this region with the given optionalAffineTransform
.In case
frustum culling is set
, theOutlineShape
s are dropped if it'sbounding-box
is fully outside of the frustum. The optionalAffineTransform
is applied to the bounding-box beforehand.- Parameters:
shapes
- list ofOutlineShape
to addt
- the optionalAffineTransform
to be applied on each vertexrgbaColor
- ifhasColorChannel()
RGBA color must be passed, otherwise value is ignored.
-
getBounds
public final 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()
.
-
-