File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 26842684-----------------
26852685< div class='together'>
26862686We can also randomize the reflected direction by using a small sphere and choosing a new endpoint
2687- for the ray:
2687+ for the ray.
2688+ We'll use a random point from the surface of a sphere centered on the original endpoint, scaled by
2689+ the fuzz factor.
26882690
2689- ![Figure [reflect-fuzzy]: Generating fuzzed reflection rays](../images/fig-1.12-reflect-fuzzy.jpg)
2691+ ![Figure [reflect-fuzzy]: Generating fuzzed reflection rays
2692+ ](../images/fig-1.12-reflect-fuzzy.jpg)
26902693
26912694</ div>
26922695
27072710 const override {
27082711 vec3 reflected = reflect(unit_vector(r_in.direction()), rec.normal);
27092712 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
2710- scattered = ray(rec.p, reflected + fuzz*random_in_unit_sphere ());
2713+ scattered = ray(rec.p, reflected + fuzz*random_unit_vector ());
27112714 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
27122715 attenuation = albedo;
27132716 return (dot(scattered.direction(), rec.normal) > 0);
You can’t perform that action at this time.
0 commit comments