Files
somaesque-native/assets/shaders/phong-solid.vertex.glsl
Daniel Ledda 95b781a4b9 update
2025-02-17 14:13:22 +01:00

20 lines
455 B
GLSL

#version 330 core
layout (location = 0) in vec3 a_xyz;
layout (location = 1) in vec2 a_uv;
layout (location = 2) in vec3 a_normal;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
out vec3 normal;
out vec3 frag_position;
void main() {
vec4 a_xyz_vec4 = vec4(a_xyz, 1);
frag_position = (model * a_xyz_vec4).xyz;
normal = mat3(transpose(inverse(model))) * a_normal;
gl_Position = projection * view * model * a_xyz_vec4;
}