blob: a82c13b9fb7a267b6b0f94297c7ae20145afa71f (
plain)
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
|
in vec3 pos;
/* Instance */
in vec3 inst_pos;
flat out vec4 finalColor;
flat out vec2 edgeStart;
noperspective out vec2 edgePos;
void main()
{
finalColor = colorLight;
/* Relative to DPI scaling. Have constant screen size. */
vec3 screen_pos = screenVecs[0].xyz * pos.x + screenVecs[1].xyz * pos.y;
vec3 p = inst_pos;
p.z *= (pos.z == 0.0) ? 0.0 : 1.0;
float screen_size = mul_project_m4_v3_zfac(p) * sizePixel;
vec3 world_pos = p + screen_pos * screen_size;
gl_Position = point_world_to_ndc(world_pos);
/* Convert to screen position [0..sizeVp]. */
edgePos = edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;
#ifdef USE_WORLD_CLIP_PLANES
world_clip_planes_calc_clip_distance(world_pos);
#endif
}
|