Exemple #1
0
 public static AreaLight CreateAreaLight(Transform lightToWorld, ParameterSet paramSet, IShape shape)
 {
     Spectrum L = paramSet.FindOneSpectrum ("L", new Spectrum (1.0));
     Spectrum sc = paramSet.FindOneSpectrum ("scale", new Spectrum (1.0));
     int nSamples = paramSet.FindOneInt ("nsamples", 1);
     return new DiffuseAreaLight (lightToWorld, L * sc, nSamples, shape);
 }
Exemple #2
0
        public static ISampler CreateSampler(ParameterSet parameters, IFilm film, ICamera camera)
        {
            // Initialize common sampler parameters
            int xstart, xend, ystart, yend;
            film.GetSampleExtent (out xstart, out xend, out ystart, out yend);
            int nsamp = parameters.FindOneInt ("pixelsamples", 4);

            return new LowDiscrepancy (xstart, xend, ystart, yend, nsamp, camera.ShutterOpen, camera.ShutterClose);
        }
        /// <summary>
        ///     Creates a new Kd-Tree
        /// </summary>
        /// <param name="primitives">
        ///     List of primitives to include in the Tree
        /// </param>
        /// <param name="parameterSet">
        ///     Parameters for the Kd-Tree
        /// </param>
        /// <returns>
        ///     The newly created Kd-Tree
        /// </returns>
        public static IAggregate CreateAccelerator(List<IPrimitive> primitives, ParameterSet parameterSet)
        {
            int isectCost = parameterSet.FindOneInt ("intersectcost", 80);
            int traversalCost = parameterSet.FindOneInt ("traversalcost", 1);
            double emptyBonus = parameterSet.FindOneDouble ("emptybonus", 0.5);
            int maxPrimitives = parameterSet.FindOneInt ("maxprims", 1);
            int maxDepth = parameterSet.FindOneInt ("maxdepth", -1);

            return new KdTree (primitives, isectCost, traversalCost, emptyBonus, maxPrimitives, maxDepth);
        }