summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java4
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java11
4 files changed, 10 insertions, 13 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
index bc5fe7d11..d970b7029 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
@@ -383,7 +383,6 @@ public final class VBORegion2PMSAAES2 extends GLRegion {
private final AABBox drawWinBox = new AABBox();
private final Recti drawView = new Recti();
- private final Matrix4f drawMat4PMv = new Matrix4f();
private static final int border = 2; // surrounding border, i.e. width += 2*border, height +=2*border
@@ -426,8 +425,7 @@ public final class VBORegion2PMSAAES2 extends GLRegion {
drawView.setWidth(vpWidth);
drawView.setHeight(vpHeight);
- renderer.getMatrix().mulPMvMat(drawMat4PMv);
- box.mapToWindow(drawWinBox, drawMat4PMv, drawView, true /* useCenterZ */);
+ box.mapToWindow(drawWinBox, renderer.getMatrix().getPMvMat(), drawView, true /* useCenterZ */);
winWidth = drawWinBox.getWidth();
winHeight = drawWinBox.getHeight();
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
index a7fce3a92..889f4448d 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
@@ -444,7 +444,6 @@ public final class VBORegion2PVBAAES2 extends GLRegion {
private final AABBox drawWinBox = new AABBox();
private final Recti drawView = new Recti();
- private final Matrix4f drawMat4PMv = new Matrix4f();
private static final int border = 2; // surrounding border, i.e. width += 2*border, height +=2*border
@@ -487,8 +486,7 @@ public final class VBORegion2PVBAAES2 extends GLRegion {
drawView.setWidth(vpWidth);
drawView.setHeight(vpHeight);
- renderer.getMatrix().mulPMvMat(drawMat4PMv);
- box.mapToWindow(drawWinBox, drawMat4PMv, drawView, true /* useCenterZ */);
+ box.mapToWindow(drawWinBox, renderer.getMatrix().getPMvMat(), drawView, true /* useCenterZ */);
winWidth = drawWinBox.getWidth();
winHeight = drawWinBox.getHeight();
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);
}