NJU-3DV / Relightable3DGaussian

[ECCV2024] Relightable 3D Gaussian: Real-time Point Cloud Relighting with BRDF Decomposition and Ray Tracing
https://nju-3dv.github.io/projects/Relightable3DGaussian/
Other
376 stars 24 forks source link

Question about the function `trace_visibility` #21

Open raynehe opened 3 months ago

raynehe commented 3 months ago

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:

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 commented 3 weeks ago

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?