Skip to content

Commit

Permalink
Merge branch 'AcademySoftwareFoundation:main' into downstream_traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
kwokcb committed Jul 24, 2023
2 parents f5d8984 + 42e8b76 commit 46c8fb2
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 31 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ option(MATERIALX_BUILD_TESTS "Build unit tests." ON)
option(MATERIALX_BUILD_SHARED_LIBS "Build MaterialX libraries as shared rather than static." OFF)
option(MATERIALX_PYTHON_LTO "Enable link-time optimizations for MaterialX Python." ON)
option(MATERIALX_INSTALL_PYTHON "Install the MaterialX Python package as a third-party library when the install target is built." ON)
option(MATERIALX_INSTALL_RESOURCES "Install the resources folder when building render modules." ON)
option(MATERIALX_TEST_RENDER "Run rendering tests for MaterialX Render module. GPU required for graphics validation." ON)
option(MATERIALX_WARNINGS_AS_ERRORS "Interpret all compiler warnings as errors." OFF)
option(MATERIALX_DYNAMIC_ANALYSIS "Build MaterialX libraries with dynamic analysis on supporting platforms." OFF)
Expand Down Expand Up @@ -276,7 +277,9 @@ if(MATERIALX_BUILD_RENDER)
if(MATERIALX_BUILD_GRAPH_EDITOR)
add_subdirectory(source/MaterialXGraphEditor)
endif()
add_subdirectory(resources)
if(MATERIALX_INSTALL_RESOURCES)
add_subdirectory(resources)
endif()
endif()

# Add test subdirectory
Expand Down
4 changes: 3 additions & 1 deletion cmake/modules/MaterialXConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ set_and_check(MATERIALX_STDLIB_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/libraries")
if(@MATERIALX_BUILD_PYTHON@ AND @MATERIALX_INSTALL_PYTHON@)
set_and_check(MATERIALX_PYTHON_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/python")
endif()
set_and_check(MATERIALX_RESOURCES_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/resources")
if(@MATERIALX_BUILD_RENDER@ AND @MATERIALX_INSTALL_RESOURCES@)
set_and_check(MATERIALX_RESOURCES_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/resources")
endif()

check_required_components(@CMAKE_PROJECT_NAME@)
50 changes: 25 additions & 25 deletions javascript/MaterialXView/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion javascript/MaterialXView/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "ISC",
"dependencies": {
"dat.gui": "^0.7.9",
"three": "^0.135.0",
"three": "^0.140.2",
"webpack": "^5.88.1"
},
"devDependencies": {
Expand Down
2 changes: 0 additions & 2 deletions javascript/MaterialXView/source/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const IMAGE_PATH_SEPARATOR = "/";
export function prepareEnvTexture(texture, capabilities)
{
const rgbaTexture = RGBToRGBA_Float(texture);
// RGBELoader sets flipY to true by default
rgbaTexture.flipY = false;
rgbaTexture.wrapS = THREE.RepeatWrapping;
rgbaTexture.anisotropy = capabilities.getMaxAnisotropy();
rgbaTexture.minFilter = THREE.LinearMipmapLinearFilter;
Expand Down
2 changes: 1 addition & 1 deletion javascript/MaterialXView/source/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ export class Material
Object.assign(uniforms, {
u_numActiveLightSources: { value: lights.length },
u_lightData: { value: lightData },
u_envMatrix: { value: getLightRotation() },
u_envMatrix: { value: new THREE.Matrix4().multiplyMatrices(getLightRotation(), new THREE.Matrix4().makeScale(1, -1, 1)) },
u_envRadiance: { value: radianceTexture },
u_envRadianceMips: { value: Math.trunc(Math.log2(Math.max(radianceTexture.image.width, radianceTexture.image.height))) + 1 },
u_envRadianceSamples: { value: 16 },
Expand Down
2 changes: 2 additions & 0 deletions source/MaterialXGenMsl/MslShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

#include "MslResourceBindingContext.h"

#include <cctype>

MATERIALX_NAMESPACE_BEGIN

const string MslShaderGenerator::TARGET = "genmsl";
Expand Down

0 comments on commit 46c8fb2

Please sign in to comment.