示例#1
0
        public SphereAreaLight(Vector3 pos, Vector3 col, float intens, int uniqSamples = 256) : base(pos, col, intens, uniqSamples)
        {
            int a     = 0;
            int steps = (int)Math.Sqrt(uniqSamples);

            for (int i = 0; i < steps; i++)
            {
                for (int j = 0; j < steps; j++)
                {
                    allPoints[a++] = Position + RRandom.RndUnitStratified(steps, i, j) * Radius;
                }
            }
        }
示例#2
0
        public SpotLightMultiSample(Vector3 position, Vector3 colour, float intensity, int uniqSamples = 256)
            : base(position, colour, intensity, uniqSamples)
        {
            int a     = 0;
            int steps = (int)Math.Sqrt(uniqSamples);

            for (int i = 0; i < steps; i++)
            {
                for (int j = 0; j < steps; j++)
                {
                    allPoints[a++] = Position + RRandom.RndUnitStratified(steps, i, j) * Radius;
                }
            }
        }
示例#3
0
        //points on surface of a sphere
        public override Vector3[] TrueStratified(uint max)
        {
            int a     = 0;
            int steps = (int)Math.Sqrt(max);

            Vector3[] arr = new Vector3[steps * steps];
            for (int i = 0; i < steps; i++)
            {
                for (int j = 0; j < steps; j++)
                {
                    arr[a++] = Position + RRandom.RndUnitStratified(steps, i, j) * Radius;
                }
            }
            return(arr);
        }