diff options
Diffstat (limited to 'shaders')
-rwxr-xr-x | shaders/triangle.vert | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/shaders/triangle.vert b/shaders/triangle.vert index 663fea0..c61f894 100755 --- a/shaders/triangle.vert +++ b/shaders/triangle.vert @@ -1,5 +1,11 @@ #version 450
+layout(binding = 0) uniform UniformBufferObject {
+ mat4 model;
+ mat4 view;
+ mat4 proj;
+} ubo;
+
layout(location = 0) in vec2 inPos;
layout(location = 1) in vec3 inCol;
@@ -7,6 +13,6 @@ layout(location = 1) in vec3 inCol; layout(location = 0) out vec3 fragColor;
void main() {
- gl_Position = vec4(inPos, 0.0, 1.0);
+ gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPos, 0.0, 1.0);
fragColor = inCol;
}
|