Files
client/Editor/Internal Data/Third Party/Shaders/Utils/PRNG.hlsl
T
2026-07-31 19:29:07 +03:00

17 lines
311 B
HLSL

// Licensed under the Non-Profit Open Software License version 3.0
uint Hash(uint s)
{
s ^= 2747636419u;
s *= 2654435769u;
s ^= s >> 16;
s *= 2654435769u;
s ^= s >> 16;
s *= 2654435769u;
return s;
}
float Random(uint seed)
{
return float(Hash(seed)) / 4294967295.0; // 2^32-1
}