Skip to content

Commit

Permalink
Use the integer representation to nudge tmin instead of a fixed epsil…
Browse files Browse the repository at this point in the history
…on. Update the reference images where needed.

Signed-off-by: Tim Grant <[email protected]>
  • Loading branch information
tgrant-nv committed Oct 31, 2024
1 parent f2df957 commit d43b48c
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/testrender/cuda/optix_raytracer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,15 @@ Scene::intersect(const Ray& r, const float tmax, const unsigned skipID1,
// Trace the ray against the scene. If the ID for the hit matches skipID1,
// "nudge" the ray forward by adjusting tmin to exclude the hit interval
// and try again.
const float epsilon = 1e-6f;
const int num_attempts = 2;
float tmin = epsilon;
float tmin = 0.0f;
for (int attempt = 0; attempt < num_attempts; ++attempt) {
Payload payload;
payload.hit_id = ~0u;
trace_ray(handle, payload, V3_TO_F3(r.origin), V3_TO_F3(r.direction),
tmin);
if (payload.hit_id == skipID1) {
tmin = payload.hit_t + 2.0f * epsilon;
tmin = __uint_as_float(__float_as_uint(payload.hit_t) + 1u);
} else if (payload.hit_id != ~0u) {
return { payload.hit_t, payload.hit_u, payload.hit_v,
payload.hit_id };
Expand Down
Binary file modified testsuite/render-bunny/ref/out_optix_alt.exr
Binary file not shown.
Binary file modified testsuite/render-microfacet/ref/out_optix_alt.exr
Binary file not shown.
Binary file modified testsuite/render-mx-burley-diffuse/ref/out_optix_alt.exr
Binary file not shown.
Binary file modified testsuite/render-mx-conductor/ref/out_optix_alt.exr
Binary file not shown.
Binary file modified testsuite/render-mx-dielectric-glass/ref/out_optix_alt.exr
Binary file not shown.
Binary file modified testsuite/render-mx-generalized-schlick/ref/out_optix_alt.exr
Binary file not shown.
Binary file modified testsuite/render-mx-layer/ref/out_optix_alt.exr
Binary file not shown.
Binary file modified testsuite/render-mx-sheen/ref/out_optix_alt.exr
Binary file not shown.

0 comments on commit d43b48c

Please sign in to comment.