Skip to content

How to optimize variables in custom mitsuba plugins ? #1315

Answered by njroussel
XiaoXinyyx asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, in the constructor we should have:

self.tint = mi.Color3f(props['tint'])

and in the initialization of the tint:

tint = mi.Color3f(0.9, 0.2, 0.2)
dr.enable_grad(tint)

Otherwise internally, the system will keep thinking that self.tint is a drjit.scalar.Array3f64 (you can print type(self.tint) to check that it is a drjit.*.ad type).

I'll change this in the tutorial, so that it is less confusing even though we don't need it to be differentiated.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@XiaoXinyyx
Comment options

@njroussel
Comment options

Answer selected by XiaoXinyyx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants