NVIDIA / gvdb-voxels

Sparse volume compute and rendering on NVIDIA GPUs
Other
679 stars 145 forks source link

Grid bricks appear to cast shadows in Optix #93

Closed digbeta closed 4 years ago

digbeta commented 4 years ago

Below is a scene consisting of a single GVDB volume bunny in the foreground with a cube mesh in the background. The bottom left corner is an Optix preview of the scene and the main screen shows normal GVDB scene rendering. Note the space in the top right of the Optix preview is lighter than the shadows that appear to be cast from the bricks against the mesh.

image

Looking more closely at the cube mesh, you can see it appears that the occupied brick is actually casting a shadow against the side of the box mesh:

image

Then I disable shadow rays in the Optix surface intersector program for the mesh geometry:

#if 0  //debug - disable shadow rays
    if (rayinfo.depth < SHADOW_DEPTH) {
        // shadow sample        
        for (int i = 0; i < 2; i++) {
            lightdir = normalize(normalize(light_pos - fhp) + jitter_sample() * mat.light_width);
            shadowclr *= TraceRay(fhp + lightdir*mat.shadow_bias, lightdir, rayinfo.depth + 1, SHADOW_RAY, refldist);
        }
    }
#endif

And here's what I get as a result:

image

Note the bricks no longer appear to cast shadows against the mesh.

Any ideas what might be happening? Thanks in advance!

NBickford-NV commented 4 years ago

Hi digbeta!

I think the bugs in SetTransform and in OptiX should be fixed now - does this happen to fix this issue? (See main comment at https://github.com/NVIDIA/gvdb-voxels/issues/89#issuecomment-656899431.)

Thanks!

digbeta commented 4 years ago

Hi, Neil!

You’ve been busy! I just saw all the great updates... I will dive into these on Monday and will report back to its any issues!

Thanks again!

On Fri, Jul 10, 2020 at 5:30 PM Neil Bickford notifications@github.com wrote:

Hi digbeta!

I think the bugs in SetTransform and in OptiX should be fixed now - does this happen to fix this issue? (See main comment at #89 (comment) https://github.com/NVIDIA/gvdb-voxels/issues/89#issuecomment-656899431.)

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NVIDIA/gvdb-voxels/issues/93#issuecomment-656899975, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECSDEN2SH4XKFTNNCSPXCTR26B6JANCNFSM4OCDZ7EQ .

digbeta commented 4 years ago

This issue appears to have been resolved in the latest batch of fixes. Closing the issue. Thank you!