aboutsummaryrefslogtreecommitdiffstats
path: root/shaders/main/vert.glsl
blob: 3b145e33b50b7f664243d7bcce4a3482fab88b44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com>
 * SPDX-License-Identifier: MIT
 */
out iface {
	vec3 norm;
	vec3 pos;
	vec2 uv;
	vec3 lipos;
} o;

void main()
{
	gl_Position = proj * view * model * vec4(pos, 1.0);
	o.pos = vec3(view * model * vec4(pos, 1.0));
	o.uv = uv;
	// TODO: Try to work out how to only do this ONCE in C or see if it matters
	o.norm = mat3(transpose(inverse(view * model))) * norm;
	o.lipos = vec3(view * vec4(light, 1.0));
}