diff --git a/Runtime/Shaders/LayerSwitch8.shadersubgraph b/Runtime/Shaders/LayerSwitch8.shadersubgraph
index 9910b017cd84054a68c9a9e025337ef71e7d46cc..b8348c56fb2cde94bdc14917a9138ba01fe2cb7e 100644
--- a/Runtime/Shaders/LayerSwitch8.shadersubgraph
+++ b/Runtime/Shaders/LayerSwitch8.shadersubgraph
@@ -35,6 +35,9 @@
         },
         {
             "m_Id": "40c6d9e0a9f7402daa1d786fd95cbae6"
+        },
+        {
+            "m_Id": "876b12ee86204b4a99d055babddc5f8c"
         }
     ],
     "m_Keywords": [],
@@ -206,6 +209,12 @@
         },
         {
             "m_Id": "61c65efd79854eff8758fea3fbd2ef31"
+        },
+        {
+            "m_Id": "fcdd01ef1e8d4c3ea4b085becdfa1688"
+        },
+        {
+            "m_Id": "af1efc0f79f64715a029e20328c1c966"
         }
     ],
     "m_GroupDatas": [],
@@ -560,7 +569,7 @@
             },
             "m_InputSlot": {
                 "m_Node": {
-                    "m_Id": "f904bdadb77c4f0ca744f9639b48a2d2"
+                    "m_Id": "fcdd01ef1e8d4c3ea4b085becdfa1688"
                 },
                 "m_SlotId": 0
             }
@@ -803,6 +812,20 @@
                 "m_SlotId": 0
             }
         },
+        {
+            "m_OutputSlot": {
+                "m_Node": {
+                    "m_Id": "af1efc0f79f64715a029e20328c1c966"
+                },
+                "m_SlotId": 0
+            },
+            "m_InputSlot": {
+                "m_Node": {
+                    "m_Id": "fcdd01ef1e8d4c3ea4b085becdfa1688"
+                },
+                "m_SlotId": 1
+            }
+        },
         {
             "m_OutputSlot": {
                 "m_Node": {
@@ -1166,6 +1189,20 @@
                 },
                 "m_SlotId": 1
             }
+        },
+        {
+            "m_OutputSlot": {
+                "m_Node": {
+                    "m_Id": "fcdd01ef1e8d4c3ea4b085becdfa1688"
+                },
+                "m_SlotId": 2
+            },
+            "m_InputSlot": {
+                "m_Node": {
+                    "m_Id": "f904bdadb77c4f0ca744f9639b48a2d2"
+                },
+                "m_SlotId": 0
+            }
         }
     ],
     "m_VertexContext": {
@@ -1850,6 +1887,9 @@
         },
         {
             "m_Id": "40c6d9e0a9f7402daa1d786fd95cbae6"
+        },
+        {
+            "m_Id": "876b12ee86204b4a99d055babddc5f8c"
         }
     ]
 }
@@ -2334,6 +2374,21 @@
     "m_Labels": []
 }
 
+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
+    "m_ObjectId": "31733450ddf947cda85aff2c48c68ad6",
+    "m_Id": 0,
+    "m_DisplayName": "Tiling",
+    "m_SlotType": 1,
+    "m_Hidden": false,
+    "m_ShaderOutputName": "Out",
+    "m_StageCapability": 3,
+    "m_Value": 0.0,
+    "m_DefaultValue": 0.0,
+    "m_Labels": []
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
@@ -2639,9 +2694,9 @@
     "hlslDeclarationOverride": 0,
     "m_Hidden": false,
     "m_Value": {
-        "r": 1.0,
+        "r": 0.590446949005127,
         "g": 0.0,
-        "b": 0.8475146293640137,
+        "b": 1.0,
         "a": 1.0
     },
     "isMainColor": false,
@@ -3388,6 +3443,54 @@
     "m_Labels": []
 }
 
+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
+    "m_ObjectId": "5cdfb3221c1b452c8180ba15e6465094",
+    "m_Id": 2,
+    "m_DisplayName": "Out",
+    "m_SlotType": 1,
+    "m_Hidden": false,
+    "m_ShaderOutputName": "Out",
+    "m_StageCapability": 3,
+    "m_Value": {
+        "e00": 0.0,
+        "e01": 0.0,
+        "e02": 0.0,
+        "e03": 0.0,
+        "e10": 0.0,
+        "e11": 0.0,
+        "e12": 0.0,
+        "e13": 0.0,
+        "e20": 0.0,
+        "e21": 0.0,
+        "e22": 0.0,
+        "e23": 0.0,
+        "e30": 0.0,
+        "e31": 0.0,
+        "e32": 0.0,
+        "e33": 0.0
+    },
+    "m_DefaultValue": {
+        "e00": 1.0,
+        "e01": 0.0,
+        "e02": 0.0,
+        "e03": 0.0,
+        "e10": 0.0,
+        "e11": 1.0,
+        "e12": 0.0,
+        "e13": 0.0,
+        "e20": 0.0,
+        "e21": 0.0,
+        "e22": 1.0,
+        "e23": 0.0,
+        "e30": 0.0,
+        "e31": 0.0,
+        "e32": 0.0,
+        "e33": 1.0
+    }
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
@@ -3499,10 +3602,10 @@
         "m_Expanded": true,
         "m_Position": {
             "serializedVersion": "2",
-            "x": -3385.0,
+            "x": -3727.000244140625,
             "y": -546.0,
             "width": 208.0,
-            "height": 315.0
+            "height": 315.0000305175781
         }
     },
     "m_Slots": [
@@ -3616,6 +3719,54 @@
     "m_Labels": []
 }
 
+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
+    "m_ObjectId": "65191e64399a4781951fb53f8e8ddfeb",
+    "m_Id": 0,
+    "m_DisplayName": "A",
+    "m_SlotType": 0,
+    "m_Hidden": false,
+    "m_ShaderOutputName": "A",
+    "m_StageCapability": 3,
+    "m_Value": {
+        "e00": 0.0,
+        "e01": 0.0,
+        "e02": 0.0,
+        "e03": 0.0,
+        "e10": 0.0,
+        "e11": 0.0,
+        "e12": 0.0,
+        "e13": 0.0,
+        "e20": 0.0,
+        "e21": 0.0,
+        "e22": 0.0,
+        "e23": 0.0,
+        "e30": 0.0,
+        "e31": 0.0,
+        "e32": 0.0,
+        "e33": 0.0
+    },
+    "m_DefaultValue": {
+        "e00": 1.0,
+        "e01": 0.0,
+        "e02": 0.0,
+        "e03": 0.0,
+        "e10": 0.0,
+        "e11": 1.0,
+        "e12": 0.0,
+        "e13": 0.0,
+        "e20": 0.0,
+        "e21": 0.0,
+        "e22": 1.0,
+        "e23": 0.0,
+        "e30": 0.0,
+        "e31": 0.0,
+        "e32": 0.0,
+        "e33": 1.0
+    }
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot",
@@ -4259,6 +4410,33 @@
     }
 }
 
+{
+    "m_SGVersion": 1,
+    "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
+    "m_ObjectId": "876b12ee86204b4a99d055babddc5f8c",
+    "m_Guid": {
+        "m_GuidSerialized": "c942f79f-4c25-466c-bbc0-5c3969223ec9"
+    },
+    "m_Name": "Tiling",
+    "m_DefaultRefNameVersion": 1,
+    "m_RefNameGeneratedByDisplayName": "Tiling",
+    "m_DefaultReferenceName": "_Tiling",
+    "m_OverrideReferenceName": "",
+    "m_GeneratePropertyBlock": true,
+    "m_UseCustomSlotLabel": false,
+    "m_CustomSlotLabel": "",
+    "m_Precision": 0,
+    "overrideHLSLDeclaration": false,
+    "hlslDeclarationOverride": 0,
+    "m_Hidden": false,
+    "m_Value": 0.0,
+    "m_FloatType": 0,
+    "m_RangeValues": {
+        "x": 0.0,
+        "y": 1.0
+    }
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
@@ -5141,6 +5319,41 @@
     "m_ComparisonType": 2
 }
 
+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.PropertyNode",
+    "m_ObjectId": "af1efc0f79f64715a029e20328c1c966",
+    "m_Group": {
+        "m_Id": ""
+    },
+    "m_Name": "Property",
+    "m_DrawState": {
+        "m_Expanded": true,
+        "m_Position": {
+            "serializedVersion": "2",
+            "x": -3571.000244140625,
+            "y": -696.0,
+            "width": 104.0,
+            "height": 33.99993896484375
+        }
+    },
+    "m_Slots": [
+        {
+            "m_Id": "31733450ddf947cda85aff2c48c68ad6"
+        }
+    ],
+    "synonyms": [],
+    "m_Precision": 0,
+    "m_PreviewExpanded": true,
+    "m_PreviewMode": 0,
+    "m_CustomColors": {
+        "m_SerializableColors": []
+    },
+    "m_Property": {
+        "m_Id": "876b12ee86204b4a99d055babddc5f8c"
+    }
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
@@ -5720,6 +5933,54 @@
     "m_DefaultType": 0
 }
 
+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
+    "m_ObjectId": "c8effe2a546849f2b9ea54a27bb568a5",
+    "m_Id": 1,
+    "m_DisplayName": "B",
+    "m_SlotType": 0,
+    "m_Hidden": false,
+    "m_ShaderOutputName": "B",
+    "m_StageCapability": 3,
+    "m_Value": {
+        "e00": 2.0,
+        "e01": 2.0,
+        "e02": 2.0,
+        "e03": 2.0,
+        "e10": 2.0,
+        "e11": 2.0,
+        "e12": 2.0,
+        "e13": 2.0,
+        "e20": 2.0,
+        "e21": 2.0,
+        "e22": 2.0,
+        "e23": 2.0,
+        "e30": 2.0,
+        "e31": 2.0,
+        "e32": 2.0,
+        "e33": 2.0
+    },
+    "m_DefaultValue": {
+        "e00": 1.0,
+        "e01": 0.0,
+        "e02": 0.0,
+        "e03": 0.0,
+        "e10": 0.0,
+        "e11": 1.0,
+        "e12": 0.0,
+        "e13": 0.0,
+        "e20": 0.0,
+        "e21": 0.0,
+        "e22": 1.0,
+        "e23": 0.0,
+        "e30": 0.0,
+        "e31": 0.0,
+        "e32": 0.0,
+        "e33": 1.0
+    }
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
@@ -6960,6 +7221,48 @@
     "m_DefaultType": 0
 }
 
+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.MultiplyNode",
+    "m_ObjectId": "fcdd01ef1e8d4c3ea4b085becdfa1688",
+    "m_Group": {
+        "m_Id": ""
+    },
+    "m_Name": "Multiply",
+    "m_DrawState": {
+        "m_Expanded": true,
+        "m_Position": {
+            "serializedVersion": "2",
+            "x": -3368.000244140625,
+            "y": -662.0,
+            "width": 208.0,
+            "height": 302.0000305175781
+        }
+    },
+    "m_Slots": [
+        {
+            "m_Id": "65191e64399a4781951fb53f8e8ddfeb"
+        },
+        {
+            "m_Id": "c8effe2a546849f2b9ea54a27bb568a5"
+        },
+        {
+            "m_Id": "5cdfb3221c1b452c8180ba15e6465094"
+        }
+    ],
+    "synonyms": [
+        "multiplication",
+        "times",
+        "x"
+    ],
+    "m_Precision": 0,
+    "m_PreviewExpanded": true,
+    "m_PreviewMode": 0,
+    "m_CustomColors": {
+        "m_SerializableColors": []
+    }
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot",
diff --git a/Runtime/Shaders/TerrainMaterial4.mat b/Runtime/Shaders/TerrainMaterial4.mat
deleted file mode 100644
index d22af8d706f5ee7c9f4364b92bd8a5f5582bd611..0000000000000000000000000000000000000000
--- a/Runtime/Shaders/TerrainMaterial4.mat
+++ /dev/null
@@ -1,137 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!114 &-5815873368556989248
-MonoBehaviour:
-  m_ObjectHideFlags: 11
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 0}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  version: 12
-  hdPluginSubTargetMaterialVersions:
-    m_Keys: []
-    m_Values: 
---- !u!21 &2100000
-Material:
-  serializedVersion: 8
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_Name: TerrainMaterial4
-  m_Shader: {fileID: -6465566751694194690, guid: a5dd71e70127f7749a88744b32ca8625,
-    type: 3}
-  m_ValidKeywords:
-  - _DISABLE_SSR_TRANSPARENT
-  m_InvalidKeywords: []
-  m_LightmapFlags: 4
-  m_EnableInstancingVariants: 0
-  m_DoubleSidedGI: 0
-  m_CustomRenderQueue: 2225
-  stringTagMap:
-    MotionVector: User
-  disabledShaderPasses:
-  - TransparentDepthPrepass
-  - TransparentDepthPostpass
-  - TransparentBackface
-  - RayTracingPrepass
-  - MOTIONVECTORS
-  m_SavedProperties:
-    serializedVersion: 3
-    m_TexEnvs:
-    - AlbedoMaps:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - ControlTexture:
-        m_Texture: {fileID: 2800000, guid: 41328c44ccd76e649bf625b65348de33, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - NormalMaps:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - TextureArray:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - unity_Lightmaps:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - unity_LightmapsInd:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - unity_ShadowMasks:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    m_Ints: []
-    m_Floats:
-    - _AddPrecomputedVelocity: 0
-    - _AlphaCutoffEnable: 0
-    - _AlphaDstBlend: 0
-    - _AlphaSrcBlend: 1
-    - _AlphaToMask: 0
-    - _AlphaToMaskInspectorValue: 0
-    - _BlendMode: 0
-    - _ConservativeDepthOffsetEnable: 0
-    - _CullMode: 2
-    - _CullModeForward: 2
-    - _DepthOffsetEnable: 0
-    - _DoubleSidedEnable: 0
-    - _DoubleSidedGIMode: 0
-    - _DoubleSidedNormalMode: 2
-    - _DstBlend: 0
-    - _EnableBlendModePreserveSpecularLighting: 1
-    - _EnableFogOnTransparent: 1
-    - _OpaqueCullMode: 2
-    - _RayTracing: 0
-    - _ReceivesSSR: 1
-    - _ReceivesSSRTransparent: 0
-    - _RefractionModel: 0
-    - _RenderQueueType: 1
-    - _RequireSplitLighting: 0
-    - _SrcBlend: 1
-    - _StencilRef: 0
-    - _StencilRefDepth: 8
-    - _StencilRefDistortionVec: 4
-    - _StencilRefGBuffer: 10
-    - _StencilRefMV: 40
-    - _StencilWriteMask: 6
-    - _StencilWriteMaskDepth: 8
-    - _StencilWriteMaskDistortionVec: 4
-    - _StencilWriteMaskGBuffer: 14
-    - _StencilWriteMaskMV: 40
-    - _SupportDecals: 1
-    - _SurfaceType: 0
-    - _TesselationFactor: 40
-    - _TessellationBackFaceCullEpsilon: -0.25
-    - _TessellationFactorMaxDistance: 300
-    - _TessellationFactorMinDistance: 0
-    - _TessellationFactorTriangleSize: 1
-    - _TessellationMaxDisplacement: 10
-    - _TessellationMode: 0
-    - _TessellationShapeFactor: 0.75
-    - _TransparentBackfaceEnable: 0
-    - _TransparentCullMode: 2
-    - _TransparentDepthPostpassEnable: 0
-    - _TransparentDepthPrepassEnable: 0
-    - _TransparentSortPriority: 0
-    - _TransparentWritingMotionVec: 0
-    - _TransparentZWrite: 0
-    - _UseShadowThreshold: 0
-    - _ZTestDepthEqualForOpaque: 3
-    - _ZTestGBuffer: 4
-    - _ZTestTransparent: 4
-    - _ZWrite: 1
-    m_Colors:
-    - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
-    - _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
-  m_BuildTextureStacks: []
diff --git a/Runtime/Shaders/TerrainMaterial4.mat.meta b/Runtime/Shaders/TerrainMaterial4.mat.meta
deleted file mode 100644
index 4e74c20e064979c3227d9afb611220770e83bd04..0000000000000000000000000000000000000000
--- a/Runtime/Shaders/TerrainMaterial4.mat.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: bd83ae6778c76cb45b79b1e65bacc725
-NativeFormatImporter:
-  externalObjects: {}
-  mainObjectFileID: 2100000
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
diff --git a/Runtime/Shaders/TerrainMaterial8.mat b/Runtime/Shaders/TerrainMaterial8.mat
index 086e30504b7cf032319957fc6e5ea983f5bf8931..ec96083c18c28d07f7478f4bae8fcd68cc103be9 100644
--- a/Runtime/Shaders/TerrainMaterial8.mat
+++ b/Runtime/Shaders/TerrainMaterial8.mat
@@ -45,35 +45,35 @@ Material:
     serializedVersion: 3
     m_TexEnvs:
     - Albedo0:
-        m_Texture: {fileID: 0}
+        m_Texture: {fileID: 2800000, guid: 6750646421d4f8e4f859133bd4fa98df, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - Albedo1:
-        m_Texture: {fileID: 0}
+        m_Texture: {fileID: 2800000, guid: 1186476173fcd994d9df404282debc6f, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - Albedo2:
-        m_Texture: {fileID: 0}
+        m_Texture: {fileID: 2800000, guid: 1a7d9a6002608b342bde613de3f92a61, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - Albedo3:
-        m_Texture: {fileID: 0}
+        m_Texture: {fileID: 2800000, guid: 9534db908d9a3d1478a85403cf414f8a, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - Albedo4:
-        m_Texture: {fileID: 0}
+        m_Texture: {fileID: 2800000, guid: 46c9b2c471a59f24cbe88eae93a32f60, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - Albedo5:
-        m_Texture: {fileID: 0}
+        m_Texture: {fileID: 2800000, guid: 34625fdce6a77a543804361b473cd27b, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - Albedo6:
-        m_Texture: {fileID: 0}
+        m_Texture: {fileID: 2800000, guid: 133dc91bc0027424f846f4cff389cb9f, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - Albedo7:
-        m_Texture: {fileID: 0}
+        m_Texture: {fileID: 2800000, guid: f0a8168310b10da4faedc474bb26c20f, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - AlbedoMaps:
@@ -81,7 +81,7 @@ Material:
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - ControlTexture:
-        m_Texture: {fileID: 2800000, guid: 41328c44ccd76e649bf625b65348de33, type: 3}
+        m_Texture: {fileID: 0}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - NormalMaps:
diff --git a/Runtime/Shaders/TerrainShader8.shadergraph b/Runtime/Shaders/TerrainShader8.shadergraph
index 30833452561f0ee04d7d24ae53bdd2dbd57ba38e..bb4f5bcd2186d0e21e29d10bef5129c0bf52f0a8 100644
--- a/Runtime/Shaders/TerrainShader8.shadergraph
+++ b/Runtime/Shaders/TerrainShader8.shadergraph
@@ -814,10 +814,10 @@
         "m_Expanded": true,
         "m_Position": {
             "serializedVersion": "2",
-            "x": -2562.0,
-            "y": 7.000010967254639,
+            "x": -2534.0,
+            "y": -22.0,
             "width": 219.0,
-            "height": 517.9999389648438
+            "height": 518.0
         }
     },
     "m_Slots": [
@@ -854,6 +854,9 @@
         {
             "m_Id": "229010c9165c4e63bd3e6ba1e93775f6"
         },
+        {
+            "m_Id": "72fd075d908e47fd96be8ea9a361cb15"
+        },
         {
             "m_Id": "9d7594ad37bd45819df711cf8c24e444"
         }
@@ -877,7 +880,8 @@
         "f32da0b6-f87b-4a06-bd93-f9c3f96f7915",
         "71b21a08-90b9-4b63-98dd-91931be6d168",
         "22468938-8f1d-49b0-9629-9fa1449a26d7",
-        "d7cde703-663a-481c-92e6-1355e3579dec"
+        "d7cde703-663a-481c-92e6-1355e3579dec",
+        "c942f79f-4c25-466c-bbc0-5c3969223ec9"
     ],
     "m_PropertyIds": [
         -846562862,
@@ -890,7 +894,8 @@
         1873519753,
         -1047416526,
         491763191,
-        643772488
+        643772488,
+        2135710056
     ],
     "m_Dropdowns": [],
     "m_DropdownSelectedEntries": []
@@ -1234,7 +1239,7 @@
     "m_CustomColors": {
         "m_SerializableColors": []
     },
-    "m_filter": 2,
+    "m_filter": 0,
     "m_wrap": 0,
     "m_aniso": 0
 }
@@ -1279,7 +1284,7 @@
     "hlslDeclarationOverride": 0,
     "m_Hidden": false,
     "m_Value": {
-        "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
+        "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"c27cc595898fcde4d904c3c990baa298\",\"type\":3}}",
         "m_Guid": ""
     },
     "isMainTexture": false,
@@ -1288,6 +1293,21 @@
     "m_DefaultType": 0
 }
 
+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
+    "m_ObjectId": "72fd075d908e47fd96be8ea9a361cb15",
+    "m_Id": 2135710056,
+    "m_DisplayName": "Tiling",
+    "m_SlotType": 0,
+    "m_Hidden": false,
+    "m_ShaderOutputName": "_Tiling",
+    "m_StageCapability": 2,
+    "m_Value": 0.0,
+    "m_DefaultValue": 0.0,
+    "m_Labels": []
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.PropertyNode",
@@ -1679,7 +1699,7 @@
     "hlslDeclarationOverride": 0,
     "m_Hidden": false,
     "m_Value": {
-        "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
+        "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"41b4bc172c64fe340ba099cc288e93d0\",\"type\":3}}",
         "m_Guid": ""
     },
     "isMainTexture": false,
@@ -1699,9 +1719,9 @@
     "m_ShaderOutputName": "BaseColor",
     "m_StageCapability": 2,
     "m_Value": {
-        "x": 0.5,
-        "y": 0.5,
-        "z": 0.5
+        "x": 0.8867924213409424,
+        "y": 0.871586799621582,
+        "z": 0.5981665849685669
     },
     "m_DefaultValue": {
         "x": 0.0,
diff --git a/Runtime/TerrainBuilder.cs b/Runtime/TerrainBuilder.cs
index 9d064a017a1c8b3072165271ac379893fa86d561..2bb58480fe01308d74fd3a1658610f2f8d321b89 100644
--- a/Runtime/TerrainBuilder.cs
+++ b/Runtime/TerrainBuilder.cs
@@ -2,6 +2,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
+using System.Threading.Tasks;
 using UnityEditor;
 using UnityEngine;
 using UnityEngine.Networking;
@@ -15,10 +16,9 @@ namespace Wander
         internal int deltaTileY;
         internal UnityWebRequest www;
         internal Texture2D texture;
-        internal Action<MapTile> callback;
     }
 
-    [System.Serializable]
+    [Serializable]
     public struct TerrainLayer2
     {
         public TerrainLayer layer;
@@ -28,34 +28,31 @@ namespace Wander
     [ExecuteAlways()]
     public class TerrainBuilder : MonoBehaviour
     {
-        public enum MapType
-        {
-            Trees,
-            BGT_achtergrond,
-            BGT_standaard,
-            BRT
-        }
+        public Vector2 originWGS84   = new Vector2(51.985365f, 5.664941f); // Copy directly from Google maps. This is Forum on Campus WUR.
+        public int controlResolution = 8192;
+        public float height          = 300;
+        public int zoom              = 11;
+        public int numDLRetries      = 5;
+        public bool runOnStart       = false;
+        public Material terrainMat   = null;
 
-        public List<TerrainLayer2> layers;
-
-        public MapType mapType;
-        public bool runOnStart = false;
-
-        public Material terrainMat  = null;
-        public Vector2 originRD     = new Vector2(174041, 444126);
-        public Vector3 size         = new Vector3(500, 300, 500);
-        public int zoom             = 11;
-        public int numTileDownloadRetries = 5;
+        [ReadOnly]
+        public Texture2D controlTexture;
+        public List<TerrainLayer2> layers;
 
         private Vector2Int tileOrigin;
         private Vector3 adjustedSize;
         private double tileSize;
+        private int tilePixelSize;
         private int nTilesWide;
         private int nTilesHigh;
         private TerrainData terrainData;
         private Terrain terrain;
         private List<MapTile> requests;
+        private byte[] controlData;
+        private Dictionary<uint, byte> pixelToLayerIndex;
 
+        private bool isRunning;
 
         private void Start()
         {
@@ -71,26 +68,100 @@ namespace Wander
 
         internal void Cancel()
         {
-            StopAllCoroutines();
-            requests = new List<MapTile>();
+            requests = null;
+            controlData = null;
+            controlTexture = null;
+            isRunning = false;
         }
 
         internal void Build()
         {
             Cancel();
-            CalcPreliminaries();
-            DownloadTiles();
-            CreateTerrainData();
-            StartCoroutine( CheckDownloadRequests() );
+         //   try
+            {
+                controlData = new byte[controlResolution*controlResolution];
+                CalcPreliminaries();
+                CreatePixelToLayerIndex();
+                DownloadTiles();
+                CreateTerrainData();
+                LinkLayersToMaterial();
+                isRunning = true;
+            }
+            //finally
+            //{
+            //    Cancel();
+            //}
+        }
+
+        void Update()
+        {
+            if (isRunning)
+            {
+                CheckDownloadRequests();
+                FlashControlTexture();
+            }
         }
 
         void CalcPreliminaries()
         {
-            tileOrigin   = RDUtils.RD2Tile( originRD, zoom );
-            tileSize     = RDUtils.CalcTileSizeRD(zoom);
-            nTilesWide   = Mathf.CeilToInt( (float)( size.x / tileSize ) );
-            nTilesHigh   = Mathf.CeilToInt( (float)( size.z / tileSize ) );
-            adjustedSize = new Vector3((float)(nTilesWide*tileSize), size.y, (float)(nTilesHigh*tileSize));
+            if (controlResolution % RDUtils.RDDefaultTileRes != 0)
+            {
+                Debug.LogError( "Control resolution must be multiple of 256" );
+                return;
+            }
+
+            RDUtils.GPS2RD( originWGS84.x, originWGS84.y, out double rdX, out double rdY );
+            tileOrigin    = RDUtils.RD2Tile( new Vector2( (float)rdX, (float)rdY ), zoom );
+            tileSize      = RDUtils.CalcTileSizeRD( zoom );
+            tilePixelSize = RDUtils.RDDefaultTileRes;
+            nTilesWide    = controlResolution / tilePixelSize;
+            nTilesHigh    = controlResolution / tilePixelSize;
+            adjustedSize  = new Vector3( (float)(nTilesWide*tileSize), height, (float)(nTilesHigh*tileSize) );
+        }
+
+        void CreatePixelToLayerIndex()
+        {
+            if (layers == null || layers.Count == 0)
+            {
+                Debug.LogWarning( "No layers specified!" );
+                return;
+            }
+            pixelToLayerIndex = new Dictionary<uint, byte>();
+            for (int i = 0;i< layers.Count;i++)
+            {
+                var l = layers[i];
+                if (l.colors == null || l.colors.Length == 0)
+                {
+                    Debug.LogWarning( $"Layer {i} has no colors specified!" );
+                }
+                for (int j = 0;j < l.colors.Length;j++)
+                {
+                    Color32 c    = l.colors[j];
+                    uint colMask = ((uint)c.r<<16) | ((uint)c.g<<8) | (c.b);
+                    if (!pixelToLayerIndex.TryGetValue( colMask, out byte usedLayerIdx ))
+                    {
+                        pixelToLayerIndex[colMask] = (byte)i;
+                    }
+                    else
+                    {
+                        Debug.LogWarning( $"Color {j} from layer {i} has already been used in layer {usedLayerIdx}." );
+                    }
+                }
+            }
+        }
+
+        void LinkLayersToMaterial()
+        {
+            if (layers == null || layers.Count == 0)
+            {
+                Debug.LogWarning( "No layers specified!" );
+                return;
+            }
+            for (int i = 0;i< layers.Count;i++)
+            {
+                var l = layers[i];
+                terrain.materialTemplate.SetTexture( "Albedo" + i, l.layer.diffuseTexture );
+            }
         }
 
         void CreateTerrainData()
@@ -107,6 +178,7 @@ namespace Wander
 
             go.AddComponent<TerrainCollider>().terrainData = terrainData;
         }
+
         internal void SyncLayersToMaterial()
         {
             Texture2DArray albedoArray = new Texture2DArray(4, 4, 4, TextureFormat.RGB24, 5, false);
@@ -120,20 +192,20 @@ namespace Wander
         {
             int res = terrainData.alphamapResolution;
             float [,,] splatMap = terrainData.GetAlphamaps( 0, 0, res, res );
-            if ( splatMap.GetLength(2) == 0 )
+            if (splatMap.GetLength( 2 ) == 0)
                 return;
             Texture2D controlTex = new Texture2D(res, res, TextureFormat.R8, false );
             byte [] textureIndexArray = new byte[res*res];
-            for (int x = 0; x < res; x++ )
+            for (int x = 0;x < res;x++)
             {
-                for (int y=0; y < res; y++ )
+                for (int y = 0;y < res;y++)
                 {
                     float max = splatMap[x,y, 0];
                     byte chosenIndex = 0;
-                    for ( int texIdx = 1; texIdx < splatMap.GetLength(2); texIdx++ )
+                    for (int texIdx = 1;texIdx < splatMap.GetLength( 2 );texIdx++)
                     {
                         float d = splatMap[x,y,texIdx];
-                        if ( d > max )
+                        if (d > max)
                         {
                             max = d;
                             chosenIndex = (byte)texIdx;
@@ -147,60 +219,47 @@ namespace Wander
             terrain.materialTemplate.SetTexture( "ControlTexture", controlTex );
         }
 
-        void ApplyTileOntoTerrain( MapTile tile )
+        void WriteTileToControlTexture( MapTile tile )
         {
-            //float[,,] map = new float[t.terrainData.alphamapWidth, t.terrainData.alphamapHeight, 2];
-
-            //// For each point on the alphamap...
-            //for (int y = 0;y < t.terrainData.alphamapHeight;y++)
-            //{
-            //    for (int x = 0;x < t.terrainData.alphamapWidth;x++)
-            //    {
-            //        // Get the normalized terrain coordinate that
-            //        // corresponds to the point.
-            //        float normX = x * 1.0f / (t.terrainData.alphamapWidth - 1);
-            //        float normY = y * 1.0f / (t.terrainData.alphamapHeight - 1);
-
-            //        // Get the steepness value at the normalized coordinate.
-            //        var angle = t.terrainData.GetSteepness(normX, normY);
-
-            //        // Steepness is given as an angle, 0..90 degrees. Divide
-            //        // by 90 to get an alpha blending value in the range 0..1.
-            //        var frac = angle / 90.0;
-            //        map[x, y, 0] = (float)frac;
-            //        map[x, y, 1] = (float)(1 - frac);
-            //    }
-            //}
-            //terrain.
-            //t.terrainData.SetAlphamaps( 0, 0, map );
+            var pixelData = tile.texture.GetPixelData<Color32>( 0 );
+            var height = tile.texture.height;
+            var width  = tile.texture.width;
+            byte layerIndex   = 255;
+            uint cachedMask   = 0;
+            int x2 = tile.deltaTileX * tilePixelSize;
+            int y2 = tile.deltaTileY * tilePixelSize;
+            for (int y = 0;y < height;y++)
+            {
+                for (int x = 0;x < width;x++)
+                {
+                    Color32 col  = pixelData[y*width+x];
+                    uint colMask = ((uint)col.a<<16) | ((uint)col.b<<8) | (col.g); // Color is reversed in memory. So RGBA = ABGR.
+                    if ( cachedMask!=colMask || layerIndex==255 )
+                    {
+                        if (!pixelToLayerIndex.TryGetValue( colMask, out layerIndex ))
+                        {
+                            layerIndex=255;
+                        }
+                        cachedMask = colMask;
+                    }
+                    controlData[(y2 + y) * controlResolution + (x2+x)] = layerIndex;
+                }
+            }
         }
 
-        string GetMapUrl(int tileX, int tileY, int zoom)
+        string GetMapUrl( int tileX, int tileY, int zoom )
         {
-            string url = "";
-            switch( mapType )
-            {
-                case MapType.BGT_achtergrond:
-                    url = $"https://service.pdok.nl/lv/bgt/wmts/v1_0/achtergrondvisualisatie/EPSG:28992/{zoom}/{tileX}/{tileY}.png";
-                    break;
-                case MapType.BGT_standaard:
-                    url = $"https://service.pdok.nl/lv/bgt/wmts/v1_0/standaardvisualisatie/EPSG:28992/{zoom}/{tileX}/{tileY}.png";
-                    break;
-                case MapType.BRT:
-                    url = $"https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0?layer=standaard&style=default&tilematrixset=EPSG:28992&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/Fpng&TileMatrix=EPSG:28992:{zoom}&TileCol={tileX}&TileRow={tileY}";
-                    break;
-                case MapType.Trees:
-                    url = $"https://services.geodan.nl/data/geodan/gws/nld/landuse/wmts?layer=trees&style=default&tilematrixset=EPSG:28992&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TileMatrix={zoom}&TileCol={tileX}&TileRow={tileY}&servicekey=b28cce8a-abe7-11e6-84a1-005056805b87";
-                    break;
-            }
+            // $"https://service.pdok.nl/lv/bgt/wmts/v1_0/achtergrondvisualisatie/EPSG:28992/{zoom}/{tileX}/{tileY}.png";
+            var url = $"https://service.pdok.nl/lv/bgt/wmts/v1_0/standaardvisualisatie/EPSG:28992/{zoom}/{tileX}/{tileY}.png";
             return url;
         }
 
         void DownloadTiles()
         {
-            for (int x = 0; x < nTilesWide; x++ )
+            requests = new List<MapTile>();
+            for (int x = 0;x < nTilesWide;x++)
             {
-                for (int y = 0; y < nTilesHigh; y++ )
+                for (int y = 0;y < nTilesHigh;y++)
                 {
                     int tileX  = x + tileOrigin.x;
                     int tileY  = y + tileOrigin.y;
@@ -210,61 +269,62 @@ namespace Wander
                     MapTile td = new MapTile();
                     td.www = www;
                     td.deltaTileX = x;
-                    td.deltaTileY = -y;
-                    td.callback   = ApplyTileOntoTerrain;
+                    td.deltaTileY = y;
                     requests.Add( td );
                 }
             }
         }
 
-        IEnumerator CheckDownloadRequests()
+        void CheckDownloadRequests()
         {
-            while(true)
+            if (requests==null)
+                return;
+
+            float tileSize = (float) RDUtils.CalcTileSizeRD(zoom);
+            for (int i = 0;i < requests.Count;i++)
             {
-                float tileSize = (float) RDUtils.CalcTileSizeRD(zoom);
-                for (int i = 0;i < requests.Count;i++)
+                var tile = requests[i];
+                var www = tile.www;
+                if (www.isDone)
                 {
-                    var tile = requests[i];
-                    var www = tile.www;
-                    if (www.isDone)
+                    if (www.result != UnityWebRequest.Result.Success)
                     {
-                        if (www.result != UnityWebRequest.Result.Success)
+                        Debug.Log( www.error );
+                        if (tile.numRetries < numDLRetries)
                         {
-                            Debug.Log( www.error );
-                            if (tile.numRetries < numTileDownloadRetries)
-                            {
-                                tile.numRetries++;
-                                tile.www = UnityWebRequestTexture.GetTexture( www.url );
-                                tile.www.SendWebRequest();
-                                requests[i] = tile;
-                            }
-                            else
-                            {
-                                requests.RemoveAt( i );
-                                i--;
-                            }
+                            tile.numRetries++;
+                            tile.www = UnityWebRequestTexture.GetTexture( www.url );
+                            tile.www.SendWebRequest();
+                            requests[i] = tile;
                         }
                         else
                         {
-                            tile.texture = ((DownloadHandlerTexture)www.downloadHandler).texture;
-                            if (tile.callback!=null)
-                            {
-                                tile.callback(tile);
-                            }
                             requests.RemoveAt( i );
                             i--;
                         }
                     }
+                    else
+                    {
+                        tile.texture = ((DownloadHandlerTexture)www.downloadHandler).texture;
+                        WriteTileToControlTexture( tile );
+                        FlashControlTexture();
+                        requests.RemoveAt( i );
+                        i--;
+                    }
                 }
+            }
+        }
 
-                if (requests.Count == 0)
-                    yield break;
-
-               // yield return null;
-                yield return new WaitForSeconds( 0.2f );
+        void FlashControlTexture()
+        {
+            if (controlTexture == null)
+            {
+                controlTexture = new Texture2D( controlResolution, controlResolution, TextureFormat.R8, false );
+                terrain.materialTemplate.SetTexture( "ControlTexture", controlTexture );
             }
-
-        }
+            controlTexture.SetPixelData( controlData, 0, 0 );
+            controlTexture.Apply( false, false );
+        }            
     }
 
 #if UNITY_EDITOR
@@ -276,8 +336,7 @@ namespace Wander
         {
             TerrainBuilder builder = (TerrainBuilder)target;
 
-          //  EditorGUILayout.HelpBox( "If the 'Tree setup' section is changed, cached meshes may not load back correctly, because the tree structure is not cached to disk. Always clear cache if altering the 'Tree setup'. This is not needed if 'Cache Meshes To Scene' is unticked.", MessageType.Warning, true );
-
+            EditorGUILayout.HelpBox( "Copy coordinates from Google maps by clicking a location into WGS84.", MessageType.Info, true );
 
             GUILayout.BeginHorizontal();
             {
diff --git a/Runtime/Textures/test_input.png b/Runtime/Textures/test_input.png
index 86807055b26f0cbf38a9e027ef2ecc17107ee5fc..32ee96fea5f5df53333e040649277a2f039c3b0d 100644
--- a/Runtime/Textures/test_input.png
+++ b/Runtime/Textures/test_input.png
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:3606173f672569d6c4b9cc6558b63a907b047b6045d40843746f41d5a60680fd
-size 903
+oid sha256:513eea7b82448af88f61327e2bc4ba6b23c6b9a0e56206c4afa1f7a346636994
+size 280294
diff --git a/Runtime/Textures/test_input.png.meta b/Runtime/Textures/test_input.png.meta
index fb915d76e219db7018824e5385e5a49c3abba0b9..9242a3c62dc0b9611f4181ff49fd28ddb8ef05ad 100644
--- a/Runtime/Textures/test_input.png.meta
+++ b/Runtime/Textures/test_input.png.meta
@@ -6,7 +6,7 @@ TextureImporter:
   serializedVersion: 12
   mipmaps:
     mipMapMode: 0
-    enableMipMap: 1
+    enableMipMap: 0
     sRGBTexture: 0
     linearTexture: 0
     fadeOut: 0
@@ -50,7 +50,7 @@ TextureImporter:
   spritePixelsToUnits: 100
   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
   spriteGenerateFallbackPhysicsShape: 1
-  alphaUsage: 1
+  alphaUsage: 0
   alphaIsTransparency: 0
   spriteTessellationDetail: -1
   textureType: 0
@@ -61,7 +61,7 @@ TextureImporter:
   maxTextureSizeSet: 0
   compressionQualitySet: 0
   textureFormatSet: 0
-  ignorePngGamma: 0
+  ignorePngGamma: 1
   applyGammaDecoding: 0
   cookieLightType: 0
   platformSettings:
diff --git a/TerrainBuilder.prefab b/TerrainBuilder.prefab
index 0751771ab7bed20c05c54429cde99431356c27fd..bb0e4d627ff4c97b41633fc8cad3e0827cf4d8b2 100644
--- a/TerrainBuilder.prefab
+++ b/TerrainBuilder.prefab
@@ -44,6 +44,14 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: cd43ca4104daaec4a9d3a76a67972b44, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  originWGS84: {x: 51.985367, y: 5.664941}
+  controlResolution: 1024
+  height: 300
+  zoom: 16
+  numDLRetries: 5
+  runOnStart: 0
+  terrainMat: {fileID: 2100000, guid: 8179da2b0897196479bec0f26c2c46e7, type: 2}
+  controlTexture: {fileID: 0}
   layers:
   - layer: {fileID: 8574412962073106934, guid: f963e57374ac1ff44b017a60c3f8ad82, type: 2}
     colors:
@@ -51,7 +59,6 @@ MonoBehaviour:
   - layer: {fileID: 8574412962073106934, guid: a8f4323a2d7fc5a4980be7d0b9db0f78, type: 2}
     colors:
     - {r: 0.78823537, g: 0.9215687, b: 0.43921572, a: 0}
-    - {r: 0.78823537, g: 0.9215687, b: 0.43921572, a: 0}
   - layer: {fileID: 8574412962073106934, guid: 18e099679d7c2e441b23ddbab4283f49, type: 2}
     colors:
     - {r: 1, g: 1, b: 1, a: 0}
@@ -68,10 +75,3 @@ MonoBehaviour:
   - layer: {fileID: 8574412962073106934, guid: 60085e35e8e4b114cae3ce971378231a, type: 2}
     colors:
     - {r: 0.95294124, g: 0.9607844, b: 0.96470594, a: 0}
-  mapType: 0
-  runOnStart: 0
-  terrainMat: {fileID: 2100000, guid: 8179da2b0897196479bec0f26c2c46e7, type: 2}
-  originRD: {x: 174041, y: 444126}
-  size: {x: 500, y: 500, z: 500}
-  zoom: 11
-  numTileDownloadRetries: 5