Skip to content

Commit

Permalink
fix MIS bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrit committed Jan 22, 2024
1 parent 33f43d5 commit 0e2a7d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SeeSharp/Integrators/Common/RandomWalk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public virtual float ComputeSurvivalProbability(ref RandomWalk<PayloadType> walk
/// Initializes a new random walk
/// </summary>
/// <param name="scene">The scene</param>
/// <param name="rng">Reference to the random number generator that is used to sample the path</param>
/// <param name="maxDepth">Maximum number of edges along the path</param>
/// <param name="modifier">Defines callbacks to be invoked at the scattering events</param>
public RandomWalk(Scene scene, ref RNG rng, int maxDepth, RandomWalkModifier modifier = null) {
this.scene = scene;
this.maxDepth = maxDepth;
Expand Down Expand Up @@ -185,7 +187,7 @@ RgbColor ContinueWalk(Ray ray, SurfacePoint previousPoint, float pdfDirection, R
// Continue the path with the next ray
prefixWeight *= dirSample.Weight / survivalProb;
depth++;
pdfDirection = dirSample.PdfForward * survivalProb;
pdfDirection = dirSample.PdfForward;
previousPoint = hit;
ray = Raytracer.SpawnRay(hit, dirSample.Direction);
}
Expand Down

0 comments on commit 0e2a7d8

Please sign in to comment.