mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Code re-work: advanced lighting.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#version 330 core
|
||||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 1) in vec3 aNormal;
|
||||
layout (location = 2) in vec2 aTexCoords;
|
||||
|
||||
// Declare an interface block; see 'Advanced GLSL' for what these are.
|
||||
out VS_OUT {
|
||||
vec3 FragPos;
|
||||
vec3 Normal;
|
||||
vec2 TexCoords;
|
||||
} vs_out;
|
||||
|
||||
uniform mat4 projection;
|
||||
uniform mat4 view;
|
||||
|
||||
void main()
|
||||
{
|
||||
vs_out.FragPos = aPos;
|
||||
vs_out.Normal = aNormal;
|
||||
vs_out.TexCoords = aTexCoords;
|
||||
gl_Position = projection * view * vec4(aPos, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user