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

[TODO] MaterialX support #86

Open
6 tasks
syoyo opened this issue Aug 10, 2023 · 2 comments
Open
6 tasks

[TODO] MaterialX support #86

syoyo opened this issue Aug 10, 2023 · 2 comments

Comments

@syoyo
Copy link
Collaborator

syoyo commented Aug 10, 2023

Working branch: mtlx https://github.com/syoyo/tinyusdz/tree/mtlx

MaterialX spec: https://materialx.org/assets/MaterialX.v1.38.Spec.pdf
(version: 1.38)

Adding TinyUSDZ to load USD model in ASF MaterialXViewer https://github.com/lighttransport/materialx
(We can use this as a reference and for verification)

Shading model support

TODO

  • MaterialX v1.39 support.

Don't support

  • Shaders in OSL, GLSL, etc
    • Support hardcoded shader only

Dataset for USD + MaterialX

@syoyo
Copy link
Collaborator Author

syoyo commented Aug 11, 2023

Example syntax(?) of materialx

#usda 1.0

def "bora" 
(
   # Seems we need to specify </MaterialX> prim path
   references = @usd_preview_surface_default.mtlx@</MaterialX>
) {

}
$ usdcat --flatten materialx-001.usda 
#usda 1.0
(
    doc = """Generated from Composed Stage of root layer /mnt/data/work/tinyusdz/tests/usda/materialx-001.usda
"""
)

def "bora"
{
    def "Materials"
    {
        def Material "USD_Default"
        {
        }
    }
}
  • Use references to load .mtlx
  • Need to add </MaterialX> prim path(otherwise flatten fails)
  • It looks Mtlx support in pxrUSD is not yet well supported(material/shader parameter not expanded)

@syoyo
Copy link
Collaborator Author

syoyo commented Aug 23, 2023

https://materialx.org/assets/MaterialX.v1.38.Supplement.pdf

Texture nodes

  • tiledimage(for texture mapping)
  • triplanarprojection(for cube mapping?)
  • ramp4

Math nodes

  • place2d
    • Mapping place2d to UsdTransform2d looses some infos(e.g. pivot)
  • safepower

Adjustment nodes

  • contrast
  • range
  • hsvadjust
  • saturate

Channel nodes

  • extract
  • separate2, separate3, separate4

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

1 participant