aboutsummaryrefslogtreecommitdiffstats
path: root/src/demos
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* GraphUI RangeSlider: Add SliderAdapter (convenience) and use a ↵Sven Göthel2024-01-151-9/+4
| | | | listener-array (was 1 instance)
* Graph/GraphUI AA-Quality (shader): Region: Add DEFAULT_AA_QUALITY and ↵Sven Göthel2024-01-1521-39/+65
| | | | | | | | | | | | | | | | | | | | | | | | 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
* GraphUI UIShapeDemo00: Simple Shape within SceneSven Göthel2024-01-141-0/+152
|
* Bump (c) -2024 for edited files + LICENSE.txtSven Göthel2024-01-147-7/+7
|
* Graph/GraphUI: Revise Graph Region ShaderMapping, fix AABBox-Clipping for ↵Sven Göthel2024-01-147-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()
* GraphUI RangeSlider: Add unitSize param: Size of one unit (element) in ↵Sven Göthel2024-01-121-22/+25
| | | | sliding direction
* GraphUI Demos: Use CommandlineOptions properlySven Göthel2024-01-122-21/+21
|
* AABBox resize{Width, Height}(..): Positive argument shall always denote ↵Sven Göthel2024-01-121-1/+1
| | | | expansion
* GraphUI Margin/Padding: Rename zeroSum*() -> zero*()Sven Göthel2024-01-123-7/+7
|
* Graph Clipping: Add missing Modelview-Matrix (Mv) Multiplication / ConsiderationSven Göthel2024-01-091-11/+35
| | | | | | - 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
* Graph Clipping: Initial Region impl of AABBox clipping using GLSL shader ↵Sven Göthel2024-01-091-0/+350
| | | | | | | | | | | | (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
* GraphUI Demo UIMediaGrid00: Add letterBox option, defaults to true nowSven Göthel2024-01-081-1/+5
|
* GraphUI Demos: Have CommandlineOptions produce GLProfile and full ↵Sven Göthel2024-01-0819-236/+128
| | | | GLCapabilities request, removing code duplication
* GraphUI Button.setLabelColor(..): Add alpha channel and variant w/ Vec4f for ↵Sven Göthel2024-01-073-3/+3
| | | | flexibility
* GraphUI Cleanup: Simplify Shape.draw*() and ↵Sven Göthel2024-01-073-7/+1
| | | | | | | | | | | | | Container.{add,remove*}Shape[s](); Remove Scene.setDebugBorderBox() Simplify Shape/Scene - Split scene.display()/shape.drawImpl0() and scene.displayGLSelect()/shape.drawToSelectImpl0() Simplify Container (Scene/Group) - {add,remove*}Shape[s](), i.e. drop unusual removeShape*() and simplify implementation Scene - Remove setDebugBorderBox()
* GraphUI RangeSlider: Add rectangular marks (e.g. for chapters, see ↵Sven Gothel2023-12-311-0/+2
| | | | | | MediaPlayer), by simply overlay marks on bar Knob color defaults to 0.80f, 0.80f, 0.80f, 0.7f, i.e. light-mode better matching MediaPlayer use-case.
* GraphUI RangeSlider Widget: Add rectangular page-sized knob mode using a ↵Sven Gothel2023-12-241-103/+55
| | | | | | 'page size' of covered view. Resolve color-setup. Tested with FontView01
* GraphUI MediaPlayer Widget: Issue playStream(..) and setTextureUnit(..) by ↵Sven Gothel2023-12-242-3/+7
| | | | caller, reducing specification
* Bug 805: GraphUI: Add Widget 'marker' (a Group), derived by {MediaUI01 -> ↵Sven Gothel2023-12-192-11/+11
| | | | | | | | | | | | | MediaPlayer} and new RangeSlider - A widget specifies specific UI semantics including individual controls. - Being a {@link Group}, implementations provide shape(s) and its instance can be added to the user's scene. - Due to the specific nature of widgets, individual controls/listener may be provided with semantic values. +++ MediaPlayer exposes a RangeSlider for current position (view and control).
* UIMediaGrid0{01}: Minor cleanup: Drop unused local FontSven Gothel2023-12-182-12/+4
|
* Bug 805: GraphUI: Add MediaUI01 widtget (MediaButton w/ full feature ↵Sven Gothel2023-12-182-123/+116
| | | | controls), used in demos UIMediaGrid0[01]
* GraphUI Padding, Margin, Gap: Use zero value constant None instead of ↵Sven Gothel2023-12-181-1/+1
| | | | default ctor
* GraphUI UISceneDemo20: Only use ALAudioSink if its context is already ↵Sven Gothel2023-12-181-5/+9
| | | | created (ready)
* MovieSBSStereo: GLMediaPlayer.setTextureMinMagFilter() must be called before ↵Sven Gothel2023-12-181-1/+1
| | | | initialization
* GraphUI Shape: Rename [set|is]{Enabled -> Visible}(..) for claritySven Gothel2023-12-183-12/+12
| | | | | Note that invisible shapes are still considered for picking/activation. To completely mute the shape, issue {@link #setInteractive(boolean)} as well.
* GraphUI Shape: Use Shape.MoveListener for Shape.onMove(..) providing more ↵Sven Gothel2023-12-122-10/+7
| | | | details of the translation
* Bug 1472: GLMediaPlayer: Handle setPlaySpeed() like setAudioVolume() if ↵Sven Gothel2023-10-161-0/+11
| | | | stream is not yet initialized or playing, cached clipped value and set at initGL(..)
* Bug 1472: GLMediaPlayer: Expose SCR PTS and encourage its usage, removes ↵Sven Gothel2023-10-163-15/+18
| | | | user from selecting video or audio PTS.
* Bug 1472: Enhance GLMediaPlayer AV Sync: Utilize SCR aware audio PTS used as ↵Sven Gothel2023-10-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | master-clock, enabling proper AV sync w/ untouched audio We can finally utilize the added pass through audio PTS, see commits - GlueGen 52725b4c6525487f93407f529dc0a758b387a4fc - JOAL 12029f1ec1d8afa576e1ac61655f318cc37c1d16 This enables us to use the audio PTS as the master-clock and adjust video to the untouched audio. In case no audio is selected/playing or audio is muted, we sync merely on the system-clock (SCR) w/o audio. AV granularity is 22ms, however, since the ALAudioSink PTS may be a little late, it renders even a slightly better sync in case of too early audio (d_apts < 0). Since video frames are sync'ed to audio, the resync procedure may result in a hysteresis swinging into sync. This might be notable at start and when resumed audio or after seek. We leave the audio frames untouched to reduce processing burden and allow non-disrupted listening. Passed AV sync tests - Five-minute-sync-test.mp4 - Audio-Video-Sync-Test-Calibration-23.98fps-24fps.mp4 - Audio-Video-Sync-Test-2.mkv
* GraphUI Shape: 'int name' -> 'int id' and add 'String name', change get/set ↵Sven Gothel2023-10-034-11/+11
| | | | methods accordingly
* GraphUI Scene: Add custom one-time GLRunnable disposable action list, ↵Sven Gothel2023-10-031-0/+4
| | | | | | | | allowing to properly take-down user resources at dispose(GLAutoDrawable) Used for UISceneDemo20 to stop and release SimpleSineSynth and its ALAudioSink. The latter causes a bad exit (crash at OpenAL32.dll) on OpenJDK's Window Binary if not stopped!
* Bug 1468 - SIGSEGV on use after free when destroying NEWT Window/Display via ↵Sven Gothel2023-10-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a native dispatch'ed event like key/mouse/touch input SIGSEGV on use after free of native X11 Display* at XEventsQueued in DisplayDriver.DispatchMessages0. This potentially happens when an application destroys the NEWT Window/Display from an action being called directly from DisplayDriver.DispatchMessages0 (itself), i.e. keyboard or mouse input. DisplayDriver.DispatchMessages0 stays in the event loop and the next XEventsQueued call causes a SIGSEGV due to already deleted display driver connection and hence invalid native X11 Display*. This issue also exist for other Windowing System drivers, where the native (dispatch) method sticks to a loop and still (re)uses the window or display handle. One is WindowsWindow, where touch events are looped, but such handler could have closed the window. Querying the status of a window / display instance before dispatching is not be good enough - resource could already be GC'ed, so we also would need to query jobject status - would imply an addition Java callback +++ This fix: Having the Java callbacks return a boolean with the value Window.isNativeValid(). This way the dispatch logic - can bail out right away w/o using the resource anymore - must be reviewed by myself due to changed Call{Void->Boolean}*(..) invocation change. This review shall resolve potential similar issues. +++ Tested on X11/Linux/GNU, Windows and MacOS with new TestDestroyGLAutoDrawableNewtAWT, which tests all destruction invocation variants.
* Bug 1468: Demos MiscUtil.destroyWindow() Call GLAutoDrawable.destroy() ↵Sven Gothel2023-10-013-7/+23
| | | | directly w/o mitigation attempts (off-thread)
* Bug 1465 - Graph / GraphUI: Render a Region's ColorTexture in proper ↵Sven Gothel2023-09-302-99/+338
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aspect-ratio, letter-boxed or zoomed (config) + Bug 1466 Fix color mixing Bug 1465: Region currently simply bloats a given texture to its region AABBox, which renders textures with the wrong aspect ratio. Add facility to program the texture-coordinates to either letter-box or scaled-up (and cut) true aspect-ratio. Default shall be zoom (scale-up and cut), but user shall be able to set a flag in the Region for letter-box. Have the shader clip texture coordinates properly, best w/o branching to soothe performance. See functions.glsl +++ Bug 1466: Current color mix: texture * color_channel * color_static is useless in GraphUI. color_static shall modulate the texture, which works. But in case of color_channel (attribute/varying) we want it to be mixed so it can become the more dominant color for e.g. a border. Desired is: color = vec4( mix( tex.rgb * gcu_ColorStatic.rgb, gcv_Color.rgb, gcv_Color.a ), mix( tex.a * gcu_ColorStatic.a, 1, gcv_Color.a) );
* GraphUI Demos: Minor refinements..Sven Gothel2023-09-262-5/+5
|
* GraphUI Demo UISceneDemo20: Give 'Show FPS' a toggle text 'Hide FPS' .. and ↵Sven Gothel2023-09-261-1/+2
| | | | have the text resize being of fixed aspect-ratio (like the movie)
* GraphUI Button: Support toggle'ed labels and fixed font size scaling for ↵Sven Gothel2023-09-264-37/+59
| | | | | | | | | | | | | | | | | | | | | | | | | symbols (see setFixedLabelSize()), This allows convenient instantiation of a Button changing its text (or symbol) when toggled, e.g.: UISceneDemo03: + final Button button = new Button(options.renderModes, fontSymbols, + fontSymbols.getUTF16String("play_arrow"), fontSymbols.getUTF16String("pause"), + buttonWidth, buttonHeight, buttonZOffset); + button.setSpacing(symSpacing, fixedSymSize); +++ setFixedLabelSize(..): Sets fixed label font size clipped to range [0 .. 1], defaults to {@code 0, 0}. Use {@code w=0, h=1} when using single symbols from fixed sized symbol fonts! Use {@link #setSpacing(Vec2f, Vec2f)} to also set spacing. The fixed label font size is used as the denominator when scaling.{@code max(fixedLabelSize, fontLabelSize)}, hence reasonable values are either {@code 1} to enable using the given font-size for the axis or {@code 0} to scale up/down the font to match the button box less spacing for the axis.
* Bug 1462 / 1462: GraphUI Demo UISceneDemo20: Replace some text in buttons ↵Sven Gothel2023-09-241-6/+7
| | | | with symbols
* GraphUI Demos UIMediaGrid01: Demos multiple MediaButton in a grid - ↵Sven Gothel2023-09-241-0/+360
| | | | performance & stability
* Graph Font Tests: Fix missing codepoint -> GlyphID conversionSven Gothel2023-09-241-2/+2
|
* Bug 1462 - Graph Font: Add name + codepoint to ID and Glyph mapping plus ↵Sven Gothel2023-09-246-33/+31
| | | | | | | | | traversing through all Glyphs See UISceneDemo03 new Button(options.renderModes, fontSymbols, " "+fontSymbols.getUTF16String("pause")+" ", buttonWidth, buttonHeight); // pause Unicode codepoint symbol is also contained in FontGlyph