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).
This commit is contained in:
Sergey Sharybin 2015-02-21 01:56:48 +05:00
parent f7a2a36b31
commit 1b92dfa961
Notes: blender-bot 2023-02-14 09:31:58 +01:00
Referenced by commit abd630de62, Disable Bake Jitter code (recently added)
Referenced by issue #43772, Vertex slide crashes Blender
Referenced by issue #43550, Bug in Cycles Bake Texture
1 changed files with 6 additions and 2 deletions

View File

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