world.ts 0.6.10 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1134,7 +1134,7 @@ out vec2 uv_out;
1134
1134
 
1135
1135
  const int ONE = 1073741824;
1136
1136
  const float INV_ONE = 1.f / float(ONE);
1137
- const float CIRCUMFERENCE = 40075017.;
1137
+ const float CIRCUMFERENCE = 40075017.f;
1138
1138
 
1139
1139
  vec4 transform(vec3 v) {
1140
1140
  return projection * model_view * vec4(vec3(position - camera) * INV_ONE + v, 1.f);
@@ -1143,7 +1143,9 @@ vec4 transform(vec3 v) {
1143
1143
  void main(void) {
1144
1144
  vec4 projected = transform(vec3(0.f, 0.f, 0.f));
1145
1145
  float pixel_size = projected.w / screen.y / -projection[1][1];
1146
- float scale = clamp(size / CIRCUMFERENCE, min_size_pixels * pixel_size, max_size_pixels * pixel_size);
1146
+ float latitude = atan(sinh(-(float(position.y) * INV_ONE - 0.5f) * (2.f * radians(180.f))));
1147
+ float latitude_scale = 1.f / cos(latitude);
1148
+ float scale = clamp(latitude_scale * size / CIRCUMFERENCE, min_size_pixels * pixel_size, max_size_pixels * pixel_size);
1147
1149
 
1148
1150
  vec4 q = orientation * vec4(vertex * scale, 1.f);
1149
1151
  gl_Position = transform(q.xyz / q.w);