Skip to content

Commit

Permalink
Re organize the MaterialX usdImagingGL tests
Browse files Browse the repository at this point in the history
Splitting testUsdImagingGLMaterialX into two tests:
- testUsdImagingGLMaterialXBasic
- testUsdImagingGLMaterialXTextured
Moving the mtlx files and any images used in those mtlx files into a subfolder.
Deleting two unused baslines
Adding a missing test case to the CMakeLists

(Internal change: 2294454)
  • Loading branch information
klucknav authored and pixar-oss committed Sep 7, 2023
1 parent 23a9bbb commit 6430162
Show file tree
Hide file tree
Showing 59 changed files with 88 additions and 69 deletions.
123 changes: 71 additions & 52 deletions pxr/usdImaging/usdImagingGL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3629,11 +3629,11 @@ pxr_register_test(testUsdImagingGLMaterialStrengthOrder

if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
pxr_install_test_dir(
SRC testenv/testUsdImagingGLMaterialX
DEST testUsdImagingGLMaterialX
SRC testenv/testUsdImagingGLMaterialXBasic
DEST testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_mxSimple
pxr_register_test(testUsdImagingGLMaterialXBasic_mxSimple
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxSimple.usda -write mxSimple.png"
IMAGE_DIFF_COMPARE
mxSimple.png
Expand All @@ -3642,10 +3642,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.0075
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_standardSurface
pxr_register_test(testUsdImagingGLMaterialXBasic_standardSurface
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage standardSurface.usda -write standardSurface.png"
IMAGE_DIFF_COMPARE
standardSurface.png
Expand All @@ -3654,10 +3654,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.2
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_standardSurfaceMarble
pxr_register_test(testUsdImagingGLMaterialXBasic_standardSurfaceMarble
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage standardSurfaceMarble.usda -write standardSurfaceMarble.png"
IMAGE_DIFF_COMPARE
standardSurfaceMarble.png
Expand All @@ -3666,10 +3666,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_usdPreviewSurface
pxr_register_test(testUsdImagingGLMaterialXBasic_usdPreviewSurface
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage usdPreviewSurface.usda -write usdPreviewSurface.png"
IMAGE_DIFF_COMPARE
usdPreviewSurface.png
Expand All @@ -3678,10 +3678,22 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.06
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialXBasic_mxGlass
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxGlass.usda -write mxGlass.png"
IMAGE_DIFF_COMPARE
mxGlass.png
FAIL 0.5
FAIL_PERCENT 0.005
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_basicMxYup
pxr_register_test(testUsdImagingGLMaterialXBasic_basicMxYup
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -stage basicMxYup.usda -camera /FrontCamera -write basicMxYup.png"
IMAGE_DIFF_COMPARE
basicMxYup.png
Expand All @@ -3690,10 +3702,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.0025
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_basicMxZup
pxr_register_test(testUsdImagingGLMaterialXBasic_basicMxZup
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -stage basicMxZup.usda -camera /FrontCamera -write basicMxZup.png"
IMAGE_DIFF_COMPARE
basicMxZup.png
Expand All @@ -3702,10 +3714,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.0025
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_mxDirectLights
pxr_register_test(testUsdImagingGLMaterialXBasic_mxDirectLights
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxDirectLights.usda -write mxDirectLights.png"
IMAGE_DIFF_COMPARE
mxDirectLights.png
Expand All @@ -3714,10 +3726,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.0025
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_mxDirectLightsCameraLight
pxr_register_test(testUsdImagingGLMaterialXBasic_mxDirectLightsCameraLight
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -camlight -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxDirectLights.usda -write mxDirectLightsCameraLight.png"
IMAGE_DIFF_COMPARE
mxDirectLightsCameraLight.png
Expand All @@ -3726,22 +3738,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.0025
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
)

pxr_register_test(testUsdImagingGLMaterialX_mxFallbackDome
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxFallbackDome.usda -write mxFallbackDome.png"
IMAGE_DIFF_COMPARE
mxFallbackDome.png
FAIL 0.5
FAIL_PERCENT 0.005
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

pxr_register_test(testUsdImagingGLMaterialX_mxLights
pxr_register_test(testUsdImagingGLMaterialXBasic_mxLights
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxLights.usda -write mxLights.png"
IMAGE_DIFF_COMPARE
mxLights.png
Expand All @@ -3750,10 +3750,17 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXBasic
)

# MaterialX materials using texture, texture coordinates, and geompropvalues.
pxr_install_test_dir(
SRC testenv/testUsdImagingGLMaterialXTextured
DEST testUsdImagingGLMaterialXTextured
)

pxr_register_test(testUsdImagingGLMaterialX_mxTextured

pxr_register_test(testUsdImagingGLMaterialXTextured_mxTextured
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxTextured.usda -write mxTextured.png"
IMAGE_DIFF_COMPARE
mxTextured.png
Expand All @@ -3762,10 +3769,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.05
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXTextured
)

pxr_register_test(testUsdImagingGLMaterialX_mxTextured2
pxr_register_test(testUsdImagingGLMaterialXTextured_mxTextured2
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxTextured2.usda -write mxTextured2.png"
IMAGE_DIFF_COMPARE
mxTextured2.png
Expand All @@ -3774,55 +3781,67 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT})
WARN 0.05
WARN_PERCENT 0.0025
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXTextured
)

pxr_register_test(testUsdImagingGLMaterialX_mxGlass
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxGlass.usda -write mxGlass.png"
pxr_register_test(testUsdImagingGLMaterialXTextured_mxGeomprop
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxGeomprop.usda -write mxGeomprop.png"
IMAGE_DIFF_COMPARE
mxGlass.png
mxGeomprop.png
FAIL 0.5
FAIL_PERCENT 0.005
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXTextured
)

pxr_register_test(testUsdImagingGLMaterialX_mxGeomprop
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxGeomprop.usda -write mxGeomprop.png"
pxr_register_test(testUsdImagingGLMaterialXTextured_mxTexcoord
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxTexcoord.usda -write mxTexcoord.png"
IMAGE_DIFF_COMPARE
mxGeomprop.png
mxTexcoord.png
FAIL 0.5
FAIL_PERCENT 0.005
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXTextured
)

pxr_register_test(testUsdImagingGLMaterialX_mxTexcoord
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxTexcoord.usda -write mxTexcoord.png"
pxr_register_test(testUsdImagingGLMaterialXTextured_mxDefaultTextureVals
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxDefaultTextureVals.usda -write mxDefaultTextureVals.png"
IMAGE_DIFF_COMPARE
mxTexcoord.png
mxDefaultTextureVals.png
FAIL 0.5
FAIL_PERCENT 0.005
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXTextured
)

pxr_register_test(testUsdImagingGLMaterialX_mxDefaultTextureVals
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxDefaultTextureVals.usda -write mxDefaultTextureVals.png"
pxr_register_test(testUsdImagingGLMaterialXTextured_mxFallbackDome
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxFallbackDome.usda -write mxFallbackDome.png"
IMAGE_DIFF_COMPARE
mxDefaultTextureVals.png
mxFallbackDome.png
FAIL 0.5
FAIL_PERCENT 0.005
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialX
TESTENV testUsdImagingGLMaterialXTextured
)

pxr_register_test(testUsdImagingGLMaterialXTextured_mxDefaultGemopropVal
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxDefaultGeompropVal.usda -write mxDefaultGeompropVal.png"
IMAGE_DIFF_COMPARE
mxDefaultGeompropVal.png
FAIL 0.5
FAIL_PERCENT 0.005
WARN 0.05
WARN_PERCENT 0.02
EXPECTED_RETURN_CODE 0
TESTENV testUsdImagingGLMaterialXTextured
)

pxr_register_test(testUsdImagingGLMaterialX_mxCustomNodeDef
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def Sphere "mxSphere" (
def Scope "Materials" {
def "MaterialX" (
references = [
@./standard_surface_nodes.mtlx@</MaterialX>,
@./mtlxFiles/standard_surface_nodes.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def Sphere "mxSphere" (
def Scope "Materials" {
def "MaterialX" (
references = [
@./standard_surface_nodes.mtlx@</MaterialX>,
@./mtlxFiles/standard_surface_nodes.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def Sphere "mxSphere" (
def Scope "Materials" {
def "MaterialX" (
references = [
@./standard_surface_default.mtlx@</MaterialX>,
@./mtlxFiles/standard_surface_default.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def Sphere "USD_Glass" (

def Scope "MaterialX" (
references = [
@./glass.mtlx@</MaterialX>,
@./mtlxFiles/glass.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def Sphere "UsdSphere" (
def Scope "Materials" {
def "MaterialX" (
references = [
@./standard_surface_default.mtlx@</MaterialX>,
@./mtlxFiles/standard_surface_default.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def Sphere "ball2" (
def Scope "Materials" {
def "MaterialX" (
references = [
@./standard_surface_default.mtlx@</MaterialX>,
@./mtlxFiles/standard_surface_default.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def Scope "Materials" {
def "MaterialX" (
references = [
# Standard Surface MaterialX Nodes
@./standard_surface_nodes.mtlx@</MaterialX>,
@./mtlxFiles/standard_surface_nodes.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def Sphere "ball3" (
def Scope "Materials" {
def "MaterialX" (
references = [
@./standard_surface_marble_nodes.mtlx@</MaterialX>,
@./mtlxFiles/standard_surface_marble_nodes.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def Scope "Materials" {
def "MaterialX" (
references = [
# USD Preview Surface MaterialX Nodes
@./usd_preview_surface_nodes.mtlx@</MaterialX>,
@./mtlxFiles/usd_preview_surface_nodes.mtlx@</MaterialX>,
]
)
{
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def "ImageCustomNodeDef" (
}

def Scope "MaterialX"(
references = @./customNodeDef_material.mtlx@</MaterialX>
references = @./mtlxFiles/customNodeDef_material.mtlx@</MaterialX>
)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def Scope "Materials"
{
def Scope "MaterialX" (
references = [
@./defaultGeompropVal.mtlx@</MaterialX>,
@./mtlxFiles/defaultGeompropVal.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def "TestMaterial" (

def Scope "MaterialX" (
references = [
@./textureTest.mtlx@</MaterialX>,
@./mtlxFiles/textureTest.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def "TestMaterial" (

def Scope "MaterialX" (
references = [
@./textureTest.mtlx@</MaterialX>,
@./mtlxFiles/textureTest.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def Scope "MaterialX" (
references = [
@./geomprop.mtlx@</MaterialX>,
@./mtlxFiles/geomprop.mtlx@</MaterialX>,
]
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def Scope "Materials" {

def Scope "MaterialX" (
references = [
@./texcoord.mtlx@</MaterialX>,
@./mtlxFiles/texcoord.mtlx@</MaterialX>,
]
)
{
Expand Down
Loading

0 comments on commit 6430162

Please sign in to comment.