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:
Brecht Van Lommel
2023-10-02 17:11:53 +02:00
parent 9a8f65ef13
commit ed36398e16
+3 -1
View File
@@ -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