Esempio n. 1
0
 public override void InitPath(IPathProcessor buffer)
 {
     base.InitPath(buffer);
     depth = 0;
     specularBounce = false;
     pathWeight = 1.0f;
     this.Sample = pathIntegrator.Sampler.GetSample(null);
     scene = pathIntegrator.Scene;             
     if (this.engine == null)
     {
         var ppb = buffer as PPMPathBuffer;
         this.engine = ppb.context;
     }
 }
Esempio n. 2
0
 public PPMPathBuffer(PPMContext ctx)
 {
     context = ctx;
 }
Esempio n. 3
0
        public void SplatHitPoints(List<PPMHitPoint> hitPoints, PPMContext engine)
        {
            Tracer.TraceLine("Start splatting hitpoints");
            var sb = GetFreeSampleBuffer();
            int nonZero = 0;
            /*
            Parallel.For(0, hitPoints.Count, index =>
            {
                var ppmHitPoint = hitPoints[index];
                if (ppmHitPoint.accumPhotonCount > 0)
                {
                    //Debugger.Break();
                    nonZero++;
                }
                sb.SampleHitPoint(ppmHitPoint, engine.PhotonMapPhotons);

                if (sb.IsFull())
                {
                    SplatSampleBuffer(true, sb);
                    FreeSampleBuffer(sb);
                    sb = GetFreeSampleBuffer();
                }
            });
            */
            for (int index = 0; index < hitPoints.Count; index++)
            {
                var ppmHitPoint = hitPoints[index];
                if (ppmHitPoint.accumPhotonCount > 0)
                {
                    //Debugger.Break();
                    nonZero++;
                }
                sb.SampleHitPoint(ppmHitPoint, engine.PhotonsGathered);

                if (sb.IsFull())
                {
                    SplatSampleBuffer(true, sb);
                    FreeSampleBuffer(sb);
                    sb = GetFreeSampleBuffer();
                }
            }

            Tracer.TraceLine("Non zero splatted hitpoints {0}", nonZero);
        }
Esempio n. 4
0
 public PPMDeviceRenderThread(int index, IIntersectionEngine device, RayEngineScene scn, bool lowLatency, IImageFilm pixelDevice, ISampler sampler, SurfaceSampler ss, PPMContext ctx, IFrameManager frameManager)
     : base(index, scn)
 {
     this.context = ctx;
     Init(device, lowLatency, pixelDevice, sampler, ss);
 }