aboutsummaryrefslogtreecommitdiffstats
path: root/vert.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'vert.glsl')
-rw-r--r--vert.glsl14
1 files changed, 11 insertions, 3 deletions
diff --git a/vert.glsl b/vert.glsl
index d33cc47..5e4e43a 100644
--- a/vert.glsl
+++ b/vert.glsl
@@ -2,16 +2,24 @@
// SPDX-License-Identifier: MIT
#version 330 core
layout (location = 0) in vec3 pos;
-layout (location = 1) in vec3 normal;
+layout (location = 1) in vec3 norm;
layout (location = 2) in vec2 uv;
-out vec3 vcolor;
+out vec3 vnorm;
+out vec3 fpos;
+out vec3 lipos;
+
uniform mat4 model;
uniform mat4 view;
uniform mat4 proj;
void main()
{
+ vec3 light = { 1.2, 1.0, 2.0 };
+
gl_Position = proj * view * model * vec4(pos, 1.0);
- vcolor = normal;
+ fpos = vec3(view * model * vec4(pos, 1.0));
+ // TODO: Try to work out how to only do this ONCE in C or see if it matters
+ vnorm = mat3(transpose(inverse(view * model))) * norm;
+ lipos = vec3(view * vec4(light, 1.0));
}