|
1595 | 1595 | for (int i = 0; i < image_width; ++i) { |
1596 | 1596 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
1597 | 1597 | color pixel_color(0, 0, 0); |
1598 | | - for (int s = 0; s < samples_per_pixel; ++s) { |
| 1598 | + for (int sample = 0; sample < samples_per_pixel; ++sample) { |
1599 | 1599 | auto u = (i + random_double()) / (image_width-1); |
1600 | 1600 | auto v = (j + random_double()) / (image_height-1); |
1601 | 1601 | ray r = cam.get_ray(u, v); |
|
1773 | 1773 | std::clog << "\rScanlines remaining: " << j << ' ' << std::flush; |
1774 | 1774 | for (int i = 0; i < image_width; ++i) { |
1775 | 1775 | color pixel_color(0, 0, 0); |
1776 | | - for (int s = 0; s < samples_per_pixel; ++s) { |
| 1776 | + for (int sample = 0; sample < samples_per_pixel; ++sample) { |
1777 | 1777 | auto u = (i + random_double()) / (image_width-1); |
1778 | 1778 | auto v = (j + random_double()) / (image_height-1); |
1779 | 1779 | ray r = cam.get_ray(u, v); |
|
2373 | 2373 | std::clog << "\rScanlines remaining: " << j << ' ' << std::flush; |
2374 | 2374 | for (int i = 0; i < image_width; ++i) { |
2375 | 2375 | color pixel_color(0, 0, 0); |
2376 | | - for (int s = 0; s < samples_per_pixel; ++s) { |
| 2376 | + for (int sample = 0; sample < samples_per_pixel; ++sample) { |
2377 | 2377 | auto u = (i + random_double()) / (image_width-1); |
2378 | 2378 | auto v = (j + random_double()) / (image_height-1); |
2379 | 2379 | ray r = cam.get_ray(u, v); |
|
2832 | 2832 | std::clog << "\rScanlines remaining: " << j << ' ' << std::flush; |
2833 | 2833 | for (int i = 0; i < image_width; ++i) { |
2834 | 2834 | color pixel_color(0,0,0); |
2835 | | - for (int s = 0; s < samples_per_pixel; ++s) { |
| 2835 | + for (int sample = 0; sample < samples_per_pixel; ++sample) { |
2836 | 2836 | auto u = (i + random_double()) / (image_width-1); |
2837 | 2837 | auto v = (j + random_double()) / (image_height-1); |
2838 | 2838 | ray r = cam.get_ray(u, v); |
|
0 commit comments