示例#1
0
        private static void GenerateSampleKernel(IRandom random, Span <Float4> kernel)
        {
            //Generate points in the hemisphere with higher density near the center
            for (int i = 0; i < kernel.Length; i++)
            {
                Float3 dir = Float3.FastNormalize(
                    random.GetBetween(minValue: (-1f, -1f, .2f), maxValue: (1f, 1f, 1f)));

                float  scale = (float)i / kernel.Length;
                Float3 point = dir * FloatUtils.Lerp(.1f, 1f, scale * scale);
                kernel[i] = point.XYZ0;
            }
        }