Exemplo n.º 1
0
 public static Aggregate MakeAccelerator(string name, ParamSet parameters, 
     IEnumerable<Primitive> primitives)
 {
     switch (name)
     {
         case "grid" :
         {
             var refineImmediately = parameters.FindBoolean("refineimmediately", false);
             return new GridAccelerator(primitives, refineImmediately);
         }
         default:
             throw new ArgumentException("Unknown accelerator: " + name);
     }
 }
Exemplo n.º 2
0
        public static Aggregate MakeAccelerator(string name, ParamSet parameters,
                                                IEnumerable <Primitive> primitives)
        {
            switch (name)
            {
            case "grid":
            {
                var refineImmediately = parameters.FindBoolean("refineimmediately", false);
                return(new GridAccelerator(primitives, refineImmediately));
            }

            default:
                throw new ArgumentException("Unknown accelerator: " + name);
            }
        }
Exemplo n.º 3
0
        public static Sampler MakeSampler(string name, ParamSet parameters, Film film, Camera camera)
        {
            switch (name)
            {
            case "stratified":
            {
                var jitter       = parameters.FindBoolean("jitter", true);
                var xSamples     = parameters.FindInt32("xsamples", 2);
                var ySamples     = parameters.FindInt32("ysamples", 2);
                var sampleExtent = film.SampleExtent;
                return(new StratifiedSampler(sampleExtent, xSamples, ySamples, jitter,
                                             camera.ShutterOpen, camera.ShutterClose));
            }

            default:
                throw new ArgumentException("Unknown sampler: " + name);
            }
        }
Exemplo n.º 4
0
 public static Sampler MakeSampler(string name, ParamSet parameters, Film film, Camera camera)
 {
     switch (name)
     {
         case "stratified":
         {
             var jitter = parameters.FindBoolean("jitter", true);
             var xSamples = parameters.FindInt32("xsamples", 2);
             var ySamples = parameters.FindInt32("ysamples", 2);
             var sampleExtent = film.SampleExtent;
             return new StratifiedSampler(sampleExtent, xSamples, ySamples, jitter, 
                 camera.ShutterOpen, camera.ShutterClose);
             }
         default:
             throw new ArgumentException("Unknown sampler: " + name);
     }
 }
Exemplo n.º 5
0
 public bool FindBoolean(string name, bool defaultValue)
 {
     return(_geomParams.FindBoolean(name, defaultValue));
 }