namespace UnityEngine.Rendering.PostProcessing
{
///
/// Halton sequence utility.
///
public static class HaltonSeq
{
///
/// Gets a value from the Halton sequence for a given index and radix.
///
/// The sequence index
/// The sequence base
/// A number from the Halton sequence between 0 and 1.
public static float Get(int index, int radix)
{
float result = 0f;
float fraction = 1f / (float)radix;
while (index > 0)
{
result += (float)(index % radix) * fraction;
index /= radix;
fraction /= (float)radix;
}
return result;
}
}
}