@johnmorrisdotca/wakusei-planets 0.0.0-stage → 0.3.0

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.
Files changed (114) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE.md +48 -0
  4. package/README.md +214 -2
  5. package/dist/bodies/all.d.ts +16 -0
  6. package/dist/bodies/all.js +16 -0
  7. package/dist/bodies/earth.d.ts +1 -0
  8. package/dist/bodies/earth.js +23 -0
  9. package/dist/bodies/jupiter.d.ts +1 -0
  10. package/dist/bodies/jupiter.js +22 -0
  11. package/dist/bodies/mars.d.ts +1 -0
  12. package/dist/bodies/mars.js +25 -0
  13. package/dist/bodies/mercury.d.ts +1 -0
  14. package/dist/bodies/mercury.js +9 -0
  15. package/dist/bodies/moons-earth.d.ts +1 -0
  16. package/dist/bodies/moons-earth.js +37 -0
  17. package/dist/bodies/moons-jupiter.d.ts +1 -0
  18. package/dist/bodies/moons-jupiter.js +29 -0
  19. package/dist/bodies/moons-mars.d.ts +1 -0
  20. package/dist/bodies/moons-mars.js +4 -0
  21. package/dist/bodies/moons-neptune.d.ts +1 -0
  22. package/dist/bodies/moons-neptune.js +11 -0
  23. package/dist/bodies/moons-pluto.d.ts +1 -0
  24. package/dist/bodies/moons-pluto.js +5 -0
  25. package/dist/bodies/moons-saturn.d.ts +1 -0
  26. package/dist/bodies/moons-saturn.js +34 -0
  27. package/dist/bodies/moons-uranus.d.ts +1 -0
  28. package/dist/bodies/moons-uranus.js +7 -0
  29. package/dist/bodies/neptune.d.ts +1 -0
  30. package/dist/bodies/neptune.js +19 -0
  31. package/dist/bodies/pluto.d.ts +1 -0
  32. package/dist/bodies/pluto.js +22 -0
  33. package/dist/bodies/saturn.d.ts +1 -0
  34. package/dist/bodies/saturn.js +14 -0
  35. package/dist/bodies/sun.d.ts +1 -0
  36. package/dist/bodies/sun.js +20 -0
  37. package/dist/bodies/uranus.d.ts +1 -0
  38. package/dist/bodies/uranus.js +15 -0
  39. package/dist/bodies/venus.d.ts +1 -0
  40. package/dist/bodies/venus.js +10 -0
  41. package/dist/data/orbits.d.ts +20 -0
  42. package/dist/data/orbits.js +27 -0
  43. package/dist/element.d.ts +88 -0
  44. package/dist/element.js +603 -0
  45. package/dist/ephemeris.d.ts +189 -0
  46. package/dist/ephemeris.js +340 -0
  47. package/dist/facts.d.ts +213 -0
  48. package/dist/facts.js +198 -0
  49. package/dist/gate.d.ts +37 -0
  50. package/dist/gate.js +54 -0
  51. package/dist/index.d.ts +5 -0
  52. package/dist/index.js +5 -0
  53. package/dist/line.d.ts +82 -0
  54. package/dist/line.js +280 -0
  55. package/dist/live.d.ts +42 -0
  56. package/dist/live.js +62 -0
  57. package/dist/pose.d.ts +62 -0
  58. package/dist/pose.js +69 -0
  59. package/dist/scene/body.d.ts +68 -0
  60. package/dist/scene/body.js +337 -0
  61. package/dist/scene/glsl.d.ts +13 -0
  62. package/dist/scene/glsl.js +186 -0
  63. package/dist/scene/look.d.ts +106 -0
  64. package/dist/scene/look.js +35 -0
  65. package/dist/scene/recipes.d.ts +49 -0
  66. package/dist/scene/recipes.js +76 -0
  67. package/dist/scene/rings.d.ts +34 -0
  68. package/dist/scene/rings.js +64 -0
  69. package/dist/scene/shared.d.ts +24 -0
  70. package/dist/scene/shared.js +55 -0
  71. package/dist/scene/store.d.ts +19 -0
  72. package/dist/scene/store.js +8 -0
  73. package/dist/textures/callisto-1024.webp +0 -0
  74. package/dist/textures/callisto-512.webp +0 -0
  75. package/dist/textures/enceladus-1024.webp +0 -0
  76. package/dist/textures/enceladus-512.webp +0 -0
  77. package/dist/textures/europa-1024.webp +0 -0
  78. package/dist/textures/europa-512.webp +0 -0
  79. package/dist/textures/ganymede-1024.webp +0 -0
  80. package/dist/textures/ganymede-512.webp +0 -0
  81. package/dist/textures/io-1024.webp +0 -0
  82. package/dist/textures/io-512.webp +0 -0
  83. package/dist/textures/jupiter-1024.webp +0 -0
  84. package/dist/textures/jupiter-512.webp +0 -0
  85. package/dist/textures/mars-1024.webp +0 -0
  86. package/dist/textures/mars-512.webp +0 -0
  87. package/dist/textures/mercury-1024.webp +0 -0
  88. package/dist/textures/mercury-512.webp +0 -0
  89. package/dist/textures/mimas-1024.webp +0 -0
  90. package/dist/textures/mimas-512.webp +0 -0
  91. package/dist/textures/moon-1024.webp +0 -0
  92. package/dist/textures/moon-512.webp +0 -0
  93. package/dist/textures/neptune-1024.webp +0 -0
  94. package/dist/textures/neptune-512.webp +0 -0
  95. package/dist/textures/pluto-1024.webp +0 -0
  96. package/dist/textures/pluto-512.webp +0 -0
  97. package/dist/textures/rhea-1024.webp +0 -0
  98. package/dist/textures/rhea-512.webp +0 -0
  99. package/dist/textures/saturn-1024.webp +0 -0
  100. package/dist/textures/saturn-512.webp +0 -0
  101. package/dist/textures/saturn-ring-2048.webp +0 -0
  102. package/dist/textures/sun-1024.webp +0 -0
  103. package/dist/textures/sun-512.webp +0 -0
  104. package/dist/textures/titan-1024.webp +0 -0
  105. package/dist/textures/titan-512.webp +0 -0
  106. package/dist/textures/uranus-1024.webp +0 -0
  107. package/dist/textures/uranus-512.webp +0 -0
  108. package/dist/textures/venus-1024.webp +0 -0
  109. package/dist/textures/venus-512.webp +0 -0
  110. package/dist/vec.d.ts +19 -0
  111. package/dist/vec.js +32 -0
  112. package/dist/version.d.ts +1 -0
  113. package/dist/version.js +1 -0
  114. package/package.json +236 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+
3
+ ## 0.3.0
4
+
5
+ Painted moons, Saturn's rings from Cassini, and a drag that goes the right way up.
6
+
7
+ - **Painted maps of nine moons**, from public-domain imagery on Wikimedia Commons, each file's licence read from Commons and credited in `NOTICE.md`: the Moon (LRO WAC, NASA's SVS Moon Kit), Io (Galileo and Voyager), Europa (USGS), Ganymede and Callisto (USGS), Titan (Cassini's 938 nm map, coloured and low in contrast, said plainly in `NOTICE.md`), Rhea, Enceladus (Cassini colour maps, the false colour turned most of the way to grey) and Mimas (Cassini). 512 and 1024 pixel widths in the package, 2048 from the repository as for the planets (Europa's source is 1024 wide, so it has no 2048). Where a source does not state its longitudes, `NOTICE.md` says what the map was turned by and why. Tethys, Dione, Iapetus, Triton and Charon keep their drawn look: Cassini maps of the first three are not made yet, Triton's source gives no longitudes, and the only clean public-domain map of Charon is under a grid of labels.
8
+ - **Saturn's rings in the painted look are a Cassini picture** (PIA07874, natural colour): one strip of 2048 colours and opacities from 74,794 to 137,035 km, 2.4 KB, with the real ringlets, the Cassini Division and the Encke gap. The realistic look keeps the strip made from the ring table. `PaintedMap.rings` names the strip; a strip that cannot load leaves the table's.
9
+ - **The package's pictures grow from 0.53 MB to 1.31 MB** (the 512 and 1024 widths of 18 maps and the ring strip); the budget in `pnpm test:package` is 1.5 MB.
10
+ - **The Moon is in `/all`.** `@johnmorrisdotca/wakusei-planets/all` left out `moons-earth`, so the demo's Moon was drawn as a plain ball.
11
+ - **Io's Pele is at 105 degrees east** in the shaded look (it was at 90 degrees west; Pele is at 255 degrees west).
12
+ - **A drag up moves the surface up** (it moved it down), in every look: the controls' tilt tipped the pole toward you as it grew, and now tips the top of the body away, so the near surface goes up, as in chikyu-earth 0.9.1. Drag right, the right arrow and the up arrow agree. Test (`e2e/drag.demo.ts`): a real pointer and real key presses on Mars (line, shaded, painted), Venus and the Moon (painted); the vertical checks fail on 0.2.0.
13
+ - `scripts/make-textures.py` makes the moons and the ring strip too (`python3 scripts/make-textures.py io saturn-ring`) and writes each source's file page, licence and credit into `textures/SOURCES.json`.
14
+
15
+ ## 0.2.0
16
+
17
+ The painted looks.
18
+
19
+ - `look="painted"`: real surface maps of Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto and the Sun, from public-domain NASA, USGS and JPL imagery, each file's licence checked and credited in `NOTICE.md`. Saturn, Uranus, Neptune and the Sun have no global map, so theirs are made from one photograph each (said plainly in `NOTICE.md`).
20
+ - Small pictures by default: the 512 and 1024 pixel widths are in the package (0.53 MB in all); a view that is zoomed in fetches the 2048 pixel width from the repository by jsDelivr's GitHub address (`texture-far-base` to serve it yourself). A picture that fails to load leaves the shaded look drawn, and no picture is asked for twice.
21
+ - A texture is freed when a sharper one replaces it and when the element leaves.
22
+
23
+ ## 0.1.0
24
+
25
+ The first release. The package, to the family's standard from the start: a demo and an embed page on GitHub Pages, a documentation site in English and Japanese, a README with every way to use it (each one tested), the shared release workflow with its freeze test.
26
+
27
+ - Line drawings, as SVG strings and as `<wakusei-body look="line">`, of the Sun, Mercury, Venus, Mars, Jupiter, Saturn (with its rings), Uranus (with its rings), Neptune and Pluto, and of the Moon, Phobos and Deimos, the Galilean moons, Saturn's seven larger moons, Uranus's five, Neptune's Proteus, Triton and Nereid, and Pluto's Charon, Nix and Hydra: real relative sizes, axial tilt and rotation as data.
28
+ - The Earth, through a thin adapter over chikyu-earth's own globe (`/earth`, chikyu-earth an optional peer): its line globe, and its Earth from space when the body is live. No second copy.
29
+ - Shaded realistic drawings with three.js through kazoku-ui's shared renderer, each body its own optional entry point: bands, spots, craters, caps and the Pluto heart worked out in a shader, rings that cast shadows, the Sun's glow.
30
+ - The sky for a date and time: a body's pole, rotation, phase and ring opening as the Earth sees it, and a planet's moons on their orbits where they are then (JPL elements, Meeus for the Moon), worked out about once a second and carried forward between.
31
+ - One WebGL context per page, nothing drawn at rest, thirty frames a second at most, canvas within 4096 pixels a side and 6 MP, everything freed, no drawing out of sight, reduced motion respected, a lost context recovers; tested by `pnpm test:freeze` and a soak.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 John Morris
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,48 @@
1
+ # Notice
2
+
3
+ Wakusei Planets is original work by John Morris, under the MIT licence in `LICENSE`.
4
+
5
+ ## The numbers
6
+
7
+ No picture is used by the line and shaded looks: they are drawn from numbers.
8
+
9
+ - **Sizes, flattening, axial tilt, poles and rotation**: the IAU Working Group on Cartographic Coordinates and Rotational Elements, B. A. Archinal et al. (2018), "Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2015", Celestial Mechanics and Dynamical Astronomy 130:22, and NASA's planetary and satellite fact sheets (https://nssdc.gsfc.nasa.gov/planetary/factsheet/, read 2026-11-02). Facts are not copyrightable; the values were typed from these sources.
10
+ - **Planet positions**: JPL Solar System Dynamics, "Keplerian Elements for Approximate Positions of the Major Planets", Table 1, 1800 AD to 2050 AD (https://ssd.jpl.nasa.gov/planets/approx_pos.html, read 2026-11-02; Pluto from the same page's earlier edition). NASA/JPL content is not subject to copyright in the United States; credit: NASA/JPL-Caltech.
11
+ - **Moons' orbits**: JPL Solar System Dynamics, "Planetary Satellite Mean Elements" (https://ssd.jpl.nasa.gov/sats/elem/, read 2026-11-02), made into `src/data/orbits.ts` by `scripts/make-moon-data.py`. Credit: NASA/JPL-Caltech; the elements are from R. A. Jacobson and colleagues' ephemerides cited on that page.
12
+ - **The Moon's position**: the largest terms of the series in Jean Meeus, "Astronomical Algorithms" (2nd edition), chapter 47, written out here as numbers; the mean arguments are the standard ones.
13
+
14
+ The tests compare the Galilean moons and four planets with astronomy-engine (MIT, https://github.com/cosinekitty/astronomy), a development dependency that is never shipped.
15
+
16
+ ## The Earth
17
+
18
+ The Earth is drawn by chikyu-earth (MIT, by John Morris; https://github.com/johnmorrisdotca/chikyu-earth), an optional peer dependency: its own NOTICE.md has the terms of its outlines and its NASA pictures.
19
+
20
+ ## Surface pictures
21
+
22
+ The painted looks' pictures in `textures/` (the 512 and 1024 pixel widths are also in the package's `dist/textures/`) are made by `scripts/make-textures.py` from public-domain imagery on Wikimedia Commons. The script reads each file's licence from Commons' own metadata and stops unless it is public domain or CC0; the originals are downloaded to `.cache/` and never kept in the repository. `textures/SOURCES.json` records the file pages, licences and credits as read on 2026-11-02.
23
+
24
+ NASA says its content "generally are not subject to copyright in the United States" and asks for acknowledgement (https://www.nasa.gov/nasa-brand-center/images-and-media/); USGS and JPL maps are works of the United States government. This package is not endorsed by NASA, the USGS or any mission, and uses none of their insignia or logotypes.
25
+
26
+ | Pictures | Body | Source file | Licence | Credit | What was done |
27
+ |---|---|---|---|---|---|
28
+ | `mercury-*.webp` | Mercury | [Mercury MESSENGER MDIS Basemap EnhancedColor Mosaic Global 32ppd.jpg](https://commons.wikimedia.org/wiki/File:Mercury_MESSENGER_MDIS_Basemap_EnhancedColor_Mosaic_Global_32ppd.jpg) | Public domain | Johns Hopkins Applied Physics Laboratory, Applied Coherent Technology Corporation | MESSENGER MDIS enhanced-colour global mosaic (USGS Astrogeology map), colour turned most of the way to grey and brightened; the polar rows with no data repeat the nearest real ones |
29
+ | `venus-*.webp` | Venus | [Cylindrical Map of Venus.jpg](https://commons.wikimedia.org/wiki/File:Cylindrical_Map_of_Venus.jpg) | Public domain | NASA / Jet Propulsion Laboratory | Magellan radar global map in the orange tone of the Venera pictures (a colour for the radar's brightness, not a photograph of the surface under the clouds), turned so Maxwell Montes is at 3 degrees east |
30
+ | `mars-*.webp` | Mars | [Mars Viking MDIM21 ClrMosaic 1km.jpg](https://commons.wikimedia.org/wiki/File:Mars_Viking_MDIM21_ClrMosaic_1km.jpg) | Public domain | NASA / Jet Propulsion Lab / USGS | Viking Orbiter MDIM 2.1 colour mosaic (USGS Astrogeology), as it is |
31
+ | `jupiter-*.webp` | Jupiter | [Jupiter Cylindrical Map - Dec 2000 PIA07782.jpg](https://commons.wikimedia.org/wiki/File:Jupiter_Cylindrical_Map_-_Dec_2000_PIA07782.jpg) | Public domain | NASA/JPL/Space Science Institute | Cassini cylindrical map of December 2000 (PIA07782), as it is; the poles are the map's own |
32
+ | `saturn-*.webp` | Saturn | [Saturn during Equinox.jpg](https://commons.wikimedia.org/wiki/File:Saturn_during_Equinox.jpg) | Public domain | NASA / JPL / Space Science Institute | made from Cassini's natural-colour portrait of 2009 (PIA11141): the visible hemisphere turned back onto the sphere, the limb darkening taken off, and each latitude's colour kept all the way round (a photograph has no longitudes to map), the ring shadow and the ring crossing the disc taken out |
33
+ | `uranus-*.webp` | Uranus | [Uranus as seen by NASA's Voyager 2.tif](https://commons.wikimedia.org/wiki/File:Uranus_as_seen_by_NASA%27s_Voyager_2.tif) | Public domain | NASA | made from Voyager 2's portrait (PIA18182): one colour for the whole planet, a little brighter toward the south pole, because that photograph has no features to map |
34
+ | `neptune-*.webp` | Neptune | [Neptune Full (original).jpg](https://commons.wikimedia.org/wiki/File:Neptune_Full_(original).jpg) | Public domain | NASA/JPL | made from Voyager 2's full-disk view (PIA01492): the bands of each latitude all the way round, and the Great Dark Spot with its bright companion clouds put back where the photograph shows them |
35
+ | `pluto-*.webp` | Pluto | [Pluto color mapmosaic.jpg](https://commons.wikimedia.org/wiki/File:Pluto_color_mapmosaic.jpg) | Public domain | NASA / Johns Hopkins University Applied Physics Laboratory / Southwest Research Institute | New Horizons global colour map, turned so Sputnik Planitia is at 178 degrees east; the south, in the polar night New Horizons never saw, fades into a dark brown |
36
+ | `sun-*.webp` | Sun | [SDO 20240810 000000 4096 HMIIC (HMI).jpg](https://commons.wikimedia.org/wiki/File:SDO_20240810_000000_4096_HMIIC_(HMI).jpg) | Public domain | Courtesy of NASA/SDO and the AIA, EVE, and HMI science teams. | SDO's HMI continuum picture of 10 August 2024: the visible hemisphere turned back onto the sphere, limb darkening taken off, and its sunspots and granulation kept on a flat orange, repeated on the far side |
37
+ | `moon-*.webp` | The Moon | [CGI Moon Kit - Lroc color poles.tif](https://commons.wikimedia.org/wiki/File:CGI_Moon_Kit_-_Lroc_color_poles.tif) | Public domain | NASA's Scientific Visualization Studio (Ernie Wright, Noah Petro); Lunar Reconnaissance Orbiter Camera | LRO WAC colour map from the SVS Moon Kit (4720), as it is, longitude 0 in the middle |
38
+ | `io-*.webp` | Io | [Io from Galileo and Voyager missions.jpg](https://commons.wikimedia.org/wiki/File:Io_from_Galileo_and_Voyager_missions.jpg) | Public domain | NASA / JPL (Galileo SSI and Voyager images); the file page names no author | Galileo and Voyager colour map between 57 degrees north and south, turned so Pele is at 105 degrees east; the poles it does not reach fade from the map's edge into its mean colour |
39
+ | `europa-*.webp` | Europa | [Europa Voyager GalileoSSI global mosaic.jpg](https://commons.wikimedia.org/wiki/File:Europa_Voyager_GalileoSSI_global_mosaic.jpg) | Public domain | U.S. Geological Survey / Planetary Data System / Tammy Becker | USGS Voyager and Galileo grey-scale mosaic, longitude 0 in the middle (the source does not say; the Pwyll crater and the dark trailing side fall at 90 degrees east, the bright leading side at 90 degrees west); the unmapped rim of the south fades to its mean grey. The source is 1024 pixels wide, so there is no 2048 picture |
40
+ | `ganymede-*.webp` | Ganymede | [Ganymede equatorial.jpg](https://commons.wikimedia.org/wiki/File:Ganymede_equatorial.jpg) | Public domain | USGS | USGS Voyager and Galileo colour mosaic (I-2762), the Mercator sheet for 57 degrees north and south, redrawn as an equirectangular map with longitude 0 in the middle (the source does not say; Galileo Regio falls at 140 degrees west); the poles are not on that sheet and fade from its edge into its mean colour |
41
+ | `callisto-*.webp` | Callisto | [Callisto equatorial.jpg](https://commons.wikimedia.org/wiki/File:Callisto_equatorial.jpg) | Public domain | USGS | USGS Voyager and Galileo mosaic (I-2770), the Mercator sheet for 57 degrees north and south, redrawn as an equirectangular map with longitude 0 in the middle (the source does not say; Valhalla falls at 56 degrees west); the poles fade from its edge into its mean grey |
42
+ | `titan-*.webp` | Titan | [Titan map April 2011 full.png](https://commons.wikimedia.org/wiki/File:Titan_map_April_2011_full.png) | Public domain | NASA / JPL / Space Science Institute | Cassini ISS 938 nm map (PIA14908), turned so longitude 0 is in the middle (the original is centred on 180). Titan's surface cannot be seen in visible light under its haze, so the picture is a colour for the infrared brightness, with its contrast turned down: it is not a photograph, as with Venus |
43
+ | `rhea-*.webp` | Rhea | [Rhea Color Map.jpg](https://commons.wikimedia.org/wiki/File:Rhea_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18438), turned half way round so longitude 0 is in the middle (the source does not say where it is centred; the dark trailing side is put at 90 degrees east); the colours are false-colour (infrared, green, ultraviolet) and are turned about half way to grey |
44
+ | `enceladus-*.webp` | Enceladus | [Enceladus Color Map.jpg](https://commons.wikimedia.org/wiki/File:Enceladus_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18435), turned half way round the same way as Rhea's (the source does not say where it is centred; the fractured trailing terrain is put at 90 degrees east); the colours are false-colour (the blue of the tiger stripes is ultraviolet) and are turned most of the way to grey |
45
+ | `mimas-*.webp` | Mimas | [Map of Mimas 2010-02 PIA12780.jpg](https://commons.wikimedia.org/wiki/File:Map_of_Mimas_2010-02_PIA12780.jpg) | Public domain | NASA/JPL/Space Science Institute | Cassini ISS map of February 2010 (PIA12780), cropped inside its frame and labels; Herschel is at 110 degrees west as its own scale says |
46
+ | `saturn-ring-2048.webp` | Saturn's rings | [Saturn's rings in visible light and radio.jpg](https://commons.wikimedia.org/wiki/File:Saturn's_rings_in_visible_light_and_radio.jpg) | Public domain | NASA / JPL / Space Science Institute | Cassini's natural-colour mosaic of the lit rings (PIA07874, from PIA06175), read along one radius into a strip of 2048 colours and opacities from 74,794 to 137,035 km. The radii are fitted to five edges the picture shows (the B ring's inner edge, the two edges of the Cassini Division, the Encke gap and the A ring's outer edge), each within 300 km. The opacity is taken from the brightness, and the colour balance is moved to match the Saturn portrait above; the F ring and the D ring are not in the picture |
47
+
48
+ The package does not ship the 2048 pixel widths: `TEXTURE_FAR_BASE` fetches them from this repository by jsDelivr's GitHub address when a view is zoomed in. The 512 and 1024 pixel widths of every picture, and the ring strip, are 1.31 MB in the package (the nine of 0.2.0 were 0.53 MB). Tethys, Dione, Iapetus, Triton and Charon have no picture: Cassini's maps of the first three are not made yet, the source of Triton's map does not give its longitudes, and the only clean public-domain map of Charon is under a grid of labels, so those five keep their drawn look.
package/README.md CHANGED
@@ -1,3 +1,215 @@
1
- # Temporary Holding Version
1
+ <h1 align="center">Wakusei Planets <sub>惑星</sub></h1>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <p align="center"><strong>The Sun, the planets and their moons, for the web.</strong><br>
4
+ A clean line drawing, a shaded realistic drawing, or a painted surface map, with each body's real size, axial tilt and rotation as data, and a planet's moons where they are at any date and time.</p>
5
+
6
+ <p align="center">
7
+ <a href="https://github.com/johnmorrisdotca/wakusei-planets/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/johnmorrisdotca/wakusei-planets/actions/workflows/ci.yml/badge.svg"></a>
8
+ <a href="./LICENSE"><img alt="MIT licence" src="https://img.shields.io/badge/licence-MIT-2f5d4a"></a>
9
+ <img alt="TypeScript" src="https://img.shields.io/badge/types-TypeScript-3178c6">
10
+ </p>
11
+
12
+ <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>
13
+
14
+ <p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="docs/images/hero-desk.png" width="640"></p>
15
+
16
+ ## One minute
17
+
18
+ ```sh
19
+ npm install @johnmorrisdotca/wakusei-planets
20
+ ```
21
+
22
+ A page with no build step needs one tag. `look="line"` is an SVG and needs nothing else:
23
+
24
+ ```html
25
+ <!doctype html>
26
+ <html lang="en">
27
+ <head>
28
+ <meta charset="utf-8" />
29
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
30
+ <title>Wakusei Planets from jsDelivr</title>
31
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets/element/+esm"></script>
32
+ </head>
33
+ <body>
34
+ <wakusei-body body="saturn" look="line" size="320"></wakusei-body>
35
+ </body>
36
+ </html>
37
+ ```
38
+
39
+ The same tag with the shared [kazoku-ui](https://github.com/johnmorrisdotca/kazoku-ui) controls, which turn, tip, zoom and pan the body:
40
+
41
+ ```html
42
+ <!doctype html>
43
+ <html lang="en">
44
+ <head>
45
+ <meta charset="utf-8" />
46
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
47
+ <title>Wakusei Planets with the shared controls</title>
48
+ <script type="module">
49
+ import "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/kazoku-ui/view-controls/define/+esm";
50
+ import "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets/element/+esm";
51
+
52
+ const body = document.querySelector("wakusei-body");
53
+ document.querySelector("kazoku-view-controls").addEventListener("kazoku-viewchange", (event) => {
54
+ body.setView(event.detail);
55
+ });
56
+ </script>
57
+ </head>
58
+ <body>
59
+ <div id="view" tabindex="0">
60
+ <wakusei-body body="saturn" look="line" size="420"></wakusei-body>
61
+ </div>
62
+ <kazoku-view-controls for="view" address controls="advanced" tilt-max="90" speed="0"></kazoku-view-controls>
63
+ </body>
64
+ </html>
65
+ ```
66
+
67
+ A bundled app imports it: `import "@johnmorrisdotca/wakusei-planets/element"` (and `import { lineSvg } from "@johnmorrisdotca/wakusei-planets"` for the SVG string, which needs no browser). For the shaded look add the body's own entry point, `import "@johnmorrisdotca/wakusei-planets/jupiter"`, and `three` (an optional peer).
68
+
69
+ ## Three looks
70
+
71
+ | Look | What it is | Needs |
72
+ |---|---|---|
73
+ | `line` | A clean outline drawing with the body's key features: bands, craters, rings and their gaps, caps, the dark side dashed off. An SVG. | nothing |
74
+ | `realistic` | A shaded sphere drawn from the body's real colours and features, lit from the Sun's side, with the rings casting shadows. No pictures: the surface is worked out in a shader. | `three`, the body's entry point |
75
+ | `painted` | A real surface map from public-domain NASA, USGS and JPL imagery. Small pictures first (1.31 MB for all of them in the package), a sharper one fetched when you zoom in. | `three`, the body's entry point |
76
+
77
+ Every body has its real size relative to the others (`scale-to="jupiter"`), its axial tilt and its rotation. The Sun, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto are drawn, and so are 25 moons (the Moon, Phobos and Deimos, the four Galilean moons, Saturn's seven larger moons, Uranus's five, Proteus, Triton and Nereid, Charon, Nix and Hydra). The Earth is [chikyu-earth](https://github.com/johnmorrisdotca/chikyu-earth)'s own globe, not a second copy: `import "@johnmorrisdotca/wakusei-planets/earth"` (it needs `@johnmorrisdotca/chikyu-earth` installed). The painted looks cover the Sun, the planets from Mercury to Pluto, the Moon, the four Galilean moons, Titan, Rhea, Enceladus and Mimas, and Saturn's rings are Cassini's own picture of them.
78
+
79
+ ## As the Earth sees it
80
+
81
+ Give a body a `time` and it is drawn as the sky shows it then: its pole and rotation, how far the rings are open (Saturn's rings are edge-on in March 2025), the phase of the Moon or Venus, the Sun's direction.
82
+
83
+ ```html
84
+ <wakusei-body body="saturn" look="realistic" time="2026-11-02T12:00:00Z"></wakusei-body>
85
+ ```
86
+
87
+ ## Every way to use it
88
+
89
+ | How | Where |
90
+ |---|---|
91
+ | A script tag from jsDelivr or unpkg, a shaded body from a CDN | [CDN guide](docs/guides/html-and-cdn.md) |
92
+ | An ES module in Vite or webpack, only the bodies you need | [bundlers guide](docs/guides/bundlers.md) |
93
+ | React, Vue, Svelte, Angular; Next.js, Nuxt, SvelteKit | [frameworks guide](docs/guides/frameworks.md) |
94
+ | An `<iframe>` of the embed page, no script of your own | [iframe guide](docs/guides/embed-in-an-iframe.md) |
95
+ | TypeScript types, an SVG string on a server, Node | [TypeScript and Node guide](docs/guides/typescript-and-node.md) |
96
+ | The looks, the entry points, one WebGL context | [looks and bodies](docs/guides/looks-and-bodies.md) |
97
+ | Moons where they are on a date, time that runs fast | [moons and time](docs/guides/moons-and-time.md) |
98
+ | Something does not appear | [troubleshooting](docs/guides/troubleshooting.md) |
99
+
100
+ The guides are also in Japanese (日本語), one language to a page: [docs/guides/ja/](docs/guides/ja/getting-started.md).
101
+
102
+ In React, with the browser-only import where a server render never reaches it:
103
+
104
+ ```tsx
105
+ import { useEffect } from "react";
106
+
107
+ export function WakuseiBody({ body = "saturn", look = "line" }: { body?: string; look?: "line" | "realistic" }) {
108
+ useEffect(() => {
109
+ // The element needs a browser, so it is imported here, never at the top of the file: a server render never reaches an effect.
110
+ void import("@johnmorrisdotca/wakusei-planets/element");
111
+ void import("@johnmorrisdotca/wakusei-planets/all");
112
+ }, []);
113
+ return <wakusei-body body={body} look={look} />;
114
+ }
115
+ ```
116
+
117
+ Vue, Svelte and Angular components, the Vite and webpack setups and an `<iframe>` are in the guides, each one built and opened in a browser by `pnpm test:usage`.
118
+
119
+ ## Light by design
120
+
121
+ A page full of bodies stays light: one WebGL context for the page through kazoku-ui's shared renderer (the body in focus is live, the others are pictures), nothing drawn while nothing changes, at most thirty frames a second while it moves, a canvas held to 4096 pixels a side and six million pixels, everything freed when an element leaves, no drawing out of sight or in a hidden tab, no movement for a reader who prefers reduced motion, and a lost WebGL context coming back by itself. The tests count draws, animation frames, contexts and GPU objects at rest and over many changes (`pnpm test:freeze`, and a soak with `pnpm test:soak`).
122
+
123
+ ## The element
124
+
125
+ | Attribute | What it does | Default |
126
+ | --- | --- | --- |
127
+ | `body` | The body's name. | `earth` |
128
+ | `look` | `line`, `realistic` or `painted`. | `line` |
129
+ | `size` | The width in pixels. | `320` |
130
+ | `time` | `now` or an ISO date: the body as the Earth sees it then. Left out, a portrait. | portrait |
131
+ | `moons` | A planet with its moons on their orbits (with a date). | off |
132
+ | `rate` | Simulated seconds for each real second. | `1` |
133
+ | `turn` | A portrait turns this many degrees a second. | `0` |
134
+ | `tilt`, `pitch`, `phase`, `meridian` | A portrait's pose in degrees. | the body's own |
135
+ | `scale-to` | Draw to scale with another body. | fills its box |
136
+ | `live` | `always`, `hover` or `off`: when a shaded body takes the page's one WebGL context. | `always` |
137
+ | `lang` | `en` or `ja` for names and labels. | `en` |
138
+
139
+ The pure side has no DOM: `BODIES`, `apparent(id, time)`, `system(planet, time)`, `orbitPath`, `portrait` and `lineSvg(id, options)`.
140
+
141
+ ## The data
142
+
143
+ Sizes, flattening, poles and rotation are the IAU's and NASA's; planet positions are JPL's approximate elements; the Moon's are Meeus's largest terms; the other moons are JPL's mean elements. Nothing is fetched at run time by the line and shaded looks, which use no pictures. See [NOTICE.md](NOTICE.md).
144
+
145
+ ## The name
146
+
147
+ Wakusei (惑星, わくせい) is Japanese for a planet.
148
+
149
+ ## The family
150
+
151
+ <!-- family:start (made by scripts/family-readme.mjs from scripts/family-template.mjs; change those, not this) -->
152
+ Wakusei Planets is one of thirty-four packages, each made for the same site, each at
153
+ [github.com/johnmorrisdotca](https://github.com/johnmorrisdotca) or [github.com/spxis](https://github.com/spxis). The code of every one is MIT.
154
+
155
+ **Games — board**
156
+
157
+ - [Domino](https://github.com/johnmorrisdotca/domino) (ドミノ): dominoes and Mexican Train. [Demo](https://johnmorrisdotca.github.io/domino/).
158
+ - [Gunjin](https://github.com/johnmorrisdotca/gunjin) (軍人): five hidden-rank strategy games with pass-the-device play. [Demo](https://johnmorrisdotca.github.io/gunjin/).
159
+ - [Narabe](https://github.com/johnmorrisdotca/narabe) (並べ): one rules engine for abstract board games, from gomoku and Reversi to Go and checkers. [Demo](https://johnmorrisdotca.github.io/narabe/).
160
+ - [Sugoroku](https://github.com/johnmorrisdotca/sugoroku) (双六): backgammon and its variants, with the doubling cube and match play. [Demo](https://johnmorrisdotca.github.io/sugoroku/).
161
+ - [Tenka](https://github.com/johnmorrisdotca/tenka) (天下): world conquest for two to six, on a map of the real world. [Demo](https://johnmorrisdotca.github.io/tenka/).
162
+
163
+ **Games — cards & tiles**
164
+
165
+ - [Hitotsu](https://github.com/johnmorrisdotca/hitotsu) (一つ): a colour-card shedding game for two to eight, with the house rules people play. [Demo](https://johnmorrisdotca.github.io/hitotsu/).
166
+ - [Jarajara](https://github.com/johnmorrisdotca/jarajara) (ジャラジャラ): mahjong tiles drawn as SVG, stacked layouts, and the matching solitaire Awase. [Demo](https://johnmorrisdotca.github.io/jarajara/).
167
+ - [Kumimoji](https://github.com/johnmorrisdotca/kumimoji) (組み文字): a crossword tile race, in English and Japanese kana. [Demo](https://johnmorrisdotca.github.io/kumimoji/).
168
+ - [Toranpu](https://github.com/johnmorrisdotca/toranpu) (トランプ): a deck of playing cards, card games with computer players, and solitaires. [Demo](https://johnmorrisdotca.github.io/toranpu/).
169
+
170
+ **Games — puzzles**
171
+
172
+ - [Houseki](https://github.com/johnmorrisdotca/houseki) (宝石): gem and stone matching puzzles: falling triplets, stone collapse, colour chains and gem swap. [Demo](https://johnmorrisdotca.github.io/houseki/).
173
+ - [Jirai](https://github.com/johnmorrisdotca/jirai) (地雷): minesweeper on shaped grids with verified no-guess boards. [Demo](https://johnmorrisdotca.github.io/jirai/).
174
+ - [Karakuri](https://github.com/johnmorrisdotca/karakuri) (からくり): eight hyper-casual puzzle games, some of them physics: draw a shield, pull pins, cut ropes, slide blocks, pour tubes. [Demo](https://johnmorrisdotca.github.io/karakuri/).
175
+ - [Kazu](https://github.com/johnmorrisdotca/kazu) (数): grid number puzzles: Sudoku and its variants, Futoshiki and Skyscrapers. [Demo](https://johnmorrisdotca.github.io/kazu/).
176
+ - [Kyuubu](https://github.com/johnmorrisdotca/kyuubu) (キューブ): a turning cube for the browser, 2×2 to 7×7, with record solves to replay. [Demo](https://johnmorrisdotca.github.io/kyuubu/).
177
+ - [Meikyuu](https://github.com/johnmorrisdotca/meikyuu) (迷宮): mazes on squares, hexagons, triangles and circles, made from a seed and drawn through with a finger or the mouse. [Demo](https://johnmorrisdotca.github.io/meikyuu/).
178
+ - [Suido](https://github.com/johnmorrisdotca/suido) (水道): a pipe puzzle: turn the pieces until the water reaches every drain. [Demo](https://johnmorrisdotca.github.io/suido/).
179
+ - [Tobiishi](https://github.com/johnmorrisdotca/tobiishi) (飛び石): peg solitaire with nine boards and seeded solvable challenges. [Demo](https://johnmorrisdotca.github.io/tobiishi/).
180
+ - [Tsunagi](https://github.com/johnmorrisdotca/tsunagi) (繋ぎ): a line-joining logic puzzle whose every level has exactly one answer. [Demo](https://johnmorrisdotca.github.io/tsunagi/).
181
+
182
+ **Games — dice & random**
183
+
184
+ - [Korokoro](https://github.com/johnmorrisdotca/korokoro) (コロコロ): dice, with notation, exact odds, real sounds and the dice of many games. [Demo](https://johnmorrisdotca.github.io/korokoro/).
185
+ - [Tane](https://github.com/johnmorrisdotca/tane) (種): seeded random numbers and daily seeds, the same in every browser and on every server. [Demo](https://johnmorrisdotca.github.io/tane/).
186
+
187
+ **Language**
188
+
189
+ - [Bushu](https://github.com/johnmorrisdotca/bushu) (部首): find a kanji by the parts it is made of. [Demo](https://johnmorrisdotca.github.io/bushu/).
190
+ - [Hikidashi](https://github.com/johnmorrisdotca/hikidashi) (引き出し): a drawer of small Japanese text tools: era dates, kanji numerals, readings and sentence difficulty. [Demo](https://johnmorrisdotca.github.io/hikidashi/).
191
+ - [Kotoba](https://github.com/johnmorrisdotca/kotoba) (言葉): word lists and word-game rules in English, French, German and Japanese. [Demo](https://johnmorrisdotca.github.io/kotoba/).
192
+
193
+ **Geography & data**
194
+
195
+ - [address-plus](https://github.com/johnmorrisdotca/address-plus) (アドレスプラス): parse and format addresses in the United States, Canada, Japan, Australia, France, Germany and the United Kingdom. [Demo](https://johnmorrisdotca.github.io/address-plus/).
196
+ - [Chikyu Earth](https://github.com/johnmorrisdotca/chikyu-earth) (地球): a line-drawn globe that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place. [Demo](https://johnmorrisdotca.github.io/chikyu-earth/).
197
+ - [Chizu](https://github.com/johnmorrisdotca/chizu) (地図): maps of the world and of countries' regions, in English and Japanese, with a quiz and callouts. [Demo](https://johnmorrisdotca.github.io/chizu/).
198
+ - [Hata](https://github.com/johnmorrisdotca/hata) (旗): country and regional flags as SVG, at their true proportions and keyed by ISO code. [Demo](https://johnmorrisdotca.github.io/hata/).
199
+ - [Kuni](https://github.com/johnmorrisdotca/kuni) (国): countries and their regions, with ISO codes and names in English and Japanese. [Demo](https://johnmorrisdotca.github.io/kuni/).
200
+ - [Wakusei Planets](https://github.com/johnmorrisdotca/wakusei-planets) (惑星): the Sun, the planets and their moons, as line drawings, shaded drawings and painted surface maps, with their real sizes, tilt and rotation. [Demo](https://johnmorrisdotca.github.io/wakusei-planets/).
201
+
202
+ **Sports**
203
+
204
+ - [Dougu Sports](https://github.com/johnmorrisdotca/dougu-sports) (道具): sports emblems as SVG: trophies, medals, crests, and the ball and gear of every sport, with optional 3D turning. [Demo](https://johnmorrisdotca.github.io/dougu-sports/).
205
+ - [Kyogijo Stadiums](https://github.com/johnmorrisdotca/kyogijo-stadiums) (競技場): sports fields, rinks, courts and ballparks drawn to scale as SVG, with each team and the score on them. [Demo](https://johnmorrisdotca.github.io/kyogijo-stadiums/).
206
+ - [Senshu Jerseys](https://github.com/johnmorrisdotca/senshu-jerseys) (選手): sports jerseys, sweaters, kits, caps, helmets and retired-number banners as SVG, front and back, with optional 2.5D turning. [Demo](https://johnmorrisdotca.github.io/senshu-jerseys/).
207
+ - [Taisen Brackets](https://github.com/johnmorrisdotca/taisen-brackets) (対戦): a sport-agnostic tournament bracket, drawn as SVG, from a list of ties. [Demo](https://johnmorrisdotca.github.io/taisen-brackets/).
208
+
209
+ **Developer tools**
210
+
211
+ - [REST in Pieces](https://github.com/spxis/rest-in-pieces) (レスト・イン・ピーシーズ): seeded test data and REST APIs for frontend development, with latency and error drills. [Demo](https://spxis.github.io/rest-in-pieces/).
212
+
213
+
214
+ **This package is Wakusei Planets.** The demos of all thirty-four share one header and footer, so each links the rest.
215
+ <!-- family:end -->
@@ -0,0 +1,16 @@
1
+ import "./sun.ts";
2
+ import "./mercury.ts";
3
+ import "./venus.ts";
4
+ import "./mars.ts";
5
+ import "./jupiter.ts";
6
+ import "./saturn.ts";
7
+ import "./uranus.ts";
8
+ import "./neptune.ts";
9
+ import "./pluto.ts";
10
+ import "./moons-earth.ts";
11
+ import "./moons-mars.ts";
12
+ import "./moons-jupiter.ts";
13
+ import "./moons-saturn.ts";
14
+ import "./moons-uranus.ts";
15
+ import "./moons-neptune.ts";
16
+ import "./moons-pluto.ts";
@@ -0,0 +1,16 @@
1
+ import "./sun.js";
2
+ import "./mercury.js";
3
+ import "./venus.js";
4
+ import "./mars.js";
5
+ import "./jupiter.js";
6
+ import "./saturn.js";
7
+ import "./uranus.js";
8
+ import "./neptune.js";
9
+ import "./pluto.js";
10
+ import "./moons-earth.js";
11
+ import "./moons-mars.js";
12
+ import "./moons-jupiter.js";
13
+ import "./moons-saturn.js";
14
+ import "./moons-uranus.js";
15
+ import "./moons-neptune.js";
16
+ import "./moons-pluto.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { delegates } from "../scene/store.js";
2
+ // The Earth is drawn by chikyu-earth's own elements, not a second copy of them: the line globe with the countries, and the Earth from space with the real Sun, clouds and night lights.
3
+ // chikyu-earth is an optional peer, loaded only when an Earth is drawn.
4
+ const CENTRE = "10,20";
5
+ delegates.set("earth", {
6
+ async line({ center, size }) {
7
+ await import("@johnmorrisdotca/chikyu-earth/element");
8
+ const globe = document.createElement("chikyu-earth");
9
+ globe.setAttribute("center", center || CENTRE);
10
+ globe.setAttribute("look", "line");
11
+ globe.setAttribute("size", String(size));
12
+ return globe;
13
+ },
14
+ async live({ center, time, textureBase }) {
15
+ await import("@johnmorrisdotca/chikyu-earth/realistic/element");
16
+ const earth = document.createElement("chikyu-earth-realistic");
17
+ earth.setAttribute("center", center || CENTRE);
18
+ earth.setAttribute("time", time);
19
+ if (textureBase !== null)
20
+ earth.setAttribute("texture-base", textureBase);
21
+ return earth;
22
+ },
23
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import { registerLook } from "../scene/look.js";
2
+ import { gas } from "../scene/recipes.js";
3
+ registerLook({
4
+ id: "jupiter",
5
+ surface: gas({
6
+ stops: [[-90, "#6f685f"], [-70, "#8f8070"], [-58, "#b9a48a"], [-48, "#a98d72"], [-40, "#e2d3bb"], [-32, "#b58b6c"], [-26, "#e5d6bf"], [-19, "#b2704f"], [-12, "#c98a62"], [-6, "#ecdcbc"], [0, "#efdfb8"], [6, "#e8d4ae"], [10, "#a96b4d"], [16, "#b97c58"], [21, "#e9dac0"], [27, "#b9916f"], [33, "#ead9bf"], [40, "#a98873"], [50, "#d2bfa2"], [60, "#a49080"], [70, "#8a7b6e"], [90, "#6c6560"]],
7
+ turbulence: 0.05,
8
+ streaks: 0.22,
9
+ plateau: 0.22,
10
+ extra: `
11
+ float spot = oval(p, -48.0, -22.0, 9.5, 6.0, 0.55);
12
+ float halo = oval(p, -48.0, -22.0, 14.0, 9.0, 0.5) - spot;
13
+ vec3 spotCol = mix(vec3(0.70, 0.31, 0.20), vec3(0.86, 0.52, 0.36), fbm(p * 16.0 + 2.0));
14
+ col = mix(col, col * 0.78, clamp(halo, 0.0, 1.0) * 0.5);
15
+ col = mix(col, spotCol, spot);
16
+ float oval2 = oval(p, -70.0, -33.0, 3.0, 2.2, 0.5);
17
+ col = mix(col, vec3(0.93, 0.88, 0.80), oval2 * 0.8);`,
18
+ }),
19
+ atmosphere: { colour: [0.75, 0.7, 0.62], strength: 0.12, power: 3.5 },
20
+ limb: 0.45,
21
+ painted: { map: "jupiter", widths: [512, 1024, 2048], far: 2048, relief: 0 },
22
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import { registerLook } from "../scene/look.js";
2
+ registerLook({
3
+ id: "mars",
4
+ surface: `
5
+ vec4 surface(vec3 p) {
6
+ float h = craters(p, 4.0, 0.4, 2.0) * 0.8 + craters(p, 12.0, 0.4, 9.0) * 0.4;
7
+ float la = lat(p);
8
+ float dk = smoothstep(0.5, 0.64, fbm(p * 2.1 + 7.0) + 0.14 * (1.0 - abs(la + 0.3) * 1.7));
9
+ dk = max(dk, oval(p, 70.0, 8.0, 16.0, 11.0, 0.6) * 0.95);
10
+ vec3 col = mix(vec3(0.80, 0.47, 0.26), vec3(0.34, 0.20, 0.15), dk * 0.85);
11
+ col = mix(col, vec3(0.88, 0.62, 0.40), oval(p, 70.0, -42.0, 9.0, 9.0, 0.6) * 0.6);
12
+ col *= 0.9 + 0.22 * fbm(p * 11.0);
13
+ col *= 1.0 + 0.7 * h;
14
+ float valles = (1.0 - smoothstep(0.0, 0.03, abs(la + 0.12 + 0.05 * sin(lon(p) * 2.0)))) * oval(p, -75.0, -10.0, 35.0, 12.0, 0.5);
15
+ col = mix(col, vec3(0.30, 0.17, 0.13), valles * 0.7);
16
+ float wob = (fbm(p * 7.0) - 0.5) * 0.14;
17
+ float cap = smoothstep(radians(79.0), radians(83.0), abs(la) + wob);
18
+ col = mix(col, vec3(0.96, 0.96, 0.98), cap);
19
+ return vec4(col, h);
20
+ }`,
21
+ atmosphere: { colour: [0.85, 0.6, 0.45], strength: 0.16, power: 4 },
22
+ relief: 0.7,
23
+ ambient: 0.03,
24
+ painted: { map: "mars", widths: [512, 1024, 2048], far: 2048 },
25
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { registerLook } from "../scene/look.js";
2
+ import { rock } from "../scene/recipes.js";
3
+ registerLook({
4
+ id: "mercury",
5
+ surface: rock({ dark: "#4f4a46", light: "#a6a09a", craters: 0.9, contrast: 0.8, seed: 2, patches: 1.8, extra: "col *= 1.0 + 0.5 * smoothstep(0.05, 0.25, h);" }),
6
+ relief: 0.9,
7
+ ambient: 0.03,
8
+ painted: { map: "mercury", widths: [512, 1024, 2048], far: 2048 },
9
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import { registerLook } from "../scene/look.js";
2
+ import { rock } from "../scene/recipes.js";
3
+ registerLook({
4
+ id: "moon",
5
+ surface: rock({
6
+ dark: "#77746f",
7
+ light: "#b9b5ad",
8
+ craters: 0.65,
9
+ contrast: 0.5,
10
+ seed: 3,
11
+ patches: 3,
12
+ extra: `
13
+ float edge = (fbm(p * 7.0 + 2.0) - 0.5) * 0.35;
14
+ float m = 0.0;
15
+ m = max(m, oval(p, -15.0 + 6.0 * edge, 35.0, 24.0, 15.0, 0.35 + edge));
16
+ m = max(m, oval(p, 18.0, 28.0, 11.0, 9.0, 0.4));
17
+ m = max(m, oval(p, 31.0, 8.0, 14.0, 11.0, 0.4));
18
+ m = max(m, oval(p, 59.0, 17.0, 8.0, 7.0, 0.4));
19
+ m = max(m, oval(p, 52.0, -4.0, 10.0, 10.0, 0.4));
20
+ m = max(m, oval(p, -16.0, -21.0, 11.0, 8.0, 0.4));
21
+ m = max(m, oval(p, -39.0, -24.0, 6.0, 6.0, 0.4));
22
+ m = max(m, oval(p, -57.0, 12.0, 14.0, 26.0, 0.4 + edge));
23
+ m = max(m, oval(p, 4.0, 13.0, 7.0, 6.0, 0.4));
24
+ m = max(m, oval(p, 35.0, -15.0, 6.0, 6.0, 0.4));
25
+ m = max(m, oval(p, 0.0, 58.0, 40.0, 5.0, 0.5) * 0.75);
26
+ m *= 0.85 + 0.3 * fbm(p * 5.0);
27
+ col = mix(col, vec3(0.31, 0.31, 0.33), clamp(m, 0.0, 1.0) * 0.92);
28
+ h *= 1.0 - clamp(m, 0.0, 1.0) * 0.75;
29
+ float tycho = acos(clamp(dot(p, dirOf(-11.0, -43.0)), -1.0, 1.0));
30
+ float ray = smoothstep(1.0, 0.04, tycho) * (0.35 + 0.65 * smoothstep(0.5, 0.8, fbm(vec3(atan(p.z + 0.68, p.y + 0.2) * 2.4, tycho * 3.0, 1.7))));
31
+ col = mix(col, vec3(0.95, 0.94, 0.92), ray * 0.45 * smoothstep(0.02, 0.2, tycho) * (1.0 - m));
32
+ col = mix(col, vec3(0.97), smoothstep(0.035, 0.0, tycho) * 0.8);`,
33
+ }),
34
+ relief: 0.8,
35
+ ambient: 0.02,
36
+ painted: { map: "moon", widths: [512, 1024, 2048], far: 2048 },
37
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ import { registerLook } from "../scene/look.js";
2
+ import { ice, rock } from "../scene/recipes.js";
3
+ registerLook({
4
+ id: "io",
5
+ surface: `
6
+ vec4 surface(vec3 p) {
7
+ float n = fbm(p * 3.0 + 1.0);
8
+ float m = fbm(p * 9.0 + 4.0);
9
+ vec3 col = mix(vec3(0.93, 0.83, 0.34), vec3(0.98, 0.93, 0.62), n);
10
+ col = mix(col, vec3(0.86, 0.46, 0.17), smoothstep(0.52, 0.74, m) * 0.75);
11
+ col = mix(col, vec3(0.96, 0.96, 0.92), smoothstep(0.68, 0.85, fbm(p * 5.0 + 8.0)) * 0.65);
12
+ float c = -craters(p, 6.5, 1.0, 21.0);
13
+ col = mix(col, vec3(0.20, 0.12, 0.07), smoothstep(0.06, 0.26, c) * 0.8);
14
+ float pele = oval(p, 105.0, -19.0, 13.0, 13.0, 0.5) - oval(p, 105.0, -19.0, 6.0, 6.0, 0.5);
15
+ col = mix(col, vec3(0.78, 0.2, 0.1), clamp(pele, 0.0, 1.0) * 0.55);
16
+ return vec4(col, 0.0);
17
+ }`,
18
+ ambient: 0.02,
19
+ painted: { map: "io", widths: [512, 1024, 2048], far: 2048 },
20
+ });
21
+ registerLook({ id: "europa", surface: ice({ base: "#e9e0cd", stain: "#a2623e", cracks: 0.85, craters: 0.2 }), ambient: 0.02, painted: { map: "europa", widths: [512, 1024] } });
22
+ registerLook({
23
+ id: "ganymede",
24
+ surface: rock({ dark: "#5f5448", light: "#b6aa99", craters: 0.9, contrast: 0.9, seed: 12, patches: 3.4, extra: "col = mix(col, vec3(0.30, 0.25, 0.21), oval(p, -140.0, 20.0, 38.0, 50.0, 0.4) * 0.7); col += vec3(0.28) * smoothstep(0.05, 0.2, -h) * 0.6;" }),
25
+ relief: 0.6,
26
+ ambient: 0.02,
27
+ painted: { map: "ganymede", widths: [512, 1024, 2048], far: 2048 },
28
+ });
29
+ registerLook({ id: "callisto", surface: rock({ dark: "#3f3832", light: "#7d7265", craters: 1.8, contrast: 0.9, seed: 21, patches: 3.2, extra: "col += vec3(0.4, 0.4, 0.42) * smoothstep(0.05, 0.22, -h);" }), relief: 0.9, ambient: 0.02, painted: { map: "callisto", widths: [512, 1024, 2048], far: 2048 } });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { registerLook } from "../scene/look.js";
2
+ import { rock } from "../scene/recipes.js";
3
+ registerLook({ id: "phobos", surface: rock({ dark: "#4d4844", light: "#8a847d", craters: 2, contrast: 1.2, seed: 8, extra: "h += bowl(p, -49.0, 1.0, 22.0, 0.45); col *= 1.0 + 0.5 * bowl(p, -49.0, 1.0, 22.0, 0.45);" }), relief: 1, ambient: 0.02 });
4
+ registerLook({ id: "deimos", surface: rock({ dark: "#6d665f", light: "#a39a8f", craters: 0.9, contrast: 0.6, seed: 4, patches: 3 }), relief: 0.7, ambient: 0.02 });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { registerLook } from "../scene/look.js";
2
+ import { ice, rock } from "../scene/recipes.js";
3
+ registerLook({ id: "proteus", surface: rock({ dark: "#45433f", light: "#6f6c68", craters: 1.8, contrast: 0.9, seed: 33 }), relief: 0.9, ambient: 0.02 });
4
+ registerLook({
5
+ id: "triton",
6
+ surface: ice({ base: "#e8d8cb", stain: "#8b6f62", craters: 0.2, extra: "col = mix(col, vec3(0.95, 0.88, 0.84), smoothstep(radians(-20.0), radians(-60.0), lat(p)) * 0.8); float cant = fbm(p * 14.0); col *= 0.92 + 0.16 * cant;" }),
7
+ atmosphere: { colour: [0.8, 0.8, 0.9], strength: 0.05, power: 5 },
8
+ ambient: 0.025,
9
+ relief: 0.4,
10
+ });
11
+ registerLook({ id: "nereid", surface: rock({ dark: "#6e6e6e", light: "#9b9b9b", craters: 1, seed: 40 }), relief: 0.8, ambient: 0.02 });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { registerLook } from "../scene/look.js";
2
+ import { rock } from "../scene/recipes.js";
3
+ registerLook({ id: "charon", surface: rock({ dark: "#756f6a", light: "#aaa29a", craters: 0.7, contrast: 0.7, seed: 41, extra: "col = mix(col, vec3(0.42, 0.20, 0.13), smoothstep(radians(52.0), radians(78.0), lat(p)) * 0.85);" }), relief: 0.6, ambient: 0.02 });
4
+ registerLook({ id: "nix", surface: rock({ dark: "#8d8983", light: "#c9c3b9", craters: 1, contrast: 0.7, seed: 43 }), relief: 0.7, ambient: 0.02 });
5
+ registerLook({ id: "hydra", surface: rock({ dark: "#9e9a92", light: "#d4cec4", craters: 1, contrast: 0.7, seed: 47 }), relief: 0.7, ambient: 0.02 });
@@ -0,0 +1 @@
1
+ export {};