aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util/glsl
Commit message (Collapse)AuthorAgeFilesLines
* Fix Bug 815: GL*: Change glIs<Buffer>Enabled() -> glIs<Buffer>Bound() to ↵Sven Gothel2013-08-141-8/+8
| | | | | | | | | | | | | | | | reflect semanics - Also fix the exception message (enabled/disabled -> bound/unbound) Reason of change: Avoid confusion and point to the cause! API change: glIsVBOArrayEnabled() -> glIsVBOArrayBound() glIsVBOElementArrayEnabled() -> glIsVBOElementArrayBound() glIsPBOPackEnabled() -> glIsPBOPackBound() glIsPBOUnpackEnabled() -> glIsPBOUnpackBound() Exception message change: "must be enabled to call this method" -> "must be bound to call this method" "must be disabled to call this method" -> "must be unbound to call this method"
* Remedy for Bug 782: Issue Debug.initSingleton() or Debug.debug(..) before ↵Sven Gothel2013-07-171-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | calling 'PropertyAccess.isPropertyDefined(propName, default)' through Debug class. Calling 'Debug.isPropertyDefined(propName, default)' may be 'optimized' to 'PropertyAccess.isPropertyDefined(propName, default)', which would skip the modules Debug's class initialization. Iff that happens, an AccessControlException may happen, due to requesting an insecure property, since modules own Debug class has not been added it's trusted prefixes from within it's init block yet. This seems to be a bug of the JVM .. to me, however .. the above description is the only able to explain the issue at hand. +++ Fix calls Debug class own static methods, either Debug.initSingleton() or Debug.debug(), before calling 'isPropertyDefined(propName, default)'. +++ Also mark Debug class static methods final! +++
* Fix Bug 737: Add shader default precision for GLSL [1.30 .. 1.50[ - See GLSL ↵Sven Gothel2013-05-172-4/+4
| | | | Spec [1.30 - 1.40].
* type: weather -> whether :) .. it's spring again :)Sven Gothel2013-04-181-1/+1
|
* GLJPanel: Impl. is GLProfile agnostic; Use ↵Sven Gothel2012-12-161-0/+195
| | | | | | | | | | | | | | GLDrawableFactory.createOffscreenDrawable(..) for common OffscreenBackend (dropping pbuffer/software); Flip FBO w/ GLSL texture renderer. - Implementation is GLProfile agnostic - Shall work on ES2, GL2, .. etc - Use GLDrawableFactory.createOffscreenDrawable(..) for common OffscreenBackend (dropping pbuffer/software) - Leave offscreen selection to common factory code, favoring FBO - Flip FBO w/ GLSL texture renderer - Faster on low CPU machines - Enabled if GL2ES2 and FBO offscreen
* GLArrayData/ImmModeSink: Remove implicit dependency on ShaderState - allow ↵Sven Gothel2012-12-162-13/+84
| | | | | | | | | | | | | | | | | | | | | | operating w/o it; ShaderState: Remove notion of GL context attachment, use pass-through or object association; GLArrayData/GLUniformData: Add basic GLSL location methods - GLArrayData/GLUniformData: Add basic GLSL location methods - GLArrayData - add: setLocation(..) for attribute location/index retrieval (post link) and binding (pre link) - GLUniformData - add: setLocation(..) for attribute location/index retrieval (post link) - GLArrayData/ImmModeSink: Remove implicit dependency on ShaderState - allow operating w/o it - GLArrayData - add: 'public void associate(Object obj, boolean enable)', allows setting ShaderState usage - ShaderState: Remove notion of GL context attachment, use pass-through or object association - ownsAttribute(..) associates the attribute w/ ShaderState - removed GL context ShaderState attachment Tested: - ImmModeSink w/ GLSL/ES2 w/ and w/o ShaderState - GLArrayData* w/ and w/o ShaderState
* Shader: Add '#define texture2D texture' for GLSL >= 130 ; TestGearsES2AWT ↵Sven Gothel2012-10-311-0/+1
| | | | add forceGL3; TextureDraw01ES2Listener uses defaultShaderCustomization()
* FixedFuncPipeline: Use proper shader version and make GLSL code compatible ↵Sven Gothel2012-10-297-26/+57
| | | | w/ higher GLSL versions
* FixedFuncPipeline: Require GLSL 1.20 (GL 2.1) due to GL driver bugs in OSX ↵Sven Gothel2012-10-231-3/+1
| | | | (gl_PointCoords n/a otherwise); Add FFP Emul point test in TestPointNEWT/PointDemoES1.
* FixedFuncHook/ImmModeSink: Fix *Pointer 'normalized' parameterSven Gothel2012-10-221-11/+10
| | | | | | | | | 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.
* FixedFuncPipeline GL_POINTS: Fix gl_PointSize (attribute data format), Add ↵Sven Gothel2012-10-224-97/+91
| | | | | | | | | | | | | | GL_POINT_SOFT and dist/fade attenuation (Adding basic POINT unit tests) gl_PointSize (and all other uniform array elems) was not propagated due to wrong usage of GLUniformData component param. Due to efficiency, we use vec4[2] now and #defines in shader to easy readability. GL_POINT_SOFT uses gl_PointCoord to determnine inside/outside circle position while adding a seam of 10% in/out. This almost matches 'other' implementations and gives a nice smooth circle. !GL_POINT_SOFT produces a proper square (billboard). Point-Vertex shader takes dist/fade attentuation into account.
* FFP-Emu: Adding simple POINTS shader ; Adding GLRunnable2 interface, ↵Sven Gothel2012-10-204-61/+241
| | | | | | | | | | | | allowing passing a GL action w/ custom argument and return value. Adding simple POINTS shader not regarding POINTS parameters and not using a texture (commented out). FIXME: Event thought it works using a texture and gl_PointCoord in frag shader, I don't see the point here (lol) if gl_PointSize must be 1.0 in vert shader .. otherwise nothing is seen on ES2.0. On Desktop POINTS are always shown as 1 pixel sized points!
* FixedFuncPipeline: Add GL_POINT* state tracking; Fix glDrawArrays(): Issued ↵Sven Gothel2012-10-193-49/+131
| | | | | | twice (duh!) almost halfed performance :) TODO: Create GL_POINT texture and render w/ glDraw*()
* FixedFuncPipeline: Don't handle CullFace, ES2 impl. already takes care of ↵Sven Gothel2012-10-185-11/+20
| | | | discarding pixels of culled faces.
* FixedFuncPipeline: Cache current ShaderSelectionMode, update PMVMatrix ↵Sven Gothel2012-10-181-12/+25
| | | | according it's usage (update Mvi/Mvit only if lighting is being used)
* FixedFuncPipeline/Hook: Add glColor4ub() w/ value conversion, make ↵Sven Gothel2012-10-182-9/+24
| | | | glColor4f() more efficient, use pre-alloc NIO buffer
* ImmModeSink: Fix buffer grow (+1 element @ named buffer), enable DEBUG_* via ↵Sven Gothel2012-10-161-6/+13
| | | | properties, drawIndices QUAD w/ proper range and add uint; FixedFunctionHook: drawIndices QUAD w/ proper range and add uint
* FixedFuncColorTexture.fp: Remove unused local varSven Gothel2012-10-151-2/+0
|
* FixedFuncPipeline: Use ES2/GL2 prelude and set default precision. Shader ↵Sven Gothel2012-10-146-37/+49
| | | | code: Remove precision for default precision types.
* FixedFuncPipeline: Use resource efficient texture shader in AUTO mode as wellSven Gothel2012-10-141-2/+18
|
* FixedFuncPipeline: Optimize shader resource, if preset != ↵Sven Gothel2012-10-137-80/+206
| | | | ShaderSelectionMode.AUTO (good for mobile); Lazy shader instantiation.
* FixedFuncHook: Add ES2 alignment of certain GL functions, i.e. ↵Sven Gothel2012-10-121-3/+50
| | | | GL_QUAD_STRIP/GL_POLYGON/GL_QUADS mapping, glTexImage2D internalformat/format match.
* GLArrayData* VBO binding: Properly document and impl. bindBuffer(..) in ↵Sven Gothel2012-10-122-24/+10
| | | | | | | | | 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-1210-298/+880
| | | | | | | | | (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.
* Simplify GLArrayHandler and reduce VBO sideffectsSven Gothel2012-10-103-45/+31
| | | | | | | | | | 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.
* Fix regression of commit a644d779ab19cb1d200ae4ba567b9c042c34b337, cannot ↵Sven Gothel2012-10-041-1/+1
| | | | | | compile FixedFuncHook due to removed 'isDirty()' - getModifiedBits() -> getModifiedBits(boolean clear)
* FixedFuncPipeline: Cleanup warnings ..Sven Gothel2012-10-041-7/+7
|
* API Change ShaderCode/ShaderUtil: Enable optional mutable shader source / ↵Sven Gothel2012-04-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | generalize shader source storage type to CharSequence[] Benefits: - Allows code injection and general shader source editing (before compilation) - Uses mutable StringBuilder only if editing is intended, hence reduces memory footprint and String conversion at compilation in such case. - ShaderCode.create(..) factory methods add nw attribute 'mutableStringBuilder' if true method returns a mutable StringBuilder instance which can be edited later on at the costs of a String conversion when passing to 'glShaderSource(int, int, String[], IntBuffer)'. If <code>false</code> method returns an immutable <code>String</code> instance, which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)} at no additional costs. - New 'edit' methods in ShaderCode: ' - int insertShaderSource(int shaderIdx, String tag, int fromIndex, CharSequence data); - int insertShaderSource(int shaderIdx, int position, CharSequence data);
* StringBuffer -> StringBuilder (Local objects, no concurrency) ; Impacts: ↵Sven Gothel2012-04-161-8/+7
| | | | Capabilities/GLContext API 'toString(StringBuilder)'
* Fix commit fb7165e690546359dee92dd60b04be69f141c87e; Clarify ↵Sven Gothel2012-02-201-4/+4
| | | | ShaderState.attachShaderProgram(..)
* Cleanup ShaderCode/Program/StateSven Gothel2012-02-191-2/+1
| | | | | | - Add multiple sources for create ShaderCode - Add Shaderstate attachShaderProgram w/ enable flag - Clarify doc
* GLArrayData<VBO>: Add GLArrayHandlerFlat ; Update VBO name to interleaved ↵Sven Gothel2011-10-073-13/+137
| | | | | | | subarrays - Add GLArrayHandlerFlat gives better distinction of semantics - update sub-array VBO name, if parent's interleaved array initializes it.
* GLSL DataArray/Handler: Remove ShaderState state and pass it through: ↵Sven Gothel2011-08-303-141/+18
| | | | | | | | | ShaderState.getShaderState(gl) This removes the dependency of a GLSL GLDataArray object to a specific ShaderState and enables sharing of this VBO data, i.e. via a shared context. Test: TestSharedContextVBOES2NEWT
* API Change GLArrayDataWrapper/GLArrayDataServer: Add vboTarget to wrapper ↵Sven Gothel2011-08-221-8/+8
| | | | | | cstr and add interleaved seg. vboTarget is required in case of interleaved segments to allow eg. interleaved indices.
* Fix regression of commit 6c346d98f04e2355210960fe9ffde47432f04d62, where ↵Sven Gothel2011-08-223-22/+76
| | | | VBO/attribute binding wasn't updated (VBO data written, shader change/switch attribute on same location) ; Optimized interleaved GLSL VBO binding, hence split up GLArrayHandler syncData/enableState
* Misc Rename/Reloc; GLArrayData*/PMVMatrix enhancments; Test fixes/adds ↵Sven Gothel2011-08-228-39/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GearsES1/ES2) rename/reloc: - javax.media.nativewindow.util: DimensionReadOnly -> DimensionImmutable PointReadOnly -> PointImmutable RectangleReadOnly -> RectangleImmutable unified 'immutable' name as used within jogamp already - remove array handler from public API com.jogamp.opengl.util.GL*ArrayHandler -> jogamp.opengl.util.GL*ArrayHandler - GLArrayData: Clarify method names getComponentNumber() -> getComponentCount() getComponentSize() -> getComponentSizeInBytes() getElementNumber() -> getElementCount() getByteSize() -> getSizeInBytes() - FixedFuncPipeline: Moved def. array names to GLPointerFuncUtil enhancement: - GLArrayDataServer: Add support for interleaved arrays/VBO - GLArrayData*.createFixed(..) remove 'name' argument (non sense for fixed function) - PMVMatrix: - one nio buffer - removed 'Pmv' multiplied matrix - removed 2x2 cut down 'Mvi' normal matrix (use 4x4 Mvi) - tests: - RedSquare -> RedSquareES1/RedSquareES2 - Gears ES1 fixed + ES2 added. Both work properly and share common Gears VBO construction - Added TestMapBuffer01NEWT, testing glMapBuffer
* Cont. fix 'Allow VBO/Texture Name (int) < 0'Sven Gothel2011-08-011-4/+4
| | | | | | | Refines spec GLArrayData and it's implementations. see commit 4d33a2df1e991ab75817dcb44061d88d3c499cdb see commit 2dbd16fc3edf29b39ba37a11b9fbf1b2aad75c45
* Fixed regression of commit 360b86f4b5d0e440863c1749fe990e39fbabc51cSven Gothel2011-08-011-2/+2
|
* ShaderState: Add 'ownUniform()/ownAttribute()'; rename glFunction -> ↵Sven Gothel2011-04-261-61/+61
| | | | | | | | | | | | | | function; switch program enh. ; Graph lifecycle Add 'ownUniform()/ownAttribute()' allowing to reset all bound uniforms/attributes, not just active ones plus handling the lifecycle of the owned attributes (destroy). This simplifies the lifecycle of all shader attributes. Rename glFunction -> function .. well, the GL attribute marks them GL related already Switch program enhancement. If switching to new program (unlinked), issue glBindAttributeLocation .. Graph lifecycle cleanup using the above ..
* GLArrayData API and impl. changesSven Gothel2011-04-221-14/+14
| | | | | | | | | | | | | | | | | | | | | | +++ Remove GL parameter for - createFixed(..) - createGLSL(..) validation at client/server array data happens at 1st enableBuffer() call, no current context or profile required at creation time. Added ShaderState for createGLSL(..) clarifying dependency to the ShaderState, passing it down to the GLSLArrayHandler, which also removes the TLS GLContext.getCurrent() call. +++ Partially reverted ab48dac3f4419ceac51fdf059f310f0f0499c4d7 factory methods: removed added vboTarget parameter, since all createFixed and createGLSL are GL_ARRAY_BUFFER (VBO). Adding createData(..) factory method in GLArrayDataServer allowing diff vbo targets, ie GL_ELEMENT_ARRAY_BUFFER .. or none.
* FIX: Refactor GLArrayData and all it's implementations/sub-interfaces (VBO ↵Sven Gothel2011-04-081-8/+8
| | | | | | | | | | target, comments, names) VBO target: Allowing ELEMENT_VERTEX_ARRAY w/o corresponding GLSL/Fixed attribute Names: Clarified method named. Comments: Added and fixed comments
* Move implementation private files from com.jogamp.<module>.impl. to ↵Sven Gothel2011-02-092-2/+2
| | | | | | | | | | | | | | | jogamp.<module> (2/2) - edit files - com.jogamp.opengl.impl -> jogamp.opengl - com.jogamp.opengl.util.glsl.fixedfunc.impl -> jogamp.opengl.util.glsl.fixedfunc - com.jogamp.nativewindow.impl -> jogamp.nativewindow - com.jogamp.newt.impl -> jogamp.newt This sorts implementation details from the top level, ie skipping the public 'com', allowing a better seperation of public classes and implementation details and also reduces strings. This approach of public/private seperation is also used in the OpenJDK.
* Move implementation private files from com.jogamp.<module>.impl. to ↵Sven Gothel2011-02-0820-0/+1207
jogamp.<module> (1/2) - rename task - com.jogamp.opengl.impl -> jogamp.opengl - com.jogamp.opengl.util.glsl.fixedfunc.impl -> jogamp.opengl.util.glsl.fixedfunc - com.jogamp.nativewindow.impl -> jogamp.nativewindow - com.jogamp.newt.impl -> jogamp.newt This sorts implementation details from the top level, ie skipping the public 'com', allowing a better seperation of public classes and implementation details and also reduces strings. This approach of public/private seperation is also used in the OpenJDK.