-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify default color handling in GLSL (#1452)
This changelist simplifies default color handling in GLSL, making the renderer responsible for generating fallback textures when images are not found on disk, and removing associated dynamic branches in GLSL shader code. Two advantages of this simplification are: - Hydra Storm and other MaterialXGenGlsl integrations can now render materials that reference 1x1 images without needing special-case logic. - The render performance of MaterialXGenGlsl shaders that reference images is slightly improved, as dynamic branches exact a performance cost in some situations. This new logic doesn't yet handle color space differences between missing images and default colors, and we should address this across languages in a future improvement.
- Loading branch information
1 parent
b23de80
commit 79433cc
Showing
16 changed files
with
74 additions
and
96 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
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
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
36 changes: 36 additions & 0 deletions
36
resources/Materials/TestSuite/stdlib/texture/image_default.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.38" colorspace="lin_rec709"> | ||
<!-- | ||
Validation of default color fallbacks for missing image files. | ||
--> | ||
<image name="image_color4" type="color4"> | ||
<input name="file" type="filename" value="resources/Images/invalid.png" /> | ||
<input name="default" type="color4" value="0.8, 0.2, 0.2, 1.0" /> | ||
</image> | ||
<output name="image_color4_output" type="color4" nodename="image_color4" /> | ||
<image name="image_color3" type="color3"> | ||
<input name="file" type="filename" value="resources/Images/invalid.png" /> | ||
<input name="default" type="color3" value="0.8, 0.2, 0.2" /> | ||
</image> | ||
<output name="image_color3_output" type="color3" nodename="image_color3" /> | ||
<image name="image_vector4" type="vector4"> | ||
<input name="file" type="filename" value="resources/Images/invalid.png" /> | ||
<input name="default" type="vector4" value="0.8, 0.2, 0.2, 1.0" /> | ||
</image> | ||
<output name="image_vector4_output" type="vector4" nodename="image_vector4" /> | ||
<image name="image_vector3" type="vector3"> | ||
<input name="file" type="filename" value="resources/Images/invalid.png" /> | ||
<input name="default" type="vector3" value="0.8, 0.2, 0.2" /> | ||
</image> | ||
<output name="image_vector3_output" type="vector3" nodename="image_vector3" /> | ||
<image name="image_vector2" type="vector2"> | ||
<input name="file" type="filename" value="resources/Images/invalid.png" /> | ||
<input name="default" type="vector2" value="0.8, 0.2" /> | ||
</image> | ||
<output name="image_vector2_output" type="vector2" nodename="image_vector2" /> | ||
<image name="image_float" type="float"> | ||
<input name="file" type="filename" value="resources/Images/invalid.png" /> | ||
<input name="default" type="float" value="0.8" /> | ||
</image> | ||
<output name="image_float_output" type="float" nodename="image_float" /> | ||
</materialx> |
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
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
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
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
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