mitsuba-blender icon indicating copy to clipboard operation
mitsuba-blender copied to clipboard

Nodes: Introduce custom shader nodes for Mitsuba BSDFs

Open ros-dorian opened this issue 2 years ago • 6 comments

Although Mitsuba BSDFs can be approximated using Blender shader nodes during import, the conversion is not flawless and leads to inconsistencies when exporting.

Therefore, we introduce custom shader nodes that perfectly match Mitsuba's BSDFs and textures. This has the great advantages to allow for a perfect import/export loop and finer control over the look of each material.

This feature is enabled by first selecting the Mitsuba rendering engine and then clicking on Use Mitsuba Material Nodes in the material sidebar while in the shading tab.

material_editor

The node editor then provides access to the wide library of BSDFs available in Mitsuba in the same fashion as Blender's Cycles.

nodes

ℹ️ Note that this feature does not implement rendering and the users can still use the experimental Cycles conversion to visualize the materials in a scene.

ros-dorian avatar Aug 25 '22 18:08 ros-dorian

Hi, I think it should be possible to implement some of the Blender nodes in mitsuba using a custom bsdf. I have written a crude prototype for this idea. There are some problems that probably cannot be fixed without some changes to mitsuba though. Since mitsuba uses megakernels it would be interesting to see what the performance is for large procedural materials.

DoeringChristian avatar Nov 11 '22 22:11 DoeringChristian

Hello,

Thank you for the comment. This could be a nice complementary feature to this PR. Could you maybe open a new PR with your example factored as a Blender shader node (built on top of what is implemented in this PR). You probably need to wait until this PR is merged first though :)

Cheers!

ros-dorian avatar Nov 13 '22 11:11 ros-dorian

@ros-dorian Is there a plan to merge this?

arpit15 avatar Sep 17 '23 21:09 arpit15

It will be a super useful feature ! @ros-dorian Some update about it ?

nebnes avatar Mar 28 '24 10:03 nebnes

Hi @nebnes,

Thanks for your interest. The only reason this PR is not merged is because of some memory corruptions inside Blender which is caused by the custom node editor. It seems to also be an issue with other add-ons that have the same functionality. I did not try to see if the problem still occurs with more recent Blender versions (or if this code is still compatible altogether).

I will spend a bit of time updating the PR and do some testing and I will report my findings here.

Cheers!

ros-dorian avatar Mar 28 '24 11:03 ros-dorian

Hi @ros-dorian, Thanks a lot for the update :)

nebnes avatar Mar 29 '24 15:03 nebnes