aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1037 - FBObject/GLFBODrawable: Do not assume using a TextureAttachment ↵Sven Gothel2014-07-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for a Colorbuffer, also make DEPTH optional. API Change +++ In certain cases a TextureAttachment for the FBO's color buffer is not desired, either for performance reasons where texture functionality is not required or to avoid texture restrictions like size, etc. +++ GLFBODrawable shall use TextureAttachment for the FBO's color buffer and a DEPTH buffer per default. However, the user shall be allowed to use a plain ColorAttachment (renderbuffer) and also no DEPTH buffer. +++ FBObject Details: - Colorbuffer interface exposes Attachment details like format, size, etc as well as it's implementation specifics, isTextureAttachment() and getTextureAttachment() allowing a clean cast and type query. - Allow ColorAttachment to be used for non MSAA - Make TextureAttachment optional for method 'use(GL, TextureAttachment)' - Only validate size against MAX_TEXTURESIZE if using a TextureAttachment - API Change: - rename: getColorAttachmentCount() -> getColorbufferCount() - add: getTextureAttachmentCount() - change 'TextureAttachment getSamplingSink()' -> 'Colorbuffer getSamplingSink()'
* Bug 801: Add Graph pass-2 shader for VBAA 'odd' sample countSven Gothel2014-07-093-66/+153
|
* Findbugs: Comment on some issues (OK, they are) ; Remove dead branchesSven Gothel2014-07-081-2/+2
|
* Findbugs: Use static fields where possibleSven Gothel2014-07-082-2/+2
|
* Findbugs: Use inner static class where possibleSven Gothel2014-07-088-56/+57
|
* Findbugs: Misc minor issues (see below)Sven Gothel2014-07-081-8/+8
| | | | | | | - remove duplicate code in branch - Use Type.valueOf(primitive) - Don't use array.toString() directly - remove dead code
* Findbugs: Remove dead-code / unused [temp] storage and it's assignmentSven Gothel2014-07-086-29/+43
|
* Findbugs: Remove branches where reference cannot be nullSven Gothel2014-07-081-1/+1
|
* Findbugs: Use <NumberType>.valueOf(..) instead of 'new <NumberType>(..)'Sven Gothel2014-07-082-11/+11
|
* Findbugs: Add FIXME comment regarding float comparison (consider using ↵Sven Gothel2014-07-081-0/+2
| | | | FloatUtil.isEqual(ax, bx, epsilon), FloatUtil.isZero(bx, epsilon), ..)
* Findbugs: Remove redundant instanceof checksSven Gothel2014-07-081-7/+8
|
* Findbugs.static_final_immutable: Use final qualifier for static immutable ↵Sven Gothel2014-07-081-3/+3
| | | | instances.
* Findbugs.not-written.null: Fix referencing non-written fields (never written ↵Sven Gothel2014-07-081-5/+0
| | | | | | | | | | | | | | | or due branching) - AWT TextRenderer: Add throw new InternalError("fontRenderContext never initialized!"); FIXME! - GLContextImpl.hasFBOImpl(): Fix serious NPE issue if extCache is null - GLDrawableFactoryImpl.createOffscreenDrawableImpl(..): - Fix NPE issue w/ null drawable - Fix resetting GammaRamp by ensuring originalGammaRamp will be set at 1st setGammaRamp(..) - AndroidGLMediaPlayerAPI14: Fix NPE: Use already resolved local referenced - EGLDrawableFactory: Fix NPE: Only operate on non null surface! - ALAudioSink.dequeueBuffer(..): Only resolve releasedBuffer elements if not null -
* Findbugs.normal: Adding safeguard hashCode() implementation throwing ↵Sven Gothel2014-07-081-0/+4
| | | | | | InternalError("hashCode not designed") As long we don't use Object.hashCode() to idenitify the memory address, we can safeguard the code.
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-03115-1487/+1488
| | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Enhance FloatUtil: Merge ProjectFloat features while adding optimized ↵Sven Gothel2014-06-272-10/+25
| | | | | | | | | | | | | | | | | | variations; PMVMatrix: Remove NIO buffer path, use backing-array only and FloatUtil direct. - FloatUtil pptimized variants: - mapObjToWinCoords (gluProject) passing 'P x Mv' for batch operations - mapWinToObjCoords (gluUnProject) passing 'Inv(P x Mv)' for batch operations - mapWinToObjCoords (gluUnProject) passing 'Inv(P x Mv)' and two winz values for two ray picking resulting in two obj positions. (-> mapWinToRay) - PMVMatrix - dropped low performance NIO mode - simply use common backing-array and fixed offsets directly - drop ProjectFloat usage in favor of FloatUtil - reduce number of temporary arrays
* Graph RegionRenderer: Fix GL3 and ES3 GLSL issuesSven Gothel2014-06-111-3/+0
| | | | | | Macro redefine 'texture2D -> texture' was added _after_ the custom texture lookup insertion causing GL3-core to fail.
* Graph: Fix GLSL issue w/ ES3, add 'const float sample_count', since define ↵Sven Gothel2014-06-112-5/+5
| | | | SAMPLE_COUNT is of type 'int'
* GraphUI: Fix using multiple texture units w/ opt. colorTexUnit in GLRegionSven Gothel2014-06-093-16/+7
| | | | | The texture unit has to be updated always, since program maybe used by multiple regions and diff. texUnits
* Bug 801: Introd. RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED hinting to ↵Sven Gothel2014-04-101-2/+11
| | | | | | | | | | | | deal w/ GL_DEPTH_TEST accordingly Fixes VBORegion2PMSAAES2 no-depth-buffer usage and allows user to control behavior w/o quering GL state. If BITHINT_GLOBAL_DEPTH_TEST_ENABLED set: - RegionRenderer.defaultBlendEnable: glDepthMask(false) - RegionRenderer.defaultBlendDisable: glDepthMask(true) - VBORegion2PMSAAES2 enables/disables GL_DEPTH_TEST, otherwise MSAA is corrupt.
* VectorUtil: Fix method names, i.e. use type-suffix in end of function for ↵Sven Gothel2014-04-092-5/+5
| | | | clarity and unique method naming
* Bug 801: Region Dirty Update; TextureSequence GLMediaPlayer Fix; Blending Fix ;Sven Gothel2014-04-097-49/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Region Dirty Update - Split dirty -> ShapeDirty + StateDirty, where StateDirty forces re-rendering content w/o geometry update as req. for 2-pass mode. - Fix TextureSequence (GLMediaPlayer) usage in RegionRenderer / GLRegion* - handle GL_TEXTURE_EXTERNAL_OES incl. Android ES3 bug - inject TextureSequence's shader stubs - shader: Use abstract lookup 'texture2D' -> 'gcuTexture2D' - flip scaled colorTexBBox if TextureSequence 'tex.getMustFlipVertically()' - TODO: Handle multiple TextureSequence shader programs! - Fix Blending: GLRegion* / RegionRenderer / RenderState - Disable/Enable depth-writing w/ blending - Region impl. sets proper glBlendFunc*(..), i.e. 2-pass: - render2FBO: glClearColor(0f, 0f, 0f, 0f) glBlendFuncSeparate(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA, GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA) - renderFBO: glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA) - User code shall not set glClearColor(..) for 2-pass anymore - Graph-UI Demo - UIShape: - Add MouseGestureListener, combining MouseListener + GestureListener - EventDetails -> PointerEventInfo - PointerEventInfo contains objPos (ray-intersection) and glWin-pos - Toggle: - Separate color (on/off) if enabled - Toggle on click if enabled - SceneUIController - Use PinchToZoomGesture and propagete same gesture to UIShape - Use AABBox.getRayIntersection(..) using 'real' shape coordinates for 1st picking. - Use shape PMV for secondary picking (drag, zoom 2-pointer, etc), see windowToShapeCoords(..) - Sort shapes according to z-value (render: ascending; picking: descending) - Only 'drag' if pointerId matches 1st pressed pointer
* Bug 801: Cleanup shader-program location/data update ; Add COLORTEXTURE + ↵Sven Gothel2014-04-0410-89/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TextureSequence to Region (Demo: TextureButton) Cleanup shader-program location/data update - GLUniformData: - Allow lazy data setup, as used for RenderState.ProgramLocal, see below - RenderState - Separate data (pmv, weight, colorStatic) from program-local uniforms -> add class ProgramLocal. Reduces uniform location lookups, since ProgramLocal is bound to Region impl. - ProgramLocal.update(..) needs to write uniform data always, since data is being used in multiple programs! - No 'dirty' tracking possible, removed - see above. - RegionRenderer - Fix shader-selection: 2-pass programs differ from 1-pass! - No shader-setup at init +++ Add COLORTEXTURE + TextureSequence to Region - Create color-texture coords in vertex-shader via region's bounding box (pass-1) - Use color-texture unit in pass-1 if enabled (own shader program) - Use TextureSequence in Region impl. providing all required data (unit + texture-name) - Demo: TextureButton (a UIShape)
* Bug 801: Reduce temp. object creation, i.e. GC loadSven Gothel2014-04-024-104/+77
|
* Bug 801: WIP 2/2 - Add color attribute; Switch Shader instead of branching ↵Sven Gothel2014-04-0211-297/+115
| | | | | | | | | | | | | | in shader; Update attributes and uniforms manually, drop ShaderState; - Due to shader-switching, 'renderModes' are now local to Region, e.g. UIShape etc - Remove RegionRenderer.renderModes - VBORegion2P*: - Use simple 2x float matrix for orthogonal P+Mv - Cleanup shader
* Bug 801: WIP 1/2 - Add color attribute; Switch Shader instead of branching ↵Sven Gothel2014-04-0149-1209/+1290
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in shader; Update attributes and uniforms manually, drop ShaderState; - ShaderCode - add int insertShaderSource(int shaderIdx, int position, Class<?> context, String path) - insertShaderSource(..): pos==-1 -> append code - VectorUtil - add isVec3InTriangle3(..., float epsilon) - add testSeg2SegIntersection(..., float epsilon) - add testTri2SegIntersection(..., float epsilon) - AffineTransform: Return result for chaining - Font - Add pixel precise 'getPointsBounds(final AffineTransform transform, CharSequence string, float pixelSize)' - Rename getString*() -> getMetric*() - OTGlyph: Release _points field, no more used - - Graph Triangulation - Count additional vertices in: Triangulator, CDTriangulator2D - OutlineShape: - Allow skipping of 'transformOutlines2Quadratic', i.e. allow tagging OutlineShape to be quadratic_nurbs via 'setIsQuadraticNurbs()' - Clarify cleanup ot outlines in same method 'cleanupOutlines()' - Count additional vertices .. - Graph Shader: - Start splitting and segmenting shader code for: - pass1 / pass2 - features, i.e. sampleCont, color-channel, ..
* Bug 801: Graph OpenGL ES2 and ES3 CompatibilitySven Gothel2014-03-2521-153/+152
| | | | | | | | | | | - Remove 'const' qualifier in shader graph code for non 'absolute' const values - Use extension directive OES_standard_derivatives only for ES2.0, not ES3.0 (graph shader) - Compare float w/ float literals, not int literals! - Android Demo NEWTGraphUI2pActivity: - Is a VBAA example, hence disable scene MSAA!
* Bug 801: Use allsamples 'brute force' for VBAA (best quality) ; Demos: ↵Sven Gothel2014-03-254-10/+10
| | | | Reduce text contrast by 1/10th allowing better AA ; GPUUISceneGLListener0A uses proportional window height font size and one label w/ 10pt
* TypecastRenderer: Validate Shape Generation - Result: OKSven Gothel2014-03-251-0/+4
|
* ShaderCode: Allow 'srcRoot' to be optional ; RegionRendererImpl01: Allos ↵Sven Gothel2014-03-251-5/+18
| | | | custom shader
* Bug 801: Elaborate on multisampling performance/quality: Flipquad, RGSS, ↵Sven Gothel2014-03-2510-80/+345
| | | | | | | | | | | | | Quincunx Using poles only as sampling points is not as effective as: flipquad > rgss >> quincunx Best quality would be 'wholeedge', i.e. average every supersample, however performance is worse here. References: <http://fileadmin.cs.lth.se/graphics/research/papers/inexp_ms2005/> <http://fileadmin.cs.lth.se/graphics/research/papers/masses2003/>
* Bug 801: Revise Graph VBAA (Add border dropping MSAA; Test diff. AA modes ↵Sven Gothel2014-03-2228-522/+1327
| | | | | | | | | | | | | | | | | | | | incl. FXAA2) ; Test exp. LineAA ; Misc Changes - Revise VBAA - Add border to FBO dropping MSAA - This automatically gives AA for edges on FBO boundary - Correcting ceil-diff, use object-diff instead of win-diff (diff := ceil(a)-a, w/ float a) - Reorg shader - using includes to test diff. AA modes: - [poles, wholeedge] * [equalweight, propweight] - fxaa2 - Exp. LineAA (disabled) - Test ROESSLER-2012-OGLES for detected rectangles only - Test boundary line detection See screenshots: <http://jogamp.org/files/screenshots/graphui/20140322/>
* Graph: Fix NPE in case of double destroy call .. (VBORegion2PMSAAES2)Sven Gothel2014-03-171-6/+12
|
* Graph: Fix NPE in case of double destroy call ..Sven Gothel2014-03-172-12/+32
|
* Add generic support for picking via raycast intersection and AABBox (or similar)Sven Gothel2014-03-161-1/+1
| | | | | | | | | - New simple type Ray, denominating a .. ray - Added PMVMatrix.gluUnProjectRay(..) similar to gluUnproject(..) however, result is a Ray. - Added AABBox.intersectsRay(Ray) ..
* FloatUtil/VectorUtil: Enhance isEqual/compare w/ and w/o epsilon, add unit ↵Sven Gothel2014-03-151-8/+8
| | | | tests - Cleanup VectorUtil (vec2/3 naming, remove dedundant functions)
* Quaternion: User EPSILON for all tests against zero and one (identity .. ) ↵Sven Gothel2014-03-151-2/+6
| | | | and document the same. ; Minor edits ..
* Bug 801: Remove Vertex.Factory from AffineTransform ; Add AABBox tranformed ↵Sven Gothel2014-03-151-54/+56
| | | | resize.
* Bug 801: Add Frustum support to Region; Misc ..Sven Gothel2014-03-144-7/+47
| | | | | | | | | | | Region: Add Frustum support, to drop 'out of sight' shapes RenderState: Add hints, e.g. BITHINT_BLENDING_ENABLED, allowing user code to toggle background color etc Demos: Incomplete - WIP - Reuse mapped object to window coords computed at reshape - TODO: Use minimal Scenegraph for Graph-UI ..
* Math and PMVMatrix: Cleanup and RefineSven Gothel2014-03-141-15/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added final qualifier where possible - Refined API doc - FloatUtil: - Add machine EPSILON - fixed value and runtime computed (real machEps) - incl. isZero(..), isEqual(..) - Add makeRotationAxis(..) - Moved from PMVMatrix for reusage - Add makeRotationEuler(..) - New, not recommended due to Gimbal-Lock - Add copyMatrix[Column|Row](..) - Add more PI variations and trigo-func float mappings - Removed cross and normalize, use VectorUtil! VectorUtil: - Add copyVec* - Add equals and isZero w/ and w/o EPSILON - Add distance[Square] - Add length[Square] PMVMatrix: - Removed 'destroy' method in favor of making most fields 'final'. AffineTransform: - Added AABBox transform - Public multiply
* Bug 801: AffineTransform: Remove Serializable, make methods final; ↵Sven Gothel2014-03-061-68/+36
| | | | FloatUtil: Add DEBUG and description about Row-Major and Column-Major Order. AABBOX: Use FloatUtil.DEBUG for mapToWindow(..)
* Bug 801: Fix 183e1bc1868699b99eb9f9c8bf18d646d1120a48 'window box' CalculationSven Gothel2014-03-052-30/+24
| | | | | | | | | | | | Commit 183e1bc1868699b99eb9f9c8bf18d646d1120a48 only mapped object's bbox max/min points to window space, which is wrong due to possible rotation in 3d space. This commit adds AABBox.mapToWindow(..) method, which correctly either uses 4 points of the bbox in 3d space (using center-z) or all 8-points and creating a new bounding box. The resulting width and height of this window bbox gives the maximum amount of rectangular pixels for AA.
* Bug 801: VectorUtil: Pass result vector, allowing caller to manage memory ↵Sven Gothel2014-03-053-5/+6
| | | | (performance, reduce temp objects)
* Bug 801: Refine 'blend' usage and modes (API-doc and demo-code)Sven Gothel2014-03-053-4/+2
| | | | | | | | | | | | | - RegionRenderer: Make 'blend' setup pluggable via new GLCallbacks - 'GLCallback's for enable/disable, passed via 'create' method. Add 'defaultBlendEnable' and 'defaultBlendDisable', replacing previos fixed calls. - GLRegion.draw(..) added API-doc notes about: - Decorating call with RegionRenderer.enable(..) - glClearColor impact and blending - VBORegion2P*: Remove fixed glClearColor(..) call
* Bug 801: Fix VBAA Distortions (VBO-size fractional delta) and AA (Sample ↵Sven Gothel2014-03-049-266/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fragment position and count) Inflating the FBO pixel-size of the region using a 'samples count' multiplier to the projected window bounding box allows controlling the AA distortion as well as defining the fragment position due to it's grid-fitting nature, see below. - Fix VBAA Distortions (FBO-size fractional delta) Inflated framebuffer exceeds 'box-size * sampleCount' since it must be the ceiling of the latter due to it's integer number nature. This difference either must reflect the texture-coords -or- the texture bounding vertices-box in the 2nd pass, otherwise a distorion will appear which is quite visible explicit w/ text. Using texture-coords is not suitable, due to floating point accuracy, hence this patch extends the texture bounding vertices-box about the ceiling delta. A comparible distortion existed with the previous implementation as well, since it used an arbitrary FBO-size and hence the magnification was not grid-fitting. Current implementation is grid-fitting, or at least matches the non-inflated grid, since it inflates the original window-size of the region about samples-count. - AA (Sample fragment position and count) Using a sample-count w/ a multiple of 2 (currently 2, 4 and 8 are properly implemented), based on the projected window bounding box will give the 2nd-pass fragment shader (AA) a fragment-postion in center of the sample pixels exposing one AA pixel. Hence we need to use the diagonal coords (NW, SW, ..) off by half a pixel to reach the 1st sample-pixel .. and 1.5 pixels to reach the 2nd .. and so forth.
* Bug 801: Add MSAA_RENDERING_BIT ; VBAA: Uses GL_NEAREST (good result) ; ↵Sven Gothel2014-03-028-14/+509
| | | | Demos: Use local GLRegion for uncached text (perf.) ..
* Bug 801: Cleanup CDTriangulator2DSven Gothel2014-03-011-24/+18
| | | | | | - CDTriangulator2D.getContainerLoop(..) can exit at first 'inside' loop - Make loops field 'final' and clear at reset. - Add more 'final' qualifier
* Bug 801: TypecastRenderer: Don't use Cubic, but 'double quad' / ↵Sven Gothel2014-03-012-12/+14
| | | | GlyfCompositeDescript: Fix NPE
* Bug 801: VBAA Render-Mode Based on SampleCount (not a user-based texWidth) ; ↵Sven Gothel2014-03-014-32/+104
| | | | | | | | | | | | | | Proper FontSize -> PixelSize VBAA Render-Mode Based on SampleCount (not a user-based texWidth) - All Region based APIs now use 'sampleCount' instead of 'texWidth' - VBORegion2PES2 calculates perspective FBO width/height considering the sampleCount Proper FontSize -> PixelSize - Font: Add getPixelSize(fontSize, dpi) - Text* Demos/Classes: Use proper fontSize -> PixelSize
* Bug 801: Drop TypecastRenderer's CUBIC mode if p3 is 'looped'Sven Gothel2014-02-281-2/+2
|