diff options
author | Sven Gothel <sgothel@jausoft.com> | 2014-03-02 00:19:35 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2014-03-02 00:19:35 +0100 |
commit | 7b1a0c17fe5471557ab5e0db0334bed34edb553a (patch) | |
tree | c6242b548f4f9cbe2411c8cb4bc6dd6924437e8b /src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp | |
parent | c1218a7bcf42ae64b41e3d30bb1ee39c44b20a9f (diff) |
Bug 801: Add MSAA_RENDERING_BIT ; VBAA: Uses GL_NEAREST (good result) ; Demos: Use local GLRegion for uncached text (perf.) ..
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp')
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp deleted file mode 100644 index 0cf4cf88f..000000000 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp +++ /dev/null @@ -1,90 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -// -// 2-pass shader w/o weight -// - -#if __VERSION__ >= 130 - #define varying in - out vec4 mgl_FragColor; - #define texture2D texture -#else - #define mgl_FragColor gl_FragColor -#endif - -#include uniforms.glsl -#include varyings.glsl - -const vec4 tex_weights = vec4(0.075, 0.06, 0.045, 0.025); - -void main (void) -{ - vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y)); - vec3 c = gcu_ColorStatic.rgb; - - float alpha = 0.0; - float enable = 1.0; - - if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) { - alpha = gcu_Alpha; - } - else if((gcv_TexCoord.x >= 5.0)) { - vec2 dfx = dFdx(gcv_TexCoord); - vec2 dfy = dFdy(gcv_TexCoord); - - vec2 size = 1.0/gcu_TextureSize; - - rtex -= 5.0; - vec4 t = texture2D(gcu_TextureUnit, rtex)* 0.18; - - t += texture2D(gcu_TextureUnit, rtex + size*(vec2(1, 0)))*tex_weights.x; - t += texture2D(gcu_TextureUnit, rtex - size*(vec2(1, 0)))*tex_weights.x; - t += texture2D(gcu_TextureUnit, rtex + size*(vec2(0, 1)))*tex_weights.x; - t += texture2D(gcu_TextureUnit, rtex - size*(vec2(0, 1)))*tex_weights.x; - - t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(1, 0)))*tex_weights.y; - t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(1, 0)))*tex_weights.y; - t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(0, 1)))*tex_weights.y; - t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(0, 1)))*tex_weights.y; - - t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(1, 0)))*tex_weights.z; - t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(1, 0)))*tex_weights.z; - t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(0, 1)))*tex_weights.z; - t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(0, 1)))*tex_weights.z; - - t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(1, 0)))*tex_weights.w; - t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(1, 0)))*tex_weights.w; - t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(0, 1)))*tex_weights.w; - t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(0, 1)))*tex_weights.w; - - #if 0 - if(t.w == 0.0){ - discard; // discard freezes NV tegra2 compiler - } - #endif - - c = t.xyz; - alpha = gcu_Alpha * t.w; - } - else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) { - rtex.y -= 0.1; - - if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) { - // discard; // freezes NV tegra2 compiler - alpha = 0.0; - } else { - rtex.y = max(rtex.y, 0.0); - - vec2 dtx = dFdx(rtex); - vec2 dty = dFdy(rtex); - - 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 a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0); - alpha = gcu_Alpha * a; - } - } - - mgl_FragColor = vec4(c, alpha); -} |