aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util
Commit message (Collapse)AuthorAgeFilesLines
* FPSAnimator: Add note on deamon-thread and JVM shutdown behavior.Sven Gothel2012-11-252-5/+11
|
* Frustum: Clarify method names, fix point/sphere classification, add used ↵Sven Gothel2012-11-121-1/+1
| | | | | | | | | references Clarify method names: - update(..) -> updateByPMV(..), updateByPlanes(..) - isOutside(AABBox) -> isAABBoxOutside(AABBox) - .. same for point/sphere, while adding 'Location classifyType(..)'
* Frustum: Cleanup / update; PMVMatrix: Fix mulPMVSven Gothel2012-11-121-1/+1
| | | | | | | | | | Frustum: Cleanup / update - Remove ctor w/ PMV, use update(..) instead - avoid API explosion - Add update(Plane[]) to copy existing Frustum planes - Mention world-coordinates in update(PMV) PMVMatrix: Fix mulPMV - P*Mv in column major order is correct for Frustum
* Validating Frustum w/ help of Eduard White [email protected], referencing ↵Sven Gothel2012-11-121-5/+5
| | | | | | | | | | | | | | | | | the original paper Paper: Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix http://graphics.cs.ucf.edu/cap4720/fall2008/plane_extraction.pdf Authors (in alphabetical order): Gil Gribb <[email protected]> Klaus Hartmann <[email protected]> 06/15/2001 Fix: - Column Major Order PMV (Passing to Frustum and in calculation itself) according to paper coeff. calculation of plane - Plane's signed distance function (only add d, don't multiply) - Normalization: divide by lenght, not multiply
* Frustum: Passing Mv*P (column major order)Sven Gothel2012-11-111-5/+5
|
* PMVMatrix: Add 'Frustum glGetFrustum()' adding same dirty/request ↵Sven Gothel2012-11-111-58/+81
| | | | | | | | | methodology as for Mvi and Mvit Allows user to derive Frustum from updated P + MV Clarify method name for clearing all update request: - disableMviMvitUpdate() -> clearAllUpdateRequests()
* Cleanup Frustum Math Util: Independent / Compile Clean / Relocation ; ↵Sven Gothel2012-11-112-191/+20
| | | | | | | | | | | | PMVMatrix: Add getPreMultipliedPMV(..) - Independent / Compile Clean - Remove OpenMALI dependencies - Use basic float[] type and FloatUtil - Use AABBox - FIXME: May need BBox (no axis alignment ?!) - Relocation - Move to com.jogamp.opengl.math.geom (see commit 5fafc1ac360333645b807dcd8dff0c0a655ea439)
* Reorganize math code into: com.jogamp.opengl.math and ↵Sven Gothel2012-11-112-62/+1
| | | | | | | | | | | | | | | | | | | | | | | com.jogamp.opengl.math.geom packages Note: WIP - We may relocate / reorg math package. Public relocations: com.jogamp.opengl.util -> com.jogamp.opengl.math - FixedPoint - FloatUtil com.jogamp.graph.math -> com.jogamp.opengl.math - Quaternion - VectorUtil com.jogamp.graph.geom -> com.jogamp.opengl.math.geom - AABBox VectorUtil: Introducing Vert2fImmutable and Vert3fImmutable interfaces, allowing graph Vertex instances to be used 'graph' agnostic and to document 2d/3d use-cases.
* Adding basic Frustum utility class interfacing w/ PMVMatrix. Still depending ↵Eduard White2012-11-111-0/+191
| | | | on OpenMALI - hence broken.
* GLAutoDrawable: Refine API change of commit ↵Sven Gothel2012-11-051-17/+18
| | | | | | | | | | c002e04f848116922a1ed7bd96ead54961649bbd As suggested by Julien Gouesse, align 'enqueue(..)' method w/ 'invoke(..)': - public void enqueue(GLRunnable glRunnable); + public boolean invoke(boolean wait, List<GLRunnable> glRunnables);
* GLDrawableUtil.swapGLContextAndAllGLEventListener(..): Add glFinish() before ↵Sven Gothel2012-11-041-17/+36
| | | | | | and after ctx/drawable swap - sync'ing GL state Otherwise a driver crash may occur on Windows/NVidia.
* FPSAnimator: Wait '2 x period' or 20ms, whichever is greater in case of ↵Sven Gothel2012-11-041-5/+7
| | | | pause/stop - taking execution frequency into account
* GLAutoDrawable: Fix GLEventListener lifecycle and expose more user control ↵Sven Gothel2012-11-041-0/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (API Change) ; Added GLDrawableUtil A GLEventListener resides in two states, initialized and uninitialized. When added to a GLAutoDrawable, it is uninitialized. A first 'display()' will issue GLEventListener's 'init(..)' which renders it initialized. This is usually accompanied by 'reshape(..)' propagating the drawable's dimension. Destruction of the GLAutoDrawable will issue GLEventListener's 'dispose(..)' which renders it uninitialized. It turns our these means of GLEventListener controls are not sufficient in case the user requires to remove and add them during the lifecycle and rendering of their GLAutoDrawable host. GLAutoDrawable 'removeGLEventListener(..)' merely removes the GLEventListener from the list, but does not complete it's lifecycle, i.e. issues 'dispose(..)' if initialized to realease GL related resources. Hence the following essential API changes are made to complete the lifecycle: + public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove); disposing a single GLEventListener, allowing it's removal from the list being optional This is demonstrated via GLDrawableUtil.swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b), see below. ++++++++ Further more the following API changes were made to expose complete control of GLEventListener to the user: - public void removeGLEventListener(GLEventListener listener); + public GLEventListener removeGLEventListener(GLEventListener listener); The return value allows simple pipelining, and also delivers information whether the passed listener was actually removed. - public GLEventListener removeGLEventListener(int index) throws IndexOutOfBoundsException; + public int getGLEventListenerCount(); + public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException; Dropping the redundant removal by index, while adding count and get methods. + public boolean getGLEventListenerInitState(GLEventListener listener); + public void setGLEventListenerInitState(GLEventListener listener, boolean initialized); Allows retrieving and setting of listener states. All in all these API changes allows a user to experience all freedoms in dealing w/ GLEventListeners hosted by GLAutoDrawable impl. and shall be future proof. Note that we have avoided the Iterator pattern due to it's overhead of temporal objects creation. The simple indexed access allows us to implement each method as an atomic operation. +++++++++++ Further more a simple enqueue(..) method has been added, allowing to just enqueue a GLRunnable w/o provoking it's execution - as invoke(..) does. This method pleases a use case where GLRunnables are batched and shall be executed later on.. public boolean invoke(boolean wait, GLRunnable glRunnable); + public void enqueue(GLRunnable glRunnable); +++++++++++ Added GLDrawableUtil, exposes utility function to rearrange GLEventListener, modifiy GLAutoDrawable, etc. GLDrawableUtil.swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b) is tested and demonstrated w/ TestGLContextDrawableSwitchNEWT. Manually tested on X11, OSX and Windows.
* ShaderProgram: Program name is valid if non zero; Add init(GL) return value ↵Sven Gothel2012-10-311-14/+23
| | | | for success.
* FixedFuncPipeline: Use proper shader version and make GLSL code compatible ↵Sven Gothel2012-10-291-0/+1
| | | | w/ higher GLSL versions
* ShaderCode: Add defaultShaderCustomization(..) to prelude shader source w/ ↵Sven Gothel2012-10-262-4/+35
| | | | GLSL version and default precision (if GLES) - Used by GearsES2/RedSquare/PointDemo (Made GLSL version proof)
* Fix regression of commit 40d01bef2a1db44533472c37961aabbef68de644: Test for ↵Sven Gothel2012-10-231-2/+2
| | | | fourth element was invalid
* ImmModeSink: Reduce DEBUG_* print a bit (no this.toString())Sven Gothel2012-10-231-10/+11
|
* FixedFuncHook/ImmModeSink: Fix *Pointer 'normalized' parameterSven Gothel2012-10-223-14/+33
| | | | | | | | | All *Pointer methods used 'normalized:=false', but we cannot assume the fixed function code does use normalized (0f..1f) values. On the contrary, it usually uses the native format value range. Hence we have to pass normalized:=true for all fixed point data types and normalized:=false for floating point data types.
* Fix ImmModeSink Padding: Fourth element default value (vertex/color) is 1fSven Gothel2012-10-201-33/+47
|
* ImmModeSink: Pretty'fying Ctor/Factory methods argument listSven Gothel2012-10-181-16/+21
|
* ImmModeSink: Add resizeElementCount, allowing user to set a lower additional ↵Sven Gothel2012-10-181-2/+20
| | | | resize element count
* ImmModeSink VBO: Update single buffers (vertex, color, ..) if once written ↵Sven Gothel2012-10-181-26/+58
| | | | | | | | and size gross-net > PAGE_SIZE Usually PAGE_SIZE is written within one DMA xfer command, so if the gross buffer bulk transfer contains more unused data than PAGE_SIZE we may win when transfering each single buffer at buffer update.
* ImmModeSink: Add glColor3ub(), glColor4ub(); Add proper value conversion of ↵Sven Gothel2012-10-182-103/+174
| | | | imm. gl* functions; Default color padding is 1f; Make fields private.
* Merge remote-tracking branch 'hharrison/master'Sven Gothel2012-10-161-1/+1
|\
| * jogl: fix bit shift error in LEDataInputStreamHarvey Harrison2012-10-151-1/+1
| | | | | | | | | | | | | | | | The readlong() method is attempting to build a 64bit value from two 32 bit reads. The problem is that shifting an int only uses the lower 5 bits of the shift value, so << 32 is the same as << 0. Cast to long and restore the original intention. Signed-off-by: Harvey Harrison <[email protected]>
* | ImmModeSink: Fix buffer grow (+1 element @ named buffer), enable DEBUG_* via ↵Sven Gothel2012-10-161-52/+68
|/ | | | properties, drawIndices QUAD w/ proper range and add uint; FixedFunctionHook: drawIndices QUAD w/ proper range and add uint
* FixedFuncPipeline: Optimize shader resource, if preset != ↵Sven Gothel2012-10-131-4/+8
| | | | ShaderSelectionMode.AUTO (good for mobile); Lazy shader instantiation.
* FixedFuncHook: Add ES2 alignment of certain GL functions, i.e. ↵Sven Gothel2012-10-121-2/+2
| | | | GL_QUAD_STRIP/GL_POLYGON/GL_QUADS mapping, glTexImage2D internalformat/format match.
* GLArrayDataClient.bindBuffer(gl, bind=true): checkSeal and init_vbo if ↵Sven Gothel2012-10-121-0/+5
| | | | required (similar sanity checks as enableBuffer())
* GLArrayData* VBO binding: Properly document and impl. bindBuffer(..) in ↵Sven Gothel2012-10-122-14/+42
| | | | | | | | | detail w/ data sync within GLArrayHandle, which also removed redundant code (VBO data sync and binding). Refines commit 8582ece7dc7f65271b3184261697a542766d9864 and f49f8e22953ed2426fd4264ee407e2dc3fc07cfc
* Enhance FixedFuncPipeline: Multi-Texture, Tex-Env, Alpha-Test, Lighting ↵Sven Gothel2012-10-122-9/+60
| | | | | | | | | (fix, incomplete still), ShaderSelectionMode, Fix default values Besides the above mentioned additional features towards completness of the FFP emu, the ShaderSelectionMode allows fixating a shader program configuration, i.e. AUTO switch (default) or choosing a static shader program to avoid heavy program switches incl. uniform/attribute updates.
* ShaderState: Clean-up debug / verbose output. attachShaderProgram(..) still ↵Sven Gothel2012-10-121-41/+70
| | | | | | | issues UseProgram is enable==true, but no program switch. More versatile toString(StringBuilder sb, boolean alsoUnlocated), by default don't dump uniforms/attributes w/o valid location.
* GLArrayData* VBO binding: Adding explicit bindBuffer(..) method, since VBO ↵Sven Gothel2012-10-122-4/+25
| | | | | | | | | is not more bound after enableBuffer(); Fix unit test (test VBO bound). Explicit bindBuffer(..) is required now, since enableBuffer() doesn't leave it bound. See fixed VBORegion* patch for use case, i.e. using a VBO index buffer for glDrawElements(). Complets commit 8582ece7dc7f65271b3184261697a542766d9864.
* Simplify GLArrayHandler and reduce VBO sideffectsSven Gothel2012-10-101-7/+1
| | | | | | | | | | VBO: Always unbind VBO ASAP after data transfer (glBufferData()) and assignment (glVertexPointer(..), glVertexAttribPointer()). It's a bug to leave it bound .. due to redundancy and other calls which could have change the VBO binding. Removed syncData(..), now it's only issued at enable and hence migrated into the enable method.
* ImmModeSink: Fix bugs (use glBufferUsage, vboUsage, GL_POLYGON, GL_QUADS) ↵Sven Gothel2012-10-102-234/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and add API docs. (API Change) - Changed create*(..) factory methods (API Change) - Drop passing GL instance, not needed - allows creation of ImmModeSink as final field w/o GL context - Use 'glBufferUsage' to determine whether to use VBO or not ( 0 == glBufferUsage ) - Use glBufferUsage in glBufferData(..) call (oops) - Toggle vboUsage per object ( 0 == glBufferUsage ? nonVBO : VBO ) remove static VBO usage flag - Fix render mode - GL_POLYGON -> GL_TRIANGLE_FAN (not GL_LINES) - GL_QUADS -> Looped GL_TRIANGLE_FAN (is !GL2) in draw(..) w/ and w/o indices - Buffer usage - documented - allow creating sink w/ all components (vertices, color, normal and texCoords) bit render and grow only used parts. This allows proper usage of sink where it is not known which types are being used. - Added test case - Manually tested w/ Jake2 ES1 Jake2 uses the FFP immediate mode rendering, where we utilize this sink w/o rendering artifacts.
* GLBuffers.slice: Preserve parent buffer position/limit and the parent's ↵Sven Gothel2012-10-101-8/+19
| | | | byte-order for sliced result
* FloatUtil/PMVMatrix/GLUniformData: Move impl. of FloatBuffer matrix ↵Sven Gothel2012-10-101-53/+2
| | | | toString(..) from PMVMatrix to FloatUtil and make it more generic; GLUniformData toString() also dumps it's matrices.
* Fix regression of commit a644d779ab19cb1d200ae4ba567b9c042c34b337, cannot ↵Sven Gothel2012-10-041-6/+9
| | | | | | compile FixedFuncHook due to removed 'isDirty()' - getModifiedBits() -> getModifiedBits(boolean clear)
* ShaderState: Adding Class API doc and removing attached object w/ 'int' key, ↵Sven Gothel2012-10-041-22/+12
| | | | similar to GLContext change 6d241fc2a46413ee478985d676d2481c5a7ed119
* Update PMVMatrix/GLMatrixFunc API doc and refine PMVMatrix update / ↵Sven Gothel2012-10-041-198/+582
| | | | | | | | | | | | | | | | | | | | | | get-Mvi/Mvit-Matrix operation. (Minor API change) Using bitmask for requested Mvi and Mvit matrices, same as dirty-bits to ease matching and update operation. Update of Mvi and Mvit will be performed only if it's dirty-bit and request-bit set within update(). The individual dirty bit is cleared only if it's matrix update is performed. Update is also issued at get-Mvi/Mvit-Matrix operations to ensure proper values w/o update call w/o clearing the modified-bits. update() returns true if the Mvi or Mvit matrix got updated _or_ one of the modified bits is set. update() clears the modified-bits. Adding explicit getModifiedBits() to get and clear it's state. Adding unit test. Lots of API docs ..
* Texture: Clarifiy API doc of getTextureObject(GL)Sven Gothel2012-09-281-1/+6
|
* GLReadBufferUtil, ShaderUtil: Catch GLException (and dump if thrown), to ↵Sven Gothel2012-09-202-20/+31
| | | | increase robustness $ glReadPixels and Get NUM_SHADER_BINARY_FORMATS
* NativeWindowFactory.getNativeWindowType(..): Return canonical string ↵Sven Gothel2012-08-181-1/+1
| | | | | | representation allowing proper use of ref. comparison '==', instead of 'String.equals()' Also make NativeWindowFactory's instances of nativeWindowingTypePure and nativeWindowingTypeCustom static final.
* Robostness FBObject / GLReadBufferUtil: Ignore pre-existing GL errors - ↵Sven Gothel2012-08-171-0/+4
| | | | | | | | | | | remove GL error checking in FBObject bind/unbind. - User GL code caused errors shall not fail impl. - FBObject bind/unbind GL error checking is almost useless due to it's simple code, would only catch user GL code errors, which should be ignored here. - MultisampleDemoES2: Only enable GL_MULTISAMPLE if available, i.e. validate passed multisample flag
* Bug 599 - FBObject / Offscreen Support - Part 1Sven Gothel2012-07-1910-577/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New FBObject implementation handling FBO and it's attachments *** API CHANGE: Util -> Core *** while it's size and sample-count can be reconfigured on the fly. - com.jogamp.opengl.util.FBObject -> com.jogamp.opengl.FBObject - agnostic to texture unit - separate attachments using OO hierarchy reflecting FBO - handling MSAA and blitting - no FBO destruction for reconfig (attach/detach) - New GLFBODrawableImpl impl. an FBObject based GLDrawable - Instantiated by a dummy native surface (onscreen and invisible) hooked up to a dummy GLDrawable, which is the delegation for context creation. - Utilizies ProxySurface.UpstreamSurfaceHook for dummy surface avoiding specialization for native platforms. - TODO: Allow to utilize common surface interface as a dummy-surface to supporting API seperation of windowing/GL. The latter allows impl. of createGLDrawable(NativeSurface) with FBO. - New OffscreenAutoDrawable (extends GLAutoDrawableDelegate) for all offscreen drawables. Shall replace GLPbuffer. - New GLCapabilities*.isFBO() / setFBO(boolean) to request FBO offscreen, similar to isPBuffer(). Rule: if both are requested, FBO shall be favored. - GLContext adds raw FBO availability query (min. FBO avail), FBObject contains fine grained queries (TODO: Move parts to GLContext for efficiency). - Add framebuffer tracking, allowing fast querying: - GLBase/GLContext: public int getBoundFramebuffer(int target); public int getDefaultDrawFramebuffer(); public int getDefaultReadFramebuffer(); - GLContextImpl public final void setBoundFramebuffer(int target, int framebufferName) .. called by GL impl bind framebuffer - GL: getDefaultDrawFramebuffer(), getDefaultReadFramebuffer() Adding default framebuffer queries being issued by GL.glBindFramebuffer(target, 0) w/ a default framebuffer, o.e. zero. This allows a transparent use of a custom FBO even in case the applications attempts to reset FBO to zero. Value flow: GL <- GLContext <- GLDrawable, - GLCapabilities handle fbo/pbuffer seperate, don't disable the other - GLContext/GL track read/write framebuffer to be queried by FBObject to determine whether to bind/unbind a framebuffer - Test cases for multiple FBO w/ and w/o MSAA Other Features: - New interface ProxySurface.UpstreamSurfaceHook, allowing to hook an upstream surface of unknown type providing lifecycle and information (size, ..) callbacks. Used for all new dummy NativeSurface impl and SWT GLCanvas. - GLContext -> GLDrawable propagation context/drawable lifecycle via ProxySurface.UpstreamSurfaceHook allowing dynamic resources to react (create, init, ..) - contextRealized() - contextMadeCurrent() - SurfaceChangeable -> MutableSurface currently only contains setting the surface handle. TODO: May need to move ProxySurface.UpstreamSurfaceHook -> MutableSurface.UpstreamSurfaceHook, allowing other impl. classes (NEWT OffscreenWindow) to utilize the new upstream hookup mechanism - will allow FBO/Dummy window to work. - SWT GLCanvas using ProxySurface.UpstreamSurfaceHook for proper size propagation. - New GLAutoDrawable::getUpstreamWidget(), allowing GLEventListener to fetch the owning Java side UI element (NEWT, SWT, AWT, ..). - GLDrawableFactory: Removed createOffscreenSurface() - unused and not GL related - EGLDrawableFactory handles device/profile avail. mapping while actually creating context/drawable. This allows us to learn whether the ES context is software/hardware as well as FBO avail. - EGLDrawable: Removed secret buckets of EGL configs :) Employ native surface (X11, WGL, ..) to EGL 'mapping' in EGLDrawableFactory utilizing new EGLUpstreamSurfaceHook (implements ProxySurface.UpstreamSurfaceHook). Other Bugs: - Add CTX_OPTION_DEBUG to ctx/extension cache key since only a debug ctx may expose the ARB debug capability. This bug caused lack of ARB/AMD debug functionality. - Fix GLProfile deadlock (debug mode, w/ EGL/ES, no X11), dump availability information _after_ lock. - ImmModeSink draw(): Use GL's glDrawElements(..), don't cast for GL2ES1. Fixes use for GL2ES2. - Fix KeyEvent.getKeyChar() comment (-> only stable for keyTyped(..)) Misc: - Refined alot of API doc - New GLExtensions holds commonly used GL extension strings, allows better referencing and usage lookup. - Move GL (interface) decl. to GLBase - GLBuffers: Cleanup API doc (format, types) - TextureIO: Add PAM and PPM static suffix identifier - GLCapabilities getNumSamples() returns 0 if sampleBuffers is disabled, this seems to be more natural. - finalized a lot
* Misc cleanup: add @OverrideSven Gothel2012-06-271-1/+1
|
* TextureIO TGA/PNG: Use RGB[9] for 1-3 channel data; PNGImage(PNGJ) add 1 ↵Sven Gothel2012-06-184-35/+65
| | | | channel (Luminance) read/write
* Fix Bug 590: Wrong GL2 and GLES2 aliasing of ↵Sven Gothel2012-06-161-0/+2
| | | | | | | | | | | | | | | | GL_ARB_half_float_pixel/GL_ARB_half_float_vertex and GL_OES_texture_half_float extensions We mistakenly aliase the GL2 and GLES2 extensions: - GL_ARB_half_float_pixel - GL_HALF_FLOAT_ARB 0x140B - GL_ARB_half_float_vertex - GL_HALF_FLOAT 0x140B - GL_OES_texture_half_float extensions - GL_HALF_FLOAT_OES 0x8D61 This also leads to adding GL_HALF_FLOAT_OES to com.jogamp.opengl.util.GLBuffers.sizeof(..).
* Core/Animator: Force animator thread to be non-daemon.Sven Gothel2012-04-211-0/+5
| | | | | Even thought we didn't set the thread to be a daemon, if the [parent] thread instantiating the Animator the attribute would be passed along.