aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
Commit message (Collapse)AuthorAgeFilesLines
* Graph Clipping: Initial Region impl of AABBox clipping using GLSL shader ↵Sven Göthel2024-01-093-21/+72
| | | | | | | | | | | | (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.
* Graph Shader: Fix 'curverenderer01-single.vp' aligning w/ ↵Sven Gothel2023-12-181-2/+3
| | | | 'curverenderer01-pass1.vp' (commit 297c48f4fefd1ab59800524ea5f0dd56684d6786)
* TextureSequence.setTexCoordBBox(): Add 'verbose' parameter for debug output ↵Sven Gothel2023-10-033-3/+3
| | | | instead hard coded branch
* Bug 1465 - Graph / GraphUI: Render a Region's ColorTexture in proper ↵Sven Gothel2023-09-309-72/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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.
* Bug 1462 - Graph Font: Add name + codepoint to ID and Glyph mapping plus ↵Sven Gothel2023-09-242-116/+215
| | | | | | | | | 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-243-0/+86
| | | | in UISceneDemo03 via hard coded unicode symbol numbers
* Graph Fonts UbuntuFontLoader: Factor out FontLoaderImpl and have get(..) ↵Sven Gothel2023-09-242-103/+139
| | | | synchronized for static fontMap field access
* Graph Fonts: Remove not required text files from Ubuntu fontsSven Gothel2023-09-243-409/+0
|
* Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit ↵Sven Gothel2023-09-2013-29/+29
| | | | | | | | | | | | | | | | | | | | 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-5/+15
| | | | certain debug output to keep most silence for debugAll()
* Graph Font + Glyph: Fix whitespace definition: Include 'no original ↵Sven Gothel2023-09-011-7/+9
| | | | | | | | | | | | | | 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: Make TypecastRenderer.DEBUG package private to be used by ↵Sven Gothel2023-08-281-1/+1
| | | | TypecastFont
* Graph Font + Glyph: More robust detetection and API definition of ↵Sven Gothel2023-08-282-55/+109
| | | | | | 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-283-11/+33
| | | | | | report error but do not crash. This behavior has been evaluated with a few fonts and the WIP FontView01 demo application.
* Graph Add {GLRegion, GraphShape}.setTextureUnit(int): Allowing to set ↵Sven Gothel2023-08-013-0/+15
| | | | texture unit after ctor
* Relocate 'jar/atomic/jogl-fonts-p0.jar' -> 'jar/jogl-fonts-p0.jar' to ↵Sven Gothel2023-05-201-2/+1
| | | | | | | simplify inclusion in distribution; UbuntuFontLoader's Uri is patched accordingly. This font jar file is actually not an atomic in the sense it being aggregated to e.g. jogl-all.jar or even a fat jar. Hence it is more suitable to have it all visible in the top-dir next to the main jars.
* Graph CDTriangulator2D: Drop invalid innerPoly, avoiding ↵Sven Gothel2023-05-051-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Loop.initFromPolyline(..) outline.getGraphPoint().size() < 3 IllegalArgumentException This issue has to be added to our CD .. /* * Font FreeMono-Bold: ID 0 + 465: Glyph[id 465 'uni020F', advance 600, leftSideBearings 42, kerning[size 0, horiz true, cross true], shape true], OutlineShape@5e8a459[outlines 2, vertices 34] Drop innerPoly ctrlpts < 3 - innerPo[vertices 2, ctrlpts 2] < 3 - outline[vertices 4, ctrlpts 4] - Input[vertices 4] * * Font FreeSans-Regular: ID 0 + 409: Glyph[id 409 'Udieresiscaron', advance 720, leftSideBearings 80, kerning[size 0, horiz true, cross false], shape true], OutlineShape@5eb97ced[outlines 3, vertices 33] Drop innerPoly ctrlpts < 3 - innerPo[vertices 1, ctrlpts 1] < 3 - outline[vertices 1, ctrlpts 1] - Input[vertices 1] * Stack: at jogamp.graph.curve.tess.CDTriangulator2D.addCurve(CDTriangulator2D.java:97) at com.jogamp.graph.curve.OutlineShape.triangulateImpl(OutlineShape.java:988) at com.jogamp.graph.curve.OutlineShape.getTriangles(OutlineShape.java:1012) at com.jogamp.graph.curve.Region.countOutlineShape(Region.java:503) at com.jogamp.graph.ui.shapes.GlyphShape.<init>(GlyphShape.java:77) */
* Graph OutlineShape.get{Outline->}VectexCount() renamedSven Gothel2023-04-201-1/+1
|
* Graph GLRegion*: Utilize interleaved GLSL buffers for vertices, curveParams ↵Sven Gothel2023-04-203-104/+14
| | | | | | | | | | | and the optional colors (GPU effeciency and performance; Increased CPU buffer growth performance) Besides simplification, interleaved GPU memory boosts - effeciency - performance Since only one underlying backing buffer on the CPU (host) has to be managed, it also increases buffer growth performance.
* Graph VBORegion2P*.renderVBO(): Add comment on ↵Sven Gothel2023-04-192-0/+9
| | | | BITHINT_GLOBAL_DEPTH_TEST_ENABLED usage -> To be investigated.
* Graph GLRegion: Consolidate pass-1 common data (indices, vertices, ..) and ↵Sven Gothel2023-04-193-462/+2
| | | | all related methods. Add growCount stat.
* Graph Font.getGlyphShapeBounds(): Use variant w/ 2 temp AffineTransform ↵Sven Gothel2023-04-181-4/+5
| | | | matching getGlyphBounds()
* Graph + GraphUI: Consolidate Vertex: Drop SVertex and factory, use Vec[234]f ↵Sven Gothel2023-04-189-108/+118
| | | | | | | | | | | instead of float[] and remove unused VectorUtil methods After Matrix4f consolidation and proving same or better performance on non array types, this enhances code readability, simplifies API, reduces bugs and may improve performance. GraphUI: - Have RoundButton as a functional class to make a round or rectangular backdrop, i.e. impl. addShapeToRegion() via reused addRoundShapeToRegion()
* Typecast Font.getGlyph(..): Fix Glyph case w/ 0 getOutlineVectexCount() -> ↵Sven Gothel2023-04-141-4/+14
| | | | isWhiteSpace = true, use emptyShape
* Typecast Font.Glyph: Expose isUndefined(), i.e. name == ".notdef"Sven Gothel2023-04-141-0/+3
|
* Typecast: Expose (new) getGlyphCount(): GlyfTable.getSize() -> ↵Sven Gothel2023-04-144-1/+13
| | | | (OTFont,Font).getGlyphCount()
* Typecast GlyfTable: Use `final` qualifier (cleanup)Sven Gothel2023-04-141-14/+14
|
* Graph TypecastFont: Avoid PostTable (out-of-bounds) for glyph_name when not ↵Sven Gothel2023-04-141-3/+7
| | | | even a Glyph was mapped to the ID
* Matrix4f.mapWin*(): Drop unused temp matrices, map*() returns false on ↵Sven Gothel2023-04-092-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | invPMv null; PMVMatrix: Make Mvi, Mvit optional at ctor, add user PMv and PMvi - used at gluUnProject() .. Matrix4f.mapWin*() variants w/ invPMv don't need temp matrices, they also shall handle null invPMv -> return false to streamline usage w/ PMVMatrix if inversion failed. PMVMatrix adds user space common premultiplies Pmv and Pmvi on demand like Frustum. These are commonly required for e.g. gluUnProject(..)/mapWinToObj(..) and might benefit from caching if stack is maintained and no modification occured. PMVMatrix now has the shader related Mvi and Mvit optional at construction(!), so its backing buffers. This reduces footprint for other use cases. The 2nd temp matrix is also on-demand, to reduce footprint for certain use cases. Removed public access to temporary storage. +++ While these additional matrices are on demand and/or at request @ ctor, general memory footprint is reduced per default and hence deemed acceptable while still having PMVMatrix acting as a core flexible matrix provider.
* VBORegion2P*ES2: Just instantiate SyncMatrices4f16 in place, drop local refSven Gothel2023-04-072-5/+2
|
* PMVMatrix rewrite using Matrix4f, providing SyncMatrix4f* for GLUniformData; ↵Sven Gothel2023-04-072-38/+33
| | | | | | | | | | | | | | | | | Utilize Vec3f, Recti, .. throughout API (Matrix4f, AABBox, .. Graph*) Big Easter Cleanup - Net -214 lines of code, despite new classes. - GLUniformData buffer can be synced w/ underlying data via SyncAction/SyncBuffer, e.g. SyncMatrix4f + SyncMatrices4f - PMVMatrix rewrite using Matrix4f and providing SyncMatrix4f/Matrices4f to sync w/ GLUniformData - Additional SyncMatrix4f16 + SyncMatrices4f16 covering Matrix4f sync w/ GLUniformData w/o PMVMatrix - Utilize Vec3f, Recti, .. throughout API (Matrix4f, AABBox, .. Graph*) - Moved FloatUtil -> Matrix4f, kept a few basic matrix ops for ProjectFloat - Most, if not all, float[] and int[] should have been moved to proper classes - int[] -> Recti for viewport rectangle - Matrix4f and PMVMatrix is covered by math unit tests (as was FloatUtil before) -> save Passed all unit tests on AMD64 GNU/Linux
* Math: Complete Matrix4f w/ Vec[234]f and adopt it throughout Quaternion, ↵Sven Gothel2023-04-053-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ray, AABBox, Frustum, Stereo*, ... adding hook to PMVMatrix Motivation was to simplify matrix + vector math usage, ease review and avoid usage bugs. Matrix4f implementation uses dedicated float fields instead of an array. Performance didn't increase much, as JVM >= 11(?) has some optimizations to drop the array bounds check. AMD64 + OpenJDK17 - Matrix4f.mul(a, b) got a roughly ~10% enhancement over FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~3% slower than FloatUtil.multMatrix(a, b, dest) - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.invert(..) roughly ~3% slower than FloatUtil.invertMatrix(..) RaspberryPi 4b aarch64 + OpenJDK17 - Matrix4f.mul(a, b) got a roughly ~10% enhancement over FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~20% slower than FloatUtil.multMatrix(a, b) - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.invert(..) roughly ~4% slower than FloatUtil.invertMatrix(..) Conclusion - Matrix4f.mul(b) needs to be revised (esp for aarch64) - Matrix4f.invert(..) should also not be slower ..
* Graph Shader: Complete the USE_DISCARD logic avoiding output set after ↵Sven Gothel2023-03-3012-36/+67
| | | | discard, even though technically allowed (ignored after discard)
* Graph GLSL: Enable 'discard' in fragment shader w/o ↵Sven Gothel2023-03-3013-50/+53
| | | | | | | | | GLRendererQuirks.GLSLBuggyDiscard to avoid overdraw of such regions. Historically we disabled `discard` due to an old NV tegra2 compiler bug, which caused the compiler to freeze. Today we no more seem to have this GLSL compiler issue, i.e. GLRendererQuirks.GLSLBuggyDiscard never gets set.
* Graph Font: TypecastFont: getGlyphBoundsFU() + processString(): If ↵Sven Gothel2023-03-281-4/+6
| | | | isWhitespace() continue w/ AABBox resize, but don't earmark this (whitespace) glyph for next left_glyph (kerning).
* Graph Font.GlyphVisitor*: Pass 'char symbol' to visitor, passing full ↵Sven Gothel2023-03-281-5/+3
| | | | text-processing information
* Graph Font.Glyph: Add getFont() (the owner)Sven Gothel2023-03-281-0/+5
|
* Graph Font: Rename getBBox*() -> getBounds*() to preserve a common semantic nameSven Gothel2023-03-273-8/+8
|
* Graph: Fix Font.getGlyphBoundsFU(): FU of advance is requested here.Sven Gothel2023-03-271-1/+1
| | | | Regression from commit a5d593478afa2298282a0624b2490fde84c3a292
* Graph Font Processing: Use Font.GlyphVisitor instead of ↵Sven Gothel2023-03-221-9/+15
| | | | OutlineShape.Visitor, allowing to use the Glyph (information).
* Graph Font Processing: Produce a 'whitespace' Glyph w/ an OutlineShape (box) ↵Sven Gothel2023-03-223-5/+76
| | | | to allow better handling of such non-contour symbols.
* Graph: Cleanup Vertex.Factory referencing: Only bind to OutlineShape and use ↵Sven Gothel2023-03-211-11/+8
| | | | | | | its default. GraphUI: Always use default. Graph RegionRenderer, its RenderState as well as GraphUI's Scene don't need to have knowledge of Vertex.Factory, which is only used within OutlineShape and its 'inner geom workings'.
* Graph: GLRegion: Pass curRenderModes to updateImpl() + drawImpl(), prepare ↵Sven Gothel2023-03-193-65/+100
| | | | switch by sampleCount; Don't use any resource not requested by curRenderModes
* Fix ShaderProgram ownership bug, introduced in commit ↵Sven Gothel2023-03-153-35/+9
| | | | | | | | | 67a723477ecd818fbc5859fe20ee536a3b4efae5 (reverting and clarifying) All Graph ShaderPrograms used are owned by RegionRenderer, not RenderState nor [GL]Region*, hence [GL]Region* shall only nullify the resources but not destroy the shader currently in use. One RegionRenderer maybe used for multuple Regions.
* Graph: Have RegionRenderer.reshapeNotify(..) track x/y as well (vieport); ↵Sven Gothel2023-03-141-3/+6
| | | | GraphUI.Scene using RegionRenderer's viewport (no duplicate)
* GLRegion + RegionRenderer: Add clearShader(..) to delete all ShaderPrograms ↵Sven Gothel2023-03-133-5/+32
| | | | and is references.
* Graph: Font: Add equals() + hash() API doc; GraphUI's Label*.setText(): Only ↵Sven Gothel2023-03-081-2/+1
| | | | modify values if text and/or font differs, skipping markShapeDirty() saves performance.