Created
May 24, 2017 06:58
-
-
Save iondune/ebb132bec885422314a0252c776e597b to your computer and use it in GitHub Desktop.
Unit tests for schlick's approximation
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
TEST_CASE("shlick's approximation") | |
{ | |
CHECK(CRayTracerMath::SchlicksApproximation(1.02f, vec3f(0, 1, 0), vec3f(0, 1, 0)) == Approx(0.0001f)); | |
CHECK(CRayTracerMath::SchlicksApproximation(1.02f, vec3f(0, 1, 0), vec3f(0.707107f, 0.707107f, 0)) == Approx(0.00225f)); | |
CHECK(CRayTracerMath::SchlicksApproximation(1.02f, vec3f(0, 1, 0), vec3f(0.866025f, 0.5f, 0)) == Approx(0.03134f)); | |
CHECK(CRayTracerMath::SchlicksApproximation(1.02f, vec3f(0, 1, 0), vec3f(0.965926f, 0.258819f, 0)) == Approx(0.22375f)); | |
CHECK(CRayTracerMath::SchlicksApproximation(1.02f, vec3f(0, 1, 0), vec3f(0.996195f, 0.087156f, 0)) == Approx(0.63388f)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment