This commit is contained in:
ktyl 2022-06-03 21:16:46 +01:00
parent 3adf674871
commit 4ccba24017
2 changed files with 6 additions and 4 deletions

BIN
screenshots/ring.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

View File

@ -11,10 +11,12 @@
const double ASPECT_RATIO = 16.0 / 9.0; const double ASPECT_RATIO = 16.0 / 9.0;
const int WIDTH = 1920; const int WIDTH = 1920;
const int HEIGHT = static_cast<int>(WIDTH / ASPECT_RATIO); const int HEIGHT = static_cast<int>(WIDTH / ASPECT_RATIO);
const int SAMPLES_PER_PIXEL = 32; const int SAMPLES_PER_PIXEL = 8;
const int MAX_DEPTH = 5; const int MAX_DEPTH = 5;
const colour pink(0.973, 0.784, 0.863); // fee2aa
//
const colour pink(254.0/255.0, 226.0/255.0, 170.0/255.0);
const colour grey(0.133, 0.133, 0.133); const colour grey(0.133, 0.133, 0.133);
colour ray_colour(const ray& r, const hittable& world, int depth) colour ray_colour(const ray& r, const hittable& world, int depth)
@ -94,7 +96,7 @@ hittable_list random_scene()
//world.add(make_shared<sphere>(point3(-4, 1, 0), 1.0, material2)); //world.add(make_shared<sphere>(point3(-4, 1, 0), 1.0, material2));
auto material3 = make_shared<metal>(pink, 0.5); auto material3 = make_shared<metal>(pink, 0.5);
int sphere_count = 3; int sphere_count = 10;
for (int i = 0; i < sphere_count; i++) for (int i = 0; i < sphere_count; i++)
{ {
float a = 6.28 * (float)i/sphere_count - 100.0; float a = 6.28 * (float)i/sphere_count - 100.0;
@ -103,7 +105,7 @@ hittable_list random_scene()
float y = 2.0*cos(a); float y = 2.0*cos(a);
float z = r*cos(a); float z = r*cos(a);
point3 pos(x,y,z); point3 pos(x,y,z);
world.add(make_shared<sphere>(pos, 4.0, material3)); world.add(make_shared<sphere>(pos, 2.0, material3));
} }