Fix #109907: Cycles correlation issue with LCG random numbers
This showed up in 3.6 with multiscatter GGX, but could still be an issue in current principled hair BSDF implementations.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "util/hash.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Linear Congruential Generator */
|
||||
@@ -36,7 +38,7 @@ ccl_device_inline uint lcg_state_init(const uint rng_hash,
|
||||
const uint sample,
|
||||
const uint scramble)
|
||||
{
|
||||
return lcg_init(rng_hash + rng_offset + sample * scramble);
|
||||
return hash_uint3(rng_hash ^ scramble, rng_offset, sample);
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
Reference in New Issue
Block a user