| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and throw exception on shaderKey collision
Commit 6363ae5fb6975a6f2e7c1093ce81f25b699e3e61 changed
RegionRenderer.useShaderProgram()'s shader mapping using a new ShaderKey instance.
Such ShaderKey instance is created every time @ RegionRenderer.useShaderProgram()
to retrieve the ShaderProgram from the HashMap<ShaderKey, Shader Program>.
While this is most correct, creating the ShaderKey instance causes
a lot of temp objects.
ShaderKey also uses the optional colorTexSeq shader code for equality test
in case of hash-collisions.
Previous code simply ignored hash-collisions and used a 1:1 hashCode -> ShaderProgram mapping using our IntObjectHashMap.
However, there was no test whether collision occur.
+++
Solution would be either
1- Revert fully to the previous code just using an IntObjectHashMap,
but throwing a RuntimeException in case of hashCode collisions.
In case of a collisions, we would need to produce a better hashCode.
This is possible, as the underlying data is fully internal .. etc.
2- Use the IntObjectHashMap as long there is no hashCode collision,
then revert back to HashMap<ShaderKey, Shader Program>.
+++
This patch implements variant (1), so far no exception has been thrown on
multiple demos w/ and w/o diff color-textures.
|
| |
|
|
|
|
| |
rendering in display()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for grid, info-box and tooltip
Added TooltipText for help and TooltipShape for GlyphShape.
Notable: The actual {@link GlyphShape} created for the glyph-grid {@link Group}
is reused as-is in the bigger info-grid as well as for the {@link TooltipShape}.
This is possible only if not modifying the scale or position of the {@link GlyphShape},
achieved by simply wrapping it in a {@link Group}.
The latter gets scaled and translated when dropped
into a {@link Group} with {@link Group.Layout}.
This is a good example for a Directed Acyclic Graph (DAG).
|
| |
|
|
|
|
| |
TooltipShape.DestroyCallback gets passed the user provided Shape only
|
|
|
|
| |
as a one-liner in code
|
|
|
|
| |
zero-size and avoid scale=Infinity and zero-sized resulting AABBox
|
|
|
|
| |
getShapeByName(), also adding full traversion (instead of a flat lookup)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Frustum mapping + GraphUI Support
AABBox clipping naturally couldn't be transformed into 3D Model-View (Mv) Space,
as it is axis aligned and only provided 2 points (min/max).
Therefor we map the Group's AABBox to a 8-point Cube,
perform the Mv-transformation and then produce the 6-plane Frustum.
As before, we cull fully outside shapes within the Group's draw method
and perform fragment clipping with same Frustum planes in the shader.
With clipping enabled, the 3D z-axis getBounds() depth
will be slightly increased for functional Frustum operation.
This is also done for setFixedSize(Vec2f).
The Frustum planes are copied to the Graph shader
via float[4*6] -> uniform vec4 gcu_ClipFrustum[6]; // L, R, B, T, N, F each {n.x, n.y, n.z, d}
+++
Concludes related work of below commits
- 1040bed4ecc6f4598ea459f1073a9240583fc3c3
- 5cca51e32999a882e2a5f00cb45ecafc824ffd86
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
well as to extract planes for float[] vec4-shader uniforms.
commit 1040bed4ecc6f4598ea459f1073a9240583fc3c3 added AABBox -> Cube -> Frustum mapping (incomplete)
and requires Frustum.Plane.set(..) by normal and point-on-plane for distance.
Frustum.isOutside(Cube) has been added, testing all its 8-points similar to AABBox.
Further all 6 Frustum.Plane shall be extracted to Vec4f and float[],
the latter to pass the whole float[4*6] as a vec4[6] uniform array to the shader.
+++
Constructor, setter and getter have been adjusted accordingly.
Most of the loops have been unrolled.
+++
Method names to query Frustum, i.e. 'is*Outside(<Type>)'
have been reduced to 'isOutside(<Type>)'
where <Type> uniquely indenticates the purpose.
Hence only 'isSphereOutside()' is left over.
|
|
|
|
| |
AABBox into model-view Cube to Frustum.Plane for culling (cpu) and clipping (gpu)
|
|
|
|
|
|
|
|
|
|
|
| |
orientation in API doc
br, tr wasn't sufficient as in commit d778889f36bd6bee999ceb502c5f0ce265b014bf
while working on Frustum, as it doesn't properly reflect axis order not z.
Hence going back to 'low' and 'high' semantics,
but using same length identifier and emphasizing far (lo) < near (hi)
of our model-view coordinate system.
|
|
|
|
| |
TooltipShape supporting general Shapes to be added
|
|
|
|
| |
driven by a Scene
|
|
|
|
|
|
|
|
|
|
| |
intersection-test against 'clipBox' to discard whole shapes if completely outside is enough.
Commit f06fe57b0ae738870a61700ff2c65680102d9e73 turns out addition of using `clipbBox*cullingScale` for the AABBox contains test
was not required to render the new Glyphs in the FontView01 demo 'in time'.
A simple intersection-test against 'clipBox' to discard shapes if completely outside is enough,
hence dropping the 'cullingScale' parameter - simplifying.
|
|
|
|
| |
GLEventListener renders into FBO at correct resolution.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RegionRenderer's RenderState usually rarely set from top of user API, reducing complexity.
Discussion:
Alternative was to pass AA-Quality same as SampleCount from the top (e.g. GraphUI Scene),
however, this convolutes the API even more.
Both parameter modify the resulting shader code in pass2 rendering (only).
The used 'renderMode' is still maintained within the Region,
since it contains more dynamic states individual to each Region instance (color-texture, ..).
This despite 'renderMode' also changes the RenderState's shader program.
In the end, it really doesn't matter and is a choice of frequency - the pipeline is
usually rendering from on OpenGL rendering thread sequentially.
AA-Quality and SampleCount simply usually don't change that often
and are set only once.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clip-box*cullingScale` (Group). RangedGroup: Pass through `clipCullingScale` to cull fully outside shapes; Apply in FontView01 Demo..
Group.setClip{BBox, OnBounds}() set 'cullingScale' drops pixel clipping if `clip-box >= clip-box*cullingScale`.
- Discard Shape rendering if completely outside of `clip-box*cullingScale`
- Otherwise perform pixel-accurate clipping inside the shader within [`clip-box` .. `clip-box*cullingScale`]
- If `clip-box >= clip-box*cullingScale` for all axis, no pixel-accurate clipping is performed as shapes are culled before
+++
RangedGroup: Pass through `clipCullingScale` allowing to cull fully outside shapes outside the 'box * clipCullingScale'
and use pixel-accurate clipping from [box..box*clipCullingScale].
Uses content.setClipBBox(..) with Mv premul-mat clippedContent.getBounds() in drawImpl0() override
+++
FontView01 Demo
- Using RangedGroup 'clipCullingScale' w/ culling >= 2*cell-size outside of clipping box (vertical only)
- Allows to drop the manually coded setVisible() hack and simplifies overall usage!
- This to not issue _initial_ rendering (draw) of all 14k+ Regions (Glyph-Count * 2) at once (resources, startup-performance)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
factor for the clip-box to discard rendering completely..; Add Group.setClipBBox(..)
Changed Group.setClip{OnBox->OnBounds}():
Enable AABBox clipping on getBounds() for this group and its shapes as follows:
- Discard Shape rendering if completely outside of the 'clip-box * cullingScale'
- Otherwise perform pixel-accurate clipping inside the shader on 'clip-box'
+++
Added Group.setClipBBox():
Enable AABBox clipping on explicit given pre-multiplied Mv-matrix 'clip-box as follows
- Discard Shape rendering if completely outside of the 'clip-box * cullingScale'
- Otherwise perform pixel-accurate clipping inside the shader on 'clip-box'
|
|
|
|
| |
and scale2(float, float, float)
|
|
|
|
| |
Unroll getRayIntersection()'s 'find candidate planes'
|
|
|
|
| |
jogamp.graph.curve.opengl.VBORegion2PVBAAES2 perf-counter hooks (not committed)
|
|
|
|
|
|
|
|
|
|
| |
optional horizontal and/or vertical RangeSlider; FontView01 now uses RangedGroup scrolling GlyphGrid smooth per-pixel
GraphUI: Added RangedGroup Widget, displaying a clipped content Group with optional horizontal and/or vertical RangeSlider
- Utilizes Group.setClipBox() to enable clipping of its content to the Group's AABBox
- Uses RangeSlider based on given contentSize
FontView01 now uses RangedGroup scrolling GlyphGrid smooth per-pixel
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Shape to receive forwarded events from another Shape; Added receive*Events() specialisation for RangeSlider
Forwarding events from shape to shape is useful, allowing inner shapes to send them to its group,
which itself may send it out towards an outer widget like RangeSlider.
RangeSlider's receive*Events() specialisation receives desired events from the source to its barAndKnob and knob
shapes, which are listening. It also suppresses the mouseClicked() event as it is only useful coming from itself.
|
| |
|
|
|
|
| |
sampleSet 3 -> 1 and fontSet 11 -> 7 to avoid footprint for default tests.
|
|
|
|
| |
listener-array (was 1 instance)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clipping funs for aaQuality/sampleCount; TextRegionUtil: Pass quality parameter in draw-functions
Region.DEFAULT_AA_QUALITY defaults to MAX_AA_QUALITY still
- TODO: AA shader is subject to change ..
Region.draw(..) clips the quality param (save)
TextRegionUtil: Pass quality parameter in draw-functions
- Allowing to select the AA shader
GraphUI Scene and some demos add the AA-quality param
to the status line or screenshot-filename.
- See Region.getRenderModeString(..)
+++
TestTextRendererNEWT20 and TestTextRendererNEWT21
now iterate through all fonts, AA-quality shader and sample-sizes.
Most demos and some more tests take AA-quality into acount,
demos via CommandlineOptions.graphAAQuality
|
| |
|
|
|
|
| |
page-start position.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass2-AA, revise Pass2 AA Quality parameter ..
Misc:
- Graph VBORegion2PVBAAES2: Drop unused FBO rescale
- Move MIN/MAX QUALITY/SAMPLE from GraphUI Scene -> Graph Region
+++
Quality -> Pass2 AA Quality
- Drop quality field in region
- Pass quality to GLRegion.draw(..) similar to sampleCount
for dynamic shader and switch
- TODO: Pass quality parameter in TextRegionUtil's functions
Fix RegionRenderer Shader Mapping
- Use ShaderKey class to properly implement the hash value and equals method
- For this, TextureSequence.getTextureFragmentShaderHashID() has been added
to provide actual shader-snippet for the equals function
- All required criterias are included in the hash value and equals method
Fix AABBox Clipping for Pass-2 AA
- Clipping in pass2-AA must happen in pass2 on actual gcu_PMVMatrix01 (not ortho)
+++
GraphUI GraphShape
- Rename: [get,set]{->AA}Quality()
GraphUI Scene
- Rename: mark{All->}ShapesDirty(), set{AllShapes->}Sharpness(), set{AllShapes->AA}Quality()
- Fix setSampleCount(..), i.e. markStatesDirty() not markShapesDirty()
- Fix setAAQuality(), markShapesDirty() and markStatesDirty(): Use forAll(..) to traverse through all shapes and groups.
GraphUI Group
- Add setFixedSize()
- Add setClipOnBox()
- Document setRelayoutOnDirtyShapes(), isShapeDirty()
|
|
|
|
| |
FBO attachments (GL_COLOR_ATTACHMENTi)
|
| |
|
|
|
|
| |
use winHeight (typo)
|
|
|
|
| |
sliding direction
|
| |
|
|
|
|
| |
expansion
|
| |
|
|
|
|
|
|
| |
- GLSL vertex shader sets smooth varying 'gcv_ClipBBoxCoord' w/ Mv multiplied vertex-coord
- RegionRenderer.setClipBBox(AABBox) expects a pre-multiplied Mv AABBox covering an independent area, not per Shape/Region.
- This works as expected with moving/scaling of each Shape/Region etc
|
|
|
|
|
|
|
|
|
|
|
|
| |
(Convenient using Graph/GraphUI produced AABBox)
Simple demo, setting clip-bbox manually:
- src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeClippingDemo00.java
TODO:
- GLSL: Add missing Mv-multiplication of vertex-position -> gcv_ClipBBoxCoord
-- AABBox min/max should be set pre-multiplied w/ Mv covering an independent area, not per Shape/Region.
-- This to properly work with moving/scaling of each Shape/Region etc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
min/max vec3 as convenient using Graph/GraphUI produced AABBox
USE_AABBOX_CLIPPING
- Conditional compilation w/ macro 'USE_AABBOX_CLIPPING'
- gcv_ClipBBoxCoord smooth varying setup in vertex shader
- fragment shader clips via branch
if( is_inside(gcv_ClipBBoxCoord, gcu_ClipBBox[0], gcu_ClipBBox[1]) < 0.5 ) { CLIP }
- clipping via discard or alpha=0 in case of buggy-discard.
Other optimization:
- Drop gcv_ColorTexExt, fragment-shader uses gcu_ColorTexBBox[2] directly (flat)
- Simplified gcv_ColorTexCoord smooth varying equation in vertex shader.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'and'/'or' semantic (swapped); Add EPSILON in clip_coord(..) and add is_inside(..) function
Complete overload vec2 and vec3 variants
Fix 'and'/'or' semantic (swapped)
- 'and' uses multiplication, i.e. all arguments must be > 0 (ideally 1)
- 'or' uses addition, i.e. only one arguments must be > 0 (ideally 1)
- both uses clamp [0..1]
Add EPSILON in clip_coord(..)
- Only 'coord > high+EPSILON' is outside
Add is_inside(..) function
- Similar to clip_coord(..) but returns float 0 or 1
instead of selecting color.
|
| |
|
|
|
|
| |
GLCapabilities request, removing code duplication
|
|
|
|
|
|
|
|
|
|
| |
VBAA_RENDERING_BIT again
Dropping AA was added in commit eb99bfc27f9f49387cbb08471debcd4d61e4f745,
but non-planar rectangles need AA to avoid stairs.
Hence manually dropping some AA in MediaPlayer for blending rectangles.
RangeSlider already drops AA for its bars etc.
|