aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorphil <[email protected]>2016-12-01 19:09:53 +1300
committerphil <[email protected]>2016-12-01 19:09:53 +1300
commite3715098dc137f776b551376c294f06a870425b6 (patch)
tree45086634577c0dcd8f590ecdc8db2228662f7a12 /src
parent7667e965a35a1c7eabb59ddb5621d629e30ffbec (diff)
maxVaryingVectors variable loaded into canvas3D
This is very important on low power hardware and affects shader design
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/jogamp/java3d/Canvas3D.java6
-rw-r--r--src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/jogamp/java3d/Canvas3D.java b/src/main/java/org/jogamp/java3d/Canvas3D.java
index b4d5bcb..fe21197 100644
--- a/src/main/java/org/jogamp/java3d/Canvas3D.java
+++ b/src/main/java/org/jogamp/java3d/Canvas3D.java
@@ -795,6 +795,8 @@ ArrayList<Integer> textureIdResourceFreeList = new ArrayList<Integer>();
// Max number of vertex attrs (not counting coord, etc.)
int maxVertexAttrs = 0;
+
+ int maxVaryingVectors = 0;
// End of variables set by createNewContext()/createQueryContext()
@@ -3741,8 +3743,12 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
keys.add("textureImageUnitsCombinedMax");
values.add(new Integer(maxCombinedTextureImageUnits));
+ keys.add("maxVaryingVectors");
+ values.add(new Integer(maxVaryingVectors));
+
keys.add("vertexAttrsMax");
values.add(new Integer(maxVertexAttrs));
+
keys.add("shadingLanguageGLSL");
values.add(new Boolean(shadingLanguageGLSL));
diff --git a/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java b/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java
index fa556e9..3e2ba74 100644
--- a/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java
+++ b/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java
@@ -7012,6 +7012,11 @@ class Jogl2es2Pipeline extends Jogl2es2DEPPipeline
{
cv.maxVertexAttrs = 0;
}
+
+ //http://stackoverflow.com/questions/26682631/webgl-shaders-maximum-number-of-varying-variables
+ gl.glGetIntegerv(GL2ES2.GL_MAX_VARYING_VECTORS, tmp, 0);
+ cv.maxVaryingVectors = tmp[0];
+
cv.shadingLanguageGLSL = true;
}
}
@@ -7030,6 +7035,7 @@ class Jogl2es2Pipeline extends Jogl2es2DEPPipeline
cv.maxVertexTextureImageUnits = 0;
cv.maxCombinedTextureImageUnits = 0;
cv.maxVertexAttrs = 0;
+ cv.maxVaryingVectors = 0;
cv.extensionsSupported = 0;
cv.textureExtendedFeatures = 0;
cv.textureColorTableSize = 0;