ptk/shaders/shader.vert.glsl

27 lines
680 B
Text
Raw Normal View History

// 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;
layout(location = 2) in int inShapeType;
layout(location = 3) in vec2 inUv;
2024-08-08 14:38:43 +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 14:38:43 +02:00
fragColor = inColor;
outShapeType = inShapeType;
outUv = inUv;
2024-08-08 14:38:43 +02:00
}