diff options
author | Thomas Dinges <blender@dingto.org> | 2015-02-26 12:17:59 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2015-02-26 12:30:01 +0300 |
commit | 8197f0bb645f73f41071daaccf205a7583e695f5 (patch) | |
tree | 2f9d84df75ea1bd4b4d187acf2f482ed093d60bb /intern/cycles/kernel | |
parent | 31f6e621b8cf005ff2b02fd7f0c6f4f9bfc5a8d4 (diff) |
Cleanup: Simplify camera sample motion blur code.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_camera.h | 10 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 11 |
2 files changed, 7 insertions, 14 deletions
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h index ded222e20ff..6c32a7e46b1 100644 --- a/intern/cycles/kernel/kernel_camera.h +++ b/intern/cycles/kernel/kernel_camera.h @@ -245,21 +245,13 @@ ccl_device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float /* Common */ ccl_device void camera_sample(KernelGlobals *kg, int x, int y, float filter_u, float filter_v, - float lens_u, float lens_v, float time, Ray *ray) + float lens_u, float lens_v, Ray *ray) { /* pixel filter */ int filter_table_offset = kernel_data.film.filter_table_offset; float raster_x = x + lookup_table_read(kg, filter_u, filter_table_offset, FILTER_TABLE_SIZE); float raster_y = y + lookup_table_read(kg, filter_v, filter_table_offset, FILTER_TABLE_SIZE); -#ifdef __CAMERA_MOTION__ - /* motion blur */ - if(kernel_data.cam.shuttertime == -1.0f) - ray->time = TIME_INVALID; - else - ray->time = time; -#endif - /* sample */ if(kernel_data.cam.type == CAMERA_PERSPECTIVE) camera_sample_perspective(kg, raster_x, raster_y, lens_u, lens_v, ray); diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 151e762020b..9f3709ea5f7 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -1191,14 +1191,15 @@ ccl_device_inline void kernel_path_trace_setup(KernelGlobals *kg, ccl_global uin if(kernel_data.cam.aperturesize > 0.0f) path_rng_2D(kg, rng, sample, num_samples, PRNG_LENS_U, &lens_u, &lens_v); - float time = 0.0f; - #ifdef __CAMERA_MOTION__ - if(kernel_data.cam.shuttertime != -1.0f) - time = path_rng_1D(kg, rng, sample, num_samples, PRNG_TIME); + /* motion blur */ + if(kernel_data.cam.shuttertime == -1.0f) + ray->time = TIME_INVALID; + else + ray->time = path_rng_1D(kg, rng, sample, num_samples, PRNG_TIME); #endif - camera_sample(kg, x, y, filter_u, filter_v, lens_u, lens_v, time, ray); + camera_sample(kg, x, y, filter_u, filter_v, lens_u, lens_v, ray); } ccl_device void kernel_path_trace(KernelGlobals *kg, |