From 39e7122b5cd1e0d56a4a7cfd3c4114032d14e9b6 Mon Sep 17 00:00:00 2001 From: Omni Date: Sat, 22 Jun 2024 23:06:19 +1000 Subject: creating shadowmap pipeline --- assets/shaders/shadows.frag | 5 +++++ assets/shaders/shadows.vert | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 assets/shaders/shadows.frag create mode 100644 assets/shaders/shadows.vert (limited to 'assets/shaders') diff --git a/assets/shaders/shadows.frag b/assets/shaders/shadows.frag new file mode 100644 index 0000000..0876b66 --- /dev/null +++ b/assets/shaders/shadows.frag @@ -0,0 +1,5 @@ +#version 410 core + +void main() { + gl_FragDepth = gl_FragCoord.z; +} \ No newline at end of file diff --git a/assets/shaders/shadows.vert b/assets/shaders/shadows.vert new file mode 100644 index 0000000..00b1a81 --- /dev/null +++ b/assets/shaders/shadows.vert @@ -0,0 +1,19 @@ +#version 410 core + +// Vertex attributes +layout(location = 0) in vec3 inPosition; +layout(location = 1) in vec3 inNormal; +layout(location = 2) in vec2 inTexCoords; + +// Uniforms +uniform Model { + mat4 mat; +}; + +uniform LightSpace { + mat4 mat; +}; + +void main() { + gl_Position = LightSpace.mat * Model.mat * vec4(inPosition, 1.0); +} -- cgit v1.2.3-70-g09d2