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

Improvement to codegen of functional graphs in MDL #1243

Conversation

niklasharrysson
Copy link
Contributor

This change list improves on codegen of functional graphs in MDL, adding code for default geomprops on the inputs of functions generated from graphs.

For example, if an input in MaterialX has a defaultgeomprop attribute set:

    ...
    <input name="normal" type="vector3" defaultgeomprop="Nworld" uiname="Normal" uifolder="Geometry"
           doc="Input geometric normal" />
    <input name="tangent" type="vector3" defaultgeomprop="Tworld" uiname="Tangent Input" uifolder="Geometry"
           doc="Input geometric tangent" />
    ...

The code generated for this input will include an assignment of the corresponding data as default value in MDL:

    ...
    float3 normal = state::transform_normal(state::coordinate_internal, state::coordinate_world, state::normal()),
    float3 tangent = state::transform_vector(state::coordinate_internal, state::coordinate_world, state::texture_tangent_u(0))
    ...

@jstone-lucasfilm jstone-lucasfilm changed the title Improvment to codegen of functional graphs in MDL Improvement to codegen of functional graphs in MDL Feb 14, 2023
Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks @niklasharrysson!

@jstone-lucasfilm jstone-lucasfilm merged commit e1714a4 into AcademySoftwareFoundation:main Feb 14, 2023
Michaelredaa pushed a commit to Michaelredaa/MaterialX that referenced this pull request Oct 21, 2023
…undation#1243)

This change list improves on codegen of functional graphs in MDL, adding code for default geomprops on the inputs of functions generated from graphs.
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

Successfully merging this pull request may close these issues.

None yet

2 participants