mitsuba-renderer / drjit

Dr.Jit — A Just-In-Time-Compiler for Differentiable Rendering
BSD 3-Clause "New" or "Revised" License
603 stars 45 forks source link

Add `Array6*` bindings. #259

Closed rtabbara closed 3 months ago

rtabbara commented 3 months ago

For Mitsuba suite of SGGX distribution functons we need this type to be exposed

wjakob commented 3 months ago

A quick question: Could we implement some kind of auto-conversion to ArrayXf or some other workaround (e.g. a tuple, or 2x Array3fs)? I don't see us using the Array6* types for actual arithmetic much, and there is a non-negligible cost to adding another one of these (plus, it's weird to have 0-4 and then 6 without 5 ;)). AFAIK we're just using this type for temporary storage/access and perhaps a tiny bit of SGD math.

wjakob commented 3 months ago

If we absolutely need it, then the binding could be done on demand from Mitsuba, rather than Dr.Jit itself. The drjit/include/python.h file exposes functionality to create extra bindings when need it.

dvicini commented 3 months ago

I think we have some flexibility in the API for the SGGX sampling functions. I wouldn't mind if those were changed to pass 2 x Array3fs. There is a natural split here in the first 3D vector representing diagonal, and the second representing off-diagonal elements

rtabbara commented 3 months ago

Base on the discussion, I've opened up a PR in Mitsuba 1276 instead and will close off this PR