| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
jaulib, i.e. drop 0==epsilon case for performance
|
| |
|
| |
|
|
|
|
| |
This doesn't bring reliable results for Graph and also is pretty expensive.
|
|
|
|
|
|
|
|
| |
FloatUtil.EPSILON epsilon and no collinear test
commit 5488665474cc7b88577cedfca6416784f0fda3ba Generalize *seg2segIntersection* w/ epsilon and doCollinear
caused a big performance hit about 1/3 due to added doCollinear case and manual epsilon adding branches
and having the method being longer - probably not 'hotspot'ed.
|
|
|
|
|
|
| |
toggle OutlineShape's isComplex() for visibility
We may use complex for other criteria than !convex, i.e. self-intersecting etc.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
a zero epsilon value to reduce complexity in upper math layers
|
|
|
|
| |
passing FloatUtil.EPSILON to explicit isZero(a, epsilon)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and non-circulcircle triangulation candidates in our Delaunay tessellator
<https://jogamp.org/bugzilla//show_bug.cgi?id=1501#c6>
The used Delaunay tessellation works well with (almost) convex shapes.
In case e.g. a glyph gets to the extremes like 'M' in FreeMono
or any other complex Chinese symbol - it may just simply happen
that the new non-circumcircle triangle point crosses the inner (hope)
or outer boundaries of the given polygon.
Applying further constraint at Loop.cut() resolves most cases
by rejecting the proposed CCW and non-circumcircle triangle candidate
if its new two line-segments intersects with the original polygon.
This results in mostly proper rendered Chinese fonts and also
FreeMono is now readable - overal remaining bugs in Glyphs is low.
+++
Of course, this intersection test is costly around >= O(log(n)*n) costs,
practically adding a measured ~65% processing time.
E.g. for FontView01 using FreeSerif.ttf
- orig total took 1430.817638ms, per-glyph 0.2236ms, glyphs 6399
- fix total took 2377.337359ms, per-glyph 0.371517ms, glyphs 6399
Pure Glyph/Shape instantiation shows > 2x costs:
750 ms 100% convex (fake)
1875 ms 0% convex (fake)
1870 ms 13% convex 824/6399
+++
Hence it is desired to either
(1) Manually mark a polygon non-convex to add described intersection test for accuracy.
Also may be used to just drop the additional costs despite the lack of correctness.
PROVIDED
(2) Determine non-convex nature of a polygon with a and overall less expensive algorithm.
If considerably cheaper, this could reduce O(log(n) * n) -> O(n) or even O(log n).
Added convex/non-convex classification while ignoring off-curve points,
but only ~13% of FreeSerif is pure convex,
hence there is no benefit with this classification type.
It might be desired to attempt other classes, i.e.
being rendered in non-convex mode w/o intersection tests.
See
- GENERALIZED DELAUNAY TRIANGULATIONS OF NON-CONVEX DOMAINS
https://deepblue.lib.umich.edu/bitstream/handle/2027.42/28782/0000614.pdf;sequence=1
- https://en.wikipedia.org/wiki/List_of_self-intersecting_polygons
- https://en.wikipedia.org/wiki/Complex_polygon
|
|
|
|
|
|
|
|
|
|
|
| |
new impl; Add isConvex*() to determine whether a polyline is convex
I had problems using the previous line2line intersection methods in my (and my son's) C++ gfxbox2 project, e.g. freefall01.
Hence I found a different solution, also using less operations:
<https://jausoft.com/cgit/cs_class/gfxbox2.git/tree/include/pixel/pixel2f.hpp#n660>
While adding intersection tests for our Delaunay (Bug 1501) .. I came across this issue again
and hence swapped the implementation.
|
| |
|
|
|
|
| |
VBORegionSPES2 to just render lines instead of the filled area -> Used in UIShapeDemo02a
|
|
|
|
| |
setHintMask()->setHintBits(), clearHintMask()->clearHintBits()
|
|
|
|
| |
*2d() variants
|
|
|
|
|
|
|
|
|
|
|
| |
inner-hole:=CW w/o using winding determination (might be incorrect)
This simplifies our code further and it has been validated that our polygon shoelace-algo for area >= 0 ? CCW
doesn't produce correct results with all curves.
Hence rely on given winding depending on outer-boundary and inner-hole if CDTriangulator2D.FixedWindingRule == true (default and fixed).
This also removes the more costly winding shoelace calculus,
hence Outline ctor only sets dirtyWinding:=true w/o calculating the winding.
|
|
|
|
|
|
|
|
|
|
|
|
| |
version, overcome float precision; Loop: Pass edgeType not Winding, simplify findClosestValidNeighbor() -> isValidNeighbor(); CDTriangulator2D.addCurve() enforces Winding.CCW on BOUNDARY null == loop case
Add double version of triAreaVec2() and isInCircleVec2() in VectorUtil, overcoming float precision limits
- Analysis exposed float precision limits within isInCircleVec2()
Loop: Pass edgeType not Winding, simplify findClosestValidNeighbor() -> isValidNeighbor()
- Enhance code clarity
CDTriangulator2D.addCurve() enforces Winding.CCW on BOUNDARY null == loop case
|
| |
|
|
|
|
| |
and subtitle language
|
| |
|
| |
|
| |
|
|
|
|
| |
{get,set}FallbackFont() + Font.getBestCoverage(..); Use fallback-font in MediaButton in case chosen font doesn't match (foreign languages, e.g. 'zho' Chinese .. )
|
|
|
|
| |
select font for ASS/Text rendering; Remove GLMediaPlayer's getStreamLang() as replaced by getLang()
|
| |
|
|
|
|
| |
copy-ctor in com.jogamp.graph.* and com.jogamp.math.*
|
|
|
|
| |
subtititle) etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(PGS ..) via FFMPEGFMediaPlayer/FFmpeg
FFMPEGFMediaPlayer related changes:
- Add libswscale (6th FFmpeg lib used) for sws_getCachedContext(), sws_scale() and sws_freeContext(),
used natively to convert the palette'ed bitmap into RGBA colorspace -> GL texture
- Handling AVSubtitleRect.type SUBTITLE_BITMAP
-- only handled if libswscale is available
-- config/adjust texture object
-- sws_scale palette'ed bitmap to texture
-- intermediate memory is cached, may be resized and free'ed at destroy
-- texture objects are managed and passed from GLMediaPlayerImpl,
as they are also forwarded to player client via SubBitmapEvent
- Passing the AVCodecID to GLMediaPlayerImpl, converted to our CodecID enum.
- Unifying creation and opening of AVCodecContext with 'createOpenedAVCodecContext(..)'
+++
SubtitleEvent*
- SubTextEvent now also handles ASS.Dialogue (FFmpeg 4)
besides ASS.Event (FFmpeg 5, 6, ..).
+++
GLMediaPlayerImpl
- Added ringbuffer subTexFree, managing Texture for bitmap'ed subtitles
-- Uses 1 bitmap-subtitle Texture per used textureCount in cache,
as one bitmap-subtile can be displayed per frame.
Could be potentially reduced to just 2 .. but resources used are
relatively low here.
- Validating subTexFree + videoFramesFree usage,
use blocking get/put ringbuffer due to utilization from different threads.
- Receives subtitle content from native getNextPacket0() via callback,
creates SubtitleEvent instance and passes it to a SubtitleEventListener - if exists.
(See MediaButton example)
-- SubBitmapEvent also gets its special SubBitmapEvent.TextureOwner to handle client releasing
the event and allowing us to put back the Texture resource to 'subTexFree'.
This passing through of the Texture object is probably a weakness of this lifecycle
and requires the client to ensure SubtitleEvent.release() gets called.
See MediaButton example!
- Exposing CodecID, allowing clients like MediaButton to handle SubtitleEvent content according to codec
|
|
|
|
|
|
|
|
|
| |
Region.COLORTEXTURE_LETTERBOX_RENDERING_BIT to TextureSequence and add enabling/disabling of aratio adjustment + letter-box back-color
TextureSequence color-texture params fetched from Graph VBORegion* and fed into shader.
This allows more flexibility in aspect-ratio adjustment as well as setting a clipping background color for
the added letter-box space.
|
| |
|
|
|
|
| |
and hence also promoting VideoPixelFormat
|
|
|
|
| |
pending setup/update of texture and image dimensions
|
|
|
|
| |
available; JOGL ImageSequence: Add addFrame(GL, TextureFrame), remove*Frame() and isSequenceAnimating()
|
|
|
|
|
|
|
|
|
|
| |
GLMediaEventListener, easing listener callbacks; Prepare SubtitleEventListener generalization (Bug 1494)
Moves pushSound(), pushSubtitle*() from FFMPEGMediaPlayer to GLMediaPlayerImpl,
as it is handled in a generic way - even though currently only called by native FFMPEGMediaPlayer implementation.
Note: This patch is incomplete, i.e. not even compile clean.
But choses as-is to semantically split the work to ease review.
|
|
|
|
| |
provided by owner to take back borrowed resources (texture of bitmap subtitle)
|
| |
|
|
|
|
|
|
|
|
| |
support via FFMpeg
TODO:
- We may want to refine subtitle PTS handling
- We may want to support bitmapped subtitles
|
| |
|
|
|
|
|
|
|
|
| |
streams and languages and add convenient switchStream(..) entry.
audio/video/subtitle streams and language metadata is maintained by arrays holding the stream-IDs and language string identifier.
Implementation added in FFMPEGPlayer for these data-sets.
|
| |
|
| |
|
|
|
|
| |
DefaultGraphicsDevice.swap{Device->}HandleAndOwnership()
|
|
|
|
|
|
|
|
|
|
| |
bit-shift expressions and simplify it
commit 1dcfdf71c09c6d774ac47012c05e09da4a085d7b
- still used the 'hash code' bit shift pattern, not necessary -> simplified
- the value as not ensured to be long, hence conversion occured
This caused Graph's MSAA not being picked up properly using the shaderKey.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[0-31] bit values and state, [32-63] colorTexSeqHash
This leaves only room for a key collision on the 32-bit colorTexSeqHash value
and hence should be save within our shader-code environment.
+ // # | s |
+ // 0 | 1 | isTwoPass
+ // 1 | 1 | pass1
+ // 2 | 5 | ShaderModeSelector1
+ // 7 | 1 | hasFrustumClipping
+ // 8 | 1 | hasColorChannel
+ // 9 | 1 | hasColorTexture
+ // 32 | 32 | colorTexSeqHash
+ long hash = ( isTwoPass ? 1 : 0 );
+ hash = ( hash << 1 ) | ( pass1 ? 1 : 0 ) ;
+ hash = ( hash << 1 ) | sms.ordinal(); // incl. pass2Quality + sampleCount
+ hash = ( hash << 5 ) | ( hasFrustumClipping ? 1 : 0 );
+ hash = ( hash << 1 ) | ( hasColorChannel ? 1 : 0 );
+ hash = ( hash << 1 ) | ( hasColorTexture ? 1 : 0 );
+ hash = ( hash << 1 ) | ( ( colorTexSeqHash & 0xFFFFFFL ) << 32 );
|
|
|
|
|
|
| |
using 'static final boolean useShaderPrograms0 = true'
For now, let's leave the dead shaderPrograms1 code path inside the class for further consideration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-> 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.
|