Adding shadows!
This commit is contained in:
@@ -86,5 +86,17 @@ TEST(MaterialTest, Lighting_with_the_light_behind_the_surface)
|
||||
|
||||
Colour result = m.lighting(light, position, eyev, normalv);
|
||||
|
||||
ASSERT_EQ(result, Colour(0.1, 0.1, 0.1));
|
||||
}
|
||||
|
||||
TEST(MaterialTest, Lighting_with_the_surface_in_shadow)
|
||||
{
|
||||
Vector eyev = Vector(0, 0, -1);
|
||||
Vector normalv = Vector(0, 0, -1);
|
||||
Light light = Light(POINT_LIGHT, Point(0, 0, -10), Colour(1, 1, 1));
|
||||
bool inShadow = true;
|
||||
|
||||
Colour result = m.lighting(light, position, eyev, normalv, inShadow);
|
||||
|
||||
ASSERT_EQ(result, Colour(0.1, 0.1, 0.1));
|
||||
}
|
||||
Reference in New Issue
Block a user