Skip to content

Commit

Permalink
Add UI limits for useSpecularWorkflow and normal in UsdPreviewSurface (
Browse files Browse the repository at this point in the history
…#1646)

UsdPreviewSurface allows useSpecularWorkflow to be 0 or 1. Normals should have values between -1 to 1, inclusive. This PR puts these limits into place.
  • Loading branch information
erich666 authored Jan 11, 2024
1 parent 8489915 commit a501ebe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mkdir ./javascript/build
cd ./javascript/build
```

If you are using the emsdk directly on Windows, note that the emscripten SDK doesn't work with Microsoft's Visual Studio build tools. You need to use an alternative CMake generator like [MinGW](http://mingw-w64.org/doku.php) Makefiles or [Ninja](https://ninja-build.org/). We recommend to use Ninja (unless you already have MinGW installed), since it's pretty lightweight and a pure build system, instead of a full compiler suite.
If you are using the emsdk directly on Windows, note that the emscripten SDK doesn't work with Microsoft's Visual Studio build tools. You need to use an alternative CMake generator like [MinGW](http://mingw-w64.org/doku.php) Makefiles or [Ninja](https://ninja-build.org/). We recommend to use Ninja (unless you already have MinGW installed), since it's pretty lightweight and a pure build system, instead of a full compiler suite. Download Ninja for Windows and unzip the ninja.exe file to some suitable directory in your path (use the command "echo $PATH" or similar to view your PATH variable).

Generate the build files with CMake. When building the JavaScript bindings, you can optionally specify the emsdk path with the `MATERIALX_EMSDK_PATH` option. This option can be omitted if the `emsdk/emsdk_env.sh` script was run beforehand.
```sh
Expand Down
3 changes: 3 additions & 0 deletions javascript/build_javascript_win.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@rem This script builds MaterialX JavaScript on Windows. The final command starts a local server, allowing you to
@rem run the MaterialX Web Viewer locally by entering 'http://localhost:8080' in the search bar of your browser.
@echo --------------------- Setup Emscripten ---------------------
@echo on
@rem Edit the following paths to match your local locations for the Emscripten and MaterialX projects.
set EMSDK_LOCATION=C:/GitHub/emsdk
set MATERIALX_LOCATION=C:/GitHub/MaterialX
call %EMSDK_LOCATION%/emsdk.bat install latest
Expand Down
4 changes: 2 additions & 2 deletions libraries/bxdf/usd_preview_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<nodedef name="ND_UsdPreviewSurface_surfaceshader" node="UsdPreviewSurface" nodegroup="pbr" doc="USD preview surface shader" version="2.3" isdefaultversion="true">
<input name="diffuseColor" type="color3" value="0.18, 0.18, 0.18" uimin="0,0,0" uimax="1,1,1" />
<input name="emissiveColor" type="color3" value="0, 0, 0" uimin="0,0,0" uisoftmax="1,1,1" />
<input name="useSpecularWorkflow" type="integer" value="0" />
<input name="useSpecularWorkflow" type="integer" value="0" uimin="0" uimax="1" uistep="1" />
<input name="specularColor" type="color3" value="0, 0, 0" uimin="0,0,0" uimax="1,1,1" />
<input name="metallic" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="roughness" type="float" value="0.5" uimin="0.0" uimax="1.0" />
Expand All @@ -18,7 +18,7 @@
<input name="opacity" type="float" value="1" uimin="0.0" uimax="1.0" />
<input name="opacityThreshold" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="ior" type="float" value="1.5" uimin="0.0" uisoftmin="1.0" uisoftmax="3.0" />
<input name="normal" type="vector3" value="0, 0, 1" />
<input name="normal" type="vector3" value="0, 0, 1" uimin="-1.0,-1.0,-1.0" uimax="1.0,1.0,1.0" uistep="0.01" />
<input name="displacement" type="float" value="0" />
<input name="occlusion" type="float" value="1" uimin="0.0" uimax="1.0" />
<output name="out" type="surfaceshader" />
Expand Down

0 comments on commit a501ebe

Please sign in to comment.