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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-04 01:34:51 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-04 01:34:51 +0400
commit838949c3e76eb140bb0f776fbbd0fd61fac08f49 (patch)
tree5f59c6410a1ad65d9dee684368676f499907cf65 /intern/cycles/kernel/kernel_camera.h
parent879859e0cc4e0176e1a054fa63e94c3e506a0a7c (diff)
Fix #35207: addition to previous fix to avoid OSL getting uninitialized
ray differentials for lighting, which could cause bad texture filtering artifacts or performance.
Diffstat (limited to 'intern/cycles/kernel/kernel_camera.h')
-rw-r--r--intern/cycles/kernel/kernel_camera.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h
index fe31419b11e..13f2f84691d 100644
--- a/intern/cycles/kernel/kernel_camera.h
+++ b/intern/cycles/kernel/kernel_camera.h
@@ -76,8 +76,7 @@ __device void camera_sample_perspective(KernelGlobals *kg, float raster_x, float
/* ray differential */
float3 Ddiff = transform_direction(&cameratoworld, Pcamera);
- ray->dP.dx = make_float3(0.0f, 0.0f, 0.0f);
- ray->dP.dy = make_float3(0.0f, 0.0f, 0.0f);
+ ray->dP = differential3_zero();
ray->dD.dx = normalize(Ddiff + float4_to_float3(kernel_data.cam.dx)) - normalize(Ddiff);
ray->dD.dy = normalize(Ddiff + float4_to_float3(kernel_data.cam.dy)) - normalize(Ddiff);
@@ -138,8 +137,7 @@ __device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, floa
ray->dP.dx = float4_to_float3(kernel_data.cam.dx);
ray->dP.dy = float4_to_float3(kernel_data.cam.dy);
- ray->dD.dx = make_float3(0.0f, 0.0f, 0.0f);
- ray->dD.dy = make_float3(0.0f, 0.0f, 0.0f);
+ ray->dD = differential3_zero();
#endif
#ifdef __CAMERA_CLIPPING__
@@ -209,8 +207,7 @@ __device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float ra
#ifdef __RAY_DIFFERENTIALS__
/* ray differential */
- ray->dP.dx = make_float3(0.0f, 0.0f, 0.0f);
- ray->dP.dy = make_float3(0.0f, 0.0f, 0.0f);
+ ray->dP = differential3_zero();
Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x + 1.0f, raster_y, 0.0f));
ray->dD.dx = normalize(transform_direction(&cameratoworld, panorama_to_direction(kg, Pcamera.x, Pcamera.y))) - ray->D;