2023-10-11 20:25:22 +00:00
|
|
|
#version 330 core
|
|
|
|
layout (location = 0) in vec3 pos;
|
2023-10-15 18:38:47 +00:00
|
|
|
layout (location = 1) in vec3 normal;
|
2023-10-12 17:43:06 +00:00
|
|
|
|
2023-10-14 16:24:51 +00:00
|
|
|
uniform mat4 view;
|
|
|
|
uniform mat4 projection;
|
2023-10-16 18:48:12 +00:00
|
|
|
uniform mat4 translation;
|
|
|
|
uniform mat4 rotation;
|
2023-10-21 11:08:30 +00:00
|
|
|
uniform vec3 color;
|
2023-10-31 15:18:21 +00:00
|
|
|
uniform float scale;
|
2023-10-14 16:24:51 +00:00
|
|
|
|
2023-10-15 18:38:47 +00:00
|
|
|
out vec4 frag_pos;
|
|
|
|
out vec4 frag_normal;
|
2023-10-21 11:08:30 +00:00
|
|
|
out vec3 object_color;
|
2023-10-11 20:25:22 +00:00
|
|
|
|
|
|
|
void main() {
|
2023-10-31 15:18:21 +00:00
|
|
|
gl_Position = projection * view * translation * (vec4(pos.xyz, 1.0) * vec4(scale, scale, scale, 1.0));
|
2023-10-15 18:38:47 +00:00
|
|
|
frag_pos = gl_Position;
|
2023-10-16 18:48:12 +00:00
|
|
|
frag_normal = translation * vec4(normal.xyz, 1.0);
|
2023-10-21 11:08:30 +00:00
|
|
|
object_color = color;
|
2023-10-11 20:25:22 +00:00
|
|
|
}
|