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