public override void Advance(RayBuffer rayBuffer, SampleBuffer consumer) { base.Advance(rayBuffer, consumer); //Propagation var rayHit = rayBuffer.rayHits[RayIndex]; depth++; var point = new ScatteringPoint(); if (rayHit.Miss() || depth > scene.MaxPathDepth) { point.HitType = IntersectionType.Environment; point.IncomingDirection = -PathRay.Dir; this.SplatScatteringPoint(point, consumer); return; } }
private void SplatScatteringPoint(ScatteringPoint point, SampleBuffer sb) { switch (point.HitType) { case IntersectionType.Environment: SampledSpectrum env; this.SampleEnvironment(ref point.IncomingDirection, out env); this.Radiance += Throughput * env; break; } }