Skip to content

Commit

Permalink
test-renderers: Add maximum_intensity to tone mapping test parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Jan 24, 2025
1 parent ecd59e6 commit e769b5b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 13 additions & 8 deletions test-renderers/src/test_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ pub fn all_tests(c: &mut TestCaseCollector<'_>) {
],
);
c.insert_variants(
"tone_mapping",
&u("tone_mapping", tone_mapping_test_universe()),
tone_mapping,
"tone_map",
&u("tone_map", tone_mapping_test_universe()),
tone_map,
[
(ToneMappingOperator::Clamp, 0.5),
(ToneMappingOperator::Clamp, 2.0),
(ToneMappingOperator::Reinhard, 0.5),
(ToneMappingOperator::Reinhard, 2.0),
(ToneMappingOperator::Clamp, 1.0, 0.5),
(ToneMappingOperator::Clamp, 1.0, 2.0),
(ToneMappingOperator::Reinhard, 1.0, 0.5),
(ToneMappingOperator::Reinhard, 0.5, 0.5),
(ToneMappingOperator::Reinhard, 1.0, 2.0),
],
);
c.insert_variants("transparent_one", &None, transparent_one, ["surf", "vol"]);
Expand Down Expand Up @@ -927,9 +928,13 @@ async fn template(mut context: RenderTestContext, template_name: &'static str) {
.await;
}

async fn tone_mapping(mut context: RenderTestContext, (tmo, exposure): (ToneMappingOperator, f32)) {
async fn tone_map(
mut context: RenderTestContext,
(tmo, maximum_intensity, exposure): (ToneMappingOperator, f32, f32),
) {
let mut options = tone_mapping_test_options();
options.tone_mapping = tmo;
options.maximum_intensity = ps32(maximum_intensity);
options.exposure = ExposureOption::Fixed(ps32(exposure));
let scene = StandardCameras::from_constant_for_test(
options,
Expand Down

0 comments on commit e769b5b

Please sign in to comment.