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

MaterialX: Unlit materials (single-output nodegraphs) don't work #27494

Closed
hybridherbst opened this issue Jan 3, 2024 · 3 comments · Fixed by #27575
Closed

MaterialX: Unlit materials (single-output nodegraphs) don't work #27494

hybridherbst opened this issue Jan 3, 2024 · 3 comments · Fixed by #27575
Labels

Comments

@hybridherbst
Copy link
Contributor

hybridherbst commented Jan 3, 2024

Description

Seems that nodegraphs that don't use a surface model (aka: are unlit) are not supported right now, e.g. this one doesn't work:

<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
  <nodegraph name="just_unlit">
    <mix name="mix_color3" type="color3">
      <input name="fg" type="color3" value="0, 0.0986187, 0.186275" />
      <input name="bg" type="color3" value="0.735294, 0.735294, 0.735294" />
      <input name="mix" type="float" value="0.6" />
    </mix>
    <output name="out" type="color3" nodename="mix_color3" />
  </nodegraph>
</materialx>

The above works fine in https://academysoftwarefoundation.github.io/MaterialX/.

I think the relevant spec section is this, saying that if there's only a single output (and no surfacematerial) then that should be used, and it doesn't matter what its name is.

@sunag I think this should become a MeshBasicNodeMaterial, right?
Basically checking here if any surfacematerial was found, and if not, using the first output instead for an Unlit material.

Reproduction steps

  1. Load the above MaterialX with MaterialXLoader
  2. Note it returns zero materials

(Side note: after discussion on the MaterialX slack there are additional cases – not really relevant for this issue, just interesting for the future. This file is also valid and contains two materials (one implicit unlit one and another explicit surfacematerial): two-materials.mtlx.zip)

@sunag sunag added the Nodes label Jan 4, 2024
@sunag
Copy link
Collaborator

sunag commented Jan 4, 2024

@sunagAcho que isso deveria se tornar um MeshBasicNodeMaterial, certo?

Yes, that would be the most appropriate.

Wouldn't it be more useful to expose the nodegraphs as we do with materials?

@hybridherbst
Copy link
Contributor Author

hybridherbst commented Jan 4, 2024

The main point why I opened this issue is that loading the nodegraph-only .mtlx I posted above should return a single unlit material, without me having to do anything extra.

A way to access individual nodes might also be useful in the future – some viewers allow „picking“ which node should be displayed as result – but I think that might be possible on the NodeMaterial already?

@hybridherbst
Copy link
Contributor Author

@sunag would it be possible for you to take a look at this issue? I'm not quite sure what the right approach would be. Would be great to see unlit MaterialX support.

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

Successfully merging a pull request may close this issue.

2 participants