[Bf-blender-cvs] [1b92dfa9] master: Fix T43550: Bug in Cycles Bake Texture

Sergey Sharybin noreply at git.blender.org
Fri Feb 20 22:00:39 CET 2015


Commit: 1b92dfa96160f8151972d73337d5a927d8b89297
Author: Sergey Sharybin
Date:   Sat Feb 21 01:56:48 2015 +0500
Branches: master
https://developer.blender.org/rB1b92dfa96160f8151972d73337d5a927d8b89297

Fix T43550: Bug in Cycles Bake Texture

Issue was caused by the changes in 7b16fda which changed the initial
state for rng. This commit makes it so the same initial hash is used
(which solves the regression without distorting AA-looking image.

It also makes it so OpenCL compiler is happy about this code (before
this change it'll complain about trying to cast private variable to
global one).

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

M	intern/cycles/kernel/kernel_bake.h

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

diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h
index 0379fca..d34a3e3 100644
--- a/intern/cycles/kernel/kernel_bake.h
+++ b/intern/cycles/kernel/kernel_bake.h
@@ -199,9 +199,13 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
 
 	/* random number generator */
 	RNG rng = cmj_hash(offset + i, kernel_data.integrator.seed);
-	uint rng_state = cmj_hash(i, kernel_data.integrator.seed);
 	float filter_x, filter_y;
-	path_rng_init(kg, &rng_state, sample, num_samples, &rng, 0, 0, &filter_x, &filter_y);
+	if(sample == 0) {
+		filter_x = filter_y = 0.5f;
+	}
+	else {
+		path_rng_2D(kg, &rng, sample, num_samples, PRNG_FILTER_U, &filter_x, &filter_x);
+	}
 
 	/* subpixel u/v offset */
 	if(sample > 0) {




More information about the Bf-blender-cvs mailing list