Skip to content

Commit

Permalink
v1.38.1_adsk Release (#1241)
Browse files Browse the repository at this point in the history
* Update changelog for recent work

* Optimizations to shader translation and baking

* Update changelog for recent work

* Simplify material examples

- Remove colorspace assignments on scalar images (only color values and images are affected by colorspace assignments).
- Remove input bindings to default values.

* Fixes.

* Update JS bindings.

* Unused var fix.

* Add in new baking tests and bump to 1.38.1.

Co-authored-by: Jonathan Stone <[email protected]>
  • Loading branch information
bernardkwok and jstone-lucasfilm authored Jun 23, 2021
1 parent 8d015d7 commit 2a96c2e
Show file tree
Hide file tree
Showing 44 changed files with 611 additions and 578 deletions.
52 changes: 42 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,47 @@
# Change Log

## [1.38.1] Development
## [1.38.2_adsk] - Development

#### Added
- Unlit surface shader definitions
- Look / Lookgroup management (in progress)
- Javascript bindings for MaterialXCore, MaterialXFormat, MaterialXGenShader (wip)
- OCIO-v2 support (wip)
- SPIR-V support (wip)
- Token support (wip)

#### Changed:
- Runtime "single stage" data model / refactoring (in progress)
- Fix for Arnold conductor_bsdf implemetnation signature.
- Patch to allow "context" keyword for shaderrefs during upgrade path. Unsupported and will be removed.
## [1.38.1_adsk] - 2021-06-21

### Added
- Add support for local for numierc Value types.
- Addition of new unlit shader surface shader to standard pbr library.
- Add in new baking option to allow for baking to image using non-normalized texture coordinates. Required sometime for real-world unit mapping.
- Allow for "gamma" shader to be used instead of sRGB buffers. This allows for some color output transformation without relying on hardware SRGB buffers which are not support in MESA configurations. Gamma control is part of MaterialXView.
- Enable arm64 for macOS Xcode 12 CI build.

### Changed
- Enhance hardware transparency check including handling when transparency is defined by an graph definition.
- Add token resolving to generic string resolvers. Fix code generation to use resolved values.
- Fixes so that derived targets can use units and color management properly. (Was not finding base class targets)
- Add requiresLighting() to shader generators to allow derived class to use this logic for custom direct lighting.
- Fixes to node definition "flattening" to take into account upstream nodegraphs, baking from surface shaders and handling baking when multiple children within a nodegraph are flattened.
- Minor MDL fix for texture pathing.
- Update unit test configuration to have more modular sets of options texture baing and wedging.

## [1.38.1] - 2021-06-18

### Added
- Added support for shared library builds on Windows.
- Added support for 16-bit unsigned integer images in MaterialXRender.
- Added support for compound nodegraphs with user interfaces in shader and UI generation.
- Added headers for newly proposed MaterialX closures in OSL.
- Added a shader translation command to the viewer, assigned to the 'T' hotkey.

### Changed
- Improved the memory efficiency of texture baking operations.
- Improved the compatibility of generated MDL code with Omniverse.
- Refactored image resolution logic into new methods ImageHandler\:\:getReferencedImages and MaterialX\:\:getMaxDimensions.
- Moved the viewer hotkey for GLSL code generation from 'S' to 'G' for consistency with other languages.

### Fixed
- Fixed the Color3.asTuple and Color4.asTuple methods in Python

## [1.38.0_adsk](https://github.com/autodesk-forks/MaterialX/releases/tag/v1.38_adsk)
- 2021-03-12 : Autodesk 1.38 release
Expand All @@ -21,7 +53,7 @@

Updated the MaterialX library to the v1.38 specification. See the [v1.38 changelist](http://www.materialx.org/assets/MaterialX.v1.38.Changelist.pdf) for full details.

#### Added
### Added
- Added support for the generalized 'layer' node in Physically Based Shading.
- Added user controls for texture baking and wedge rendering in the [MaterialX Viewer](https://github.com/materialx/MaterialX/blob/main/documents/DeveloperGuide/Viewer.md).
- Added support for Nvidia's Material Definition Language (MDL) in MaterialX code generation.
Expand All @@ -30,7 +62,7 @@ Updated the MaterialX library to the v1.38 specification. See the [v1.38 change
- Added viewer rendering to cloud-based tests in GitHub Actions.
- Added support for Xcode 12.

#### Changed
### Changed
- Updated the set of standard nodes to match the v1.38 specification, including significant improvements to the [Physically Based Shading](http://www.materialx.org/assets/MaterialX.v1.38.PBRSpec.pdf) nodes.
- Replaced specialized Material elements with material nodes, allowing more flexible material definitions and more consistent traversal.
- Unified the Input and Parameter element classes, simplifying the MaterialX API and client code.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ endif()
project(MaterialX)
set(MATERIALX_MAJOR_VERSION 1)
set(MATERIALX_MINOR_VERSION 38)
set(MATERIALX_BUILD_VERSION 0)
set(MATERIALX_BUILD_VERSION 1)
set(MATERIALX_LIBRARY_VERSION ${MATERIALX_MAJOR_VERSION}.${MATERIALX_MINOR_VERSION}.${MATERIALX_BUILD_VERSION})

cmake_minimum_required(VERSION 3.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<input name="uvtiling" type="vector2" value="1.0, 1.0" />
</tiledimage>
<tiledimage name="image_roughness" type="float">
<input name="file" type="filename" value="brass_roughness.jpg" colorspace="srgb_texture" />
<input name="file" type="filename" value="brass_roughness.jpg" />
<input name="uvtiling" type="vector2" value="1.0, 1.0" />
</tiledimage>
<output name="out_color" type="color3" nodename="image_color" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<input name="uvtiling" type="vector2" value="4.0, 4.0" />
</tiledimage>
<tiledimage name="image_roughness" type="float">
<input name="file" type="filename" value="wood_roughness.jpg" colorspace="srgb_texture" />
<input name="file" type="filename" value="wood_roughness.jpg" />
<input name="uvtiling" type="vector2" value="4.0, 4.0" />
</tiledimage>
<output name="out_color" type="color3" nodename="image_color" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
<input name="uvtiling" type="vector2" value="1.0, 1.0" />
</tiledimage>
<tiledimage name="image_roughness" type="float">
<input name="file" type="filename" value="brass_roughness.jpg" colorspace="srgb_texture" />
<input name="file" type="filename" value="brass_roughness.jpg" />
<input name="uvtiling" type="vector2" value="1.0, 1.0" />
</tiledimage>
<output name="out_color" type="color3" nodename="image_color" />
<output name="out_roughness" type="float" nodename="image_roughness" />
</nodegraph>
<UsdPreviewSurface name="SR_brass1" type="surfaceshader">
<input name="diffuseColor" type="color3" nodegraph="NG_brass1" output="out_color" />
<input name="useSpecularWorkflow" type="integer" value="0" />
<input name="specularColor" type="color3" value="0, 0, 0" />
<input name="metallic" type="float" value="1" />
<input name="roughness" type="float" nodegraph="NG_brass1" output="out_roughness" />
</UsdPreviewSurface>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<materialx version="1.38" colorspace="lin_rec709">
<UsdPreviewSurface name="SR_gold" type="surfaceshader">
<input name="diffuseColor" type="color3" value="0.944, 0.776, 0.373" />
<input name="useSpecularWorkflow" type="integer" value="0" />
<input name="specularColor" type="color3" value="0, 0, 0" />
<input name="metallic" type="float" value="1" />
<input name="roughness" type="float" value="0.02" />
</UsdPreviewSurface>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
<materialx version="1.38" colorspace="lin_rec709">
<UsdPreviewSurface name="SR_plastic" type="surfaceshader">
<input name="diffuseColor" type="color3" value="0.10470402, 0.24188282, 0.81800002" />
<input name="useSpecularWorkflow" type="integer" value="0" />
<input name="metallic" type="float" value="0" />
<input name="roughness" type="float" value="0.32467532157897949" />
<input name="clearcoat" type="float" value="0" />
<input name="clearcoatRoughness" type="float" value="0.01" />
<input name="ior" type="float" value="1.5" />
</UsdPreviewSurface>
<surfacematerial name="USD_Plastic" type="material">
Expand Down
65 changes: 65 additions & 0 deletions resources/Materials/TestSuite/_options.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,70 @@
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="adsk_bitmap">
<input name="file" type="filename" value="adsk_bitmap.mtlx" />
<input name="uvmin" type="vector2" value="0,0"/>
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="adsk_glazing">
<input name="file" type="filename" value="adsk_glazing.mtlx" />
<input name="uvmin" type="vector2" value="0,0"/>
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="adsk_heightmap">
<input name="file" type="filename" value="adsk_heightmap.mtlx" />
<input name="uvmin" type="vector2" value="0,0"/>
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="adsk_layered">
<input name="file" type="filename" value="adsk_layered.mtlx" />
<input name="uvmin" type="vector2" value="0,0"/>
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="adsk_metal">
<input name="file" type="filename" value="adsk_metal.mtlx" />
<input name="uvmin" type="vector2" value="0,0"/>
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="adsk_normalmap">
<input name="file" type="filename" value="adsk_normalmap.mtlx" />
<input name="uvmin" type="vector2" value="0,0"/>
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="adsk_opaque">
<input name="file" type="filename" value="adsk_opaque.mtlx" />
<input name="uvmin" type="vector2" value="0,0"/>
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

<baker name="adsk_transparent">
<input name="file" type="filename" value="adsk_transparent.mtlx" />
<input name="uvmin" type="vector2" value="0,0"/>
<input name="uvmax" type="vector2" value="1,1" />
<input name="hdr" type="boolean" value="false" />
<input name="resolution" type="integer" value="1024" />
</baker>

</nodedef>
</materialx>
6 changes: 3 additions & 3 deletions source/JsMaterialX/JsMaterialXCore/JsMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ namespace mx = MaterialX;
EMSCRIPTEN_BINDINGS(material)
{
ems::function("getShaderNodes", ems::optional_override([](mx::NodePtr materialNode) {
std::unordered_set<mx::NodePtr> set = mx::getShaderNodes(materialNode);
std::vector<mx::NodePtr> set = mx::getShaderNodes(materialNode);
// Put all elements into an std::vector
std::vector<mx::NodePtr> vec;
vec.insert(vec.end(), set.begin(), set.end());
return vec;
}));
ems::function("getShaderNodes", ems::optional_override([](mx::NodePtr materialNode,
const std::string& nodeType) {
std::unordered_set<mx::NodePtr> set = mx::getShaderNodes(materialNode, nodeType);
std::vector<mx::NodePtr> set = mx::getShaderNodes(materialNode, nodeType);
// Put all elements into an std::vector
std::vector<mx::NodePtr> vec;
vec.insert(vec.end(), set.begin(), set.end());
Expand All @@ -36,7 +36,7 @@ EMSCRIPTEN_BINDINGS(material)
ems::function("getShaderNodes", ems::optional_override([](mx::NodePtr materialNode,
const std::string& nodeType,
const std::string& target) {
std::unordered_set<mx::NodePtr> set = mx::getShaderNodes(materialNode, nodeType, target);
std::vector<mx::NodePtr> set = mx::getShaderNodes(materialNode, nodeType, target);
// Put all elements into an std::vector
std::vector<mx::NodePtr> vec;
vec.insert(vec.end(), set.begin(), set.end());
Expand Down
Loading

0 comments on commit 2a96c2e

Please sign in to comment.