Skip to content

Commit 5e07b8e

Browse files
TudorJudefacebook-github-bot
authored andcommitted
Fix shadergraph breaking on newer versions of Unity
Summary: As of Unity's Shader Graph v14.0.8, an alpha clip threshold value of 0 breaks occlusion shader graphs. Set alpha clip threshold value to 0.01. Reviewed By: vasylbo Differential Revision: D55633341 fbshipit-source-id: c36ccdf25f2b2cfcb59d8190167daf6e59612467
1 parent 721b3f4 commit 5e07b8e

3 files changed

Lines changed: 54 additions & 7 deletions

File tree

DepthAPI-URP/Assets/DepthAPISample/Shadergraph/LitOccluded.shadergraph

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
"m_OutputNode": {
224224
"m_Id": ""
225225
},
226+
"m_SubDatas": [],
226227
"m_ActiveTargets": [
227228
{
228229
"m_Id": "43348f8b1cbb46b08cc5ed4d1394f675"
@@ -1059,7 +1060,7 @@
10591060
"m_Hidden": false,
10601061
"m_ShaderOutputName": "AlphaClipThreshold",
10611062
"m_StageCapability": 2,
1062-
"m_Value": 0.0,
1063+
"m_Value": 0.009999999776482582,
10631064
"m_DefaultValue": 0.5,
10641065
"m_Labels": []
10651066
}

DepthAPI-URP/Assets/DepthAPISample/Shadergraph/StylizedOcclusionEffectOFF.shadergraph

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
"m_OutputNode": {
198198
"m_Id": ""
199199
},
200+
"m_SubDatas": [],
200201
"m_ActiveTargets": [
201202
{
202203
"m_Id": "43348f8b1cbb46b08cc5ed4d1394f675"
@@ -263,6 +264,9 @@
263264
}
264265
},
265266
"m_Slots": [
267+
{
268+
"m_Id": "f02b8cab927740afa1f50bb82d7301a8"
269+
},
266270
{
267271
"m_Id": "3ed69fb4838a4d2c985db248e9269c16"
268272
}
@@ -276,8 +280,12 @@
276280
"m_SerializableColors": []
277281
},
278282
"m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"02d92e3f25cd820439bb83af462df06d\",\n \"type\": 3\n }\n}",
279-
"m_PropertyGuids": [],
280-
"m_PropertyIds": [],
283+
"m_PropertyGuids": [
284+
"59a86f07-8461-4536-88e4-f9b79235cad8"
285+
],
286+
"m_PropertyIds": [
287+
1940732540
288+
],
281289
"m_Dropdowns": [],
282290
"m_DropdownSelectedEntries": []
283291
}
@@ -1006,7 +1014,7 @@
10061014
"m_Hidden": false,
10071015
"m_ShaderOutputName": "AlphaClipThreshold",
10081016
"m_StageCapability": 2,
1009-
"m_Value": 0.0,
1017+
"m_Value": 0.009999999776482582,
10101018
"m_DefaultValue": 0.5,
10111019
"m_Labels": []
10121020
}
@@ -1230,6 +1238,21 @@
12301238
"m_Labels": []
12311239
}
12321240

1241+
{
1242+
"m_SGVersion": 0,
1243+
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
1244+
"m_ObjectId": "f02b8cab927740afa1f50bb82d7301a8",
1245+
"m_Id": 1940732540,
1246+
"m_DisplayName": "Environment Depth Bias",
1247+
"m_SlotType": 0,
1248+
"m_Hidden": false,
1249+
"m_ShaderOutputName": "_Environment_Depth_Bias",
1250+
"m_StageCapability": 3,
1251+
"m_Value": 0.0,
1252+
"m_DefaultValue": 0.0,
1253+
"m_Labels": []
1254+
}
1255+
12331256
{
12341257
"m_SGVersion": 0,
12351258
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",

DepthAPI-URP/Assets/DepthAPISample/Shadergraph/StylizedOcclusionEffectON.shadergraph

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@
373373
"m_OutputNode": {
374374
"m_Id": ""
375375
},
376+
"m_SubDatas": [],
376377
"m_ActiveTargets": [
377378
{
378379
"m_Id": "43348f8b1cbb46b08cc5ed4d1394f675"
@@ -1329,6 +1330,9 @@
13291330
}
13301331
},
13311332
"m_Slots": [
1333+
{
1334+
"m_Id": "e12761b348594c99823963d5a35a144a"
1335+
},
13321336
{
13331337
"m_Id": "8a80ada9be3f47c2a666b2568eaa379f"
13341338
}
@@ -1342,8 +1346,12 @@
13421346
"m_SerializableColors": []
13431347
},
13441348
"m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"02d92e3f25cd820439bb83af462df06d\",\n \"type\": 3\n }\n}",
1345-
"m_PropertyGuids": [],
1346-
"m_PropertyIds": [],
1349+
"m_PropertyGuids": [
1350+
"59a86f07-8461-4536-88e4-f9b79235cad8"
1351+
],
1352+
"m_PropertyIds": [
1353+
1940732540
1354+
],
13471355
"m_Dropdowns": [],
13481356
"m_DropdownSelectedEntries": []
13491357
}
@@ -1950,7 +1958,7 @@
19501958
"m_Hidden": false,
19511959
"m_ShaderOutputName": "AlphaClipThreshold",
19521960
"m_StageCapability": 2,
1953-
"m_Value": 0.0,
1961+
"m_Value": 0.009999999776482582,
19541962
"m_DefaultValue": 0.5,
19551963
"m_Labels": []
19561964
}
@@ -2439,6 +2447,21 @@
24392447
}
24402448
}
24412449

2450+
{
2451+
"m_SGVersion": 0,
2452+
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
2453+
"m_ObjectId": "e12761b348594c99823963d5a35a144a",
2454+
"m_Id": 1940732540,
2455+
"m_DisplayName": "Environment Depth Bias",
2456+
"m_SlotType": 0,
2457+
"m_Hidden": false,
2458+
"m_ShaderOutputName": "_Environment_Depth_Bias",
2459+
"m_StageCapability": 3,
2460+
"m_Value": 0.0,
2461+
"m_DefaultValue": 0.0,
2462+
"m_Labels": []
2463+
}
2464+
24422465
{
24432466
"m_SGVersion": 0,
24442467
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",

0 commit comments

Comments
 (0)