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

Clarification on normal Vector Initialization in forward.cu Line 207 #81

Open
zzg-zzg opened this issue Jun 16, 2024 · 2 comments
Open

Comments

@zzg-zzg
Copy link

zzg-zzg commented Jun 16, 2024

Dear Authors,

I hope this message finds you well. I am currently working with your project and have a question regarding a specific part of the code in [forward.cu.]

In the following code snippet, I noticed that the normal vector is explicitly set to {0.0, 0.0, 1.0} when transMat_precomp is not nullptr:

// Compute transformation matrix
glm::mat3 T;
float3 normal;
if (transMat_precomp == nullptr)
{
compute_transmat(((float3*)orig_points)[idx], scales[idx], rotations[idx], projmatrix, viewmatrix, W, H, T, normal);
float3 T_ptr = (float3)transMats;
T_ptr[idx * 3 + 0] = {T[0][0], T[0][1], T[0][2]};
T_ptr[idx * 3 + 1] = {T[1][0], T[1][1], T[1][2]};
T_ptr[idx * 3 + 2] = {T[2][0], T[2][1], T[2][2]};
}
else
{
glm::vec3 T_ptr = (glm::vec3)transMat_precomp;
T = glm::mat3(
T_ptr[idx * 3 + 0],
T_ptr[idx * 3 + 1],
T_ptr[idx * 3 + 2]
);
normal = make_float3(0.0, 0.0, 1.0); // why?
}

I am particularly curious about the line where normal is set to {0.0, 0.0, 1.0} when transMat_precomp is used. Could you please explain the reasoning behind this initialization? How does this affect the overall computation, and why is it different from the case where compute_transmat is called?

Thank you very much for your time and assistance. I appreciate your help in understanding this part of the code.

Best regards

@hbb1
Copy link
Owner

hbb1 commented Jun 17, 2024

It is just not supported as the comment says.

  if pipe.compute_cov3D_python:
      # currently don't support normal consistency loss if use precomputed covariance
      splat2world = pc.get_covariance(scaling_modifier)

If you are asking why we don't support normal rendering when using transMat_precomp, then the reasons behind are:

  1. I didn't find cov3D_precomp has many use cases.
  2. support normal rendering requires additional interface changes.
  3. one can also pass the normal as the color for rendering normal.
  4. I am too lazy to do so.

@zzg-zzg
Copy link
Author

zzg-zzg commented Jun 17, 2024

Thank you for your reply. I understand it now. I just want to confirm that I haven't misunderstood the correct way to compute the normal vector.

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