gralobe 1.0.12 → 1.0.14

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/gralobe.js CHANGED
@@ -5968,6 +5968,49 @@ float fbm(vec2 p) {
5968
5968
  return value;
5969
5969
  }
5970
5970
 
5971
+ // 3D hash for volumetric noise
5972
+ float hash3(vec3 p) {
5973
+ return fract(sin(dot(p, vec3(127.1, 311.7, 74.7))) * 43758.5453);
5974
+ }
5975
+
5976
+ // 3D noise for seamless spherical sampling
5977
+ float noise3D(vec3 p) {
5978
+ vec3 i = floor(p);
5979
+ vec3 f = fract(p);
5980
+ f = f * f * (3.0 - 2.0 * f);
5981
+
5982
+ float n000 = hash3(i);
5983
+ float n100 = hash3(i + vec3(1.0, 0.0, 0.0));
5984
+ float n010 = hash3(i + vec3(0.0, 1.0, 0.0));
5985
+ float n110 = hash3(i + vec3(1.0, 1.0, 0.0));
5986
+ float n001 = hash3(i + vec3(0.0, 0.0, 1.0));
5987
+ float n101 = hash3(i + vec3(1.0, 0.0, 1.0));
5988
+ float n011 = hash3(i + vec3(0.0, 1.0, 1.0));
5989
+ float n111 = hash3(i + vec3(1.0, 1.0, 1.0));
5990
+
5991
+ float nx00 = mix(n000, n100, f.x);
5992
+ float nx10 = mix(n010, n110, f.x);
5993
+ float nx01 = mix(n001, n101, f.x);
5994
+ float nx11 = mix(n011, n111, f.x);
5995
+
5996
+ float nxy0 = mix(nx00, nx10, f.y);
5997
+ float nxy1 = mix(nx01, nx11, f.y);
5998
+
5999
+ return mix(nxy0, nxy1, f.z);
6000
+ }
6001
+
6002
+ // FBM using 3D noise for seamless spherical clouds
6003
+ float fbm3D(vec3 p) {
6004
+ float value = 0.0;
6005
+ float amplitude = 0.5;
6006
+ for (int i = 0; i < 4; i++) {
6007
+ value += amplitude * noise3D(p);
6008
+ p *= 2.0;
6009
+ amplitude *= 0.5;
6010
+ }
6011
+ return value;
6012
+ }
6013
+
5971
6014
  void main() {
5972
6015
  if (vDiscard > 0.5) {
5973
6016
  discard;
@@ -6315,13 +6358,20 @@ class xo {
6315
6358
  this.stars = new S.Points(t, s), this.scene.add(this.stars);
6316
6359
  }
6317
6360
  createGUI() {
6318
- this.gui = new Vi({ title: "Globe Controls", width: 300 });
6319
- const e = this.gui.addFolder("View");
6320
- e.add({ toGlobe: () => this.toGlobe() }, "toGlobe").name("→ Globe"), e.add({ toFlat: () => this.toFlat() }, "toFlat").name("→ Flat Map"), e.add({ morph: this.morph }, "morph", 0, 1).name("Morph").onChange((r) => this.setMorph(r)), e.open();
6321
- const t = this.gui.addFolder("Statistics"), i = Object.keys(wi);
6322
- t.add({ stat: this.config.statistic }, "stat", i).name("Statistic").onChange((r) => this.setStatistic(r)), t.open();
6323
- const n = ["none", "minimal", "major", "all"];
6324
- this.gui.add({ labels: this.config.labels }, "labels", n).name("Labels").onChange((r) => this.setLabels(r)), this.gui.add(this.config, "autoRotate").name("Auto Rotate");
6361
+ getComputedStyle(this.container).position === "static" && (this.container.style.position = "relative"), this.gui = new Vi({
6362
+ container: this.container,
6363
+ title: " Controls",
6364
+ width: 220,
6365
+ closeFolders: !0
6366
+ });
6367
+ const t = this.gui.domElement;
6368
+ t.style.position = "absolute", t.style.top = "8px", t.style.right = "8px", t.style.zIndex = "100", this.gui.close();
6369
+ const i = this.gui.addFolder("View");
6370
+ i.add({ toGlobe: () => this.toGlobe() }, "toGlobe").name("→ Globe"), i.add({ toFlat: () => this.toFlat() }, "toFlat").name("→ Flat"), i.add({ morph: this.morph }, "morph", 0, 1).name("Morph").onChange((o) => this.setMorph(o));
6371
+ const n = this.gui.addFolder("Statistics"), r = Object.keys(wi);
6372
+ n.add({ stat: this.config.statistic }, "stat", r).name("Statistic").onChange((o) => this.setStatistic(o));
6373
+ const s = ["none", "minimal", "major", "all"];
6374
+ this.gui.addFolder("Display").add({ labels: this.config.labels }, "labels", s).name("Labels").onChange((o) => this.setLabels(o)), this.gui.add(this.config, "autoRotate").name("Auto Rotate");
6325
6375
  }
6326
6376
  handleResize = () => {
6327
6377
  if (this.isDestroyed) return;