Skip to content

Commit

Permalink
gi: abort path tracing if throughput is too small
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed May 26, 2024
1 parent 5376248 commit 9f0004a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gi/shaders/rp_main.rgen
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ vec3 evaluate_sample(vec3 ray_origin,
}
#endif

// Terminate path if throughput is too small
if (length(rayPayload.throughput) < 1e-9)
{
rayPayload.bitfield |= SHADE_RAY_PAYLOAD_TERMINATE_FLAG;
}

// Russian roulette
if (bounce > rrBounceOffset)
{
Expand Down

0 comments on commit 9f0004a

Please sign in to comment.