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

gpu_shader_instance_distance_line_vert.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 142df70e68a4815795a6194a910d98c7b89a1ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

uniform mat4 ViewProjectionMatrix;

/* ---- Instanciated Attribs ---- */
in vec3 pos;

/* ---- Per instance Attribs ---- */
in vec3 color;
in float start;
in float end;
in mat4 InstanceModelMatrix;

uniform float size;

flat out vec4 finalColor;

void main()
{
	float len = end - start;
	vec3 sta = vec3(0.0, 0.0, -start);

	gl_Position = ViewProjectionMatrix * InstanceModelMatrix * vec4(pos * -len + sta, 1.0);
	gl_PointSize = size;
	finalColor = vec4(color, 1.0);
}