コード例 #1
0
ファイル: RandomWalk.cs プロジェクト: pgrit/SeeSharp
        public virtual RgbColor StartFromEmitter(EmitterSample emitterSample, RgbColor initialWeight)
        {
            isOnLightSubpath = true;
            Ray ray = Raytracer.SpawnRay(emitterSample.Point, emitterSample.Direction);

            return(ContinueWalk(ray, emitterSample.Point, emitterSample.Pdf, initialWeight, 1));
        }
コード例 #2
0
ファイル: CachedRandomWalk.cs プロジェクト: pgrit/SeeSharp
 public override RgbColor StartFromEmitter(EmitterSample emitterSample, RgbColor initialWeight)
 {
     nextReversePdf = 0.0f;
     // Add the vertex on the light source
     lastId = cache.AddVertex(new PathVertex {
         // TODO are any of these actually useful? Only the point right now, but only because we do not pre-compute
         //      the next event weight (which would be more efficient to begin with)
         Point              = emitterSample.Point,
         PdfFromAncestor    = 0.0f,           // unused
         PdfReverseAncestor = 0.0f,           // unused
         Weight             = RgbColor.Black, // the first known weight is that at the first hit point
         AncestorId         = -1,
         Depth              = 0
     }, pathIdx);
     return(base.StartFromEmitter(emitterSample, initialWeight));
 }