mitsuba2 icon indicating copy to clipboard operation
mitsuba2 copied to clipboard

- [❔ other question] Add differentiable parameter to shape

Open chx125ck opened this issue 2 years ago • 1 comments

Summary

How to add a differentiable parameter to an existing shape?

Description

I am trying to make the radius of a sphere differentiable, any hint on how to achieve this? Which parts of the code should I modify to make it work?

chx125ck avatar May 10 '22 01:05 chx125ck

Hi @chx125ck ,

In the current codebase this will require a few changes in sphere.cpp. First you will need to set the type of m_radius to Float. Then make sure it is properly exposed and handled in the traverse() and parameters_changed() method. You will probably need to change the update() method as well so that it doesn't overwrite m_radius.

More importantly, you will need to use the path-reparam integrator in order to correctly account for the discontinuities in the light transport equation when differentiating w.r.t. such parameter. Please see the pathreparam-optix7 branch for this.

Speierers avatar May 10 '22 06:05 Speierers