uci-rendering / psdr-cuda

Path-space differentiable renderer
BSD 3-Clause "New" or "Revised" License
155 stars 11 forks source link

Gradient flow boundaries #2

Closed nkyriazis closed 2 years ago

nkyriazis commented 2 years ago

Going through the example I understand that one has the option to compute gradients for scene parameters, treating scene constituents as variables (I'm not sure what constituents are amenable to gradient computation).

What I'm yet to understand is whether one can also consider procedural scenes, i.e. scenes that are functions of variables outside the idiomatic scene representation.

A specific example

What if I had a regularized procedural surface, e.g. a sphere, controlled by its position and radius. How would I write the loss in PyTorch?

andyyankai commented 2 years ago

We don't currently support procedural surfaces. The currently supported object is mesh only. Such loss function can be simply image/geometric silhouette. Or maybe some laplacian-related loss function?

nkyriazis commented 2 years ago

Thank you for the answer. Is this limitation due to a fundamental reason? I.e. would it be reasonable to expect that this can be worked out in the near future?

andyyankai commented 2 years ago

Sampling for the boundary term in the PSDR framework for non-discrete manifold is a pretty hard question. It might take a while to figure this out and implement these on GPU :) So I guess we won't have this in the near future. But I am still interested in taking a look at this problem soon.