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 nprlib with viewdirection node #1631

Merged

Conversation

jstone-lucasfilm
Copy link
Member

This changelist introduces an NPR (non-photorealistic rendering) data library to MaterialX, initially consisting of a single viewdirection node.

The NPR data library is designed for the portable expression of artistic, non-physically-based materials, with common examples being cartoon shading, architectural diagrams, and edge highlighting. In future versions of MaterialX, we expect this data library to be extended with additional primitives and artist-facing graphs as they are requested by the graphics community and approved by the MaterialX TSC.

For shader generation, MaterialX initially supports the NPR data library in GLSL, ESSL, MSL, and OSL, with MDL being omitted for now, based on intentional restrictions in its design philosophy.

This changelist introduces an NPR (non-photorealistic rendering) data library to MaterialX, initially consisting of a single `viewdirection` node.

The NPR data library is designed for the portable expression of artistic, non-physically-based materials, with common examples being cartoon shading, architectural diagrams, and edge highlighting.  In future versions of MaterialX, we expect this data library to be extended with additional primitives and artist-facing graphs as they are requested by the graphics community and approved by the MaterialX TSC.

For shader generation, MaterialX initially supports the NPR data library in GLSL, ESSL, MSL, and OSL, with MDL being omitted for now, based on intentional restrictions in its design philosophy.
@jstone-lucasfilm
Copy link
Member Author

This changelist includes a handful of very simple NPR examples, including Edge Brighten, Environment Map, and Starfield, in order to test implementations and evaluate parity across languages.

Artists are encouraged to create their own examples, and we'd be happy to include them in the future!

GraphEditor_EdgeBrighten
GraphEditor_EnvironmentMap
GraphEditor_Starfield

@ashwinbhat
Copy link
Contributor

Very excited to see this work towards nprlib. Thank you!!

As suggested in review feedback, this commit moves environment_map.mtlx back to the resources/Lights folder, so that the MaterialX Viewer doesn't gain a dependency on a new folder.
@jstone-lucasfilm jstone-lucasfilm merged commit 39d6d5b into AcademySoftwareFoundation:main Jan 4, 2024
31 checks passed
kwokcb added a commit to kwokcb/MaterialX that referenced this pull request Jan 4, 2024
* Add enumeration support to web viewer (AcademySoftwareFoundation#1632)

- Scan for `enum` and `enumvalues` if attributes exist on input. If no `enumvalues` exist then map to "default" of 0..<enum list size>.
- Create a drop-down for each enumerated input.

* Initial nprlib with viewdirection node (AcademySoftwareFoundation#1631)

This changelist introduces an NPR (non-photorealistic rendering) data library to MaterialX, initially consisting of a single `viewdirection` node.

The NPR data library is designed for the portable expression of artistic, non-physically-based materials, with common examples being cartoon shading, architectural diagrams, and edge highlighting.  In future versions of MaterialX, we expect this data library to be extended with additional primitives and artist-facing graphs as they are requested by the graphics community and approved by the MaterialX TSC.

For shader generation, MaterialX initially supports the NPR data library in GLSL, ESSL, MSL, and OSL, with MDL being omitted for now, based on intentional restrictions in its design philosophy.

* Improve shader generation for viewdirection

This changelist improves shader generation logic for the new viewdirection node, allowing it to work correctly in derived hardware languages such as ESSL.

* Add creatematrix nodes to build matrices from vectors (AcademySoftwareFoundation#1553)

I'm opening this PR to add creatematrix, a constructor for Matrix33 from 3 Vector3s, Matrix44 from 4 Vector3s and Matrix44 from 4 Vector4s from the specification document (https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/documents/Specification/MaterialX.Specification.md#math-nodes).

---------

Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>
Co-authored-by: Frieder Erdmann <55715326+friedererdmann@users.noreply.github.com>
kwokcb added a commit to kwokcb/MaterialX that referenced this pull request Jan 4, 2024
* Add enumeration support to web viewer (AcademySoftwareFoundation#1632)

- Scan for `enum` and `enumvalues` if attributes exist on input. If no `enumvalues` exist then map to "default" of 0..&lt;enum list size&gt;.
- Create a drop-down for each enumerated input.

* Initial nprlib with viewdirection node (AcademySoftwareFoundation#1631)

This changelist introduces an NPR (non-photorealistic rendering) data library to MaterialX, initially consisting of a single `viewdirection` node.

The NPR data library is designed for the portable expression of artistic, non-physically-based materials, with common examples being cartoon shading, architectural diagrams, and edge highlighting.  In future versions of MaterialX, we expect this data library to be extended with additional primitives and artist-facing graphs as they are requested by the graphics community and approved by the MaterialX TSC.

For shader generation, MaterialX initially supports the NPR data library in GLSL, ESSL, MSL, and OSL, with MDL being omitted for now, based on intentional restrictions in its design philosophy.

* Improve shader generation for viewdirection

This changelist improves shader generation logic for the new viewdirection node, allowing it to work correctly in derived hardware languages such as ESSL.

* Add creatematrix nodes to build matrices from vectors (AcademySoftwareFoundation#1553)

I'm opening this PR to add creatematrix, a constructor for Matrix33 from 3 Vector3s, Matrix44 from 4 Vector3s and Matrix44 from 4 Vector4s from the specification document (https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/documents/Specification/MaterialX.Specification.md#math-nodes).

---------

Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>
Co-authored-by: Frieder Erdmann <55715326+friedererdmann@users.noreply.github.com>
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