[FEAT] Add shadow support
This commit is contained in:
@@ -331,7 +331,7 @@ SCENARIO("Lighting with the eye between the light and the surface", "[features/m
|
||||
PointLight light = PointLight(Tuple::Point(0, 0, -10), Color(1, 1, 1));
|
||||
WHEN("result <- lighting(m, light, position, eyev, normalv)")
|
||||
{
|
||||
Color result = m.lighting(light, position, eyev, normalv);
|
||||
Color result = m.lighting(light, position, eyev, normalv, false);
|
||||
THEN("result = color(1.9, 1.9, 1.9)")
|
||||
{
|
||||
REQUIRE(result == Color(1.9, 1.9, 1.9));
|
||||
@@ -360,7 +360,7 @@ SCENARIO("Lighting with eye between the light & surface, eye offset 45°", "[fea
|
||||
PointLight light = PointLight(Tuple::Point(0, 0, -10), Color(1, 1, 1));
|
||||
WHEN("result <- lighting(m, light, position, eyev, normalv)")
|
||||
{
|
||||
Color result = m.lighting(light, position, eyev, normalv);
|
||||
Color result = m.lighting(light, position, eyev, normalv, false);
|
||||
THEN("result = color(1.0, 1.0, 1.0)")
|
||||
{
|
||||
REQUIRE(result == Color(1.0, 1.0, 1.0));
|
||||
@@ -389,7 +389,7 @@ SCENARIO("Lighting with the eye opposite surface, light offset 45°", "[features
|
||||
PointLight light = PointLight(Tuple::Point(0, 10, -10), Color(1, 1, 1));
|
||||
WHEN("result <- lighting(m, light, position, eyev, normalv)")
|
||||
{
|
||||
Color result = m.lighting(light, position, eyev, normalv);
|
||||
Color result = m.lighting(light, position, eyev, normalv, false);
|
||||
THEN("result = color(0.7364, 0.7364, 0.7364)")
|
||||
{
|
||||
REQUIRE(result == Color(0.7364, 0.7364, 0.7364));
|
||||
@@ -418,7 +418,7 @@ SCENARIO("Lighting with the eye in the path of the reflection vector", "[feature
|
||||
PointLight light = PointLight(Tuple::Point(0, 10, -10), Color(1, 1, 1));
|
||||
WHEN("result <- lighting(m, light, position, eyev, normalv)")
|
||||
{
|
||||
Color result = m.lighting(light, position, eyev, normalv);
|
||||
Color result = m.lighting(light, position, eyev, normalv, false);
|
||||
THEN("result = color(1.6364, 1.6364, 1.6364)")
|
||||
{
|
||||
REQUIRE(result == Color(1.6364, 1.6364, 1.6364));
|
||||
@@ -447,7 +447,7 @@ SCENARIO("Lighting with the light behind the surface", "[features/materials.feat
|
||||
PointLight light = PointLight(Tuple::Point(0, 0, 10), Color(1, 1, 1));
|
||||
WHEN("result <- lighting(m, light, position, eyev, normalv)")
|
||||
{
|
||||
Color result = m.lighting(light, position, eyev, normalv);
|
||||
Color result = m.lighting(light, position, eyev, normalv, false);
|
||||
THEN("result = color(0.1, 0.1, 0.1)")
|
||||
{
|
||||
REQUIRE(result == Color(0.1, 0.1, 0.1));
|
||||
|
||||
Reference in New Issue
Block a user