diff options
Diffstat (limited to 'advanced_lighting/9.ssao/gbuffer.vert')
-rw-r--r-- | advanced_lighting/9.ssao/gbuffer.vert | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/advanced_lighting/9.ssao/gbuffer.vert b/advanced_lighting/9.ssao/gbuffer.vert new file mode 100644 index 0000000..81ab951 --- /dev/null +++ b/advanced_lighting/9.ssao/gbuffer.vert @@ -0,0 +1,21 @@ +#version 330 core + +layout (location = 0) in vec3 position; +layout (location = 1) in vec3 normal; + +out vert_t { + vec3 position; + vec3 normal; +} vert; + +uniform mat4 projection; +uniform mat4 view; +uniform mat4 model; + +void main() +{ + vert.position = vec3(view * model * vec4(position, 1.0)); + mat3 matrix_normal = transpose(inverse(mat3(view * model))); + vert.normal = matrix_normal * normal; + gl_Position = projection * view * model * vec4(position, 1.0); +} |