diff options
Diffstat (limited to 'assets')
-rw-r--r-- | assets/shaders/debug_quad.frag | 12 | ||||
-rw-r--r-- | assets/shaders/debug_quad.vert | 13 | ||||
-rw-r--r-- | assets/shaders/shadows.vert | 6 |
3 files changed, 28 insertions, 3 deletions
diff --git a/assets/shaders/debug_quad.frag b/assets/shaders/debug_quad.frag new file mode 100644 index 0000000..ac7842d --- /dev/null +++ b/assets/shaders/debug_quad.frag @@ -0,0 +1,12 @@ +#version 410 core +out vec4 FragColor; + +in vec2 TexCoords; + +uniform sampler2D depthMap; + +void main() +{ + float depthValue = texture(depthMap, TexCoords).r; + FragColor = vec4(vec3(depthValue), 1.0); // orthographic +}
\ No newline at end of file diff --git a/assets/shaders/debug_quad.vert b/assets/shaders/debug_quad.vert new file mode 100644 index 0000000..8b8201c --- /dev/null +++ b/assets/shaders/debug_quad.vert @@ -0,0 +1,13 @@ +#version 410 core +layout (location = 0) in vec3 inPosition; +layout (location = 1) in vec3 inNormal; +layout (location = 2) in vec2 inTexCoords; + +out vec2 TexCoords; + +void main() +{ + TexCoords = inTexCoords; + vec2 xy = inPosition.xz; + gl_Position = vec4(xy, 0.0, 1.0); +} diff --git a/assets/shaders/shadows.vert b/assets/shaders/shadows.vert index 00b1a81..1d1c59a 100644 --- a/assets/shaders/shadows.vert +++ b/assets/shaders/shadows.vert @@ -8,12 +8,12 @@ layout(location = 2) in vec2 inTexCoords; // Uniforms uniform Model { mat4 mat; -}; +} model; uniform LightSpace { mat4 mat; -}; +} lightSpace; void main() { - gl_Position = LightSpace.mat * Model.mat * vec4(inPosition, 1.0); + gl_Position = lightSpace.mat * model.mat * vec4(inPosition, 1.0); } |