Commit: 60679a171d8b14705f54c32873df87e5ed911b0a Author: Thomas Dinges Date: Thu Feb 26 13:27:02 2015 +0100 Branches: master https://developer.blender.org/rB60679a171d8b14705f54c32873df87e5ed911b0a
Revert "Cleanup: Simplify camera sample motion blur code." This reverts commit 8197f0bb645f73f41071daaccf205a7583e695f5. =================================================================== M intern/cycles/kernel/kernel_camera.h M intern/cycles/kernel/kernel_path.h =================================================================== diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h index 6c32a7e..ded222e 100644 --- a/intern/cycles/kernel/kernel_camera.h +++ b/intern/cycles/kernel/kernel_camera.h @@ -245,13 +245,21 @@ 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, Ray *ray) + float lens_u, float lens_v, float time, 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 9f3709e..151e762 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -1191,15 +1191,14 @@ 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__ - /* 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); + if(kernel_data.cam.shuttertime != -1.0f) + 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, ray); + camera_sample(kg, x, y, filter_u, filter_v, lens_u, lens_v, time, ray); } ccl_device void kernel_path_trace(KernelGlobals *kg, _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs