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

- [✨ feature request] Why roughplastic's alpha is not differentiable? #440

Closed
LZleejean opened this issue May 26, 2021 · 1 comment
Closed

Comments

@LZleejean
Copy link

Summary

Everything is ok but can't optimize roughplastic's alpha.

Description

I tried create two parameters to be optimized which is roughness and diffuse reflectance but failed. Because roughplastic's alpha is not differentiable.

Steps to reproduce

@Speierers
Copy link
Member

Hi @LZleejean ,

Please see #391 for this.

Basically those are not differentiable as the roughplastic BSDF pre-computes tables in its constructor, which would need to be updated whenever you update the alpha value. We are still investigating better solutions to also make this parameter spatially-varying.

This being said, with only a few changes, you should be able to turn this member into a differentiable type (ScalarFloat -> Float), expose it in the RoughPlasticBSDF::traverse call back and move the table computation code to RoughPlasticBSDF::parameters_changed() so that it gets updated when necessary.

Good luck!

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