ugui.c3l/resources/shaders/source/sprite.frag.glsl

18 lines
351 B
Plaintext
Raw Permalink Normal View History

2025-06-07 12:42:57 +02:00
#version 450
2025-06-10 23:02:44 +02:00
layout(set = 3, binding = 0) uniform Viewport {
ivec2 view;
};
2025-06-07 12:42:57 +02:00
layout(location = 0) in vec2 uv;
layout(location = 0) out vec4 fragColor;
layout(set = 2, binding = 0) uniform sampler2D tx;
void main()
{
ivec2 ts = textureSize(tx, 0);
2025-06-15 18:54:35 +02:00
vec2 fts = vec2(ts);
2025-06-07 12:42:57 +02:00
vec2 real_uv = uv / fts;
fragColor = texture(tx, real_uv);
}