Revert "Cleanup: Simplify camera sample motion blur code."

This reverts commit 8197f0bb645f73f41071daaccf205a7583e695f5.
This commit is contained in:
Thomas Dinges 2015-02-26 13:27:02 +01:00
parent f159ed7746
commit 60679a171d
2 changed files with 14 additions and 7 deletions

@ -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);

@ -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,