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

Python Texture Bake and Multiple Udims Texture Bake Support #448

Conversation

mjyip-lucasfilm
Copy link
Contributor

No description provided.

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.

Thanks for this change, Madeleine! It looks very good overall, and I've added some comments below:

source/MaterialXRenderGlsl/TextureBaker.h Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.h Outdated Show resolved Hide resolved
source/MaterialXView/Viewer.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
python/Scripts/baketextures.py Outdated Show resolved Hide resolved
python/Scripts/baketextures.py Outdated Show resolved Hide resolved
python/Scripts/baketextures.py Outdated Show resolved Hide resolved
python/Scripts/baketextures.py Show resolved Hide resolved
python/Scripts/baketextures.py Outdated Show resolved Hide resolved
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.

Just a few additional notes below:

source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.h Outdated Show resolved Hide resolved
python/Scripts/baketextures.py Outdated Show resolved Hide resolved
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.

A few more thoughts:

source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXView/Viewer.cpp Outdated Show resolved Hide resolved
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 nearly ready to merge, and just a few additional notes below:

source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXView/Viewer.cpp Outdated Show resolved Hide resolved
python/Scripts/baketextures.py Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.cpp Outdated Show resolved Hide resolved
source/MaterialXRenderGlsl/TextureBaker.h Outdated Show resolved Hide resolved
source/MaterialXView/Viewer.cpp Outdated Show resolved Hide resolved
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.

Great notes, thanks Bernard!

source/MaterialXRenderGlsl/TextureBaker.cpp Show resolved Hide resolved
Madeleine Yip and others added 3 commits July 23, 2020 16:13
Removing the three-slash comment, which is meant for the auto-documentation system in Doxygen, from this non-client-facing method.
@jstone-lucasfilm jstone-lucasfilm merged commit 3cd2754 into AcademySoftwareFoundation:master Jul 24, 2020
@mjyip-lucasfilm mjyip-lucasfilm deleted the PythonTextureBake branch July 31, 2020 21:05
bernardkwok added a commit to kwokcb/MaterialX that referenced this pull request Oct 5, 2021
* Update PyBind11 to version 2.4.3

* Documentation updates

- Update to the latest revision of the 1.37 specification.
- Add hyperlinks to the contributor page.
- Minor revisions to Doxygen comments.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS, including the following:

- Remove a signed bitshift operation with undefined C++ behavior, replacing it with the intended constant result.
- Restrict the capture scope of two lambdas, removing access to temporary variables.

Also:

- Add initial unit tests for the Half class, providing validation for future work.

* Finalize changelog for v1.36.5

* Updates for MaterialX v1.37 (AcademySoftwareFoundation#338)

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

### Added
- Added support for LookGroup elements.
- Added support for the 'uisoftmin', 'uisoftmax', and 'uistep' attributes, updating Autodesk Standard Surface to leverage these features.

### Changed
- Updated the set of standard nodes to match the v1.37 specification.
- Unified the rules for NodeDef outputs, with all NodeDefs defining their output set through Output child elements rather than 'type' attributes.
- Replaced backdrop nodes with Backdrop elements.
- Improved the robustness of GLSL and OSL code generation.

* Update document version strings

- Update document version strings to 1.37.
- Remove legacy attributes from root elements.

* Extend build tests to Python 3.8

Extend Appveyor build tests to include Python 3.8, which is supported by the latest version of PyBind11.

* Extend build tests to Clang 9

Extend Travis build tests to Clang 9, and fix a related warning in MaterialXRenderGlsl.

* Add a Split Environment option to the viewer (AcademySoftwareFoundation#349)

This changelist adds a Split Environment option to the advanced tab of the MaterialX viewer, allowing an HDR environment light to be split into its indirect and direct (i.e. dominant directional light) components at load-time.

This work is intended as a precursor to future shadowing improvements in GLSL shader generation and MaterialXView.

For organizational clarity, user-facing light resources have been moved into a resources/Lights folder, and test suite lights have been moved into resources/Materials/TestSuite/lights.

* Update CMake policy for broader compatibility

This changelist updates the CMake policy for OpenGL library preferences, requesting that older libraries be used when both new and old are present in the same environment.  This addresses an issue brought up by Frankie Liu at Nvidia on the MaterialX discussion forum.

* View handler improvements

- Add method ViewHandler::createOrthographicMatrix.
- Provide direct access to ViewHandler data.
- Harmonize matrix computations across the MaterialX viewer.

* Viewer rendering fixes

This changelist fixes two rendering issues in the MaterialX viewer:

- Fix wireframe rendering with the Outline Selected Geometry option.
- Fix rendering of mixed opaque/transparent looks.

For simplicity, the UV wireframe hotkey has been removed, as it required some duplication of rendering logic, and we can integrate this functionality into the main render pathway if needed in the future.

* Update stb_image to version 2.23

* Initial support for variance shadow maps

This changelist adds support for variance shadow maps to the MaterialXGenGlsl code generator, allowing applications based on this generator to easily include the rendering technique.

The MaterialX viewer now includes a "Shadow Map" option on its Advanced Settings page, and its default lighting environment now has separate direct and indirect components, allowing different shadowing approaches to be used for each.

* Shadow rendering improvements

- Add helper function GLTextureHandler::mapTextureFormatToGL for consistency.
- Defer shadow map allocations until requested by the user.
- To view a scene with variance shadow maps, click Load Environment and select Resources/Lights/san_giuseppe_bridge_split.hdr, then enable Shadow Maps in the Advanced Settings page.

* Light environment improvements

- Move irradiance maps to a subfolder for clarity.
- Rebuild the san_giuseppe_split environment with a higher split luminance.
- Extend createRenderResources and getTexelColor to additional texture formats.
- Add reference CPU functions for image convolution.

* Texture-space rendering improvements

- Modularize functionality for future reuse, adding methods GLFrameBuffer::setEncodeSrgb, GLFrameBuffer::getEncodeSrgb, and GlslRenderer::drawScreenSpaceQuad.
- Remove duplicate OpenGL calls.

* Document upgrade fixes

This changelist fixes two edge cases when upgrading documents to v1.37 at import time:

- Return a default value rather than throwing an exception in getType, as this method can be called during the upgrade process itself.
- Upgrade nested nodes as well as those at root scope.

* Image convolution improvements

- Align Gaussian kernel weights between CPU and GPU implementations.
- Add createBlurShader helper function to MaterialXRender.
- Replace non-standard shader usage in mx_shadow.glsl.

* Shadow quality improvements

- Add a Gaussian blur step to shadow map generation.
- Clear the shadow framebuffer to one before rendering.
- Enable anisotropic filtering in the texture handler.
- Enable shadow maps by default.

* Harmonize vector conventions for matrix methods

This changelist aligns all matrix methods in MaterialX with the row-vector convention, in which matrix-vector multiplication is computed as v' = vM.

Previously, there was disagreement between the createTranslation methods (which followed row vector) and the createRotation/multiply methods (which followed column vector), requiring unnecessary calls to getTranspose in rendering code.

Documentation of the library vector convention has been added to Types.h, and related matrix code has been refactored for clarity.

* Update from GeomAttr to GeomProp for 1.37

This changelist implements the update from GeomAttr to GeomProp elements described in the v1.37 specification, along with the corresponding change from <geomattrvalue> to <geompropvalue> nodes.  Legacy documents from v1.36 and earlier are automatically upgraded at load-time.

See http://www.materialx.org/assets/MaterialX.v1.37REV2.Changelist.pdf for a complete list of changes in v1.37.

* Patch osl implementations for geompropvalue (AcademySoftwareFoundation#368)

* Static analysis fixes (AcademySoftwareFoundation#369)

- Fixes for static analysis warnings reported by PVS
- Documentation and formatting updates

* Generalize colorspace usage for filename (AcademySoftwareFoundation#370)

Update to shader generation support for `colorspace` to be consistent with `unit` support.
* This change makes it so that the `colorspace` attribute can now be recognized at the same scope / location as for `units`. This includes handling `filename` inputs which have been exposed
via a `nodegraph` definition interface (`interfacename`).
* Previously, `colorspace` would only be recognized on `filename` inputs which reside on an `image` node directly (not exposed via a interface)
* Additional configurations added to unit tests

* Light environment improvements

- Improve the accuracy of computing the dominant directional light from an environment map.
- Add support for environment map normalization.
- Rebuild the san_giuseppe environment.
- Add the venetian_crossroads and spruit_sunrise environments, including both combined and split variants.

* Increase environment split radiance

This changelist increases the split radiance for environment maps from 2 to 16, providing a better balance between direct and indirect lighting terms.

* Update documentation for recent work

* Syntax Example Updates (AcademySoftwareFoundation#375)

Updates to Syntax example files to better conform to 1.37 syntax and conventions

* Code and documentation cleanup

- Clarify implementations of matrix transforms and environment normalization.
- Simplify viewer constructor and filename generation.
- Update documentation for MATERIALX_PYTHON_PYBIND11_DIR.

* Harmonization on singular unit names. (AcademySoftwareFoundation#378)

Using https://physics.nist.gov/cuu/Units/units.html as a reference to use singular naming convention.
e.g. angle is 30 degree instead of degrees

* Update light paths in test suite

This changelist updates two light paths in the render test suite, matching the new location of environment irradiance maps.

* Python Script Examples Updates (AcademySoftwareFoundation#380)

writelooks.py: added output of lookgroup
mxvalidate.py: added support for geomprops, backdrops and lookgroups, preliminary support for units; changed output format for very-verbose nodegraphs to better indicate connections vs values

* Unit tests options file fix (AcademySoftwareFoundation#381)

Need to tranpose the uv transform used for GLSL unit tests to match current convention.

* Enable render tests by default

- Enable render tests by default in MaterialXTest, and disable this feature explicitly for CI builds.
- Require that environment lights are successfully found in render tests.

* Update tiled wood example

This changelist updates the tiled wood example material, replacing its tiled textures and assigning specular anisotropy and clearcoat properties.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS:

- Add self-assignment check to WindowWrapper assignment operator.
- Remove extra null check in Viewer::loadEnvironmentLight.
- Replace push_back with emplace_back for simplicity.

* Finalize changelog for v1.37.0

* Additional fixes for v1.37.0

- Update the v1.26 upgrade path for the v1.37 API.
- Fix edge cases for lighting search paths in the viewer.

* Initial support for Appveyor build artifacts

* Add documentation for Windows binaries

* Light environment improvements

- Add the Goegap and Table Mountain lighting environments, providing higher-dynamic-range options than San Giuseppe Bridge.
- Update documentation with Lucasfilm examples and new environments.

* Restore viewer dimensions

* Update development build to 1.37.1

* Add backwards compatibility for OIIO 1.x

This changelist adds backwards compatibility for OpenImageIO 1.x, using the pattern described in the OpenImageIO 2 porting guide.

Also, remove a documentation line describing the MATERIALX_TEST_RENDER flag, which is now enabled by default in builds.

* Standard library path improvements

- Make unit conversion robust to missing standard data libraries.
- Add a viewer warning for missing standard data libraries.
- Add helper method FilePath::getModulePath, which returns the directory containing the executable module.
- Update the viewer to leverage FilePath::getModulePath.
- Improve documentation for the --path and --library flags in the viewer.

* Use Python 3 by default in Travis builds

* Refactor two MaterialXGenShader methods for VS2019

This changelist refactors the MaterialX::readFile and SourceCodeNode::initialize methods for better compatibility with Visual Studio 2019

* GLSL shading improvements

- Remove duplicate library and resource folders that were generated during the MaterialXView build process.  This makes shader development more straightforward, where a developer can edit library source files directly and hit 'R' to reload shaders in the viewer.
- Use texture address modes rather than shader logic to keep latitude-longitude texture coordinates within bounds.  This addresses lighting artifacts along longitude seams in filtered importance sampling.
- Move spherical Fibonacci methods from mx_math.glsl to mx_environment_fis.glsl, removing them from generated shaders where they're not needed.

* Use height-correlated Smith masking-shadowing

This changelist updates the GLSL implementation of Smith masking-shadowing from uncorrelated to height-correlated forms, as described in http://jcgt.org/published/0003/02/03/paper.pdf.  As a future improvement, we should also update from isotropic to anisotropic forms, as described in the same paper.

* Update Travis build settings

This changelist updates Travis settings to accommodate recent changes to their build environments.

* Backdrop element improvements

- Add utility methods Backdrop::setContainsElements and Backdrop::getContainsElements.
- Rename Backdrop::setContains/Backdrop::getContains to Backdrop::setContainsString/Backdrop::getContainsString for consistency.
- Remove unneeded element names in unit tests.
- Remove an outdated warning in PortElement::validate.

* Energy conservation improvements for generated GLSL

- Add mx_microfacet_ggx_directional_albedo for computing a directional albedo for the GGX/Smith/Schlick BRDF.
- Replace mirror Fresnel with directional albedo for BSDF layering.
- Move Fresnel computation into the lighting integral for filtered importance sampling.
- Add mx_average_roughness for converting from anisotropic to isotropic roughness.

* Initial support for wedge rendering

- Add initial support for "wedge" rendering, where a single property is ramped between two values across successive screenshots, and the resulting image set is merged into a strip.  The new feature is activated by pressing the 'W' key in the MaterialX viewer, and settings for the render are hardcoded for now.
- Add hotkeys for adjusting camera zoom (+/-).
- Add utilities FilePath::addExtension and MaterialX::stringEndsWith.
- Refactor Viewer::drawContents for greater flexibility.
- Update changelog for recent work.

* Display advanced material properties by default

- Display advanced material properties by default in the viewer.
- Refactor BSDF function names for clarity.

* Refactor sheen BRDF for clarity

- Refactor the implementation of the sheen BRDF in GLSL to align with other BxDF nodes.
- Remove an unused overload of mx_fresnel_schlick.

* Energy compensation improvements for generated GLSL (AcademySoftwareFoundation#407)

- Add mx_ggx_energy_compensation for computing multiple scattering compensation with GGX/Smith shading.
- Split mx_ggx_directional_albedo into approximate and reference versions for evaluating approximation accuracy.
- Incorporate energy compensation into conductor_brdf, dielectric_brdf, and generalized_schlick_brdf.
- Add a Reference Quality option to MaterialXView.

* ADSK master to ILM master (AcademySoftwareFoundation#401)

Material node support plus additional improvements

* Remove duplicate data folders for viewer

This changelist restores an earlier improvement lost in the last merge, removing duplicate library and resource folders that were generated during the MaterialXView build process.

* Directional albedo improvements for generated GLSL

- Add generator option hwDirectionalAlbedoMethod for selecting between curve fit, table look-up, and importance sampling in directional albedo computations.
- Add generator option hwWriteAlbedoTable for generating a directional albedo table on the GPU.
- Use table look-up for directional albedo computations in the MaterialX viewer.

Also refactor the implementation of FilePath::removeExtension for consistency with FilePath::addExtension.

* Refactor microfacet library for generated GLSL (AcademySoftwareFoundation#412)

- Split mx_bsdfs.glsl into mx_microfacet, mx_microfacet_diffuse, mx_microfacet_specular, and mx_microfacet_sheen for more granular includes.
- Generate samples with respect to the standard basis in mx_ggx_directional_albedo_importance_sample (thanks to Stephen Hill for this suggestion).
- Improvements to method names, variable names, and documentation.

* Enable parallel builds in Appveyor

* Fix spelling in standard_surface graph

* Extend transparency heuristic to all surface shaders

This changelist takes the current transparency heuristic for standard_surface and extends it to all surface shaders, producing a more consistent result for UsdPreviewSurface and custom physically-based shaders.

* Simplify normal computation in UsdPreviewSurface

This changelist simplifies the computation of the per-pixel normal in UsdPreviewSurface, leveraging the standard <normalmap> node and removing a dependency on the bitangent stream.

* Improvements to material examples

- Add a standard_surface_brushed_metal example with high anisotropy.
- Increase the anisotropy of standard_surface_jade.
- Improve the unit tests for geometric streams, making them useful as debug visualizations for normals, tangents, and bitangents.

* Improvements to tangent frame generation

- Detect and skip duplicate vertices in TinyObjLoader::load, providing more accurate adjacency data for tangent frame generation.
- On hardware shading targets, generate bitangents in the vertex shader rather than storing them as an independent data stream.
- Refactor Mesh::generateTangents for improved robustness and clarity.

Supporting changes:

- Add a VectorN less-than operator, allowing vectors to be used as map keys.
- Add a MeshStream::getElement method to simplify geometry processing logic.

* Improvements to image extension handling

- Update ImageHandler::acquireImage to recognize extensions with non-standard letter case.
- Add clearer warning messages for images that fail to load.

* Improved handling for missing data libraries

* Fix upgrade path for compare nodes

- Fix comparison order in the upgrade path for compare nodes in v1.36 documents.
- Refactor the v1.36 upgrade path for clarity.

* Align behaviors of setConnectedNode methods

Align the behaviors of PortElement::setConnectedNode and Node::setConnectedNode, clarifying that a null NodePtr argument will clear any existing node connection.

* Improvements to image I/O

- Fix a CMake issue with OpenImageIO builds.
- Add a warning message for missing image files.

* Python related fixes for AcademySoftwareFoundation#355 and AcademySoftwareFoundation#359 (AcademySoftwareFoundation#411)

- Added CMake logic so pybind11 can be found, if no explicit path is provided
- Display validation warnings in Python unit tests.
- Remove Python bindings of header-defined constants.

* Add command-line options for mesh and light rotation

- Add command-line options '--meshRotation' and '--lightRotation' to the viewer.
- Add a Light Rotation slider to the Advanced Settings panel of the viewer.

Supporting changes:

- Add support for unary negation of a VectorN.
- Add error reporting for viewer command-line options.

* Add command-line options for camera position and target

- Add command-line options '--cameraPosition', '--cameraTarget', and '--meshScale' to the viewer.
- Generalize shadow transform for arbitrary camera placement.
- Mark the vector negation operator as const.

* Additional command-line options for the viewer

- Add command-line options '--cameraViewAngle', '--screenWidth', '--screenHeight', and '--screenColor' to the viewer.
- Simplify token parsing for command-line options.
- Update changelog for latest work.

* Add support for vector hashing

- Add support for hashing instances of VectorN classes, enabling their use as keys in unordered containers.
- Optimize TinyObjLoader::load by tracking duplicate vertices in an unordered map.
- Refactor MaterialXCore to remove unneeded dependencies.

* Shading model fixes and improvements

- Remove an extra factor of PI in the analytic Burley diffuse term for generated GLSL.
- Improve the robustness of the upgrade path for v1.36 compare nodes.
- Reset camera view angle when a new mesh is loaded into the viewer.

* Add support for GCC 10

- Add missing include to Element.cpp.
- Minor refactor of MaterialXCore dependencies.
- Update Travis configuration for GCC 10.

* Update documentation for v1.37.1

- Fix warnings reported by Doxygen.
- Update changelog for latest work.

* Support for exporting metadata in shader generation. (AcademySoftwareFoundation#844)

* Add implemention of AttributeDef element.

* Added AttributeDef pointer types

* Support [[ ]] punctuations for scope begin/end.

* Fixed issue with boolean type in OSL.

* Add metadata to ShaderPort. Support generation of metadata for shader inputs.

* Added AttributeDef methods to document.

* Fixed bug with scope handling in shader generation

* Using AttributeDefs for registering shader metadata.

* Support for metadata on node level.

* Added unittest for metadata generation.

* Fix typo in standard_surface nodedef.

* Support input widget metadata.

* Code cleanup.

* Fix initialization order issue.

* Changed default value and unit on thin_film_brdf.thickness. (AcademySoftwareFoundation#868)

* Use alphabetical order for consistency

* Align whitespace with ILM convention

* Add documentation for Oren-Nayar diffuse

This changelist adds documentation for the GLSL implementation of Oren-Nayar diffuse, along with minor updates to function and variable names.

* Improvements to transparency detection

- Handle both scalar and color values for transparent inputs.
- Check for a transparent graph when no uniform input binding is found.

* Fixes for tests_to_html (AcademySoftwareFoundation#428)

* print fix for tests_to_html.py so it'll run in Python 3
* Fix for tests_to_html to operate and generate an html even if it doesn't have both osl -and- glsl

* Shading improvements for generated GLSL

- Add a Fresnel model term to mx_environment_radiance, allowing for correct integration of conductor Fresnel on rough surfaces.  Thanks to Stephen Hill at Lucasfilm for catching this issue in the codebase!
- Unify epsilon tests for shading dot products in GLSL, addressing artifacts from backwards shading normals.
- Refactor shading logic for consistency and clarity.
- Add a pure conductor material to the test suite.

* Finalize changelog for v1.37.1

* Update development build to 1.37.2

* Merge of library API + OSL displacement (AcademySoftwareFoundation#439)

- Cleanup library utilities and add Python bindings.
- Add support for displacement shaders in generated OSL.
- Remove the CopyOptions class, making it the default behavior for Document::importLibrary to skip conflicting elements.

* Update image placement in README

* Load standard libraries regardless of build folder location (AcademySoftwareFoundation#445)

This changelist fixes a dependency on the build folder being located within the repository root folder.

* Add support for floating-point render targets

This changelist adds support for floating-point render targets in ShaderRenderer and its subclasses, allowing for HDR texture baking with TextureBaker.

* Improvements to environment background rendering

This changelist improves the accuracy of environment background rendering in the viewer, using a node graph based on view direction rather than geometric texture coordinates.

* Fix reflections from rotated environment lights

This changelist fixes the alignment of reflections from rotated environment lights.

* Python Texture Bake and Multiple Udims Texture Bake Support (AcademySoftwareFoundation#448)

* Scripting and documentation updates

- Add support for texture baking of documents with validation warnings.
- Update documentation.

* Additional improvements to texture baking

- Update argument names in baketextures.py to match those in MaterialXView (e.g. --width, --height, --library).
- Add arguments for input search path and output filename to baketextures.py.
- Rename TextureBaker::bakeAllShaders to TextureBaker::bakeAllMaterials.

Additional supporting changes:
- Emit warnings for missing textures in GlslProgram::bindTexture.
- Mark Element::getDescendant as a const method.

* Normal map texture baking feature (AcademySoftwareFoundation#451)

* Colorspace texture bake fix (AcademySoftwareFoundation#454)

* Unify search path generation

This changelist aligns search path generation between the viewer and texture baker, adding the MaterialX::getDefaultSearchPath method to define the expected behavior.

* Image handling improvements

- Add support for UINT8 textures in setTexelColor, getTexelColor, and createUniformImage.
- Make sure GLTextureHandler::createRenderResources sets the packing alignment in all code paths.
- Add a workaround for sampling issues with 1x1 textures.

* Improvements to viewer texture baking

- Fix an OpenGL error after baking textures in the viewer.
- Apply a constant maximum resolution to baked textures.
- Minor clarifications to baking logic.

* Image class improvements

- Add Python bindings for Image classes and enumerations.
- Add helper method Image::isUniformColor.

Also, add a standard include to Element.cpp that is required in recent VS2019 build environments.

* Texture baking optimizations (AcademySoftwareFoundation#460)

- Store uniform images as constant colors in texture baking.
- Skip duplicate references to a single output in texture baking.

Additional supporting changes:
- Make TextureBaker::bakeAllMaterials a non-static method.
- Clarify method names for image saving in ShaderRenderer.
- Remove partial support for shader nodes in texture baking (to be addressed more robustly in 1.38).

* Static analysis fixes

- Remove an unused argument from Element::addChildOfCategory.
- Use emplace/emplace_back where simpler and more efficient than insert/push_back.
- Const correctness fixes.

* Image loading improvements

- If an ImageHandler has multiple loaders, they are applied in the order they were added by the client.
- If MaterialX has been built with OpenImageIO support, make it available as a secondary loader in both MaterialXView and TextureBaker.

* Update changelog for recent work

* Shader translation (AcademySoftwareFoundation#463)

- Added ShaderTranslator class
- Added python bindings for ShaderTranslator

Additional supporting changes:
- Moved TextureBaker::connectsToNormalMapNode() to MaterialXGenShader/Util.h

* Python image support

- Add Python bindings for loading, editing, and saving images.
- Simplify Python bindings for image-related classes.
- Simplify traversal of image loaders.

* Add support for MDL shader generation (AcademySoftwareFoundation#441)

MDL: 
- Add a MaterialXGenMdl project for MDL shader generation in MaterialX.
- Add support for OSL and MDL code generation in the MaterialX viewer.
- Related improvements to OSL and GLSL shader generation.
- MDL code generation unit testing (mdlc for compilation. df_cuda or dxr for command line rendering)

1.38:
- Swap atan2() arguments as was previously incorrect.
- Change rotate3d() "axis" from parameter to input.
- Tag standard surface with version (1.0.1)
- Update sheen and add thin-film support.
- 1.37 -> 1.38 upgrade tests

General:
- Additional material node support for traversal and shadergen.
- Uniform block support for GLSL generator.
- Add inlined implementation support.
- interfacename / node name clash upgrade handling.
- Nodedef publishing utilities

* Add TextureBaker controls for color space and constant optimization

- Add a TextureBaker control for the color space in which textures are encoded.
- Add a TextureBaker control for optimization of uniform textures as constant values.
- Extend Python bindings for TextureBaker methods.
- Add support for the g22_ap1 color space in code generation.

* Improve accuracy of g22_ap1 transforms

This changelist improves the accuracy of transforms from g22_ap1 to lin_rec709 in generated GLSL and OSL.

* Improve search path for baketextures script (AcademySoftwareFoundation#470)

* Improvements to library loading functions

- Clarify interfaces and fix Python bindings for loadLibrary and loadLibraries.
- Leverage library loading functions in genshader.py.

* Additional refinements to baketextures script

- Unify search paths for documents and images.
- Align naming conventions with other Python scripts.

* Python import improvements

- Import MaterialX libraries consistently across Python scripts.
- Remove unused imports from Python scripts.

* Improvements to diffuse BSDF tests

This changelist integrates improvements to the diffuse BSDF test materials from the 1.38 branch of MaterialX.

* Improve CMake backwards compatibility

This changelist updates the CMakeLists.txt file in MaterialXTest to use patterns supported by earlier versions of CMake in addition to the latest version.

* Extend wedge rendering to color properties

* Static analysis fixes

- Add missing quotation marks to string literal.
- Add missing null checks.
- Use emplace_back where simpler and more efficient than push_back.
- Const correctness fixes.

* Documentation updates

- Fix mismatching braces in Doxygen comments
- Update changelog for recent work.
- Update main page for recent presentations.

* Align variable names

- Align variable names between interface and implementation in loadLibraries.
- Use a single variable name convention in baketextures.py.
- Additional script cleanup in baketextures.py.

* Finalize changelog for v1.37.2

* Clarify the new interface for PortElement

* Add output connection methods to PortElement

* Update development build to 1.37.3

* Initial support for shared libraries

This changelist adds initial support for shared libraries on Linux and MacOS.

* Update pre-built binaries

This changelist updates the links for pre-built binaries, pointing them to the latest release rather than the latest commit.

* Wedge updates for v1.38. (AcademySoftwareFoundation#483)

- Expose general parameters in advanced.
- Expose choice of parameter to sample (supports int, float, vec2, vec3, color3, vec4, color4) now vs only float before.
- Support more than tga in file dialog.
- Add in additional command line arguments to avoid having to interactively perform this:
--cameraZoom : Amount of user zoom to apply 1.3 seems to get a close fit.
--envSampleCount : Default is 16 but 64 is a good fidelity number.

* Improvements to transparency rendering in viewer

- Add a Render Transparency option to the Advanced Settings panel.
- Allow transparent surfaces to be shadow receivers.

* Github actions support (AcademySoftwareFoundation#427)

Initial support for continuous integration support with Github Actions.

Has a builder for linux, macos, and windows with vs2017 and 2019.

* Extend GitHub Actions coverage

* Range loop analysis fixes

This changelist addresses range-loop analysis warnings reported by Clang 12.

* Refinements to GitHub CI

- Add Python 2.7 builds on Linux and MacOS.
- Remove unused Python path step.
- Clarify job names.

* Update project badges

- Remove Travis CI badge, as this functionality is now covered by GitHub CI.
- Add release version badge.

* Parameter to input 1.38 update Part 1. (AcademySoftwareFoundation#493)

- Convert Parameters to Inputs marked as "uniform".  Note that according to the spec all "filename" and "string" types are uniform. **All other inputs are marked with `uniform="false"`**. 
- Modify addInput() to make name, type required arguments and add in a `isUniform` argument (default=`false`) to allow a single method to create and set whether something is uniform. Note that according to the spec all `filename` and `string` types are uniform. 
- Add new `getIsUniform()` and `setIsUniform()` APIs.
- Replace all `get/set/isA<Parameter>()` calls with new API calls.
- Remove `getPrimaryShaderParameters()` API from Material Element.
- Update Core, ShaderGen + tests. RTS passes for GLSL, MDL, and Vanilla OSL.

**Note** : While 1.38 is WIP, we keep the version at 1.37 so that the upgrade will be appied.

* stdlib (defintion + node graph implementations) after upgrade. inputs with `uniform` attributes are converted `parameters`
[1_37_to_1_38_updated .mtlx.txt](https://github.com/materialx/MaterialX/files/5319974/1_37_to_1_38_updated.mtlx.txt)

* Merge branch 'master' into v1.38 (AcademySoftwareFoundation#495)

* Improvements to acquireImage

- Remove the 'message' return value from ImageHandler::acquireImage, allowing for more straightforward Python bindings.
- Generate mipmaps by default in ImageHandler::acquireImage.

* Refinements to shader translation

- Add handling for source materials without node graphs.
- Add handling for source materials with unsupported inputs.

* Remove unused variables

* Remove legacy Observer classes

This changelist removes the legacy Observer and ObservedDocument classes, which have been superseded by the MaterialXRuntime library for real-time graph editing.  Callback methods that were exclusively leveraged by Observer classes have been removed as well.

* Image I/O improvements

- Add exception handling to image I/O calls.
- Clarify documentation for the MATERIALX_OIIO_DIR option in CMake.

* Improvements to shader translation

- Make ShaderTranslator::translateAllShaders a non-static member function.
- Use exceptions rather than standard I/O to signal errors.
- Add error messages for common missing features in translation graphs.

* Robustness improvements for translation and baking

- Add handling for edge cases in shader translation (e.g. missing normal maps).
- Add handling for edge cases in texture baking (e.g. missing node inputs).
- Improved handling of upgrades for legacy documents.

* Improvements to texture baking

- Omit default-valued constants in texture baking.
- Bake TIFF/EXR files when OpenImageIO is available.

* Viewer improvements

- Add render support for partially-transparent meshes.
- Automatically split meshes by UDIMs as required.
- Additional refinements to texture baking.

* Improvements to OpenGL texture handling

- Fix an edge case in image resource construction.
- Emit warnings when errors are encountered in image binding.

* Add support for image averaging in baking

* Additional viewer options

- Add a double-sided rendering option to the Advanced Settings panel.
- Add hotkeys for cycling through selected geometries (up/down arrows).

* Add GLSL subsurface scattering approximation

This changelist adds a simple subsurface scattering approximation to MaterialX GLSL.  The high-level approach is to integrate Burley's diffusion profile over the sphere using Eric Penner's curvature-based approximation.  While this ignores the thickness of the scattering volume, it keeps the implementation within a single shading pass and provides a meaningful visual interpretation of the subsurface scattering inputs.

* GLSL shading improvements

- Render back faces with forward-facing normals.
- Fix artifacts with low roughness values in sheen rendering.

* Fix for single-channel textures in MaterialXRenderGlsl

This changelist fixes the rendering of single-channel textures in MaterialXRenderGlsl, setting the required state that replicates the red channel to RGB.

* Handle empty environments in computeDominantLight

* Viewer improvements

- Handle UDIMs when merging multiple materials.
- Invalidate shadow maps when a new material is loaded.
- Check for zero intensities in splitDirectLight.
- Consider "existence" bindings when computing transparency.

* Remove legacy CI configurations

This changelist removes legacy CI configurations for Travis and Appveyor, and updates the changelog for recent work.

* Update env commands in GitHub Actions

* Image handling improvements (AcademySoftwareFoundation#520)

- Unify the handling of missing images in generated GLSL, binding a 1x1 sentinel image when the declared default value should be rendered.
- Remove legacy handling for fallback colors in image loading.
- Add a missing image example to the test suite.

* Remove MATERIALX_DEBUG_POSTFIX in favor of CMAKE_DEBUG_POSTFIX (AcademySoftwareFoundation#509)

* Additional workflow fixes

- Add a missing variable initialization in TextureBaker.
- Restrict UDIM assignments to materials in the viewer.

* Fix bug with codegen of custom BSDF/EDF graphs.

* Use newer OpenImageIO interface.

* Allow building against an external NanoGUI installation (AcademySoftwareFoundation#525)

* Merge from ADSK to LucasFilm 1.38 (AcademySoftwareFoundation#522)

* Update changelog for recent work

* Add changelog and readme to install

This changelist adds two root-level documents, CHANGELOG.md and README.md, to installations of MaterialX.

* Finalize changelog for v1.37.3

* Update links in README

* ADSK Update to ILM v1.38. (AcademySoftwareFoundation#529)

- Further updates / fixes for **TextureBaker**:
  - Fixes for per shader iteration, making it less state dependent
    - Perform proper state cleanup to avoid corruption between bakes.
  - Options for graph, and geominfo nodes created
  - Return list of documents to allow external file I/O flexibility.
- Port of **ShaderTranslator** to use Material nodes:
  - Add colorspace + units support
  - Add in missing traversal utility to upstream inputs.
  -  Fix state cleanup per shader translation to avoid corruption between translations.
- Fixes for **USD Preview surface**
  - Update "reflectivity" computation to match version 2.3 revision logic. (was modulating by diffuse twice).
  - Add version tag to definition

Additional GLSL changes:
- Update to handle uniform resources blocks for GLSL.
- Expose number of environment samples as settable option.

* Simplify image codec test

* Additional parameter updates for 1.38

- Remove remaining ParameterPtr references in Document::upgradeVersion.
- Add a fast path for non-existent attributes in Element::getTypedAttribute.

* Remove Parameter class

This changelist removes the legacy Parameter class from the v1.38 branch of MaterialX.

* Remove ShaderRef classes

This changelist removes the legacy ShaderRef, BindInput, BindParameter, and BindToken classes from the v1.38 branch of MaterialX.

* Remove Material element class

This changelist removes the legacy Material element class, and merges MaterialNode.cpp/h into Material.cpp/h and Look.cpp/h.

* Initial material unit tests

- Add initial C++ unit tests for the v1.38 material interface.
- Add helper methods Node::setConnectedOutput, Node::getConnectedOutput, and GraphElement::addMaterialNode.

* Additional material unit tests

- Additional C++ unit tests for the v1.38 material interface.
- Generalize the setConnectedOutput and getConnectedOutput methods.
- Merge unit tests from FormatUtil.tpp into File.cpp.

* Initial look unit tests

- Add initial C++ unit tests for looks and material assignments.
- Extend material and look unit tests to Python.
- Rename Look::getReferencedMaterialNode to Look::getReferencedMaterial for simplicity.

* Add shared library build

This changelist adds a Linux shared-library build to GitHub Actions CI.

* Update development build to 1.37.4

* OpenGL improvements for software rendering

- Add missing VAO binding to GlslRenderer::drawScreenSpaceQuad.
- Use warnings rather than exceptions to report OpenGL errors.
- Update CMake settings in MaterialXRenderGlsl to prefer GLVND libraries.
- Reorganize GLUtilityContext into GLUtil and GLContext for clarity.

* Add material baking to GitHub Actions CI

This changelist adds an initial material baking example to our GitHub Actions CI, leveraging xvfb for software OpenGL rendering on Linux.

* Improved robustness in MaterialXRenderGlsl

- Clarify the lifetime and ownership of WindowWrapper objects using shared pointers.
- Improve alignment of OpenGL context management between platforms.
- Minor formatting and comment updates for consistency and clarity.

* Make strings local to module

This changelist makes two strings local to the ConvolutionNode module, in order to work around a compiler issue on Linux.

* Additional improvements to MaterialXRenderGlsl

- Simplify platform-specific logic in GLContext.
- Add a null check to the Linux SimpleWindow destructor.
- Remove a context-changing call from the GlslRenderer destructor.
- Remove an unused header from the glew library.
- Clarify an initializer in the GlslProgram constructor.

* Update version badge link

* Improved color space handling in MaterialXRenderGlsl

- Correctly transfer color spaces of uniform values in TextureBaker.
- Add a warning for unsupported color space transforms in ShaderGraph.
- Add a second material baking test to GitHub Actions.
- Minor clarifications to example materials.

* Update changelog for recent work

* Disable software render tests in v1.38

* Add upgrade path for color2 type

This changelist adds an upgrade path for the legacy color2 type, and removes all references to color2 in the standard libraries.

Additional improvements:

- Integrate a fix to non-material rendering in the viewer (thanks to Bernard at Autodesk).
- Clarify a few warnings in shader generation.

* Remove color2 classes

* Refinements to GitHub Actions CI

- Initialize the virtual framebuffer before running unit tests, opening the door to more advanced render testing in the future.
- Remove unused libraries in MacOS builds.

* Finalize changelog for v1.37.4

* Texture baking improvements

- Align texture baking logic between render tests and the MaterialX viewer.
- Align TextureBaker function signatures with their v1.37 equivalents for consistency.
- Remove references to the standard regex library, which is not consistently supported in GCC 4.8.
- Restore cloud-based tests for material baking.

* Minor refinements to v1.38

- Align the signature of InterfaceElement::addInput with v1.37.
- Rename resolveFileNames to flattenFilenames for clarity.
- Extend the image search path in viewer texture baking.

* Remove legacy applyFutureUpdates flag

This changelist removes the legacy applyFutureUpdates flag, which no longer has any effect on document loading.

* Additional cleanup for v1.38

- Remove references to parameter elements in documentation.
- Restore default name argument to InterfaceElement::addInput.
- Align conventions for MDL generation code.

* Viewer and texture baking improvements

- Simplify texture baking in the viewer, assigning it a unique 'B' hotkey rather than overloading the Save Material button.
- Simplify the property name option for wedge rendering, making it an editable string grouped with other wedge options.
- Various improvements and fixes for texture baking.
- Update viewer documentation for new features.

* Additional baking fixes for v1.38

- Fix order of operations for processing uniform outputs.
- Remove document-modifying calls from texture baking.
- Remove an incorrect early exit in texture baking.
- Fix version strings for partial document upgrades.

* Add image averaging test to CI

* Add MDL support for g22_ap1

This changelist adds support for the g22_ap1 color space in MDL code generation.

* Fix bug in PNG file writing

* Fix OpenGL error in frame capture

* Improvements to GitHub CI

- Add support for parallel builds.
- Simplify Linux dependencies.
- Simplify render tests.

* Merge.

* Add viewer rendering to GitHub CI

- Add a viewer rendering test to GitHub Actions CI, rendering a uniform material and saving the image to disk.
- Add a captureFilename command line option to the viewer.
- Add a Viewer::initialize method, allowing settings to be modified between class construction and resource loading.

* Cleanup.

* Add viewer rendering to GitHub CI

* Minor formatting change for unit test render html.

* Restore the interface of GlslRenderer::create

* Restore simplified upgrade logic

* Remove unused helper function

* Restore additional edits

* Code cleanup for drawScreenSpaceQuad

* Fix Python binding for createBakeDocuments

* Align class name with conventions

* Restore std::regex fix

Note that std::regex is not consistently supported in GCC 4.8, so it's better to use our own code for this functionality in MaterialX.

* Patch test.

* Remove unit test for shader translation

* Remove unused include

* Minor formatting fixes

* Revert "Remove unit test for shader translation"

This reverts commit 429dda3.

* Revert "Remove unused include"

This reverts commit f8138a6.

* Add new interface for output stream setting for TextureBaker.

* Fix initialization order warning.

* Additional refactoring of baker output

* Omit color space revisions for texture baking

These changes need additional testing work, so we're omitting them for now.

* Minor clarity improvements

* Remove Python bindings for non-Pythonic methods

* Restore accidently removed code.

Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>
Co-authored-by: Doug Smythe <dbsmythe@gmail.com>
Co-authored-by: Ashwin Bhat <1727158+ashwinbhat@users.noreply.github.com>
Co-authored-by: alister-chowdhury <30833607+alister-chowdhury@users.noreply.github.com>
Co-authored-by: Niklas Harrysson <niklas.harrysson@gmail.com>
Co-authored-by: Indy Ray <iray@telltale.com>
Co-authored-by: Madeleine Yip <52723401+mjyip-lucasfilm@users.noreply.github.com>
Co-authored-by: bsavery <brian.savery@gmail.com>
Co-authored-by: debaetsd <debaetsd@gmail.com>
Co-authored-by: rzulak <rzulak@imageworks.com>
Co-authored-by: marsupial <marsupial@users.noreply.github.com>
bernardkwok added a commit to kwokcb/MaterialX that referenced this pull request Oct 5, 2021
* Finalize changelog for v1.36.4

* Update development build to 1.36.5

* Initial implementation of texture baking (#293)

- Add an initial TextureBaker class that leverages the GlslValidator to bake graph outputs and shader inputs to textures.
- Add a "Bake Textures" option to MaterialXView.  When this option is enabled, the Save Material command will bake textures for graph-connected shader inputs before writing the new MaterialX file.

* Generalize shader validator classes

- Rename the ShaderValidator, GlslValidator, and OslValidator classes to ShaderRenderer, GlslRenderer, and OslRenderer, generalizing their role to rendering as well as validation.
- Rename class methods for consistency with both rendering and validation use cases.
- Update Python bindings and documentation.

* Additional improvements to texture baking

- Add support for UDIM-based materials.
- Subclass TextureBaker from GlslRenderer for simplicity.
- Move baked filename logic into TextureBaker::generateTextureFilename.
- Clarify related interfaces and documentation in MaterialXRender and MaterialXRenderGlsl.

* Improvements to image handling (#303)

- Move responsibility for image path resolution from client code to GLTextureHandler::acquireImage.
- Remove duplicate cache lookups in GLTextureHandler::bindImage and GLTextureHandler::unbindImage.
- Add a static create method for StringResolver.

* Initial support for units (#300)

**Added**
- Initial support for units, including the Unit, UnitDef, and UnitTypeDef classes.
- Support for unit conversion in shader code generation.
- Utility to generate Markdown from `nodedef` definition.

**Changed**
- Standard surface `subsurface_color` changed type to color3 from vector3. `subsurface_scale` supported in code generation
- Search path argument for MaterialXView adds search paths versus replacing.

* Add support for Visual Studio 2019

- Update Appveyor for Visual Studio 2019.
- Reduce the number of Appveyor configurations for faster turnaround.

* Documentation improvements

- Update descriptions in Doxygen comments.
- Fix mismatched groups in Doxygen comments.
- Use nullptr as the default value for ImageDesc::resourceBufferDeallocator, since this has the same behavior as an explicit call to free().

* Update Travis links

Update migrated Travis links from travis-ci.org to travis-ci.com.

* Remove "default" unit from <unittypedef> (#308)

Remove "default" from \<unittypedef> as there is no need for a default.
It is assumed that all units of interest to convert to are added as \<unitdefs>. Thus "meter" for distance and "degrees" for angle.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS, including the following:

- Fix references to undefined variables in constructors.
- Fix inconsistent null checks.
- Fix exception instantiations without calls to throw.
- Remove conditional expressions that always evaluate to true.
- Move common constants to shared locations.
- Const-correctness and type-matching fixes.

* Improvements to CI builds

- Distribute Appveyor builds across Visual Studio 2015, 2017, and 2019.
- Distribute Travis builds across Python 2.7 and 3.x.

* Additional Travis improvements

- Select Linux and OSX images explicitly.
- Simplify logic for Python version selection.
- Reduce parallel jobs for performance.

* Improvements to image functionality

- Rename the ImageDesc class to Image, and create a clearer separation between its interface and data.
- Move image creation logic to the Image class.
- Move image caching and fallback behavior to the base ImageHandler class.
- Add an initial Image::getTexelColor method, opening the door to future image processing and analysis functionality.

* Update example materials

- Update standard_surface_default bindings to match the current definition of the shader.
- Remove standard_surface_velvet bindings that have no visible effect (clearcoat properties that are set without a clearcoat weight).

* Update to OpenImageIO 2

- Update the OiioImageLoader class to the OpenImageIO 2 API.  For simplicity, this changelist removes support for OpenImageIO 1.x, but supporting both API versions is an option for the future.
- Additional updates and cleanup for OiioImageLoader.

* Move Image class to its own source and header files

- Move the Image class to its own source and header files (Image.cpp and Image.h), allowing image processors to depend on Image without depending on ImageHandler and ImageLoader.
- Add a ConstImagePtr alias to clarify the behavior of image processing interfaces.
- Minor whitespace fixes in Util.h.

* Vector class improvements

- Consistently return the VectorN type from operators that return vector references.
- Minor formatting fixes.

* Move Travis image declarations to the build matrix

This provides clearer feedback during Travis builds and allows for greater flexibility in the future.

* Initial setTexelColor method

Add an initial setTexelColor method to the Image class

* Initial support for spherical harmonic irradiance (#322)

- Add the ShCoeffs class template, representing a set of spherical harmonic coefficients for a particular data type and number of bands.
- Add the projectEnvironment function, allowing a lat-long environment to be projected to third-order spherical harmonics (with or without an irradiance convolution).
- Add the renderEnvironment function, allowing a third-order spherical harmonic signal to be rendered to a lat-long environment map.

* Add a Load Environment option to the viewer

This changelist adds a Load Environment option to the viewer, allowing arbitrary lat-long environment lights to be loaded at run-time.  If a pre-generated diffuse convolution is not found on the file system, then one will be generated at load-time via spherical harmonics.

Additional changes:

- Add a resources/Images/Environments folder, containing two environment light options (san_giuseppe_bridge and piazza_bologni).
- Create rendering resources for images on demand, rather than at construction time.
- Add a lightweight half-precision float class to MaterialXRender, allowing spherical harmonics to be generated from half-precision environment lights.
- Add handling to the render test suite for missing OSL executable locations.
- Move the Save Material option to the Property Editor.

* Update documentation for recent work (#325)

- Add documentation for the Load Environment option.
- Add documentation for OpenImageIO support.
- Update images for textured materials in the viewer.
- Additional improvements for clarity and consistency.

* Add ambient occlusion support to HwShaderGenerator

This changelist adds support for ambient occlusion images to HwShaderGenerator, replacing the custom multi-pass solution previously used in MaterialXView.

The new implementation is available to any application leveraging GLSL shader generation, and should be extensible to other shadowing and visibility solutions in the future.

* Vector class improvements

- Generalize getMagnitude to handle all subclasses of VectorN
- Specialize Color classes directly from VectorN for consistent handling of operators.
- Move <cmath> library include to Types.h.
- Add missing Python tests for Vector operators.

* MacOS build improvements

- Integrate Ashwin's MacOS fix from the Autodesk fork (https://github.com/autodesk-forks/MaterialX/pull/647)
- Silence OpenGL deprecation warnings in MacOS builds.
- Increment the osx_image setting to xcode11, so that we're testing against a more recent MacOS image.
- Minor fixes to CMake formatting and whitespace.

* CMake build simplifications

- Unify target link lists across platforms.
- Remove duplicate requirements tests.
- Minor improvements to formatting.

* Improvements to light and image handling

- Unify direct light management between the viewer and light handler.
- Add functions Image::splitByLuminance and computeDominantLight for upcoming rendering work.
- Fix an edge case in AO image loading.
- Fix an edge case in property editor display.

* Update PyBind11 to version 2.4.3

* Documentation updates

- Update to the latest revision of the 1.37 specification.
- Add hyperlinks to the contributor page.
- Minor revisions to Doxygen comments.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS, including the following:

- Remove a signed bitshift operation with undefined C++ behavior, replacing it with the intended constant result.
- Restrict the capture scope of two lambdas, removing access to temporary variables.

Also:

- Add initial unit tests for the Half class, providing validation for future work.

* Finalize changelog for v1.36.5

* Updates for MaterialX v1.37 (#338)

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

### Added
- Added support for LookGroup elements.
- Added support for the 'uisoftmin', 'uisoftmax', and 'uistep' attributes, updating Autodesk Standard Surface to leverage these features.

### Changed
- Updated the set of standard nodes to match the v1.37 specification.
- Unified the rules for NodeDef outputs, with all NodeDefs defining their output set through Output child elements rather than 'type' attributes.
- Replaced backdrop nodes with Backdrop elements.
- Improved the robustness of GLSL and OSL code generation.

* Update document version strings

- Update document version strings to 1.37.
- Remove legacy attributes from root elements.

* Extend build tests to Python 3.8

Extend Appveyor build tests to include Python 3.8, which is supported by the latest version of PyBind11.

* Extend build tests to Clang 9

Extend Travis build tests to Clang 9, and fix a related warning in MaterialXRenderGlsl.

* Add a Split Environment option to the viewer (#349)

This changelist adds a Split Environment option to the advanced tab of the MaterialX viewer, allowing an HDR environment light to be split into its indirect and direct (i.e. dominant directional light) components at load-time.

This work is intended as a precursor to future shadowing improvements in GLSL shader generation and MaterialXView.

For organizational clarity, user-facing light resources have been moved into a resources/Lights folder, and test suite lights have been moved into resources/Materials/TestSuite/lights.

* Update CMake policy for broader compatibility

This changelist updates the CMake policy for OpenGL library preferences, requesting that older libraries be used when both new and old are present in the same environment.  This addresses an issue brought up by Frankie Liu at Nvidia on the MaterialX discussion forum.

* View handler improvements

- Add method ViewHandler::createOrthographicMatrix.
- Provide direct access to ViewHandler data.
- Harmonize matrix computations across the MaterialX viewer.

* Viewer rendering fixes

This changelist fixes two rendering issues in the MaterialX viewer:

- Fix wireframe rendering with the Outline Selected Geometry option.
- Fix rendering of mixed opaque/transparent looks.

For simplicity, the UV wireframe hotkey has been removed, as it required some duplication of rendering logic, and we can integrate this functionality into the main render pathway if needed in the future.

* Update stb_image to version 2.23

* Initial support for variance shadow maps

This changelist adds support for variance shadow maps to the MaterialXGenGlsl code generator, allowing applications based on this generator to easily include the rendering technique.

The MaterialX viewer now includes a "Shadow Map" option on its Advanced Settings page, and its default lighting environment now has separate direct and indirect components, allowing different shadowing approaches to be used for each.

* Shadow rendering improvements

- Add helper function GLTextureHandler::mapTextureFormatToGL for consistency.
- Defer shadow map allocations until requested by the user.
- To view a scene with variance shadow maps, click Load Environment and select Resources/Lights/san_giuseppe_bridge_split.hdr, then enable Shadow Maps in the Advanced Settings page.

* Light environment improvements

- Move irradiance maps to a subfolder for clarity.
- Rebuild the san_giuseppe_split environment with a higher split luminance.
- Extend createRenderResources and getTexelColor to additional texture formats.
- Add reference CPU functions for image convolution.

* Texture-space rendering improvements

- Modularize functionality for future reuse, adding methods GLFrameBuffer::setEncodeSrgb, GLFrameBuffer::getEncodeSrgb, and GlslRenderer::drawScreenSpaceQuad.
- Remove duplicate OpenGL calls.

* Document upgrade fixes

This changelist fixes two edge cases when upgrading documents to v1.37 at import time:

- Return a default value rather than throwing an exception in getType, as this method can be called during the upgrade process itself.
- Upgrade nested nodes as well as those at root scope.

* Image convolution improvements

- Align Gaussian kernel weights between CPU and GPU implementations.
- Add createBlurShader helper function to MaterialXRender.
- Replace non-standard shader usage in mx_shadow.glsl.

* Shadow quality improvements

- Add a Gaussian blur step to shadow map generation.
- Clear the shadow framebuffer to one before rendering.
- Enable anisotropic filtering in the texture handler.
- Enable shadow maps by default.

* Harmonize vector conventions for matrix methods

This changelist aligns all matrix methods in MaterialX with the row-vector convention, in which matrix-vector multiplication is computed as v' = vM.

Previously, there was disagreement between the createTranslation methods (which followed row vector) and the createRotation/multiply methods (which followed column vector), requiring unnecessary calls to getTranspose in rendering code.

Documentation of the library vector convention has been added to Types.h, and related matrix code has been refactored for clarity.

* Update from GeomAttr to GeomProp for 1.37

This changelist implements the update from GeomAttr to GeomProp elements described in the v1.37 specification, along with the corresponding change from <geomattrvalue> to <geompropvalue> nodes.  Legacy documents from v1.36 and earlier are automatically upgraded at load-time.

See http://www.materialx.org/assets/MaterialX.v1.37REV2.Changelist.pdf for a complete list of changes in v1.37.

* Patch osl implementations for geompropvalue (#368)

* Static analysis fixes (#369)

- Fixes for static analysis warnings reported by PVS
- Documentation and formatting updates

* Generalize colorspace usage for filename (#370)

Update to shader generation support for `colorspace` to be consistent with `unit` support.
* This change makes it so that the `colorspace` attribute can now be recognized at the same scope / location as for `units`. This includes handling `filename` inputs which have been exposed
via a `nodegraph` definition interface (`interfacename`).
* Previously, `colorspace` would only be recognized on `filename` inputs which reside on an `image` node directly (not exposed via a interface)
* Additional configurations added to unit tests

* Light environment improvements

- Improve the accuracy of computing the dominant directional light from an environment map.
- Add support for environment map normalization.
- Rebuild the san_giuseppe environment.
- Add the venetian_crossroads and spruit_sunrise environments, including both combined and split variants.

* Increase environment split radiance

This changelist increases the split radiance for environment maps from 2 to 16, providing a better balance between direct and indirect lighting terms.

* Update documentation for recent work

* Syntax Example Updates (#375)

Updates to Syntax example files to better conform to 1.37 syntax and conventions

* Code and documentation cleanup

- Clarify implementations of matrix transforms and environment normalization.
- Simplify viewer constructor and filename generation.
- Update documentation for MATERIALX_PYTHON_PYBIND11_DIR.

* Harmonization on singular unit names. (#378)

Using https://physics.nist.gov/cuu/Units/units.html as a reference to use singular naming convention.
e.g. angle is 30 degree instead of degrees

* Update light paths in test suite

This changelist updates two light paths in the render test suite, matching the new location of environment irradiance maps.

* Python Script Examples Updates (#380)

writelooks.py: added output of lookgroup
mxvalidate.py: added support for geomprops, backdrops and lookgroups, preliminary support for units; changed output format for very-verbose nodegraphs to better indicate connections vs values

* Unit tests options file fix (#381)

Need to tranpose the uv transform used for GLSL unit tests to match current convention.

* Enable render tests by default

- Enable render tests by default in MaterialXTest, and disable this feature explicitly for CI builds.
- Require that environment lights are successfully found in render tests.

* Update tiled wood example

This changelist updates the tiled wood example material, replacing its tiled textures and assigning specular anisotropy and clearcoat properties.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS:

- Add self-assignment check to WindowWrapper assignment operator.
- Remove extra null check in Viewer::loadEnvironmentLight.
- Replace push_back with emplace_back for simplicity.

* Finalize changelog for v1.37.0

* Additional fixes for v1.37.0

- Update the v1.26 upgrade path for the v1.37 API.
- Fix edge cases for lighting search paths in the viewer.

* Initial support for Appveyor build artifacts

* Add documentation for Windows binaries

* Light environment improvements

- Add the Goegap and Table Mountain lighting environments, providing higher-dynamic-range options than San Giuseppe Bridge.
- Update documentation with Lucasfilm examples and new environments.

* Restore viewer dimensions

* Update development build to 1.37.1

* Add backwards compatibility for OIIO 1.x

This changelist adds backwards compatibility for OpenImageIO 1.x, using the pattern described in the OpenImageIO 2 porting guide.

Also, remove a documentation line describing the MATERIALX_TEST_RENDER flag, which is now enabled by default in builds.

* Standard library path improvements

- Make unit conversion robust to missing standard data libraries.
- Add a viewer warning for missing standard data libraries.
- Add helper method FilePath::getModulePath, which returns the directory containing the executable module.
- Update the viewer to leverage FilePath::getModulePath.
- Improve documentation for the --path and --library flags in the viewer.

* Use Python 3 by default in Travis builds

* Refactor two MaterialXGenShader methods for VS2019

This changelist refactors the MaterialX::readFile and SourceCodeNode::initialize methods for better compatibility with Visual Studio 2019

* GLSL shading improvements

- Remove duplicate library and resource folders that were generated during the MaterialXView build process.  This makes shader development more straightforward, where a developer can edit library source files directly and hit 'R' to reload shaders in the viewer.
- Use texture address modes rather than shader logic to keep latitude-longitude texture coordinates within bounds.  This addresses lighting artifacts along longitude seams in filtered importance sampling.
- Move spherical Fibonacci methods from mx_math.glsl to mx_environment_fis.glsl, removing them from generated shaders where they're not needed.

* Use height-correlated Smith masking-shadowing

This changelist updates the GLSL implementation of Smith masking-shadowing from uncorrelated to height-correlated forms, as described in http://jcgt.org/published/0003/02/03/paper.pdf.  As a future improvement, we should also update from isotropic to anisotropic forms, as described in the same paper.

* Update Travis build settings

This changelist updates Travis settings to accommodate recent changes to their build environments.

* Backdrop element improvements

- Add utility methods Backdrop::setContainsElements and Backdrop::getContainsElements.
- Rename Backdrop::setContains/Backdrop::getContains to Backdrop::setContainsString/Backdrop::getContainsString for consistency.
- Remove unneeded element names in unit tests.
- Remove an outdated warning in PortElement::validate.

* Energy conservation improvements for generated GLSL

- Add mx_microfacet_ggx_directional_albedo for computing a directional albedo for the GGX/Smith/Schlick BRDF.
- Replace mirror Fresnel with directional albedo for BSDF layering.
- Move Fresnel computation into the lighting integral for filtered importance sampling.
- Add mx_average_roughness for converting from anisotropic to isotropic roughness.

* Initial support for wedge rendering

- Add initial support for "wedge" rendering, where a single property is ramped between two values across successive screenshots, and the resulting image set is merged into a strip.  The new feature is activated by pressing the 'W' key in the MaterialX viewer, and settings for the render are hardcoded for now.
- Add hotkeys for adjusting camera zoom (+/-).
- Add utilities FilePath::addExtension and MaterialX::stringEndsWith.
- Refactor Viewer::drawContents for greater flexibility.
- Update changelog for recent work.

* Display advanced material properties by default

- Display advanced material properties by default in the viewer.
- Refactor BSDF function names for clarity.

* Refactor sheen BRDF for clarity

- Refactor the implementation of the sheen BRDF in GLSL to align with other BxDF nodes.
- Remove an unused overload of mx_fresnel_schlick.

* Energy compensation improvements for generated GLSL (#407)

- Add mx_ggx_energy_compensation for computing multiple scattering compensation with GGX/Smith shading.
- Split mx_ggx_directional_albedo into approximate and reference versions for evaluating approximation accuracy.
- Incorporate energy compensation into conductor_brdf, dielectric_brdf, and generalized_schlick_brdf.
- Add a Reference Quality option to MaterialXView.

* ADSK master to ILM master (#401)

Material node support plus additional improvements

* Remove duplicate data folders for viewer

This changelist restores an earlier improvement lost in the last merge, removing duplicate library and resource folders that were generated during the MaterialXView build process.

* Directional albedo improvements for generated GLSL

- Add generator option hwDirectionalAlbedoMethod for selecting between curve fit, table look-up, and importance sampling in directional albedo computations.
- Add generator option hwWriteAlbedoTable for generating a directional albedo table on the GPU.
- Use table look-up for directional albedo computations in the MaterialX viewer.

Also refactor the implementation of FilePath::removeExtension for consistency with FilePath::addExtension.

* Refactor microfacet library for generated GLSL (#412)

- Split mx_bsdfs.glsl into mx_microfacet, mx_microfacet_diffuse, mx_microfacet_specular, and mx_microfacet_sheen for more granular includes.
- Generate samples with respect to the standard basis in mx_ggx_directional_albedo_importance_sample (thanks to Stephen Hill for this suggestion).
- Improvements to method names, variable names, and documentation.

* Enable parallel builds in Appveyor

* Fix spelling in standard_surface graph

* Extend transparency heuristic to all surface shaders

This changelist takes the current transparency heuristic for standard_surface and extends it to all surface shaders, producing a more consistent result for UsdPreviewSurface and custom physically-based shaders.

* Simplify normal computation in UsdPreviewSurface

This changelist simplifies the computation of the per-pixel normal in UsdPreviewSurface, leveraging the standard <normalmap> node and removing a dependency on the bitangent stream.

* Improvements to material examples

- Add a standard_surface_brushed_metal example with high anisotropy.
- Increase the anisotropy of standard_surface_jade.
- Improve the unit tests for geometric streams, making them useful as debug visualizations for normals, tangents, and bitangents.

* Improvements to tangent frame generation

- Detect and skip duplicate vertices in TinyObjLoader::load, providing more accurate adjacency data for tangent frame generation.
- On hardware shading targets, generate bitangents in the vertex shader rather than storing them as an independent data stream.
- Refactor Mesh::generateTangents for improved robustness and clarity.

Supporting changes:

- Add a VectorN less-than operator, allowing vectors to be used as map keys.
- Add a MeshStream::getElement method to simplify geometry processing logic.

* Improvements to image extension handling

- Update ImageHandler::acquireImage to recognize extensions with non-standard letter case.
- Add clearer warning messages for images that fail to load.

* Improved handling for missing data libraries

* Fix upgrade path for compare nodes

- Fix comparison order in the upgrade path for compare nodes in v1.36 documents.
- Refactor the v1.36 upgrade path for clarity.

* Align behaviors of setConnectedNode methods

Align the behaviors of PortElement::setConnectedNode and Node::setConnectedNode, clarifying that a null NodePtr argument will clear any existing node connection.

* Improvements to image I/O

- Fix a CMake issue with OpenImageIO builds.
- Add a warning message for missing image files.

* Python related fixes for #355 and #359 (#411)

- Added CMake logic so pybind11 can be found, if no explicit path is provided
- Display validation warnings in Python unit tests.
- Remove Python bindings of header-defined constants.

* Add command-line options for mesh and light rotation

- Add command-line options '--meshRotation' and '--lightRotation' to the viewer.
- Add a Light Rotation slider to the Advanced Settings panel of the viewer.

Supporting changes:

- Add support for unary negation of a VectorN.
- Add error reporting for viewer command-line options.

* Add command-line options for camera position and target

- Add command-line options '--cameraPosition', '--cameraTarget', and '--meshScale' to the viewer.
- Generalize shadow transform for arbitrary camera placement.
- Mark the vector negation operator as const.

* Additional command-line options for the viewer

- Add command-line options '--cameraViewAngle', '--screenWidth', '--screenHeight', and '--screenColor' to the viewer.
- Simplify token parsing for command-line options.
- Update changelog for latest work.

* Add support for vector hashing

- Add support for hashing instances of VectorN classes, enabling their use as keys in unordered containers.
- Optimize TinyObjLoader::load by tracking duplicate vertices in an unordered map.
- Refactor MaterialXCore to remove unneeded dependencies.

* Shading model fixes and improvements

- Remove an extra factor of PI in the analytic Burley diffuse term for generated GLSL.
- Improve the robustness of the upgrade path for v1.36 compare nodes.
- Reset camera view angle when a new mesh is loaded into the viewer.

* Add support for GCC 10

- Add missing include to Element.cpp.
- Minor refactor of MaterialXCore dependencies.
- Update Travis configuration for GCC 10.

* Update documentation for v1.37.1

- Fix warnings reported by Doxygen.
- Update changelog for latest work.

* Support for exporting metadata in shader generation. (#844)

* Add implemention of AttributeDef element.

* Added AttributeDef pointer types

* Support [[ ]] punctuations for scope begin/end.

* Fixed issue with boolean type in OSL.

* Add metadata to ShaderPort. Support generation of metadata for shader inputs.

* Added AttributeDef methods to document.

* Fixed bug with scope handling in shader generation

* Using AttributeDefs for registering shader metadata.

* Support for metadata on node level.

* Added unittest for metadata generation.

* Fix typo in standard_surface nodedef.

* Support input widget metadata.

* Code cleanup.

* Fix initialization order issue.

* Changed default value and unit on thin_film_brdf.thickness. (#868)

* Use alphabetical order for consistency

* Align whitespace with ILM convention

* Add documentation for Oren-Nayar diffuse

This changelist adds documentation for the GLSL implementation of Oren-Nayar diffuse, along with minor updates to function and variable names.

* Improvements to transparency detection

- Handle both scalar and color values for transparent inputs.
- Check for a transparent graph when no uniform input binding is found.

* Fixes for tests_to_html (#428)

* print fix for tests_to_html.py so it'll run in Python 3
* Fix for tests_to_html to operate and generate an html even if it doesn't have both osl -and- glsl

* Shading improvements for generated GLSL

- Add a Fresnel model term to mx_environment_radiance, allowing for correct integration of conductor Fresnel on rough surfaces.  Thanks to Stephen Hill at Lucasfilm for catching this issue in the codebase!
- Unify epsilon tests for shading dot products in GLSL, addressing artifacts from backwards shading normals.
- Refactor shading logic for consistency and clarity.
- Add a pure conductor material to the test suite.

* Finalize changelog for v1.37.1

* Update development build to 1.37.2

* Merge of library API + OSL displacement (#439)

- Cleanup library utilities and add Python bindings.
- Add support for displacement shaders in generated OSL.
- Remove the CopyOptions class, making it the default behavior for Document::importLibrary to skip conflicting elements.

* Update image placement in README

* Load standard libraries regardless of build folder location (#445)

This changelist fixes a dependency on the build folder being located within the repository root folder.

* Add support for floating-point render targets

This changelist adds support for floating-point render targets in ShaderRenderer and its subclasses, allowing for HDR texture baking with TextureBaker.

* Improvements to environment background rendering

This changelist improves the accuracy of environment background rendering in the viewer, using a node graph based on view direction rather than geometric texture coordinates.

* Fix reflections from rotated environment lights

This changelist fixes the alignment of reflections from rotated environment lights.

* Python Texture Bake and Multiple Udims Texture Bake Support (#448)

* Scripting and documentation updates

- Add support for texture baking of documents with validation warnings.
- Update documentation.

* Additional improvements to texture baking

- Update argument names in baketextures.py to match those in MaterialXView (e.g. --width, --height, --library).
- Add arguments for input search path and output filename to baketextures.py.
- Rename TextureBaker::bakeAllShaders to TextureBaker::bakeAllMaterials.

Additional supporting changes:
- Emit warnings for missing textures in GlslProgram::bindTexture.
- Mark Element::getDescendant as a const method.

* Normal map texture baking feature (#451)

* Colorspace texture bake fix (#454)

* Unify search path generation

This changelist aligns search path generation between the viewer and texture baker, adding the MaterialX::getDefaultSearchPath method to define the expected behavior.

* Image handling improvements

- Add support for UINT8 textures in setTexelColor, getTexelColor, and createUniformImage.
- Make sure GLTextureHandler::createRenderResources sets the packing alignment in all code paths.
- Add a workaround for sampling issues with 1x1 textures.

* Improvements to viewer texture baking

- Fix an OpenGL error after baking textures in the viewer.
- Apply a constant maximum resolution to baked textures.
- Minor clarifications to baking logic.

* Image class improvements

- Add Python bindings for Image classes and enumerations.
- Add helper method Image::isUniformColor.

Also, add a standard include to Element.cpp that is required in recent VS2019 build environments.

* Texture baking optimizations (#460)

- Store uniform images as constant colors in texture baking.
- Skip duplicate references to a single output in texture baking.

Additional supporting changes:
- Make TextureBaker::bakeAllMaterials a non-static method.
- Clarify method names for image saving in ShaderRenderer.
- Remove partial support for shader nodes in texture baking (to be addressed more robustly in 1.38).

* Static analysis fixes

- Remove an unused argument from Element::addChildOfCategory.
- Use emplace/emplace_back where simpler and more efficient than insert/push_back.
- Const correctness fixes.

* Image loading improvements

- If an ImageHandler has multiple loaders, they are applied in the order they were added by the client.
- If MaterialX has been built with OpenImageIO support, make it available as a secondary loader in both MaterialXView and TextureBaker.

* Update changelog for recent work

* Shader translation (#463)

- Added ShaderTranslator class
- Added python bindings for ShaderTranslator

Additional supporting changes:
- Moved TextureBaker::connectsToNormalMapNode() to MaterialXGenShader/Util.h

* Python image support

- Add Python bindings for loading, editing, and saving images.
- Simplify Python bindings for image-related classes.
- Simplify traversal of image loaders.

* Add support for MDL shader generation (#441)

MDL: 
- Add a MaterialXGenMdl project for MDL shader generation in MaterialX.
- Add support for OSL and MDL code generation in the MaterialX viewer.
- Related improvements to OSL and GLSL shader generation.
- MDL code generation unit testing (mdlc for compilation. df_cuda or dxr for command line rendering)

1.38:
- Swap atan2() arguments as was previously incorrect.
- Change rotate3d() "axis" from parameter to input.
- Tag standard surface with version (1.0.1)
- Update sheen and add thin-film support.
- 1.37 -> 1.38 upgrade tests

General:
- Additional material node support for traversal and shadergen.
- Uniform block support for GLSL generator.
- Add inlined implementation support.
- interfacename / node name clash upgrade handling.
- Nodedef publishing utilities

* Add TextureBaker controls for color space and constant optimization

- Add a TextureBaker control for the color space in which textures are encoded.
- Add a TextureBaker control for optimization of uniform textures as constant values.
- Extend Python bindings for TextureBaker methods.
- Add support for the g22_ap1 color space in code generation.

* Improve accuracy of g22_ap1 transforms

This changelist improves the accuracy of transforms from g22_ap1 to lin_rec709 in generated GLSL and OSL.

* Improve search path for baketextures script (#470)

* Improvements to library loading functions

- Clarify interfaces and fix Python bindings for loadLibrary and loadLibraries.
- Leverage library loading functions in genshader.py.

* Additional refinements to baketextures script

- Unify search paths for documents and images.
- Align naming conventions with other Python scripts.

* Python import improvements

- Import MaterialX libraries consistently across Python scripts.
- Remove unused imports from Python scripts.

* Improvements to diffuse BSDF tests

This changelist integrates improvements to the diffuse BSDF test materials from the 1.38 branch of MaterialX.

* Improve CMake backwards compatibility

This changelist updates the CMakeLists.txt file in MaterialXTest to use patterns supported by earlier versions of CMake in addition to the latest version.

* Extend wedge rendering to color properties

* Static analysis fixes

- Add missing quotation marks to string literal.
- Add missing null checks.
- Use emplace_back where simpler and more efficient than push_back.
- Const correctness fixes.

* Documentation updates

- Fix mismatching braces in Doxygen comments
- Update changelog for recent work.
- Update main page for recent presentations.

* Align variable names

- Align variable names between interface and implementation in loadLibraries.
- Use a single variable name convention in baketextures.py.
- Additional script cleanup in baketextures.py.

* Finalize changelog for v1.37.2

* Clarify the new interface for PortElement

* Add output connection methods to PortElement

* Update development build to 1.37.3

* Initial support for shared libraries

This changelist adds initial support for shared libraries on Linux and MacOS.

* Update pre-built binaries

This changelist updates the links for pre-built binaries, pointing them to the latest release rather than the latest commit.

* Wedge updates for v1.38. (#483)

- Expose general parameters in advanced.
- Expose choice of parameter to sample (supports int, float, vec2, vec3, color3, vec4, color4) now vs only float before.
- Support more than tga in file dialog.
- Add in additional command line arguments to avoid having to interactively perform this:
--cameraZoom : Amount of user zoom to apply 1.3 seems to get a close fit.
--envSampleCount : Default is 16 but 64 is a good fidelity number.

* Improvements to transparency rendering in viewer

- Add a Render Transparency option to the Advanced Settings panel.
- Allow transparent surfaces to be shadow receivers.

* Github actions support (#427)

Initial support for continuous integration support with Github Actions.

Has a builder for linux, macos, and windows with vs2017 and 2019.

* Extend GitHub Actions coverage

* Range loop analysis fixes

This changelist addresses range-loop analysis warnings reported by Clang 12.

* Refinements to GitHub CI

- Add Python 2.7 builds on Linux and MacOS.
- Remove unused Python path step.
- Clarify job names.

* Update project badges

- Remove Travis CI badge, as this functionality is now covered by GitHub CI.
- Add release version badge.

* Parameter to input 1.38 update Part 1. (#493)

- Convert Parameters to Inputs marked as "uniform".  Note that according to the spec all "filename" and "string" types are uniform. **All other inputs are marked with `uniform="false"`**. 
- Modify addInput() to make name, type required arguments and add in a `isUniform` argument (default=`false`) to allow a single method to create and set whether something is uniform. Note that according to the spec all `filename` and `string` types are uniform. 
- Add new `getIsUniform()` and `setIsUniform()` APIs.
- Replace all `get/set/isA<Parameter>()` calls with new API calls.
- Remove `getPrimaryShaderParameters()` API from Material Element.
- Update Core, ShaderGen + tests. RTS passes for GLSL, MDL, and Vanilla OSL.

**Note** : While 1.38 is WIP, we keep the version at 1.37 so that the upgrade will be appied.

* stdlib (defintion + node graph implementations) after upgrade. inputs with `uniform` attributes are converted `parameters`
[1_37_to_1_38_updated .mtlx.txt](https://github.com/materialx/MaterialX/files/5319974/1_37_to_1_38_updated.mtlx.txt)

* Merge branch 'master' into v1.38 (#495)

* Improvements to acquireImage

- Remove the 'message' return value from ImageHandler::acquireImage, allowing for more straightforward Python bindings.
- Generate mipmaps by default in ImageHandler::acquireImage.

* Refinements to shader translation

- Add handling for source materials without node graphs.
- Add handling for source materials with unsupported inputs.

* Remove unused variables

* Remove legacy Observer classes

This changelist removes the legacy Observer and ObservedDocument classes, which have been superseded by the MaterialXRuntime library for real-time graph editing.  Callback methods that were exclusively leveraged by Observer classes have been removed as well.

* Image I/O improvements

- Add exception handling to image I/O calls.
- Clarify documentation for the MATERIALX_OIIO_DIR option in CMake.

* Improvements to shader translation

- Make ShaderTranslator::translateAllShaders a non-static member function.
- Use exceptions rather than standard I/O to signal errors.
- Add error messages for common missing features in translation graphs.

* Robustness improvements for translation and baking

- Add handling for edge cases in shader translation (e.g. missing normal maps).
- Add handling for edge cases in texture baking (e.g. missing node inputs).
- Improved handling of upgrades for legacy documents.

* Improvements to texture baking

- Omit default-valued constants in texture baking.
- Bake TIFF/EXR files when OpenImageIO is available.

* Viewer improvements

- Add render support for partially-transparent meshes.
- Automatically split meshes by UDIMs as required.
- Additional refinements to texture baking.

* Improvements to OpenGL texture handling

- Fix an edge case in image resource construction.
- Emit warnings when errors are encountered in image binding.

* Add support for image averaging in baking

* Additional viewer options

- Add a double-sided rendering option to the Advanced Settings panel.
- Add hotkeys for cycling through selected geometries (up/down arrows).

* Add GLSL subsurface scattering approximation

This changelist adds a simple subsurface scattering approximation to MaterialX GLSL.  The high-level approach is to integrate Burley's diffusion profile over the sphere using Eric Penner's curvature-based approximation.  While this ignores the thickness of the scattering volume, it keeps the implementation within a single shading pass and provides a meaningful visual interpretation of the subsurface scattering inputs.

* GLSL shading improvements

- Render back faces with forward-facing normals.
- Fix artifacts with low roughness values in sheen rendering.

* Fix for single-channel textures in MaterialXRenderGlsl

This changelist fixes the rendering of single-channel textures in MaterialXRenderGlsl, setting the required state that replicates the red channel to RGB.

* Handle empty environments in computeDominantLight

* Viewer improvements

- Handle UDIMs when merging multiple materials.
- Invalidate shadow maps when a new material is loaded.
- Check for zero intensities in splitDirectLight.
- Consider "existence" bindings when computing transparency.

* Remove legacy CI configurations

This changelist removes legacy CI configurations for Travis and Appveyor, and updates the changelog for recent work.

* Update env commands in GitHub Actions

* Image handling improvements (#520)

- Unify the handling of missing images in generated GLSL, binding a 1x1 sentinel image when the declared default value should be rendered.
- Remove legacy handling for fallback colors in image loading.
- Add a missing image example to the test suite.

* Remove MATERIALX_DEBUG_POSTFIX in favor of CMAKE_DEBUG_POSTFIX (#509)

* Additional workflow fixes

- Add a missing variable initialization in TextureBaker.
- Restrict UDIM assignments to materials in the viewer.

* Fix bug with codegen of custom BSDF/EDF graphs.

* Use newer OpenImageIO interface.

* Allow building against an external NanoGUI installation (#525)

* Merge from ADSK to LucasFilm 1.38 (#522)

* Update changelog for recent work

* Add changelog and readme to install

This changelist adds two root-level documents, CHANGELOG.md and README.md, to installations of MaterialX.

* Finalize changelog for v1.37.3

* Update links in README

* ADSK Update to ILM v1.38. (#529)

- Further updates / fixes for **TextureBaker**:
  - Fixes for per shader iteration, making it less state dependent
    - Perform proper state cleanup to avoid corruption between bakes.
  - Options for graph, and geominfo nodes created
  - Return list of documents to allow external file I/O flexibility.
- Port of **ShaderTranslator** to use Material nodes:
  - Add colorspace + units support
  - Add in missing traversal utility to upstream inputs.
  -  Fix state cleanup per shader translation to avoid corruption between translations.
- Fixes for **USD Preview surface**
  - Update "reflectivity" computation to match version 2.3 revision logic. (was modulating by diffuse twice).
  - Add version tag to definition

Additional GLSL changes:
- Update to handle uniform resources blocks for GLSL.
- Expose number of environment samples as settable option.

* Simplify image codec test

* Additional parameter updates for 1.38

- Remove remaining ParameterPtr references in Document::upgradeVersion.
- Add a fast path for non-existent attributes in Element::getTypedAttribute.

* Remove Parameter class

This changelist removes the legacy Parameter class from the v1.38 branch of MaterialX.

* Remove ShaderRef classes

This changelist removes the legacy ShaderRef, BindInput, BindParameter, and BindToken classes from the v1.38 branch of MaterialX.

* Remove Material element class

This changelist removes the legacy Material element class, and merges MaterialNode.cpp/h into Material.cpp/h and Look.cpp/h.

* Initial material unit tests

- Add initial C++ unit tests for the v1.38 material interface.
- Add helper methods Node::setConnectedOutput, Node::getConnectedOutput, and GraphElement::addMaterialNode.

* Additional material unit tests

- Additional C++ unit tests for the v1.38 material interface.
- Generalize the setConnectedOutput and getConnectedOutput methods.
- Merge unit tests from FormatUtil.tpp into File.cpp.

* Initial look unit tests

- Add initial C++ unit tests for looks and material assignments.
- Extend material and look unit tests to Python.
- Rename Look::getReferencedMaterialNode to Look::getReferencedMaterial for simplicity.

* Add shared library build

This changelist adds a Linux shared-library build to GitHub Actions CI.

* Update development build to 1.37.4

* OpenGL improvements for software rendering

- Add missing VAO binding to GlslRenderer::drawScreenSpaceQuad.
- Use warnings rather than exceptions to report OpenGL errors.
- Update CMake settings in MaterialXRenderGlsl to prefer GLVND libraries.
- Reorganize GLUtilityContext into GLUtil and GLContext for clarity.

* Add material baking to GitHub Actions CI

This changelist adds an initial material baking example to our GitHub Actions CI, leveraging xvfb for software OpenGL rendering on Linux.

* Improved robustness in MaterialXRenderGlsl

- Clarify the lifetime and ownership of WindowWrapper objects using shared pointers.
- Improve alignment of OpenGL context management between platforms.
- Minor formatting and comment updates for consistency and clarity.

* Make strings local to module

This changelist makes two strings local to the ConvolutionNode module, in order to work around a compiler issue on Linux.

* Additional improvements to MaterialXRenderGlsl

- Simplify platform-specific logic in GLContext.
- Add a null check to the Linux SimpleWindow destructor.
- Remove a context-changing call from the GlslRenderer destructor.
- Remove an unused header from the glew library.
- Clarify an initializer in the GlslProgram constructor.

* Update version badge link

* Improved color space handling in MaterialXRenderGlsl

- Correctly transfer color spaces of uniform values in TextureBaker.
- Add a warning for unsupported color space transforms in ShaderGraph.
- Add a second material baking test to GitHub Actions.
- Minor clarifications to example materials.

* Update changelog for recent work

* Disable software render tests in v1.38

* Add upgrade path for color2 type

This changelist adds an upgrade path for the legacy color2 type, and removes all references to color2 in the standard libraries.

Additional improvements:

- Integrate a fix to non-material rendering in the viewer (thanks to Bernard at Autodesk).
- Clarify a few warnings in shader generation.

* Remove color2 classes

* Refinements to GitHub Actions CI

- Initialize the virtual framebuffer before running unit tests, opening the door to more advanced render testing in the future.
- Remove unused libraries in MacOS builds.

* Finalize changelog for v1.37.4

* Texture baking improvements

- Align texture baking logic between render tests and the MaterialX viewer.
- Align TextureBaker function signatures with their v1.37 equivalents for consistency.
- Remove references to the standard regex library, which is not consistently supported in GCC 4.8.
- Restore cloud-based tests for material baking.

* Minor refinements to v1.38

- Align the signature of InterfaceElement::addInput with v1.37.
- Rename resolveFileNames to flattenFilenames for clarity.
- Extend the image search path in viewer texture baking.

* Remove legacy applyFutureUpdates flag

This changelist removes the legacy applyFutureUpdates flag, which no longer has any effect on document loading.

* Additional cleanup for v1.38

- Remove references to parameter elements in documentation.
- Restore default name argument to InterfaceElement::addInput.
- Align conventions for MDL generation code.

* Viewer and texture baking improvements

- Simplify texture baking in the viewer, assigning it a unique 'B' hotkey rather than overloading the Save Material button.
- Simplify the property name option for wedge rendering, making it an editable string grouped with other wedge options.
- Various improvements and fixes for texture baking.
- Update viewer documentation for new features.

* Additional baking fixes for v1.38

- Fix order of operations for processing uniform outputs.
- Remove document-modifying calls from texture baking.
- Remove an incorrect early exit in texture baking.
- Fix version strings for partial document upgrades.

* Add image averaging test to CI

* Add MDL support for g22_ap1

This changelist adds support for the g22_ap1 color space in MDL code generation.

* Fix bug in PNG file writing

* Fix OpenGL error in frame capture

* Improvements to GitHub CI

- Add support for parallel builds.
- Simplify Linux dependencies.
- Simplify render tests.

* Add viewer rendering to GitHub CI

- Add a viewer rendering test to GitHub Actions CI, rendering a uniform material and saving the image to disk.
- Add a captureFilename command line option to the viewer.
- Add a Viewer::initialize method, allowing settings to be modified between class construction and resource loading.

* Merge from ADSK fork to v1.38 LucasFilm (Jan 6, 2020) (#561)

* Cleanup.

Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>
Co-authored-by: Madeleine Yip <52723401+mjyip-lucasfilm@users.noreply.github.com>
Co-authored-by: Doug Smythe <dbsmythe@gmail.com>
Co-authored-by: Ashwin Bhat <1727158+ashwinbhat@users.noreply.github.com>
Co-authored-by: alister-chowdhury <30833607+alister-chowdhury@users.noreply.github.com>
Co-authored-by: Niklas Harrysson <niklas.harrysson@gmail.com>
Co-authored-by: Indy Ray <iray@telltale.com>
Co-authored-by: bsavery <brian.savery@gmail.com>
Co-authored-by: debaetsd <debaetsd@gmail.com>
Co-authored-by: rzulak <rzulak@imageworks.com>
Co-authored-by: marsupial <marsupial@users.noreply.github.com>
bernardkwok added a commit to kwokcb/MaterialX that referenced this pull request Oct 5, 2021
* Move Image class to its own source and header files

- Move the Image class to its own source and header files (Image.cpp and Image.h), allowing image processors to depend on Image without depending on ImageHandler and ImageLoader.
- Add a ConstImagePtr alias to clarify the behavior of image processing interfaces.
- Minor whitespace fixes in Util.h.

* Vector class improvements

- Consistently return the VectorN type from operators that return vector references.
- Minor formatting fixes.

* Move Travis image declarations to the build matrix

This provides clearer feedback during Travis builds and allows for greater flexibility in the future.

* Initial setTexelColor method

Add an initial setTexelColor method to the Image class

* Initial support for spherical harmonic irradiance (#322)

- Add the ShCoeffs class template, representing a set of spherical harmonic coefficients for a particular data type and number of bands.
- Add the projectEnvironment function, allowing a lat-long environment to be projected to third-order spherical harmonics (with or without an irradiance convolution).
- Add the renderEnvironment function, allowing a third-order spherical harmonic signal to be rendered to a lat-long environment map.

* Add a Load Environment option to the viewer

This changelist adds a Load Environment option to the viewer, allowing arbitrary lat-long environment lights to be loaded at run-time.  If a pre-generated diffuse convolution is not found on the file system, then one will be generated at load-time via spherical harmonics.

Additional changes:

- Add a resources/Images/Environments folder, containing two environment light options (san_giuseppe_bridge and piazza_bologni).
- Create rendering resources for images on demand, rather than at construction time.
- Add a lightweight half-precision float class to MaterialXRender, allowing spherical harmonics to be generated from half-precision environment lights.
- Add handling to the render test suite for missing OSL executable locations.
- Move the Save Material option to the Property Editor.

* Update documentation for recent work (#325)

- Add documentation for the Load Environment option.
- Add documentation for OpenImageIO support.
- Update images for textured materials in the viewer.
- Additional improvements for clarity and consistency.

* Add ambient occlusion support to HwShaderGenerator

This changelist adds support for ambient occlusion images to HwShaderGenerator, replacing the custom multi-pass solution previously used in MaterialXView.

The new implementation is available to any application leveraging GLSL shader generation, and should be extensible to other shadowing and visibility solutions in the future.

* Vector class improvements

- Generalize getMagnitude to handle all subclasses of VectorN
- Specialize Color classes directly from VectorN for consistent handling of operators.
- Move <cmath> library include to Types.h.
- Add missing Python tests for Vector operators.

* MacOS build improvements

- Integrate Ashwin's MacOS fix from the Autodesk fork (https://github.com/autodesk-forks/MaterialX/pull/647)
- Silence OpenGL deprecation warnings in MacOS builds.
- Increment the osx_image setting to xcode11, so that we're testing against a more recent MacOS image.
- Minor fixes to CMake formatting and whitespace.

* CMake build simplifications

- Unify target link lists across platforms.
- Remove duplicate requirements tests.
- Minor improvements to formatting.

* Improvements to light and image handling

- Unify direct light management between the viewer and light handler.
- Add functions Image::splitByLuminance and computeDominantLight for upcoming rendering work.
- Fix an edge case in AO image loading.
- Fix an edge case in property editor display.

* Update PyBind11 to version 2.4.3

* Documentation updates

- Update to the latest revision of the 1.37 specification.
- Add hyperlinks to the contributor page.
- Minor revisions to Doxygen comments.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS, including the following:

- Remove a signed bitshift operation with undefined C++ behavior, replacing it with the intended constant result.
- Restrict the capture scope of two lambdas, removing access to temporary variables.

Also:

- Add initial unit tests for the Half class, providing validation for future work.

* Finalize changelog for v1.36.5

* Updates for MaterialX v1.37 (#338)

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

### Added
- Added support for LookGroup elements.
- Added support for the 'uisoftmin', 'uisoftmax', and 'uistep' attributes, updating Autodesk Standard Surface to leverage these features.

### Changed
- Updated the set of standard nodes to match the v1.37 specification.
- Unified the rules for NodeDef outputs, with all NodeDefs defining their output set through Output child elements rather than 'type' attributes.
- Replaced backdrop nodes with Backdrop elements.
- Improved the robustness of GLSL and OSL code generation.

* Update document version strings

- Update document version strings to 1.37.
- Remove legacy attributes from root elements.

* Extend build tests to Python 3.8

Extend Appveyor build tests to include Python 3.8, which is supported by the latest version of PyBind11.

* Extend build tests to Clang 9

Extend Travis build tests to Clang 9, and fix a related warning in MaterialXRenderGlsl.

* Add a Split Environment option to the viewer (#349)

This changelist adds a Split Environment option to the advanced tab of the MaterialX viewer, allowing an HDR environment light to be split into its indirect and direct (i.e. dominant directional light) components at load-time.

This work is intended as a precursor to future shadowing improvements in GLSL shader generation and MaterialXView.

For organizational clarity, user-facing light resources have been moved into a resources/Lights folder, and test suite lights have been moved into resources/Materials/TestSuite/lights.

* Update CMake policy for broader compatibility

This changelist updates the CMake policy for OpenGL library preferences, requesting that older libraries be used when both new and old are present in the same environment.  This addresses an issue brought up by Frankie Liu at Nvidia on the MaterialX discussion forum.

* View handler improvements

- Add method ViewHandler::createOrthographicMatrix.
- Provide direct access to ViewHandler data.
- Harmonize matrix computations across the MaterialX viewer.

* Viewer rendering fixes

This changelist fixes two rendering issues in the MaterialX viewer:

- Fix wireframe rendering with the Outline Selected Geometry option.
- Fix rendering of mixed opaque/transparent looks.

For simplicity, the UV wireframe hotkey has been removed, as it required some duplication of rendering logic, and we can integrate this functionality into the main render pathway if needed in the future.

* Update stb_image to version 2.23

* Initial support for variance shadow maps

This changelist adds support for variance shadow maps to the MaterialXGenGlsl code generator, allowing applications based on this generator to easily include the rendering technique.

The MaterialX viewer now includes a "Shadow Map" option on its Advanced Settings page, and its default lighting environment now has separate direct and indirect components, allowing different shadowing approaches to be used for each.

* Shadow rendering improvements

- Add helper function GLTextureHandler::mapTextureFormatToGL for consistency.
- Defer shadow map allocations until requested by the user.
- To view a scene with variance shadow maps, click Load Environment and select Resources/Lights/san_giuseppe_bridge_split.hdr, then enable Shadow Maps in the Advanced Settings page.

* Light environment improvements

- Move irradiance maps to a subfolder for clarity.
- Rebuild the san_giuseppe_split environment with a higher split luminance.
- Extend createRenderResources and getTexelColor to additional texture formats.
- Add reference CPU functions for image convolution.

* Texture-space rendering improvements

- Modularize functionality for future reuse, adding methods GLFrameBuffer::setEncodeSrgb, GLFrameBuffer::getEncodeSrgb, and GlslRenderer::drawScreenSpaceQuad.
- Remove duplicate OpenGL calls.

* Document upgrade fixes

This changelist fixes two edge cases when upgrading documents to v1.37 at import time:

- Return a default value rather than throwing an exception in getType, as this method can be called during the upgrade process itself.
- Upgrade nested nodes as well as those at root scope.

* Image convolution improvements

- Align Gaussian kernel weights between CPU and GPU implementations.
- Add createBlurShader helper function to MaterialXRender.
- Replace non-standard shader usage in mx_shadow.glsl.

* Shadow quality improvements

- Add a Gaussian blur step to shadow map generation.
- Clear the shadow framebuffer to one before rendering.
- Enable anisotropic filtering in the texture handler.
- Enable shadow maps by default.

* Harmonize vector conventions for matrix methods

This changelist aligns all matrix methods in MaterialX with the row-vector convention, in which matrix-vector multiplication is computed as v' = vM.

Previously, there was disagreement between the createTranslation methods (which followed row vector) and the createRotation/multiply methods (which followed column vector), requiring unnecessary calls to getTranspose in rendering code.

Documentation of the library vector convention has been added to Types.h, and related matrix code has been refactored for clarity.

* Update from GeomAttr to GeomProp for 1.37

This changelist implements the update from GeomAttr to GeomProp elements described in the v1.37 specification, along with the corresponding change from <geomattrvalue> to <geompropvalue> nodes.  Legacy documents from v1.36 and earlier are automatically upgraded at load-time.

See http://www.materialx.org/assets/MaterialX.v1.37REV2.Changelist.pdf for a complete list of changes in v1.37.

* Patch osl implementations for geompropvalue (#368)

* Static analysis fixes (#369)

- Fixes for static analysis warnings reported by PVS
- Documentation and formatting updates

* Generalize colorspace usage for filename (#370)

Update to shader generation support for `colorspace` to be consistent with `unit` support.
* This change makes it so that the `colorspace` attribute can now be recognized at the same scope / location as for `units`. This includes handling `filename` inputs which have been exposed
via a `nodegraph` definition interface (`interfacename`).
* Previously, `colorspace` would only be recognized on `filename` inputs which reside on an `image` node directly (not exposed via a interface)
* Additional configurations added to unit tests

* Light environment improvements

- Improve the accuracy of computing the dominant directional light from an environment map.
- Add support for environment map normalization.
- Rebuild the san_giuseppe environment.
- Add the venetian_crossroads and spruit_sunrise environments, including both combined and split variants.

* Increase environment split radiance

This changelist increases the split radiance for environment maps from 2 to 16, providing a better balance between direct and indirect lighting terms.

* Update documentation for recent work

* Syntax Example Updates (#375)

Updates to Syntax example files to better conform to 1.37 syntax and conventions

* Code and documentation cleanup

- Clarify implementations of matrix transforms and environment normalization.
- Simplify viewer constructor and filename generation.
- Update documentation for MATERIALX_PYTHON_PYBIND11_DIR.

* Harmonization on singular unit names. (#378)

Using https://physics.nist.gov/cuu/Units/units.html as a reference to use singular naming convention.
e.g. angle is 30 degree instead of degrees

* Update light paths in test suite

This changelist updates two light paths in the render test suite, matching the new location of environment irradiance maps.

* Python Script Examples Updates (#380)

writelooks.py: added output of lookgroup
mxvalidate.py: added support for geomprops, backdrops and lookgroups, preliminary support for units; changed output format for very-verbose nodegraphs to better indicate connections vs values

* Unit tests options file fix (#381)

Need to tranpose the uv transform used for GLSL unit tests to match current convention.

* Enable render tests by default

- Enable render tests by default in MaterialXTest, and disable this feature explicitly for CI builds.
- Require that environment lights are successfully found in render tests.

* Update tiled wood example

This changelist updates the tiled wood example material, replacing its tiled textures and assigning specular anisotropy and clearcoat properties.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS:

- Add self-assignment check to WindowWrapper assignment operator.
- Remove extra null check in Viewer::loadEnvironmentLight.
- Replace push_back with emplace_back for simplicity.

* Finalize changelog for v1.37.0

* Additional fixes for v1.37.0

- Update the v1.26 upgrade path for the v1.37 API.
- Fix edge cases for lighting search paths in the viewer.

* Initial support for Appveyor build artifacts

* Add documentation for Windows binaries

* Light environment improvements

- Add the Goegap and Table Mountain lighting environments, providing higher-dynamic-range options than San Giuseppe Bridge.
- Update documentation with Lucasfilm examples and new environments.

* Restore viewer dimensions

* Update development build to 1.37.1

* Add backwards compatibility for OIIO 1.x

This changelist adds backwards compatibility for OpenImageIO 1.x, using the pattern described in the OpenImageIO 2 porting guide.

Also, remove a documentation line describing the MATERIALX_TEST_RENDER flag, which is now enabled by default in builds.

* Standard library path improvements

- Make unit conversion robust to missing standard data libraries.
- Add a viewer warning for missing standard data libraries.
- Add helper method FilePath::getModulePath, which returns the directory containing the executable module.
- Update the viewer to leverage FilePath::getModulePath.
- Improve documentation for the --path and --library flags in the viewer.

* Use Python 3 by default in Travis builds

* Refactor two MaterialXGenShader methods for VS2019

This changelist refactors the MaterialX::readFile and SourceCodeNode::initialize methods for better compatibility with Visual Studio 2019

* GLSL shading improvements

- Remove duplicate library and resource folders that were generated during the MaterialXView build process.  This makes shader development more straightforward, where a developer can edit library source files directly and hit 'R' to reload shaders in the viewer.
- Use texture address modes rather than shader logic to keep latitude-longitude texture coordinates within bounds.  This addresses lighting artifacts along longitude seams in filtered importance sampling.
- Move spherical Fibonacci methods from mx_math.glsl to mx_environment_fis.glsl, removing them from generated shaders where they're not needed.

* Use height-correlated Smith masking-shadowing

This changelist updates the GLSL implementation of Smith masking-shadowing from uncorrelated to height-correlated forms, as described in http://jcgt.org/published/0003/02/03/paper.pdf.  As a future improvement, we should also update from isotropic to anisotropic forms, as described in the same paper.

* Update Travis build settings

This changelist updates Travis settings to accommodate recent changes to their build environments.

* Backdrop element improvements

- Add utility methods Backdrop::setContainsElements and Backdrop::getContainsElements.
- Rename Backdrop::setContains/Backdrop::getContains to Backdrop::setContainsString/Backdrop::getContainsString for consistency.
- Remove unneeded element names in unit tests.
- Remove an outdated warning in PortElement::validate.

* Energy conservation improvements for generated GLSL

- Add mx_microfacet_ggx_directional_albedo for computing a directional albedo for the GGX/Smith/Schlick BRDF.
- Replace mirror Fresnel with directional albedo for BSDF layering.
- Move Fresnel computation into the lighting integral for filtered importance sampling.
- Add mx_average_roughness for converting from anisotropic to isotropic roughness.

* Initial support for wedge rendering

- Add initial support for "wedge" rendering, where a single property is ramped between two values across successive screenshots, and the resulting image set is merged into a strip.  The new feature is activated by pressing the 'W' key in the MaterialX viewer, and settings for the render are hardcoded for now.
- Add hotkeys for adjusting camera zoom (+/-).
- Add utilities FilePath::addExtension and MaterialX::stringEndsWith.
- Refactor Viewer::drawContents for greater flexibility.
- Update changelog for recent work.

* Display advanced material properties by default

- Display advanced material properties by default in the viewer.
- Refactor BSDF function names for clarity.

* Refactor sheen BRDF for clarity

- Refactor the implementation of the sheen BRDF in GLSL to align with other BxDF nodes.
- Remove an unused overload of mx_fresnel_schlick.

* Energy compensation improvements for generated GLSL (#407)

- Add mx_ggx_energy_compensation for computing multiple scattering compensation with GGX/Smith shading.
- Split mx_ggx_directional_albedo into approximate and reference versions for evaluating approximation accuracy.
- Incorporate energy compensation into conductor_brdf, dielectric_brdf, and generalized_schlick_brdf.
- Add a Reference Quality option to MaterialXView.

* ADSK master to ILM master (#401)

Material node support plus additional improvements

* Remove duplicate data folders for viewer

This changelist restores an earlier improvement lost in the last merge, removing duplicate library and resource folders that were generated during the MaterialXView build process.

* Directional albedo improvements for generated GLSL

- Add generator option hwDirectionalAlbedoMethod for selecting between curve fit, table look-up, and importance sampling in directional albedo computations.
- Add generator option hwWriteAlbedoTable for generating a directional albedo table on the GPU.
- Use table look-up for directional albedo computations in the MaterialX viewer.

Also refactor the implementation of FilePath::removeExtension for consistency with FilePath::addExtension.

* Refactor microfacet library for generated GLSL (#412)

- Split mx_bsdfs.glsl into mx_microfacet, mx_microfacet_diffuse, mx_microfacet_specular, and mx_microfacet_sheen for more granular includes.
- Generate samples with respect to the standard basis in mx_ggx_directional_albedo_importance_sample (thanks to Stephen Hill for this suggestion).
- Improvements to method names, variable names, and documentation.

* Enable parallel builds in Appveyor

* Fix spelling in standard_surface graph

* Extend transparency heuristic to all surface shaders

This changelist takes the current transparency heuristic for standard_surface and extends it to all surface shaders, producing a more consistent result for UsdPreviewSurface and custom physically-based shaders.

* Simplify normal computation in UsdPreviewSurface

This changelist simplifies the computation of the per-pixel normal in UsdPreviewSurface, leveraging the standard <normalmap> node and removing a dependency on the bitangent stream.

* Improvements to material examples

- Add a standard_surface_brushed_metal example with high anisotropy.
- Increase the anisotropy of standard_surface_jade.
- Improve the unit tests for geometric streams, making them useful as debug visualizations for normals, tangents, and bitangents.

* Improvements to tangent frame generation

- Detect and skip duplicate vertices in TinyObjLoader::load, providing more accurate adjacency data for tangent frame generation.
- On hardware shading targets, generate bitangents in the vertex shader rather than storing them as an independent data stream.
- Refactor Mesh::generateTangents for improved robustness and clarity.

Supporting changes:

- Add a VectorN less-than operator, allowing vectors to be used as map keys.
- Add a MeshStream::getElement method to simplify geometry processing logic.

* Improvements to image extension handling

- Update ImageHandler::acquireImage to recognize extensions with non-standard letter case.
- Add clearer warning messages for images that fail to load.

* Improved handling for missing data libraries

* Fix upgrade path for compare nodes

- Fix comparison order in the upgrade path for compare nodes in v1.36 documents.
- Refactor the v1.36 upgrade path for clarity.

* Align behaviors of setConnectedNode methods

Align the behaviors of PortElement::setConnectedNode and Node::setConnectedNode, clarifying that a null NodePtr argument will clear any existing node connection.

* Improvements to image I/O

- Fix a CMake issue with OpenImageIO builds.
- Add a warning message for missing image files.

* Python related fixes for #355 and #359 (#411)

- Added CMake logic so pybind11 can be found, if no explicit path is provided
- Display validation warnings in Python unit tests.
- Remove Python bindings of header-defined constants.

* Add command-line options for mesh and light rotation

- Add command-line options '--meshRotation' and '--lightRotation' to the viewer.
- Add a Light Rotation slider to the Advanced Settings panel of the viewer.

Supporting changes:

- Add support for unary negation of a VectorN.
- Add error reporting for viewer command-line options.

* Add command-line options for camera position and target

- Add command-line options '--cameraPosition', '--cameraTarget', and '--meshScale' to the viewer.
- Generalize shadow transform for arbitrary camera placement.
- Mark the vector negation operator as const.

* Additional command-line options for the viewer

- Add command-line options '--cameraViewAngle', '--screenWidth', '--screenHeight', and '--screenColor' to the viewer.
- Simplify token parsing for command-line options.
- Update changelog for latest work.

* Add support for vector hashing

- Add support for hashing instances of VectorN classes, enabling their use as keys in unordered containers.
- Optimize TinyObjLoader::load by tracking duplicate vertices in an unordered map.
- Refactor MaterialXCore to remove unneeded dependencies.

* Shading model fixes and improvements

- Remove an extra factor of PI in the analytic Burley diffuse term for generated GLSL.
- Improve the robustness of the upgrade path for v1.36 compare nodes.
- Reset camera view angle when a new mesh is loaded into the viewer.

* Add support for GCC 10

- Add missing include to Element.cpp.
- Minor refactor of MaterialXCore dependencies.
- Update Travis configuration for GCC 10.

* Update documentation for v1.37.1

- Fix warnings reported by Doxygen.
- Update changelog for latest work.

* Support for exporting metadata in shader generation. (#844)

* Add implemention of AttributeDef element.

* Added AttributeDef pointer types

* Support [[ ]] punctuations for scope begin/end.

* Fixed issue with boolean type in OSL.

* Add metadata to ShaderPort. Support generation of metadata for shader inputs.

* Added AttributeDef methods to document.

* Fixed bug with scope handling in shader generation

* Using AttributeDefs for registering shader metadata.

* Support for metadata on node level.

* Added unittest for metadata generation.

* Fix typo in standard_surface nodedef.

* Support input widget metadata.

* Code cleanup.

* Fix initialization order issue.

* Changed default value and unit on thin_film_brdf.thickness. (#868)

* Use alphabetical order for consistency

* Align whitespace with ILM convention

* Add documentation for Oren-Nayar diffuse

This changelist adds documentation for the GLSL implementation of Oren-Nayar diffuse, along with minor updates to function and variable names.

* Improvements to transparency detection

- Handle both scalar and color values for transparent inputs.
- Check for a transparent graph when no uniform input binding is found.

* Fixes for tests_to_html (#428)

* print fix for tests_to_html.py so it'll run in Python 3
* Fix for tests_to_html to operate and generate an html even if it doesn't have both osl -and- glsl

* Shading improvements for generated GLSL

- Add a Fresnel model term to mx_environment_radiance, allowing for correct integration of conductor Fresnel on rough surfaces.  Thanks to Stephen Hill at Lucasfilm for catching this issue in the codebase!
- Unify epsilon tests for shading dot products in GLSL, addressing artifacts from backwards shading normals.
- Refactor shading logic for consistency and clarity.
- Add a pure conductor material to the test suite.

* Finalize changelog for v1.37.1

* Update development build to 1.37.2

* Merge of library API + OSL displacement (#439)

- Cleanup library utilities and add Python bindings.
- Add support for displacement shaders in generated OSL.
- Remove the CopyOptions class, making it the default behavior for Document::importLibrary to skip conflicting elements.

* Update image placement in README

* Load standard libraries regardless of build folder location (#445)

This changelist fixes a dependency on the build folder being located within the repository root folder.

* Add support for floating-point render targets

This changelist adds support for floating-point render targets in ShaderRenderer and its subclasses, allowing for HDR texture baking with TextureBaker.

* Improvements to environment background rendering

This changelist improves the accuracy of environment background rendering in the viewer, using a node graph based on view direction rather than geometric texture coordinates.

* Fix reflections from rotated environment lights

This changelist fixes the alignment of reflections from rotated environment lights.

* Python Texture Bake and Multiple Udims Texture Bake Support (#448)

* Scripting and documentation updates

- Add support for texture baking of documents with validation warnings.
- Update documentation.

* Additional improvements to texture baking

- Update argument names in baketextures.py to match those in MaterialXView (e.g. --width, --height, --library).
- Add arguments for input search path and output filename to baketextures.py.
- Rename TextureBaker::bakeAllShaders to TextureBaker::bakeAllMaterials.

Additional supporting changes:
- Emit warnings for missing textures in GlslProgram::bindTexture.
- Mark Element::getDescendant as a const method.

* Normal map texture baking feature (#451)

* Colorspace texture bake fix (#454)

* Unify search path generation

This changelist aligns search path generation between the viewer and texture baker, adding the MaterialX::getDefaultSearchPath method to define the expected behavior.

* Image handling improvements

- Add support for UINT8 textures in setTexelColor, getTexelColor, and createUniformImage.
- Make sure GLTextureHandler::createRenderResources sets the packing alignment in all code paths.
- Add a workaround for sampling issues with 1x1 textures.

* Improvements to viewer texture baking

- Fix an OpenGL error after baking textures in the viewer.
- Apply a constant maximum resolution to baked textures.
- Minor clarifications to baking logic.

* Image class improvements

- Add Python bindings for Image classes and enumerations.
- Add helper method Image::isUniformColor.

Also, add a standard include to Element.cpp that is required in recent VS2019 build environments.

* Texture baking optimizations (#460)

- Store uniform images as constant colors in texture baking.
- Skip duplicate references to a single output in texture baking.

Additional supporting changes:
- Make TextureBaker::bakeAllMaterials a non-static method.
- Clarify method names for image saving in ShaderRenderer.
- Remove partial support for shader nodes in texture baking (to be addressed more robustly in 1.38).

* Static analysis fixes

- Remove an unused argument from Element::addChildOfCategory.
- Use emplace/emplace_back where simpler and more efficient than insert/push_back.
- Const correctness fixes.

* Image loading improvements

- If an ImageHandler has multiple loaders, they are applied in the order they were added by the client.
- If MaterialX has been built with OpenImageIO support, make it available as a secondary loader in both MaterialXView and TextureBaker.

* Update changelog for recent work

* Shader translation (#463)

- Added ShaderTranslator class
- Added python bindings for ShaderTranslator

Additional supporting changes:
- Moved TextureBaker::connectsToNormalMapNode() to MaterialXGenShader/Util.h

* Python image support

- Add Python bindings for loading, editing, and saving images.
- Simplify Python bindings for image-related classes.
- Simplify traversal of image loaders.

* Add support for MDL shader generation (#441)

MDL: 
- Add a MaterialXGenMdl project for MDL shader generation in MaterialX.
- Add support for OSL and MDL code generation in the MaterialX viewer.
- Related improvements to OSL and GLSL shader generation.
- MDL code generation unit testing (mdlc for compilation. df_cuda or dxr for command line rendering)

1.38:
- Swap atan2() arguments as was previously incorrect.
- Change rotate3d() "axis" from parameter to input.
- Tag standard surface with version (1.0.1)
- Update sheen and add thin-film support.
- 1.37 -> 1.38 upgrade tests

General:
- Additional material node support for traversal and shadergen.
- Uniform block support for GLSL generator.
- Add inlined implementation support.
- interfacename / node name clash upgrade handling.
- Nodedef publishing utilities

* Add TextureBaker controls for color space and constant optimization

- Add a TextureBaker control for the color space in which textures are encoded.
- Add a TextureBaker control for optimization of uniform textures as constant values.
- Extend Python bindings for TextureBaker methods.
- Add support for the g22_ap1 color space in code generation.

* Improve accuracy of g22_ap1 transforms

This changelist improves the accuracy of transforms from g22_ap1 to lin_rec709 in generated GLSL and OSL.

* Improve search path for baketextures script (#470)

* Improvements to library loading functions

- Clarify interfaces and fix Python bindings for loadLibrary and loadLibraries.
- Leverage library loading functions in genshader.py.

* Additional refinements to baketextures script

- Unify search paths for documents and images.
- Align naming conventions with other Python scripts.

* Python import improvements

- Import MaterialX libraries consistently across Python scripts.
- Remove unused imports from Python scripts.

* Improvements to diffuse BSDF tests

This changelist integrates improvements to the diffuse BSDF test materials from the 1.38 branch of MaterialX.

* Improve CMake backwards compatibility

This changelist updates the CMakeLists.txt file in MaterialXTest to use patterns supported by earlier versions of CMake in addition to the latest version.

* Extend wedge rendering to color properties

* Static analysis fixes

- Add missing quotation marks to string literal.
- Add missing null checks.
- Use emplace_back where simpler and more efficient than push_back.
- Const correctness fixes.

* Documentation updates

- Fix mismatching braces in Doxygen comments
- Update changelog for recent work.
- Update main page for recent presentations.

* Align variable names

- Align variable names between interface and implementation in loadLibraries.
- Use a single variable name convention in baketextures.py.
- Additional script cleanup in baketextures.py.

* Finalize changelog for v1.37.2

* Clarify the new interface for PortElement

* Add output connection methods to PortElement

* Update development build to 1.37.3

* Initial support for shared libraries

This changelist adds initial support for shared libraries on Linux and MacOS.

* Update pre-built binaries

This changelist updates the links for pre-built binaries, pointing them to the latest release rather than the latest commit.

* Wedge updates for v1.38. (#483)

- Expose general parameters in advanced.
- Expose choice of parameter to sample (supports int, float, vec2, vec3, color3, vec4, color4) now vs only float before.
- Support more than tga in file dialog.
- Add in additional command line arguments to avoid having to interactively perform this:
--cameraZoom : Amount of user zoom to apply 1.3 seems to get a close fit.
--envSampleCount : Default is 16 but 64 is a good fidelity number.

* Improvements to transparency rendering in viewer

- Add a Render Transparency option to the Advanced Settings panel.
- Allow transparent surfaces to be shadow receivers.

* Github actions support (#427)

Initial support for continuous integration support with Github Actions.

Has a builder for linux, macos, and windows with vs2017 and 2019.

* Extend GitHub Actions coverage

* Range loop analysis fixes

This changelist addresses range-loop analysis warnings reported by Clang 12.

* Refinements to GitHub CI

- Add Python 2.7 builds on Linux and MacOS.
- Remove unused Python path step.
- Clarify job names.

* Update project badges

- Remove Travis CI badge, as this functionality is now covered by GitHub CI.
- Add release version badge.

* Parameter to input 1.38 update Part 1. (#493)

- Convert Parameters to Inputs marked as "uniform".  Note that according to the spec all "filename" and "string" types are uniform. **All other inputs are marked with `uniform="false"`**. 
- Modify addInput() to make name, type required arguments and add in a `isUniform` argument (default=`false`) to allow a single method to create and set whether something is uniform. Note that according to the spec all `filename` and `string` types are uniform. 
- Add new `getIsUniform()` and `setIsUniform()` APIs.
- Replace all `get/set/isA<Parameter>()` calls with new API calls.
- Remove `getPrimaryShaderParameters()` API from Material Element.
- Update Core, ShaderGen + tests. RTS passes for GLSL, MDL, and Vanilla OSL.

**Note** : While 1.38 is WIP, we keep the version at 1.37 so that the upgrade will be appied.

* stdlib (defintion + node graph implementations) after upgrade. inputs with `uniform` attributes are converted `parameters`
[1_37_to_1_38_updated .mtlx.txt](https://github.com/materialx/MaterialX/files/5319974/1_37_to_1_38_updated.mtlx.txt)

* Merge branch 'master' into v1.38 (#495)

* Improvements to acquireImage

- Remove the 'message' return value from ImageHandler::acquireImage, allowing for more straightforward Python bindings.
- Generate mipmaps by default in ImageHandler::acquireImage.

* Refinements to shader translation

- Add handling for source materials without node graphs.
- Add handling for source materials with unsupported inputs.

* Remove unused variables

* Remove legacy Observer classes

This changelist removes the legacy Observer and ObservedDocument classes, which have been superseded by the MaterialXRuntime library for real-time graph editing.  Callback methods that were exclusively leveraged by Observer classes have been removed as well.

* Image I/O improvements

- Add exception handling to image I/O calls.
- Clarify documentation for the MATERIALX_OIIO_DIR option in CMake.

* Improvements to shader translation

- Make ShaderTranslator::translateAllShaders a non-static member function.
- Use exceptions rather than standard I/O to signal errors.
- Add error messages for common missing features in translation graphs.

* Robustness improvements for translation and baking

- Add handling for edge cases in shader translation (e.g. missing normal maps).
- Add handling for edge cases in texture baking (e.g. missing node inputs).
- Improved handling of upgrades for legacy documents.

* Improvements to texture baking

- Omit default-valued constants in texture baking.
- Bake TIFF/EXR files when OpenImageIO is available.

* Viewer improvements

- Add render support for partially-transparent meshes.
- Automatically split meshes by UDIMs as required.
- Additional refinements to texture baking.

* Improvements to OpenGL texture handling

- Fix an edge case in image resource construction.
- Emit warnings when errors are encountered in image binding.

* Add support for image averaging in baking

* Additional viewer options

- Add a double-sided rendering option to the Advanced Settings panel.
- Add hotkeys for cycling through selected geometries (up/down arrows).

* Add GLSL subsurface scattering approximation

This changelist adds a simple subsurface scattering approximation to MaterialX GLSL.  The high-level approach is to integrate Burley's diffusion profile over the sphere using Eric Penner's curvature-based approximation.  While this ignores the thickness of the scattering volume, it keeps the implementation within a single shading pass and provides a meaningful visual interpretation of the subsurface scattering inputs.

* GLSL shading improvements

- Render back faces with forward-facing normals.
- Fix artifacts with low roughness values in sheen rendering.

* Fix for single-channel textures in MaterialXRenderGlsl

This changelist fixes the rendering of single-channel textures in MaterialXRenderGlsl, setting the required state that replicates the red channel to RGB.

* Handle empty environments in computeDominantLight

* Viewer improvements

- Handle UDIMs when merging multiple materials.
- Invalidate shadow maps when a new material is loaded.
- Check for zero intensities in splitDirectLight.
- Consider "existence" bindings when computing transparency.

* Remove legacy CI configurations

This changelist removes legacy CI configurations for Travis and Appveyor, and updates the changelog for recent work.

* Update env commands in GitHub Actions

* Image handling improvements (#520)

- Unify the handling of missing images in generated GLSL, binding a 1x1 sentinel image when the declared default value should be rendered.
- Remove legacy handling for fallback colors in image loading.
- Add a missing image example to the test suite.

* Remove MATERIALX_DEBUG_POSTFIX in favor of CMAKE_DEBUG_POSTFIX (#509)

* Additional workflow fixes

- Add a missing variable initialization in TextureBaker.
- Restrict UDIM assignments to materials in the viewer.

* Fix bug with codegen of custom BSDF/EDF graphs.

* Use newer OpenImageIO interface.

* Allow building against an external NanoGUI installation (#525)

* Merge from ADSK to LucasFilm 1.38 (#522)

* Update changelog for recent work

* Add changelog and readme to install

This changelist adds two root-level documents, CHANGELOG.md and README.md, to installations of MaterialX.

* Finalize changelog for v1.37.3

* Update links in README

* ADSK Update to ILM v1.38. (#529)

- Further updates / fixes for **TextureBaker**:
  - Fixes for per shader iteration, making it less state dependent
    - Perform proper state cleanup to avoid corruption between bakes.
  - Options for graph, and geominfo nodes created
  - Return list of documents to allow external file I/O flexibility.
- Port of **ShaderTranslator** to use Material nodes:
  - Add colorspace + units support
  - Add in missing traversal utility to upstream inputs.
  -  Fix state cleanup per shader translation to avoid corruption between translations.
- Fixes for **USD Preview surface**
  - Update "reflectivity" computation to match version 2.3 revision logic. (was modulating by diffuse twice).
  - Add version tag to definition

Additional GLSL changes:
- Update to handle uniform resources blocks for GLSL.
- Expose number of environment samples as settable option.

* Simplify image codec test

* Additional parameter updates for 1.38

- Remove remaining ParameterPtr references in Document::upgradeVersion.
- Add a fast path for non-existent attributes in Element::getTypedAttribute.

* Remove Parameter class

This changelist removes the legacy Parameter class from the v1.38 branch of MaterialX.

* Remove ShaderRef classes

This changelist removes the legacy ShaderRef, BindInput, BindParameter, and BindToken classes from the v1.38 branch of MaterialX.

* Remove Material element class

This changelist removes the legacy Material element class, and merges MaterialNode.cpp/h into Material.cpp/h and Look.cpp/h.

* Initial material unit tests

- Add initial C++ unit tests for the v1.38 material interface.
- Add helper methods Node::setConnectedOutput, Node::getConnectedOutput, and GraphElement::addMaterialNode.

* Additional material unit tests

- Additional C++ unit tests for the v1.38 material interface.
- Generalize the setConnectedOutput and getConnectedOutput methods.
- Merge unit tests from FormatUtil.tpp into File.cpp.

* Initial look unit tests

- Add initial C++ unit tests for looks and material assignments.
- Extend material and look unit tests to Python.
- Rename Look::getReferencedMaterialNode to Look::getReferencedMaterial for simplicity.

* Add shared library build

This changelist adds a Linux shared-library build to GitHub Actions CI.

* Update development build to 1.37.4

* OpenGL improvements for software rendering

- Add missing VAO binding to GlslRenderer::drawScreenSpaceQuad.
- Use warnings rather than exceptions to report OpenGL errors.
- Update CMake settings in MaterialXRenderGlsl to prefer GLVND libraries.
- Reorganize GLUtilityContext into GLUtil and GLContext for clarity.

* Add material baking to GitHub Actions CI

This changelist adds an initial material baking example to our GitHub Actions CI, leveraging xvfb for software OpenGL rendering on Linux.

* Improved robustness in MaterialXRenderGlsl

- Clarify the lifetime and ownership of WindowWrapper objects using shared pointers.
- Improve alignment of OpenGL context management between platforms.
- Minor formatting and comment updates for consistency and clarity.

* Make strings local to module

This changelist makes two strings local to the ConvolutionNode module, in order to work around a compiler issue on Linux.

* Additional improvements to MaterialXRenderGlsl

- Simplify platform-specific logic in GLContext.
- Add a null check to the Linux SimpleWindow destructor.
- Remove a context-changing call from the GlslRenderer destructor.
- Remove an unused header from the glew library.
- Clarify an initializer in the GlslProgram constructor.

* Update version badge link

* Improved color space handling in MaterialXRenderGlsl

- Correctly transfer color spaces of uniform values in TextureBaker.
- Add a warning for unsupported color space transforms in ShaderGraph.
- Add a second material baking test to GitHub Actions.
- Minor clarifications to example materials.

* Update changelog for recent work

* Disable software render tests in v1.38

* Add upgrade path for color2 type

This changelist adds an upgrade path for the legacy color2 type, and removes all references to color2 in the standard libraries.

Additional improvements:

- Integrate a fix to non-material rendering in the viewer (thanks to Bernard at Autodesk).
- Clarify a few warnings in shader generation.

* Remove color2 classes

* Refinements to GitHub Actions CI

- Initialize the virtual framebuffer before running unit tests, opening the door to more advanced render testing in the future.
- Remove unused libraries in MacOS builds.

* Finalize changelog for v1.37.4

* Texture baking improvements

- Align texture baking logic between render tests and the MaterialX viewer.
- Align TextureBaker function signatures with their v1.37 equivalents for consistency.
- Remove references to the standard regex library, which is not consistently supported in GCC 4.8.
- Restore cloud-based tests for material baking.

* Minor refinements to v1.38

- Align the signature of InterfaceElement::addInput with v1.37.
- Rename resolveFileNames to flattenFilenames for clarity.
- Extend the image search path in viewer texture baking.

* Remove legacy applyFutureUpdates flag

This changelist removes the legacy applyFutureUpdates flag, which no longer has any effect on document loading.

* Additional cleanup for v1.38

- Remove references to parameter elements in documentation.
- Restore default name argument to InterfaceElement::addInput.
- Align conventions for MDL generation code.

* Viewer and texture baking improvements

- Simplify texture baking in the viewer, assigning it a unique 'B' hotkey rather than overloading the Save Material button.
- Simplify the property name option for wedge rendering, making it an editable string grouped with other wedge options.
- Various improvements and fixes for texture baking.
- Update viewer documentation for new features.

* Additional baking fixes for v1.38

- Fix order of operations for processing uniform outputs.
- Remove document-modifying calls from texture baking.
- Remove an incorrect early exit in texture baking.
- Fix version strings for partial document upgrades.

* Add image averaging test to CI

* Add MDL support for g22_ap1

This changelist adds support for the g22_ap1 color space in MDL code generation.

* Fix bug in PNG file writing

* Fix OpenGL error in frame capture

* Improvements to GitHub CI

- Add support for parallel builds.
- Simplify Linux dependencies.
- Simplify render tests.

* Add viewer rendering to GitHub CI

- Add a viewer rendering test to GitHub Actions CI, rendering a uniform material and saving the image to disk.
- Add a captureFilename command line option to the viewer.
- Add a Viewer::initialize method, allowing settings to be modified between class construction and resource loading.

* Merge from ADSK fork to v1.38 LucasFilm (Jan 6, 2020) (#561)

* Refactor interface name methods

- Refactor the new interface name methods for clarity, renaming them to NodeGraph::addInterfaceName, NodeGraph::removeInterfaceName, and NodeGraph::modifyInterfaceName.
- Add missing initializers to the Viewer constructor.
- Additional fixes for static analysis warnings.

* MacOS build improvements

- Add support for shared library builds on MacOS (thanks to Karen Lucknavalai at Pixar for the catch!)
- Add support for Xcode 12 builds on MacOS.
- Add a missing dependency between MaterialXRenderGlsl and MaterialXGenGlsl.

* Make v1.38 upgrade path only mark filename and string parameters as uniforms. (#1077) (#564)

* Remove viewer dependency on NanoGUI::GLShader

This changelist removes the dependency of the MaterialX viewer on NanoGUI::GLShader, allowing future iterations of the viewer to take advantage of other rendering frameworks (including ImGui and the modernized NanoGUI used in Mitsuba 2).

In place of NanoGUI::GLShader, shader compilation, introspection, and binding is now entirely handled by MaterialX::GlslProgram, unifying the approach to GLSL shading across the viewer, texture baker, and render test framework.

* Improvements to relative image paths

- Fix an edge case for relative image paths with the "--material" option in the viewer.
- Update material examples to use relative image paths, making the resources folder relocatable.

* Improvements to prefiltered environments

- Add a viewer option for switching between filtered importance sampling and prefiltered environments for specular lighting.
- Align the prefiltered environment path with Niklas's latest work on Fresnel model selection.

* Refactor viewer camera using MaterialX types (#569)

This commit reimplements the NanoGui camera controls into the MaterialX Viewer using native MaterialX types.

The removes the dependency on Eigen, and opens the door to more sophisticated camera behaviors, and also enables migrating to the most up to date version of NanoGui, which no longer has large external dependencies such as Eigen.

A minimal Quaternion class is introduced to MaterialX types, and the few necessary operations necessary for the implementation of arcball type control for cameras.

* PBS library updates for MaterialX v1.38 (#571)

This change list contains the following changes to _pbrlib_, from our list of agreed changes for v1.38.

- Our dielectric BSDF nodes which previously was split into separate BRDF and BTDF nodes are now unified into a single spherical BSDF distribution, same as MDL, with a scatter_mode parameter to control the two hemispheres.

- The conductor_bsdf has been changed from an artistic parameterization (Gulbrandsen) into the physical / complex IOR parameterization. Instead, the node artistic_ior can be used to convert from artistic to physical parameters when needed. This makes it more aligned with MDL and avoids forcing the user into using Gulbrandsen's parameterization. The node complex_ior is thus no longer needed and has been removed.

- Removing the base input on the vertically layerable nodes, that connected a BSDF for the layer below. In favor of always using the layer operator to connect nodes into layer stacks, for consistency. 

- Removing the interior input on the dielectric transmission node, that connected a VDF for specifying volumetric properties of the medium. In favor of always using the layer operator to connect nodes into layer stacks, for consistency.

- A general naming convention change for BSDF nodes to use "_bsdf" as suffix for all nodes, where we previously used "_brdf" or "_btdf" depending on which hemisphere it represented.

- diffuse_brdf has been renamed oren_nayar_diffuse_bsdf

- diffuse_btdf has been renamed translucent_bsdf

- Document upgrade logic has been added to upgrade old documents according to above changes

* Update Python scripts for v1.38

- Add mxdoc.py and mxvalidate.py to cloud-based tests.
- Add deprecation warnings for v1.37 Python methods in v1.38, using the original versions of mxdoc.py and mxvalidate.py for testing.
- Update mxdoc.py and mxvalidate.py for v1.38, simplifying and aligning the Python code with more recent MaterialX scripts.

* Adsk contrib/adsk lucasfilm v1.38 sync (#1099)

* Restore code for shader fallback drawing.

* IBL update (#1083)

* IBL update.

* Review fix.

* Patch 9e0afcbbd8e46b21f764f755d51674d385d7bc95

* Restore changeChildCategory() accidently removed. (#1086)

* Version logic fixes and std surface default value version update

* Remove keeping the version at 1.37 when an upgrade occurs for consistency. (#1090)

* Use new traversal code for nodegraph interfaces for shader search utility. (#1092)

Add in test.

* Fix issue with CM and target inheritance. (#1093)

* Fix issue with CM and target inheritance.

* Fix python bindings

* Fix issue with variable name not being unique. (#1094)

* Fix issue with variable name not being unique.

* Spelling error

* Get MDL compile tests working again. Parameter-to-Input and PBR upgrade fixes.

* - Usd patch
- Texture backer constant patch
- Viewer local build install patch

* Improvements to specular environment rendering

- Add a missing geometric term to the prefiltered environment path.
- Improve sharing and alignment between environment rendering paths.
- Display shader generation errors in the console when compiling viewer materials.

* Merge updateChildSubclass with changeChildCategory

* Remove early exit for now (further discussion needed)

* Clarify a comment

* Remove unneeded null check

* Use default constructor for shared pointer

Co-authored-by: Niklas Harrysson <niklas.harrysson@gmail.com>
Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>

* Merge updateChildSubclass with changeChildCategory

* Remove early exit for now (further discussion needed)

* Clarify a comment

* Remove unneeded null check

* Use default constructor for shared pointer

* Improvements to specular environment rendering

- Add a missing geometric term to the prefiltered environment path.
- Improve sharing and alignment between environment rendering paths.
- Display shader generation errors in the console when compiling viewer materials.

* Update Python scripts for v1.38

- Add mxdoc.py and mxvalidate.py to cloud-based tests.
- Add deprecation warnings for v1.37 Python methods in v1.38, using the original versions of mxdoc.py and mxvalidate.py for testing.
- Update mxdoc.py and mxvalidate.py for v1.38, simplifying and aligning the Python code with more recent MaterialX scripts.

* Change log update.

Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>
Co-authored-by: Doug Smythe <dbsmythe@gmail.com>
Co-authored-by: Ashwin Bhat <1727158+ashwinbhat@users.noreply.github.com>
Co-authored-by: alister-chowdhury <30833607+alister-chowdhury@users.noreply.github.com>
Co-authored-by: Niklas Harrysson <niklas.harrysson@gmail.com>
Co-authored-by: Indy Ray <iray@telltale.com>
Co-authored-by: Madeleine Yip <52723401+mjyip-lucasfilm@users.noreply.github.com>
Co-authored-by: bsavery <brian.savery@gmail.com>
Co-authored-by: debaetsd <debaetsd@gmail.com>
Co-authored-by: rzulak <rzulak@imageworks.com>
Co-authored-by: marsupial <marsupial@users.noreply.github.com>
Co-authored-by: Nick Porcino <meshula@hotmail.com>
bernardkwok added a commit to kwokcb/MaterialX that referenced this pull request Oct 5, 2021
* Adding sample python code scripts (#265)

* Python Code Examples

Adding mxvalidate.py, writelooks.py, writenodegraphs.py and a README.md describing them to a new Scripts folder under "python".

* Update mxvalidate.py

Make all function names camelCase.

* Addressing PR notes

* Add vector types for trig, log, pow, and sqrt (#267)

* Add MaterialX v1.37 specifications

* Added type attributes to geompropdefs (#269)

Adds in the missing type attributes on geompropdefs

* Merges from dev to ILM master (#270)

General:
- Fixes for auto non-const usage in iterators

ShaderGen:
- Sanitize all generated identifiers during code generation. 
- UDIM transform support (for tiled atlases) + UDIM computation utilities
- Fix utility for transparency detection to test for bindinputs which set for nodedef inputs which are marked as interfaces (vs assuming any interface is transparent).

File Management:
- Library path read / include cleanup.
- Add additional skips for read/import since read can have includes, and includes can still conflict.

Test:
- Add external library path and test root options to unit test framework (_options.mtlx)

UI:
- Add in `uiadvanced` option support for Property Editor in viewer.

* Viewer fixes merge to master (#271)

- Fix so that node implementation cache is cleared before each shader generate to avoid accidental reuse. This fixes the ability to generate proper code for shader graphs that use UDIMs defined in images nodes which are part of a nodedef.
- Allow for a shared shader to be used for all UDIMs so that when editing in the Property Editor editing one viewer Material ends up editing the display for all geometry using the shared Shader (though different Materials are assigned as UDIM association is at the Material level)
- Fix regression in editing inputs which affected uniforms which have generated variable names different than the ShaderPort name. When generation was added, the editor code was not updated to use the variable getter interface but was instead using the existing name getter interface. This resulted in the shader uniform not being found and no updates occurring. 
Note: Any inputs without generated names would still work before this fix.

* Restore isotropic fallback for roughness_dual

* Finalize changelog for v1.36.3

* Updates to CI builds

- Add Travis builds for Clang 8 and GCC 8 with LTO.
- Refactor Appveyor setup for clarity.
- Fix static analysis warnings.
- Update development build to 1.36.4.

* Fix for OSL implementation of mx_roughness_dual. (#274)

* Fix for OSL implementation of mx_roughness_dual(().

* Fix bad merge.

* Reload standard libraries (#276)

Added hotkey to reload standard libraries. Also added a label that displays the current shading model (if it exists).

* Add "Save" option to Viewer (#277)

- Explicitly library load will keep track of the list of libraries loaded.
- Property editor now updates both the shader uniform (for immediate shader feedback without recompiling) as well as the associated document element.
- New "Save" UI menu item. 
- Save uses an element predicate to prune out any elements which belong to libraries which are explicitly loaded.
- Add unit test for sourceUri and hence xinclude pruning (as if all elements of a given include are pruned out then no xinclude will be written into the document).

* Value construction from C-style strings

This changelist adds support for value construction from C-style strings and string literals.  Previously, it was only possible to construct a value of string type from a standard string.

* Move shading model to property editor

Move the new shading model display from the main viewer to the property editor, and refactor a few smaller details within the editor source file.

* Fixes for static analysis warnings

* Improvements to FilePath and FileSearchPath

- Make FilePath construction independent of the current platform, allowing FilePath to be used with stored strings.
- Add support for iteration over FileSearchPath objects.
- Update the interface of readFromXmlFile and writeToXmlFile to leverage FilePath and FileSearchPath.
- Extend Python bindings for FilePath and FileSearchPath.

* Added python bindings for TypeDesc (#284)

Fixed missing base class for DefaultColorManagement python binding

* Align includes and formatting in MaterialXRender

This changelist adjusts the includes and formatting in MaterialXRender for consistency with other MaterialX modules.

Specific changes include:

- Merged the ExceptionShaderValidationError class into the ShaderValidator source files.
- Adjusted header includes for consistency.
- Adjusted comments and whitespace for consistency.
- Minor const correctness fixes.

* Add support for GCC 9

- Add Travis build and adjust compiler flags for GCC 9.
- Refactor compiler flags to better localize warning suppression.
- Update changelog for recent work.

* CMake file improvements

- Share a single copy of the assign_source_group function.
- Adjust platform checks for consistency.
- Adjust formatting for consistency.

* Extended interface of PropertyAssign and PropertySetAssign

- Add PropertyAssign methods setProperty, hasProperty, and getProperty.
- Add PropertySetAssign methods setPropertySetString, hasPropertySetString, getPropertySetString, setPropertySet, and getPropertySet.

* Improvements to FilePath

- Handle null inputs in FilePath construction from a C-style string.
- Return a const string reference in FilePath::getBaseName for efficiency.
- Use std::array in FilePath::getCurrentPath for consistency.
- Use FilePath::getExtension in MaterialXRender for consistency.

* Add Python bindings for array types

- Add Python bindings for array types in value accessors.
- Add Python functions getTypeString, getValueString, and createValueFromStrings.
- Deprecate Python functions typeToName, valueToString, and stringToValue.
- Remove deprecated Python functions objectToString and stringToObject.

* Write relative XInclude paths as Posix (#290)

* Documentation improvements

- Update changelog for recent work.
- Update Viewer documentation for latest feature set.
- Fix class hyperlinks in Doxygen comments.

* Harmonize usage of registerSourceCodeSearchPath

Use the FilePath and FileSearchPath variants of registerSourceCodeSearchPath consistently across the library, allowing string arguments to automatically convert to a FilePath where needed.

* Fixes for static analysis warnings

- Fix null test in BlurNode::emitFunctionCall.
- Fix format specifier in SimpleWindow constructor.
- Mark ImageHandler::clearImageCache as non-virtual.
- Add const modifiers as needed.

* Finalize changelog for v1.36.4

* Update development build to 1.36.5

* Initial implementation of texture baking (#293)

- Add an initial TextureBaker class that leverages the GlslValidator to bake graph outputs and shader inputs to textures.
- Add a "Bake Textures" option to MaterialXView.  When this option is enabled, the Save Material command will bake textures for graph-connected shader inputs before writing the new MaterialX file.

* Generalize shader validator classes

- Rename the ShaderValidator, GlslValidator, and OslValidator classes to ShaderRenderer, GlslRenderer, and OslRenderer, generalizing their role to rendering as well as validation.
- Rename class methods for consistency with both rendering and validation use cases.
- Update Python bindings and documentation.

* Additional improvements to texture baking

- Add support for UDIM-based materials.
- Subclass TextureBaker from GlslRenderer for simplicity.
- Move baked filename logic into TextureBaker::generateTextureFilename.
- Clarify related interfaces and documentation in MaterialXRender and MaterialXRenderGlsl.

* Improvements to image handling (#303)

- Move responsibility for image path resolution from client code to GLTextureHandler::acquireImage.
- Remove duplicate cache lookups in GLTextureHandler::bindImage and GLTextureHandler::unbindImage.
- Add a static create method for StringResolver.

* Initial support for units (#300)

**Added**
- Initial support for units, including the Unit, UnitDef, and UnitTypeDef classes.
- Support for unit conversion in shader code generation.
- Utility to generate Markdown from `nodedef` definition.

**Changed**
- Standard surface `subsurface_color` changed type to color3 from vector3. `subsurface_scale` supported in code generation
- Search path argument for MaterialXView adds search paths versus replacing.

* Add support for Visual Studio 2019

- Update Appveyor for Visual Studio 2019.
- Reduce the number of Appveyor configurations for faster turnaround.

* Documentation improvements

- Update descriptions in Doxygen comments.
- Fix mismatched groups in Doxygen comments.
- Use nullptr as the default value for ImageDesc::resourceBufferDeallocator, since this has the same behavior as an explicit call to free().

* Update Travis links

Update migrated Travis links from travis-ci.org to travis-ci.com.

* Remove "default" unit from <unittypedef> (#308)

Remove "default" from \<unittypedef> as there is no need for a default.
It is assumed that all units of interest to convert to are added as \<unitdefs>. Thus "meter" for distance and "degrees" for angle.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS, including the following:

- Fix references to undefined variables in constructors.
- Fix inconsistent null checks.
- Fix exception instantiations without calls to throw.
- Remove conditional expressions that always evaluate to true.
- Move common constants to shared locations.
- Const-correctness and type-matching fixes.

* Improvements to CI builds

- Distribute Appveyor builds across Visual Studio 2015, 2017, and 2019.
- Distribute Travis builds across Python 2.7 and 3.x.

* Additional Travis improvements

- Select Linux and OSX images explicitly.
- Simplify logic for Python version selection.
- Reduce parallel jobs for performance.

* Improvements to image functionality

- Rename the ImageDesc class to Image, and create a clearer separation between its interface and data.
- Move image creation logic to the Image class.
- Move image caching and fallback behavior to the base ImageHandler class.
- Add an initial Image::getTexelColor method, opening the door to future image processing and analysis functionality.

* Update example materials

- Update standard_surface_default bindings to match the current definition of the shader.
- Remove standard_surface_velvet bindings that have no visible effect (clearcoat properties that are set without a clearcoat weight).

* Update to OpenImageIO 2

- Update the OiioImageLoader class to the OpenImageIO 2 API.  For simplicity, this changelist removes support for OpenImageIO 1.x, but supporting both API versions is an option for the future.
- Additional updates and cleanup for OiioImageLoader.

* Move Image class to its own source and header files

- Move the Image class to its own source and header files (Image.cpp and Image.h), allowing image processors to depend on Image without depending on ImageHandler and ImageLoader.
- Add a ConstImagePtr alias to clarify the behavior of image processing interfaces.
- Minor whitespace fixes in Util.h.

* Vector class improvements

- Consistently return the VectorN type from operators that return vector references.
- Minor formatting fixes.

* Move Travis image declarations to the build matrix

This provides clearer feedback during Travis builds and allows for greater flexibility in the future.

* Initial setTexelColor method

Add an initial setTexelColor method to the Image class

* Initial support for spherical harmonic irradiance (#322)

- Add the ShCoeffs class template, representing a set of spherical harmonic coefficients for a particular data type and number of bands.
- Add the projectEnvironment function, allowing a lat-long environment to be projected to third-order spherical harmonics (with or without an irradiance convolution).
- Add the renderEnvironment function, allowing a third-order spherical harmonic signal to be rendered to a lat-long environment map.

* Add a Load Environment option to the viewer

This changelist adds a Load Environment option to the viewer, allowing arbitrary lat-long environment lights to be loaded at run-time.  If a pre-generated diffuse convolution is not found on the file system, then one will be generated at load-time via spherical harmonics.

Additional changes:

- Add a resources/Images/Environments folder, containing two environment light options (san_giuseppe_bridge and piazza_bologni).
- Create rendering resources for images on demand, rather than at construction time.
- Add a lightweight half-precision float class to MaterialXRender, allowing spherical harmonics to be generated from half-precision environment lights.
- Add handling to the render test suite for missing OSL executable locations.
- Move the Save Material option to the Property Editor.

* Update documentation for recent work (#325)

- Add documentation for the Load Environment option.
- Add documentation for OpenImageIO support.
- Update images for textured materials in the viewer.
- Additional improvements for clarity and consistency.

* Add ambient occlusion support to HwShaderGenerator

This changelist adds support for ambient occlusion images to HwShaderGenerator, replacing the custom multi-pass solution previously used in MaterialXView.

The new implementation is available to any application leveraging GLSL shader generation, and should be extensible to other shadowing and visibility solutions in the future.

* Vector class improvements

- Generalize getMagnitude to handle all subclasses of VectorN
- Specialize Color classes directly from VectorN for consistent handling of operators.
- Move <cmath> library include to Types.h.
- Add missing Python tests for Vector operators.

* MacOS build improvements

- Integrate Ashwin's MacOS fix from the Autodesk fork (https://github.com/autodesk-forks/MaterialX/pull/647)
- Silence OpenGL deprecation warnings in MacOS builds.
- Increment the osx_image setting to xcode11, so that we're testing against a more recent MacOS image.
- Minor fixes to CMake formatting and whitespace.

* CMake build simplifications

- Unify target link lists across platforms.
- Remove duplicate requirements tests.
- Minor improvements to formatting.

* Improvements to light and image handling

- Unify direct light management between the viewer and light handler.
- Add functions Image::splitByLuminance and computeDominantLight for upcoming rendering work.
- Fix an edge case in AO image loading.
- Fix an edge case in property editor display.

* Update PyBind11 to version 2.4.3

* Documentation updates

- Update to the latest revision of the 1.37 specification.
- Add hyperlinks to the contributor page.
- Minor revisions to Doxygen comments.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS, including the following:

- Remove a signed bitshift operation with undefined C++ behavior, replacing it with the intended constant result.
- Restrict the capture scope of two lambdas, removing access to temporary variables.

Also:

- Add initial unit tests for the Half class, providing validation for future work.

* Finalize changelog for v1.36.5

* Updates for MaterialX v1.37 (#338)

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

### Added
- Added support for LookGroup elements.
- Added support for the 'uisoftmin', 'uisoftmax', and 'uistep' attributes, updating Autodesk Standard Surface to leverage these features.

### Changed
- Updated the set of standard nodes to match the v1.37 specification.
- Unified the rules for NodeDef outputs, with all NodeDefs defining their output set through Output child elements rather than 'type' attributes.
- Replaced backdrop nodes with Backdrop elements.
- Improved the robustness of GLSL and OSL code generation.

* Update document version strings

- Update document version strings to 1.37.
- Remove legacy attributes from root elements.

* Extend build tests to Python 3.8

Extend Appveyor build tests to include Python 3.8, which is supported by the latest version of PyBind11.

* Extend build tests to Clang 9

Extend Travis build tests to Clang 9, and fix a related warning in MaterialXRenderGlsl.

* Add a Split Environment option to the viewer (#349)

This changelist adds a Split Environment option to the advanced tab of the MaterialX viewer, allowing an HDR environment light to be split into its indirect and direct (i.e. dominant directional light) components at load-time.

This work is intended as a precursor to future shadowing improvements in GLSL shader generation and MaterialXView.

For organizational clarity, user-facing light resources have been moved into a resources/Lights folder, and test suite lights have been moved into resources/Materials/TestSuite/lights.

* Update CMake policy for broader compatibility

This changelist updates the CMake policy for OpenGL library preferences, requesting that older libraries be used when both new and old are present in the same environment.  This addresses an issue brought up by Frankie Liu at Nvidia on the MaterialX discussion forum.

* View handler improvements

- Add method ViewHandler::createOrthographicMatrix.
- Provide direct access to ViewHandler data.
- Harmonize matrix computations across the MaterialX viewer.

* Viewer rendering fixes

This changelist fixes two rendering issues in the MaterialX viewer:

- Fix wireframe rendering with the Outline Selected Geometry option.
- Fix rendering of mixed opaque/transparent looks.

For simplicity, the UV wireframe hotkey has been removed, as it required some duplication of rendering logic, and we can integrate this functionality into the main render pathway if needed in the future.

* Update stb_image to version 2.23

* Initial support for variance shadow maps

This changelist adds support for variance shadow maps to the MaterialXGenGlsl code generator, allowing applications based on this generator to easily include the rendering technique.

The MaterialX viewer now includes a "Shadow Map" option on its Advanced Settings page, and its default lighting environment now has separate direct and indirect components, allowing different shadowing approaches to be used for each.

* Shadow rendering improvements

- Add helper function GLTextureHandler::mapTextureFormatToGL for consistency.
- Defer shadow map allocations until requested by the user.
- To view a scene with variance shadow maps, click Load Environment and select Resources/Lights/san_giuseppe_bridge_split.hdr, then enable Shadow Maps in the Advanced Settings page.

* Light environment improvements

- Move irradiance maps to a subfolder for clarity.
- Rebuild the san_giuseppe_split environment with a higher split luminance.
- Extend createRenderResources and getTexelColor to additional texture formats.
- Add reference CPU functions for image convolution.

* Texture-space rendering improvements

- Modularize functionality for future reuse, adding methods GLFrameBuffer::setEncodeSrgb, GLFrameBuffer::getEncodeSrgb, and GlslRenderer::drawScreenSpaceQuad.
- Remove duplicate OpenGL calls.

* Document upgrade fixes

This changelist fixes two edge cases when upgrading documents to v1.37 at import time:

- Return a default value rather than throwing an exception in getType, as this method can be called during the upgrade process itself.
- Upgrade nested nodes as well as those at root scope.

* Image convolution improvements

- Align Gaussian kernel weights between CPU and GPU implementations.
- Add createBlurShader helper function to MaterialXRender.
- Replace non-standard shader usage in mx_shadow.glsl.

* Shadow quality improvements

- Add a Gaussian blur step to shadow map generation.
- Clear the shadow framebuffer to one before rendering.
- Enable anisotropic filtering in the texture handler.
- Enable shadow maps by default.

* Harmonize vector conventions for matrix methods

This changelist aligns all matrix methods in MaterialX with the row-vector convention, in which matrix-vector multiplication is computed as v' = vM.

Previously, there was disagreement between the createTranslation methods (which followed row vector) and the createRotation/multiply methods (which followed column vector), requiring unnecessary calls to getTranspose in rendering code.

Documentation of the library vector convention has been added to Types.h, and related matrix code has been refactored for clarity.

* Update from GeomAttr to GeomProp for 1.37

This changelist implements the update from GeomAttr to GeomProp elements described in the v1.37 specification, along with the corresponding change from <geomattrvalue> to <geompropvalue> nodes.  Legacy documents from v1.36 and earlier are automatically upgraded at load-time.

See http://www.materialx.org/assets/MaterialX.v1.37REV2.Changelist.pdf for a complete list of changes in v1.37.

* Patch osl implementations for geompropvalue (#368)

* Static analysis fixes (#369)

- Fixes for static analysis warnings reported by PVS
- Documentation and formatting updates

* Generalize colorspace usage for filename (#370)

Update to shader generation support for `colorspace` to be consistent with `unit` support.
* This change makes it so that the `colorspace` attribute can now be recognized at the same scope / location as for `units`. This includes handling `filename` inputs which have been exposed
via a `nodegraph` definition interface (`interfacename`).
* Previously, `colorspace` would only be recognized on `filename` inputs which reside on an `image` node directly (not exposed via a interface)
* Additional configurations added to unit tests

* Light environment improvements

- Improve the accuracy of computing the dominant directional light from an environment map.
- Add support for environment map normalization.
- Rebuild the san_giuseppe environment.
- Add the venetian_crossroads and spruit_sunrise environments, including both combined and split variants.

* Increase environment split radiance

This changelist increases the split radiance for environment maps from 2 to 16, providing a better balance between direct and indirect lighting terms.

* Update documentation for recent work

* Syntax Example Updates (#375)

Updates to Syntax example files to better conform to 1.37 syntax and conventions

* Code and documentation cleanup

- Clarify implementations of matrix transforms and environment normalization.
- Simplify viewer constructor and filename generation.
- Update documentation for MATERIALX_PYTHON_PYBIND11_DIR.

* Harmonization on singular unit names. (#378)

Using https://physics.nist.gov/cuu/Units/units.html as a reference to use singular naming convention.
e.g. angle is 30 degree instead of degrees

* Update light paths in test suite

This changelist updates two light paths in the render test suite, matching the new location of environment irradiance maps.

* Python Script Examples Updates (#380)

writelooks.py: added output of lookgroup
mxvalidate.py: added support for geomprops, backdrops and lookgroups, preliminary support for units; changed output format for very-verbose nodegraphs to better indicate connections vs values

* Unit tests options file fix (#381)

Need to tranpose the uv transform used for GLSL unit tests to match current convention.

* Enable render tests by default

- Enable render tests by default in MaterialXTest, and disable this feature explicitly for CI builds.
- Require that environment lights are successfully found in render tests.

* Update tiled wood example

This changelist updates the tiled wood example material, replacing its tiled textures and assigning specular anisotropy and clearcoat properties.

* Static analysis fixes

Fixes for static analysis warnings reported by PVS:

- Add self-assignment check to WindowWrapper assignment operator.
- Remove extra null check in Viewer::loadEnvironmentLight.
- Replace push_back with emplace_back for simplicity.

* Finalize changelog for v1.37.0

* Additional fixes for v1.37.0

- Update the v1.26 upgrade path for the v1.37 API.
- Fix edge cases for lighting search paths in the viewer.

* Initial support for Appveyor build artifacts

* Add documentation for Windows binaries

* Light environment improvements

- Add the Goegap and Table Mountain lighting environments, providing higher-dynamic-range options than San Giuseppe Bridge.
- Update documentation with Lucasfilm examples and new environments.

* Restore viewer dimensions

* Update development build to 1.37.1

* Add backwards compatibility for OIIO 1.x

This changelist adds backwards compatibility for OpenImageIO 1.x, using the pattern described in the OpenImageIO 2 porting guide.

Also, remove a documentation line describing the MATERIALX_TEST_RENDER flag, which is now enabled by default in builds.

* Standard library path improvements

- Make unit conversion robust to missing standard data libraries.
- Add a viewer warning for missing standard data libraries.
- Add helper method FilePath::getModulePath, which returns the directory containing the executable module.
- Update the viewer to leverage FilePath::getModulePath.
- Improve documentation for the --path and --library flags in the viewer.

* Use Python 3 by default in Travis builds

* Refactor two MaterialXGenShader methods for VS2019

This changelist refactors the MaterialX::readFile and SourceCodeNode::initialize methods for better compatibility with Visual Studio 2019

* GLSL shading improvements

- Remove duplicate library and resource folders that were generated during the MaterialXView build process.  This makes shader development more straightforward, where a developer can edit library source files directly and hit 'R' to reload shaders in the viewer.
- Use texture address modes rather than shader logic to keep latitude-longitude texture coordinates within bounds.  This addresses lighting artifacts along longitude seams in filtered importance sampling.
- Move spherical Fibonacci methods from mx_math.glsl to mx_environment_fis.glsl, removing them from generated shaders where they're not needed.

* Use height-correlated Smith masking-shadowing

This changelist updates the GLSL implementation of Smith masking-shadowing from uncorrelated to height-correlated forms, as described in http://jcgt.org/published/0003/02/03/paper.pdf.  As a future improvement, we should also update from isotropic to anisotropic forms, as described in the same paper.

* Update Travis build settings

This changelist updates Travis settings to accommodate recent changes to their build environments.

* Backdrop element improvements

- Add utility methods Backdrop::setContainsElements and Backdrop::getContainsElements.
- Rename Backdrop::setContains/Backdrop::getContains to Backdrop::setContainsString/Backdrop::getContainsString for consistency.
- Remove unneeded element names in unit tests.
- Remove an outdated warning in PortElement::validate.

* Energy conservation improvements for generated GLSL

- Add mx_microfacet_ggx_directional_albedo for computing a directional albedo for the GGX/Smith/Schlick BRDF.
- Replace mirror Fresnel with directional albedo for BSDF layering.
- Move Fresnel computation into the lighting integral for filtered importance sampling.
- Add mx_average_roughness for converting from anisotropic to isotropic roughness.

* Initial support for wedge rendering

- Add initial support for "wedge" rendering, where a single property is ramped between two values across successive screenshots, and the resulting image set is merged into a strip.  The new feature is activated by pressing the 'W' key in the MaterialX viewer, and settings for the render are hardcoded for now.
- Add hotkeys for adjusting camera zoom (+/-).
- Add utilities FilePath::addExtension and MaterialX::stringEndsWith.
- Refactor Viewer::drawContents for greater flexibility.
- Update changelog for recent work.

* Display advanced material properties by default

- Display advanced material properties by default in the viewer.
- Refactor BSDF function names for clarity.

* Refactor sheen BRDF for clarity

- Refactor the implementation of the sheen BRDF in GLSL to align with other BxDF nodes.
- Remove an unused overload of mx_fresnel_schlick.

* Energy compensation improvements for generated GLSL (#407)

- Add mx_ggx_energy_compensation for computing multiple scattering compensation with GGX/Smith shading.
- Split mx_ggx_directional_albedo into approximate and reference versions for evaluating approximation accuracy.
- Incorporate energy compensation into conductor_brdf, dielectric_brdf, and generalized_schlick_brdf.
- Add a Reference Quality option to MaterialXView.

* ADSK master to ILM master (#401)

Material node support plus additional improvements

* Remove duplicate data folders for viewer

This changelist restores an earlier improvement lost in the last merge, removing duplicate library and resource folders that were generated during the MaterialXView build process.

* Directional albedo improvements for generated GLSL

- Add generator option hwDirectionalAlbedoMethod for selecting between curve fit, table look-up, and importance sampling in directional albedo computations.
- Add generator option hwWriteAlbedoTable for generating a directional albedo table on the GPU.
- Use table look-up for directional albedo computations in the MaterialX viewer.

Also refactor the implementation of FilePath::removeExtension for consistency with FilePath::addExtension.

* Refactor microfacet library for generated GLSL (#412)

- Split mx_bsdfs.glsl into mx_microfacet, mx_microfacet_diffuse, mx_microfacet_specular, and mx_microfacet_sheen for more granular includes.
- Generate samples with respect to the standard basis in mx_ggx_directional_albedo_importance_sample (thanks to Stephen Hill for this suggestion).
- Improvements to method names, variable names, and documentation.

* Enable parallel builds in Appveyor

* Fix spelling in standard_surface graph

* Extend transparency heuristic to all surface shaders

This changelist takes the current transparency heuristic for standard_surface and extends it to all surface shaders, producing a more consistent result for UsdPreviewSurface and custom physically-based shaders.

* Simplify normal computation in UsdPreviewSurface

This changelist simplifies the computation of the per-pixel normal in UsdPreviewSurface, leveraging the standard <normalmap> node and removing a dependency on the bitangent stream.

* Improvements to material examples

- Add a standard_surface_brushed_metal example with high anisotropy.
- Increase the anisotropy of standard_surface_jade.
- Improve the unit tests for geometric streams, making them useful as debug visualizations for normals, tangents, and bitangents.

* Improvements to tangent frame generation

- Detect and skip duplicate vertices in TinyObjLoader::load, providing more accurate adjacency data for tangent frame generation.
- On hardware shading targets, generate bitangents in the vertex shader rather than storing them as an independent data stream.
- Refactor Mesh::generateTangents for improved robustness and clarity.

Supporting changes:

- Add a VectorN less-than operator, allowing vectors to be used as map keys.
- Add a MeshStream::getElement method to simplify geometry processing logic.

* Improvements to image extension handling

- Update ImageHandler::acquireImage to recognize extensions with non-standard letter case.
- Add clearer warning messages for images that fail to load.

* Improved handling for missing data libraries

* Fix upgrade path for compare nodes

- Fix comparison order in the upgrade path for compare nodes in v1.36 documents.
- Refactor the v1.36 upgrade path for clarity.

* Align behaviors of setConnectedNode methods

Align the behaviors of PortElement::setConnectedNode and Node::setConnectedNode, clarifying that a null NodePtr argument will clear any existing node connection.

* Improvements to image I/O

- Fix a CMake issue with OpenImageIO builds.
- Add a warning message for missing image files.

* Python related fixes for #355 and #359 (#411)

- Added CMake logic so pybind11 can be found, if no explicit path is provided
- Display validation warnings in Python unit tests.
- Remove Python bindings of header-defined constants.

* Add command-line options for mesh and light rotation

- Add command-line options '--meshRotation' and '--lightRotation' to the viewer.
- Add a Light Rotation slider to the Advanced Settings panel of the viewer.

Supporting changes:

- Add support for unary negation of a VectorN.
- Add error reporting for viewer command-line options.

* Add command-line options for camera position and target

- Add command-line options '--cameraPosition', '--cameraTarget', and '--meshScale' to the viewer.
- Generalize shadow transform for arbitrary camera placement.
- Mark the vector negation operator as const.

* Additional command-line options for the viewer

- Add command-line options '--cameraViewAngle', '--screenWidth', '--screenHeight', and '--screenColor' to the viewer.
- Simplify token parsing for command-line options.
- Update changelog for latest work.

* Add support for vector hashing

- Add support for hashing instances of VectorN classes, enabling their use as keys in unordered containers.
- Optimize TinyObjLoader::load by tracking duplicate vertices in an unordered map.
- Refactor MaterialXCore to remove unneeded dependencies.

* Shading model fixes and improvements

- Remove an extra factor of PI in the analytic Burley diffuse term for generated GLSL.
- Improve the robustness of the upgrade path for v1.36 compare nodes.
- Reset camera view angle when a new mesh is loaded into the viewer.

* Add support for GCC 10

- Add missing include to Element.cpp.
- Minor refactor of MaterialXCore dependencies.
- Update Travis configuration for GCC 10.

* Update documentation for v1.37.1

- Fix warnings reported by Doxygen.
- Update changelog for latest work.

* Support for exporting metadata in shader generation. (#844)

* Add implemention of AttributeDef element.

* Added AttributeDef pointer types

* Support [[ ]] punctuations for scope begin/end.

* Fixed issue with boolean type in OSL.

* Add metadata to ShaderPort. Support generation of metadata for shader inputs.

* Added AttributeDef methods to document.

* Fixed bug with scope handling in shader generation

* Using AttributeDefs for registering shader metadata.

* Support for metadata on node level.

* Added unittest for metadata generation.

* Fix typo in standard_surface nodedef.

* Support input widget metadata.

* Code cleanup.

* Fix initialization order issue.

* Changed default value and unit on thin_film_brdf.thickness. (#868)

* Use alphabetical order for consistency

* Align whitespace with ILM convention

* Add documentation for Oren-Nayar diffuse

This changelist adds documentation for the GLSL implementation of Oren-Nayar diffuse, along with minor updates to function and variable names.

* Improvements to transparency detection

- Handle both scalar and color values for transparent inputs.
- Check for a transparent graph when no uniform input binding is found.

* Fixes for tests_to_html (#428)

* print fix for tests_to_html.py so it'll run in Python 3
* Fix for tests_to_html to operate and generate an html even if it doesn't have both osl -and- glsl

* Shading improvements for generated GLSL

- Add a Fresnel model term to mx_environment_radiance, allowing for correct integration of conductor Fresnel on rough surfaces.  Thanks to Stephen Hill at Lucasfilm for catching this issue in the codebase!
- Unify epsilon tests for shading dot products in GLSL, addressing artifacts from backwards shading normals.
- Refactor shading logic for consistency and clarity.
- Add a pure conductor material to the test suite.

* Finalize changelog for v1.37.1

* Update development build to 1.37.2

* Merge of library API + OSL displacement (#439)

- Cleanup library utilities and add Python bindings.
- Add support for displacement shaders in generated OSL.
- Remove the CopyOptions class, making it the default behavior for Document::importLibrary to skip conflicting elements.

* Update image placement in README

* Load standard libraries regardless of build folder location (#445)

This changelist fixes a dependency on the build folder being located within the repository root folder.

* Add support for floating-point render targets

This changelist adds support for floating-point render targets in ShaderRenderer and its subclasses, allowing for HDR texture baking with TextureBaker.

* Improvements to environment background rendering

This changelist improves the accuracy of environment background rendering in the viewer, using a node graph based on view direction rather than geometric texture coordinates.

* Fix reflections from rotated environment lights

This changelist fixes the alignment of reflections from rotated environment lights.

* Python Texture Bake and Multiple Udims Texture Bake Support (#448)

* Scripting and documentation updates

- Add support for texture baking of documents with validation warnings.
- Update documentation.

* Additional improvements to texture baking

- Update argument names in baketextures.py to match those in MaterialXView (e.g. --width, --height, --library).
- Add arguments for input search path and output filename to baketextures.py.
- Rename TextureBaker::bakeAllShaders to TextureBaker::bakeAllMaterials.

Additional supporting changes:
- Emit warnings for missing textures in GlslProgram::bindTexture.
- Mark Element::getDescendant as a const method.

* Normal map texture baking feature (#451)

* Colorspace texture bake fix (#454)

* Unify search path generation

This changelist aligns search path generation between the viewer and texture baker, adding the MaterialX::getDefaultSearchPath method to define the expected behavior.

* Image handling improvements

- Add support for UINT8 textures in setTexelColor, getTexelColor, and createUniformImage.
- Make sure GLTextureHandler::createRenderResources sets the packing alignment in all code paths.
- Add a workaround for sampling issues with 1x1 textures.

* Improvements to viewer texture baking

- Fix an OpenGL error after baking textures in the viewer.
- Apply a constant maximum resolution to baked textures.
- Minor clarifications to baking logic.

* Image class improvements

- Add Python bindings for Image classes and enumerations.
- Add helper method Image::isUniformColor.

Also, add a standard include to Element.cpp that is required in recent VS2019 build environments.

* Texture baking optimizations (#460)

- Store uniform images as constant colors in texture baking.
- Skip duplicate references to a single output in texture baking.

Additional supporting changes:
- Make TextureBaker::bakeAllMaterials a non-static method.
- Clarify method names for image saving in ShaderRenderer.
- Remove partial support for shader nodes in texture baking (to be addressed more robustly in 1.38).

* Static analysis fixes

- Remove an unused argument from Element::addChildOfCategory.
- Use emplace/emplace_back where simpler and more efficient than insert/push_back.
- Const correctness fixes.

* Image loading improvements

- If an ImageHandler has multiple loaders, they are applied in the order they were added by the client.
- If MaterialX has been built with OpenImageIO support, make it available as a secondary loader in both MaterialXView and TextureBaker.

* Update changelog for recent work

* Shader translation (#463)

- Added ShaderTranslator class
- Added python bindings for ShaderTranslator

Additional supporting changes:
- Moved TextureBaker::connectsToNormalMapNode() to MaterialXGenShader/Util.h

* Python image support

- Add Python bindings for loading, editing, and saving images.
- Simplify Python bindings for image-related classes.
- Simplify traversal of image loaders.

* Add TextureBaker controls for color space and constant optimization

- Add a TextureBaker control for the color space in which textures are encoded.
- Add a TextureBaker control for optimization of uniform textures as constant values.
- Extend Python bindings for TextureBaker methods.
- Add support for the g22_ap1 color space in code generation.

* Improve accuracy of g22_ap1 transforms

This changelist improves the accuracy of transforms from g22_ap1 to lin_rec709 in generated GLSL and OSL.

* Improve search path for baketextures script (#470)

* Improvements to library loading functions

- Clarify interfaces and fix Python bindings for loadLibrary and loadLibraries.
- Leverage library loading functions in genshader.py.

* Additional refinements to baketextures script

- Unify search paths for documents and images.
- Align naming conventions with other Python scripts.

* Python import improvements

- Import MaterialX libraries consistently across Python scripts.
- Remove unused imports from Python scripts.

* Improvements to diffuse BSDF tests

This changelist integrates improvements to the diffuse BSDF test materials from the 1.38 branch of MaterialX.

* Improve CMake backwards compatibility

This changelist updates the CMakeLists.txt file in MaterialXTest to use patterns supported by earlier versions of CMake in addition to the latest version.

* Extend wedge rendering to color properties

* Static analysis fixes

- Add missing quotation marks to string literal.
- Add missing null checks.
- Use emplace_back where simpler and more efficient than push_back.
- Const correctness fixes.

* Documentation updates

- Fix mismatching braces in Doxygen comments
- Update changelog for recent work.
- Update main page for recent presentations.

* Align variable names

- Align variable names between interface and implementation in loadLibraries.
- Use a single variable name convention in baketextures.py.
- Additional script cleanup in baketextures.py.

* Finalize changelog for v1.37.2

* Update development build to 1.37.3

* Initial support for shared libraries

This changelist adds initial support for shared libraries on Linux and MacOS.

* Update pre-built binaries

This changelist updates the links for pre-built binaries, pointing them to the latest release rather than the latest commit.

* Improvements to transparency rendering in viewer

- Add a Render Transparency option to the Advanced Settings panel.
- Allow transparent surfaces to be shadow receivers.

* Github actions support (#427)

Initial support for continuous integration support with Github Actions.

Has a builder for linux, macos, and windows with vs2017 and 2019.

* Extend GitHub Actions coverage

* Range loop analysis fixes

This changelist addresses range-loop analysis warnings reported by Clang 12.

* Refinements to GitHub CI

- Add Python 2.7 builds on Linux and MacOS.
- Remove unused Python path step.
- Clarify job names.

* Update project badges

- Remove Travis CI badge, as this functionality is now covered by GitHub CI.
- Add release version badge.

* Improvements to acquireImage

- Remove the 'message' return value from ImageHandler::acquireImage, allowing for more straightforward Python bindings.
- Generate mipmaps by default in ImageHandler::acquireImage.

* Refinements to shader translation

- Add handling for source materials without node graphs.
- Add handling for source materials with unsupported inputs.

* Remove unused variables

* Remove legacy Observer classes

This changelist removes the legacy Observer and ObservedDocument classes, which have been superseded by the MaterialXRuntime library for real-time graph editing.  Callback methods that were exclusively leveraged by Observer classes have been removed as well.

* Image I/O improvements

- Add exception handling to image I/O calls.
- Clarify documentation for the MATERIALX_OIIO_DIR option in CMake.

* Improvements to shader translation

- Make ShaderTranslator::translateAllShaders a non-static member function.
- Use exceptions rather than standard I/O to signal errors.
- Add error messages for common missing features in translation graphs.

* Robustness improvements for translation and baking

- Add handling for edge cases in shader translation (e.g. missing normal maps).
- Add handling for edge cases in texture baking (e.g. missing node inputs).
- Improved handling of upgrades for legacy documents.

* Improvements to texture baking

- Omit default-valued constants in texture baking.
- Bake TIFF/EXR files when OpenImageIO is available.

* Viewer improvements

- Add render support for partially-transparent meshes.
- Automatically split meshes by UDIMs as required.
- Additional refinements to texture baking.

* Improvements to OpenGL texture handling

- Fix an edge case in image resource construction.
- Emit warnings when errors are encountered in image binding.

* Add support for image averaging in baking

* Additional viewer options

- Add a double-sided rendering option to the Advanced Settings panel.
- Add hotkeys for cycling through selected geometries (up/down arrows).

* Add GLSL subsurface scattering approximation

This changelist adds a simple subsurface scattering approximation to MaterialX GLSL.  The high-level approach is to integrate Burley's diffusion profile over the sphere using Eric Penner's curvature-based approximation.  While this ignores the thickness of the scattering volume, it keeps the implementation within a single shading pass and provides a meaningful visual interpretation of the subsurface scattering inputs.

* GLSL shading improvements

- Render back faces with forward-facing normals.
- Fix artifacts with low roughness values in sheen rendering.

* Fix for single-channel textures in MaterialXRenderGlsl

This changelist fixes the rendering of single-channel textures in MaterialXRenderGlsl, setting the required state that replicates the red channel to RGB.

* Handle empty environments in computeDominantLight

* Viewer improvements

- Handle UDIMs when merging multiple materials.
- Invalidate shadow maps when a new material is loaded.
- Check for zero intensities in splitDirectLight.
- Consider "existence" bindings when computing transparency.

* Remove legacy CI configurations

This changelist removes legacy CI configurations for Travis and Appveyor, and updates the changelog for recent work.

* Update env commands in GitHub Actions

* Image handling improvements (#520)

- Unify the handling of missing images in generated GLSL, binding a 1x1 sentinel image when the declared default value should be rendered.
- Remove legacy handling for fallback colors in image loading.
- Add a missing image example to the test suite.

* Remove MATERIALX_DEBUG_POSTFIX in favor of CMAKE_DEBUG_POSTFIX (#509)

* Additional workflow fixes

- Add a missing variable initialization in TextureBaker.
- Restrict UDIM assignments to materials in the viewer.

* Fix bug with codegen of custom BSDF/EDF graphs.

* Use newer OpenImageIO interface.

* Allow building against an external NanoGUI installation (#525)

* Update changelog for recent work

* Add changelog and readme to install

This changelist adds two root-level documents, CHANGELOG.md and README.md, to installations of MaterialX.

* Finalize changelog for v1.37.3

* Update links in README

* Add shared library build

This changelist adds a Linux shared-library build to GitHub Actions CI.

* Update development build to 1.37.4

* OpenGL improvements for software rendering

- Add missing VAO binding to GlslRenderer::drawScreenSpaceQuad.
- Use warnings rather than exceptions to report OpenGL errors.
- Update CMake settings in MaterialXRenderGlsl to prefer GLVND libraries.
- Reorganize GLUtilityContext into GLUtil and GLContext for clarity.

* Add material baking to GitHub Actions CI

This changelist adds an initial material baking example to our GitHub Actions CI, leveraging xvfb for software OpenGL rendering on Linux.

* Improved robustness in MaterialXRenderGlsl

- Clarify the lifetime and ownership of WindowWrapper objects using shared pointers.
- Improve alignment of OpenGL context management between platforms.
- Minor formatting and comment updates for consistency and clarity.

* Make strings local to module

This changelist makes two strings local to the ConvolutionNode module, in order to work around a compiler issue on Linux.

* Additional improvements to MaterialXRenderGlsl

- Simplify platform-specific logic in GLContext.
- Add a null check to the Linux SimpleWindow destructor.
- Remove a context-changing call from the GlslRenderer destructor.
- Remove an unused header from the glew library.
- Clarify an initializer in the GlslProgram constructor.

* Update version badge link

* Improved color space handling in MaterialXRenderGlsl

- Correctly transfer color spaces of uniform values in TextureBaker.
- Add a warning for unsupported color space transforms in ShaderGraph.
- Add a second material baking test to GitHub Actions.
- Minor clarifications to example materials.

* Update changelog for recent work

* Refinements to GitHub Actions CI

- Initialize the virtual framebuffer before running unit tests, opening the door to more advanced render testing in the future.
- Remove unused libraries in MacOS builds.

* Finalize changelog for v1.37.4

* Merge the v1.38 development branch to master (#578)

Updated the MaterialX library to the v1.38 specification.

### Added
- Added support for Nvidia's Material Definition Language (MDL) in MaterialX code generation.
- Added user controls for texture baking and wedge rendering in the MaterialX viewer.
- Added viewer rendering to cloud-based testing in GitHub Actions.
- Added support for TargetDef elements.
- Added support for Xcode 12.

### Changed
- Updated the set of standard nodes to match the v1.38 specification, including significant improvements to the Physically Based Shading nodes.
- Replaced specialized Material elements with material nodes, allowing more flexible material definitions and more consistent traversal.
- Replaced specialized Parameter elements with uniform Input elements, reducing duplication in libraries and client code.
- Updated the MaterialX viewer to use native classes for GLSL rendering and camera controls, opening the door to additional render frameworks in the future.
- Updated the prefiltered path for specular environment rendering in GLSL, providing a closer match with the Filtered Importance Sampling path.
- Updated the definition of Autodesk Standard Surface to version 1.0.1.
- Updated the definition of UsdPreviewSurface to version 2.3.

### Removed
- Removed support for the Color2 type.

* Miscellaneous fixes from production testing

- Bind the active shader before setting uniforms for unit selection.  (Fixes an OpenGL error when changing units.)
- Only apply implicit UDIM assignments to material nodes, not to unbound graph outputs.  (Fixes UDIM assignments in documents with unbound graph outputs.)
- Cache resolved filenames when images fail to load.  (Fixes handling of a single bad UDIM within a sequence.)
- Return a nullptr rather than throwing an exception when a TypeDesc is not found.  (Fixes error messages during scanning for light nodes.)

* Patch.

* Patch test to match new no-throw logic.

* More patches.

* Document versioning improvements

- Assign the 1.38 version to documents after updates are complete.
- Add an mxupdate.py script to update a folder of documents in place.

* Restore code which should be removed due to merge (fallback shader for viewer).

* Update example scripts for document writing

- Update writelooks.py and writenodegraphs.py to the latest Python API.
- Add default arguments to the Python wrapper for Document::addMaterialNode.
- Add deprecation warnings for legacy Python methods (addParameter, addBindInput, addBindParam, addShaderRef, addMaterial).

* Change log updates.

* HM filter with numeric saftey checks. Restore baker non-optimization code.

* Review fix.

* Python wrapper improvements

- Add a standard __version__ string to MaterialX Python, matching the value of MaterialX.getVersionString().
- Add missing deprecation warnings for GeomAttr elements.
- Add missing deprecation warning for InterfaceElement.addParameter.
- Simplify the Python wrapper for GraphElement.addNode.
- Unify formatting across Python wrapper modules.

* Fix edge case for shaderref updates

This changelist addresses an edge case when updating shaderrefs to v1.38, where the node string of the associated nodedef was ignored when determining the shader node category.  Thanks to Karen Lucknavalai at Pixar for catching this!

* Fix to copy over contents from sampled node to newly created normalmap node if the sampled node
is not actually a normalmap node. This can occur when searching upstream for normalmap nodes in the
subgraph to sample. A normalmap node may be found but the root of the subgraph is what is actually sampled --
so the 2 nodes are not the same.

* Update luma coefficients for acescg

This changelist updates the luma coefficients for the acescg/lin_ap1 colorspace, aligning them with reference values at https://www.colour-science.org/api/0.3.5/html/colour.models.dataset.aces.html.  Thanks to Philippe Leprince on the RenderMan team for this catch!

* Improvements to target and version handling

- Add handling for target, version, and nodedef attributes when upgrading from shaderrefs to shader nodes.
- Move target and version accessors from Element to InterfaceElement, as shaderrefs were the only non-interface elements requiring them.
- Remove version-compatibility logic from NodeDef::getImplementation, as implementations don't support version strings.
- Remove Implementation elements for saturate and contrast nodes from the standard library, as these nodes are now defined via nodegraphs.

* Update heighttonormal test.

Co-authored-by: Doug Smythe <dbsmythe@gmail.com>
Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>
Co-authored-by: Niklas Harrysson <niklas.harrysson@gmail.com>
Co-authored-by: Madeleine Yip <52723401+mjyip-lucasfilm@users.noreply.github.com>
Co-authored-by: David Larsson <laserallan@gmail.com>
Co-authored-by: Ashwin Bhat <1727158+ashwinbhat@users.noreply.github.com>
Co-authored-by: alister-chowdhury <30833607+alister-chowdhury@users.noreply.github.com>
Co-authored-by: Indy Ray <iray@telltale.com>
Co-authored-by: bsavery <brian.savery@gmail.com>
Co-authored-by: debaetsd <debaetsd@gmail.com>
Co-authored-by: rzulak <rzulak@imageworks.com>
Co-authored-by: marsupial <marsupial@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

3 participants