X-Git-Url: https://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=vertex.glsl;h=e2d30b74d109577a524be5636ecfb94365e7c432;hp=6333f5488b26232a0aec08ba8219fd88723e3422;hb=526f5c3dc0302e541c95ed2198ce8fdb5cdd0b99;hpb=1dcbad027a4537b550766e9053a4418e8256c81c diff --git a/vertex.glsl b/vertex.glsl index 6333f54..e2d30b7 100644 --- a/vertex.glsl +++ b/vertex.glsl @@ -1,9 +1,18 @@ #version 330 in vec3 vPosition; in vec4 vColor; +in vec3 vNormal; +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; out vec4 color; +out vec3 normal; +out vec3 fragPos; void main() { - gl_Position = vec4(vPosition, 1.0); + vec4 pos = model * vec4(vPosition, 1.f); + gl_Position = projection * view * pos; + fragPos = vec3(pos); color = vColor; + normal = vNormal; }