BlenderUSDHydraAddon
BlenderUSDHydraAddon copied to clipboard
'Surface' node does not work in MaterialX network
Tested with latest master (1.0.77) and Blender 3.0.1.
To reproduce:
- open Blender, select 'USD Hydra' render engine
- create a cube, assign a new material, convert it to MaterialX
- change MaterialX graph to look like this:

- observe that RPR Preview render is black
- export USD scene to file
- see that diffuse node is missing from exported material graph
def "Materials"
{
def Material "surfacematerial_2"
{
token inputs:bsdf (
renderType = "BSDF"
)
token inputs:edf (
renderType = "EDF"
)
float inputs:opacity = 1
token outputs:mtlx:surface.connect = </Cube/Material_001/Materials/surfacematerial_2/ND_surface.outputs:surface>
def Shader "ND_surface"
{
uniform token info:id = "ND_surface"
token inputs:bsdf (
renderType = "BSDF"
)
token inputs:bsdf.connect = </Cube/Material_001/Materials/surfacematerial_2.inputs:bsdf>
token inputs:edf (
renderType = "EDF"
)
token inputs:edf.connect = </Cube/Material_001/Materials/surfacematerial_2.inputs:edf>
float inputs:opacity.connect = </Cube/Material_001/Materials/surfacematerial_2.inputs:opacity>
token outputs:surface
}
}
}
Hi.
Seems like USD (our is 21.11) doesn't fully support MaterialX nodes. The MatX file we are generating is correct.
I think this is the issue we're talking about: https://github.com/PixarAnimationStudios/USD/issues/1502
Wrapping the nodes in a nodegraph seems to work.
Yes, you are right. But this method doesn't make all nodes work.
I would expect this to be fixed in the latest USD version as multiple MaterialX issues have been addressed since USD 21.11: https://github.com/PixarAnimationStudios/USD/issues/1785 https://github.com/PixarAnimationStudios/USD/issues/1784 https://github.com/PixarAnimationStudios/USD/issues/1629 https://github.com/PixarAnimationStudios/USD/issues/1581
I've implemented construction of complex graphs in my converter and it works: https://github.com/pablode/guc/blob/97d156f0d1974aea6ba363e8ce3f0157cda02334/src/libguc/src/materialx.cpp#L388
We have plans to update USD to latest and we will retest this issue.
Great to hear! I've recently did some work to update RprUSD to v22.05 - I've set up a draft PR here: https://github.com/GPUOpen-LibrariesAndSDKs/RadeonProRenderUSD/pull/557
@DagerD please add a task to our sprint to upgrade.
Created ticket BLEN-169.