aboutsummaryrefslogtreecommitdiffstats
path: root/src/demos/com
Commit message (Collapse)AuthorAgeFilesLines
* Math: Align Frustum/Matrix dependency w/ native jaulibSven Göthel2024-04-251-1/+1
|
* Bug 1489: Lock-Free Double-Buffered 'renderedShapes' causes data-race ↵Sven Göthel2024-02-175-1/+21
| | | | | | | | | | | | | | | between rendering & input-edt, use synchronized tripple-buffering Tripple-buffering _almost_ produces zero data-race collisions, however .. it still does rarely -> hence synchronize on the used ArrayList<>. This adds a minimal chance for blocking the input-EDT, but gives correct code & results. Double-buffered 'renderedShapes' was introduced to resolve Bug 1489 in commit 5f9fb7159fa33bc979e5050d384b6939658049bd This solution is tested by passing '-swapInterval 0' via CommandlineOptions for FontView01, UIMediaGrid01 .., i.e. rendering faster than picking and hence provoking the data-race condition.
* Bug 1501: Refine convex == !complex: Use 'complex' term, have env-property ↵Sven Göthel2024-02-141-10/+10
| | | | | | toggle OutlineShape's isComplex() for visibility We may use complex for other criteria than !convex, i.e. self-intersecting etc.
* Use FloatUtil.isZero(a) w/ build-in FloatUtil.EPSILON directly instead of ↵Sven Göthel2024-02-143-3/+3
| | | | passing FloatUtil.EPSILON to explicit isZero(a, epsilon)
* GraphUI Demo FontView01: Re-Enable snapshot via 's'Sven Göthel2024-02-131-6/+6
|
* Bug 1501: Apply intersection tests for non-convex shapes to reject new CCW ↵Sven Göthel2024-02-131-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and non-circulcircle triangulation candidates in our Delaunay tessellator <https://jogamp.org/bugzilla//show_bug.cgi?id=1501#c6> The used Delaunay tessellation works well with (almost) convex shapes. In case e.g. a glyph gets to the extremes like 'M' in FreeMono or any other complex Chinese symbol - it may just simply happen that the new non-circumcircle triangle point crosses the inner (hope) or outer boundaries of the given polygon. Applying further constraint at Loop.cut() resolves most cases by rejecting the proposed CCW and non-circumcircle triangle candidate if its new two line-segments intersects with the original polygon. This results in mostly proper rendered Chinese fonts and also FreeMono is now readable - overal remaining bugs in Glyphs is low. +++ Of course, this intersection test is costly around >= O(log(n)*n) costs, practically adding a measured ~65% processing time. E.g. for FontView01 using FreeSerif.ttf - orig total took 1430.817638ms, per-glyph 0.2236ms, glyphs 6399 - fix total took 2377.337359ms, per-glyph 0.371517ms, glyphs 6399 Pure Glyph/Shape instantiation shows > 2x costs: 750 ms 100% convex (fake) 1875 ms 0% convex (fake) 1870 ms 13% convex 824/6399 +++ Hence it is desired to either (1) Manually mark a polygon non-convex to add described intersection test for accuracy. Also may be used to just drop the additional costs despite the lack of correctness. PROVIDED (2) Determine non-convex nature of a polygon with a and overall less expensive algorithm. If considerably cheaper, this could reduce O(log(n) * n) -> O(n) or even O(log n). Added convex/non-convex classification while ignoring off-curve points, but only ~13% of FreeSerif is pure convex, hence there is no benefit with this classification type. It might be desired to attempt other classes, i.e. being rendered in non-convex mode w/o intersection tests. See - GENERALIZED DELAUNAY TRIANGULATIONS OF NON-CONVEX DOMAINS https://deepblue.lib.umich.edu/bitstream/handle/2027.42/28782/0000614.pdf;sequence=1 - https://en.wikipedia.org/wiki/List_of_self-intersecting_polygons - https://en.wikipedia.org/wiki/Complex_polygon
* Bug 1501: Graph Shape: onInit(ListenerBool) -> onDraw(DrawListener) w/ added ↵Sven Göthel2024-02-131-2/+3
| | | | | | capability for code injection to render Besides the one-shot on-init functionality, this allows us to re-render the shape differently.
* Bug 1501: Graph RenderState add debug-bits, i.e. DEBUG_LINESTRIP used in ↵Sven Göthel2024-02-132-7/+23
| | | | VBORegionSPES2 to just render lines instead of the filled area -> Used in UIShapeDemo02a
* Graph RenderState/RegionRenderer: Rename isHintMaskSet()->hintBitsSet(), ↵Sven Göthel2024-02-136-7/+7
| | | | setHintMask()->setHintBits(), clearHintMask()->clearHintBits()
* Remove unused imports ...Sven Göthel2024-02-123-9/+0
|
* Bug 1501: Graph: Add UIShapeDemo02a test for rectangular shape provoking ↵Sven Göthel2024-02-122-0/+227
| | | | tessellation issue / or use Glyph03FreeMonoRegular_M
* GraphUI Demos FontView01 + UIMediaGrid01: Use FSAA 8 (GPU MSAA 8) as these ↵Sven Göthel2024-02-073-6/+10
| | | | | | | demos utilize lots of smaller resources regions ... .. and this also brings us to the next required task: Resolve AA w/o supersampling right in our shader, which is very well possible when extending the tessellated outline triangle's area.
* GraphUI MediaPlayer: Add HUDShape on time-slider @ mouse-over with ↵Sven Göthel2024-02-071-1/+4
| | | | time-string and still-images (optional) .. using HUDShape
* GraphUI Shape: Add MouseEvent to MoveListener; RangeSlider: Add rel obj ↵Sven Göthel2024-02-074-23/+15
| | | | position + NEWT MouseEvent to listener, renamed {Slider->Change}Listener and add PeekListener for mouse-over events
* Bug 1492: GLMediaPlayer: Add playStream(..) variant passing desired audio- ↵Sven Göthel2024-02-051-2/+10
| | | | and subtitle language
* Bug 805: GraphUI Demos: Adopt changes to FontView01 + UIMediaGrid01, ↵Sven Göthel2024-02-053-320/+43
| | | | dropping UIMediaGrid00
* GraphUI Cleanup: Use TreeTool directly (Reduce virtl-funcs); Fix typos; Use ↵Sven Göthel2024-02-049-89/+119
| | | | | | PointerListener for onClicked(), add onHover(); Subsequent commits will fix complete cleanup where code was changed mostly regarding other issues.
* Use new com.jogamp.common.util.StringUtil (GlueGen)Sven Göthel2024-02-041-9/+10
|
* Graph/GraphUI: Move getDefault*() to FontFactory and add ↵Sven Göthel2024-02-033-9/+18
| | | | {get,set}FallbackFont() + Font.getBestCoverage(..); Use fallback-font in MediaButton in case chosen font doesn't match (foreign languages, e.g. 'zho' Chinese .. )
* Bug 1494 - GLMediaPlayer/GraphUI: Support Displaying Bitmap'ed Subtitles ↵Sven Göthel2024-02-021-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (PGS ..) via FFMPEGFMediaPlayer/FFmpeg FFMPEGFMediaPlayer related changes: - Add libswscale (6th FFmpeg lib used) for sws_getCachedContext(), sws_scale() and sws_freeContext(), used natively to convert the palette'ed bitmap into RGBA colorspace -> GL texture - Handling AVSubtitleRect.type SUBTITLE_BITMAP -- only handled if libswscale is available -- config/adjust texture object -- sws_scale palette'ed bitmap to texture -- intermediate memory is cached, may be resized and free'ed at destroy -- texture objects are managed and passed from GLMediaPlayerImpl, as they are also forwarded to player client via SubBitmapEvent - Passing the AVCodecID to GLMediaPlayerImpl, converted to our CodecID enum. - Unifying creation and opening of AVCodecContext with 'createOpenedAVCodecContext(..)' +++ SubtitleEvent* - SubTextEvent now also handles ASS.Dialogue (FFmpeg 4) besides ASS.Event (FFmpeg 5, 6, ..). +++ GLMediaPlayerImpl - Added ringbuffer subTexFree, managing Texture for bitmap'ed subtitles -- Uses 1 bitmap-subtitle Texture per used textureCount in cache, as one bitmap-subtile can be displayed per frame. Could be potentially reduced to just 2 .. but resources used are relatively low here. - Validating subTexFree + videoFramesFree usage, use blocking get/put ringbuffer due to utilization from different threads. - Receives subtitle content from native getNextPacket0() via callback, creates SubtitleEvent instance and passes it to a SubtitleEventListener - if exists. (See MediaButton example) -- SubBitmapEvent also gets its special SubBitmapEvent.TextureOwner to handle client releasing the event and allowing us to put back the Texture resource to 'subTexFree'. This passing through of the Texture object is probably a weakness of this lifecycle and requires the client to ensure SubtitleEvent.release() gets called. See MediaButton example! - Exposing CodecID, allowing clients like MediaButton to handle SubtitleEvent content according to codec
* GraphUI Demos: FontView01 can use scaling Lable ctor; UISceneDemo01b doesn't ↵Sven Göthel2024-01-312-3/+2
| | | | need to issue Shape.updateMat()
* Utilize PTS.getCurrent() where applicableSven Göthel2024-01-313-7/+7
|
* GLMediaPlayer: Split GLMediaFrameListener (rarely used) from ↵Sven Göthel2024-01-3110-50/+0
| | | | | | | | | | GLMediaEventListener, easing listener callbacks; Prepare SubtitleEventListener generalization (Bug 1494) Moves pushSound(), pushSubtitle*() from FFMPEGMediaPlayer to GLMediaPlayerImpl, as it is handled in a generic way - even though currently only called by native FFMPEGMediaPlayer implementation. Note: This patch is incomplete, i.e. not even compile clean. But choses as-is to semantically split the work to ease review.
* Cleanup GLMediaPlayer.EventMask.Bit handling in GLMediaEventListener ↵Sven Göthel2024-01-285-10/+5
| | | | implementations: Either Uninit, Init, Pause or Play (exclusive)
* GraphUI Demo UIMediaGrid00: Add missing patch from relocating getSymbolsFont()Sven Göthel2024-01-281-1/+1
|
* GraphUI Demos: Disable debug togglesSven Göthel2024-01-282-2/+2
|
* GraphUI MediaButton/MediaPlayer-Widget: Add working subtitle (text + ↵Sven Göthel2024-01-281-8/+10
| | | | ass/saa) support via GLMediaPlayer/FFMPEGMediaPlayer
* GraphUI Misc Cleanup: Move get*Font() helper to Scene; Allow ↵Sven Göthel2024-01-282-5/+6
| | | | GraphShape.drawImpl0(..) override;
* GLMediaPlayer: Add initial subtitle support, track audio/video/subtitle ↵Sven Göthel2024-01-279-12/+12
| | | | | | | | streams and languages and add convenient switchStream(..) entry. audio/video/subtitle streams and language metadata is maintained by arrays holding the stream-IDs and language string identifier. Implementation added in FFMPEGPlayer for these data-sets.
* GraphUI MediaPlayer: seek from display-thread, don't act on ↵Sven Göthel2024-01-271-1/+6
| | | | SliderAdapter.clicked() as dragged is always called
* GraphUI Demos: Bump FontView01 + UIMediaGrid01Sven Göthel2024-01-262-34/+66
|
* Graph: Drop non-existing 'JAVA' font from FontFactorySven Göthel2024-01-252-1/+12
|
* GraphUI RangeSlider/RangedGroup: Fix overall integration, adding more API ↵Sven Göthel2024-01-192-41/+87
| | | | | | | | | | | | | | | | | | | 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-191-2/+2
| | | | FontView01: Use TooltipShape for GlyphShape only with mouse click -> Tooltip.now()
* GraphUI Demos: Minor fixesSven Göthel2024-01-223-21/+6
|
* Simplify TooltipShape: Create own wrapper Group to not mutate user given ↵Sven Göthel2024-01-221-6/+3
| | | | Shape (if reused in DAG); Fix FontView01 TooltipShape instance, use NoOp DestroyCallback
* Bug 1489 - GraphUI Group: Resolve Performance Regression in ↵Sven Göthel2024-01-228-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Group: Resolve Performance Issues with Shape Mv Transform ↵Sven Göthel2024-01-2211-26/+33
| | | | | | | | | | | | | | | | | | | | -> 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.
* 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).
* Graph Clipping: Use Frustum Clipping using AABBox -> Mv transformed Cube -> ↵Sven Göthel2024-01-202-51/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* GraphUI Clipping Demo: Adding a simple Shape within a clipping Group all ↵Sven Göthel2024-01-162-1/+183
| | | | driven by a Scene
* GraphUI Enhance Clipping: Drop 'cullingScale' param, a simple ↵Sven Göthel2024-01-161-8/+1
| | | | | | | | | | 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.
* Graph/GraphUI AA-Quality + SampleCount (shader): Push params down to ↵Sven Göthel2024-01-1617-85/+74
| | | | | | | | | | | | | | | | | | 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 Enhance Clipping: Drop pixel clipping if `clip-box >= ↵Sven Göthel2024-01-161-41/+20
| | | | | | | | | | | | | | | | | | | | | | | 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 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-151-130/+160
| | | | | | | | | | 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 RangeSlider: [add,remove]{->Slider}Listener()Sven Göthel2024-01-151-2/+2
|