Implemented Depth Buffering

This commit is contained in:
Ano-sys
2025-04-05 23:37:38 +02:00
parent 6d986f496e
commit b458f432ff
3 changed files with 145 additions and 40 deletions
+2 -5
View File
@@ -6,7 +6,7 @@ layout(set = 0, binding = 0) uniform UniformBufferObject{
mat4 proj;
}ubo;
layout(location = 0) in vec2 inPosition;
layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inColor;
layout(location = 2) in vec2 inTexCoord;
@@ -14,10 +14,7 @@ layout(location = 0) out vec3 fragColor;
layout(location = 1) out vec2 fragTexCoord;
void main(){
// gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
// fragColor = colors[gl_VertexIndex];
// gl_Position = vec4(inPosition, 0.0, 1.0);
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
fragColor = inColor;
fragTexCoord = inTexCoord;
}