Ejemplo n.º 1
0
 public override void InitPath(IPathProcessor buffer)
 {
     base.InitPath(buffer);
     this.scene = pathIntegrator.Scene;
     this.Radiance = new RgbSpectrum(0f);
     this.Throughput = new RgbSpectrum(1f);
     this.PathState = PathTracerPathState.EyeVertex;
     if (this.secRays == null)
     {
         this.secRays = new ShadowRayInfo[scene.ShadowRaysPerSample];
         continueRays = new ShadowRayInfo[scene.ShadowRaysPerSample];
     }
     if (volumeComp == null)
     {
         volumeComp = new VolumeComputation(scene.VolumeIntegrator);
     }
     contCount = 0;
     this.Sample = pathIntegrator.Sampler.GetSample(this.Sample);
     pathIntegrator.Scene.Camera.GetRay(Sample.imageX, Sample.imageY, out this.PathRay);
     this.RayIndex = -1;
     this.pathWeight = 1.0f;
     this.tracedShadowRayCount = 0;
     this.depth = 0;
     this.specularBounce = true;
     this.inVolume = false;
 }
Ejemplo n.º 2
0
        public override void InitPath(IPathProcessor buffer)
        {
            base.InitPath(buffer);
            this.scene = pathIntegrator.Scene;
            this.Radiance = new RgbSpectrum(0f);
            this.Throughput = new RgbSpectrum(1f);
            this.PathState = PathTracerPathState.EyeVertex;
            if (this.secRays == null)
            {
                this.secRays = new ShadowRayInfo[scene.ShadowRaysPerSample];
                continueRays = new ShadowRayInfo[scene.ShadowRaysPerSample];
            }
            if (paths == null)
            {
                paths = new List<PathInfo>();
            }
            if (CurrentVertices == null)
            {
                CurrentVertices = new List<PathVertex>();
            }
            else
            {
                CurrentVertices.Clear();
            }

            contCount = 0;
            this.Sample = pathIntegrator.Sampler.GetSample(this.Sample);

            pathIntegrator.Scene.Camera.GetRay(Sample.imageX, Sample.imageY, out this.PathRay);
            this.EyeSample = new CameraSample()
            {
                imageX = (float)Sample.imageX,
                imageY = (float)Sample.imageY,
                EyeRay = this.PathRay
            };
            this.RayIndex = -1;
            this.pathWeight = 1.0f;
            this.tracedShadowRayCount = 0;
            this.depth = 0;
            this.specularBounce = true;
        }