-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathharfbuzz.vert
More file actions
40 lines (32 loc) · 818 Bytes
/
Copy pathharfbuzz.vert
File metadata and controls
40 lines (32 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright 2026 Behdad Esfahbod. All Rights Reserved.
*/
uniform mat4 u_matViewProjection;
uniform vec2 u_viewport;
uniform float u_scale;
uniform vec2 u_position;
in vec2 a_position;
in vec2 a_texcoord;
in vec2 a_normal;
in float a_emPerPos;
in uint a_glyphLoc;
in uint a_runeIdx;
out vec2 v_texcoord;
out float v_runeIdx;
flat out uint v_glyphLoc;
void main()
{
vec2 pos = a_position;
vec2 tex = a_texcoord;
float scale = u_scale;
float epp = a_emPerPos;
epp /= scale;
pos = (pos + tex) * scale;
pos += u_position;
vec4 jac = vec4(epp, 0.0, 0.0, -epp);
hb_gpu_dilate(pos, tex, a_normal, jac, u_matViewProjection, u_viewport);
gl_Position = u_matViewProjection * vec4(pos, 0.0, 1.0);
v_texcoord = tex;
v_glyphLoc = a_glyphLoc;
v_runeIdx = a_runeIdx;
}