aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit ↵Sven Gothel2023-09-2036-11244/+101
| | | | | | | | | | | | | | | | | | | | 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-161-1/+1
| | | | 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-042-7/+14
| | | | | | | | | | | | | | | | 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-037-20/+82
| | | | | | 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.
* PMVMatrix.gluPerspective(): Redfine angle in radians instead of degrees ** ↵Sven Gothel2023-09-021-3/+3
| | | | | | | | 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: More robust detetection and API definition of ↵Sven Gothel2023-08-281-0/+20
| | | | | | non-contour/whitespace Glyphs (detect and allow to skip 'em) We also drop shapes for both, but for id 0 (unknown).
* 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
|
* Vec[234]f: Add scale(Vec[234]f s) variant for convenienceSven Gothel2023-08-233-0/+9
|
* Bug 1310: Reset GLJPanel states @ dispose(..) and always reshapeImpl(..) @ ↵v2.5.0Sven Gothel2023-08-181-7/+30
| | | | | | | | | addNotify(), leading to proper initialization sequence when re-adding panel. The proper initialization sequence subsequently also leads to proper glViewport initialization, see commit d17d807a76ba9cb940542264fcad9cf71c7ec585 No side-effects expected, just ensuring same code-path compared to initial addNotify().
* GraphUIDemoArgs: Issue GLProfile.initSingleton() once in static init block, ↵Sven Gothel2023-08-131-1/+1
| | | | | | ensuring JOGL is completely initialized Noteable: On MacOS 13.1 (aarch64) UISceneDemo20 won't show the window if NEWT is initialized before JOGL core via GLProfile.initSingleton().
* Minor cleanup of imports, etc: FBObject, GLContext*, Texture, ..Sven Gothel2023-08-135-45/+30
| | | | TODO: Full cleanup perhaps
* Texture ctor w/ external textureID: Pass `ownsTextureID` where true hands ↵Sven Gothel2023-08-131-10/+28
| | | | | | | | | over ownership and allows destroy() to delete it, otherwise not. Fixes GraphUI's GLButton. GraphUI's GLButton uses the offscreen's FBO texture and hence can't pass over ownership of the texture. Hence the Texture instance is created w/o handing over ownership! GLMediaPlayerImpl does hand over ownership of the generated and passed texture to the Texture ctor.
* Animator*: Add ctor variants passing modeBits directly, i.e. enable/disable ↵Sven Gothel2023-08-133-37/+177
| | | | AWT rendering thread support. Adopt it in tests and demos
* GLMediaPlayer: Show more reasonable DEBUG output in factory; Impl initGL(GL) ↵Sven Gothel2023-08-111-2/+20
| | | | shall handle null streamWorker, i.e. when using NullGLMediaPlayer
* Add {GL, GLContext}.getDefaultDrawBuffer() to complement getDefaultReadBuffer()Sven Gothel2023-07-153-28/+80
|
* Use DPI scaling to scale drawn fonts.Glenn Burkhardt2023-06-041-1/+14
|
* GLMediaPlayer: Add setAudioChannelLimit(..), correlating with ↵Sven Gothel2023-05-231-0/+15
| | | | | | | AudioSink.setChannelLimit() .. May be utilized to enforce 1 channel (mono) downsampling in combination with JOAL/OpenAL to experience spatial 3D position effects.
* Common av classes (*AudioSink, ..) are promoted to gluegen (commit ↵Sven Gothel2023-05-175-590/+3
| | | | 270172bcbd91f96d4a38a3d73e23d744f57a25b8) and joal (commit 03f4bb63ce8a358b1c2ef303480e1887d72ecb2e)
* HiDPI: Revise AWT GLCanvas/GLJPanel ScalableSurface: No setSurfaceScale(), ↵Sven Gothel2023-05-152-116/+118
| | | | | | | | | | | have AWT toolkit define pixelScale only (simplification) This aligns with Glenn's initial AWT patch commit e5e7514d649cd7dd28bbb8e04b72338dc09c2c83, i.e. removing redundancies... Tested on Linux, Windows and MacOS w/ GLCanvas, GLJPanel and GLWindow using pixelScale values: - Linux: 1, 2 - Windows: 1, 1.25, 2 - MacOS: 1, 2
* GLMediaPlayer: Replace GLMediaEventListener.EVENT_CHANGE_* 'int event_mask' ↵Sven Gothel2023-05-091-39/+112
| | | | with EventMask.Bit/EventMask
* AudioSinkFactory: Add debug output in case of failed initializationSven Gothel2023-05-041-0/+2
|
* AABBox: Add 'translate' w/ dedicated componentsSven Gothel2023-04-281-0/+15
|
* [PMV]Matrix[4f]: Clarify 'mulVec[34]f' in-place arg properties, add pure ↵Sven Gothel2023-04-282-16/+113
| | | | in-place variant and use it in PMVMatrix dropping temporary
* Vec[234]f: Add 'max' and 'min' functionSven Gothel2023-04-283-0/+45
|
* GLArrayDataClient: Refine API doc for grow*() and reserve()Sven Gothel2023-04-201-2/+2
|
* GLArrayDataServer.addGLSLSubArray(): Return (actual) GLArrayDataWrapper ↵Sven Gothel2023-04-201-1/+1
| | | | instead of just GLArrayData interface, exposing and allowing mutable access to attribute location for interleaved sub-arrays
* VectorUtil: Fix isVec3InTriangle3(..) testing p1, p2 and p3Sven Gothel2023-04-181-12/+8
|
* Graph + GraphUI: Consolidate Vertex: Drop SVertex and factory, use Vec[234]f ↵Sven Gothel2023-04-186-592/+199
| | | | | | | | | | | 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()
* Graph/Math: Cleanup toString(), spacing and use System.lineSeparator()Sven Gothel2023-04-124-27/+21
|
* Matrix4f.mapWin*(): Drop unused temp matrices, map*() returns false on ↵Sven Gothel2023-04-092-335/+603
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* PMVMatrix: Expose temporary storage (w/o side-effects) for efficiency; ↵Sven Gothel2023-04-081-1/+42
| | | | | | | GraphUI.Shape: Efficiently reuse matPMv and temporary PMVMatrix storage Reuse PMv in Shape.getSurfaceSize() and Shape.winToShapeCoord(), for the latter we invert the reused PMv for mapWinToObj (i.e. UnProject).
* PMVMatrix API doc: Use `` to quote code since {@code } causes block-quoting ↵Sven Gothel2023-04-081-5/+5
| | | | w/ Doxygen. Doxygen uses markdown
* PMVMatrix rewrite using Matrix4f, providing SyncMatrix4f* for GLUniformData; ↵Sven Gothel2023-04-0718-1403/+1513
| | | | | | | | | | | | | | | | | 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
* Matrix4f Perf: Enhance invert(), Drop (test) load on Matrix4f.mul(Matrix4f) ↵Sven Gothel2023-04-052-89/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for fair and realistic numbers - Both mul() ops faster than FloatUtil Enhanced invert() of Matrix4f* and FloatUtil: Use 1f/det factor for burst scale. Enhanced Matrix4f.invert(..): Use factored-out mulScale() to deliver the scale, giving a good 10% advantage on aarch64 and amd64. Brings Matrix4f.invert(..) on par w/ FloatUtil, on aarch64 even a 14% advantage. +++ TestMatrix4f02MulNOUI added an additional Matrix4f.load() to the mul(Matrix4f) loop test, which surely is an extra burden and not realistic as the mul(Matrix4f, Matrix4f) and FloatUtil pendants also don't count loading a value. Matrix4f.mul(Matrix4f) shall be used to utilize an already stored value anyways. Matrix4f.mul(Matrix4f) didn't really exist in FloatUtil. Same is true for Matrix4f.invert(), re-grouped order, i.e. pushing the non-arg variant last. +++ Revised performance numbers from commit 15e60161787224e85172685f74dc0ac195969b51 AMD64 + OpenJDK17 - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.mul(a, b) roughly ~10% faster than FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~18% faster than FloatUtil.multMatrix(a, b, dest) (*) - Matrix4f.invert(a) roughly ~ 2% faster than FloatUtil.invertMatrix(..) - Matrix4f.invert() roughly ~ 4% slower than FloatUtil.invertMatrix(..) (*) - Launched: nice -19 scripts/tests-x64.sh RaspberryPi 4b aarch64 + OpenJDK17 - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.mul(a, b) roughly ~ 9% faster than FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~14% faster than FloatUtil.multMatrix(a, b, dest) (*) - Matrix4f.invert(a) roughly ~14% faster than FloatUtil.invertMatrix(..) - Matrix4f.invert() roughly ~12% faster than FloatUtil.invertMatrix(..) (*) - Launched: nice -19 scripts/tests-linux-aarch64.sh (*) not a true comparison in feature, as operating on 'this' matrix values for one argument, unavailable to FloatUtil. Conclusion - Matrix4f.mul(..) is considerable faster! - Matrix4f.invert(..) faster, esp on aarch64 And additional Matrix4fb tests using float[16] similar to FloatUtil also demonstrates less performance compared to Matrix4f using dedicated float fields.
* AABBOX: Revert API doc copy/type errors from commit ↵Sven Gothel2023-04-051-7/+7
| | | | 15e60161787224e85172685f74dc0ac195969b51
* Math: Complete Matrix4f w/ Vec[234]f and adopt it throughout Quaternion, ↵Sven Gothel2023-04-0518-857/+3194
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ..
* Vec2f, Vec3f: Return this @ set(..), add set(float[]) and add(float, ..)Sven Gothel2023-03-302-22/+60
|
* Quaternion: Shorten toString() type nameSven Gothel2023-03-271-1/+2
|
* Add Vec2f and Vec3f, to support a more simple OO vector-math usage, e.g. for ↵Sven Gothel2023-03-222-0/+528
| | | | | | | | animation etc Implementation borrowed my 'gfxbox2' C++ project <https://jausoft.com/cgit/cs_class/gfxbox2.git/tree/include/pixel/pixel3f.hpp#n29> and its layout from OpenAL's Vec3f.
* Graph Font Processing: Use Font.GlyphVisitor instead of ↵Sven Gothel2023-03-221-0/+10
| | | | OutlineShape.Visitor, allowing to use the Glyph (information).
* GraphUI UISceneDemo*: Use lambdas for GLAutoDrawable.invoke(..) to reduce LOCSven Gothel2023-03-211-0/+7
| | | | GLAutoDrawable.invoke(..) API doc: Add semantics about GLRunnable return value.
* GLArrayDataClient: Allow null buffer @ growIfNeeded(), removed from commit ↵Sven Gothel2023-03-201-20/+1
| | | | | | 90a95e6f689b479f3c3ae3caf4e30447030c7682 A null buffer is possible in case initialElementCount at ctor is <= 0
* GLOffscreenAutoDrawable: Remove unused importSven Gothel2023-03-201-2/+0
|
* Add FloatUtil.isZero(float) using FloatUtil.EPSILONSven Gothel2023-03-201-0/+8
|
* API doc cleanup, add + refine math testsSven Gothel2023-03-197-17/+35
| | | | API doc
* ShaderProgram field programLinked: Set to false @ release()/destroy(), On ↵Sven Gothel2023-03-151-1/+5
| | | | useProgram() only throw exception if 'on==true' is requested (disabling after delettion is OK)