Workbench: Shadows: Fix cap being clipped by far plane.
[blender.git] / source / blender / draw / engines / workbench / shaders / workbench_shadow_vert.glsl
1 #define INFINITE 1000.0
2
3 uniform mat4 ModelViewProjectionMatrix;
4
5 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
6 uniform float lightDistance = 1e4;
7
8 in vec3 pos;
9
10 out VertexData {
11         vec3 pos;           /* local position */
12         vec4 frontPosition; /* final ndc position */
13         vec4 backPosition;
14 } vData;
15
16 void main()
17 {
18         vData.pos = pos;
19         vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0);
20         vData.backPosition  = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0);
21 }