Files
shooter/resources/shaders/shader.vert
T

24 lines
494 B
GLSL

#version 330 core
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
uniform mat4 model;
// uniform mat4 view;
uniform mat4 projection;
uniform vec3 lightPos;
out vec3 FragPos;
out vec3 Normal;
out vec3 LightPos;
void main()
{
// * view * model
gl_Position = projection * model * vec4(position, 1.0);
FragPos = vec3(model * vec4(position, 1.0));
Normal = transpose(inverse(mat3(model))) * normal;
LightPos = lightPos;
// Normal = normal;
}