MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

The medium_vdf closure and nested dielectrics priority order

Open boberfly opened this issue 10 months ago • 2 comments

Hi again,

When looking into supporting nested dielectrics, for Cycles we noticed the medium_vdf has a priority order number that can be set, although I couldn't find much documentation on the specifics of this number's interpretation.

When looking at different renderer documentation, both Renderman and Arnold specify the higher priority is the higher number, while Karma and OpenMoonray specify this as the lower number as higher priority. Only Arnold specifies negative numbers being considered for lower priorities (Renderman could also but it isn't documented).

For MaterialX, what is the intended behaviour for the priority value? I guess implementors would do the conversion internally to the intended value.

https://projects.blender.org/blender/blender/pulls/118478 we are discussing it here.

Cheers

boberfly avatar Feb 17 '25 09:02 boberfly

This is a great question, and I'm CC'ing @niklasharrysson, who worked closely on the original definition of this node in MaterialX.

This may end up being a question to resolve in a MaterialX TSC meeting, and I'll bet our colleagues on the Arnold, RenderMan, Karma, and OpenMoonray teams would have useful perspectives to provide.

jstone-lucasfilm avatar Feb 17 '25 18:02 jstone-lucasfilm

@jstone-lucasfilm @boberfly The medium_vdf closure is actually not defined in the MaterialX specification yet. It was introduced in OSL as part of the work we did to formalize the MaterialX closures in OSL. But it was never ported back to the MaterialX spec AFAIK.

There is a long discussion of that work in this thread: https://github.com/AcademySoftwareFoundation/MaterialX/pull/614

The need for a new medium_vdf closure came up in that discussion. But the priority number's interpretation was not discussed there. Personally I just assumed a higher number would represent a higher priority. To my mind this is the most intuitive and practical interpretation, if you also allow negative numbers for setting lower priorities once a zero has been set.

But I agree with Jonathan this should be discussed and resolved in a TSC Meeting where all renderer teams can place their vote. Once it has been settled we should also add this node to the spec to have it defined there.

niklasharrysson avatar Feb 18 '25 15:02 niklasharrysson