diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-02-13 17:38:13 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-02-13 17:38:13 -0500 |
| commit | 5f77c5f905d2a3063230bde1176372ebd074bc99 (patch) | |
| tree | 223e8e1443972a8829c5b92f0b00cc6236ebc0d6 /assets | |
| parent | 570498ee77505d44654fdbc97d094ae429323379 (diff) | |
pke: add FontRenderSettings + first pass advance
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/shaders/glyph.vert | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/assets/shaders/glyph.vert b/assets/shaders/glyph.vert index 9907ce1..a2c7de3 100644 --- a/assets/shaders/glyph.vert +++ b/assets/shaders/glyph.vert @@ -6,11 +6,12 @@ layout(location = 1) in vec2 in_uv; layout(location = 2) in vec2 in_atlas_size; // instance -layout(location = 3) in vec4 in_fg_color; -layout(location = 4) in vec4 in_bg_color; -layout(location = 5) in vec2 in_sprite_region_min; -layout(location = 6) in vec2 in_sprite_region_max; -layout(location = 7) in float in_width; +layout(location = 3) in mat4 pos_scale; +layout(location = 7) in vec4 in_fg_color; +layout(location = 8) in vec4 in_bg_color; +layout(location = 9) in vec2 in_sprite_region_min; +layout(location = 10) in vec2 in_sprite_region_max; +layout(location = 11) in float in_width; layout(location = 0) out vec4 out_fg_color; layout(location = 1) out vec4 out_bg_color; @@ -24,7 +25,8 @@ out gl_PerVertex void main() { - gl_Position = vec4(in_position / 4.0, 0.0, 1.0); + vec4 transformed_position = pos_scale * vec4(in_position, 0.0, 1.0); + gl_Position = vec4(transformed_position.xy, 0.0, 1.0); out_fg_color = in_fg_color; out_bg_color = in_bg_color; out_uv = mix(in_sprite_region_min, in_sprite_region_max, in_uv) / in_atlas_size; |
