From aa123c28c826ce42eb1b372dfd81ef7a43b9812d Mon Sep 17 00:00:00 2001 From: Lucien Date: Mon, 3 Aug 2026 17:05:59 +0200 Subject: [PATCH] Tweak the dither fade shader --- .../CocaTrees/CocaTreesFoliage.shadergraph | 524 +++++++++++++++++- .../CocaTrees/Scripts/DefaultDitherFade.asset | 2 +- .../chestnut/Chestnut_leaves_Hideable.mat | 1 + Sources/CocaTrees/trees_playerhidemap.png | 4 +- 4 files changed, 523 insertions(+), 8 deletions(-) diff --git a/Sources/CocaTrees/CocaTreesFoliage.shadergraph b/Sources/CocaTrees/CocaTreesFoliage.shadergraph index 03141c74..7e7f313c 100644 --- a/Sources/CocaTrees/CocaTreesFoliage.shadergraph +++ b/Sources/CocaTrees/CocaTreesFoliage.shadergraph @@ -32,6 +32,9 @@ }, { "m_Id": "c09704ec5e714392bf10f5b070ce849e" + }, + { + "m_Id": "9c137bc13ae44587bdf231d20c4f66ca" } ], "m_Keywords": [], @@ -125,6 +128,18 @@ }, { "m_Id": "2d928c18ade04ce0805f0631a0db376e" + }, + { + "m_Id": "f2d162477b2b4c88804fa9f8d7631e36" + }, + { + "m_Id": "e19a06e5429f4bc7b088b27d6320175e" + }, + { + "m_Id": "b6dee5534a8243528d837680203d8030" + }, + { + "m_Id": "8f3adb6a72b34a20aeac2776695d7183" } ], "m_GroupDatas": [], @@ -307,9 +322,9 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "0c13f3f53c92494c89efb1f1f73a7e79" + "m_Id": "8f3adb6a72b34a20aeac2776695d7183" }, - "m_SlotId": 613477270 + "m_SlotId": 0 } }, { @@ -340,6 +355,20 @@ "m_SlotId": 1 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "8f3adb6a72b34a20aeac2776695d7183" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0c13f3f53c92494c89efb1f1f73a7e79" + }, + "m_SlotId": 613477270 + } + }, { "m_OutputSlot": { "m_Node": { @@ -354,6 +383,20 @@ "m_SlotId": 0 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b6dee5534a8243528d837680203d8030" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e19a06e5429f4bc7b088b27d6320175e" + }, + "m_SlotId": 1 + } + }, { "m_OutputSlot": { "m_Node": { @@ -368,6 +411,20 @@ "m_SlotId": 1 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e19a06e5429f4bc7b088b27d6320175e" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3adb6a72b34a20aeac2776695d7183" + }, + "m_SlotId": 1 + } + }, { "m_OutputSlot": { "m_Node": { @@ -381,6 +438,20 @@ }, "m_SlotId": 0 } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f2d162477b2b4c88804fa9f8d7631e36" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e19a06e5429f4bc7b088b27d6320175e" + }, + "m_SlotId": 0 + } } ], "m_VertexContext": { @@ -748,6 +819,30 @@ "m_DefaultType": 0 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "25a267cba4224ad796e4a3bf6e72f940", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", @@ -1125,6 +1220,29 @@ "m_SerializedDescriptor": "SurfaceDescription.Metallic" } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "459ca4b105a54491b789726d6b614184", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -1140,6 +1258,54 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "505ab0734c0b4aafa20dee0d91941e6c", + "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.DynamicValueMaterialSlot", @@ -1413,6 +1579,54 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "5ccf6d0adfaf481c98c0f516aa80f67c", + "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.BlockNode", @@ -1507,6 +1721,30 @@ "m_MipSamplingMode": 0 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "61452c177afd440a970aa02441986ebf", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -1682,6 +1920,30 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "76d833d9b65c423eb1ba4e5403aa1a9f", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", @@ -1778,6 +2040,21 @@ "m_SerializedDescriptor": "VertexDescription.Normal" } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7a7f78f3c7474314b8484a41b0e59e71", + "m_Id": 0, + "m_DisplayName": "GeometryAdapt", + "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.PropertyNode", @@ -1826,9 +2103,9 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -905.0, - "y": 471.0000305175781, - "width": 151.0, + "x": -1578.0001220703125, + "y": 318.0, + "width": 151.0001220703125, "height": 34.0 } }, @@ -1955,6 +2232,49 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "8f3adb6a72b34a20aeac2776695d7183", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1151.0, + "y": 429.0, + "width": 130.00006103515626, + "height": 118.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "76d833d9b65c423eb1ba4e5403aa1a9f" + }, + { + "m_Id": "61452c177afd440a970aa02441986ebf" + }, + { + "m_Id": "25a267cba4224ad796e4a3bf6e72f940" + } + ], + "synonyms": [ + "addition", + "sum", + "plus" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", @@ -2066,6 +2386,34 @@ "m_Labels": [] } +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "9c137bc13ae44587bdf231d20c4f66ca", + "m_Guid": { + "m_GuidSerialized": "4fe1ef50-7b04-4dd5-bb32-9322ce41314f" + }, + "m_Name": "GeometryAdapt", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "GeometryAdapt", + "m_DefaultReferenceName": "_GeometryAdapt", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "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.Vector1MaterialSlot", @@ -2186,6 +2534,9 @@ }, { "m_Id": "c565bf0f17e0406d9766582b9e7267fc" + }, + { + "m_Id": "9c137bc13ae44587bdf231d20c4f66ca" } ] } @@ -2447,6 +2798,42 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "b6dee5534a8243528d837680203d8030", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1708.0, + "y": 661.0000610351563, + "width": 158.0, + "height": 33.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "7a7f78f3c7474314b8484a41b0e59e71" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "9c137bc13ae44587bdf231d20c4f66ca" + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -2863,6 +3250,54 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "d2af1ef532f640b49b4105be34c76d76", + "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.DynamicValueMaterialSlot", @@ -2911,6 +3346,49 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "e19a06e5429f4bc7b088b27d6320175e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1393.0, + "y": 463.0000305175781, + "width": 130.0, + "height": 117.99996948242188 + } + }, + "m_Slots": [ + { + "m_Id": "5ccf6d0adfaf481c98c0f516aa80f67c" + }, + { + "m_Id": "505ab0734c0b4aafa20dee0d91941e6c" + }, + { + "m_Id": "d2af1ef532f640b49b4105be34c76d76" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -2993,6 +3471,42 @@ "m_DefaultValue": false } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalVectorNode", + "m_ObjectId": "f2d162477b2b4c88804fa9f8d7631e36", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Normal Vector", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1750.0, + "y": 463.0000305175781, + "width": 206.0, + "height": 130.00003051757813 + } + }, + "m_Slots": [ + { + "m_Id": "459ca4b105a54491b789726d6b614184" + } + ], + "synonyms": [ + "surface direction" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 1 +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", diff --git a/Sources/CocaTrees/Scripts/DefaultDitherFade.asset b/Sources/CocaTrees/Scripts/DefaultDitherFade.asset index daa28642..2e4f3e76 100644 --- a/Sources/CocaTrees/Scripts/DefaultDitherFade.asset +++ b/Sources/CocaTrees/Scripts/DefaultDitherFade.asset @@ -14,4 +14,4 @@ MonoBehaviour: m_EditorClassIdentifier: verticalOffset: 0.75 cameraDistanceRange: {x: 1, y: 35} - hideRadiusRange: {x: 0.6, y: 0.2} + hideRadiusRange: {x: 0.92, y: 0.42} diff --git a/Sources/CocaTrees/chestnut/Chestnut_leaves_Hideable.mat b/Sources/CocaTrees/chestnut/Chestnut_leaves_Hideable.mat index 14a890b5..ba242317 100644 --- a/Sources/CocaTrees/chestnut/Chestnut_leaves_Hideable.mat +++ b/Sources/CocaTrees/chestnut/Chestnut_leaves_Hideable.mat @@ -64,6 +64,7 @@ Material: m_Ints: [] m_Floats: - _ClipThreshold: 0.1 + - _GeometryAdapt: -0.07 - _HideRadius: 0.4 - _Metallic: 0 - _NormalStrength: 1 diff --git a/Sources/CocaTrees/trees_playerhidemap.png b/Sources/CocaTrees/trees_playerhidemap.png index 187d40b0..bac54623 100644 --- a/Sources/CocaTrees/trees_playerhidemap.png +++ b/Sources/CocaTrees/trees_playerhidemap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aac54e1c5acfa5ea27793c9aa4331488e9ca1b3bbae0214bc2134771e4578d1b -size 29324 +oid sha256:3a0bd999ee172aa8f3ae5716af4b863ac454dd2ea3549878da84f23e65fba722 +size 272948