scary quads and nice sprites
This commit is contained in:
parent
e3d87525d4
commit
6e65700f38
6 changed files with 218 additions and 64 deletions
14
resources/shaders/source/sprite.frag.glsl
Normal file
14
resources/shaders/source/sprite.frag.glsl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#version 450
|
||||
|
||||
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);
|
||||
vec2 fts = vec2(float(ts.x), float(ts.y));
|
||||
vec2 real_uv = uv / fts;
|
||||
fragColor = texture(tx, real_uv);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue