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-08-26 18:51:54 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-08-26 18:51:54 +0300
commit2633928e1def66c63e89a4534fdcc0d9c268c7c4 (patch)
tree26313d0f9331ad9bde54ebe8dd65451d02884f5d /intern/cycles/kernel/kernel_bake.h
parentf62748f10a91650f059d589ac2d500dc5a1c1fea (diff)
Fix T45232: Cycles bake artifacts with transparent textures
The issue was caused by uninitialized ray used for composite and AO evaluation. Can;t really think of "proper" ray configuration here, it's all a bit arbitrary but think initializing the ray in a way so we look at the surface in a negative normal direction is much better alternative to uninitialized ray. Open for alternative suggestions tho.
Diffstat (limited to 'intern/cycles/kernel/kernel_bake.h')
-rw-r--r--intern/cycles/kernel/kernel_bake.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h
index 2fca83c615f..2b305e5488d 100644
--- a/intern/cycles/kernel/kernel_bake.h
+++ b/intern/cycles/kernel/kernel_bake.h
@@ -31,6 +31,13 @@ ccl_device void compute_light_pass(KernelGlobals *kg, ShaderData *sd, PathRadian
float3 throughput = make_float3(1.0f, 1.0f, 1.0f);
bool is_sss_sample = is_sss;
+ ray.P = sd->P + sd->Ng;
+ ray.D = -sd->Ng;
+ ray.t = FLT_MAX;
+#ifdef __CAMERA_MOTION__
+ ray.time = TIME_INVALID;
+#endif
+
/* init radiance */
path_radiance_init(&L_sample, kernel_data.film.use_light_pass);