Welcome to mirror list, hosted at ThFree Co, Russian Federation.

workbench_shadow_vert.glsl « shaders « workbench « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 50a721f948f6db06558f47fad1ddbac832b033e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define INFINITE 1000.0

uniform mat4 ModelViewProjectionMatrix;

uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
uniform float lightDistance = 1e4;

in vec3 pos;

out VertexData {
	vec3 pos;           /* local position */
	vec4 frontPosition; /* final ndc position */
	vec4 backPosition;
} vData;

void main()
{
	vData.pos = pos;
	vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0);
	vData.backPosition  = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0);
}