aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-01 01:45:16 +0200
committerSven Gothel <[email protected]>2011-10-01 01:45:16 +0200
commitdf3c10d8bb7c220b4837733a2fc5a53b7f56f50d (patch)
tree8bfa5e85b34322f0d1cf6320caea196accb6c7cb /src/test/com/jogamp/opengl
parentbdfdd4db38e3908e67909624cbb15da3728dabcb (diff)
parent321720090314836d663b0bed0925c0cea76193e0 (diff)
fix conflict
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java7
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp9
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java27
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.vp15
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.vp34
5 files changed, 41 insertions, 51 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
index b750e8eb1..81c97d861 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
@@ -59,6 +59,13 @@ public class RedSquareES2 implements GLEventListener {
System.err.println(Thread.currentThread()+" RedSquareES2.init ...");
GL2ES2 gl = glad.getGL().getGL2ES2();
+ System.err.println(Thread.currentThread()+"Chosen GLCapabilities: " + glad.getChosenGLCapabilities());
+ System.err.println(Thread.currentThread()+"INIT GL IS: " + gl.getClass().getName());
+ System.err.println(Thread.currentThread()+"GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
+ System.err.println(Thread.currentThread()+"GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
+ System.err.println(Thread.currentThread()+"GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
+
+
System.err.println(Thread.currentThread()+" GL Profile: "+gl.getGLProfile());
System.err.println(Thread.currentThread()+" GL:" + gl);
System.err.println(Thread.currentThread()+" GL_VERSION=" + gl.glGetString(GL.GL_VERSION));
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp
index a4b9828e0..d3cfecd94 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp
@@ -10,14 +10,11 @@
*/
#ifdef GL_ES
- #define MEDIUMP mediump
- #define HIGHP highp
-#else
- #define MEDIUMP
- #define HIGHP
+ precision mediump float;
+ precision mediump int;
#endif
-varying HIGHP vec4 frontColor;
+varying vec4 frontColor;
void main (void)
{
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
index 3ef62df31..cdbf3d9b8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
@@ -31,17 +31,14 @@ package com.jogamp.opengl.test.junit.jogl.demos.es2.shader;
public class RedSquareShader {
public static String VERTEX_SHADER_TEXT =
" #ifdef GL_ES\n" +
- " #define MEDIUMP mediump\n" +
- " #define HIGHP highp\n" +
- "#else\n" +
- " #define MEDIUMP\n" +
- " #define HIGHP\n" +
+ " precision mediump float;\n" +
+ " precision mediump int;\n" +
"#endif\n" +
"\n" +
- "uniform MEDIUMP mat4 mgl_PMVMatrix[2];\n" +
- "attribute HIGHP vec4 mgl_Vertex;\n" +
- "attribute HIGHP vec4 mgl_Color;\n" +
- "varying HIGHP vec4 frontColor;\n" +
+ "uniform mat4 mgl_PMVMatrix[2];\n" +
+ "attribute vec4 mgl_Vertex;\n" +
+ "attribute vec4 mgl_Color;\n" +
+ "varying vec4 frontColor;\n" +
"\n" +
"void main(void)\n" +
"{\n" +
@@ -50,19 +47,15 @@ public class RedSquareShader {
"}\n" ;
public static String FRAGMENT_SHADER_TEXT =
- "#ifdef GL_ES\n" +
- " #define MEDIUMP mediump\n" +
- " #define HIGHP highp\n" +
- "#else\n" +
- " #define MEDIUMP\n" +
- " #define HIGHP\n" +
+ " #ifdef GL_ES\n" +
+ " precision mediump float;\n" +
+ " precision mediump int;\n" +
"#endif\n" +
"\n" +
- "varying HIGHP vec4 frontColor;\n" +
+ "varying vec4 frontColor;\n" +
"\n" +
"void main (void)\n" +
"{\n" +
" gl_FragColor = frontColor;\n" +
"}\n" ;
-
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.vp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.vp
index 305f5c2c2..bfd44c8f4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.vp
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.vp
@@ -10,17 +10,14 @@
*/
#ifdef GL_ES
- #define MEDIUMP mediump
- #define HIGHP highp
-#else
- #define MEDIUMP
- #define HIGHP
+ precision mediump float;
+ precision mediump int;
#endif
-uniform MEDIUMP mat4 mgl_PMVMatrix[2];
-attribute HIGHP vec4 mgl_Vertex;
-attribute HIGHP vec4 mgl_Color;
-varying HIGHP vec4 frontColor;
+uniform mat4 mgl_PMVMatrix[2];
+attribute vec4 mgl_Vertex;
+attribute vec4 mgl_Color;
+varying vec4 frontColor;
void main(void)
{
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.vp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.vp
index 0e417290c..b2d77082b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.vp
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.vp
@@ -2,28 +2,24 @@
// Details see GearsES2.java
#ifdef GL_ES
- #define MEDIUMP mediump
- #define HIGHP highp
-#else
- #define MEDIUMP
- #define HIGHP
+ precision mediump float;
+ precision mediump int;
#endif
+uniform mat4 pmvMatrix[4]; // P, Mv, Mvi and Mvit
+uniform vec3 lightPos;
-uniform MEDIUMP mat4 pmvMatrix[4]; // P, Mv, Mvi and Mvit
-uniform MEDIUMP vec3 lightPos;
+attribute vec4 vertices;
+attribute vec4 normals;
-attribute MEDIUMP vec4 vertices;
-attribute MEDIUMP vec4 normals;
+varying vec3 normal;
+varying vec4 position;
+varying vec3 lightDir;
+varying float attenuation;
+varying vec3 cameraDir;
-varying MEDIUMP vec3 normal;
-varying MEDIUMP vec4 position;
-varying MEDIUMP vec3 lightDir;
-varying MEDIUMP float attenuation;
-varying MEDIUMP vec3 cameraDir;
-
-const MEDIUMP float constantAttenuation = 0.5; // 1.0;
-const MEDIUMP float linearAttenuation = 0.001; // 0.0;
-const MEDIUMP float quadraticAttenuation= 0.0002; // 0.0;
+const float constantAttenuation = 0.5; // 1.0;
+const float linearAttenuation = 0.001; // 0.0;
+const float quadraticAttenuation= 0.0002; // 0.0;
void main(void)
{
@@ -38,7 +34,7 @@ void main(void)
// Calculating The Vector From The Vertex Position To The Light Position
lightDir = lightPos - position.xyz;
- MEDIUMP float d = length(lightDir);
+ float d = length(lightDir);
attenuation = 1.0 / (
constantAttenuation +
linearAttenuation * d +