-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add proptest usage within ggx tests, along with some fixtures/prop_co…
…mpose invocations
- Loading branch information
1 parent
7025efc
commit e70b479
Showing
5 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Seeds for failure cases proptest has generated in the past. It is | ||
# automatically read and these particular cases re-run before any | ||
# novel cases are generated. | ||
# | ||
# It is recommended to check this file in to source control so that | ||
# everyone who runs the test benefits from these saved cases. | ||
cc 9c0ae291d4fb1b0b7461c99518df9126afd836caa7b93dadd6772b8c1f81fb26 # shrinks to roughness = 8.736748, wi = Vec3(0.54826164, 0.0, -0.83630687), lambda = 400.0, s = Sample2D { x: 0.0, y: 0.0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use math::{random::random_on_unit_sphere, sample::Sample2D, vec::Vec3}; | ||
use proptest::prelude::*; | ||
|
||
prop_compose! { | ||
pub fn uniform_sample()(u in 0.0..1.0f32, v in 0.0..1.0f32) -> Sample2D { | ||
Sample2D::new(u, v) | ||
} | ||
} | ||
|
||
prop_compose! { | ||
pub fn valid_ggx_roughness()(x in 0.0..1.0f32) -> f32 { | ||
(-(x+f32::EPSILON).ln()).recip() | ||
} | ||
} | ||
|
||
prop_compose! { | ||
pub fn unit_vector()(s in uniform_sample()) -> Vec3 { | ||
random_on_unit_sphere(s) | ||
} | ||
} |