-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hdSt] Incorrect MaterialX shading without Dome Light
MaterialX uses samplers in its shaderGen to calculate indirect lighting. When there is a domeLight in the scene or the default domeLight is enabled these are initialized with the appropriate HdGetSampler_domeLight**() functions. If there is no domeLlight, MaterialX still expects valid samplers. When using non-bindless textures these samplers are declared without bindings specified, and as a result if the MaterialX material has textures, the shader will sample from those material textures for the indirect lighting. Adding a fallback domeLight texture node to the material network in MaterialXFilter, so that when there is no domeLight we will sample from this fallback texture instead. Fixes #1877 (Internal change: 2238260)
- Loading branch information
Showing
10 changed files
with
127 additions
and
6 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+64.6 KB
...ging/usdImagingGL/testenv/testUsdImagingGLMaterialX/baseline/mxFallbackDome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.4 KB
pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialX/grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialX/mxFallbackDome.usda
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,31 @@ | ||
#usda 1.0 | ||
( | ||
upAxis = "Z" | ||
) | ||
|
||
def "TestMaterial" ( | ||
references = @texturedSphere.usda@ | ||
) | ||
{ | ||
rel material:binding = </MaterialX/Materials/TextureTest> | ||
} | ||
|
||
|
||
def Scope "MaterialX" ( | ||
references = [ | ||
@./textureTest.mtlx@</MaterialX>, | ||
] | ||
) | ||
{ | ||
} | ||
|
||
def Xform "lights" | ||
{ | ||
def SphereLight "Light" | ||
{ | ||
float inputs:radius = 5 | ||
float inputs:intensity = 10 | ||
Vec3f xformOp:translate = (0, -20, 0) | ||
uniform token[] xformOpOrder = ["xformOp:translate"] | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialX/textureTest.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,19 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.38"> | ||
<nodegraph name="NG_imagetex"> | ||
<texcoord name="texcoord0" type="vector2" /> | ||
<image name="image0_color" type="color3" nodedef="ND_image_color3"> | ||
<input name="file" type="filename" uniform="true" value="./grid.png" /> | ||
<input name="texcoord" type="vector2" nodename="texcoord0" /> | ||
</image> | ||
<output name="out_color_0" type="color3" nodename="image0_color" /> | ||
</nodegraph> | ||
<standard_surface name="SR_test" type="surfaceshader"> | ||
<input name="base" type="float" value="1" /> | ||
<input name="base_color" type="color3" nodegraph="NG_imagetex" output="out_color_0" /> | ||
<input name="metalness" type="float" value="0" /> | ||
</standard_surface> | ||
<surfacematerial name="TextureTest" type="material"> | ||
<input name="surfaceshader" type="surfaceshader" nodename="SR_test" /> | ||
</surfacematerial> | ||
</materialx> |