From ea8129ebe2a2ec1157bb752e435d16aab2ee932a Mon Sep 17 00:00:00 2001 From: Rami Santina Date: Sun, 2 Oct 2011 02:46:04 +0200 Subject: Fixed shader entry files a/b --- .../opengl/shader/curverenderer01-es2-merged.vp | 19 ++++++++ .../curve/opengl/shader/curverenderer01-es2.fp | 14 ------ .../curve/opengl/shader/curverenderer01-gl2.fp | 6 --- .../curve/opengl/shader/curverenderer01-sp-xxx.fp | 52 ---------------------- .../curve/opengl/shader/curverenderer01-sp-xxx.vp | 19 -------- .../opengl/shader/curverenderer01a-es2-merged.fp | 52 ++++++++++++++++++++++ .../curve/opengl/shader/curverenderer01a-es2.fp | 13 ++++++ .../curve/opengl/shader/curverenderer01a-gl2.fp | 6 +++ .../curve/opengl/shader/curverenderer01b-es2.fp | 14 ++++++ .../curve/opengl/shader/curverenderer01b-gl2.fp | 6 +++ 10 files changed, 110 insertions(+), 91 deletions(-) create mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-es2-merged.vp delete mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-es2.fp delete mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-gl2.fp delete mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-sp-xxx.fp delete mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-sp-xxx.vp create mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-es2-merged.fp create mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-es2.fp create mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-gl2.fp create mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-es2.fp create mode 100644 src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-gl2.fp diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-es2-merged.vp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-es2-merged.vp new file mode 100644 index 000000000..530b24f64 --- /dev/null +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-es2-merged.vp @@ -0,0 +1,19 @@ +//Copyright 2010 JogAmp Community. All rights reserved. + +#ifdef GL_ES + precision lowp float; + precision lowp int; +#endif + +uniform mat4 gcu_PMVMatrix[3]; // P, Mv, and Mvi +varying vec2 gcv_TexCoord; + +attribute vec4 gca_Vertices; +attribute vec2 gca_TexCoords; + + +void main(void) +{ + gl_Position = gcu_PMVMatrix[0] * gcu_PMVMatrix[1] * gca_Vertices; + gcv_TexCoord = gca_TexCoords; +} diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-es2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-es2.fp deleted file mode 100644 index adf2c62bd..000000000 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-es2.fp +++ /dev/null @@ -1,14 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#version 100 - -// we require dFdx/dFdy -// #extension OES_standard_derivatives : require -#extension GL_OES_standard_derivatives : enable - -precision mediump float; -precision mediump int; -precision mediump sampler2D; - -#include curverenderer01-xxx.fp - diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-gl2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-gl2.fp deleted file mode 100644 index ba4c7daa0..000000000 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-gl2.fp +++ /dev/null @@ -1,6 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#version 110 - -#include curverenderer01-xxx.fp - diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-sp-xxx.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-sp-xxx.fp deleted file mode 100644 index da32df51f..000000000 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-sp-xxx.fp +++ /dev/null @@ -1,52 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#ifdef GL_ES - precision lowp float; - precision lowp int; -#endif - -uniform mat4 gcu_PMVMatrix[3]; // P, Mv, and Mvi -uniform vec3 gcu_ColorStatic; -uniform float gcu_Alpha; - -varying vec2 gcv_TexCoord; - -const vec3 b_color = vec3(1.0, 1.0, 1.0); - -void main (void) -{ - vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y)); - vec3 c = gcu_ColorStatic; - - float alpha = 0.0; - - if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) { - alpha = gcu_Alpha; - } - else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) { - vec2 dtx = dFdx(rtex); - vec2 dty = dFdy(rtex); - - rtex.y -= 0.1; - - if(rtex.y < 0.0) { - rtex.y = 0.0; - } - - vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x)); - float position = rtex.y - (rtex.x * (1.0 - rtex.x)); - float d = position/(length(f)); - - float a = (0.5 - d * sign(gcv_TexCoord.y)); - - if (a >= 1.0) { - alpha = gcu_Alpha; - } else if (a <= 0.0) { - alpha=0.0; - } else { - alpha = gcu_Alpha * a; - } - } - - gl_FragColor = vec4(c, alpha); -} diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-sp-xxx.vp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-sp-xxx.vp deleted file mode 100644 index 530b24f64..000000000 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-sp-xxx.vp +++ /dev/null @@ -1,19 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#ifdef GL_ES - precision lowp float; - precision lowp int; -#endif - -uniform mat4 gcu_PMVMatrix[3]; // P, Mv, and Mvi -varying vec2 gcv_TexCoord; - -attribute vec4 gca_Vertices; -attribute vec2 gca_TexCoords; - - -void main(void) -{ - gl_Position = gcu_PMVMatrix[0] * gcu_PMVMatrix[1] * gca_Vertices; - gcv_TexCoord = gca_TexCoords; -} diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-es2-merged.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-es2-merged.fp new file mode 100644 index 000000000..da32df51f --- /dev/null +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-es2-merged.fp @@ -0,0 +1,52 @@ +//Copyright 2010 JogAmp Community. All rights reserved. + +#ifdef GL_ES + precision lowp float; + precision lowp int; +#endif + +uniform mat4 gcu_PMVMatrix[3]; // P, Mv, and Mvi +uniform vec3 gcu_ColorStatic; +uniform float gcu_Alpha; + +varying vec2 gcv_TexCoord; + +const vec3 b_color = vec3(1.0, 1.0, 1.0); + +void main (void) +{ + vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y)); + vec3 c = gcu_ColorStatic; + + float alpha = 0.0; + + if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) { + alpha = gcu_Alpha; + } + else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) { + vec2 dtx = dFdx(rtex); + vec2 dty = dFdy(rtex); + + rtex.y -= 0.1; + + if(rtex.y < 0.0) { + rtex.y = 0.0; + } + + vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x)); + float position = rtex.y - (rtex.x * (1.0 - rtex.x)); + float d = position/(length(f)); + + float a = (0.5 - d * sign(gcv_TexCoord.y)); + + if (a >= 1.0) { + alpha = gcu_Alpha; + } else if (a <= 0.0) { + alpha=0.0; + } else { + alpha = gcu_Alpha * a; + } + } + + gl_FragColor = vec4(c, alpha); +} diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-es2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-es2.fp new file mode 100644 index 000000000..e693891a6 --- /dev/null +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-es2.fp @@ -0,0 +1,13 @@ +//Copyright 2010 JogAmp Community. All rights reserved. + +#version 100 + +// we require dFdx/dFdy +// #extension OES_standard_derivatives : require +#extension GL_OES_standard_derivatives : enable + +precision mediump float; +precision mediump int; + +#include curverenderer01a-xxx.fp + diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-gl2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-gl2.fp new file mode 100644 index 000000000..d187fea24 --- /dev/null +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-gl2.fp @@ -0,0 +1,6 @@ +//Copyright 2010 JogAmp Community. All rights reserved. + +#version 110 + +#include curverenderer01a-xxx.fp + diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-es2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-es2.fp new file mode 100644 index 000000000..2e709630d --- /dev/null +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-es2.fp @@ -0,0 +1,14 @@ +//Copyright 2010 JogAmp Community. All rights reserved. + +#version 100 + +// we require dFdx/dFdy +// #extension OES_standard_derivatives : require +#extension GL_OES_standard_derivatives : enable + +precision mediump float; +precision mediump int; +precision mediump sampler2D; + +#include curverenderer01b-xxx.fp + diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-gl2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-gl2.fp new file mode 100644 index 000000000..01e08ff30 --- /dev/null +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-gl2.fp @@ -0,0 +1,6 @@ +//Copyright 2010 JogAmp Community. All rights reserved. + +#version 110 + +#include curverenderer01b-xxx.fp + -- cgit v1.2.3