[M] water plant shader graph

This commit is contained in:
2025-03-06 16:55:41 +08:00
parent cb050e34d2
commit d2d11c52e3
13 changed files with 3170 additions and 48 deletions

View File

@@ -0,0 +1,990 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "a83ef416392349f4aca0150f295e2fc3",
"m_Properties": [
{
"m_Id": "dd1dfe738e924f509fbb589fb430bad0"
},
{
"m_Id": "6d64f39c767d483ca24dd98b387c83dd"
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "024144f47d41460e998ea45fb6dbe872"
}
],
"m_Nodes": [
{
"m_Id": "9a790e08ca674c19bc4d931280b5662b"
},
{
"m_Id": "dc5d572062ef40daae81170cd6f8bfd0"
},
{
"m_Id": "796c3cbfdbf0441b8b16315b50e7c7c6"
},
{
"m_Id": "4bb172c11481438faec95ced0906094a"
},
{
"m_Id": "9dfed02b6d5f44c595ac51205f6ffc9a"
},
{
"m_Id": "0caa2e2875e740ff8070397424496040"
},
{
"m_Id": "0def883b2d3a44ccba97e646ad80e1bb"
},
{
"m_Id": "9872048199ca4c25a246321082e726e1"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "0caa2e2875e740ff8070397424496040"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "9872048199ca4c25a246321082e726e1"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "0def883b2d3a44ccba97e646ad80e1bb"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "9872048199ca4c25a246321082e726e1"
},
"m_SlotId": 1
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "9872048199ca4c25a246321082e726e1"
},
"m_SlotId": 2
},
"m_InputSlot": {
"m_Node": {
"m_Id": "4bb172c11481438faec95ced0906094a"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "9dfed02b6d5f44c595ac51205f6ffc9a"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "0caa2e2875e740ff8070397424496040"
},
"m_SlotId": 1
}
}
],
"m_VertexContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": [
{
"m_Id": "9a790e08ca674c19bc4d931280b5662b"
},
{
"m_Id": "dc5d572062ef40daae81170cd6f8bfd0"
},
{
"m_Id": "796c3cbfdbf0441b8b16315b50e7c7c6"
}
]
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 200.0
},
"m_Blocks": [
{
"m_Id": "4bb172c11481438faec95ced0906094a"
}
]
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "Shader Graphs",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_SubDatas": [],
"m_ActiveTargets": [
{
"m_Id": "96c533144cab4ab4aa021960aee14673"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "024144f47d41460e998ea45fb6dbe872",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "dd1dfe738e924f509fbb589fb430bad0"
},
{
"m_Id": "6d64f39c767d483ca24dd98b387c83dd"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
"m_ObjectId": "0b3c13e1d7864b9981b58281d3934d57",
"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.SampleTexture2DNode",
"m_ObjectId": "0caa2e2875e740ff8070397424496040",
"m_Group": {
"m_Id": ""
},
"m_Name": "Sample Texture 2D",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -361.0,
"y": 144.0,
"width": 208.0,
"height": 435.0
}
},
"m_Slots": [
{
"m_Id": "6ff9a4c5419649baa9aee0154a78f3f6"
},
{
"m_Id": "271e197eb9224390adbd747cd386bf2f"
},
{
"m_Id": "8aae0e2b0b9d43179e96079adebb2f22"
},
{
"m_Id": "70014fdf683d43cea2d1e10a83ae434a"
},
{
"m_Id": "3585a2117121488d9d029f27f0c8af29"
},
{
"m_Id": "e9cdd1023e224054b05c59dca4880039"
},
{
"m_Id": "e230a54e90e04295b73f91f47768ef73"
},
{
"m_Id": "d29acc9c082a4ff1bd0a6f2f56c69c9f"
}
],
"synonyms": [
"tex2d"
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_TextureType": 0,
"m_NormalMapSpace": 0,
"m_EnableGlobalMipBias": true,
"m_MipSamplingMode": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "0def883b2d3a44ccba97e646ad80e1bb",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -235.73561096191407,
"y": 690.4772338867188,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "d91b3e15cfb542e18c491f44df3521c4"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "6d64f39c767d483ca24dd98b387c83dd"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
"m_ObjectId": "1282a8be3c2a4258b19e14b3fd239a6e",
"m_Id": 0,
"m_DisplayName": "Tangent",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Tangent",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "271e197eb9224390adbd747cd386bf2f",
"m_Id": 4,
"m_DisplayName": "R",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "R",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
"m_ObjectId": "2bb94d48b98b4b3e9442ecb16d93ab12",
"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",
"m_ObjectId": "3585a2117121488d9d029f27f0c8af29",
"m_Id": 7,
"m_DisplayName": "A",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "A",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "4bb172c11481438faec95ced0906094a",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.BaseColor",
"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": "66653afd514d4edfb0d07f8f8a660b1a"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "66653afd514d4edfb0d07f8f8a660b1a",
"m_Id": 0,
"m_DisplayName": "Base Color",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "BaseColor",
"m_StageCapability": 2,
"m_Value": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_ColorMode": 0,
"m_DefaultColor": {
"r": 0.5,
"g": 0.5,
"b": 0.5,
"a": 1.0
}
}
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty",
"m_ObjectId": "6d64f39c767d483ca24dd98b387c83dd",
"m_Guid": {
"m_GuidSerialized": "da979ce0-fda5-4e9a-a883-b4da4c041d21"
},
"m_Name": "Color",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Color",
"m_DefaultReferenceName": "_Color",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": true,
"hlslDeclarationOverride": 2,
"m_Hidden": false,
"m_Value": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.0
},
"isMainColor": false,
"m_ColorMode": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
"m_ObjectId": "6ff9a4c5419649baa9aee0154a78f3f6",
"m_Id": 0,
"m_DisplayName": "RGBA",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "RGBA",
"m_StageCapability": 2,
"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_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "70014fdf683d43cea2d1e10a83ae434a",
"m_Id": 6,
"m_DisplayName": "B",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "B",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "796c3cbfdbf0441b8b16315b50e7c7c6",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Tangent",
"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": "1282a8be3c2a4258b19e14b3fd239a6e"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Tangent"
}
{
"m_SGVersion": 2,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget",
"m_ObjectId": "7bcd9b23e0a5440a94ebe27ef679932d"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "8aae0e2b0b9d43179e96079adebb2f22",
"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": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
"m_ObjectId": "96c533144cab4ab4aa021960aee14673",
"m_Datas": [],
"m_ActiveSubTarget": {
"m_Id": "7bcd9b23e0a5440a94ebe27ef679932d"
},
"m_AllowMaterialOverride": false,
"m_SurfaceType": 0,
"m_ZTestMode": 4,
"m_ZWriteControl": 0,
"m_AlphaMode": 0,
"m_RenderFace": 2,
"m_AlphaClip": false,
"m_CastShadows": true,
"m_ReceiveShadows": true,
"m_SupportsLODCrossFade": false,
"m_CustomEditorGUI": "",
"m_SupportVFX": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.MultiplyNode",
"m_ObjectId": "9872048199ca4c25a246321082e726e1",
"m_Group": {
"m_Id": ""
},
"m_Name": "Multiply",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -3.0417423248291017,
"y": 535.3480224609375,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "d1830c8006f344ae981a3aff404acb44"
},
{
"m_Id": "2bb94d48b98b4b3e9442ecb16d93ab12"
},
{
"m_Id": "0b3c13e1d7864b9981b58281d3934d57"
}
],
"synonyms": [
"multiplication",
"times",
"x"
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "9a790e08ca674c19bc4d931280b5662b",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Position",
"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": "b54f1d0554a24408b041b177bdcf0515"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Position"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "9dfed02b6d5f44c595ac51205f6ffc9a",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -510.0,
"y": 154.0,
"width": 139.0,
"height": 34.0
}
},
"m_Slots": [
{
"m_Id": "ee5a818a94724c3bb653f156eca335ef"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "dd1dfe738e924f509fbb589fb430bad0"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
"m_ObjectId": "b54f1d0554a24408b041b177bdcf0515",
"m_Id": 0,
"m_DisplayName": "Position",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Position",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
"m_ObjectId": "d1830c8006f344ae981a3aff404acb44",
"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.NormalMaterialSlot",
"m_ObjectId": "d1e92bc4ab2a4b169ec0a26de8381fff",
"m_Id": 0,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot",
"m_ObjectId": "d29acc9c082a4ff1bd0a6f2f56c69c9f",
"m_Id": 3,
"m_DisplayName": "Sampler",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Sampler",
"m_StageCapability": 3,
"m_BareResource": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
"m_ObjectId": "d91b3e15cfb542e18c491f44df3521c4",
"m_Id": 0,
"m_DisplayName": "Color",
"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_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "dc5d572062ef40daae81170cd6f8bfd0",
"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": "d1e92bc4ab2a4b169ec0a26de8381fff"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Normal"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
"m_ObjectId": "dd1dfe738e924f509fbb589fb430bad0",
"m_Guid": {
"m_GuidSerialized": "716b5e78-8d6e-4b42-8e73-f2e23db1ab55"
},
"m_Name": "Texture2D",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Texture2D",
"m_DefaultReferenceName": "_Texture2D",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": true,
"hlslDeclarationOverride": 2,
"m_Hidden": false,
"m_Value": {
"m_SerializedTexture": "",
"m_Guid": ""
},
"isMainTexture": false,
"useTilingAndOffset": true,
"m_Modifiable": true,
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot",
"m_ObjectId": "e230a54e90e04295b73f91f47768ef73",
"m_Id": 2,
"m_DisplayName": "UV",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "UV",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0
},
"m_Labels": [],
"m_Channel": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot",
"m_ObjectId": "e9cdd1023e224054b05c59dca4880039",
"m_Id": 1,
"m_DisplayName": "Texture",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Texture",
"m_StageCapability": 3,
"m_BareResource": false,
"m_Texture": {
"m_SerializedTexture": "",
"m_Guid": ""
},
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot",
"m_ObjectId": "ee5a818a94724c3bb653f156eca335ef",
"m_Id": 0,
"m_DisplayName": "Texture2D",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_BareResource": false
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 5292af0aba74d5a4483600dd60d5407c
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@@ -53,7 +53,7 @@ Shader "zzwater/testshader"
float4x4 mx = GetObjectToWorldMatrix();
o.positionHCS = TransformObjectToHClip(v.positionOS);
float factor = dot(float3(mx[0].w, mx[1].w, mx[2].w), 1);
o.phase = sin(_Time.y * factor);
o.phase = sin(_Time.y * 1.5 + factor);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}

View File

@@ -249,6 +249,7 @@
"m_OutputNode": {
"m_Id": ""
},
"m_SubDatas": [],
"m_ActiveTargets": [
{
"m_Id": "220627f91f3340f98d55d6f709e1173d"
@@ -1271,7 +1272,7 @@
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": {
"m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
"m_SerializedTexture": "",
"m_Guid": ""
},
"isMainTexture": false,
@@ -1292,7 +1293,7 @@
"m_StageCapability": 3,
"m_BareResource": false,
"m_Texture": {
"m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
"m_SerializedTexture": "",
"m_Guid": ""
},
"m_DefaultType": 0

View File

@@ -0,0 +1,133 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WaterPlantG
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
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:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
--- !u!114 &7309648709844754497
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c6b6a16215e745d45a276188e760f581
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -108,10 +108,10 @@ Material:
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _SubFreq: 0
- _SubFreq: 0.3
- _Surface: 0
- _SwayFreq: 7.69
- _SwayIntensity: 0.183
- _SwayFreq: 1.18
- _SwayIntensity: 0.129
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
@@ -119,6 +119,8 @@ Material:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
- _TineColor: {r: 0.8773585, g: 0.78201175, b: 0.36832502, a: 1}
- _WaterDir: {r: 0.58, g: 0.44, b: -0.42, a: 2.2}
- _WindDir: {r: 1, g: 0, b: 1, a: 0}
m_BuildTextureStacks: []
--- !u!114 &8498174157611730267

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 746c94d4092dee3428d2f89537482562
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@@ -0,0 +1,28 @@
//UNITY_SHADER_NO_UPGRADE
#ifndef WATER_OBJ_INCLUDE
#define WATER_OBJ_INCLUDE
#ifndef GET_TF_FROM_M
#define GET_TF_FROM_M(m) dot(float3(m[0].w, m[1].w, m[2].w),1)
#endif
inline float3 GetObjWaveDisplacement(float3 positionOS, float4 waterDir, float freq, float intensity, float factor)
{
float3 positionWS = TransformObjectToWorld(positionOS);
float objFreq = _Time.y * freq + positionWS.y ;
float objPhase = objFreq + GET_TF_FROM_M(GetObjectToWorldMatrix()) * waterDir.w;
float branchPhase = objPhase + dot(positionOS.xyz,1);
float offset = sin(objPhase) + cos(branchPhase);
return normalize(waterDir.xyz) * offset * factor * intensity;
}
void GGetObjWaveDisplacement_float(float3 positionOS, float4 waterDir, float freq, float intensity, float factor, out float3 Out)
{
Out = GetObjWaveDisplacement(positionOS, waterDir, freq, intensity, factor);
}
#endif //WATER_OBJ_INCLUDE

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a46a1e71fdaff524b9227e1bb5d54401
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -3,41 +3,49 @@ Shader "zzwater/waterPlant"
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_SwayFreq("Sway Frequency", Range(0,10)) = 1.0
_SubFreq("sub Frequency", Range(0,100)) = 1.0
_SwayIntensity("Sway Intensity", Range(0,2)) = 0.1
_WindDir("Wind Direction", Vector) = (1,0,0,0)
_TineColor("Tine color", Color) = (1,1,1)
_SwayFreq("Sway Frequency", Range(0,5)) = 1.0
_SwayIntensity("Sway Intensity", Range(0.05,0.5)) = 0.1
_WaterDir("Water Direction", Vector) = (1,0,0,0)
// _waterDir.w for wave diff from each other
}
SubShader
{
Tags
{
"RenderType" = "Opaque"
"RenderPipeline"="UniversalPipeline"
"UniversalMaterialType" = "Lit"
"IgnoreProjector" = "True"
"RenderType"="Opaque"
"UniversalMaterialType" = "Unlit"
"Queue"="Geometry"
"DisableBatching"="False"
}
LOD 300
Pass
{
Name "ForwardLit"
Tags { "LightMode" = "UniversalForward" }
ZCLIP On
Name "Universal Forward"
Tags
{
// LightMode: <None>
}
// Render State
Cull Back
Blend One Zero
ZTest LEqual
ZWrite On
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/zzwater/shaders/libs/WaveObj.hlsl"
struct Attributes {
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
float3 normalOS : NORMAL;
float4 color : COLOR;
};
@@ -45,34 +53,29 @@ Shader "zzwater/waterPlant"
{
float4 positionHCS : SV_POSITION;
float2 uv : TEXCOORD0;
float3 normalWS : TEXCOORD1;
float4 color : TEXCOORD2;
float4 color : TEXCOORD1;
};
sampler2D _MainTex;
CBUFFER_START(UnityPerMaterial)
float4 _MainTex_ST;
float3 _TineColor;
half _SwayFreq;
half _SubFreq;
half _SwayIntensity;
float4 _WindDir;
float4 _WaterDir;
CBUFFER_END
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
Varyings vert (Attributes v)
{
Varyings o;
// 顶点摆动算法[^1]
float3 worldPos = TransformObjectToWorld(v.positionOS.xyz);
float phase = worldPos.y * _SwayFreq + _Time.y;
float phase2 = phase * _SubFreq;
float offset = clamp(sin(phase) + sin(phase2), -1.0, 1.0) * _SwayIntensity * v.color.a;
//half offset = sin(phase) * _SwayIntensity * v.color.a;
// 风方向控制
float3 displacement = _WindDir.xyz * offset;
v.positionOS.xyz += displacement * 0.1;
float3 displacement;
v.positionOS.xyz += GetObjWaveDisplacement(v.positionOS, _WaterDir, _SwayFreq, _SwayIntensity, v.color.a);
o.positionHCS = TransformObjectToHClip(v.positionOS.xyz);
o.normalWS = TransformObjectToWorldNormal(v.normalOS);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.color = v.color;
return o;
@@ -80,15 +83,9 @@ Shader "zzwater/waterPlant"
half4 frag (Varyings i) : SV_Target
{
half4 albedo = tex2D(_MainTex, i.uv);
half4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
clip(albedo.a - 0.5);
//return half4(i.color.aaa, 1.0);
return half4(albedo.rgb, 1.0);
//Light mainLight = GetMainLight(TransformWorldToShadowCoord(i.positionHCS));
// 简易光照模型[^2]
//half3 diffuse = mainLight.color * saturate(dot(i.normalWS, mainLight.direction));
//return half4(albedo.rgb * diffuse, 1.0);
return half4(albedo.rgb * _TineColor, 1.0);
}
ENDHLSL
}