diff --git a/README.md b/README.md index 50eedf7..6d44154 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ mkdir -p output/imgs --duration 2 --fps 30 --proper-acceleration 1.52 ./build/minkowski_sky --observer-track output/minkowski_accel_2s.csv \ --frames-dir output/imgs --frames-prefix minkowski_accel \ - --start-time 0 --duration 2 --fps 30 + --start-time 0 --duration 2 --fps 30 --exposure 1e-5 ``` This writes `minkowski_accel_000000.png` through @@ -47,7 +47,10 @@ This writes `minkowski_accel_000000.png` through input; the acceleration generator is only a reproducible flat-spacetime test fixture. The current movie path still renders frames independently while the time-slab/RayPool scheduler is implemented next, so it must not yet be used -as a performance measurement for numerical-relativity data. +as a performance measurement for numerical-relativity data. Movie mode uses +the same `1e-5` exposure by default when `--exposure` is omitted; this differs +from the legacy single-frame default so the accelerated test catalog does not +clip to white. PNG output is optional so the default build has no `libpng` dependency. Build with `make ENABLE_PNG=1`, then select it with a `.png` output path: diff --git a/src/main.c b/src/main.c index a3b4411..a089ff1 100644 --- a/src/main.c +++ b/src/main.c @@ -17,6 +17,7 @@ typedef struct { int width, height; int coarse_cell_pixels; int draw_mesh; + int exposure_was_set; double horizontal_fov_deg, look_ra_deg, look_dec_deg, exposure; double observer_inward_speed; PointSpreadFunction psf; @@ -127,6 +128,7 @@ static int parse_args(int argc, char **argv, Settings *s, !parse_dec_deg(argv[++i], &s->look_dec_deg)) { } else if (!strcmp(argv[i], "--exposure") && i + 1 < argc && !parse_positive(argv[++i], &s->exposure)) { + s->exposure_was_set = 1; } else if (!strcmp(argv[i], "--observer-inward-speed") && i + 1 < argc && !parse_speed(argv[++i], &s->observer_inward_speed)) { } else if (!strcmp(argv[i], "--psf-fwhm-pixels") && i + 1 < argc && @@ -233,7 +235,14 @@ static int render_movie(const Settings *s, const StarCatalog *catalog, const SpacetimeSource *spacetime) { ObserverTrack track = {0}; Movie movie = {0}; + Settings frame_settings = *s; int result = -1; + /* The single-image sky fixture historically used an exposure intended for + * static inspection. A near-light-speed movie makes it clip immediately; + * retain that single-frame default but choose a legible, fixed test exposure + * for sequences unless the caller explicitly supplied --exposure. */ + if (!frame_settings.exposure_was_set) + frame_settings.exposure = 1e-5; if (s->observer_track_path == NULL || observer_track_load_csv(&track, s->observer_track_path) || movie_init(&movie, &track, s->movie_start_time, s->movie_duration, @@ -242,8 +251,8 @@ static int render_movie(const Settings *s, const StarCatalog *catalog, for (size_t i = 0; i < movie.frame_count; ++i) { char output_path[PATH_MAX]; if (frame_output_path(output_path, s, movie.frames[i].frame_id) || - render_observer_frame(s, catalog, spacetime, &movie.frames[i].observer, - output_path)) + render_observer_frame(&frame_settings, catalog, spacetime, + &movie.frames[i].observer, output_path)) goto done; } result = 0;