vulkzample/shader/shader.vertex.glsl
Rebekah Rowe 0faa71751d
All checks were successful
ci/woodpecker/push/woodpecker.json Pipeline was successful
Implimented a Depth Buffer to prevent things under the top most triangles are properly obscured
2024-07-18 18:24:13 -04:00

40 lines
1.2 KiB
GLSL

/*
* VulkZample
* Copyright (C) 2024 Rebekah Rowe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
layout(binding = 0) uniform UniformBufferObject {
mat4 model;
mat4 view;
mat4 proj;
} ubo;
layout(location = 0) in vec3 in_position;
layout(location = 2) in vec3 in_color;
layout(location = 4) in vec2 in_texture_coordinate;
layout(location = 0) out vec3 frag_color;
layout(location = 1) out vec2 frag_texture_coordinate;
void main() {
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(in_position, 1.0);
frag_color = in_color;
frag_texture_coordinate = in_texture_coordinate;
}