Fix most of #31307: cycles panorama camera not working correct with speed

vectors and window texture coordinates. Only for Fisheye Equisolid it's
still not working correct yet. Patch from Dalai with modifications.
This commit is contained in:
Brecht Van Lommel
2012-05-07 10:53:09 +00:00
parent 69fc654f94
commit 022d12a721
11 changed files with 300 additions and 167 deletions

View File

@@ -158,13 +158,25 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
kcam->have_motion = 0;
if(need_motion == Scene::MOTION_PASS) {
if(use_motion) {
kcam->motion.pre = transform_inverse(motion.pre * rastertocamera);
kcam->motion.post = transform_inverse(motion.post * rastertocamera);
if(type == CAMERA_PANORAMA) {
if(use_motion) {
kcam->motion.pre = transform_inverse(motion.pre);
kcam->motion.post = transform_inverse(motion.post);
}
else {
kcam->motion.pre = kcam->worldtocamera;
kcam->motion.post = kcam->worldtocamera;
}
}
else {
kcam->motion.pre = worldtoraster;
kcam->motion.post = worldtoraster;
if(use_motion) {
kcam->motion.pre = transform_inverse(motion.pre * rastertocamera);
kcam->motion.post = transform_inverse(motion.post * rastertocamera);
}
else {
kcam->motion.pre = worldtoraster;
kcam->motion.post = worldtoraster;
}
}
}
else if(need_motion == Scene::MOTION_BLUR) {
@@ -196,6 +208,10 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
kcam->sensorwidth = sensorwidth;
kcam->sensorheight = sensorheight;
/* render size */
kcam->width = width;
kcam->height = height;
/* store differentials */
kcam->dx = float3_to_float4(dx);
kcam->dy = float3_to_float4(dy);