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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-10-27 11:16:04 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-10-28 00:43:06 +0300
commit6a529e14f4c25fc20b797799b602472d3a22a0f9 (patch)
treed94d60107dc8540312c7f3a217e01a7f4174216e /intern/cycles/kernel/kernel_camera.h
parentc07c066685658fc5a9f070ab9f9e8fb97926568a (diff)
Cycles: Support user-defined shutter curve
Previously shutter was instantly opening, staying opened for the shutter time period of time and then instantly closing. This isn't quite how real cameras are working, where shutter is opening with some curve. Now it is possible to define user curve for how much shutter is opened across the sampling period of time. This could be used for example to make motion blur trails softer.
Diffstat (limited to 'intern/cycles/kernel/kernel_camera.h')
-rw-r--r--intern/cycles/kernel/kernel_camera.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h
index 8d439ceb0d7..01017eabde2 100644
--- a/intern/cycles/kernel/kernel_camera.h
+++ b/intern/cycles/kernel/kernel_camera.h
@@ -290,10 +290,13 @@ ccl_device void camera_sample(KernelGlobals *kg, int x, int y, float filter_u, f
#ifdef __CAMERA_MOTION__
/* motion blur */
- if(kernel_data.cam.shuttertime == -1.0f)
+ if(kernel_data.cam.shuttertime == -1.0f) {
ray->time = TIME_INVALID;
- else
- ray->time = time;
+ }
+ else {
+ const int shutter_table_offset = kernel_data.cam.shutter_table_offset;
+ ray->time = lookup_table_read(kg, time, shutter_table_offset, SHUTTER_TABLE_SIZE);
+ }
#endif
/* sample */