|
1710 | 1710 |
|
1711 | 1711 |
|
1712 | 1712 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
|
1713 |
| - shared_ptr<hittable> light_shape = make_shared<xz_rect>(213, 343, 227, 332, 554, 0); |
| 1713 | + shared_ptr<hittable> light_shape = |
| 1714 | + make_shared<xz_rect>(213, 343, 227, 332, 554, shared_ptr<material>()); |
1714 | 1715 | hittable_pdf p(light_shape, rec.p);
|
1715 | 1716 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
|
1716 | 1717 |
|
|
1797 | 1798 | if (!rec.mat_ptr->scatter(r, rec, albedo, scattered, pdf_val))
|
1798 | 1799 | return emitted;
|
1799 | 1800 |
|
1800 |
| - |
| 1801 | + shared_ptr<hittable> light_shape = |
| 1802 | + make_shared<xz_rect>(213, 343, 227, 332, 554, make_shared<material>()); |
1801 | 1803 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
|
1802 |
| - shared_ptr<hittable> light_ptr = make_shared<xz_rect>(213, 343, 227, 332, 554, 0); |
1803 |
| - hittable_pdf p0(light_ptr, rec.p); |
1804 |
| - |
| 1804 | + hittable_pdf p0(light_shape, rec.p); |
1805 | 1805 | cosine_pdf p1(rec.normal);
|
1806 | 1806 | mixture_pdf p(&p0, &p1);
|
1807 | 1807 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
|
|
0 commit comments