mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-02 04:37:54 +08:00
24 lines
513 B
GLSL
24 lines
513 B
GLSL
#version 330 core
|
|
layout (location = 0) in vec3 position;
|
|
layout (location = 1) in vec3 normal;
|
|
layout (location = 2) in vec2 texCoords;
|
|
|
|
out vec2 TexCoords;
|
|
|
|
out VS_OUT {
|
|
vec3 FragPos;
|
|
vec3 Normal;
|
|
vec2 TexCoords;
|
|
} vs_out;
|
|
|
|
uniform mat4 projection;
|
|
uniform mat4 view;
|
|
uniform mat4 model;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = projection * view * model * vec4(position, 1.0f);
|
|
vs_out.FragPos = position;
|
|
vs_out.Normal = transpose(inverse(mat3(model))) * normal;
|
|
vs_out.TexCoords = texCoords;
|
|
} |