Replies: 2 comments
-
Hi @skosch Adding new geometry primitives/types in Mitsuba is very complex. I would avoid that if possible. However, you can definitely define a parametric function that generates your bitmap. This should greatly help to constrain the optimization. Effectively you'd have a few latent parameters that control your function that is then used to generate a bitmap which finally is applied as a height map to your mesh. |
Beta Was this translation helpful? Give feedback.
-
Hi @skosch, you could take a look at this repository, specifically the script Unfortunately, the implementation is based on PyTorch and only dispatches to Mitsuba for rendering. But it shouldn't be too hard to port the functions to Dr.Jit. Let me know if you have any questions (I am the author of the code). |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I am trying to use Mitsuba3 to design a freeform mirror shape (which I hope to 3D print later) such that it reflects an incoming spotlight in a very particular way.
Following the tutorials, I tried starting out with a mesh for the mirror, and then optimizing by shifting around the vertex positions themselves or applying and optimizing a heightmap texture (as in the "Caustics optimization" example).
This works, but just barely: I can see that the resulting heightmap is going in the right direction, but it's full of strange artifacts, and quite honestly it feels silly to use a high resolution mesh/bitmap to define the mirror shape in my case, when a parametric function would take much fewer parameters and have much cleaner, continuous normals.
Unfortunately, I don't think the B-Spline curve would work for my case, since my mirror is non-spherical along both axes. I do think something like a NURBS surface would work well, though; or alternatively a heightmap expressed as a high-degree polynomial over the X and Y coordinates.
Am I thinking about this wrong? If not, is there some easy-ish way to achieve this in Python? I would be grateful for any pointers.
Beta Was this translation helpful? Give feedback.
All reactions