diff options
author | Charlie Jolly <charlie> | 2021-10-11 23:59:04 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2021-10-12 00:59:04 +0300 |
commit | e005ad5b547627914a87469b58bcd6a249c95c55 (patch) | |
tree | 5a58e4bdb69596248a586229069742fb7571736d /source/blender/blenlib | |
parent | ca8e8fd8d4747943bbff5f37b4858c7cd32daef3 (diff) |
Fix T92103: Update BLI hash_float_to_float functions to be shader compatible
Previously the functions called `hash_float` instead of `uint_to_float_01`.
This meant that the float was hashed twice instead of once.
The new functions are also compatible with Cycles/Eevee.
Differential Revision: https://developer.blender.org/D12832
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/noise.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/noise.cc b/source/blender/blenlib/intern/noise.cc index e80975f618c..6ed1fae71ad 100644 --- a/source/blender/blenlib/intern/noise.cc +++ b/source/blender/blenlib/intern/noise.cc @@ -222,22 +222,22 @@ float hash_to_float(uint32_t kx, uint32_t ky, uint32_t kz, uint32_t kw) float hash_float_to_float(float k) { - return hash_to_float(hash_float(k)); + return uint_to_float_01(hash_float(k)); } float hash_float_to_float(float2 k) { - return hash_to_float(hash_float(k)); + return uint_to_float_01(hash_float(k)); } float hash_float_to_float(float3 k) { - return hash_to_float(hash_float(k)); + return uint_to_float_01(hash_float(k)); } float hash_float_to_float(float4 k) { - return hash_to_float(hash_float(k)); + return uint_to_float_01(hash_float(k)); } /* ------------ |