Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2014-08-27 12:51:50 +0400
committerDalai Felinto <dfelinto@gmail.com>2014-08-27 12:51:50 +0400
commit146ed67d5591e0058f24c30c81044b413cd66de4 (patch)
tree04b08cbd2914d5abc91e22567d3ed645251414f2 /intern/cycles/blender/blender_camera.cpp
parent9b9ddb46697b56213cb1e968ac0c8ddefc5ee79e (diff)
Cycles Aperture Ratio - option to produce anamorphic bokeh
Thanks for Aldo Zang for the help with the fix for the panorama/fisheye depth of field calculation and the overall math. Reviewed By: sergey, dingto Subscribers: juicyfruit, gregzaal, #cycles, dingto, matray Differential Revision: https://developer.blender.org/D753
Diffstat (limited to 'intern/cycles/blender/blender_camera.cpp')
-rw-r--r--intern/cycles/blender/blender_camera.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp
index 1a85561c6d5..ce8c64c4819 100644
--- a/intern/cycles/blender/blender_camera.cpp
+++ b/intern/cycles/blender/blender_camera.cpp
@@ -46,6 +46,8 @@ struct BlenderCamera {
float2 pixelaspect;
+ float aperture_ratio;
+
PanoramaType panorama_type;
float fisheye_fov;
float fisheye_lens;
@@ -167,6 +169,7 @@ static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob, boo
bcam->apertureblades = RNA_int_get(&ccamera, "aperture_blades");
bcam->aperturerotation = RNA_float_get(&ccamera, "aperture_rotation");
bcam->focaldistance = blender_camera_focal_distance(b_ob, b_camera);
+ bcam->aperture_ratio = RNA_float_get(&ccamera, "aperture_ratio");
bcam->shift.x = b_camera.shift_x();
bcam->shift.y = b_camera.shift_y();
@@ -328,6 +331,9 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int
cam->fisheye_fov = bcam->fisheye_fov;
cam->fisheye_lens = bcam->fisheye_lens;
+ /* anamorphic lens bokeh */
+ cam->aperture_ratio = bcam->aperture_ratio;
+
/* perspective */
cam->fov = 2.0f * atanf((0.5f * sensor_size) / bcam->lens / aspectratio);
cam->focaldistance = bcam->focaldistance;