From 0e2a7d81c94ee5741823544b2737ecce8b3ca9db Mon Sep 17 00:00:00 2001 From: Pascal Grittmann Date: Mon, 22 Jan 2024 23:58:46 +0100 Subject: [PATCH] fix MIS bug --- SeeSharp/Integrators/Common/RandomWalk.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SeeSharp/Integrators/Common/RandomWalk.cs b/SeeSharp/Integrators/Common/RandomWalk.cs index af9ff20..9dc9756 100644 --- a/SeeSharp/Integrators/Common/RandomWalk.cs +++ b/SeeSharp/Integrators/Common/RandomWalk.cs @@ -58,7 +58,9 @@ public virtual float ComputeSurvivalProbability(ref RandomWalk walk /// Initializes a new random walk /// /// The scene + /// Reference to the random number generator that is used to sample the path /// Maximum number of edges along the path + /// Defines callbacks to be invoked at the scattering events public RandomWalk(Scene scene, ref RNG rng, int maxDepth, RandomWalkModifier modifier = null) { this.scene = scene; this.maxDepth = maxDepth; @@ -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); }