aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2023-09-20 19:51:55 +0200
committerSven Gothel <sgothel@jausoft.com>2023-09-20 19:51:55 +0200
commit5d6e8a367c03644740187e500c6de5d3ac039d5e (patch)
treea649f559413c51272ee3f4afff1f68ebfea45477 /src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
parentbbe845846ffc00807395a5070a7352c6bbe7e4ef (diff)
Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit agnostic (PMVMatrix, Matrix4f, Vec4f, ..)
Math functionality (PMVMatrix, Matrix4f, Vec4f, ..) - shall be used toolkit agnostic, e.g. independent from OpenGL - shall be reused within our upcoming Vulkan implementation - may also move outside of JOGL, i.e. GlueGen or within its own package to be reused for other purposed. The 'com.jogamp.opengl.util.PMVMatrix' currently also used to feed in GLUniformData via the toolkit agnostic SyncAction and SyncBuffer shall also be split to a toolkit agnostic variant. An OpenGL PMVMatrix specialization implementing GLMatrixFunc can still exist, being derived from the toolkit agnostic base implementation. +++ Initial commit .. compile clean, passing most unit tests.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java20
1 files changed, 10 insertions, 10 deletions
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 c9e2664ba..a4b5e9afd 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -54,9 +54,9 @@ import jogamp.opengl.Debug;
import com.jogamp.common.nio.Buffers;
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.math.util.PMVMatrix4f;
+import com.jogamp.math.util.SyncBuffer;
+import com.jogamp.math.util.SyncMatrices4f;
import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
import com.jogamp.opengl.util.glsl.ShaderState;
@@ -82,7 +82,7 @@ public class FixedFuncPipeline {
public static final int MAX_TEXTURE_UNITS = 8;
public static final int MAX_LIGHTS = 8;
- public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
+ public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix4f pmvMatrix) {
shaderRootClass = FixedFuncPipeline.class;
shaderSrcRoot = shaderSrcRootDef;
shaderBinRoot = shaderBinRootDef;
@@ -92,7 +92,7 @@ public class FixedFuncPipeline {
fragmentColorTextureFile = fragmentColorTextureFileDef;
init(gl, mode, pmvMatrix);
}
- public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix,
+ public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix4f pmvMatrix,
final Class<?> shaderRootClass, final String shaderSrcRoot,
final String shaderBinRoot,
final String vertexColorFile, final String vertexColorLightFile,
@@ -820,9 +820,9 @@ public class FixedFuncPipeline {
final SyncMatrices4f m;
if(ShaderSelectionMode.COLOR_TEXTURE8_LIGHT_PER_VERTEX == currentShaderSelectionMode ||
ShaderSelectionMode.COLOR_LIGHT_PER_VERTEX== currentShaderSelectionMode ) {
- m = pmvMatrix.getSyncPMvMviMvitMat();
+ m = pmvMatrix.getSyncPMvMviMvit();
} else {
- m = pmvMatrix.getSyncPMvMat();
+ m = pmvMatrix.getSyncPMv();
}
if(m != ud.getBuffer()) {
ud.setData(m);
@@ -1102,7 +1102,7 @@ public class FixedFuncPipeline {
return sp;
}
- private void init(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
+ private void init(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix4f pmvMatrix) {
if(null==pmvMatrix) {
throw new GLException("PMVMatrix is null");
}
@@ -1114,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.getSyncPMvMviMvitMat()))) {
+ if(!shaderState.uniform(gl, new GLUniformData(mgl_PMVMatrix, 4, 4, pmvMatrix.getSyncPMvMviMvit()))) {
throw new GLException("Error setting PMVMatrix in shader: "+this);
}
@@ -1202,7 +1202,7 @@ public class FixedFuncPipeline {
/** ( pointSize, pointSmooth, attn. pointMinSize, attn. pointMaxSize ) , ( attenuation coefficients 1f 0f 0f, attenuation fade theshold 1f ) */
private final FloatBuffer pointParams = Buffers.newDirectFloatBuffer(new float[] { 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f });
- private PMVMatrix pmvMatrix;
+ private PMVMatrix4f pmvMatrix;
private ShaderState shaderState;
private ShaderProgram shaderProgramColor;
private ShaderProgram shaderProgramColorTexture2, shaderProgramColorTexture4, shaderProgramColorTexture8;