summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/pointLight.vs
blob: c53820796690054b666b7c88ce9b2747377389c3 (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
#version 330 core

layout(location = 0) in vec3 v_position;
layout(location = 1) in vec3 v_colour;
layout(location = 2) in float v_kq;
layout(location = 3) in mat4 model;
layout(location = 7) in ivec3 modelPos;

uniform ivec3 viewPoint;

flat out vec3 position;
flat out vec3 colour;
flat out float size;
flat out float kq;

void
main()
{
	position = modelPos + ivec3(mat3(model) * v_position);
	kq = v_kq;
	size = (8000 * sqrt(max(max(v_colour.r, v_colour.g), v_colour.b))) / sqrt(v_kq);
	colour = v_colour;
	gl_Position = vec4(position - viewPoint, 0);
}