Skip to content

Commit

Permalink
Tone mapping in CLI scene rendering (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
xelatihy authored Jun 9, 2021
1 parent df22158 commit dabe9ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/yscene/yscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ int run_render(const render_params& params_) {
auto image = params.denoise ? get_denoised(state) : get_render(state);
auto ext = "-s" + std::to_string(sample) + path_extension(params.output);
auto outfilename = replace_extension(params.output, ext);
auto ioerror = ""s;
if (!is_hdr_filename(params.output))
image = tonemap_image(image, params.exposure, params.filmic);
auto ioerror = ""s;
if (!save_image(outfilename, image, ioerror)) print_fatal(ioerror);
}
print_progress_next();
Expand All @@ -248,6 +250,8 @@ int run_render(const render_params& params_) {
// save image
print_progress_begin("save image");
auto image = params.denoise ? get_denoised(state) : get_render(state);
if (!is_hdr_filename(params.output))
image = tonemap_image(image, params.exposure, params.filmic);
if (!save_image(params.output, image, ioerror)) return print_fatal(ioerror);
print_progress_end();

Expand Down

0 comments on commit dabe9ce

Please sign in to comment.