@johnmorrisdotca/wakusei-planets 0.17.0 → 0.17.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.1 - 2026-11-06
4
+
5
+ Saturn, Uranus and Neptune show their turn.
6
+
7
+ - A plain band is the same at every longitude, so those three turned and the picture stayed still. Saturn now draws its north hexagon and a wave in the bands; Uranus and Neptune draw a storm and a wave. They move with the surface (MODULES-509).
8
+ - `e2e/turn-all.demo.ts` waits three seconds and fails unless one percent of the middle of the disc has changed, for every body, with no date and with a date.
9
+
3
10
  ## 0.17.0 - 2026-11-06
4
11
 
5
12
  Photo maps on the realistic look, and every body turns.
package/README.md CHANGED
@@ -13,9 +13,9 @@ A clean line drawing, a shaded realistic drawing, or a painted surface map, with
13
13
 
14
14
  <p align="center"><a href="https://johnmorrisdotca.github.io/wakusei-planets/"><strong>Open the demo →</strong></a> · <a href="https://johnmorrisdotca.github.io/wakusei-planets/embed.html">Embed page</a> · <a href="https://johnmorrisdotca.github.io/wakusei-planets/docs/">Docs</a></p>
15
15
 
16
- <p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.17.0/docs/images/hero-desk.png" width="640"></p>
16
+ <p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.17.1/docs/images/hero-desk.png" width="640"></p>
17
17
 
18
- <p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.17.0/docs/images/lineup-desk.png" width="640"></p>
18
+ <p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.17.1/docs/images/lineup-desk.png" width="640"></p>
19
19
 
20
20
  ## One minute
21
21
 
@@ -273,7 +273,7 @@ A body that turns by itself and a moving sky, in HTML:
273
273
 
274
274
  ## The portrait builder
275
275
 
276
- <p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.17.0/docs/images/portrait-family.png" width="640"></p>
276
+ <p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.17.1/docs/images/portrait-family.png" width="640"></p>
277
277
 
278
278
  [The portrait builder](https://johnmorrisdotca.github.io/wakusei-planets/portrait.html) puts any bodies in one picture: drag them, size them, turn them, order them front to back, arrange them in a row, an arc, a grid or at true orbit distance (true or readable sizes, a planet's moons round it in orbit order), light them from one direction, and take the code, a PNG or an SVG. The scene is kept in the address, and every body is drawn in one WebGL scene, so the page holds one WebGL context. [The portrait builder](docs/guides/portrait-builder.md) is its guide.
279
279
 
@@ -15,5 +15,5 @@ registerLook({
15
15
  atmosphere: { colour: [0.35, 0.5, 0.95], strength: 0.42, power: 2.8 },
16
16
  limb: 0.3,
17
17
  ambient: 0.05,
18
- painted: { map: "neptune", widths: [512, 1024, 2048], far: 2048, relief: 0 },
18
+ painted: { map: "neptune", widths: [512, 1024, 2048], far: 2048, relief: 0, turn: "bands" },
19
19
  });
@@ -10,5 +10,5 @@ registerLook({
10
10
  }),
11
11
  atmosphere: { colour: [0.9, 0.82, 0.62], strength: 0.12, power: 3.5 },
12
12
  limb: 0.4,
13
- painted: { map: "saturn", widths: [512, 1024, 2048], far: 2048, relief: 0, rings: { map: "saturn-ring", width: 2048, from: 74794, to: 137035 } },
13
+ painted: { map: "saturn", widths: [512, 1024, 2048], far: 2048, relief: 0, turn: "hexagon", rings: { map: "saturn-ring", width: 2048, from: 74794, to: 137035 } },
14
14
  });
@@ -11,5 +11,5 @@ registerLook({
11
11
  atmosphere: { colour: [0.55, 0.88, 0.92], strength: 0.4, power: 2.8 },
12
12
  limb: 0.3,
13
13
  ambient: 0.05,
14
- painted: { map: "uranus", widths: [512, 1024, 2048], far: 2048, relief: 0 },
14
+ painted: { map: "uranus", widths: [512, 1024, 2048], far: 2048, relief: 0, turn: "bands" },
15
15
  });
package/dist/element.d.ts CHANGED
@@ -25,7 +25,7 @@ export type WakuseiState = "line" | "loading" | "still" | "live" | "lost" | "una
25
25
  * console.log(TEXTURE_BASE);
26
26
  * ```
27
27
  */
28
- export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.17.0/dist/textures/";
28
+ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.17.1/dist/textures/";
29
29
  /**
30
30
  * Where the sharpest surface pictures are: the files of this exact version in the repository, on jsDelivr's GitHub address. The npm package holds only the two smaller widths, so a page that
31
31
  * never zooms in never fetches them. Set `texture-far-base` on an element to serve them yourself.
@@ -37,7 +37,7 @@ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdot
37
37
  * console.log(TEXTURE_FAR_BASE);
38
38
  * ```
39
39
  */
40
- export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.17.0/textures/";
40
+ export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.17.1/textures/";
41
41
  /**
42
42
  * The `<wakusei-body>` custom element: a body of the solar system, drawn in a look.
43
43
  *
@@ -25,6 +25,7 @@ function makeBodyMaterial(T, look, painted) {
25
25
  uAtmosPow: { value: a?.power ?? 3 },
26
26
  uRimBase: { value: 0.12 },
27
27
  uEmissive: { value: look.emissive === true ? 1 : 0 },
28
+ ...(painted ? { uMark: { value: look.painted?.turn === "hexagon" ? 2 : look.painted?.turn === "bands" ? 1 : 0 } } : {}),
28
29
  uRingN: { value: new T.Vector3(0, 1, 0) },
29
30
  uRingR: { value: new T.Vector2(1, 2) },
30
31
  uRingOn: { value: 0 },
@@ -4,7 +4,7 @@ export declare const PRELUDE = "\nfloat hash13(vec3 p) { p = fract(p * 0.1031);
4
4
  /** The fragment shader of a body: the surface code goes between the prelude and `main`. */
5
5
  export declare function bodyFragment(surface: string, painted: boolean, world?: boolean): string;
6
6
  /** A painted body's surface code: the map by longitude and latitude, with the seam at 180 degrees left alone. */
7
- export declare const PAINTED_SURFACE = "\nvec4 surface(vec3 p) {\n float u1 = atan(p.y, p.x) / 6.2831853 + 0.5;\n float u2 = fract(u1 + 0.5) - 0.5;\n float v = asin(clamp(p.z, -1.0, 1.0)) / 3.1415927 + 0.5;\n vec2 a = vec2(u1, v); vec2 b = vec2(u2, v);\n vec2 ax = dFdx(a); vec2 ay = dFdy(a); vec2 bx = dFdx(b); vec2 by = dFdy(b);\n bool useA = dot(ax, ax) + dot(ay, ay) <= dot(bx, bx) + dot(by, by);\n vec3 c = textureGrad(uMap, useA ? a : b, useA ? ax : bx, useA ? ay : by).rgb;\n return vec4(c, dot(c, vec3(0.3, 0.59, 0.11)));\n}";
7
+ export declare const PAINTED_SURFACE = "\nvec4 surface(vec3 p) {\n float u1 = atan(p.y, p.x) / 6.2831853 + 0.5;\n float u2 = fract(u1 + 0.5) - 0.5;\n float v = asin(clamp(p.z, -1.0, 1.0)) / 3.1415927 + 0.5;\n vec2 a = vec2(u1, v); vec2 b = vec2(u2, v);\n vec2 ax = dFdx(a); vec2 ay = dFdy(a); vec2 bx = dFdx(b); vec2 by = dFdy(b);\n bool useA = dot(ax, ax) + dot(ay, ay) <= dot(bx, bx) + dot(by, by);\n vec3 c = textureGrad(uMap, useA ? a : b, useA ? ax : bx, useA ? ay : by).rgb;\n // A map of plain bands is the same at every longitude, so the body turns and the picture does not. The wave, the spot and the polar hexagon move with the surface.\n if (uMark > 0.5) {\n float lon = atan(p.y, p.x);\n float lat = asin(clamp(p.z, -1.0, 1.0));\n float wave = sin(lon * 4.0 + lat * 6.0);\n float belt = 1.0 - smoothstep(1.15, 1.45, abs(lat));\n c *= 0.86 + 0.22 * (0.5 + 0.5 * wave) * belt;\n if (uMark > 1.5) {\n float ang = atan(p.y, p.x);\n float radius = length(p.xy);\n float hexR = 0.26 + 0.045 * cos(ang * 6.0);\n float hex = (1.0 - smoothstep(0.0, 0.028, abs(radius - hexR))) * smoothstep(0.42, 0.68, p.z);\n c = mix(c, vec3(0.45, 0.55, 0.68), hex);\n } else {\n float spot = exp(-pow((lat - 0.32) / 0.2, 2.0) - pow(lon / 0.5, 2.0));\n c = mix(c, c * vec3(0.28, 0.34, 0.5), clamp(spot, 0.0, 1.0));\n }\n }\n return vec4(c, dot(c, vec3(0.3, 0.59, 0.11)));\n}";
8
8
  export declare const RING_FRAGMENT = "\nprecision highp float;\nuniform sampler2D uRingTex;\nuniform vec2 uRingR;\nuniform vec3 uLight;\nuniform vec3 uRingN;\nvarying vec3 vL;\nvarying vec3 vW;\nvoid main() {\n float u = (length(vL.xy) - uRingR.x) / (uRingR.y - uRingR.x);\n if (u < 0.0 || u > 1.0) discard;\n vec4 t = texture2D(uRingTex, vec2(u, 0.5));\n float nl = dot(uRingN, uLight);\n float side = nl * uRingN.z;\n float bright = 0.16 + 0.84 * clamp(abs(nl) * 2.0, 0.0, 1.0);\n if (side < 0.0) bright *= 0.38;\n float b = dot(vW, uLight);\n float closest = sqrt(max(dot(vW, vW) - b * b, 0.0));\n float shadow = b < 0.0 ? smoothstep(1.02, 0.97, closest) : 0.0;\n vec3 c = pow(t.rgb, vec3(2.2)) * bright * (1.0 - 0.93 * shadow);\n gl_FragColor = vec4(pow(c, vec3(1.0 / 2.2)), t.a);\n}";
9
9
  export declare const RING_VERTEX = "\nvarying vec3 vL;\nvarying vec3 vW;\nvoid main() {\n vL = position;\n vec4 w = modelMatrix * vec4(position, 1.0);\n vW = w.xyz;\n gl_Position = projectionMatrix * viewMatrix * w;\n}";
10
10
  /**
@@ -65,6 +65,7 @@ uniform vec3 uAtmos;
65
65
  uniform float uAtmosPow;
66
66
  uniform float uRimBase;
67
67
  uniform float uEmissive;
68
+ ${painted ? "uniform float uMark;" : ""}
68
69
  uniform vec3 uRingN;
69
70
  uniform vec2 uRingR;
70
71
  uniform float uRingOn;
@@ -135,6 +136,24 @@ vec4 surface(vec3 p) {
135
136
  vec2 ax = dFdx(a); vec2 ay = dFdy(a); vec2 bx = dFdx(b); vec2 by = dFdy(b);
136
137
  bool useA = dot(ax, ax) + dot(ay, ay) <= dot(bx, bx) + dot(by, by);
137
138
  vec3 c = textureGrad(uMap, useA ? a : b, useA ? ax : bx, useA ? ay : by).rgb;
139
+ // A map of plain bands is the same at every longitude, so the body turns and the picture does not. The wave, the spot and the polar hexagon move with the surface.
140
+ if (uMark > 0.5) {
141
+ float lon = atan(p.y, p.x);
142
+ float lat = asin(clamp(p.z, -1.0, 1.0));
143
+ float wave = sin(lon * 4.0 + lat * 6.0);
144
+ float belt = 1.0 - smoothstep(1.15, 1.45, abs(lat));
145
+ c *= 0.86 + 0.22 * (0.5 + 0.5 * wave) * belt;
146
+ if (uMark > 1.5) {
147
+ float ang = atan(p.y, p.x);
148
+ float radius = length(p.xy);
149
+ float hexR = 0.26 + 0.045 * cos(ang * 6.0);
150
+ float hex = (1.0 - smoothstep(0.0, 0.028, abs(radius - hexR))) * smoothstep(0.42, 0.68, p.z);
151
+ c = mix(c, vec3(0.45, 0.55, 0.68), hex);
152
+ } else {
153
+ float spot = exp(-pow((lat - 0.32) / 0.2, 2.0) - pow(lon / 0.5, 2.0));
154
+ c = mix(c, c * vec3(0.28, 0.34, 0.5), clamp(spot, 0.0, 1.0));
155
+ }
156
+ }
138
157
  return vec4(c, dot(c, vec3(0.3, 0.59, 0.11)));
139
158
  }`;
140
159
  export const RING_FRAGMENT = /* glsl */ `
@@ -37,6 +37,11 @@ export interface PaintedMap {
37
37
  far?: number;
38
38
  /** How much of the map's brightness is also relief. Default 0. */
39
39
  relief?: number;
40
+ /**
41
+ * Weather drawn on the map so a turn can be seen. `bands` is a wave and a spot that move with longitude.
42
+ * `hexagon` is that wave plus the six-sided storm at the north pole. A map of plain bands shows no turn without it.
43
+ */
44
+ turn?: "bands" | "hexagon";
40
45
  /** A picture of the body's rings for this look, one pixel high: colour and opacity from the inner edge to the outer, `width` samples. Used instead of the table's strip when it loads. */
41
46
  rings?: {
42
47
  map: string;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.17.0";
1
+ export declare const VERSION = "0.17.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.17.0";
1
+ export const VERSION = "0.17.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/wakusei-planets",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "Wakusei Planets 惑星 — The Sun, planets and moons for the web: each as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, axial tilt and rotation as data, and positions of the moons for any date and time. SVG for the lines, three.js (optional) for the rest.",
5
5
  "keywords": [
6
6
  "planets",