Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the function trace_visibility #21

Open
raynehe opened this issue May 8, 2024 · 1 comment
Open

Question about the function trace_visibility #21

raynehe opened this issue May 8, 2024 · 1 comment

Comments

@raynehe
Copy link

raynehe commented May 8, 2024

Hello, thanks for the wonderful work!

Sorry to bother, I'm trying to use bvh ray tracing to calculate the shadow effect, and I'm a little confused about the trace_visibility function here. I have two questions:

Question 1

In the code the ray direction are randomly sampled, what's the reason for this:

rays_d = torch.randn_like(rays_o)

Question 2

My goal is to compute the visibility of all gaussian points under a point light (in order to calculate the shadow effect).

def trace_visibility(self, rays_o, rays_d, means3D, symm_inv, opacity, normals):

When I set:

  • rays_o as the position of the point light
  • means3D as gaussian positions
  • rays_d as means3D-rays_o

And add these lines in the trace_bvh_opacity_cuda function (which means the light reaches the targeted gaussians):

if (object_id2==idx){
     rendered_opacity[idx] = ray_opacity*opacities[object_id2];
     return;
}

I always get an all-zero visibility. I'm wondering if I set the parameters wrong. Could you give me a hint it?

Sorry for the bother again! I'm looking forward to your reply!

@cxzhou35
Copy link

cxzhou35 commented Aug 7, 2024

Hello, thanks for the wonderful work!

Sorry to bother, I'm trying to use bvh ray tracing to calculate the shadow effect, and I'm a little confused about the trace_visibility function here. I have two questions:

Question 1

In the code the ray direction are randomly sampled, what's the reason for this:

rays_d = torch.randn_like(rays_o)

Question 2

My goal is to compute the visibility of all gaussian points under a point light (in order to calculate the shadow effect).

def trace_visibility(self, rays_o, rays_d, means3D, symm_inv, opacity, normals):

When I set:

  • rays_o as the position of the point light
  • means3D as gaussian positions
  • rays_d as means3D-rays_o

And add these lines in the trace_bvh_opacity_cuda function (which means the light reaches the targeted gaussians):

if (object_id2==idx){
     rendered_opacity[idx] = ray_opacity*opacities[object_id2];
     return;
}

I always get an all-zero visibility. I'm wondering if I set the parameters wrong. Could you give me a hint it?

Sorry for the bother again! I'm looking forward to your reply!

Same results with yours, I also get an all-zero visibility map with ray-tracing. Have you found some solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants