File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
examples_tests/22.RaytracedAO Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,10 @@ void storeAccumulation(in vec3 color, in uvec3 coord)
7979}
8080void storeAccumulation(in vec3 prev, in vec3 delta, in uvec3 coord)
8181{
82- if (any (greaterThan (abs (delta),vec3 (nbl_glsl_FLT_MIN* 16 .f))))
83- storeAccumulation(prev+ delta,coord);
82+ const vec3 newVal = prev+ delta;
83+ const uvec3 diff = floatBitsToUint(newVal)^ floatBitsToUint(prev);
84+ if (bool ((diff.x| diff.y| diff.z)& 0x7ffffff0u))
85+ storeAccumulation(newVal,coord);
8486}
8587
8688vec3 fetchAlbedo(in uvec3 coord)
@@ -324,8 +326,8 @@ void generate_next_rays(
324326 worldspaceNormal += result.aov.normal/ float (maxRaysToGen);
325327
326328 nextThroughput[i] = prevThroughput* result.quotient;
327- // do denormalized half floats flush to 0 ?
328- if (max (max (nextThroughput[i].x,nextThroughput[i].y),nextThroughput[i].z)>= exp2 (- 14 .f))
329+ // TODO: add some sort of factor to this inequality that could account for highest possible emission (direct or indirect) we could encounter
330+ if (max (max (nextThroughput[i].x,nextThroughput[i].y),nextThroughput[i].z)> exp2 (- 19 .f)) // match output mantissa (won't contribute anything afterwards )
329331 {
330332 maxT[i] = nbl_glsl_FLT_MAX;
331333 nextAoVThroughputScale[i] = prevAoVThroughputScale* result.aov.throughputFactor;
You can’t perform that action at this time.
0 commit comments