diff options
Diffstat (limited to 'chart2/opengl/pickingVertexShader.glsl')
-rw-r--r-- | chart2/opengl/pickingVertexShader.glsl | 7 |
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; } |