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); } }
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); } }
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); } }
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); } }
public bool FindBoolean(string name, bool defaultValue) { return(_geomParams.FindBoolean(name, defaultValue)); }