mitsuba-renderer / mitsuba2

Mitsuba 2: A Retargetable Forward and Inverse Renderer
Other
2.05k stars 266 forks source link

Geometric differentiation does not yet work #26

Closed lvjiahui closed 3 years ago

lvjiahui commented 4 years ago

In Inverse rendering example invert_cbox.py and invert_bunny.py, if I change the differentiated parameters to vertex_positions ( which have asterisk (*) on the left ), I receive the following error:

RuntimeError: set_gradient(): no gradients are associated with this variable (a prior call to requires_gradient() is required.)

I wonder why no gradients when they are differentiable? How should I differentiate with them? Thanks!

lvjiahui commented 4 years ago

Tutorial says I don't need to call requires_gradient() when I use optimizer. If I call it manually the error is still the same.

wjakob commented 4 years ago

Hi @lvjiahui,

differentiation of shapes in Mitsuba 2 requires a plugin that is based on a separate paper (http://rgl.epfl.ch/publications/Loubet2019Reparameterizing). We have not released this plugin yet, but we are about to do so. I will ping this ticket once it's ready.

Cheers, Wenzel

LeonidMill commented 4 years ago

Hi @wjakob,

will this plugin also provide a possibility to learn the weight texture for a blended material? And is there a rough timeline for the release? Thanks!

mmgutsche commented 4 years ago

Any update on this?

merlinND commented 4 years ago

Hi @mmgutsche, You can track progress on this feature in PR #44.