Create-Engine/src/assets/shaders/unlit.vert

14 lines
334 B
GLSL
Raw Normal View History

2025-04-13 21:04:03 +00:00
#version 330 core
layout (location = 0) in vec2 aPos;
layout (location = 1) in vec2 aUV;
out vec2 vUV;
uniform vec2 uPos;
uniform vec2 uSize;
uniform vec2 uScreen;
void main() {
vec2 worldPos = aPos * uSize + uPos;
vUV = aUV;
vec2 ndc = (worldPos / uScreen) * 2.0 - 1.0;
gl_Position = vec4(ndc.x, -ndc.y, 0.0, 1.0);
}