diff options
Diffstat (limited to 'shaders/main/vert.glsl')
-rw-r--r-- | shaders/main/vert.glsl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/shaders/main/vert.glsl b/shaders/main/vert.glsl new file mode 100644 index 0000000..f710067 --- /dev/null +++ b/shaders/main/vert.glsl @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ +out vec3 fnorm; +out vec3 fpos; +out vec2 fuv; +out vec3 lipos; + +void main() +{ + gl_Position = proj * view * model * vec4(pos, 1.0); + fpos = vec3(view * model * vec4(pos, 1.0)); + fuv = uv; + // TODO: Try to work out how to only do this ONCE in C or see if it matters + fnorm = mat3(transpose(inverse(view * model))) *norm; + lipos = vec3(view * vec4(light, 1.0)); +} |