tweak renderer API
This commit is contained in:
parent
177e52b0d0
commit
2014c67bfd
10 changed files with 424 additions and 247 deletions
21
resources/shaders/source/font.frag.glsl
Normal file
21
resources/shaders/source/font.frag.glsl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#version 450
|
||||
|
||||
layout(set = 3, binding = 0) uniform Viewport {
|
||||
ivec2 view;
|
||||
};
|
||||
layout(set = 2, binding = 0) uniform sampler2D tx;
|
||||
|
||||
layout(location = 0) in vec2 uv;
|
||||
layout(location = 1) in vec4 color;
|
||||
|
||||
layout(location = 0) out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
ivec2 ts = textureSize(tx, 0);
|
||||
vec2 fts = vec2(float(ts.x), float(ts.y));
|
||||
vec2 real_uv = uv / fts;
|
||||
|
||||
vec4 opacity = texture(tx, real_uv);
|
||||
fragColor = vec4(color.rgb, color.a*opacity.r);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue