aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl
Commit message (Collapse)AuthorAgeFilesLines
...
* Graph/GraphUI AA-Quality (shader): Region: Add DEFAULT_AA_QUALITY and ↵Sven Göthel2024-01-153-20/+34
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Bump (c) -2024 for edited files + LICENSE.txtSven Göthel2024-01-1412-14/+14
|
* Graph/GraphUI: Revise Graph Region ShaderMapping, fix AABBox-Clipping for ↵Sven Göthel2024-01-1419-327/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()
* GLReadBufferUtil: Allow passing a custom GL read-buffer name, useful to read ↵Sven Göthel2024-01-131-1/+8
| | | | FBO attachments (GL_COLOR_ATTACHMENTi)
* Matrix4f: Fix minor API doc parem ref-nameSven Göthel2024-01-131-1/+1
|
* Graph VBORegion2PVBAAES2: Fix Rescale (MAX texSize): renderFboHeight shall ↵Sven Göthel2024-01-121-1/+1
| | | | use winHeight (typo)
* AABBox resize{Width, Height}(..): Positive argument shall always denote ↵Sven Göthel2024-01-121-4/+4
| | | | expansion
* Graph Clipping: Add missing Modelview-Matrix (Mv) Multiplication / ConsiderationSven Göthel2024-01-094-2/+7
| | | | | | - 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-097-34/+111
| | | | | | | | | | | | (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
* Graph Clipping: GLSL: Add `USE_AABBOX_CLIPPING`, i.e. clipping via AABBox ↵Sven Göthel2024-01-098-19/+50
| | | | | | | | | | | | | | | 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.
* Graph GLSL functions.glsl: Complete overload vec2 and vec3 variants; Fix ↵Sven Göthel2024-01-091-8/+52
| | | | | | | | | | | | | | | | | | '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.
* GraphUI MediaPlayer / GLMediaPlayer: Add current chapter-title to info-fieldSven Göthel2024-01-073-3/+20
|
* GLMediaPlayer/FFMPEGMediaPlayer: Add chapter metadata support and use ↵Sven Gothel2023-12-309-19/+174
| | | | | | | | com.jogamp.common.av.PTS.millisToTimeStr(..) Chapter metadata is now supported via our FFMPEGMediaPlayer implementation. Added public method: 'Chapters[] GLMediaPlayer.getChapters()'
* OMXGLMediaPlayer: Add 'printNativeInfo(..)' - completes commit ↵Sven Gothel2023-12-181-0/+6
| | | | d99c2d8b28470d335ab5b30124ef8b0607b3b90f
* GLMediaPlayer: TEXTURE_COUNT_DEFAULT 4 -> 3 as tested via UIMediaGrid01, ↵Sven Gothel2023-12-181-1/+1
| | | | usable w/ fix for Bug 1472 (Enhance A/V Sync)
* GLMediaPlayer: Add printNativeInfo(..) exposing used native library ↵Sven Gothel2023-12-186-38/+90
| | | | information (if any), FFMPEG* utilizes NativeLibrary.get[Native]LibraryPath()
* Graph Shader: Fix 'curverenderer01-single.vp' aligning w/ ↵Sven Gothel2023-12-181-2/+3
| | | | 'curverenderer01-pass1.vp' (commit 297c48f4fefd1ab59800524ea5f0dd56684d6786)
* Graph Region: Edit API doc for AA_RENDERING_MASKSven Gothel2023-12-181-1/+1
|
* FFMpeg: Just be nice and flush GL stream, no finish sync requiredSven Gothel2023-12-041-2/+8
|
* FFMpeg: Fix and clarify 'resend package' and 'continue draining frames' statesSven Gothel2023-12-041-21/+30
|
* Bug 1479 - NativeLibrary: Add getNativeLibraryPath() returning actual native ↵Sven Gothel2023-11-264-5/+16
| | | | library path, support throughout DynamicLibraryBundle[Info]
* GLMediaPlayer.getPerfString(): Don't show audio pts values is no_audio, ↵Sven Gothel2023-10-161-17/+19
| | | | misleading and wrong info (e.g. on mute)
* GLMediaPlayer: Don't resetAVPTS() on resume(), allowing less AV sync ↵Sven Gothel2023-10-161-13/+10
| | | | disruption after pause(flush:=false)
* GLMediaPlayer: Recognize !use_audio when repeating (caching) a video-frame, ↵Sven Gothel2023-10-161-26/+27
| | | | i.e. ignore audio_queued_ms in such case (Fixes video sync on SCR w/o audio)
* GLMediaPlayerImpl: Use a PTS av_scr_cpy from av_scr for getPTS() avoiding ↵Sven Gothel2023-10-161-7/+12
| | | | direct user-exposure and potential data-race
* GLMediaPlayerImpl: Don't reset SCR on video_scr_reset or irq'ed rendering ↵Sven Gothel2023-10-161-2/+2
| | | | w/o video-frame (fixes 'massive' seek'ing)
* FFMPEGMediaPlayer: Remove unconditional DEBUG outputSven Gothel2023-10-161-1/+1
| | | | Left behind hacking for AV sync ..
* Bug 1472: GLMediaPlayer.getNextTexture(): Fix playSpeed > 1; Handle ↵Sven Gothel2023-10-161-88/+86
| | | | | | !hasVideoFrame upfront, simplifying sync-block Fix playSpeed > 1: dt_v (keep playSpeed factor), allow drop frame on no-frames w/ playSpeed > 2
* Bug 1472: GLMediaPlayer: Handle setPlaySpeed() like setAudioVolume() if ↵Sven Gothel2023-10-161-15/+18
| | | | 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-162-4/+25
| | | | user from selecting video or audio PTS.
* GLJPanel: Fix DEBUG output USE_GLSL_TEXTURE_RASTERIZER -> ↵Sven Gothel2023-10-161-1/+1
| | | | USE_GLSL_VERTICAL_FLIP, changed names in commit d6cf89f22a5926b437c4430eb166972d90fd92be
* GLJPanel: Allow disabling GLSL vertical flip programmatically via ↵Sven Gothel2023-10-161-14/+26
| | | | | | | | | | | | | | setUseGLSLVerticalFlip(false) in addition to property 'jogl.gljpanel.noglsl' Suche setting would enable the slow path of flipping a potentially 'big' framebuffer via the CPU. The best performance path is using the GLSL shader to vertically flip the FBO, or - w/o using the shader - to render the GL scene vertically-flipped and set the flag 'flipVertical' to false. - property "jogl.gljpanel.noverticalflip" - setter setSkipGLOrientationVerticalFlip(boolean) If set to <code>true</code>, user needs to flip the OpenGL rendered scene <i>if {@link #isGLOriented()} == true</i>, e.g. via the projection matrix.<br/> See constraints of {@link #isGLOriented()}.
* Bug 1472: Enhance GLMediaPlayer AV Sync: Fine tune AV heuristics to ↵Sven Gothel2023-10-151-20/+28
| | | | | | | | | | | | | | | | | | | | | | | | (multiple of) audio_dequeued_ms The case of lagging audio to the audio master-clock (by experience) is a rare and probably synthethic case of the AV async videos, was dt_a > MAX_VIDEO_ASYNC && d_apts > 0 now with increased threshold max_adelay = Math.max( 4*audio_dequeued_ms, 4*MAX_VIDEO_ASYNC ) dt_a > max_adelay && d_apts > 0 In conjunction the video-repeat case (video pts > SCR) shall use a higher threshold _when_ detecting, i.e. min1_audio_queued_ms = Math.max( 2*audio_dequeued_ms, 2*MAX_VIDEO_ASYNC ) to ensure enough buffered audio exists (2 audio-frames) before the next getNextTexture() hits within vsync. This early detection and min1_audio_queued_ms threshold is double of the late threshold for video-repeat min0_audio_queued_ms = Math.max( audio_dequeued_ms, MAX_VIDEO_ASYNC ), when the to-be repeated frame shall be displayed within getNextThreshold(). Failing this requirement (1 audio-frame) will discard it and gather the next video-frame, allowing to fill the audio-buffer. A subsequent AV sync shall correct the difference. Strategy is less intervention on less buffered-audio. This shorter tolerance also reduces some video lag or stuttering on 24fps -> 60fps films.
* Bug 1472: Enhance GLMediaPlayer AV Sync: Fix FFMPEGMediaPlayer's audio ↵Sven Gothel2023-10-152-5/+10
| | | | | | | | | resample: Use swr_get_out_samples(..) to calculate the required output sample count Notable when playing audio with e.g. 24k sample rate on a 48k OpenAL ALAudioSink, the sample duration was cut in half due to erroneous resampling missing half the required samples. Using swr_get_out_samples(..) resolves this issue pre swr_convert(..), the resampling.
* Bug 1472: Enhance GLMediaPlayer AV Sync: Utilize SCR aware audio PTS used as ↵Sven Gothel2023-10-157-240/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Bug 1472: GLMediaPlayerImpl: Track repeatedFrame countSven Gothel2023-10-041-5/+5
|
* Bug 1472: GLMediaPlayer AVSync: Refine AVSync debug output (WIP)Sven Gothel2023-10-041-12/+47
| | | | Using `-Djogl.debug.GLMediaPlayer.AVSync -Djogamp.debug.AudioSink` to trace AVSync issues for now.
* Bug 1473 - ALAudioSink: AV Synchronization: Adopt to JOAL ALAudioSink changesSven Gothel2023-10-041-6/+6
| | | | | FFMPEGMediaPlayer: This also effectively reduces the audio buffer size from 3000ms -> 768ms, the new default for audio streams with video.
* FFMPEGMediaPlayer: Always use own textureLookupShader and validate its ↵Sven Gothel2023-10-031-26/+65
| | | | | | | | | | | custom name against GLSL internal 'texture2D', add missing VideoPixelFormat conversions Always use own textureLookupShader, avoiding confusion or even race conditions. Validate textureLookupShader custom name against GLSL internal 'texture2D' (illegal override) Add missing VideoPixelFormat conversions: - RGB24, ARGB, RGBA, ABGR, BGRA
* TextureSequence.setTexCoordBBox(): Add 'verbose' parameter for debug output ↵Sven Gothel2023-10-034-7/+7
| | | | instead hard coded branch
* Bug 1470 - FFmpeg / JNI: Perform exception check and rethrow for all Java ↵Sven Gothel2023-10-023-7/+48
| | | | Callbacks as recommended
* Bug 1471: Add a GLEventAdapter for GLEventListener similar to the other ↵Sven Gothel2023-10-021-0/+42
| | | | Adapter patterns
* Bug 1469 - FFmpeg binding uses ReleaseStringChars instead of ↵Sven Gothel2023-10-021-12/+14
| | | | ReleaseStringUTFChars for GetStringUTFChars() acquired UTF
* Bug 1468 - SIGSEGV on use after free when destroying NEWT Window/Display via ↵Sven Gothel2023-10-022-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* FFMPEGMediaPlayer: Insert GLSL comment-line documenting the addressed ↵Sven Gothel2023-09-301-1/+6
| | | | VideoPixelFormat conversion for easier debugging
* Bug 1465 - Graph / GraphUI: Render a Region's ColorTexture in proper ↵Sven Gothel2023-09-3013-81/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) );
* Bug 1430 - Fix Background erase not disabled with AWT GLCanvas and NewtCanvasAWTSven Gothel2023-09-291-2/+10
| | | | | | | | | | Commit c5431f46b7bf64f109315ec78461859dd88f202a reduced the disableBackgroundErase(..) to SunToolkit's variation which doesn't work on Windows as it does not act upon the java.awt.Canvas peer post addNotify(). This re-introduces the java.awt.Canvas method via class JAWTUtil.BackgroundEraseControl and its called only after addNotify() on Windows and ASAP for everyone else. Method also calles the SunTookit variation just to be sure.
* Bug 1463 - Graph Font: Whitespace or undefined Glyphs shall not cover (any) ↵Sven Gothel2023-09-261-4/+7
| | | | | | | | | | | | | | | | | | height exceeding overall CharSequence TypecastFont using `metrics.getAscentFU() - metrics.getDescentFU()` for ascent used for all undefined and whitespace Glyphs w/o a spatial outline, leads to a potential exceeding height compared to the actual used bounding box of the rendered text. This in turn leads to layout issues, e.g. button labels are placed too low. Solution: - Whitespace/Undefined: Drop full height 'metrics.getAscentFU() - metrics.getDescentFU()', b/c of non-existing shape height. - Otherwise, layout on AABBox or created empty shape would pick up such default hhea-table ascent which might exceed actual string height. Sideeffect would be if user relies on height of a whitespace. However, knowing this fact - a user may always pick the hhea-table's ascent metric values as exposed in Font and Font.Metric. This resolves remaining layout issues, including button labels.
* Graph Font: API doc: Fix typos 'Return ' .. to 'Returns `.Sven Gothel2023-09-241-17/+20
|
* Bug 1462 - Graph Font: Add name + codepoint to ID and Glyph mapping plus ↵Sven Gothel2023-09-245-140/+293
| | | | | | | | | 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