aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Bug 1491: GLMediaPlayerImpl: Use a shared *GraphicsDevice for all compatible ↵Sven Göthel2024-01-251-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shared GLContext, removing resource restrictions In a use case with hundreds of GLMediaPlayer instances, this causes the application to bail out due to running out of resources. +++ GLMediaPlayer exposes resource restrictions and locking related with the created off-thread shared GLContext due to its newly created NativeWindow *GraphicsDevice instance (on X11). On the X11 platform, the *GraphicsDevice actually uses a native resource (X11 Display handle) and hence creating such device is costly and limited. To operate an off-thread GLContext w/o actual X11 input handling, it is *NOT* required to use a new instance. +++ Further more, the device is using locking. To operate an off-thread GLContext, it is *NOT* required to use locking on it as it does not perform actual X11 input handling etc. All operations are performed on the shared GL context. +++ Solution is to create a shared non-locking device clone compatible with the source. A share counter shall determine that the last one actually gets destructed. The usual ..
* Bug 1491: FFMPEGMediaPlayer: Lock moviePtr lifecycle phase in-between ↵Sven Göthel2024-01-251-69/+73
| | | | | | | | | [initStreamImpl - destruction] initStreamImpl() calls ffmpeg natives.setStream0(..), which in turn callsback to the GLMediaPlayerImpl and FFMPEGPlayer and hence requires a valid moviePtr. In total, it covers a longer time period. This patch uses a moviePtrLock object avoiding destruction while within initStreamImpl.
* Bug 1491: Add missing rename ↵Sven Göthel2024-01-251-2/+2
| | | | DefaultGraphicsDevice.swap{Device->}HandleAndOwnership()
* NativeWindowFactory.createDevice(..) w/ unitID for cloning; ↵Sven Göthel2024-01-256-82/+75
| | | | | | | | | | DefaultGraphicsDevice: Move ownership (Object) code into base class ensuring same code NativeWindowFactory.createDevice(..) w/ unitID - Allows cloning a device instance with same parameter. DefaultGraphicsDevice: Move ownership (Object) code final into base class ensuring same code - Rename DefaultGraphicsDevice.swapDeviceHandleAndOwnership() -> swapHandleAndOwnership()
* Bug 1488: Complete/Fix producing the 64-bit shaderKey: Use long values in ↵Sven Göthel2024-01-251-36/+28
| | | | | | | | | | bit-shift expressions and simplify it commit 1dcfdf71c09c6d774ac47012c05e09da4a085d7b - still used the 'hash code' bit shift pattern, not necessary -> simplified - the value as not ensured to be long, hence conversion occured This caused Graph's MSAA not being picked up properly using the shaderKey.
* Graph: Drop non-existing 'JAVA' font from FontFactorySven Göthel2024-01-256-200/+14
|
* GraphUI MediaPlayer: Fix Zoom behavior; Disable DEBUG outputSven Göthel2024-01-191-33/+67
|
* GraphUI RangeSlider/RangedGroup: Fix overall integration, adding more API ↵Sven Göthel2024-01-194-142/+359
| | | | | | | | | | | | | | | | | | | comments; UIMediaGrid01 now uses RangedGroup RangeSlider - Fix pageSize, i.e. allow valid content.getBounds() be pending @ validateImpl() - Clip value [0, maximum - pageSize] - Has to use Float.isFinite() to capture both, NaN and Infinity -- used for pageSize, determining whether slider uses pageSize rect-knob or position round-knob -- used for minMax, val, val_pct and temp range + pageSize_pct -- don't overwrite valid pageSize if leading to !isFinite() - Reuse setKnobSize() for ctor as well, where padding is be done once (FIXME?) - Tested via RangedGroup w/ UIMediaGrid01 and FontView0 -- vertical slider, inverse and !inverse
* GraphUI Tooltip: Use delayMS for no time-based alarm (only used for now()); ↵Sven Göthel2024-01-192-15/+16
| | | | FontView01: Use TooltipShape for GlyphShape only with mouse click -> Tooltip.now()
* GraphUI Demos: Minor fixesSven Göthel2024-01-223-21/+6
|
* VBORegionSPES2: Disable verbose flag in TextureSequence.setTexCoordBBox() .. ↵Sven Göthel2024-01-221-1/+1
| | | | oops
* Bug 1488: FFMPEGMediaPlayer: Fix getTextureFragmentShaderHashID(), i.e. use ↵Sven Göthel2024-01-221-6/+3
| | | | actual tc_w_1 = (float)getWidth() / (float)texWidth value as hardcoded within the shader.
* Bug 1488 - Graph RegionRenderer: Use a more deterministic 64-bit shaderKey: ↵Sven Göthel2024-01-221-31/+62
| | | | | | | | | | | | | | | | | | | | | | | [0-31] bit values and state, [32-63] colorTexSeqHash This leaves only room for a key collision on the 32-bit colorTexSeqHash value and hence should be save within our shader-code environment. + // # | s | + // 0 | 1 | isTwoPass + // 1 | 1 | pass1 + // 2 | 5 | ShaderModeSelector1 + // 7 | 1 | hasFrustumClipping + // 8 | 1 | hasColorChannel + // 9 | 1 | hasColorTexture + // 32 | 32 | colorTexSeqHash + long hash = ( isTwoPass ? 1 : 0 ); + hash = ( hash << 1 ) | ( pass1 ? 1 : 0 ) ; + hash = ( hash << 1 ) | sms.ordinal(); // incl. pass2Quality + sampleCount + hash = ( hash << 5 ) | ( hasFrustumClipping ? 1 : 0 ); + hash = ( hash << 1 ) | ( hasColorChannel ? 1 : 0 ); + hash = ( hash << 1 ) | ( hasColorTexture ? 1 : 0 ); + hash = ( hash << 1 ) | ( ( colorTexSeqHash & 0xFFFFFFL ) << 32 );
* Scene.dispatchMouseEventPickShape(): Reuse PMVMatrix4f, Ray and Vec3f within ↵Sven Göthel2024-01-191-6/+8
| | | | EDT, reducing temp objects on mouse moves
* TooltipShape.destroyTip(): Only show warning instead of throwing a ↵Sven Göthel2024-01-191-1/+5
| | | | RuntimeException if tip couldn't be found within wrapper Group
* Simplify TooltipShape: Create own wrapper Group to not mutate user given ↵Sven Göthel2024-01-223-33/+83
| | | | Shape (if reused in DAG); Fix FontView01 TooltipShape instance, use NoOp DestroyCallback
* Bug 1488 - Graph RegionRenderer: Ensure shaderPrograms1 path is disabled ↵Sven Göthel2024-01-221-6/+8
| | | | | | using 'static final boolean useShaderPrograms0 = true' For now, let's leave the dead shaderPrograms1 code path inside the class for further consideration.
* Bug 1490: Add missing rename Shape.transformMvTo() -> applyMatToMv(), an ↵Sven Göthel2024-01-221-31/+31
| | | | transformMvTo() was an intermediate rename (oops)
* Bug 1489 - GraphUI Group: Resolve Performance Regression in ↵Sven Göthel2024-01-2216-117/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scene.pickShape(): Drop invisible and clipped shapes After implementing Bug 1487 (Frustum Clipping/Culling) and using thousands of shapes within one Group mostly culled (outside of frustum), overall mouse Scene.pickShape() caused tremendous lagging. This is caused by Scene.pickShape() traversing through _all_ shapes, rendered ones, invisible ones and culled ones. +++ Solution is to have Scene and Group provide a pre-sorted list of actually rendered shapes, i.e. isVisible() and not culled. Scene.pickShape() can now use this reduced and pre-sorted list reducing the load considerably. +++ Further - cleanup TreeTool - rename Container methods: -- setFrustumCullingEnabled() -> setPMvCullingEnabled() -- isFrustumCullingEnabled() -> isPMvCullingEnabled() - supply Container with -- isCullingEnabled() -- List<Shape> getRenderedShapes() -- isOutside() -- isOutside2() -- forAllRendered()
* Bug 1490 - GraphUI Performance: Group/Scene: Use temp sorted arraysSven Göthel2024-01-222-16/+25
| | | | | Group/Scene's uses temp arrays for Z oder sorting, which should be maintained locally to avoid too many temp object creations.
* Bug 1490 - GraphUI Group: Resolve Performance Issues with Shape Mv Transform ↵Sven Göthel2024-01-2218-116/+223
| | | | | | | | | | | | | | | | | | | | -> PMVMatrix4f Shape.setTransformMv() is called for each renderer frame and for each shape, involving 6 Matrix4f.mul() and set*() operations. Since mutation of shape's position, rotation or scale is less frequent than rendering one frame (for all shapes), it is more efficient to maintain a local Matrix4f and update it on such single mutations. Rendering then only needs to perform one Matrix4f.mul() operation using this internal matrix. +++ Also changes name from setTransformMv(PMVMatrix4f) to applyMatToMv(PMVMatrix4f), as its name might be misleading.
* Bug 1488 - Graph RegionRenderer Shader Mapping: Revert to IntObjectHashMap ↵Sven Göthel2024-01-221-64/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* GraphUI Demos: Minor finetuning..Sven Göthel2024-01-213-11/+22
|
* UIShapeClippingDemo00: Fix behavior, use shape as child and completely chain ↵Sven Göthel2024-01-211-24/+23
| | | | rendering in display()
* GraphUI Demo Fontview: Demonstrate Clipping w/ rotation; Reuse GlyphShape ↵Sven Göthel2024-01-201-45/+123
| | | | | | | | | | | | | | | | 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).
* GraphUI RangeSlider: Keep Region.AA_RENDERING_MASK in renderModesSven Göthel2024-01-201-1/+1
|
* GraphUI Tooltip*: Allow user to trigger display via now(); Ensure ↵Sven Göthel2024-01-204-45/+108
| | | | TooltipShape.DestroyCallback gets passed the user provided Shape only
* GraphUI Group: Add ctor with most usable values, allowing injecting a Group ↵Sven Göthel2024-01-201-1/+24
| | | | as a one-liner in code
* GraphUI Group/BoxLayout/GridLayout: Handle empty Group, i.e. detect ↵Sven Göthel2024-01-203-5/+19
| | | | zero-size and avoid scale=Infinity and zero-sized resulting AABBox
* GraphUI Graph/Scene: Reuse TreeTool for contains(), getShapeByID() and ↵Sven Göthel2024-01-203-53/+54
| | | | getShapeByName(), also adding full traversion (instead of a flat lookup)
* Graph Clipping: Use Frustum Clipping using AABBox -> Mv transformed Cube -> ↵Sven Göthel2024-01-2022-219/+364
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Frustum: Revise code and its Plane definition to support Cube->Frustum as ↵Sven Göthel2024-01-196-55/+203
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add Cube to Frustum Plane mapping, supporting transformation of object-space ↵Sven Göthel2024-01-192-1/+251
| | | | AABBox into model-view Cube to Frustum.Plane for culling (cpu) and clipping (gpu)
* AABBox: Rename private fields {bl, tr} -> {lo, hi} denoting proper ↵Sven Göthel2024-01-191-137/+137
| | | | | | | | | | | 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.
* GraphUI Tooltip*: Generalize Tooltip base (more versatile) and add ↵Sven Göthel2024-01-195-41/+240
| | | | TooltipShape supporting general Shapes to be added
* GraphUI Clipping Demo: Adding a simple Shape within a clipping Group all ↵Sven Göthel2024-01-163-2/+185
| | | | driven by a Scene
* GraphUI Enhance Clipping: Drop 'cullingScale' param, a simple ↵Sven Göthel2024-01-163-36/+12
| | | | | | | | | | 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.
* GraphUI GLButton: Filter out Region.AA_RENDERING_MASK in ctor, as ↵Sven Göthel2024-01-161-1/+2
| | | | GLEventListener renders into FBO at correct resolution.
* Graph/GraphUI AA-Quality + SampleCount (shader): Push params down to ↵Sven Göthel2024-01-1647-367/+326
| | | | | | | | | | | | | | | | | | 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.
* GraphUI RangedGroup.validateImpl(): Simplify updating contentPosZeroSven Göthel2024-01-161-5/+9
|
* GraphUI Enhance Clipping: Drop pixel clipping if `clip-box >= ↵Sven Göthel2024-01-163-51/+54
| | | | | | | | | | | | | | | | | | | | | | | 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)
* GraphUI Group Clipping setClip{OnBox->OnBounds}(): Add Vec3f cullingScale ↵Sven Göthel2024-01-151-21/+76
| | | | | | | | | | | | | | | | | | 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'
* AABBox: Add intersects(AABBox), contains(AABBox), scale(float, float, float) ↵Sven Göthel2024-01-151-0/+59
| | | | and scale2(float, float, float)
* AABBox: Rename private fields low -> bl and hight -> tr for readability; ↵Sven Göthel2024-01-151-149/+187
| | | | Unroll getRayIntersection()'s 'find candidate planes'
* GraphUI Demo FontView01: Remove using ↵Sven Göthel2024-01-151-3/+0
| | | | jogamp.graph.curve.opengl.VBORegion2PVBAAES2 perf-counter hooks (not committed)
* GraphUI: Added RangedGroup Widget, displaying a clipped content Group with ↵Sven Göthel2024-01-153-132/+323
| | | | | | | | | | 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
* GraphUI Demos CommandlineOptions: Add ctor w/ graphAAQuality and graphAASamplesSven Göthel2024-01-151-4/+15
|
* GraphUI Shape: Add receiveKeyEvents() and receiveMouseEvents() allowing a ↵Sven Göthel2024-01-153-8/+135
| | | | | | | | | | 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.
* GraphUI RangeSlider: [add,remove]{->Slider}Listener()Sven Göthel2024-01-152-4/+4
|
* Graph Text Tests: TestTextRendererNEWT20, TestTextRendererNEWT21: Reduce ↵Sven Göthel2024-01-153-13/+42
| | | | sampleSet 3 -> 1 and fontSet 11 -> 7 to avoid footprint for default tests.