Added backgdrop, object and more text to text overlay example

This commit is contained in:
saschawillems 2016-05-07 12:37:12 +02:00
parent 99ad677339
commit b39d589c86
13 changed files with 243 additions and 62 deletions

View file

@ -6,7 +6,6 @@
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec3 inNormal;
layout (location = 2) in vec2 inUV;
layout (location = 3) in vec3 inColor;
layout (binding = 0) uniform UBO
{
@ -16,10 +15,9 @@ layout (binding = 0) uniform UBO
} ubo;
layout (location = 0) out vec3 outNormal;
layout (location = 1) out vec3 outColor;
layout (location = 2) out vec2 outUV;
layout (location = 3) out vec3 outViewVec;
layout (location = 4) out vec3 outLightVec;
layout (location = 1) out vec2 outUV;
layout (location = 2) out vec3 outViewVec;
layout (location = 3) out vec3 outLightVec;
out gl_PerVertex
{
@ -29,13 +27,12 @@ out gl_PerVertex
void main()
{
outNormal = inNormal;
outColor = inColor;
outUV = inUV;
gl_Position = ubo.projection * ubo.model * vec4(inPos.xyz, 1.0);
vec4 pos = ubo.model * vec4(inPos, 1.0);
outNormal = /*mat3(ubo.model) */ inNormal;
vec3 lPos = /*mat3(ubo.model) */ ubo.lightPos.xyz;
outNormal = mat3(transpose(inverse(ubo.model))) * normalize(inNormal);
vec3 lPos = mat3(ubo.model) * ubo.lightPos.xyz;
outLightVec = lPos - pos.xyz;
outViewVec = -pos.xyz;
outViewVec = -pos.xyz;
}