Skip to content

Commit

Permalink
[bug] fix incorrect per-voxel pathlength when mua->0, fangq/mcx#164
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jan 22, 2025
1 parent 3640d79 commit febd932
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mcx_core.cl
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ __kernel void mcx_main_loop(__global const uint* media,
if (GPU_PARAM(gcfg, outputtype) == otEnergy) {
weight = w0 - p.w;
} else if ((bool)(GPU_PARAM(gcfg, outputtype) == otFluence) || (bool)(GPU_PARAM(gcfg, outputtype) == otFlux)) {
weight = (prop.x * f.z < 0.001f) ? (w0 * f.z) : ((w0 - p.w) / (prop.x));
weight = (prop.x < EPS) ? (w0 * pathlen) : ((w0 - p.w) / (prop.x));
} else if (GPU_PARAM(gcfg, seed) == SEED_FROM_FILE) {
if (GPU_PARAM(gcfg, outputtype) == otJacobian) {
weight = replayweight[(idx * gcfg->threadphoton + min(idx, gcfg->oddphoton - 1) + (int)f.w) - 1] * pathlen;
Expand Down

0 comments on commit febd932

Please sign in to comment.