Cycles: panorama camera in viewport camera view now shows the render mapped

to the camera border rather than the entire viewport.
This commit is contained in:
Brecht Van Lommel
2012-11-10 22:31:29 +00:00
parent 446f70f286
commit 1ca4670267
4 changed files with 177 additions and 119 deletions

View File

@@ -55,15 +55,10 @@ Camera::Camera()
width = 1024;
height = 512;
left = -((float)width/(float)height);
right = (float)width/(float)height;
bottom = -1.0f;
top = 1.0f;
border_left = 0.0f;
border_right = 1.0f;
border_bottom = 0.0f;
border_top = 1.0f;
viewplane.left = -((float)width/(float)height);
viewplane.right = (float)width/(float)height;
viewplane.bottom = -1.0f;
viewplane.top = 1.0f;
screentoworld = transform_identity();
rastertoworld = transform_identity();
@@ -95,10 +90,11 @@ void Camera::update()
/* raster to screen */
Transform screentoraster = ndctoraster;
screentoraster = ndctoraster *
transform_scale(1.0f/(right - left), 1.0f/(top - bottom), 1.0f) *
transform_translate(-left, -bottom, 0.0f);
transform_scale(1.0f/(viewplane.right - viewplane.left),
1.0f/(viewplane.top - viewplane.bottom), 1.0f) *
transform_translate(-viewplane.left, -viewplane.bottom, 0.0f);
Transform rastertoscreen = transform_inverse(screentoraster);
@@ -265,14 +261,8 @@ bool Camera::modified(const Camera& cam)
// modified for progressive render
// (width == cam.width) &&
// (height == cam.height) &&
(left == cam.left) &&
(right == cam.right) &&
(bottom == cam.bottom) &&
(top == cam.top) &&
(border_left == cam.border_left) &&
(border_right == cam.border_right) &&
(border_bottom == cam.border_bottom) &&
(border_top == cam.border_top) &&
(viewplane == cam.viewplane) &&
(border == cam.border) &&
(matrix == cam.matrix) &&
(panorama_type == cam.panorama_type) &&
(fisheye_fov == cam.fisheye_fov) &&