summaryrefslogtreecommitdiff
path: root/chart2/opengl/shape3DVertexShaderV300.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/opengl/shape3DVertexShaderV300.glsl')
-rw-r--r--chart2/opengl/shape3DVertexShaderV300.glsl8
1 files changed, 6 insertions, 2 deletions
diff --git a/chart2/opengl/shape3DVertexShaderV300.glsl b/chart2/opengl/shape3DVertexShaderV300.glsl
index 6737004cb914..a8da294fb3cd 100644
--- a/chart2/opengl/shape3DVertexShaderV300.glsl
+++ b/chart2/opengl/shape3DVertexShaderV300.glsl
@@ -16,12 +16,16 @@ uniform mat4 P;
uniform mat4 M;
uniform mat4 V;
uniform mat3 normalMatrix;
+uniform float minCoordX;
+uniform float maxCoordX;
void main()
{
- gl_Position = P * V * M * vec4(vertexPositionModelspace,1);
+ positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz;
- positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz;
+ positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX);
+
+ gl_Position = P * V * vec4(positionWorldspace,1);
normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace);
}