aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1490 - GraphUI Group: Resolve Performance Issues with Shape Mv Transform ↵Sven Göthel2024-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | -> 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.
* Graph Clipping: Use Frustum Clipping using AABBox -> Mv transformed Cube -> ↵Sven Göthel2024-01-202-27/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-194-51/+199
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Graph/GraphUI AA-Quality + SampleCount (shader): Push params down to ↵Sven Göthel2024-01-165-52/+89
| | | | | | | | | | | | | | | | | | 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.
* 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'
* 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-147-9/+9
|
* Graph/GraphUI: Revise Graph Region ShaderMapping, fix AABBox-Clipping for ↵Sven Göthel2024-01-147-99/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* 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-092-0/+5
| | | | | | - 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-094-13/+39
| | | | | | | | | | | | (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 MediaPlayer / GLMediaPlayer: Add current chapter-title to info-fieldSven Göthel2024-01-071-1/+6
|
* GLMediaPlayer/FFMPEGMediaPlayer: Add chapter metadata support and use ↵Sven Gothel2023-12-301-4/+24
| | | | | | | | com.jogamp.common.av.PTS.millisToTimeStr(..) Chapter metadata is now supported via our FFMPEGMediaPlayer implementation. Added public method: 'Chapters[] GLMediaPlayer.getChapters()'
* 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-181-0/+4
| | | | information (if any), FFMPEG* utilizes NativeLibrary.get[Native]LibraryPath()
* Graph Region: Edit API doc for AA_RENDERING_MASKSven Gothel2023-12-181-1/+1
|
* Bug 1479 - NativeLibrary: Add getNativeLibraryPath() returning actual native ↵Sven Gothel2023-11-261-0/+2
| | | | library path, support throughout DynamicLibraryBundle[Info]
* Bug 1472: GLMediaPlayer: Expose SCR PTS and encourage its usage, removes ↵Sven Gothel2023-10-161-2/+20
| | | | 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: Utilize SCR aware audio PTS used as ↵Sven Gothel2023-10-151-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* TextureSequence.setTexCoordBBox(): Add 'verbose' parameter for debug output ↵Sven Gothel2023-10-031-4/+4
| | | | instead hard coded branch
* Bug 1471: Add a GLEventAdapter for GLEventListener similar to the other ↵Sven Gothel2023-10-021-0/+42
| | | | Adapter patterns
* Bug 1465 - Graph / GraphUI: Render a Region's ColorTexture in proper ↵Sven Gothel2023-09-304-9/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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-243-24/+78
| | | | | | | | | 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
* Graph Fonts: Add 'Material Icons Round-Regular' (APL-2 license) and use it ↵Sven Gothel2023-09-241-0/+6
| | | | in UISceneDemo03 via hard coded unicode symbol numbers
* Bug 1455 - GLMediaPlayer: Add isAutioMuted() query on volume and earmark ↵Sven Gothel2023-09-231-0/+3
| | | | | | | | audio-volume if not initialized and set it when AudioSink becomes available Setting the audio volume before initialization shall impact GLMediaPlayer when it becomes initialized. Further add a query if audio is muted, merely based on volume.
* Bug 1452: PMVMatrix4f: Drop redundant unused mulWith*(Vec*...) 'v_out = M * ↵Sven Gothel2023-09-231-102/+0
| | | | v_in', user can simply get the desired matrix and apply its mulVec*(..) operation
* Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit ↵Sven Gothel2023-09-2057-1365/+2506
| | | | | | | | | | | | | | | | | | | | agnostic (PMVMatrix, Matrix4f, Vec4f, ..) Math functionality (PMVMatrix, Matrix4f, Vec4f, ..) - shall be used toolkit agnostic, e.g. independent from OpenGL - shall be reused within our upcoming Vulkan implementation - may also move outside of JOGL, i.e. GlueGen or within its own package to be reused for other purposed. The 'com.jogamp.opengl.util.PMVMatrix' currently also used to feed in GLUniformData via the toolkit agnostic SyncAction and SyncBuffer shall also be split to a toolkit agnostic variant. An OpenGL PMVMatrix specialization implementing GLMatrixFunc can still exist, being derived from the toolkit agnostic base implementation. +++ Initial commit .. compile clean, passing most unit tests.
* Debug.debugExplicit(): Define and use explicit symbol debug flag; Use it for ↵Sven Gothel2023-09-163-4/+7
| | | | certain debug output to keep most silence for debugAll()
* FloatUtil.abs(a): Mark as deprecated, use Math.abs(a) directly. We assume it ↵Sven Gothel2023-09-044-13/+20
| | | | | | | | | | | | | | | | is an intrinsic + branch-less implementation Expected implementation is - return Float.intBitsToFloat(Float.floatToRawIntBits(a) & 0x7fffffff); replacing old implementation - return (a <= 0.0F) ? 0.0F - a : a; .. also market as @IntrinsicCandidate Hence we shall leave it to the JRE core-lib implementation...
* GraphUI Enhance: API doc; Scene/Button Z-offset and -epsilon; Push temp ↵Sven Gothel2023-09-041-0/+5
| | | | AffineTransform to local method; Simplify BaseButton setCorner(0) -> setPerp(); Protected abstract ctor ..
* FloatUtil.isEqual(..): Rename raw {isEqual->isEqualRaw}(a,b) varianr w/o ↵Sven Gothel2023-09-039-22/+84
| | | | | | EPSILON; Add isEqual(a,b) w/ default EPSILON; Use it where applicable Also add isEqual2(a,b) w/o corner cases (NaN, Inf) used for comparison in Graph Outline, OutlineShape and later GraphUI Shape.
* GraphUI Scene: Pass sampleCount in ctor variant and refine API doc, clip to ↵Sven Gothel2023-09-031-1/+12
| | | | [1..8]; Add clarity in Region; Demos CommandlineOptions adds actual graphAASamples set and utilized
* PMVMatrix.gluPerspective(): Redfine angle in radians instead of degrees ** ↵Sven Gothel2023-09-022-6/+18
| | | | | | | | API Change ** Since this is an extra implementation of PMVMatrix and not of GLMatrixFunc, we shall use the default ISO dimension avoiding conversion. This alsi redefined Graph's RegionRenderer.reshapePerspective() angle definition from degrees to radians
* Graph Font + Glyph: Fix whitespace definition: Include 'no original ↵Sven Gothel2023-09-011-13/+17
| | | | | | | | | | | | | | underlying shape' and add API doc Regression was introduced with commit 920e529516bb264f04138ed1caca80d4925e3773 'Robust detetection and API definition of non-contour/whitespace Glyphs'. Issue was mistaken a glyph as undefined if not having an underlying shape, which is true for some fonts (e.g. 'space'). +++ Also Use post table's name if no underlying shape exists.
* Graph Font + Glyph: More robust detetection and API definition of ↵Sven Gothel2023-08-284-8/+62
| | | | | | non-contour/whitespace Glyphs (detect and allow to skip 'em) We also drop shapes for both, but for id 0 (unknown).
* Graph Loop: Make initFromPolyline() and locateClosestVertex() more robust, ↵Sven Gothel2023-08-281-1/+1
| | | | | | report error but do not crash. This behavior has been evaluated with a few fonts and the WIP FontView01 demo application.
* AABBox: Fix intersects2DRegion(..), add resize{Height, Width}(..) and AABBox ↵Sven Gothel2023-08-271-4/+57
| | | | | | | | | ctor using Vec3f low and high intersects2DRegion(..) got the passed width and height wrong, i.e. given object low position >= this-low position and given object high position including width/height <= this-high position is required to match for intersection.
* Vec3f: Add UNIX_X and UNIX_X_NEG, enhance API docSven Gothel2023-08-271-2/+4
|
* Quaternion: Add rotateByAngleNormalAxis(..) variant using Vec3f axisSven Gothel2023-08-271-1/+18
|
* AABBox: Add set(AABBox)Sven Gothel2023-08-251-0/+13
|