Building shaders in mat context for 3Delight

   2743   2   0
User Avatar
Member
30 posts
Joined: July 2012
Offline
I have been migrating a tutorial from Mantra to 3Delight. There is a limited number of 3Delight nodes you can use in a mat context. I was hoping you could mix houdini nodes with the 3Delight nodes: e.g. do some calculation to build say a value for the vector colour attribute, then convert the vector to 3 floats, the use the 3Delight FloatToColour node to build a 3Delight Colour object. The nodes join, types match i.e. the output of the Manta node is floats the input to the 3Delight node is floats, but the values get ignored.

It is not clear to me if this is because 3Delight is still Beta so not everything works as expected - or if by design this plugging of nodes is just never going to work? I would imagine the Houdini node interpreter would have no problem passing the float along so it must be 3Delight that is failing to get the plumbing to work.

The is a question in principle since I have worked around in 2 ways: 3Delight has a (horrible) condition node that can be used for the logic I needed (but doing so involves you implementing the logic 2x - once for Mantra once for 3Delight). My second solution was to take the nodes out of the mat context and put them in a VOP in the obj context and set an attribute. In the mat context you just then read the attribute using the supplied 3Delight node. This either means you end up with duplicate code in the obj context for 3Delight, and the mat context for Mantra, or you move shader logic out of mat context - which seems to be taking it away from where it should be.

I wanted to have a set up that had a switch to flick to move from Mantra to 3Delight and to share the Mantra logic as much as possible in the mat context.
User Avatar
Member
2528 posts
Joined: June 2008
Offline
I would call that a 3Delight bug. Even if I plug the 3dl float to color into the i-color of the Principled shader, the color value will not flow through to the node.

It's best to report this to 3Delight.
Using Houdini Indie 20.0
Ubuntu 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
mmc
I have been migrating a tutorial from Mantra to 3Delight. There is a limited number of 3Delight nodes you can use in a mat context. I was hoping you could mix houdini nodes with the 3Delight nodes: e.g. do some calculation to build say a value for the vector colour attribute, then convert the vector to 3 floats, the use the 3Delight FloatToColour node to build a 3Delight Colour object. The nodes join, types match i.e. the output of the Manta node is floats the input to the 3Delight node is floats, but the values get ignored.

It is not clear to me if this is because 3Delight is still Beta so not everything works as expected - or if by design this plugging of nodes is just never going to work? I would imagine the Houdini node interpreter would have no problem passing the float along so it must be 3Delight that is failing to get the plumbing to work.

The is a question in principle since I have worked around in 2 ways: 3Delight has a (horrible) condition node that can be used for the logic I needed (but doing so involves you implementing the logic 2x - once for Mantra once for 3Delight). My second solution was to take the nodes out of the mat context and put them in a VOP in the obj context and set an attribute. In the mat context you just then read the attribute using the supplied 3Delight node. This either means you end up with duplicate code in the obj context for 3Delight, and the mat context for Mantra, or you move shader logic out of mat context - which seems to be taking it away from where it should be.

I wanted to have a set up that had a switch to flick to move from Mantra to 3Delight and to share the Mantra logic as much as possible in the mat context.


You can't use any mantra nodes with 3dl, except for a couple that are translated internally to 3delight nodes, such as bind and the texture node and mantra principled shader. But other than bind, the mantra nodes that are translated to 3delight are only given the most base level of implementation, so stick with only use the 3delight nodes and the bind node.

Using only 3delight nodes can be quite limiting, however it's possible to write osl code to be compiled into new custom 3delight nodes. This should help with filling the gaps.

If you have any 3delight for Houdini questions, I suggest joining their Discord:

https://discord.gg/MGtJx4q [discord.gg]
  • Quick Links