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

Using sigmoid(rgb) or clamp(rgb) is correct? #10

Closed
lukasHoel opened this issue May 30, 2022 · 2 comments
Closed

Using sigmoid(rgb) or clamp(rgb) is correct? #10

lukasHoel opened this issue May 30, 2022 · 2 comments

Comments

@lukasHoel
Copy link

lukasHoel commented May 30, 2022

Hi,

thanks for your awesome work!
in the Plenoctree paper and in this implementation, you apply the sigmoid function to the SH sum:

comp_rgb = (weights[Ellipsis, None] * jax.nn.sigmoid(rgb)).sum(axis=-2) # Accumulated color over the samples, ignoring background

Whereas in the CUDA implementation it seems to me like you apply clamp(x+0.5, 0, inf):
https://github.com/sxyu/svox2/blob/59984d6c4fd3d713353bafdcb011646e64647cc7/svox2/csrc/render_lerp_kernel_cuvol.cu#L102
outv += weight * fmaxf(lane_color_total + 0.5f, 0.f); // Clamp to [+0, infty)

What's the reason for the different implementations and which is more accurate?
If it is the second one: why do you add constant 0.5f, whats the intuition for this factor?

Thanks a lot! :)

@sarafridov
Copy link
Owner

Good eye! The short answer is that we changed it from sigmoid to just clamp in an attempt to be more physically accurate, with the idea being that actual radiance is unbounded above and the clipping to [0,1] happens at the camera sensor. The 0.5 constant was just to make the default starting color gray rather than black, but it's not too important. This sigmoid vs clamp doesn't seem to make much difference; both versions work ok in practice. Feel free to play around with it :)

@lukasHoel
Copy link
Author

Thank you very much for clarifying!

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