CLI, along with several examples, plus model downloading

This commit is contained in:
connor committed 2026-10-14 18:01:49 -04:00
1 parent 4f9e73a418
commit 51ace681a7
22 files changed
+1804 -18

No files matched your search

+35 -1
View File
@@ -61,6 +61,35 @@ assert!(frame.dn_at(960, 540, 1) > 1000);
# }
```
## Command line
`resolved render` renders a scene described in TOML: camera overrides, the
observer, Sun and Moon positions (or an epoch, with the `astrokit` feature) and
targets with their models. `examples/scenes/` has commented examples:
`boxwing.toml` and `boxwing-epoch.toml` use a small generated model that is
in the repository, and the rest use NASA spacecraft models (Landsat 8,
ICESat-2, OSTM/Jason-2, an SSL-1300 and ACE) that `scripts/fetch-models.sh`
downloads into `examples/models/nasa/`. That script needs Node (for `npx`),
because most NASA models are Draco-compressed and are decoded on the way in.
```sh
cargo run --release -p resolved-cli -- render \
--scene examples/scenes/boxwing.toml \
--out frame.png --preview preview.png --timings 50
```
- `--out` writes raw DN as a 16-bit PNG, shifted up to fill 16 bits as
cameras usually store them: a 12-bit DN is the stored value divided by 16.
It is linear, so it looks dark next to the preview.
- `--preview` writes an 8-bit sRGB image for looking at, with the bias as
black and saturation as white.
- `--timings N` renders N frames and reports setup and per-frame times.
- `--adapter` takes `auto`, `gpu`, `cpu` or part of an adapter's name;
`resolved adapters` lists them.
- `--kernels DIR` says where astrokit's kernels are, for scenes given by
epoch. Without it the CLI tries `ASTROKIT_KERNELS`, then `data/kernels`,
then the sibling `../astrokit` checkout it was built against.
## Features
- `astrokit`: build a `Scene` from an epoch with
@@ -73,7 +102,8 @@ assert!(frame.dn_at(960, 540, 1) > 1000);
## Status
M1 in progress: the library renders Earth, Moon, Sun and targets to DN
through `Renderer`; the CLI and benchmarks are still to come. The work is
through `Renderer`, and the CLI renders scene files; benchmarks are still to
come. The work is
tracked as Gitea milestones, each split into one issue per change:
| Milestone | Scope |
@@ -96,6 +126,10 @@ tracked as Gitea milestones, each split into one issue per change:
- `crates/resolved`: the library.
- `crates/resolved-cli`: the `resolved` command, for rendering without writing
a host program.
- `examples/`: scene files and the box-wing model
(`scripts/make-example-model.py` regenerates it). The NASA scenes are
generated by `scripts/make-example-scenes.py`.
- `scripts/`: generators for compiled-in data and examples.
- `docs/optics.md`: the optics and radiometry the renderer models, explained
for readers without an optics background.