Replies: 6 comments 4 replies
-
For the scene in question, I believe the focus distance should be 3.4. A quick glance through your code seems to show that everything else is ok. |
Beta Was this translation helpful? Give feedback.
-
Checking again, and the settings in my repo match the settings in the book outside of accidentally committing when I halved the defocus angle as a test. |
Beta Was this translation helpful? Give feedback.
-
Hmmm. I looked through things again, and didn't find anything that jumped out at me. Looks like it's debugger time. |
Beta Was this translation helpful? Give feedback.
-
With a bit of examination, I think I've seen the issue:
|
Beta Was this translation helpful? Give feedback.
-
Okay, trying a definitely good implementation of sampling the unit disk: pub fn random_in_unit_disk() -> Vector3<f64> {
let theta = fastrand::f64() * TAU;
let r = fastrand::f64().sqrt();
Vector3::new(r * theta.cos(), r * theta.sin(), 0.)
} and confirming that the |
Beta Was this translation helpful? Give feedback.
-
It's now resolved, thanks so much to @armansito! |
Beta Was this translation helpful? Give feedback.
-
I've completed the first book, and while I've mostly managed to get it working, the only issue that I'm having is with the depth of field implementation. My code is in Rust and at https://github.com/typedrat/rayromano, enabling the depth of field by setting the angle to be non-zero makes the entire image uniformly blurry.
Beta Was this translation helpful? Give feedback.
All reactions