Post by zzeligg on Nov 30, 2018 2:23:15 GMT
First of all, thanks a lot to Jamis for the book, I am having a lot of fun developing the ray tracing routines in it. I look forward to it becoming an actual ray tracing program!
I have a problem with one of the tests (or rather, the routine that it is supposed to test).
The problem I encounter is in chapter 7, in the Building a world section, with the color_at(world,ray) function. The last test scenario, “Scenario: The color with an intersection behind the ray”, doesn’t pass. The color returned is brighter than the material of the inner sphere.
Basically, in that test, the line c = color_at(world,ray) returns color(1.50186,1.50186,1.50186), whereas the material color for the inner sphere in the default world is the default color, namely color(1,1,1) (and that is the expected color).
I spent quite some time looking over all the code from the beginning of the book, and tried to figure out what I might have done wrong. Moreover, since all the other tests in the book up to that point pass (including the 2 other tests for color_at in that same section and the test for the lighting function), I am at a loss.
Looking at the lighting function, the only way color_at would return color(1,1,1) is if the diffuse component that it computes was black. This could happen if the light_dot_normal were negative (light behind the surface), or if the diffuse value for the material was 0 to start with. Am i right?
I have a problem with one of the tests (or rather, the routine that it is supposed to test).
The problem I encounter is in chapter 7, in the Building a world section, with the color_at(world,ray) function. The last test scenario, “Scenario: The color with an intersection behind the ray”, doesn’t pass. The color returned is brighter than the material of the inner sphere.
Basically, in that test, the line c = color_at(world,ray) returns color(1.50186,1.50186,1.50186), whereas the material color for the inner sphere in the default world is the default color, namely color(1,1,1) (and that is the expected color).
I spent quite some time looking over all the code from the beginning of the book, and tried to figure out what I might have done wrong. Moreover, since all the other tests in the book up to that point pass (including the 2 other tests for color_at in that same section and the test for the lighting function), I am at a loss.
Looking at the lighting function, the only way color_at would return color(1,1,1) is if the diffuse component that it computes was black. This could happen if the light_dot_normal were negative (light behind the surface), or if the diffuse value for the material was 0 to start with. Am i right?
I will review all my tests and my code from the beginning of the book, but I thought maybe the solution is something obvious that I am just missing.
Regards,