Beispiel #1
0
        public Tracer(Construction construction, IMaterial ambient, IRandomFactory randomFactory,
                      IHemispherecalSamplerFactory samplerFactory, double maxRadiance)
        {
            this.construction  = construction;
            this.ambient       = ambient;
            this.randomFactory = randomFactory;
            this.sampler       = samplerFactory.makeSampler();
            this.maxRadiance   = maxRadiance;

            this.DEFAULT_FILTER = (t) => false;
        }
Beispiel #2
0
        public static Vector3D sampleWi(Vector3D n, IHemispherecalSampler sampler, IRandomFactory randomFactory)
        {
            Vector3D x, y;

            MathUtil.generateXYFromZ(n, out x, out y);

            Vector3D sample = sampler.sample(randomFactory);
            Vector3D wi     = sample.X * x + sample.Y * y + sample.Z * n;

            wi.Normalize();

            return(wi);
        }
 public HemiSamplerFactory()
 {
     this.sampler = new SimpleHemispherecalSampler();
 }