diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java | 4 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java index 9cd8c863f..998406856 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java @@ -70,7 +70,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun this.pmvMatrix = pmvMatrix; } else { this.ownsPMVMatrix = true; - this.pmvMatrix = new PMVMatrix(); + this.pmvMatrix = new PMVMatrix(PMVMatrix.INVERSE_MODELVIEW | PMVMatrix.INVERSE_TRANSPOSED_MODELVIEW); } fixedFunction = new FixedFuncPipeline(this.gl, mode, this.pmvMatrix); } @@ -91,7 +91,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun this.pmvMatrix = pmvMatrix; } else { this.ownsPMVMatrix = true; - this.pmvMatrix = new PMVMatrix(); + this.pmvMatrix = new PMVMatrix(PMVMatrix.INVERSE_MODELVIEW | PMVMatrix.INVERSE_TRANSPOSED_MODELVIEW); } fixedFunction = new FixedFuncPipeline(this.gl, mode, this.pmvMatrix, shaderRootClass, shaderSrcRoot, diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java index 6b7317dd6..c9e2664ba 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java @@ -56,6 +56,7 @@ import com.jogamp.common.util.IntIntHashMap; import com.jogamp.common.util.PropertyAccess; import com.jogamp.opengl.util.PMVMatrix; import com.jogamp.opengl.util.SyncBuffer; +import com.jogamp.opengl.util.SyncMatrices4f; import com.jogamp.opengl.util.glsl.ShaderCode; import com.jogamp.opengl.util.glsl.ShaderProgram; import com.jogamp.opengl.util.glsl.ShaderState; @@ -813,13 +814,13 @@ public class FixedFuncPipeline { } GLUniformData ud; - if( pmvMatrix.update() ) { + if( pmvMatrix.isReqDirty() ) { ud = shaderState.getUniform(mgl_PMVMatrix); if(null!=ud) { - final SyncBuffer m; + final SyncMatrices4f m; if(ShaderSelectionMode.COLOR_TEXTURE8_LIGHT_PER_VERTEX == currentShaderSelectionMode || ShaderSelectionMode.COLOR_LIGHT_PER_VERTEX== currentShaderSelectionMode ) { - m = pmvMatrix.getSyncPMvMvitMat(); + m = pmvMatrix.getSyncPMvMviMvitMat(); } else { m = pmvMatrix.getSyncPMvMat(); } @@ -827,7 +828,7 @@ public class FixedFuncPipeline { ud.setData(m); } // same data object .. - shaderState.uniform(gl, ud); + shaderState.uniform(gl, ud); // automatic sync + update of Mvi + Mvit } else { throw new GLException("Failed to update: mgl_PMVMatrix"); } @@ -1113,7 +1114,7 @@ public class FixedFuncPipeline { shaderState.attachShaderProgram(gl, selectShaderProgram(gl, requestedShaderSelectionMode), true); // mandatory .. - if(!shaderState.uniform(gl, new GLUniformData(mgl_PMVMatrix, 4, 4, pmvMatrix.getSyncPMvMvitMat()))) { + if(!shaderState.uniform(gl, new GLUniformData(mgl_PMVMatrix, 4, 4, pmvMatrix.getSyncPMvMviMvitMat()))) { throw new GLException("Error setting PMVMatrix in shader: "+this); } |