Skip to content

Commit

Permalink
Changed DoF for final render.
Browse files Browse the repository at this point in the history
  • Loading branch information
shayshunk committed Feb 7, 2024
1 parent 4696446 commit ae46557
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions RayTracer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ int main(int argc, char* argv[])

sphereMaterial = make_shared<Lambertian>(albedo);

Point3 center2 = center + Vector3(0, RandomDouble(0, 0.5), 0);
world.Add(make_shared<Sphere>(center, center2, 0.2, sphereMaterial));
continue;
double chooseBounce = RandomDouble();

if (chooseBounce < 0.5)
{
Point3 center2 = center + Vector3(0, RandomDouble(0, 0.5), 0);
world.Add(make_shared<Sphere>(center, center2, 0.2, sphereMaterial));
continue;
}
}
else if (chooseMaterial < 0.70)
{
Expand Down Expand Up @@ -99,8 +104,8 @@ int main(int argc, char* argv[])
camera.lookAt = Point3(0, 0, 0);
camera.vUp = Vector3(0, 1, 0);

camera.defocusAngle = 0.6;
camera.focusDistance = 10;
camera.defocusAngle = 0.2;
camera.focusDistance = 8;

camera.Render(world);

Expand Down
Binary file modified result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ae46557

Please sign in to comment.