bevy_elements 0.6.0

Living environments for Bevy: sun, moon and stars, climate-driven weather, GPU wind, volumetric clouds, rain, snow and fog, lightning, terrain with hydraulic and thermal erosion, flooding, snow cover, wetness and dust — simulated in compute shaders.
Documentation
# Provenance of the data in `src/celestial/`

Two binary files ship in this directory. Both are generated by programs in `tools/` from public sources, never edited by hand. The licensing reasoning is in `docs/research/celestial.md` §Data licensing; this file records the sources, terms, credit lines, record formats and the exact regeneration commands.

| file | bytes | generator | source |
|---|---|---|---|
| `stars.bin` | 134 464 (8404 × 16) | `tools/src/bin/gen_stars.rs` | Yale Bright Star Catalogue, 5th revised ed. (CDS V/50) |
| `moon_albedo.r8` | 131 072 (512 × 256) | `tools/src/bin/gen_moon.rs` | NASA SVS CGI Moon Kit, ID 4720 (`lroc_color_2k.jpg`) |

## `stars.bin` — Bright Star Catalogue

**Source.** Hoffleit & Warren, *The Bright Star Catalogue*, 5th revised edition (preliminary version), via the Centre de Données astronomiques de Strasbourg, catalogue V/50 (`catalog.gz`, 9110 records; original distribution NASA GSFC NSSDC/Astronomical Data Center, Yale University Observatory).
- File: https://cdsarc.cds.unistra.fr/ftp/cats/V/50/catalog.gz (573 921 bytes; sha256 `3dc44b1e90be8fbe5bcc7656032560f51275f985c7e3f783c9028e1838ec7bed`, fetched 2026-10-13)
- Byte layout: https://cdsarc.cds.unistra.fr/ftp/cats/V/50/ReadMe (sha256 `44fd9c73e2eecad0beb47bdfa3f01c60fd43f93d6964198e31fcd48732de5b33`)
- The same data, as derived and served by HEASARC: the `bsc5p` table, https://heasarc.gsfc.nasa.gov/W3Browse/star-catalog/bsc5p.html

**Terms.** HEASARC's data policy (https://heasarc.gsfc.nasa.gov/docs/heasarc/data_policy.html) states: "HEASARC materials are all available freely for your use." It asks only for a citation or acknowledgement in publications. The CDS `ReadMe` of V/50 contains description, byte layout and history, and no restriction on redistribution. The crate ships four `f32` per star (right ascension, declination, V magnitude, B−V): positions and magnitudes are astronomical facts, not creative expression, and the file is a derived binary of 8404 records. No file in the sources carries an explicit CC0 or public-domain notice; this is a reading of the sources, not legal advice. If that residual risk is unacceptable, replace the catalogue with the procedural generator named in the plan (seed `0x5EED_57A5`).

**Credit.** Hoffleit, D. & Warren, W. H. Jr., *The Bright Star Catalogue*, 5th Revised Ed. (preliminary version), via CDS (V/50) and NASA HEASARC.

**Record format.** Little-endian, 16 bytes per star, catalogue (HR number) order, no header:

| offset | type | field | unit |
|---|---|---|---|
| 0 | `f32` | right ascension, J2000 | rad, 0 to 2π |
| 4 | `f32` | declination, J2000 | rad, −π/2 to π/2 |
| 8 | `f32` | visual magnitude V | mag |
| 12 | `f32` | colour index B−V | mag |

Selection: a J2000 position is present (the catalogue's removed non-stars have none) and V ≤ 6.5. 244 of the 8404 stars have no catalogued B−V and carry 0.48 (the median of the 8160 catalogued values). Proper motion is dropped. Brightest record: Sirius, V −1.46. Source columns (1-based bytes, from the `ReadMe`): RA J2000 hours 76–77, minutes 78–79, seconds 80–83; Dec J2000 sign 84, degrees 85–86, arcminutes 87–88, arcseconds 89–90; Vmag 103–107; B−V 110–114.

**Regenerate.**

```sh
curl -fsSL -o /tmp/catalog.gz https://cdsarc.cds.unistra.fr/ftp/cats/V/50/catalog.gz
cargo run --manifest-path tools/Cargo.toml --bin gen_stars -- /tmp/catalog.gz src/celestial/stars.bin
```

Expected output: `8404 stars (V <= 6.5), 244 without B-V`.

## `moon_albedo.r8` — Moon map

**Source.** NASA Scientific Visualization Studio, *CGI Moon Kit* (SVS 4720), colour map `lroc_color_2k.jpg`, 2048 × 1024, sRGB, equirectangular, centred on 0° longitude. Built from the Lunar Reconnaissance Orbiter Camera (LROC) Wide Angle Camera Hapke-normalised mosaic, with the Lunar Orbiter Laser Altimeter (LOLA) LDAM elevation model used for the kit's displacement map.
- Page: https://svs.gsfc.nasa.gov/4720/
- File: https://svs.gsfc.nasa.gov/vis/a000000/a004700/a004720/lroc_color_2k.jpg (457 942 bytes; sha256 `f7130a1822681fa7512d7dcfd40db8c10b9ba4f06777910348698260ed7a2170`, fetched 2026-10-13)

**Terms.** NASA Images and Media Usage Guidelines, https://www.nasa.gov/nasa-brand-center/images-and-media/: NASA content, including "files used in the rendition of 3-dimensional models, such as texture maps", is "generally … not subject to copyright in the United States", "NASA should be acknowledged as the source", and use must not imply NASA's endorsement. The SVS page notes the map is optimised for aesthetics, not science (white balance and range were adjusted), which is why the crate calibrates the photometry on the disc mean instead of trusting texel values.

**Credit.** NASA's Scientific Visualization Studio. Visualizer: Ernie Wright (USRA). Scientist: Noah Petro (NASA/GSFC). Data: LRO LROC WAC and LOLA.

**Format.** Raw `u8`, no header, 512 × 256 = 131 072 bytes, row-major.
- Equirectangular, centred on 0° longitude. Row 0 is the north edge (latitude +90°), the last row the south edge. Column 0 is the west edge (longitude −180°), column 511 the east edge (+180°); longitude is east-positive (IAU).
- Texel `(col, row)` is centred on longitude `−180° + (col + 0.5) · 360°/512` and latitude `90° − (row + 0.5) · 180°/256`.
- Bytes are linear luminance, not sRGB. The shader reads them as an `R8Unorm` texture and computes the albedo `A = Ā · byte / 128`, with `Ā` = 4843·π/130000 = 0.117036 (`MOON_MEAN_ALBEDO`), the disc-mean albedo that makes the full moon's disc-mean luminance 4843 cd/m² (Krisciunas & Schaefer 1991 full-moon illuminance 0.31331 lx over the disc's solid angle). The research note rounds this to 0.117.

**Processing** (`gen_moon.rs`, in order):
1. Decode the JPEG; convert each sRGB channel to linear light; linear luminance `Y = 0.2126 R + 0.7152 G + 0.0722 B`.
2. Box-filter 4 × 4 to 512 × 256, in linear light.
3. Scale so that the mean texel over the **full-moon disc as seen from the sub-observer point** (latitude 0, longitude 0, north up; an orthographic disc, bilinear samples on a 1024 × 1024 grid of cells) is exactly 128 after rounding to `u8` and clipping at 255 (bisection on the scale; scale 322.603, disc mean 128.0000, 1475 texels = 1.1 % clipped at 255, mostly polar). The disc mean, rather than the mean over the equirectangular map, is what the full-moon calibration fixes; `src/celestial/moon.rs` re-computes it in a unit test with the same quadrature.

**Regenerate.**

```sh
curl -fsSL -o /tmp/lroc_color_2k.jpg https://svs.gsfc.nasa.gov/vis/a000000/a004700/a004720/lroc_color_2k.jpg
cargo run --release --manifest-path tools/Cargo.toml --bin gen_moon -- /tmp/lroc_color_2k.jpg src/celestial/moon_albedo.r8
```

Expected output: `512x256 -> src/celestial/moon_albedo.r8: scale 322.603, disc mean 128.0000/255, 1475 texels clipped, max 255`.

## Excluded from the published package

`tools/` is excluded from the crate (`exclude = ["tools/*"]`); `stars.bin`, `moon_albedo.r8` and this file ship.