Răsfoiți Sursa

Added regression tests for material pipeline based materials for Standard and Enhanced lighting models.
Minor updates to the deferred material pipeline to work with recent changes on o3de.
Removed old unused MaterialEditorTest.materialtype.

Signed-off-by: santorac <[email protected]>

santorac 2 ani în urmă
părinte
comite
1e5fcea25a

+ 6 - 1
Materials/Pipelines/PrototypeDeferredPipeline/DeferredMaterialPass.azsli

@@ -5,6 +5,9 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
+ 
+//TODO(DeferredPOC): Support clear coat
+#define ENABLE_CLEAR_COAT 0
 
 #include <viewsrg.srgi>
 #include <Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli>
@@ -83,7 +86,9 @@ DeferredMaterialOutput MaterialPS(VSOutput IN)
     float metallic = 0.0;
     float specularF0Factor = 0.5f;
     surface.SetAlbedoAndSpecularF0(baseColor, specularF0Factor, metallic);
-    surface.clearCoat.InitializeToZero();
+
+    //TODO(DeferredPOC): Support clear coat
+    //surface.clearCoat.InitializeToZero();
 
     MaterialFunction_AdjustSurface(surface);
     

+ 1 - 1
Materials/Pipelines/PrototypeDeferredPipeline/DeferredMaterialPass.shader.template

@@ -1,5 +1,5 @@
 {
-    "Source" : "INSERT_AZSL_HERE",
+    "Source" : "INSERT_AZSL_PATH_HERE",
 
     "DepthStencilState" :
     {

+ 0 - 0
Scripts/ExpectedScreenshots/PrototypeDeferredPipeline/materialpipelinetest_basic_deferredpipeline.png → Scripts/ExpectedScreenshots/MaterialPipelineSystem/materialpipelinetest_basic_deferredpipeline.png


+ 3 - 0
Scripts/ExpectedScreenshots/MaterialPipelineSystem/materialpipelinetest_enhanced_deferredpipeline.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e419db67daf837b44e4bdd74b1138a4f2bb38c7824dd61d41edd5cee33e0fb13
+size 515291

+ 3 - 0
Scripts/ExpectedScreenshots/MaterialPipelineSystem/materialpipelinetest_enhanced_lowendpipeline.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:169fffed759e29b70a21ca9974bfcac77db80bea2624277dbd174e28706fa3e8
+size 400881

+ 3 - 0
Scripts/ExpectedScreenshots/MaterialPipelineSystem/materialpipelinetest_enhanced_mainpipeline.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e1623c8dcfbcb8e3fb8aeba2e4e63404b0979fa55f47d609b356418a351d3cb
+size 534101

+ 3 - 0
Scripts/ExpectedScreenshots/MaterialPipelineSystem/materialpipelinetest_standard_deferredpipeline.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cb89399e16a0d5cfb8f9287c4330d4c50c9da7e24029c5d728ab1cf6f3c2af5d
+size 629402

+ 3 - 0
Scripts/ExpectedScreenshots/MaterialPipelineSystem/materialpipelinetest_standard_lowendpipeline.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a9ed921c4a734b21434c45221c0a2f1d51efadad40f0815583b82212614bf9fd
+size 564540

+ 3 - 0
Scripts/ExpectedScreenshots/MaterialPipelineSystem/materialpipelinetest_standard_mainpipeline.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9798c3dc9410844fe4f31b185143d9af3aa5e5d325a1b38d3fe914760746d563
+size 683513

+ 14 - 16
Scripts/MaterialScreenshotTests.bv.lua

@@ -247,33 +247,31 @@ GenerateMaterialScreenshot('Level F', '009_Opacity_Blended', {lighting="Neutral
 
 SetImguiValue('Use Low End Pipeline', false)
 
-----------------------------------------------------------------------
--- Prototype Deferred Pipeline...
-
--- TODO: Switch this test case to use StandardPBR once it is ported to the material pipeline system.
-g_testMaterialsFolder = 'materials/materialpipelinetest/'
-g_testCaseFolder = 'PrototypeDeferredPipeline'
-Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder .. g_testCaseFolder))
-
-SetImguiValue('Use Deferred Pipeline', true)
-
-GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Basic', {screenshotFilename="MaterialPipelineTest_Basic_DeferredPipeline"})
-
-SetImguiValue('Use Deferred Pipeline', false)
-
 ----------------------------------------------------------------------
 -- Material Pipeline Abstraction...
 
--- These tests are temporary, specifically for regression testing the new material pipeline system while it is in development.
--- Once the core material types like StandardPBR are ported to use material pipelines, we can remove these test cases.
+-- These test materials are temporary, specifically for regression testing the new material pipeline system while it is in development.
+-- Once the core material types like StandardPBR are ported to use material pipelines, we can switch these over to use core material 
+-- types, and maybe remove some cases if they end up being redundant.
 
 g_testMaterialsFolder = 'materials/materialpipelinetest/'
 g_testCaseFolder = 'MaterialPipelineSystem'
 Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder .. g_testCaseFolder))
 
 SetImguiValue('Use Low End Pipeline', false)
+SetImguiValue('Use Deferred Pipeline', false)
 GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Basic', {screenshotFilename="MaterialPipelineTest_Basic_MainPipeline"})
+GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Standard', {screenshotFilename="MaterialPipelineTest_Standard_MainPipeline"})
+GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Enhanced', {screenshotFilename="MaterialPipelineTest_Enhanced_MainPipeline", lighting="Test"})
 
 SetImguiValue('Use Low End Pipeline', true)
 GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Basic', {screenshotFilename="MaterialPipelineTest_Basic_LowEndPipeline"})
+GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Standard', {screenshotFilename="MaterialPipelineTest_Standard_LowEndPipeline"})
+GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Enhanced', {screenshotFilename="MaterialPipelineTest_Enhanced_LowEndPipeline", lighting="Test"})
+SetImguiValue('Use Low End Pipeline', false)
 
+SetImguiValue('Use Deferred Pipeline', true)
+GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Basic', {screenshotFilename="MaterialPipelineTest_Basic_DeferredPipeline"})
+GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Standard', {screenshotFilename="MaterialPipelineTest_Standard_DeferredPipeline"})
+GenerateMaterialScreenshot('Level E', 'MaterialPipelineTest_Enhanced', {screenshotFilename="MaterialPipelineTest_Enhanced_DeferredPipeline", lighting="Test"})
+SetImguiValue('Use Deferred Pipeline', false)

+ 0 - 89
Shaders/MaterialEditorTest.materialtype

@@ -1,89 +0,0 @@
-{
-    "description": "Just collects some dummy fields for testing the material editor.",
-    "version": 1,
-    "propertyLayout": {
-        "groups": [
-            {
-                "id": "normal",
-                "displayName": "Normal Settings",
-                "description": "Properties for configuring the surface normals."
-            },
-            {
-                "id": "diffuse",
-                "displayName": "Diffuse Settings",
-                "description": "Properties for configuring the surface diffuse."
-            },
-            {
-                "id": "specular",
-                "displayName": "Specular Settings",
-                "description": "Properties for configuring the surface specular."
-            }
-        ],
-        "properties": {
-            "normal": [
-                {
-                    "id": "myBool",
-                    "displayName": "My Bool",
-                    "description": "This is a tooltip for MyBool",
-                    "type": "bool"
-                },
-                {
-                    "id": "myFloat",
-                    "displayName": "My Float",
-                    "description": "This is a tooltip for MyFloat",
-                    "type": "float"
-                },
-                {
-                    "id": "myVector2",
-                    "displayName": "My Vector2",
-                    "description": "This is a tooltip for MyVector2",
-                    "type": "vector2"
-                }
-            ],
-            "diffuse": [
-                {
-                    "id": "myInt",
-                    "displayName": "My Int",
-                    "description": "This is a tooltip for MyInt",
-                    "type": "int",
-                    "min": -100,
-                    "max": 100
-                },
-                {
-                    "id": "myColor",
-                    "displayName": "My Color",
-                    "description": "This is a tooltip for MyColor",
-                    "type": "color"
-                },
-                {
-                    "id": "myImage",
-                    "displayName": "My Image",
-                    "description": "This is a tooltip for MyImage",
-                    "type": "image"
-                }
-            ],
-            "specular": [
-                {
-                    "id": "myUInt",
-                    "displayName": "My UInt",
-                    "description": "This is a tooltip for MyUInt",
-                    "type": "uint",
-                    "max": 1000,
-                    "step": 5
-                },
-                {
-                    "id": "myVector3",
-                    "displayName": "My Vector3",
-                    "description": "This is a tooltip for MyVector3",
-                    "type": "vector3"
-                },
-                {
-                    "id": "myVector4",
-                    "displayName": "My Vector4",
-                    "description": "This is a tooltip for MyVector4",
-                    "type": "vector4"
-                }
-            ]
-        }
-    }
-}

+ 0 - 32
Shaders/MaterialEditorTest_default.material

@@ -1,32 +0,0 @@
-{
-    "materialType": "MaterialEditorTest.materialtype",
-    "materialTypeVersion": 1,
-    "propertyValues": {
-        "diffuse.myColor": [
-            1.0,
-            0.5,
-            0.5,
-            1.0
-        ],
-        "diffuse.myImage": "Textures/Streaming/streaming12.dds",
-        "diffuse.myInt": 10,
-        "normal.myBool": false,
-        "normal.myFloat": 0.5,
-        "normal.myVector2": [
-            0.10000000149011612,
-            0.20000000298023224
-        ],
-        "specular.myUInt": 20,
-        "specular.myVector3": [
-            0.30000001192092896,
-            0.4000000059604645,
-            0.5
-        ],
-        "specular.myVector4": [
-            0.6000000238418579,
-            0.699999988079071,
-            0.800000011920929,
-            0.8999999761581421
-        ]
-    }
-}