Add depth buffer

- Add depth testing to swapchain
- Add Shader abstraction
- Add CommandBuffer abstraction
This commit is contained in:
Thraix
2023-01-29 23:22:17 +01:00
parent 87ed5739b3
commit 9de2ff594b
25 changed files with 927 additions and 488 deletions
+5 -2
View File
@@ -1,12 +1,15 @@
#version 450
layout(set = 1, binding = 0) uniform sampler2D texSampler;
layout(set = 0, binding = 1) uniform sampler2D texSampler;
layout(location = 0) in vec3 fragColor;
layout(location = 1) in vec2 fragTexCoord;
layout(location = 2) in vec3 fragPosition;
layout(location = 3) in vec3 fragLightPos;
layout(location = 0) out vec4 outColor;
void main() {
outColor = vec4(fragColor, 1.0) * texture(texSampler, fragTexCoord);
float scale = 0.45 + max(dot(vec3(0, 1, 0), normalize(fragLightPos - fragPosition)), 0.0);
outColor = vec4(fragColor, 1.0) * texture(texSampler, fragTexCoord) * scale;
}