Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/intern/noise.cc
| Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| return uint_to_float_01(hash(kx, ky, kz, kw)); | return uint_to_float_01(hash(kx, ky, kz, kw)); | ||||
| } | } | ||||
| /* Hashing a number of floats into a float in the range [0, 1]. */ | /* Hashing a number of floats into a float in the range [0, 1]. */ | ||||
| float hash_float_to_float(float k) | 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) | 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) | 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) | float hash_float_to_float(float4 k) | ||||
| { | { | ||||
| return hash_to_float(hash_float(k)); | return uint_to_float_01(hash_float(k)); | ||||
| } | } | ||||
| /* ------------ | /* ------------ | ||||
| * Perlin Noise | * Perlin Noise | ||||
| * ------------ | * ------------ | ||||
| * | * | ||||
| * Perlin, Ken. "Improving noise." Proceedings of the 29th annual conference on Computer graphics | * Perlin, Ken. "Improving noise." Proceedings of the 29th annual conference on Computer graphics | ||||
| * and interactive techniques. 2002. | * and interactive techniques. 2002. | ||||
| ▲ Show 20 Lines • Show All 469 Lines • Show Last 20 Lines | |||||