reorder vertices
This commit is contained in:
@@ -23,11 +23,11 @@ size_t TextVertexBuffer::add(int16_t x, int16_t y, float ox, float oy, uint16_t
|
|||||||
ubytes[8] = tx / 4;
|
ubytes[8] = tx / 4;
|
||||||
ubytes[9] = ty / 4;
|
ubytes[9] = ty / 4;
|
||||||
ubytes[10] = labelminzoom * 10;
|
ubytes[10] = labelminzoom * 10;
|
||||||
ubytes[11] = minzoom * 10; // 1/10 zoom levels: z16 == 160.
|
ubytes[11] = (int16_t)round(angle * angleFactor) % 256;
|
||||||
|
|
||||||
// a_data2
|
// a_data2
|
||||||
ubytes[12] = fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160.
|
ubytes[12] = minzoom * 10; // 1/10 zoom levels: z16 == 160.
|
||||||
ubytes[13] = (int16_t)round(angle * angleFactor) % 256;
|
ubytes[13] = fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160.
|
||||||
ubytes[14] = util::max((int16_t)round(range[0] * angleFactor), (int16_t)0) % 256;
|
ubytes[14] = util::max((int16_t)round(range[0] * angleFactor), (int16_t)0) % 256;
|
||||||
ubytes[15] = util::min((int16_t)round(range[1] * angleFactor), (int16_t)255) % 256;
|
ubytes[15] = util::min((int16_t)round(range[1] * angleFactor), (int16_t)255) % 256;
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,9 @@ varying float v_alpha;
|
|||||||
void main() {
|
void main() {
|
||||||
vec2 a_tex = a_data1.xy;
|
vec2 a_tex = a_data1.xy;
|
||||||
float a_labelminzoom = a_data1[2];
|
float a_labelminzoom = a_data1[2];
|
||||||
float a_minzoom = a_data1[3];
|
float a_angle = a_data1[3];
|
||||||
float a_maxzoom = a_data2[0];
|
vec2 a_zoom = a_data2.st;
|
||||||
float a_angle = a_data2[1];
|
vec2 a_range = a_data2.pq;
|
||||||
float a_rangeend = a_data2[2];
|
|
||||||
float a_rangestart = a_data2[3];
|
|
||||||
|
|
||||||
float rev = 0.0;
|
float rev = 0.0;
|
||||||
|
|
||||||
@@ -42,7 +40,7 @@ void main() {
|
|||||||
// of the view plane so that the triangle gets clipped. This makes it easier
|
// of the view plane so that the triangle gets clipped. This makes it easier
|
||||||
// for us to create degenerate triangle strips.
|
// for us to create degenerate triangle strips.
|
||||||
// u_zoom is the current zoom level adjusted for the change in font size
|
// u_zoom is the current zoom level adjusted for the change in font size
|
||||||
float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom)) + rev;
|
float z = 2.0 - step(a_zoom[0], u_zoom) - (1.0 - step(a_zoom[1], u_zoom)) + rev;
|
||||||
|
|
||||||
// fade out labels
|
// fade out labels
|
||||||
float alpha = clamp((u_fadezoom - a_labelminzoom) / u_fadedist, 0.0, 1.0);
|
float alpha = clamp((u_fadezoom - a_labelminzoom) / u_fadedist, 0.0, 1.0);
|
||||||
@@ -64,7 +62,7 @@ void main() {
|
|||||||
|
|
||||||
// all the angles are 0..256 representing 0..2PI
|
// all the angles are 0..256 representing 0..2PI
|
||||||
// hide if (angle >= a_rangeend && angle < rangestart)
|
// hide if (angle >= a_rangeend && angle < rangestart)
|
||||||
z += step(a_rangeend, u_angle) * (1.0 - step(a_rangestart, u_angle));
|
z += (1.0 - step(a_range[0], u_angle)) * step(a_range[1], u_angle);
|
||||||
|
|
||||||
gl_Position = u_matrix * vec4(a_pos, 0, 1) + u_exmatrix * vec4(a_offset / 64.0, z, 0);
|
gl_Position = u_matrix * vec4(a_pos, 0, 1) + u_exmatrix * vec4(a_offset / 64.0, z, 0);
|
||||||
v_tex = a_tex * 4.0 / u_texsize;
|
v_tex = a_tex * 4.0 / u_texsize;
|
||||||
|
|||||||
Reference in New Issue
Block a user