diff options
| author | Mel <einebeere@gmail.com> | 2022-10-23 02:48:51 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-10-23 02:48:51 +0200 |
| commit | 75a9c87b50cef2f1d749bd9042a9348bc28b4c09 (patch) | |
| tree | 8d82f3cbbb5bdc63c7e5b6431dac3d49b23a478d /assets/shaders/vertex.glsl | |
| parent | 589bfb5cad0052856077ce867f3858ca3741d95d (diff) | |
| download | meowcraft-75a9c87b50cef2f1d749bd9042a9348bc28b4c09.tar.zst meowcraft-75a9c87b50cef2f1d749bd9042a9348bc28b4c09.zip | |
Sun lighting
Diffstat (limited to 'assets/shaders/vertex.glsl')
| -rw-r--r-- | assets/shaders/vertex.glsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/assets/shaders/vertex.glsl b/assets/shaders/vertex.glsl index 1ad43f4..c59d6cd 100644 --- a/assets/shaders/vertex.glsl +++ b/assets/shaders/vertex.glsl @@ -5,11 +5,15 @@ uniform mat4 view_matrix; uniform mat4 projection_matrix; layout (location = 0) in vec3 position; -layout (location = 1) in vec2 tex_coord; +layout (location = 1) in vec3 normal; +layout (location = 2) in vec2 tex_coord; out vec2 frag_tex_coord; +out vec3 surface_normal; void main() { gl_Position = projection_matrix * view_matrix * model_matrix * vec4(position, 1.0); frag_tex_coord = tex_coord; + + surface_normal = (model_matrix * vec4(normal, 0.0)).xyz; } \ No newline at end of file |
