Commit: 2633928e1def66c63e89a4534fdcc0d9c268c7c4
Author: Sergey Sharybin
Date:   Wed Aug 26 17:51:54 2015 +0200
Branches: master
https://developer.blender.org/rB2633928e1def66c63e89a4534fdcc0d9c268c7c4

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.

===================================================================

M       intern/cycles/kernel/kernel_bake.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_bake.h 
b/intern/cycles/kernel/kernel_bake.h
index 2fca83c..2b305e5 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);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to