aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
authorRami Santina <[email protected]>2011-04-02 16:52:41 +0300
committerRami Santina <[email protected]>2011-04-02 16:52:41 +0300
commit2d681a3d1557c8cdc15fbed70a3b52d82be4052c (patch)
tree75abdf7d91e7ec67cb0c169e7a8e2fef648cec23 /src/jogl/classes
parentc2fdfa4e25a378f1d82b41417b1370a93048ab62 (diff)
Fix: p1y region set to 0.5, cleaned shader
Diffstat (limited to 'src/jogl/classes')
-rwxr-xr-xsrc/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java2
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java2
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.fp11
3 files changed, 6 insertions, 9 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
index 607a8d5df..c1f293fff 100755
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
@@ -47,7 +47,7 @@ public class RegionRendererImpl01 extends RegionRenderer {
* on the off-curve vertex. The high value of sharpness will
* result in high curvature.
*/
- private GLUniformData mgl_sharpness = new GLUniformData("p1y", 0.0f);
+ private GLUniformData mgl_sharpness = new GLUniformData("p1y", 0.5f);
GLUniformData mgl_alpha = new GLUniformData("g_alpha", 1.0f);
private GLUniformData mgl_color = new GLUniformData("g_color", 3, FloatBuffer.allocate(3));
private GLUniformData mgl_strength = new GLUniformData("a_strength", 3.0f);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
index d7fbd8e33..0f0b91412 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
@@ -47,7 +47,7 @@ public class TextRendererImpl01 extends TextRenderer {
* on the off-curve vertex. The high value of sharpness will
* result in high curvature.
*/
- private GLUniformData mgl_sharpness = new GLUniformData("p1y", 0.0f);
+ private GLUniformData mgl_sharpness = new GLUniformData("p1y", 0.5f);
GLUniformData mgl_alpha = new GLUniformData("g_alpha", 1.0f);
private GLUniformData mgl_color = new GLUniformData("g_color", 3, FloatBuffer.allocate(3));
private GLUniformData mgl_strength = new GLUniformData("a_strength", 1.8f);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.fp
index 6f75c3e69..3a1ef5157 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.fp
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.fp
@@ -63,7 +63,7 @@ void main (void)
vec2 dtx = dFdx(rtex);
vec2 dty = dFdy(rtex);
- rtex.y -= p1y - 0.1;
+ rtex.y -= 0.1;
if(rtex.y < 0.0) {
if(v_texCoord.y < 0.0)
@@ -74,24 +74,21 @@ void main (void)
}
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(v_texCoord.y));
-
if (a >= 1.0) {
alpha = g_alpha;
- }
+ }
else if (a <= 0.0) {
- alpha = 0.0;
- // discard; // should work but generates artifacts, dimples ?
+ alpha = 0.0;//discard;
}
else {
alpha = g_alpha*a;
mix(b_color,g_color, a);
- }
+ }
}
gl_FragColor = vec4(c, alpha);