Skip to content

Commit 264d757

Browse files
committed
Fixed hrec back to rec
1 parent c9dc5fc commit 264d757

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TheRestOfYourLife/main.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ vec3 ray_color(const ray& r, hittable& world, hittable& light_shape, int depth)
4242

4343
hittable_pdf plight(&light_shape, rec.p);
4444
mixture_pdf p(&plight, srec.pdf_ptr);
45-
ray scattered = ray(hrec.p, p.generate(), r.time());
45+
ray scattered = ray(rec.p, p.generate(), r.time());
4646
auto pdf_val = p.value(scattered.direction());
4747
delete srec.pdf_ptr;
4848

4949
return emitted
50-
+ srec.attenuation * hrec.mat_ptr->scattering_pdf(r, hrec, scattered)
50+
+ srec.attenuation * rec.mat_ptr->scattering_pdf(r, rec, scattered)
5151
* ray_color(scattered, world, light_shape, depth-1)
5252
/ pdf_val;
5353
}

0 commit comments

Comments
 (0)