Exemplo 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;
     }
 }
Exemplo n.º 2
0
 public PPMPathBuffer(PPMContext ctx)
 {
     context = ctx;
 }
Exemplo 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);
        }
Exemplo 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);
 }