-
Notifications
You must be signed in to change notification settings - Fork 230
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
Projective Sampling Integrators #997
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
njroussel
force-pushed
the
projective
branch
8 times, most recently
from
December 5, 2023 18:22
ac399af
to
045e03d
Compare
njroussel
force-pushed
the
projective
branch
2 times, most recently
from
December 8, 2023 09:09
e77bd4d
to
9000195
Compare
njroussel
force-pushed
the
projective
branch
3 times, most recently
from
December 9, 2023 13:22
b5207a2
to
63d15da
Compare
Speierers
reviewed
Dec 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stuff
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
…nuity_types` Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
…apes. Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
…houette` structs Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
This commit also updates the `resources/data` submodule Co-authored-by: Nicolas Roussel <n.roussel13@gmail.com>
…ew BibTeX references, update tutorials submodule
njroussel
force-pushed
the
projective
branch
from
December 11, 2023 14:47
e6fe424
to
f1d0f66
Compare
njroussel
force-pushed
the
projective
branch
from
December 11, 2023 15:34
f1d0f66
to
b704e26
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short Description
This changes Mitsuba's way of handling visibilty-induced discontinuities for differentiable rendering. It removes all the existing code relating reparameterizations and introduces a new architecture for path-space/projective-sampling styled integrators.
Overview
The overall architecture is defined around the ability to generate boundary segments and estimate contributions of paths that have such a boundary segment. Briefly, a boundary segment is a point on a shape with a tangential direction to the surface of the shape at that point.
Refer to the reference API for a full description of the new interface. This text below is meant as gentle introduction to the new architecture.
1. Boundary segments:
We first have a new struct/record to hold boundary segments. This is introduced with a
mi.SilhouetteSample3f
object which is used for the following:2. Shapes:
Every shape has 4 new methods:
Shape.sample_silhouette()
:mi.SilhouetteSample3f
)Shape.invert_silhouette_sample()
:mi.SilhouetteSample3f
) to a point in boundary space (unit cube)Shape.precompute_silhouette()
:Shape.sample_precomputed_silhouette()
:mi.SilhouetteSample3f
.The first two methods create a bijective mapping between boundary segments and boundary sample space. Assuming we have some guiding structure in boundary sample space, these two methods will allows us to fill the guiding structure (take a boundary segment and convert it to boundary sample space) or sample from it (take a boundary sample space point and get its corresponding boundary segment).
The last two methods are a specialization of the silhouette sampling problem. For the primary visibility discontinuities, it is more efficient to have specialized methods as the viewpoint for the silhouette is already know (it's the sensor's pinhole).
3. Scene:
The
Scene
now also has the same two first methods as the shapes (sample_silhouette
andinvert_silhouette_sample
). It will dispatch sampling or inverse sampling requests to all the shapes that are being differentiated in the scene. (We can weigh each shape: it does not have to be a uniform sampling).4. Integrator:
With this in place we define a new
PSIntegrator
interface (PS stands for path-space and projective sampling - very convenient). It still has the typical:sample()
render()
render_forward()
render_backward()
methods.
But in addition we add the following:
render_ad
:This method is more of a intermediary/utiliy method for
render_forward
andrender_backward
. Instead of just calling thesample
method it will also sample boundary paths. In short, this method will accumulate 3 different types of paths: continuous, directly visible discontinuities, indirectly visible discontinuities. The continuous paths are just normal calls tosample
, whereas the two types of discontinuous paths are paths that contain exactly one boundary segment. This method is defined directly in thePSIntegrator
interface.sample_radiance_difference
:We need the ability to construct a full light path from a boundary segment. This method samples a path from the boundary segment to an emitter and measures the radiance difference depending on whether or not hat we had hit the boundary segment's shape or if we barely grazed it.
sample_importance
:This is the counterpart to the previous method, it samples a path from the boundary segment to an emitter.
The last two methods are not defined in the base class and must be overridden by integrators.
Much of the details of sampling boundary segments, and using projective sampling is held in a separate new file
projective.py
.Two new integrators are shipped in this PR:
direct_projective
andprb_projective
.5. Guiding:
A new file
guiding.py
was added in this PR. It holds different guiding data structures that should be used by newPSIntegrator
s.Important notes/breaking changes
Reparameterizations were completely removed from the codebase. This has the following "unexpected" consequences:
sdfgrid
andinstance
plugins are no longer differentiablecheckerboard
texture, anearest
interpolation scheme on a texture, or even non-smooth shape surface normals) are not handled.We plan on re-adding these features to the new integrators in a future release.
The
batch
sensor cannot be used with the new integrator when primarily visible discontinuities are needed. This will also be fixed in a future release.The new interfaces, especially for guiding structures, still have some rough edges. We expect these to still change quite a bit in the near future, especially as we add-in the lost features mentioned above.