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

- [❔ other question] Add differentiable parameter to shape #595

Open
chx125ck opened this issue May 10, 2022 · 1 comment
Open

- [❔ other question] Add differentiable parameter to shape #595

chx125ck opened this issue May 10, 2022 · 1 comment

Comments

@chx125ck
Copy link

chx125ck commented May 10, 2022

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?

@Speierers
Copy link
Member

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.

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