aboutsummaryrefslogtreecommitdiffstats
path: root/vert.glsl
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2018-04-27 20:56:00 +0100
committerTomasz Kramkowski <tk@the-tk.com>2018-04-27 20:56:00 +0100
commitbab0824608498d1079d4e9522f3014d3d538aabe (patch)
tree932f082b58fd48f85fbbdfa3f7419d2b3b03eedb /vert.glsl
parent3d73622dbd5a9ddc687fe6f42268c760695d7226 (diff)
downloadfaqe-bab0824608498d1079d4e9522f3014d3d538aabe.tar.gz
faqe-bab0824608498d1079d4e9522f3014d3d538aabe.tar.xz
faqe-bab0824608498d1079d4e9522f3014d3d538aabe.zip
Implement basic model loading of FMD format.
The FMD (Faqe Model Data) format is a format designed for faqe. It stores vertex, element and material information and mesh information. This patch provides the basic implementation and use of this format. This patch also implements perspective projection, depth testing and view and model matrices. An example fmd file is provided.
Diffstat (limited to 'vert.glsl')
-rw-r--r--vert.glsl9
1 files changed, 6 insertions, 3 deletions
diff --git a/vert.glsl b/vert.glsl
index 2ee78d0..d33cc47 100644
--- a/vert.glsl
+++ b/vert.glsl
@@ -2,13 +2,16 @@
// SPDX-License-Identifier: MIT
#version 330 core
layout (location = 0) in vec3 pos;
-layout (location = 1) in vec3 color;
+layout (location = 1) in vec3 normal;
layout (location = 2) in vec2 uv;
out vec3 vcolor;
+uniform mat4 model;
+uniform mat4 view;
+uniform mat4 proj;
void main()
{
- gl_Position = vec4(pos, 1.0);
- vcolor = color;
+ gl_Position = proj * view * model * vec4(pos, 1.0);
+ vcolor = normal;
}