-
Notifications
You must be signed in to change notification settings - Fork 58
Description
It would be useful to be able to specify depth of field (DOF) settings within the Blender scene and use those on the rs-pbrt side.
For .pbrt files those should work correctly already, but forparse_blend_file we still need a way how to translate the settings from the Blender UI to camera settings, which can be used for e.g. the struct PerspectiveCamera. Here an example from the Italian Flat scene:
In Blender version 2.79 the two settings in questions are shown here:
The depth of field distance can be used as parameter focaldistance directly, but Blender's f-stop value has to be translated somehow to PBRT's lensradius (in this example I used lensradius = 0.0125):
diff --git a/src/cameras/perspective.rs b/src/cameras/perspective.rs
index 92c77db..72f9d98 100644
--- a/src/cameras/perspective.rs
+++ b/src/cameras/perspective.rs
@@ -173,6 +173,10 @@ impl PerspectiveCamera {
// params.find_one_float(String::from("halffov"), -1.0);
// TODO: if (halffov > 0.f)
// TODO: let perspective_camera: Arc<Camera + Sync + Send> =
+ // TMP
+ let lensradius: Float = 0.0125;
+ let focaldistance: Float = 5.6;
+ // TMP
Arc::new(Camera::Perspective(Box::new(PerspectiveCamera::new(
cam2world,
screen, The best solution would be to look into Blender's source code to find a proper translation hint.

