summaryrefslogtreecommitdiff
path: root/chart2/opengl/pickingVertexShader.glsl
diff options
context:
space:
mode:
authorweigao <weigao@multicorewareinc.com>2014-08-03 18:36:56 +0800
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-08-06 20:45:13 +0200
commit495d53b1dc0f3c32e0b76344775b9fc728e09fe5 (patch)
treea52a8159db5abb77ffbee0967235e23b805991bb /chart2/opengl/pickingVertexShader.glsl
parentb819026e1994287dd6a27848981aebca805c4e09 (diff)
make pick shader work when bars scroll
Change-Id: I9a3e0e36b212ff49ad22ac0ff267d04476b4c307
Diffstat (limited to 'chart2/opengl/pickingVertexShader.glsl')
-rw-r--r--chart2/opengl/pickingVertexShader.glsl7
1 files changed, 6 insertions, 1 deletions
diff --git a/chart2/opengl/pickingVertexShader.glsl b/chart2/opengl/pickingVertexShader.glsl
index f32e3fd38a91..df71ae170f01 100644
--- a/chart2/opengl/pickingVertexShader.glsl
+++ b/chart2/opengl/pickingVertexShader.glsl
@@ -9,11 +9,16 @@
attribute vec3 vPosition;
uniform mat4 MVP;
+uniform mat4 M;
uniform vec4 vColor;
+uniform float minCoordX;
+uniform float maxCoordX;
varying vec4 fragmentColor;
-
+varying vec3 positionWorldspace;
void main()
{
+ positionWorldspace = (M * vec4(vPosition,1)).xyz;
+ positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX);
gl_Position = MVP * vec4(vPosition, 1);
fragmentColor = vColor;
}