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

Initial commit legacy materials #1398

Merged
merged 8 commits into from
Mar 14, 2024
Merged

Conversation

zicher3d
Copy link
Collaborator

@zicher3d zicher3d commented Feb 6, 2024

This commit includes:

  • all Legacy (Protein) classes
  • procedural nodes (checker, noise, turbulence 2d/3d)
  • utilities (stain, normals combine nodes)

For now all nodes are under "adsk_legacy" group, except the turbulence ones that might be ok to be added to the standard lib.

Because of a bug in the handling of namespaces in the Graph Editor all namespaces are set to "".
Bug: AcademySoftwareFoundation#1695

This commit includes:
 - all Legacy (Protein) classes
 - procedural nodes (checker, noise, turbulence 2d/3d)
 - utilities (stain, normals combine nodes)

For now all nodes are under "adsk_legacy" group, except the turbulence ones that might be ok to be added to the standard lib.

Becasue of a bug in the handling of namespaces in the Graph Editor all namespaces are set to "". Bug: AcademySoftwareFoundation#1695
@ashwinbhat
Copy link
Collaborator

@zicher3d can you include an example mtlx for legacy

@zicher3d
Copy link
Collaborator Author

zicher3d commented Feb 6, 2024

Will do. I have one that works in MaterialX viewer. I need to update it.
Then I just need to do new commits to the branch and they will add to the PR?

Copy link

@nicolassavva-autodesk nicolassavva-autodesk left a comment

Choose a reason for hiding this comment

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

added a few quick inline comments

Comment on lines +11 to +12
<implementation name="IM_turbulence2d_float_genglsl" nodedef="ND_turbulence2d_float" file="mx_turbulence2d_float.glsl" function="mx_turbulence2d_float" target="genglsl" />
<implementation name="IM_turbulence3d_float_genglsl" nodedef="ND_turbulence3d_float" file="mx_turbulence3d_float.glsl" function="mx_turbulence3d_float" target="genglsl" />

Choose a reason for hiding this comment

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

did we already determine that the noise functions in question here are not available through the existing stdlib noise()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the current stdlib noise types are Perlin, Cell, Worley and Fractal

<materialx version="1.38">
<!--
DESCRIPTION: Nodegraphs for Autodesk Legacy Material Classes
VERSION: 0.9.0

Choose a reason for hiding this comment

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

we might want to revisit our version numbers

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Definetly. We can discuss that. Also I think we need an SHA value. Not sure about that process yet.

<materialx version="1.38">
<!--
DESCRIPTION: Node Definitions for Autodesk Legacy Material Classes
VERSION: 0.9.0

Choose a reason for hiding this comment

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

revisit the version number

This includes a single MTLX file and a set of textures.
The MTLX file can be loaded in MaterialX Viewer and materials selected from the UI
@zicher3d
Copy link
Collaborator Author

zicher3d commented Feb 7, 2024

Added a commit for the sample file, and related textures

Adding values to all inputs to avoid warnings. This files generates no warning messages  when loaded in MaterialX viewer

Also fixing a small typo in the defs file
This is a USD test file that can be loaded in usdview to test the same materials that the legacy_materials_test.mtlx tests in MaterialX viewer.

Open the file in usdview, select the ShaderBall object and in the  Meta data panel you can select a variant for each material class.

The legacy materials node defs are also updated to remove a stub for namespace that was causing trouble in usdview (but was ok in MaterialX viewer).
A typo in the comments was also fixed.
Stubs for implementation of:
 - turbulence2d_float
 - turbulence3d_float
in OSL and MDL.
Currently returning a solid color. This is just to check the build warnings.
Just a test to see if hardcoded expected skip count does influence overall implementation counters and failure to match.
Testing for glsl only.
Tests were failing because the node turbulence2D was defined but never used in any TestSuite file.

Adding a other.mtlx as a container for these orphans nodes.
Note that for consistency I also added turbulence3d in there, even if not necessary as it's used in the main material test file.
Copy link
Collaborator

@ashwinbhat ashwinbhat left a comment

Choose a reason for hiding this comment

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

LTGM We might have to revisit the nodegroup and namespace at a later point.

@nicolassavva-autodesk
Copy link

Let's squash the commits from this PR and merge.
The additions are isolated to the mtlx library and implementations so the prototype should be safe to try out
even if some finishing touches remain before this becomes production ready
(please version the newly introduced nodes accordingly)

Copy link

@nicolassavva-autodesk nicolassavva-autodesk left a comment

Choose a reason for hiding this comment

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

Go ahead and squash-merge

-->

<!-- <Color Stain> -->
<nodedef name="ND_legacy_stain_color3" node="legacy_stain" version="1.0" isdefaultversion="true" nodegroup="adsk_legacy" namespace="" >

Choose a reason for hiding this comment

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

some node versions are 1.0 while others are set to 0.1 in this set.
let's be consistent with whatever we decide to use for the first drop.

@zicher3d zicher3d merged commit 05efae1 into adsk_contrib/dev Mar 14, 2024
32 checks passed
@zicher3d zicher3d deleted the zicher-legacy_materials branch March 15, 2024 18:11
ashwinbhat pushed a commit that referenced this pull request Apr 9, 2024
* Initial commit legacy materials

This commit includes:
 - all Legacy (Protein) classes
 - procedural nodes (checker, noise, turbulence 2d/3d)
 - utilities (stain, normals combine nodes)

For now all nodes are under "adsk_legacy" group, except the turbulence ones that might be ok to be added to the standard lib.

Becasue of a bug in the handling of namespaces in the Graph Editor all namespaces are set to "". Bug: AcademySoftwareFoundation#1695

* Test files for legacy material

This includes a single MTLX file and a set of textures.
The MTLX file can be loaded in MaterialX Viewer and materials selected from the UI

* Adding values to test file

Adding values to all inputs to avoid warnings. This files generates no warning messages  when loaded in MaterialX viewer

Also fixing a small typo in the defs file

* USD test file

This is a USD test file that can be loaded in usdview to test the same materials that the legacy_materials_test.mtlx tests in MaterialX viewer.

Open the file in usdview, select the ShaderBall object and in the  Meta data panel you can select a variant for each material class.

The legacy materials node defs are also updated to remove a stub for namespace that was causing trouble in usdview (but was ok in MaterialX viewer).
A typo in the comments was also fixed.

* Stubs for OSL and MDL turbulence noise

Stubs for implementation of:
 - turbulence2d_float
 - turbulence3d_float
in OSL and MDL.
Currently returning a solid color. This is just to check the build warnings.

* Test for matching implementation count

Just a test to see if hardcoded expected skip count does influence overall implementation counters and failure to match.
Testing for glsl only.

* Revert "Test for matching implementation count"

This reverts commit 12e011f.

* Added test mtlx file for unused nodedefs

Tests were failing because the node turbulence2D was defined but never used in any TestSuite file.

Adding a other.mtlx as a container for these orphans nodes.
Note that for consistency I also added turbulence3d in there, even if not necessary as it's used in the main material test file.
ashwinbhat pushed a commit that referenced this pull request Apr 12, 2024
* Initial commit legacy materials

This commit includes:
 - all Legacy (Protein) classes
 - procedural nodes (checker, noise, turbulence 2d/3d)
 - utilities (stain, normals combine nodes)

For now all nodes are under "adsk_legacy" group, except the turbulence ones that might be ok to be added to the standard lib.

Becasue of a bug in the handling of namespaces in the Graph Editor all namespaces are set to "". Bug: AcademySoftwareFoundation#1695

* Test files for legacy material

This includes a single MTLX file and a set of textures.
The MTLX file can be loaded in MaterialX Viewer and materials selected from the UI

* Adding values to test file

Adding values to all inputs to avoid warnings. This files generates no warning messages  when loaded in MaterialX viewer

Also fixing a small typo in the defs file

* USD test file

This is a USD test file that can be loaded in usdview to test the same materials that the legacy_materials_test.mtlx tests in MaterialX viewer.

Open the file in usdview, select the ShaderBall object and in the  Meta data panel you can select a variant for each material class.

The legacy materials node defs are also updated to remove a stub for namespace that was causing trouble in usdview (but was ok in MaterialX viewer).
A typo in the comments was also fixed.

* Stubs for OSL and MDL turbulence noise

Stubs for implementation of:
 - turbulence2d_float
 - turbulence3d_float
in OSL and MDL.
Currently returning a solid color. This is just to check the build warnings.

* Test for matching implementation count

Just a test to see if hardcoded expected skip count does influence overall implementation counters and failure to match.
Testing for glsl only.

* Revert "Test for matching implementation count"

This reverts commit 12e011f.

* Added test mtlx file for unused nodedefs

Tests were failing because the node turbulence2D was defined but never used in any TestSuite file.

Adding a other.mtlx as a container for these orphans nodes.
Note that for consistency I also added turbulence3d in there, even if not necessary as it's used in the main material test file.
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.

3 participants