Code cleanup

Skybox now rotates with the camera, fixed depth issues
This commit is contained in:
Sascha Willems 2024-01-07 17:03:39 +01:00
parent 68b2e0fcfe
commit fe46cef0a7
5 changed files with 142 additions and 192 deletions

View file

@ -6,6 +6,8 @@ layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 model;
mat4 normal;
mat4 view;
} ubo;
layout (location = 0) out vec3 outUVW;
@ -13,5 +15,7 @@ layout (location = 0) out vec3 outUVW;
void main()
{
outUVW = inPos;
gl_Position = ubo.projection * ubo.model * vec4(inPos.xyz, 1.0);
// Remove translation from view matrix
mat4 viewMat = mat4(mat3(ubo.view));
gl_Position = ubo.projection * viewMat * ubo.model * vec4(inPos.xyz, 1.0);
}