briochie / wow.unity

A collection of assets to make working with wow.export easier in Unity.
MIT License
19 stars 7 forks source link

BUG: TerrainChunk.shadergraph missing include file error #24

Open oyvind-stromsvik opened 9 months ago

oyvind-stromsvik commented 9 months ago

Shader Graph at Packages/wow-export-unityifier.briochie/Runtime/Shaders/TerrainChunk.shadergraph has 1 error(s), the first is: Validation: Source file does not exist. A valid .hlsl, .cginc, or .cg file must be referenced

The PreLegionFunction file is missing here: Capture

But I'm unsure if this is user error or not? Are you getting this error on a fresh install using this package?

Note: I've always gotten this error with this package. I've just manually fixed it in the projects where I get it.

The git diff I get when adding this file is unreadable to me, so I'm not sure how to interpret it:

diff --git a/Runtime/Shaders/TerrainChunk.shadergraph b/Runtime/Shaders/TerrainChunk.shadergraph
--- a/Runtime/Shaders/TerrainChunk.shadergraph
+++ b/Runtime/Shaders/TerrainChunk.shadergraph
@@ -1188,54 +1188,6 @@
     }
 }

-{
-    "m_SGVersion": 0,
-    "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
-    "m_ObjectId": "3aab0bb29bd74bcaa9588313f17aa640",
-    "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.PropertyNode",
@@ -1330,6 +1282,54 @@
     "m_DefaultType": 1
 }

+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
+    "m_ObjectId": "3aab0bb29bd74bcaa9588313f17aa640",
+    "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.UVMaterialSlot",
@@ -2549,7 +2549,7 @@
     },
     "m_SourceType": 0,
     "m_FunctionName": "PreLegion",
-    "m_FunctionSource": "85a9e7ab1bfdeb94cb497afeb477b194",
+    "m_FunctionSource": "a0fe3fd4f59a08e448868a16897b0912",
     "m_FunctionBody": "Enter function body here..."
 }

@@ -2849,39 +2849,6 @@
     "m_OutputChannel": 0
 }

-{
-    "m_SGVersion": 0,
-    "m_Type": "UnityEditor.ShaderGraph.BlockNode",
-    "m_ObjectId": "aa2ea452c87546d383469cae0be8156f",
-    "m_Group": {
-        "m_Id": ""
-    },
-    "m_Name": "VertexDescription.Normal",
-    "m_DrawState": {
-        "m_Expanded": true,
-        "m_Position": {
-            "serializedVersion": "2",
-            "x": 0.0,
-            "y": 0.0,
-            "width": 0.0,
-            "height": 0.0
-        }
-    },
-    "m_Slots": [
-        {
-            "m_Id": "7b31f7d68934499c87c8aa652d47940d"
-        }
-    ],
-    "synonyms": [],
-    "m_Precision": 0,
-    "m_PreviewExpanded": true,
-    "m_PreviewMode": 0,
-    "m_CustomColors": {
-        "m_SerializableColors": []
-    },
-    "m_SerializedDescriptor": "VertexDescription.Normal"
-}
-
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
@@ -3161,6 +3128,21 @@
     "m_Labels": []
 }

+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
+    "m_ObjectId": "d0c5c1c915c94b26868595e490179a83",
+    "m_Id": 5,
+    "m_DisplayName": "G",
+    "m_SlotType": 1,
+    "m_Hidden": false,
+    "m_ShaderOutputName": "G",
+    "m_StageCapability": 2,
+    "m_Value": 0.0,
+    "m_DefaultValue": 0.0,
+    "m_Labels": []
+}
+
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.BlockNode",
@@ -3194,21 +3176,6 @@
     "m_SerializedDescriptor": "SurfaceDescription.BaseColor"
 }

-{
-    "m_SGVersion": 0,
-    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
-    "m_ObjectId": "d0c5c1c915c94b26868595e490179a83",
-    "m_Id": 5,
-    "m_DisplayName": "G",
-    "m_SlotType": 1,
-    "m_Hidden": false,
-    "m_ShaderOutputName": "G",
-    "m_StageCapability": 2,
-    "m_Value": 0.0,
-    "m_DefaultValue": 0.0,
-    "m_Labels": []
-}
-
 {
     "m_SGVersion": 0,
     "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
@@ -3836,3 +3803,36 @@
     }
 }

+{
+    "m_SGVersion": 0,
+    "m_Type": "UnityEditor.ShaderGraph.BlockNode",
+    "m_ObjectId": "aa2ea452c87546d383469cae0be8156f",
+    "m_Group": {
+        "m_Id": ""
+    },
+    "m_Name": "VertexDescription.Normal",
+    "m_DrawState": {
+        "m_Expanded": true,
+        "m_Position": {
+            "serializedVersion": "2",
+            "x": 0.0,
+            "y": 0.0,
+            "width": 0.0,
+            "height": 0.0
+        }
+    },
+    "m_Slots": [
+        {
+            "m_Id": "7b31f7d68934499c87c8aa652d47940d"
+        }
+    ],
+    "synonyms": [],
+    "m_Precision": 0,
+    "m_PreviewExpanded": true,
+    "m_PreviewMode": 0,
+    "m_CustomColors": {
+        "m_SerializableColors": []
+    },
+    "m_SerializedDescriptor": "VertexDescription.Normal"
+}
+

I'm guessing this is the relevant change:

-    "m_FunctionSource": "85a9e7ab1bfdeb94cb497afeb477b194",
+    "m_FunctionSource": "a0fe3fd4f59a08e448868a16897b0912",

But this makes it seem like there was already a source defined, which was what made me think this was user error.

briochie commented 9 months ago

I have had so much trouble with shadergraph custom nodes. I'm not sure what is causing that, I wonder if it may be language settings related. 🤔

fnio5 commented 9 months ago

I have had so much trouble with shadergraph custom nodes. I'm not sure what is causing that, I wonder if it may be language settings related. 🤔

how abut replacing it with a few lerps? image

this looks about the same to me.

briochie commented 9 months ago

this looks about the same to me.

Because it’s not. I tried this solution before and it didn’t work as you’d expect. Could be they changed the node behavior since, but no blending or lerping seemed to fix it.

it may work for some post-WoD terrain implementation, since those textures are then weighted.