26 lines
680 B
GLSL
26 lines
680 B
GLSL
// Copyright (jacekpoz 2024). Licensed under the EUPL-1.2 or later.
|
|
|
|
#version 450
|
|
|
|
layout(binding = 0) uniform UniformBufferObject {
|
|
vec2 initialWindowSize;
|
|
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;
|
|
|
|
layout(location = 0) out vec3 fragColor;
|
|
layout(location = 1) out int outShapeType;
|
|
layout(location = 2) out vec2 outUv;
|
|
|
|
void main() {
|
|
vec2 normalized = ((inPosition / ubo.initialWindowSize) - 0.5) * 2.0;
|
|
gl_Position = vec4(normalized, 0.0, 1.0);
|
|
|
|
fragColor = inColor;
|
|
outShapeType = inShapeType;
|
|
outUv = inUv;
|
|
}
|