forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to color space handling
- Add support for 'none' as a colorspace attribute, specifying that the given color should not be transformed. - Add support for colorspace attributes on multi-output nodes (e.g. UsdUvTexture), which only affect color-typed outputs. - Update the 'usd_normal_map.mtlx' and 'usd_uv_texture.mtlx' examples to demonstrate these new capabilities. - Remove legacy references to colorspace 'none' for physical colors, as it's more accurate in practice to interpret these values as visible colors.
- Loading branch information
1 parent
537aa92
commit b26f19e
Showing
6 changed files
with
38 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 17 additions & 12 deletions
29
resources/Materials/TestSuite/pbrlib/surfaceshader/usd_normal_map.mtlx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 7 additions & 35 deletions
42
resources/Materials/TestSuite/pbrlib/surfaceshader/usd_uv_texture.mtlx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,17 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.39"> | ||
|
||
<!-- UsdUVTexture: version 2.2 test --> | ||
<UsdUVTexture name="UsdUVTexture22" type="multioutput" version="2.2"> | ||
<UsdUVTexture name="texture_base_color" type="multioutput"> | ||
<input name="file" type="filename" value="resources/Images/brass_color.jpg" colorspace="srgb_texture" /> | ||
</UsdUVTexture> | ||
<convert name="extractColor" type="color3"> | ||
<input name="in" type="color4" nodename="UsdUVTexture22" output="rgba" /> | ||
</convert> | ||
<UsdUVTexture name="UsdUVTexture22_rough" type="multioutput" version="2.2"> | ||
<UsdUVTexture name="texture_roughness" type="multioutput"> | ||
<input name="file" type="filename" value="resources/Images/brass_roughness.jpg" /> | ||
</UsdUVTexture> | ||
<extract name="extractRoughness" type="float"> | ||
<input name="in" type="color4" nodename="UsdUVTexture22_rough" output="rgba" /> | ||
<input name="index" type="integer" value="0" /> | ||
</extract> | ||
|
||
<UsdPreviewSurface name="UsdPreviewSurface22" type="surfaceshader" nodedef="ND_UsdPreviewSurface_surfaceshader" version="2.3"> | ||
<input name="diffuseColor" type="color3" nodename="extractColor" /> | ||
<input name="roughness" type="float" nodename="extractRoughness" /> | ||
<UsdPreviewSurface name="UsdPreviewSurface" type="surfaceshader" nodedef="ND_UsdPreviewSurface_surfaceshader"> | ||
<input name="diffuseColor" type="color3" nodename="texture_base_color" output="rgb" /> | ||
<input name="roughness" type="float" nodename="texture_roughness" output="r" /> | ||
<input name="metallic" type="float" value="1" /> | ||
</UsdPreviewSurface> | ||
<surfacematerial name="USDTexture_Tiled_Brass22" type="material"> | ||
<input name="surfaceshader" type="surfaceshader" nodename="UsdPreviewSurface22" /> | ||
<surfacematerial name="TiledBrass" type="material"> | ||
<input name="surfaceshader" type="surfaceshader" nodename="UsdPreviewSurface" /> | ||
</surfacematerial> | ||
|
||
<!-- UsdUVTexture: version 2.3 test. Default is currently 2.3 so no version specifier required --> | ||
<UsdUVTexture name="UsdUVTexture23_rough" type="multioutput"> | ||
<input name="file" type="filename" value="resources/Images/brass_roughness.jpg" /> | ||
</UsdUVTexture> | ||
<UsdUVTexture name="UsdUVTexture23" type="multioutput"> | ||
<input name="file" type="filename" value="resources/Images/brass_color.jpg" colorspace="srgb_texture" /> | ||
</UsdUVTexture> | ||
|
||
<UsdPreviewSurface name="UsdPreviewSurface23" type="surfaceshader" nodedef="ND_UsdPreviewSurface_surfaceshader" version="2.3"> | ||
<input name="diffuseColor" type="color3" nodename="UsdUVTexture23" output="rgb" /> | ||
<input name="roughness" type="float" nodename="UsdUVTexture23_rough" output="r" /> | ||
<input name="metallic" type="float" value="1" /> | ||
</UsdPreviewSurface> | ||
<surfacematerial name="USDTexture_Tiled_Brass23" type="material"> | ||
<input name="surfaceshader" type="surfaceshader" nodename="UsdPreviewSurface23" /> | ||
</surfacematerial> | ||
|
||
</materialx> |
32 changes: 0 additions & 32 deletions
32
resources/Materials/TestSuite/stdlib/color_management/surface_colorspace.mtlx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters