rendlib/assets/shaders/shader.vert
Kevin Jerebica a176afab7e init: kick-off repository from gravity's SC
source code was taken from my project gravity and
modified so I can reuse the renderer in other projects.
I will also upgrade it, free it from old bugs, put more
effort into learning the math behind rendering, etc.
2024-10-08 00:15:42 +02:00

21 lines
523 B
GLSL

#version 330 core
layout (location = 0) in vec3 pos;
layout (location = 1) in vec3 normal;
uniform mat4 view;
uniform mat4 projection;
uniform mat4 translation;
uniform mat4 rotation;
uniform vec3 color;
uniform float scale;
out vec4 frag_pos;
out vec4 frag_normal;
out vec3 object_color;
void main() {
gl_Position = projection * view * translation * (vec4(pos.xyz, 1.0) * vec4(scale, scale, scale, 1.0));
frag_pos = gl_Position;
frag_normal = translation * vec4(normal.xyz, 1.0);
object_color = color;
}