2024-08-13 00:12:48 +02:00
|
|
|
// Copyright (jacekpoz 2024). Licensed under the EUPL-1.2 or later.
|
|
|
|
|
2024-08-08 14:38:43 +02:00
|
|
|
#version 450
|
|
|
|
|
|
|
|
layout(binding = 0) uniform UniformBufferObject {
|
2024-08-08 16:26:45 +02:00
|
|
|
vec2 initialWindowSize;
|
2024-08-08 14:38:43 +02:00
|
|
|
vec2 windowSize;
|
|
|
|
} ubo;
|
|
|
|
|
|
|
|
layout(location = 0) in vec2 inPosition;
|
|
|
|
layout(location = 1) in vec3 inColor;
|
2024-08-08 19:14:50 +02:00
|
|
|
layout(location = 2) in int inShapeType;
|
|
|
|
layout(location = 3) in vec2 inUv;
|
2024-08-08 14:38:43 +02:00
|
|
|
|
2024-08-08 19:58:53 +02:00
|
|
|
layout(location = 0) out vec3 fragColor;
|
|
|
|
layout(location = 1) out int outShapeType;
|
|
|
|
layout(location = 2) out vec2 outUv;
|
2024-08-08 14:38:43 +02:00
|
|
|
|
|
|
|
void main() {
|
2024-08-08 16:26:45 +02:00
|
|
|
vec2 normalized = ((inPosition / ubo.initialWindowSize) - 0.5) * 2.0;
|
|
|
|
gl_Position = vec4(normalized, 0.0, 1.0);
|
2024-08-08 19:14:50 +02:00
|
|
|
|
2024-08-08 14:38:43 +02:00
|
|
|
fragColor = inColor;
|
2024-08-08 19:14:50 +02:00
|
|
|
outShapeType = inShapeType;
|
|
|
|
outUv = inUv;
|
2024-08-08 14:38:43 +02:00
|
|
|
}
|