Skip to content

Commit

Permalink
Merge branch 'main' into zicher3d/patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm authored Aug 4, 2023
2 parents b77510a + c34a106 commit fa1a77c
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 54 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,12 @@ jobs:
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON
static_analysis: ON

- name: Linux_Clang_13_Python39
os: ubuntu-22.04
compiler: clang
compiler_version: "13"
python: 3.9
test_render: ON

- name: Linux_Clang_14_Python311
os: ubuntu-22.04
compiler: clang
compiler_version: "14"
python: 3.11
test_render: ON
clang_format: ON

- name: Linux_Clang_14_DynamicAnalysis
Expand Down
6 changes: 5 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 @@ -115,6 +116,7 @@ mark_as_advanced(MATERIALX_NAMESPACE_SUFFIX)
mark_as_advanced(MATERIALX_LIBNAME_SUFFIX)
mark_as_advanced(MATERIALX_PYTHON_LTO)
mark_as_advanced(MATERIALX_INSTALL_PYTHON)
mark_as_advanced(MATERIALX_INSTALL_RESOURCES)
mark_as_advanced(MATERIALX_TEST_RENDER)
mark_as_advanced(MATERIALX_WARNINGS_AS_ERRORS)
mark_as_advanced(MATERIALX_DYNAMIC_ANALYSIS)
Expand Down Expand Up @@ -276,7 +278,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@)
3 changes: 2 additions & 1 deletion documents/Specification/MaterialX.Specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ Standard Texture nodes:
<a id="node-image"> </a>

* **`image`**: samples data from a single image, or from a layer within a multi-layer image. When used in the context of rendering a geometry, the image is mapped onto the geometry based on geometry UV coordinates, with the lower-left corner of an image mapping to the (0,0) UV coordinate (or to the fractional (0,0) UV coordinate for tiled images).
The type of the &lt;image> node determines the number of channels output, which may be less than the number of channels in the image file, outputting the first N channels from the image file. So a `float` &lt;image> would return the Red channel of an RGB image, and a `color3` &lt;image> would return the RGB channels of an RGBA image.
* `file` (uniform filename): the URI of an image file. The filename can include one or more substitutions to change the file name (including frame number) that is accessed, as described in the [Filename Substitutions](#filename-substitutions) section above.
* `layer` (uniform string): the name of the layer to extract from a multi-layer input file. If no value for `layer` is provided and the input file has multiple layers, then the "default" layer will be used, or "rgba" if there is no "default" layer. Note: the number of channels defined by the `type` of the `<image>` must match the number of channels in the named layer.
* `default` (float or color<em>N</em> or vector<em>N</em>): a default value to use if the `file` reference can not be resolved (e.g. if a &lt;_geometry token_>, [_interface token_] or {_hostattr_} is included in the filename but no substitution value or default is defined, or if the resolved `file` URI cannot be read), or if the specified `layer` does not exist in the file. The `default` value must be the same type as the `<image>` element itself. If `default` is not defined, the default color value will be 0.0 in all channels.
Expand Down Expand Up @@ -2369,7 +2370,7 @@ An input with a shader-semantic type may be given a value of "" to indicate no s

The Standard MaterialX Library defines the following nodes and node variants operating on "shader"-semantic types. Standard library shaders do not respond to external illumination; please refer to the [**MaterialX Physically Based Shading Nodes**](./MaterialX.PBRSpec.md#materialx-pbs-library) document for definitions of additional nodes and shader constructors which do respond to illumination.

<a id="node-surfaceunlit"> </a>
<a id="node-surface-unlit"> </a>

* **`surface_unlit`**: an unlit surface shader node, representing a surface that can emit and transmit light, but does not receive illumination from light sources or other surfaces. Output type surfaceshader.
* `emission` (float): the surface emission amount; default is 1.0
Expand Down
70 changes: 35 additions & 35 deletions javascript/MaterialXView/package-lock.json

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

4 changes: 2 additions & 2 deletions javascript/MaterialXView/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"license": "ISC",
"dependencies": {
"dat.gui": "^0.7.9",
"three": "^0.135.0",
"webpack": "^5.88.1"
"three": "^0.136.0",
"webpack": "^5.88.2"
},
"devDependencies": {
"copy-webpack-plugin": "^8.1.1",
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
11 changes: 6 additions & 5 deletions libraries/pbrlib/genosl/mx_blackbody.osl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
void mx_blackbody(float temperature, output color color_value)
void mx_blackbody(float temp, output color color_value)
{
float xc, yc;
float t, t2, t3, xc2, xc3;

// if value outside valid range of approximation clamp to accepted temperature range
temperature = clamp(temperature, 1667.0, 25000.0);
float temperature = clamp(temp, 1667.0, 25000.0);

t = 1000.0 / temperature;
t2 = t * t;
Expand Down Expand Up @@ -39,9 +39,10 @@ void mx_blackbody(float temperature, output color color_value)
vector XYZ = vector(xc / yc, 1.0, (1 - xc - yc) / yc);

/// XYZ to Rec.709 RGB colorspace conversion
matrix XYZ_to_RGB = matrix( 3.2406, -0.9689, 0.0557,
-1.5372, 1.8758, -0.2040,
-0.4986, 0.0415, 1.0570);
matrix XYZ_to_RGB = matrix( 3.2406, -0.9689, 0.0557, 0.0,
-1.5372, 1.8758, -0.2040, 0.0,
-0.4986, 0.0415, 1.0570, 0.0,
0.0, 0.0, 0.0, 1.0);

color_value = transform(XYZ_to_RGB, XYZ);
color_value = max(color_value, vector(0.0));
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 fa1a77c

Please sign in to comment.