Open wahn opened 2 years ago
The focaldistance
we need for PerspectiveCamera
can be taken directly from Camera.YF_dofdist
:
$ ./target/release/blend_info -n Camera.YF_dofdist ~/git/self_hosted/render_comparison/blend/italian_flat/italian_flat_v279.blend
Camera.YF_dofdist = 0_f32
Camera.YF_dofdist = 0_f32
Camera.YF_dofdist = 0_f32
Camera.YF_dofdist = 0_f32
Camera.YF_dofdist = 0_f32
Camera.YF_dofdist = 0_f32
Camera.YF_dofdist = 5.6_f32
From within Blender 2.79 you can access the aperture_fstop
via Python:
>>> bpy.data.cameras['Camera_Table_Details'].cycles.aperture_fstop
2.0
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 structPerspectiveCamera
. 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'slensradius
(in this example I usedlensradius = 0.0125
):The best solution would be to look into Blender's source code to find a proper translation hint.