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

CurveAdjust implementation missing #674

Open
swillisart opened this issue Aug 12, 2021 · 6 comments
Open

CurveAdjust implementation missing #674

swillisart opened this issue Aug 12, 2021 · 6 comments

Comments

@swillisart
Copy link

Hello! I'm writing a MaterialX Maya File Translator
And I just ran into a critical snag on the exporting of remap nodes as CurveAdjust.
image
The resulting example when loaded into MaterialXView yields an error.

<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
  <surfacematerial name="Plastic" type="material">
    <input name="surfaceshader" type="surfaceshader" nodename="SR_plastic" />
  </surfacematerial>
  <standard_surface name="SR_plastic" type="surfaceshader">
    <input name="base" type="float" value="1" />
    <input name="base_color" type="color3" nodegraph="NG_remapColor1" output="out" />
    <input name="specular_roughness" type="float" value="0.32467532157897949" />
  </standard_surface>
  <nodegraph name="NG_remapColor1">
    <curveadjust name="remap1" type="color3">
      <input name="in" type="color3" nodename="remapColor1" />
      <parameter name="knots" type="vector2array" value="[0.0, 0.5], [1.0, 1.0]" />
    </curveadjust>
    <ramplr name="remapColor1" type="color3">
        <input name="valuel" type="color3" value="0.0, 0.0, 0.0" />
        <input name="valuer" type="color3" value="0.5, 0.0, 0.0" />
        <input name="texcoord" type="vector2" defaultgeomprop="UV0" />
    </ramplr>
    <output  name="out" type="color3" nodename="remap1" />
  </nodegraph>
</materialx>

image

And when reading though the code it seems MaterialX does not actually have an implementation available and is commented out. Is this something actively being looked into with Autodesk or are you accepting PR's for curve lookups?

Best regards,
-Sean

@bernardkwok
Copy link
Contributor

Hi Sean,
Thanks for bringing this up and it is true there is no curveadjust support currently, and from the Autodesk side it is not actively being looked at.

It would be great if you have something to put up. If you don't have all the language backends we could do one first and add the rest after we have one reference implementation.

@swillisart
Copy link
Author

Sounds good Bernard,
Created a PR Reference implementation of curveadjust
I think I'm unable to link this Issue to the PR for some reason.

@jstone-lucasfilm
Copy link
Member

It sounds like the best path forward will be to integrate the recent work from SideFX on MaterialX ramp nodes, which was discussed at the MaterialX TSC on November 9th:

https://academysoftwarefdn.slack.com/archives/C0230LWBE2X/p1636486452084200

I'll leave this original issue open for now, and we can revisit this as the work from SideFX is refined and integrated into MaterialX v1.39.

@swillisart
Copy link
Author

That’s great news! I got stuck on the GLSL limitation of fixed-size array declaration. I have working shader code but it’s all pre-declared and does not accept dynamic inputs. Looking forward to the SideFX PR.

@jstone-lucasfilm
Copy link
Member

This subject was discussed in more depth at today's MaterialX TSC meeting, and I'll include a link for those following the topic:

https://academysoftwarefdn.slack.com/archives/C0230LWBE2X/p1655837092353349

@jstone-lucasfilm
Copy link
Member

Linking this earlier issue to the recent pull request to add a ramp node to MaterialX 1.39.2:

#1884

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