summaryrefslogtreecommitdiff
path: root/chart2/opengl
diff options
context:
space:
mode:
authorweigao <weigao@multicorewareinc.com>2014-06-18 01:10:05 -0700
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-06-21 04:21:40 +0200
commit87e23f425f60b0b7459c63b824bc8bdc17796ad2 (patch)
tree042bfc2ab2847cf9a1900cb738eb59f7c5f3c333 /chart2/opengl
parentf4436dcb95b341dbb8d2c58e6c7bf1ceb2ffbc10 (diff)
use shader to calculate alpha channel
Conflicts: chart2/source/view/main/GL3DRenderer.cxx Change-Id: I3cf9636b36ffd47589dd3ab61278802ca73644ce
Diffstat (limited to 'chart2/opengl')
-rw-r--r--chart2/opengl/screenTextFragmentShader.glsl3
-rw-r--r--chart2/opengl/textFragmentShader.glsl3
2 files changed, 4 insertions, 2 deletions
diff --git a/chart2/opengl/screenTextFragmentShader.glsl b/chart2/opengl/screenTextFragmentShader.glsl
index a8481034210a..7e2bd26e1069 100644
--- a/chart2/opengl/screenTextFragmentShader.glsl
+++ b/chart2/opengl/screenTextFragmentShader.glsl
@@ -11,7 +11,8 @@ varying vec2 vTexCoord;
uniform sampler2D TextTex;
void main()
{
- gl_FragColor = vec4(texture2D(TextTex, vTexCoord).rgba);
+ vec3 color = texture2D(TextTex, vTexCoord).rgb;
+ gl_FragColor = vec4(color, 1.0 - color.r);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/opengl/textFragmentShader.glsl b/chart2/opengl/textFragmentShader.glsl
index ef8d44d6949d..c1d44bc56f63 100644
--- a/chart2/opengl/textFragmentShader.glsl
+++ b/chart2/opengl/textFragmentShader.glsl
@@ -11,7 +11,8 @@ uniform sampler2D TextTex;
varying vec2 vTexCoord;
void main()
{
- gl_FragColor = vec4(texture2D(TextTex, vTexCoord).rgba);
+ vec3 color = texture2D(TextTex, vTexCoord).rgb;
+ gl_FragColor = vec4(color, 1.0 - color.r);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */