diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-02-02 20:06:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-02-02 20:09:01 +0300 |
commit | 30e4009f0a5e7738ea6851b76b5a85e5d5f19710 (patch) | |
tree | 558d588761544f2721498b1ca14550387e286e0a /intern/cycles/render/camera.cpp | |
parent | ddba5c27a754a7cd419d2f1d1b71871269b41f86 (diff) |
Cycles: Solve dependency between camera and object synchronization
IN theory object might depend on camera location (spatial adaptive subdivisions
for example) which became not possible to achieve after camera in volume support.
Should be no functional changes for artists.
Diffstat (limited to 'intern/cycles/render/camera.cpp')
-rw-r--r-- | intern/cycles/render/camera.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp index 9d03a9e360e..ea9b853d454 100644 --- a/intern/cycles/render/camera.cpp +++ b/intern/cycles/render/camera.cpp @@ -278,11 +278,20 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene) kcam->nearclip = nearclip; kcam->cliplength = (farclip == FLT_MAX)? FLT_MAX: farclip - nearclip; - need_device_update = false; - previous_need_motion = need_motion; - /* Camera in volume. */ kcam->is_inside_volume = 0; + + previous_need_motion = need_motion; +} + +void Camera::device_update_volume(Device *device, + DeviceScene *dscene, + Scene *scene) +{ + if(!need_device_update) { + return; + } + KernelCamera *kcam = &dscene->data.cam; BoundBox viewplane_boundbox = viewplane_bounds_get(); for(size_t i = 0; i < scene->objects.size(); ++i) { Object *object = scene->objects[i]; @@ -294,6 +303,7 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene) break; } } + need_device_update = false; } void Camera::device_free(Device *device, DeviceScene *dscene) |