Kaynağa Gözat

Updated MinimalMultilayerPBR to use nested property groups for better testing of nesting.

Signed-off-by: santorac <[email protected]>
santorac 3 yıl önce
ebeveyn
işleme
3ec386e385

+ 5 - 7
Materials/Types/MinimalMultilayerExample.material

@@ -3,24 +3,22 @@
     "materialTypeVersion": 1,
     "materialTypeVersion": 1,
     "propertyValues": {
     "propertyValues": {
         "blend.texture": "TestData/Textures/checker8x8_512.png",
         "blend.texture": "TestData/Textures/checker8x8_512.png",
-        "layer1.color": [
+        "layer1.baseColor.color": [
             1.0,
             1.0,
             0.7495536804199219,
             0.7495536804199219,
             0.3466697037220001,
             0.3466697037220001,
             1.0
             1.0
         ],
         ],
+        "layer1.baseColor.texture": "Textures/bricks_1k_basecolor.png",
         "layer1.metallic": 1.0,
         "layer1.metallic": 1.0,
         "layer1.roughness": 0.23000000417232513,
         "layer1.roughness": 0.23000000417232513,
-        "layer1.texture": "Textures/bricks_1k_basecolor.png",
-        "layer1.useTexture": true,
-        "layer2.color": [
+        "layer2.baseColor.color": [
             0.34021514654159546,
             0.34021514654159546,
             0.14996567368507385,
             0.14996567368507385,
             0.42177462577819824,
             0.42177462577819824,
             1.0
             1.0
         ],
         ],
-        "layer2.roughness": 0.8399999737739563,
-        "layer2.texture": "TestData/Textures/cc0/Concrete019_1K_Color.jpg",
-        "layer2.useTexture": true
+        "layer2.baseColor.texture": "TestData/Textures/cc0/Concrete019_1K_Color.jpg",
+        "layer2.roughness": 0.8399999737739563
     }
     }
 }
 }

+ 1 - 0
Materials/Types/MinimalMultilayerPBR.materialtype

@@ -6,6 +6,7 @@
             {
             {
                 "name": "blend",
                 "name": "blend",
                 "displayName": "Blend",
                 "displayName": "Blend",
+                "description": "Controls how the layers blend together.",
                 "properties": [
                 "properties": [
                     {
                     {
                         "name": "texture",
                         "name": "texture",

+ 44 - 33
Materials/Types/MinimalMultilayerPBR_LayerProperties.json

@@ -1,32 +1,10 @@
 {
 {
+    "description": "Settings that affect one layer of the multilayer material.",
     "properties": [
     "properties": [
-        {
-            "name": "color",
-            "displayName": "Color",
-            "type": "Color",
-            "defaultValue": [ 1.0, 1.0, 1.0 ],
-            "connection": {
-                "type": "ShaderInput",
-                "name": "baseColor"
-            }
-        },
-        {
-            "name": "texture",
-            "displayName": "Color Texture",
-            "type": "Image",
-            "connection": {
-                "type": "ShaderInput",
-                "name": "baseColorTexture"
-            }
-        },
-        {
-            "name": "useTexture",
-            "displayName": "Use Color Texture",
-            "type": "Bool"
-        },
         {
         {
             "name": "metallic",
             "name": "metallic",
             "displayName": "Metallic",
             "displayName": "Metallic",
+            "description": "Controls how metallic the surface appears.",
             "type": "Float",
             "type": "Float",
             "defaultValue": 0.0,
             "defaultValue": 0.0,
             "min": 0.0,
             "min": 0.0,
@@ -49,16 +27,49 @@
             }
             }
         }
         }
     ],
     ],
-    "functors": 
-    [
+    "propertyGroups": [
         {
         {
-            "type": "UseTexture",
-            "args": {
-                "textureProperty": "texture",
-                "useTextureProperty": "useTexture",
-                "shaderOption": "useBaseColorTexture"
-            }
+            "name": "baseColor",
+            "displayName": "Base Color",
+            "description": "Settings that control the diffuse color for non-metals or specular color for metals.",
+            "properties": [
+                {
+                    "name": "color",
+                    "displayName": "Color",
+                    "type": "Color",
+                    "defaultValue": [ 1.0, 1.0, 1.0 ],
+                    "connection": {
+                        "type": "ShaderInput",
+                        "name": "baseColor"
+                    }
+                },
+                {
+                    "name": "texture",
+                    "displayName": "Color Texture",
+                    "type": "Image",
+                    "connection": {
+                        "type": "ShaderInput",
+                        "name": "baseColorTexture"
+                    }
+                },
+                {
+                    "name": "useTexture",
+                    "displayName": "Use Color Texture",
+                    "type": "Bool",
+                    "defaultValue": true
+                }
+            ],
+            "functors": 
+            [
+                {
+                    "type": "UseTexture",
+                    "args": {
+                        "textureProperty": "texture",
+                        "useTextureProperty": "useTexture",
+                        "shaderOption": "useBaseColorTexture"
+                    }
+                }
+            ]
         }
         }
     ]
     ]
 }
 }
-