File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ Change Log -- Ray Tracing in One Weekend
33
33
- Fix: Listing 30: Add missing ` camera.h ` include
34
34
- Fix: Listing 42: Don't need to include ` ray.h ` when using ` rtweekend.h `
35
35
- Fix: Listing 48: Add missing ` material.h ` include
36
+ - Fix: Listing 51: ` refract() ` function was missing ` fabs() ` on ` sqrt() ` argument (#559
36
37
- Fix: Listing 61: Include updated ` cam ` declaration, show context w/highlighting
37
38
- Fix: Listing 62: Highlight rename of ` camera::get_ray() ` parameters to s, t (#616 )
38
39
- Fix: Listing 63: Show reverted scene declarations
Original file line number Diff line number Diff line change 2399
2399
vec3 refract(const vec3& uv, const vec3& n, double etai_over_etat) {
2400
2400
auto cos_theta = dot(-uv, n);
2401
2401
vec3 r_out_parallel = etai_over_etat * (uv + cos_theta*n);
2402
- vec3 r_out_perp = -sqrt(1.0 - r_out_parallel.length_squared()) * n;
2402
+ vec3 r_out_perp = -sqrt(fabs( 1.0 - r_out_parallel.length_squared() )) * n;
2403
2403
return r_out_parallel + r_out_perp;
2404
2404
}
2405
2405
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments