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:
-rw-r--r--intern/cycles/blender/blender_camera.cpp16
-rw-r--r--intern/cycles/util/util_boundbox.h4
2 files changed, 19 insertions, 1 deletions
diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp
index 61fe7cf254d..a5fdb8d821a 100644
--- a/intern/cycles/blender/blender_camera.cpp
+++ b/intern/cycles/blender/blender_camera.cpp
@@ -279,7 +279,21 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int
/* sensor */
cam->sensorwidth = bcam->sensor_width;
- cam->sensorheight = bcam->sensor_height;
+
+ if (bcam->type == CAMERA_PANORAMA &&
+ (bcam->sensor_fit == BlenderCamera::AUTO &&
+ bcam->panorama_type == PANORAMA_FISHEYE_EQUISOLID)
+ ) {
+
+ float sensor_aspectratio = bcam->pano_viewplane.width() /
+ (bcam->pano_viewplane.height() *
+ (aspectratio));
+
+ cam->sensorheight = bcam->sensor_width * sensor_aspectratio;
+ }
+ else {
+ cam->sensorheight = bcam->sensor_height;
+ }
/* clipping distances */
cam->nearclip = bcam->nearclip;
diff --git a/intern/cycles/util/util_boundbox.h b/intern/cycles/util/util_boundbox.h
index a0cdf1761ad..624a911a3f5 100644
--- a/intern/cycles/util/util_boundbox.h
+++ b/intern/cycles/util/util_boundbox.h
@@ -182,6 +182,10 @@ public:
bottom == other.bottom && top == other.top);
}
+ float width() {return right - left;}
+
+ float height() {return bottom - top;}
+
BoundBox2D operator*(float f) const
{
BoundBox2D result;