From adb1512ab3f0b338436ef6f954ddff09ba387d2e Mon Sep 17 00:00:00 2001 From: Alexandre Coirier Date: Wed, 3 Jun 2026 01:15:15 +0200 Subject: [PATCH] fix: HouseOfLeaves sand setup --- .../Materials/M_houseOfLeaves_sand.mat | 2 +- .../HouseOfLeaves/Shaders/Sand.hlsl | 11 +- .../_Content/Models/VFX/Fog/Shaders/Fog.hlsl | 3 +- .../Models/VFX/Fog/Shaders/Fog.shadergraph | 425 +++++++++++++++++- Assets/_Content/Scenes/HouseOfLeaves.unity | 12 +- Assets/_Content/Scenes/Omnissiah.unity | 2 +- 6 files changed, 425 insertions(+), 30 deletions(-) diff --git a/Assets/_Content/Models/Environments/HouseOfLeaves/Materials/M_houseOfLeaves_sand.mat b/Assets/_Content/Models/Environments/HouseOfLeaves/Materials/M_houseOfLeaves_sand.mat index 816aa572..de338fb2 100644 --- a/Assets/_Content/Models/Environments/HouseOfLeaves/Materials/M_houseOfLeaves_sand.mat +++ b/Assets/_Content/Models/Environments/HouseOfLeaves/Materials/M_houseOfLeaves_sand.mat @@ -117,7 +117,7 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - - _Progression: 0.217 + - _Progression: 0 - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 diff --git a/Assets/_Content/Models/Environments/HouseOfLeaves/Shaders/Sand.hlsl b/Assets/_Content/Models/Environments/HouseOfLeaves/Shaders/Sand.hlsl index 566d7d91..db866ad4 100644 --- a/Assets/_Content/Models/Environments/HouseOfLeaves/Shaders/Sand.hlsl +++ b/Assets/_Content/Models/Environments/HouseOfLeaves/Shaders/Sand.hlsl @@ -28,10 +28,11 @@ void Sand_float // Arks - float arkMask = abs(frac(PositionWS.z * .5) * 2 - 1); + /*float arkMask = abs(frac(PositionWS.z * .5) * 2 - 1); arkMask = pow(smoothstep(.7, 0, arkMask), 2); arkMask += smoothstep(2.8, 3.2, abs(PositionWS.x)); - arkMask = saturate(arkMask); + arkMask = saturate(arkMask);*/ + float arkMask = 0; // Sand @@ -39,12 +40,14 @@ void Sand_float float sandDirection = cos(t * sandLayers * 3.14); - float sandDensity = smoothstep(1.5, 0, abs(PositionWS.x)); - sandDensity = saturate(sandDensity + arkMask); + //float sandDensity = smoothstep(1.5, 0, abs(PositionWS.x)); + //sandDensity = saturate(sandDensity + arkMask); float sandPatern = RidgedNoise3D(PositionWS + float3(sandDirection, 0, 0), .6, 1, 2, .5) * .8; sandPatern += 1 - RidgedNoise3D(PositionWS + float3(0, 0, t * sandLayers * 2), .8, 2, 2, .5) * .2; + float sandDensity = sqrt(smoothstep(0, 2, abs(PositionWS.x) + sandPatern)); + float sandGradientSign = (floor(t * sandLayers) % 2 == 0) ? 1 : -1; float sandGradient = smoothstep(2 * -sandGradientSign, 2 * sandGradientSign, PositionWS.x); float sandPhase = frac(t * sandLayers); diff --git a/Assets/_Content/Models/VFX/Fog/Shaders/Fog.hlsl b/Assets/_Content/Models/VFX/Fog/Shaders/Fog.hlsl index bb1e168b..a690a6e6 100644 --- a/Assets/_Content/Models/VFX/Fog/Shaders/Fog.hlsl +++ b/Assets/_Content/Models/VFX/Fog/Shaders/Fog.hlsl @@ -7,6 +7,7 @@ void Fog_float ( float4 ColorA, float4 ColorB, + float DepthAtten, float3 PositionWS, float3 PositionOS, float3 PivotWS, @@ -28,7 +29,7 @@ void Fog_float //float test = RidgedNoise3D(PositionWS, 10, 2, 2, .5); float3 camPos = _WorldSpaceCameraPos.xyz; float depth = distance(camPos, PositionWS); - float depthAtten = smoothstep(5, 30, depth); + float depthAtten = lerp(1, smoothstep(5, 30, depth), DepthAtten); float t = _Time.y * .7; diff --git a/Assets/_Content/Models/VFX/Fog/Shaders/Fog.shadergraph b/Assets/_Content/Models/VFX/Fog/Shaders/Fog.shadergraph index 2dadb8c7..6f511a5f 100644 --- a/Assets/_Content/Models/VFX/Fog/Shaders/Fog.shadergraph +++ b/Assets/_Content/Models/VFX/Fog/Shaders/Fog.shadergraph @@ -20,6 +20,12 @@ }, { "m_Id": "4da948d3c5594d2581cd893dc42c5853" + }, + { + "m_Id": "6b00dfa68b5a4919a3d199ce0d83b7b0" + }, + { + "m_Id": "683448ff408243589dbc6d52ad471b22" } ], "m_Keywords": [], @@ -116,6 +122,15 @@ }, { "m_Id": "798cfd16490043f186f0329a0eb6edd2" + }, + { + "m_Id": "701f398c9cba4c41acd604f8d47f6030" + }, + { + "m_Id": "15e1690e2d6f4303a4ff4da114bc32f1" + }, + { + "m_Id": "7d4fdac03ace4a198e5135d42a49dcc5" } ], "m_GroupDatas": [], @@ -135,6 +150,20 @@ "m_SlotId": 0 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "15e1690e2d6f4303a4ff4da114bc32f1" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "7d4fdac03ace4a198e5135d42a49dcc5" + }, + "m_SlotId": 1 + } + }, { "m_OutputSlot": { "m_Node": { @@ -289,6 +318,20 @@ "m_SlotId": 0 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "701f398c9cba4c41acd604f8d47f6030" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cd9b6500316e4beabbb4e8a42c14ce9d" + }, + "m_SlotId": 8 + } + }, { "m_OutputSlot": { "m_Node": { @@ -317,6 +360,20 @@ "m_SlotId": 0 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7d4fdac03ace4a198e5135d42a49dcc5" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1bbd96557fec42adb96949d2b0ffdd5d" + }, + "m_SlotId": 1 + } + }, { "m_OutputSlot": { "m_Node": { @@ -971,6 +1028,42 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "15e1690e2d6f4303a4ff4da114bc32f1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1338.0001220703125, + "y": 1059.0, + "width": 165.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "28da90f803e04668bab2ea38a1350cc4" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "683448ff408243589dbc6d52ad471b22" + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", @@ -1320,6 +1413,22 @@ "m_LiteralMode": false } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "28da90f803e04668bab2ea38a1350cc4", + "m_Id": 0, + "m_DisplayName": "IntersectionAtten", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [], + "m_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", @@ -1366,10 +1475,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -1017.0, - "y": 190.0, - "width": 0.0, - "height": 0.0 + "x": -990.0, + "y": 207.0, + "width": 112.0, + "height": 34.0 } }, "m_Slots": [ @@ -1518,6 +1627,31 @@ "m_LiteralMode": false } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "4217587d1b9a454f974f328acf876083", + "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_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -1990,6 +2124,50 @@ "m_SerializedDescriptor": "VertexDescription.Position" } +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "683448ff408243589dbc6d52ad471b22", + "m_Guid": { + "m_GuidSerialized": "8712a244-2722-4c04-bbfd-5ec3bfa4516c" + }, + "promotedFromAssetID": "", + "promotedFromCategoryName": "", + "promotedOrdering": -1, + "m_Name": "IntersectionAtten", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "IntersectionAtten", + "m_DefaultReferenceName": "_IntersectionAtten", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": false, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": true, + "hlslDeclarationOverride": 2, + "m_Hidden": false, + "m_PerRendererData": false, + "m_customAttributes": [], + "m_Value": 10.0, + "m_FloatType": 0, + "m_LiteralFloatMode": false, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + }, + "m_SliderType": 0, + "m_SliderPower": 3.0, + "m_EnumType": 0, + "m_CSharpEnumString": "", + "m_EnumNames": [ + "Default" + ], + "m_EnumValues": [ + 0 + ] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -2058,6 +2236,50 @@ } } +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "6b00dfa68b5a4919a3d199ce0d83b7b0", + "m_Guid": { + "m_GuidSerialized": "595dc70a-a699-4950-92ff-ad02c28fafa7" + }, + "promotedFromAssetID": "", + "promotedFromCategoryName": "", + "promotedOrdering": -1, + "m_Name": "DepthAtten", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "DepthAtten", + "m_DefaultReferenceName": "_DepthAtten", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": false, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": true, + "hlslDeclarationOverride": 2, + "m_Hidden": false, + "m_PerRendererData": false, + "m_customAttributes": [], + "m_Value": 1.0, + "m_FloatType": 1, + "m_LiteralFloatMode": false, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + }, + "m_SliderType": 0, + "m_SliderPower": 3.0, + "m_EnumType": 0, + "m_CSharpEnumString": "", + "m_EnumNames": [ + "Default" + ], + "m_EnumValues": [ + 0 + ] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", @@ -2117,10 +2339,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -1020.0, - "y": 254.0, - "width": 0.0, - "height": 0.0 + "x": -990.0, + "y": 241.0, + "width": 113.0, + "height": 34.0 } }, "m_Slots": [ @@ -2191,6 +2413,42 @@ "m_ScreenSpaceType": 1 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "701f398c9cba4c41acd604f8d47f6030", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1012.0, + "y": 274.0, + "width": 135.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "d8111b71b3344dcea3490eb6238f1c1e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "6b00dfa68b5a4919a3d199ce0d83b7b0" + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SplitNode", @@ -2320,6 +2578,48 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DivideNode", + "m_ObjectId": "7d4fdac03ace4a198e5135d42a49dcc5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Divide", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1148.0001220703125, + "y": 975.0000610351563, + "width": 126.00006103515625, + "height": 117.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "c0f54d625fa045e79128819246a3ef1a" + }, + { + "m_Id": "b7ebe9d130f548e3abbb54399d2785e6" + }, + { + "m_Id": "4217587d1b9a454f974f328acf876083" + } + ], + "synonyms": [ + "division", + "divided by" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", @@ -2355,6 +2655,12 @@ }, { "m_Id": "c8e6ac05572749048406347a00e68816" + }, + { + "m_Id": "6b00dfa68b5a4919a3d199ce0d83b7b0" + }, + { + "m_Id": "683448ff408243589dbc6d52ad471b22" } ] } @@ -2372,7 +2678,7 @@ "m_ZTestMode": 4, "m_ZWriteControl": 0, "m_AlphaMode": 0, - "m_RenderFace": 2, + "m_RenderFace": 0, "m_AlphaClip": false, "m_CastShadows": false, "m_ReceiveShadows": true, @@ -2667,6 +2973,22 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9e8b71ed4db4436d8813bff786ae37b7", + "m_Id": 8, + "m_DisplayName": "DepthAtten", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "DepthAtten", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [], + "m_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -2993,6 +3315,31 @@ } } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b7ebe9d130f548e3abbb54399d2785e6", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 2.0, + "y": 2.0, + "z": 2.0, + "w": 2.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", @@ -3125,6 +3472,31 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c0f54d625fa045e79128819246a3ef1a", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 1.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_LiteralMode": false +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -3517,19 +3889,28 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -652.0, + "x": -646.0, "y": 308.0, "width": 198.0, - "height": 166.0 + "height": 214.0 } }, "m_Slots": [ + { + "m_Id": "5ba5e0c48f2945efbada98663c457b7b" + }, + { + "m_Id": "85bd1f19680a4262b37dd8e85f368376" + }, { "m_Id": "ab1e5d725fe7419a94bbeb8f68a2a2ca" }, { "m_Id": "9517e00d3ea64186a6874be224598766" }, + { + "m_Id": "9e8b71ed4db4436d8813bff786ae37b7" + }, { "m_Id": "bc721469373a42e7ab14d6640037b417" }, @@ -3541,12 +3922,6 @@ }, { "m_Id": "c1e2c96af1fe41c99db7eb015f6be865" - }, - { - "m_Id": "5ba5e0c48f2945efbada98663c457b7b" - }, - { - "m_Id": "85bd1f19680a4262b37dd8e85f368376" } ], "synonyms": [ @@ -3617,6 +3992,22 @@ "m_LiteralMode": false } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d8111b71b3344dcea3490eb6238f1c1e", + "m_Id": 0, + "m_DisplayName": "DepthAtten", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [], + "m_LiteralMode": false +} + { "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", diff --git a/Assets/_Content/Scenes/HouseOfLeaves.unity b/Assets/_Content/Scenes/HouseOfLeaves.unity index 8b2c5e70..ae3431e7 100644 --- a/Assets/_Content/Scenes/HouseOfLeaves.unity +++ b/Assets/_Content/Scenes/HouseOfLeaves.unity @@ -201,7 +201,7 @@ MeshRenderer: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 300277218} - m_Enabled: 0 + m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 @@ -261,7 +261,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 40, y: 40, z: 40} + m_LocalScale: {x: 0.5251041, y: 40, z: 13.3708} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1920554116} @@ -324,9 +324,9 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 412733324} serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 6.9868, y: -0, z: 19.0302} - m_LocalScale: {x: 0.8365, y: 1, z: 1.526204} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 917697129} @@ -943,7 +943,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -7907523562308333758, guid: bc77fc4360cf7554d882153c57d02f91, type: 3} propertyPath: m_LocalPosition.z - value: 10.5671 + value: 0 objectReference: {fileID: 0} - target: {fileID: -7605571332984283666, guid: bc77fc4360cf7554d882153c57d02f91, type: 3} propertyPath: m_IsActive diff --git a/Assets/_Content/Scenes/Omnissiah.unity b/Assets/_Content/Scenes/Omnissiah.unity index 2add041c..3dafa55d 100644 --- a/Assets/_Content/Scenes/Omnissiah.unity +++ b/Assets/_Content/Scenes/Omnissiah.unity @@ -1014,7 +1014,7 @@ MonoBehaviour: m_FloatArgument: 0 m_StringArgument: m_BoolArgument: 1 - m_CallState: 2 + m_CallState: 0 _onTriggerDelayed: m_PersistentCalls: m_Calls: