question

Aaron Ross avatar image
Aaron Ross asked ·

Is it possible to layer materials on a Fluid?

There appears to be no way to layer materials with Fluids.

As far as I can determine, the Arnold Layer Shader material is completely non-functional with 3ds Max Bifrost Fluids.

It also appears that the 3ds Max native Blend node is non-functional with Fluids.

This is a major failure of functionality because users need to shade various parts of the fluid differently. Without the ability to layer materials, there are severe limitations in what can be accomplished.

shadersmaterialslayerfluids
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

> I don't see why a Multi/Sub-Object Material would be relevant to assigning a
> Layer Shader to the fluid. There are no foam particles in my simulation.

Whatever shader is assigned to the fluid, the first connected shader will be used for fluids, the second for foam.

You have a layer shader connected, so the first connected shader is used.

So if you want to use a layer shader for fluids, set up a shader tree like this (you can use either a Mix shader or the Multi/Sub-Object Material)


layer-shader.jpg (38.9 KiB)
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Mads Drøschler avatar image
Mads Drøschler answered ·

What is it you want to do? explain in detail.
We have OSL so we can blend like we want, no need for legacy nodes.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aaron Ross avatar image
Aaron Ross answered ·

Confirmed, thank you Stephen. I've logged this as a bug:

Stephen Blair has tracked down the problem. The Layer Shader node is mapping each shader input to a corresponding Material ID. This is wrong. The Layer Shader node (and the Blend node) should not interact with Material IDs in any way. If I assign a Layer Shader material to a Fluid, I absolutely do not expect that Layer 1 will automatically map to Material ID #1 (fluid surface) and Layer 2 will automatically map to Material ID #2 (foam particles). This is definitely a bug. Compositing nodes should not have any interaction with Material IDs whatsoever. As a workaround, the user can send the Layer Shader material to input 1 of a Multi/Sub-object material, thereby reassigning the Layer Shader output to Material ID #1 only. Please fix this. Thanks.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aaron Ross avatar image
Aaron Ross answered ·

Thank you Stephen, I will try that. But I'm scratching my head because this is just not right. The Layer Shader functionality should be completely independent of the Multi/Sub-object functionality. There should be no mapping of Layer Shader inputs to Material IDs. In other words, everything going through the Layer Shader should go to Material ID #1. To my understanding, Layer Shaders is not a tool for routing materials to different Material IDs. It is supposed to be a compositing tool that performs masking operations independent of any consideration of Material ID.

This is definitely a problem. And since it is also occurring with the 3ds Max legacy Blend node, it may be a problem that transcends Arnold, and something that needs to be addressed by the Max team.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aaron Ross avatar image
Aaron Ross answered ·

Thank you for your answers.

The effect I am trying to achieve is a pseudo-foam shading effect. One material for the non-turbulent, laminar flow, and another material for the turbulent, bubbly "foam". I should be able to pipe the laminar material into one layer, the turbulent material into another layer, and mask them with fluid surface channel data such as Vorticity. I can do this easily in Maya.

I don't know how to use Operators yet. If that is the only way to make this work, then I'd categorize that as a bug.

I do not believe that OSL map nodes can blend materials, but I can try that.

I don't see why a Multi/Sub-Object Material would be relevant to assigning a Layer Shader to the fluid. There are no foam particles in my simulation.

I do not understand what Mads's screen capture is showing me. My Slate graph looks very similar to the screen capture, I guess there's something about Operators not being shown in this screen capture? I am pretty sure I did follow the chronological order of assignments... assign the Layer Shader material first, then connect the child materials to the Layer Shader inputs. It did not work for me. But I can try again.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

MAXtoA expects two shader connections:

  • The first is for the fluid
  • A second for the foam

If you plug a Layer Shader into the first slot of a Multi/Sub-Object (or a Mix shader), then that Layer Shader is used for the fluid.


Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Mads Drøschler avatar image
Mads Drøschler answered ·

Here I blend a noise and a bitmap on the Layer closure construct.
The workflow is semi broken and can lead to think its not working, but it does.
So while its both broken and working on the same time, it should be fixed.

You are missing some kind of catch and clear for node hookups, as I can force in a blend with multiple layers resetting hooks and hook them up after the blend closure is assigned.

There is only 1 correct workflow, I found so far, and that is not just hooking things up. You need to assign the layer closure to the fluid, and then hook up the sub components, any other sequence will fail.


qweqwe.png (723.4 KiB)
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

A fluid rendered as an Arnold Surface gives you an Arnold bifrost_polymesh node, which is a shape node. So it can have a surface shader.

Looks like a bug to me. With a layered shader on a fluid (rendered as an Arnold Surface) I get the first input to the layered shader.

I used an operator to assign the layered shader to the fluid, and that worked. That makes me think it's a translation error (unless there's some reason I don't know about for disallowing layered shaders on fluids).

layer_shader isn't a legacy node.

Can OSL nodes blend closures? That's good to know

1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Not in the max implementation, yet. I thought it was on shader level.

0 Likes 0 · ·
Lee Griggs avatar image
Lee Griggs answered ·

Yes, those are surface shaders. Not sure what effect you are after, but the volume maps allow you to shade the fluids differently.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.