Added debug display for light source depth maps and shadow toggle

This commit is contained in:
saschawillems 2016-07-17 18:34:52 +02:00
parent 1e4e233f81
commit 7f687570d4
9 changed files with 59 additions and 87 deletions

View file

@ -5,12 +5,11 @@
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec2 inUV;
layout (location = 3) in vec3 inNormal;
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 model;
mat4 modelview;
} ubo;
layout (location = 0) out vec3 outUV;
@ -22,6 +21,9 @@ out gl_PerVertex
void main()
{
outUV = vec3(inUV.st, inNormal.z);
gl_Position = ubo.projection * ubo.model * vec4(inPos.xyz, 1.0);
outUV = vec3(inUV.st, gl_InstanceIndex);
vec4 tmpPos = vec4(inPos, 1.0);
tmpPos.y += gl_InstanceIndex;
tmpPos.xy *= vec2(1.0/4.0, 1.0/3.0);
gl_Position = ubo.projection * ubo.modelview * tmpPos;
}