Code-Cleanup: All samples now use the camera class and it's matrices

Cleaned up base class
This commit is contained in:
Sascha Willems 2020-04-22 20:58:24 +02:00
parent 27d5abc038
commit ab38f8b150
42 changed files with 234 additions and 396 deletions

View file

@ -6,6 +6,7 @@ layout (location = 1) in vec2 inUV;
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 view;
mat4 model;
} ubo;
@ -15,6 +16,6 @@ layout (location = 1) out vec4 outPos;
void main()
{
outUV = inUV;
outPos = ubo.projection * ubo.model * vec4(inPos.xyz, 1.0);
outPos = ubo.projection * ubo.view * ubo.model * vec4(inPos.xyz, 1.0);
gl_Position = outPos;
}

View file

@ -7,6 +7,7 @@ layout (location = 3) in vec3 inNormal;
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 view;
mat4 model;
vec4 lightPos;
} ubo;
@ -20,8 +21,8 @@ void main()
{
outNormal = inNormal;
outColor = inColor;
gl_Position = ubo.projection * ubo.model * inPos;
outEyePos = vec3(ubo.model * inPos);
gl_Position = ubo.projection * ubo.view * ubo.model * inPos;
outEyePos = vec3(ubo.view * ubo.model * inPos);
outLightVec = normalize(ubo.lightPos.xyz - outEyePos);
// Clip against reflection plane

Binary file not shown.

Binary file not shown.