Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Surface' node does not work in MaterialX network #211

Open
pablode opened this issue Mar 5, 2022 · 8 comments
Open

'Surface' node does not work in MaterialX network #211

pablode opened this issue Mar 5, 2022 · 8 comments
Assignees

Comments

@pablode
Copy link

pablode commented Mar 5, 2022

Tested with latest master (1.0.77) and Blender 3.0.1.

To reproduce:

  1. open Blender, select 'USD Hydra' render engine
  2. create a cube, assign a new material, convert it to MaterialX
  3. change MaterialX graph to look like this:
    2022-03-05 17_15_25-Blender
  4. observe that RPR Preview render is black
  5. export USD scene to file
  6. 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
        }
    }
}
@DagerD DagerD self-assigned this Mar 16, 2022
@DagerD
Copy link
Contributor

DagerD commented Mar 21, 2022

Hi.

Seems like USD (our is 21.11) doesn't fully support MaterialX nodes. The MatX file we are generating is correct.

@pablode
Copy link
Author

pablode commented Mar 25, 2022

I think this is the issue we're talking about:
PixarAnimationStudios/OpenUSD#1502

Wrapping the nodes in a nodegraph seems to work.

@DagerD
Copy link
Contributor

DagerD commented Mar 29, 2022

Yes, you are right. But this method doesn't make all nodes work.

@pablode
Copy link
Author

pablode commented May 9, 2022

I would expect this to be fixed in the latest USD version as multiple MaterialX issues have been addressed since USD 21.11:
PixarAnimationStudios/OpenUSD#1785
PixarAnimationStudios/OpenUSD#1784
PixarAnimationStudios/OpenUSD#1629
PixarAnimationStudios/OpenUSD#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

@DagerD
Copy link
Contributor

DagerD commented May 18, 2022

We have plans to update USD to latest and we will retest this issue.

@pablode
Copy link
Author

pablode commented May 18, 2022

Great to hear! I've recently did some work to update RprUSD to v22.05 - I've set up a draft PR here:
GPUOpen-LibrariesAndSDKs/RadeonProRenderUSD#557

@bsavery
Copy link
Contributor

bsavery commented Jun 10, 2022

@DagerD please add a task to our sprint to upgrade.

@DagerD
Copy link
Contributor

DagerD commented Jul 19, 2022

Created ticket BLEN-169.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants