I've just finished implementing the end of Chapter 8, which deals with the creating of over_point. When I do this, all tests pass except for one test in Chapter 7, the test at the end of page 95 whose scenario is: "Shading an intersection from the inside"
My test now fails because the point is in shadow, so it only returns ambient color instead of the whole phong model. I've tried increasing the value of epsilon by up to a factor of a hundred, so I don't think it's a float error.
Am I doing something wrong or is this meant to affect the test result?
For that test ("Shading an intersection from the inside"), there should not be any shadow, because the light source and the ray are both on the inside of the innermost sphere. That is to say, the innermost sphere is centered at the origin and has a radius of 0.5, and the light source is located at (0, 0.25, 0) --- inside the sphere --- and the ray starts at the origin, also inside the sphere.
If you're getting shadows for that test, it might be because your over_point is on the wrong side of the sphere. Are you adjusting it by the _original_ normal, or by the normal after you flip it (based on the "inside" flag)? You need to make sure you adjust over_point by the adjusted normal, otherwise it'll be moved outside the sphere, which is wrong for this case.