diff --git a/Packages/com.waveharmonic.crest.shallow-water/Documentation~/Manual.pdf b/Packages/com.waveharmonic.crest.shallow-water/Documentation~/Manual.pdf new file mode 100644 index 0000000..9c3df4d Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Documentation~/Manual.pdf differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Documentation~/Manual.pdf.meta b/Packages/com.waveharmonic.crest.shallow-water/Documentation~/Manual.pdf.meta new file mode 100644 index 0000000..d78dd4e --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Documentation~/Manual.pdf.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 98b6d3b80c25f46038dc1316959f2faf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor.meta b/Packages/com.waveharmonic.crest.shallow-water/Editor.meta new file mode 100644 index 0000000..214d227 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 16ebbb0f482bf4ae0b606786b1eaa6b2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts.meta b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts.meta new file mode 100644 index 0000000..9c4d5d3 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a193825e90dcd49dbbe1a443ca003fc9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Assembly.cs b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Assembly.cs new file mode 100644 index 0000000..6aeb80b --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Assembly.cs @@ -0,0 +1,6 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if !d_CrestValid +#error "Your Crest package needs to be updated to be compatible with this version of Crest - Shallow Water." +#endif diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Assembly.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Assembly.cs.meta new file mode 100644 index 0000000..2a843a7 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f038cfdad5c0c467f8fab1505c7342b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Editors.cs b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Editors.cs new file mode 100644 index 0000000..abfdbac --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Editors.cs @@ -0,0 +1,84 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest.ShallowWater.Editor +{ + [CustomEditor(typeof(ShallowWaterSimulation))] + sealed class ShallowWaterSimulationEditor : Inspector + { + const string k_SwitchToBaked = "Switch to Baked"; + const string k_SwitchToRealTime = "Switch to Real-Time"; + + protected override void RenderInspectorGUI() + { + base.RenderInspectorGUI(); + + EditorGUILayout.Space(); + + var target = this.target as ShallowWaterSimulation; + + var padding = GUI.skin.GetStyle("HelpBox").padding; + + GUI.skin.GetStyle("HelpBox").padding = new(10, 10, 10, 10); + EditorGUILayout.HelpBox($"Resolution: {target.Resolution}", MessageType.None); + + GUI.skin.GetStyle("HelpBox").padding = padding; + } + + protected override void RenderAfterInspectorGUI() + { + base.RenderAfterInspectorGUI(); + + var target = this.target as ShallowWaterSimulation; + + EditorGUILayout.Space(); + + if (target.Mode == ShallowWaterSimulationMode.RealTime) + { + if (target._SampleDepthProbeDirectly && target._DepthProbe == null && !target.TryGetComponent(out target._DepthProbe) && GUILayout.Button("Add Depth Probe")) + { + var probe = Undo.AddComponent(target.gameObject); + probe.Managed = true; + probe.Scale = new(target._Width, target._Width); + probe.OverridePosition = target.Movable; + } + + if (target.DisplacementTarget == ShallowWaterSimulationInjection.Level && target.LevelTexture != null && GUILayout.Button(k_SwitchToBaked)) + { + Undo.RecordObject(target, k_SwitchToBaked); + target._Mode = ShallowWaterSimulationMode.Baked; + EditorUtility.SetDirty(target); + } + + if (target.DisplacementTarget == ShallowWaterSimulationInjection.Level && GUILayout.Button("Bake Output")) + { + target.Bake(); + } + + if (GUILayout.Button("Reset Simulation")) + { + target.ResetSimulation(); + } + + if (target._DepthProbe != null && GUILayout.Button("Populate Depth Probe & Reset Simulation")) + { + target._DepthProbe.Populate(); + target.ResetSimulation(); + } + } + else + { + if (GUILayout.Button(k_SwitchToRealTime)) + { + Undo.RecordObject(target, k_SwitchToRealTime); + target._Mode = ShallowWaterSimulationMode.RealTime; + EditorUtility.SetDirty(target); + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Editors.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Editors.cs.meta new file mode 100644 index 0000000..5f6005f --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Editors.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31bee5158a29c43d1a818204ec82bd7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Gizmos.cs b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Gizmos.cs new file mode 100644 index 0000000..dfdb565 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Gizmos.cs @@ -0,0 +1,107 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.ShallowWater.Editor +{ + static class Visualizers + { +#if CREST_DEBUG + internal static Material s_VisualizeMaterial; +#endif + + [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected)] + static void DrawGizmos(ShallowWaterSimulation target, GizmoType type) + { + var rect = target.Rect; + if (rect != Rect.zero && type.HasFlag(GizmoType.Selected)) + { + var height = target.Origin.y; + Gizmos.color = Color.magenta; + + Gizmos.DrawWireCube + ( + new(rect.center.x, height, rect.center.y), + new(rect.size.x, 0, rect.size.y) + ); + + if (target.InjectShape == ShallowWaterSimulationInjection.Level) + { + Gizmos.DrawCube + ( + new(rect.center.x - rect.size.x * 0.5f + target.PaddingWidth * 0.5f, height, rect.center.y), + new(target.PaddingWidth, 0, rect.size.y) + ); + + Gizmos.DrawCube + ( + new(rect.center.x + rect.size.x * 0.5f - target.PaddingWidth * 0.5f, height, rect.center.y), + new(target.PaddingWidth, 0, rect.size.y) + ); + + Gizmos.DrawCube + ( + new(rect.center.x, height, rect.center.y + rect.size.y * 0.5f - target.PaddingWidth * 0.5f), + new(rect.size.x - target.PaddingWidth * 2f, 0, target.PaddingWidth) + ); + + Gizmos.DrawCube + ( + new(rect.center.x, height, rect.center.y - rect.size.y * 0.5f + target.PaddingWidth * 0.5f), + new(rect.size.x - target.PaddingWidth * 2f, 0, target.PaddingWidth) + ); + + Gizmos.DrawWireCube + ( + new(rect.center.x, height, rect.center.y), + new(rect.size.x - target.PaddingWidth * 2f, 0, rect.size.y - target.PaddingWidth * 2f) + ); + } + } + +#if CREST_DEBUG + if (target._Debug._ShowSimulationDataInScene != ShallowWaterSimulation.DebugFields.SimulationData.None) + { + var water = WaterRenderer.Instance; + + if (water == null) + { + return; + } + + if (s_VisualizeMaterial == null) + { + s_VisualizeMaterial = new(Shader.Find("Hidden/Crest/Debug/Visualize Texture")); + } + + s_VisualizeMaterial.mainTexture = target._Debug._ShowSimulationDataInScene switch + { + ShallowWaterSimulation.DebugFields.SimulationData.Height => target._Height0, + ShallowWaterSimulation.DebugFields.SimulationData.Ground => target._GroundHeight, + ShallowWaterSimulation.DebugFields.SimulationData.VelocityX => target._VelocityX, + ShallowWaterSimulation.DebugFields.SimulationData.VelocityY => target._VelocityY, + ShallowWaterSimulation.DebugFields.SimulationData.Mask => target._Mask, + ShallowWaterSimulation.DebugFields.SimulationData.WaterLevel => target._WaterLevel, + _ => throw new System.NotImplementedException(), + }; + + if (s_VisualizeMaterial.mainTexture == null) + { + return; + } + + s_VisualizeMaterial.SetPass(0); + + Graphics.DrawMeshNow + ( + Helpers.QuadMesh, + Matrix4x4.TRS(target.Origin.XNZ(water.SeaLevel) + Vector3.up, Quaternion.Euler(90f, 0, 0), Vector3.one * target._Width) + ); + } +#endif + } + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Gizmos.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Gizmos.cs.meta new file mode 100644 index 0000000..b3de98d --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Gizmos.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f84a244b0410149688a75a2e39c545ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Previews.cs b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Previews.cs new file mode 100644 index 0000000..6f91aa9 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Previews.cs @@ -0,0 +1,73 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest.ShallowWater.Editor +{ + [CustomPreview(typeof(ShallowWaterSimulation))] + sealed class Preview : TexturePreview + { + RenderTexture _TemporaryRenderTexture; + + public override GUIContent GetPreviewTitle() => new("Shallow Water Simulation"); + protected override Texture OriginalTexture + { + get + { + if (_TemporaryRenderTexture != null) return _TemporaryRenderTexture; + // Return on of the textures to prove initialization. + var target = this.target as ShallowWaterSimulation; + return target._GroundHeight; + } + } + + public override void OnPreviewSettings() + { + base.OnPreviewSettings(); + // OnPreviewSettings is called after OnPreviewGUI so release here. + RenderTexture.ReleaseTemporary(_TemporaryRenderTexture); + _TemporaryRenderTexture = null; + } + + public override void Cleanup() + { + base.Cleanup(); + RenderTexture.ReleaseTemporary(_TemporaryRenderTexture); + } + + public override void OnPreviewGUI(Rect rect, GUIStyle background) + { + var target = this.target as ShallowWaterSimulation; + var descriptor = target._GroundHeight.descriptor; + descriptor.dimension = TextureDimension.Tex2DArray; + descriptor.volumeDepth = target._WaterLevel != null ? 6 : 5; + descriptor.useMipMap = false; + + // Copy textures to a single texture array. + _TemporaryRenderTexture = RenderTexture.GetTemporary(descriptor); + Graphics.CopyTexture(target._GroundHeight, 0, _TemporaryRenderTexture, 0); + Graphics.CopyTexture(target._Height1, 0, _TemporaryRenderTexture, 1); + Graphics.CopyTexture(target._VelocityX, 0, 0, _TemporaryRenderTexture, 2, 0); + Graphics.CopyTexture(target._VelocityY, 0, 0, _TemporaryRenderTexture, 3, 0); + Graphics.CopyTexture(target._Mask, 0, _TemporaryRenderTexture, 4); + if (target._WaterLevel != null) Graphics.CopyTexture(target._WaterLevel, 0, _TemporaryRenderTexture, 5); + + _TemporaryRenderTexture.name = _Slice switch + { + 0 => "Ground Height", + 1 => "Height", + 2 => "Velocity X", + 3 => "Velocity Y", + 4 => "Mask", + 5 => "Water Level", + _ => throw new System.NotImplementedException(), + }; + + base.OnPreviewGUI(rect, background); + } + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Previews.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Previews.cs.meta new file mode 100644 index 0000000..4225765 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Previews.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5da89db269e744232b9c777ae18c3b59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Validators.cs b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Validators.cs new file mode 100644 index 0000000..b2e12fe --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Validators.cs @@ -0,0 +1,184 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest.ShallowWater.Editor +{ + static class Validators + { + static readonly string s_TransformName = $"{nameof(Transform)}"; + static readonly string s_DepthProbeName = $"{nameof(DepthProbe)}"; + static readonly string s_ShallowWaterSimulationName = $"{nameof(ShallowWaterSimulation)}"; + + static void FixSetFeatureEnabled(SerializedObject so, string paramName, bool enabled) + { + var property = so.FindProperty(paramName); + var oldValue = property.boolValue; + property.boolValue = enabled; + DecoratedDrawer.OnChange(property, oldValue); + } + + [Validator(typeof(ShallowWaterSimulation))] + static bool Validate(ShallowWaterSimulation target, ValidatedHelper.ShowMessage messenger) + { + var isValid = true; + var water = Crest.Editor.Validators.Water; + + if (target._InjectShape == ShallowWaterSimulationInjection.Level) + { + isValid &= Crest.Editor.Validators.ValidateLod + ( + OptionalLod.Get(typeof(LevelLod)), + messenger, + water + ); + } + else if (target._InjectShape == ShallowWaterSimulationInjection.Waves) + { + isValid &= Crest.Editor.Validators.ValidateLod + ( + OptionalLod.Get(typeof(AnimatedWavesLod)), + messenger, + water + ); + } + + if (target._InjectFlow) + { + isValid &= Crest.Editor.Validators.ValidateLod + ( + OptionalLod.Get(typeof(FlowLod)), + messenger, + water + ); + } + + if (target._InjectFoam) + { + isValid &= Crest.Editor.Validators.ValidateLod + ( + OptionalLod.Get(typeof(FoamLod)), + messenger, + water + ); + } + + if (!target._SampleDepthProbeDirectly && target._Mode != ShallowWaterSimulationMode.Baked) + { + isValid &= Crest.Editor.Validators.ValidateLod + ( + OptionalLod.Get(typeof(DepthLod)), + messenger, + water + ); + } + + if (target._SampleDepthProbeDirectly && target._Mode != ShallowWaterSimulationMode.Baked) + { + if (target._DepthProbe == null) + { + messenger + ( + $"There is no {s_DepthProbeName} present on this {nameof(GameObject)}. " + + $"A {s_DepthProbeName} is often needed other than for simple cases like pools.", + $"Add a {s_DepthProbeName}.", + ValidatedHelper.MessageType.Info, target, + (x, _) => + { + var probe = ValidatedHelper.FixAttachComponent(x); + probe.Managed = true; + probe.Scale = new(target._Width, target._Width); + probe.OverridePosition = target.Movable; + } + ); + } + } + + if (target.Placement != Placement.Fixed && target.SampleDepthProbeDirectly && target._DepthProbe != null && target._DepthProbe.Type == DepthProbeMode.Baked) + { + messenger + ( + $"The attached {nameof(DepthProbe)} is baked, but {nameof(ShallowWaterSimulation.Placement)} is not set to {nameof(Placement.Fixed)}. " + + $"{nameof(DepthProbe)} cannot be baked at runtime, so these are incompatible.", + $"Either set the {nameof(DepthProbe)} to {nameof(DepthProbeMode.RealTime)} or set the {nameof(ShallowWaterSimulation)} to {nameof(Placement.Fixed)}.", + ValidatedHelper.MessageType.Error, target + ); + } + + if (target._Debug != null) + { + var isDebugging = target._Debug._SkipUpdate + || target._Debug._SkipAdvect + || target._Debug._SkipAdvectHeights + || target._Debug._SkipUpdateHeight + || target._Debug._SkipUpdateVelocities; + if (isDebugging) + { + messenger + ( + "Debug options currently disable one or more stages of the simulation.", + "Enable all simulation stages.", + ValidatedHelper.MessageType.Warning, target, + (so, _) => + { + FixSetFeatureEnabled(so, $"{nameof(ShallowWaterSimulation._Debug)}.{nameof(ShallowWaterSimulation._Debug._SkipUpdate)}", false); + FixSetFeatureEnabled(so, $"{nameof(ShallowWaterSimulation._Debug)}.{nameof(ShallowWaterSimulation._Debug._SkipUpdateHeight)}", false); + FixSetFeatureEnabled(so, $"{nameof(ShallowWaterSimulation._Debug)}.{nameof(ShallowWaterSimulation._Debug._SkipAdvect)}", false); + FixSetFeatureEnabled(so, $"{nameof(ShallowWaterSimulation._Debug)}.{nameof(ShallowWaterSimulation._Debug._SkipAdvectHeights)}", false); + FixSetFeatureEnabled(so, $"{nameof(ShallowWaterSimulation._Debug)}.{nameof(ShallowWaterSimulation._Debug._SkipUpdateVelocities)}", false); + } + ); + } + + if (target._Debug._ShowSimulationData) + { + messenger + ( + "Debug drawing of simulation data currently active.", + "Disable debug drawing when debugging is done to hide the overlay.", + ValidatedHelper.MessageType.Info, target, + (_, property) => property.boolValue = false, + $"{nameof(ShallowWaterSimulation._Debug)}.{nameof(ShallowWaterSimulation._Debug._ShowSimulationData)}" + ); + } + } + + if (!target._SampleDepthProbeDirectly && target.Placement == Placement.Transform && target.TryGetComponent(out var probe) && probe.isActiveAndEnabled) + { + messenger + ( + $"There is an active {nameof(DepthProbe)} on this game object, with both {nameof(ShallowWaterSimulation.SampleDepthProbeDirectly)} disabled and {nameof(ShallowWaterSimulation.Placement)} set to {Placement.Transform}. " + + "This will break the movement procedure.", + $"Either disable/remove the {nameof(DepthProbe)} or change one of those settings.", + ValidatedHelper.MessageType.Error, target + ); + } + + if (water == null) + { + return isValid; + } + + var layers = water.AnimatedWavesLod._CollisionLayers; + var flag = CollisionLayers.DynamicWaves; + + if (target._Mode == ShallowWaterSimulationMode.RealTime && water.DynamicWavesLod.Enabled && !layers.HasFlag(flag)) + { + messenger + ( + $"It is recommended to enable the {flag} collision layer, " + + "as this will solve a feedback loop where the water level grows perpetually.", + $"Enable {flag} collision layer", + ValidatedHelper.MessageType.Info, water, + (_, y) => y.intValue = (int)(layers | flag), + $"{nameof(WaterRenderer._AnimatedWavesLod)}.{nameof(WaterRenderer._AnimatedWavesLod._CollisionLayers)}" + ); + } + + return isValid; + } + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Validators.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Validators.cs.meta new file mode 100644 index 0000000..e82c027 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/Validators.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d68ceb75915cb474e80405e20ec44df7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/WaveHarmonic.Crest.ShallowWater.Editor.asmdef b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/WaveHarmonic.Crest.ShallowWater.Editor.asmdef new file mode 100644 index 0000000..c8f0a27 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/WaveHarmonic.Crest.ShallowWater.Editor.asmdef @@ -0,0 +1,36 @@ +{ + "name": "WaveHarmonic.Crest.ShallowWater.Editor", + "rootNamespace": "", + "references": [ + "GUID:7c347618730f5467f86a58f333ce21df", + "GUID:125c216bac85c4443bfd4de6bc7eda99", + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:1ab2a6c2a51cd4b43867788dbaee1a55", + "GUID:98db37baed0fc4b73a47a9d66f791aae" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER", + "d_Crest" + ], + "versionDefines": [ + { + "name": "com.waveharmonic.crest", + "expression": "", + "define": "d_Crest" + }, + { + "name": "com.waveharmonic.crest", + "expression": "5.6.0", + "define": "d_CrestValid" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/WaveHarmonic.Crest.ShallowWater.Editor.asmdef.meta b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/WaveHarmonic.Crest.ShallowWater.Editor.asmdef.meta new file mode 100644 index 0000000..e5ab23e --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Editor/Scripts/WaveHarmonic.Crest.ShallowWater.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7aedaf24b93474a0e9e30d5581dea238 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/ReadMe.txt b/Packages/com.waveharmonic.crest.shallow-water/ReadMe.txt new file mode 100644 index 0000000..ce224dc --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/ReadMe.txt @@ -0,0 +1,3 @@ +Thank you for purchasing! + +Offline manual is located in the Documentation~ folder in this package directory (viewable from OS file browser). diff --git a/Packages/com.waveharmonic.crest.shallow-water/ReadMe.txt.meta b/Packages/com.waveharmonic.crest.shallow-water/ReadMe.txt.meta new file mode 100644 index 0000000..408c08f --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/ReadMe.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e1f8989701a3a45b481a91144678cd77 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime.meta new file mode 100644 index 0000000..44ba977 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 35222819f15fa40a2bfdb2af5bdd2555 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts.meta new file mode 100644 index 0000000..3404acb --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 98e28ea6e6a7440bda4e25f938974a09 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Assembly.cs b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Assembly.cs new file mode 100644 index 0000000..8b94c6a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Assembly.cs @@ -0,0 +1,10 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if !d_CrestValid +#error "Your Crest package needs to be updated to be compatible with this version of Crest - Shallow Water." +#endif + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShallowWater.Editor")] diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Assembly.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Assembly.cs.meta new file mode 100644 index 0000000..73b1279 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2061b590ba9764266bfd44bf2655dd7b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated.meta new file mode 100644 index 0000000..da37fac --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 09f675371f4f6498b9e23c3e098df748 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/API.Generated.cs b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/API.Generated.cs new file mode 100644 index 0000000..a395468 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/API.Generated.cs @@ -0,0 +1,266 @@ +// + +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +namespace WaveHarmonic.Crest.ShallowWater +{ + partial class ShallowWaterSimulation + { + /// + /// Adds meters of additional water into the simulation domain on initialization. + /// + /// + /// Requires resetting the simulation. + /// + public float AdditionalWater { get => _AdditionalWater; set => _AdditionalWater = value; } + + /// + /// Affects depth-based blending of the simulation and animated waves (m). + /// + /// + /// For the minimum, when the water depth is less than this value, animated waves will not contribute at all, water shape will come purely from this simulation. + /// + public UnityEngine.Vector2 BlendDepthRange { get => _BlendDepthRange; set => _BlendDepthRange = value; } + + /// + /// The intensity at which waves inject water into the simulation. + /// + public float BlendPushUpStrength { get => _BlendPushUpStrength; set => _BlendPushUpStrength = value; } + + /// + /// Filters the mask. + /// + public int BlurMaskIterations { get => _BlurMaskIterations; set => _BlurMaskIterations = value; } + + /// + /// Filters the shape prior to rendering to smooth out sharp features. + /// + /// + /// Always enabled when baking. + /// + public bool BlurShapeForRender { get => _BlurShapeForRender; set => _BlurShapeForRender = value; } + + /// + /// Stability measure - limits velocities. Default 0.5. + /// + public float CourantNumber { get => _CourantNumber; set => _CourantNumber = value; } + + /// + /// Disable simulation if viewpoint is more than this distance outside simulation domain. + /// + public float CullDistance { get => _CullDistance; set => _CullDistance = value; } + + /// + /// The speed of the transition to its culled state. + /// + public float CullTransitionSpeed { get => _CullTransitionSpeed; set => _CullTransitionSpeed = value; } + + /// + /// The depth of the water in the shallow water simulation (m). + /// + /// + /// Any underwater surfaces deeper than this depth will not influence the sim. Large values can lead to instabilities / jitter in the result. Requires resetting the simulation. + /// + public float Depth { get => _Depth; set => _Depth = value; } + + /// + /// Rate at which to remove water at the boundaries of the domain. + /// + /// + /// Useful for preventing buildup of water when simulating shoreline waves. + /// + public float DrainWaterAtBoundaries { get => _DrainWaterAtBoundaries; set => _DrainWaterAtBoundaries = value; } + + /// + /// Recompute ground heights every frame. + /// + /// + /// Only enable this if terrain used by water system changes at runtime. + /// + public bool DynamicSeabed { get => _DynamicSeabed; set => _DynamicSeabed = value; } + + /// + /// Disable simulation when viewpoint far from domain. + /// + public bool EnableDistanceCulling { get => _EnableDistanceCulling; set => _EnableDistanceCulling = value; } + + /// + /// Rate at which to remove water at any location. + /// + /// + /// Useful for removing remaining water from lowering tides. + /// + public float Evaporation { get => _Evaporation; set => _Evaporation = value; } + + /// + /// Multiplies flow output to scale when injecting. + /// + public float FlowStrength { get => _FlowStrength; set => _FlowStrength = value; } + + /// + /// The baked texture for flow. + /// + public UnityEngine.Texture2D FlowTexture { get => _FlowTexture; set => _FlowTexture = value; } + + /// + /// Multiplies foam output to scale when injecting. + /// + public float FoamStrength { get => _FoamStrength; set => _FoamStrength = value; } + + /// + /// The baked texture for foam. + /// + public UnityEngine.Texture2D FoamTexture { get => _FoamTexture; set => _FoamTexture = value; } + + /// + /// Friction applied to water to prevent dampen velocities. + /// + public float Friction { get => _Friction; set => _Friction = value; } + + /// + /// Add the resulting flow velocities to the water system. + /// + public bool InjectFlow { get => _InjectFlow; set => _InjectFlow = value; } + + /// + /// Add the resulting foam to the water system. + /// + public bool InjectFoam { get => _InjectFoam; set => _InjectFoam = value; } + + /// + /// Add the resulting shape to the water system. + /// + /// + /// If blending data from waves or height then use Waves or Level respectively. Requires resetting the simulation. + /// + public ShallowWaterSimulationInjection InjectShape { get => _InjectShape; set => _InjectShape = value; } + + /// + /// The baked texture for water level. + /// + public UnityEngine.Texture2D LevelTexture { get => _LevelTexture; set => _LevelTexture = value; } + + /// + /// Inform water how much this input will displace the water surface vertically. + /// + /// + /// This is used for culling water tiles. + /// + public float MaximumDisplacementVertical { get => _MaximumDisplacementVertical; set => _MaximumDisplacementVertical = value; } + + /// + /// Maximum resolution of simulation grid. + /// + /// + /// Safety limit to avoid simulation using large amount of video memory. Requires resetting the simulation. + /// + public int MaximumResolution { get => _MaximumResolution; set => _MaximumResolution = value; } + + /// + /// Whether to use the baked textures. + /// + /// + /// Only supported by water level. + /// + public ShallowWaterSimulationMode Mode { get => _Mode; set => _Mode = value; } + + /// + /// Overshoot is artifacts where the water will spike sharply. + /// + public float OvershootReductionStrength { get => _OvershootReductionStrength; set => _OvershootReductionStrength = value; } + + /// + /// Padding area for zero activity at the edge of the domain. + /// + /// + /// Adds padding so that simulation edge can overlap with height inputs without causing a seam (m). It is important that the padding fully overlaps the water level input, or there may be a gap. Visualized by the gizmo. + /// + public float PaddingWidth { get => _PaddingWidth; set => _PaddingWidth = value; } + + /// + /// Places the simulation at sea level. + /// + /// + /// Requires resetting the simulation. + /// + public bool PlaceAtSeaLevel { get => _PlaceAtSeaLevel; set => _PlaceAtSeaLevel = value; } + + /// + /// Where the simulation is placed. + /// + /// + /// The default performs the best. + /// + public WaveHarmonic.Crest.Placement Placement { get => GetPlacement(); set => _Placement = value; } + + /// + /// Preconfigures the simulation for a specific use case. + /// + /// + /// Requires resetting the simulation. + /// + public ShallowWaterSimulationPreset Preset { get => _Preset; set => SetPreset(_Preset, _Preset = value); } + + /// + /// Whether to sample the Depth Probe directly. + /// + /// + /// If disabled then data will come from the LODs which will have precision losses depending on camera position. Only disable if necessary. Requires resetting the simulation. + /// + public bool SampleDepthProbeDirectly { get => _SampleDepthProbeDirectly; set => _SampleDepthProbeDirectly = value; } + + /// + /// Whether to sample water level inputs directly. + /// + /// + /// If disabled then data will come from the LODs which will have precision losses depending on camera position. Only disable if necessary. This option only supports water level inputs using the Geometry, Spline or Renderer modes. Requires resetting the simulation. + /// + public bool SampleWaterLevelInputsDirectly { get => GetSampleWaterLevelInputsDirectly(); set => _SampleWaterLevelInputsDirectly = value; } + + /// + /// Simulation resolution - width of simulation grid cell (m). + /// + /// + /// Smaller values will increase resolution but take more computation time and memory, and may lead to instabilities for small values. Requires resetting the simulation. + /// + public float TexelSize { get => _TexelSize; set => _TexelSize = value; } + + /// + /// Time step used for simulation (s). + /// + /// + /// Smaller values can make simulation more stable but requires more runtime computation. + /// + public float TimeStep { get => _TimeStep; set => _TimeStep = value; } + + /// + /// Adds a margin around the water level to prevent water from degenerating at a distance and prevents water wall creep (px). + /// + public bool WaterEdgeMargin { get => _WaterEdgeMargin; set => _WaterEdgeMargin = value; } + + /// + /// Same as Margin Width but for baking only. + /// + /// + /// Will use the larger value of the two. + /// + public int WaterEdgeMarginBakedWidth { get => _WaterEdgeMarginBakedWidth; set => _WaterEdgeMarginBakedWidth = value; } + + /// + /// Width of the margin. + /// + /// + /// The default is the optimal width. + /// + public int WaterEdgeMarginWidth { get => _WaterEdgeMarginWidth; set => _WaterEdgeMarginWidth = value; } + + /// + /// The width of the simulation area (m). + /// + /// + /// Enable gizmos to see a wireframe outline of the domain. Requires resetting the simulation. + /// + public float Width { get => _Width; set => _Width = value; } + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/API.Generated.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/API.Generated.cs.meta new file mode 100644 index 0000000..6d965b4 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/API.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4e6cb7325f09471f83a777af615e43d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/Documentation.Generated.cs b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/Documentation.Generated.cs new file mode 100644 index 0000000..1e93f3e --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/Documentation.Generated.cs @@ -0,0 +1,59 @@ +// + +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +namespace WaveHarmonic.Crest.ShallowWater.Generated +{ + enum ShallowWaterSimulationInjection + { + /// + /// Inject into the Animated Waves. + /// + Waves, + + /// + /// Inject into Water Level. + /// + Level, + } +} + + +namespace WaveHarmonic.Crest.ShallowWater.Generated +{ + enum ShallowWaterSimulationMode + { + /// + /// Simulate every frame. + /// + RealTime, + + /// + /// Simulation output has been baked to a texture. + /// + Baked, + } +} + + +namespace WaveHarmonic.Crest.ShallowWater.Generated +{ + enum ShallowWaterSimulationPreset + { + /// + /// All options available. + /// + None, + + /// + /// Only shows options for shorelines. + /// + Shoreline, + + /// + /// Only shows options for streams. + /// + Stream, + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/Documentation.Generated.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/Documentation.Generated.cs.meta new file mode 100644 index 0000000..3abe4f9 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/Generated/Documentation.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ae54924f0199462182f9afdd2b914aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterSimulation.cs b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterSimulation.cs new file mode 100644 index 0000000..15bbb4a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterSimulation.cs @@ -0,0 +1,1869 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.ShallowWater +{ + /// + /// 's update mode. + /// + [@GenerateDoc] + public enum ShallowWaterSimulationMode + { + /// + [Tooltip("Simulate every frame.")] + [InspectorName("Real-Time")] + RealTime, + + /// + [Tooltip("Simulation output has been baked to a texture.")] + Baked, + } + + /// + /// Where to inject the displacement. + /// + [@GenerateDoc] + public enum ShallowWaterSimulationInjection + { + /// + [Tooltip("Inject into the Animated Waves.")] + Waves = 1, + + /// + [Tooltip("Inject into Water Level.")] + Level = 2, + } + + /// + /// Preset options for the + /// + [@GenerateDoc] + public enum ShallowWaterSimulationPreset + { + /// + [Tooltip("All options available.")] + None, + + /// + [Tooltip("Only shows options for shorelines.")] + Shoreline, + + /// + [Tooltip("Only shows options for streams.")] + Stream, + } + + /// + /// Runs a shallow water simulation at global sea level in a domain around its transform, + /// and injects the results of the simulation into the water data. + /// + [@ExecuteDuringEditMode] + [@HelpURL("Packages/ShallowWater/Manual.html")] + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Shallow Water Simulation")] + public sealed partial class ShallowWaterSimulation : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Group("General", Group.Style.Accordian)] + + [Tooltip("Preconfigures the simulation for a specific use case.\n\nRequires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + ShallowWaterSimulationPreset _Preset; + + [@Space(10)] + + [Tooltip("The width of the simulation area (m).\n\nEnable gizmos to see a wireframe outline of the domain. Requires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(8, 1024)] + [@GenerateAPI] + [SerializeField] + internal float _Width = 64f; + + [Tooltip("The depth of the water in the shallow water simulation (m).\n\nAny underwater surfaces deeper than this depth will not influence the sim. Large values can lead to instabilities / jitter in the result. Requires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(0.1f, 16.0f)] + [@GenerateAPI] + [SerializeField] + float _Depth = 2f; + + [Tooltip("Where the simulation is placed.\n\nThe default performs the best.")] + [@Predicated(nameof(_InjectShape), inverted: true, nameof(ShallowWaterSimulationInjection.Waves), hide: true)] + [@ShowComputedProperty(nameof(Placement))] + [@GenerateAPI(Getter.Custom)] + [@DecoratedField, SerializeField] + Placement _Placement; + + [Tooltip("Places the simulation at sea level.\n\nRequires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _PlaceAtSeaLevel = true; + + [Tooltip("Friction applied to water to prevent dampen velocities.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _Friction = 0.02f; + + [Tooltip("Recompute ground heights every frame.\n\nOnly enable this if terrain used by water system changes at runtime.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _DynamicSeabed = false; + + [Tooltip("Whether to sample the Depth Probe directly.\n\nIf disabled then data will come from the LODs which will have precision losses depending on camera position. Only disable if necessary. Requires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _SampleDepthProbeDirectly = true; + + [Tooltip("Whether to sample water level inputs directly.\n\nIf disabled then data will come from the LODs which will have precision losses depending on camera position. Only disable if necessary. This option only supports water level inputs using the Geometry, Spline or Renderer modes. Requires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Predicated(nameof(_InjectShape), inverted: true, nameof(ShallowWaterSimulationInjection.Level), hide: true)] + [@GenerateAPI(Getter.Custom)] + [@DecoratedField, SerializeField] + internal bool _SampleWaterLevelInputsDirectly = true; + + [@Space(10)] + + [Tooltip("Adds meters of additional water into the simulation domain on initialization.\n\nRequires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _AdditionalWater; + + [Tooltip("Rate at which to remove water at the boundaries of the domain.\n\nUseful for preventing buildup of water when simulating shoreline waves.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _DrainWaterAtBoundaries = -0.01f; + + [Tooltip("Rate at which to remove water at any location.\n\nUseful for removing remaining water from lowering tides.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(0.0f, 0.001f, Range.Clamp.Minimum)] + [@GenerateAPI] + [SerializeField] + float _Evaporation; + + + [@Heading("Source Blending")] + + [@Label("Depth Range")] + [Tooltip("Affects depth-based blending of the simulation and animated waves (m).\n\nFor the minimum, when the water depth is less than this value, animated waves will not contribute at all, water shape will come purely from this simulation.\n\nFor the maximum, when the water depth is greater than this value, this simulation will not contribute at all, water shape will come purely from the normal ocean waves.\n\nNegative depths are valid and occur when surfaces are above sea level.")] + [@Predicated(nameof(_InjectShape), inverted: false, nameof(ShallowWaterSimulationInjection.Level), hide: true)] + [@Range(-10f, 10f)] + [@GenerateAPI] + [SerializeField] + Vector2 _BlendDepthRange = new(0f, 4f); + + [@Label("Push Up Strength")] + [Tooltip("The intensity at which waves inject water into the simulation.")] + [@Predicated(nameof(_InjectShape), inverted: false, nameof(ShallowWaterSimulationInjection.Level), hide: true)] + [@Range(0f, 1f, Range.Clamp.Minimum)] + [@GenerateAPI] + [SerializeField] + float _BlendPushUpStrength = 0.1f; + + + [Heading("Distance Culling")] + + [@Label("Enable")] + [Tooltip("Disable simulation when viewpoint far from domain.")] + [@Predicated(nameof(_InjectShape), inverted: false, nameof(ShallowWaterSimulationInjection.Level), hide: true)] + [@Predicated(nameof(_Placement), inverted: true, nameof(Placement.Fixed))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _EnableDistanceCulling = true; + + [Tooltip("Disable simulation if viewpoint is more than this distance outside simulation domain.")] + [@Predicated(nameof(_InjectShape), inverted: false, nameof(ShallowWaterSimulationInjection.Level), hide: true)] + [@Predicated(nameof(_Placement), inverted: true, nameof(Placement.Fixed))] + [@Predicated(nameof(_EnableDistanceCulling))] + [@Range(1f, 1024f)] + [@GenerateAPI] + [SerializeField] + float _CullDistance = 75.0f; + + [Tooltip("The speed of the transition to its culled state.")] + [@Predicated(nameof(_InjectShape), inverted: false, nameof(ShallowWaterSimulationInjection.Level), hide: true)] + [@Predicated(nameof(_Placement), inverted: true, nameof(Placement.Fixed))] + [@Predicated(nameof(_EnableDistanceCulling))] + [@Range(0.01f, 1f)] + [@GenerateAPI] + [SerializeField] + float _CullTransitionSpeed = 0.5f; + + + [Group("Stability", Group.Style.Accordian)] + + [Tooltip("Time step used for simulation (s).\n\nSmaller values can make simulation more stable but requires more runtime computation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(0.001f, 0.03333333f)] + [@GenerateAPI] + [SerializeField] + float _TimeStep = 0.01f; + + [Tooltip("Stability measure - limits velocities. Default 0.5.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _CourantNumber = 0.5f; + + [Tooltip("Overshoot is artifacts where the water will spike sharply.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(0.1f, 0.5f)] + [@GenerateAPI] + [SerializeField] + float _OvershootReductionStrength = 0.25f; + + + [Group("Quality", Group.Style.Accordian)] + + [Tooltip("Simulation resolution - width of simulation grid cell (m).\n\nSmaller values will increase resolution but take more computation time and memory, and may lead to instabilities for small values. Requires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(0.01f, 2f)] + [@GenerateAPI] + [SerializeField] + float _TexelSize = 32f / 512f; + + [Tooltip("Maximum resolution of simulation grid.\n\nSafety limit to avoid simulation using large amount of video memory. Requires resetting the simulation.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(16, 4096)] + [@GenerateAPI] + [SerializeField] + int _MaximumResolution = 1024; + + [@Space(10)] + + [Tooltip("Filters the shape prior to rendering to smooth out sharp features.\n\nAlways enabled when baking.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _BlurShapeForRender = true; + + [Tooltip("Filters the mask.")] + [@Predicated(nameof(_InjectShape), inverted: false, nameof(ShallowWaterSimulationInjection.Level), hide: true)] + [@Range(0, 64)] + [@GenerateAPI] + [SerializeField] + int _BlurMaskIterations = 10; + + [@Heading("Water Edge Margin")] + + [Tooltip("Adds a margin around the water level to prevent water from degenerating at a distance and prevents water wall creep (px).")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Label("Enable")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _WaterEdgeMargin = true; + + [@Label("Margin Width")] + [Tooltip("Width of the margin.\n\nThe default is the optimal width.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(1, 64)] + [@GenerateAPI] + [SerializeField] + int _WaterEdgeMarginWidth = 4; + + [@Label("Margin Width (Baked)")] + [Tooltip("Same as Margin Width but for baking only.\n\nWill use the larger value of the two.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Predicated(nameof(_InjectShape), inverted: true, nameof(ShallowWaterSimulationInjection.Level))] + [@Range(1, 64)] + [@GenerateAPI] + [SerializeField] +#pragma warning disable CS0414 + int _WaterEdgeMarginBakedWidth = 32; +#pragma warning restore CS0414 + + + [Group("Output", Group.Style.Accordian)] + + [Tooltip("Whether to use the baked textures.\n\nOnly supported by water level.")] + [@Predicated(nameof(_InjectShape), inverted: false, nameof(ShallowWaterSimulationInjection.Waves), hide: false)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal ShallowWaterSimulationMode _Mode = ShallowWaterSimulationMode.RealTime; + + [@Heading("Shape", alwaysEnabled: true)] + + [@Label("Inject")] + [Tooltip("Add the resulting shape to the water system.\n\nIf blending data from waves or height then use Waves or Level respectively. Requires resetting the simulation.")] + [@Predicated(nameof(_Preset), inverted: true, nameof(ShallowWaterSimulationPreset.None), hide: false)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal ShallowWaterSimulationInjection _InjectShape = ShallowWaterSimulationInjection.Waves; + + [@Label("Baked Texture")] + [Tooltip("The baked texture for water level.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.RealTime))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + Texture2D _LevelTexture; + + [@Label("Report Maximum Displacement")] + [Tooltip("Inform water how much this input will displace the water surface vertically.\n\nThis is used for culling water tiles.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _MaximumDisplacementVertical = 0f; + + [@Label("Domain Padding")] + [Tooltip("Padding area for zero activity at the edge of the domain.\n\nAdds padding so that simulation edge can overlap with height inputs without causing a seam (m). It is important that the padding fully overlaps the water level input, or there may be a gap. Visualized by the gizmo.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Predicated(nameof(_InjectShape), inverted: true, nameof(ShallowWaterSimulationInjection.Level))] + [@Range(0f, 10f)] + [@GenerateAPI] + [SerializeField] + float _PaddingWidth = 2f; + + + [@Heading("Flow")] + + [@Label("Inject")] + [Tooltip("Add the resulting flow velocities to the water system.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _InjectFlow = true; + + [@Label("Baked Texture")] + [Tooltip("The baked texture for flow.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.RealTime))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + Texture2D _FlowTexture; + + [@Label("Strength")] + [Tooltip("Multiplies flow output to scale when injecting.")] + [@Predicated(nameof(_InjectFlow))] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(0, 10f, Range.Clamp.Minimum)] + [@GenerateAPI] + [SerializeField] + float _FlowStrength = 1f; + + [@Heading("Foam")] + + [@Label("Inject")] + [Tooltip("Add the resulting foam to the water system.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _InjectFoam = true; + + [@Label("Baked Texture")] + [Tooltip("The baked texture for foam.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.RealTime))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + Texture2D _FoamTexture; + + [@Label("Strength")] + [Tooltip("Multiplies foam output to scale when injecting.")] + [@Predicated(nameof(_InjectFoam))] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@Range(0, 10f, Range.Clamp.Minimum)] + [@GenerateAPI] + [SerializeField] + float _FoamStrength = 1f; + + + [@Group("Debug", isCustomFoldout: true)] + + [@DecoratedField(isCustomFoldout: true), SerializeField] + internal DebugFields _Debug = new(); + + [System.Serializable] + internal sealed class DebugFields + { + [@Heading("Stages")] + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _SkipUpdate; + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _SkipUpdateHeight; + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _SkipUpdateVelocities; + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _SkipAdvect; + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _SkipAdvectHeights; + + + [@Heading("Stability")] + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _DisableStabilityImprovements; + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _DisableMacCormackScheme; + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _DisableMacCormackSchemeForHeight; + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _DisableUpwindHeight; + + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _DisableDepthLimiter; + + [Tooltip("Overshoot is artifacts where the water will spike sharply.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(ShallowWaterSimulationMode.Baked))] + [@DecoratedField, SerializeField] + public bool _DisableOvershootReduction; + + + [@Heading("Baking")] + + [@Label("Execute Simulation")] + [Tooltip("Useful for rebaking.")] + [@DecoratedField, SerializeField] + public bool _AlwaysExecuteSimulation; + + + [@Heading("Output")] + [@DecoratedField, SerializeField] + public bool _SkipInjectShape; + + + [@Heading("Debug Overlay")] + + [@DecoratedField, SerializeField] + public bool _ShowSimulationData = false; + +#if !CREST_DEBUG + [HideInInspector] +#endif + [@DecoratedField, SerializeField] + public SimulationData _ShowSimulationDataInScene; + + public enum SimulationData + { + None, + Ground, + Height, + VelocityX, + VelocityY, + Mask, + WaterLevel, + } + } + + + const string k_DrawSWS = "SWS"; + + + static class ShaderIDs + { + // Shader properties. + public static readonly int s_DomainWidth = Shader.PropertyToID("_Crest_DomainWidth"); + public static readonly int s_DomainOrigin = Shader.PropertyToID("_Crest_DomainOrigin"); + public static readonly int s_TexelSize = Shader.PropertyToID("_Crest_TexelSize"); + public static readonly int s_SimulationDeltaTime = Shader.PropertyToID("_Crest_SimulationDeltaTime"); + public static readonly int s_AddAdditionalWater = Shader.PropertyToID("_Crest_AddAdditionalWater"); + public static readonly int s_DrainWaterAtBoundaries = Shader.PropertyToID("_Crest_DrainWaterAtBoundaries"); + public static readonly int s_Evaporation = Shader.PropertyToID("_Crest_Evaporation"); + public static readonly int s_Friction = Shader.PropertyToID("_Crest_Friction"); + public static readonly int s_MaximumVelocity = Shader.PropertyToID("_Crest_MaximumVelocity"); + public static readonly int s_ShallowMinimumDepth = Shader.PropertyToID("_Crest_ShallowMinimumDepth"); + public static readonly int s_ShallowMaximumDepth = Shader.PropertyToID("_Crest_ShallowMaximumDepth"); + public static readonly int s_BlendPushUpStrength = Shader.PropertyToID("_Crest_BlendPushUpStrength"); + public static readonly int s_MacCormackAdvection = Shader.PropertyToID("_Crest_MacCormackAdvection"); + public static readonly int s_MacCormackAdvectionForHeight = Shader.PropertyToID("_Crest_MacCormackAdvectionForHeight"); + public static readonly int s_UpwindHeight = Shader.PropertyToID("_Crest_UpwindHeight"); + public static readonly int s_DepthLimiter = Shader.PropertyToID("_Crest_DepthLimiter"); + public static readonly int s_OvershootReductionStrength = Shader.PropertyToID("_Crest_OvershootReductionStrength"); + public static readonly int s_InjectLevel = Shader.PropertyToID("_Crest_InjectLevel"); + public static readonly int s_MarginWidth = Shader.PropertyToID("_Crest_MarginWidth"); + + // Injection + public static readonly int s_InjectionStrength = Shader.PropertyToID("_Crest_InjectionStrength"); + public static readonly int s_InjectionMaximum = Shader.PropertyToID("_Crest_InjectionMaximum"); + public static readonly int s_SampleFromDepthProbe = Shader.PropertyToID("_Crest_SampleFromDepthProbe"); + public static readonly int s_SampleFromLevelInputs = Shader.PropertyToID("_Crest_SampleFromLevelInputs"); + + // Baking + public static readonly int s_FoamBakeTarget = Shader.PropertyToID("_Crest_FoamBakeTarget"); + public static readonly int s_FlowBakeTarget = Shader.PropertyToID("_Crest_FlowBakeTarget"); + public static readonly int s_LevelBakeTarget = Shader.PropertyToID("_Crest_LevelBakeTarget"); + + // Simulation textures + public static readonly int s_GroundHeightSource = Shader.PropertyToID("_Crest_GroundHeightSource"); + public static readonly int s_GroundHeightTarget = Shader.PropertyToID("_Crest_GroundHeightTarget"); + public static readonly int s_HeightSource = Shader.PropertyToID("_Crest_HeightSource"); + public static readonly int s_HeightTarget = Shader.PropertyToID("_Crest_HeightTarget"); + public static readonly int s_VelocityXSource = Shader.PropertyToID("_Crest_VelocityXSource"); + public static readonly int s_VelocityXTarget = Shader.PropertyToID("_Crest_VelocityXTarget"); + public static readonly int s_VelocityYSource = Shader.PropertyToID("_Crest_VelocityYSource"); + public static readonly int s_VelocityYTarget = Shader.PropertyToID("_Crest_VelocityYTarget"); + public static readonly int s_MaskSource = Shader.PropertyToID("_Crest_MaskSource"); + public static readonly int s_MaskTarget = Shader.PropertyToID("_Crest_MaskTarget"); + public static readonly int s_LevelSource = Shader.PropertyToID("_Crest_LevelSource"); + + // External + public static readonly int s_Height = Shader.PropertyToID("_Crest_Height"); + public static readonly int s_GroundHeight = Shader.PropertyToID("_Crest_GroundHeight"); + public static readonly int s_VelocityX = Shader.PropertyToID("_Crest_VelocityX"); + public static readonly int s_VelocityY = Shader.PropertyToID("_Crest_VelocityY"); + + public static readonly int s_ShapeTarget = Shader.PropertyToID("_Crest_ShapeTarget"); + public static readonly int s_LevelTarget = Shader.PropertyToID("_Crest_LevelTarget"); + public static readonly int s_FlowTarget = Shader.PropertyToID("_Crest_FlowTarget"); + public static readonly int s_FoamTarget = Shader.PropertyToID("_Crest_FoamTarget"); + + public static readonly int s_Temporary0 = Shader.PropertyToID("_Crest_Temporary0"); + public static readonly int s_Temporary1 = Shader.PropertyToID("_Crest_Temporary1"); + } + + static readonly List s_Instances = new(); + + internal static ShallowWaterSimulation Get(Rect rect) + { + foreach (var instance in s_Instances) + { + // Return first. + if (instance.Rect.Overlaps(rect)) return instance; + } + + return null; + } + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnDomainReload() + { + s_Instances.Clear(); + } + + internal int Resolution { get; private set; } = -1; + float _ActualTexelSize; + + // The final height to output (including blur). + internal RenderTexture _Height0; + // Keeps track of height data. Becomes the source for the next frame. + internal RenderTexture _Height1; + internal RenderTexture _VelocityX; + internal RenderTexture _VelocityY; + internal RenderTexture _Mask; + internal RenderTexture _GroundHeight; + internal RenderTexture _WaterLevel; + + CommandBuffer _CommandBuffer; + + ComputeShader _ComputeShader; + int _KernelInitialize; + int _KernelInitializeGroundHeight; + int _KernelAdvect; + int _KernelUpdateHeight; + int _KernelHeightOvershootReduction; + int _KernelUpdateVelocity; + int _KernelBlurHeight; + int _KernelBlur; + int _KernelMaskEdge; + int _KernelExpandEdge; + int _KernelFinalizeHeight; + int _KernelInjectShape; + int _KernelInjectLevel; + int _KernelInjectFoam; + int _KernelInjectFlow; + int _KernelBakeFoam; + int _KernelBakeFlow; + int _KernelBakeLevel; + + float _TimeToSimulate = 0f; + bool _FirstUpdate = true; + bool _UpdateGroundHeight; + Vector3 _PreviousOrigin; + Vector2Int _PreviousTexel; + internal DepthProbe _DepthProbe; + float _Weight = 1f; +#pragma warning disable CS0414 + bool _Allocated; +#pragma warning restore CS0414 + + internal ShallowWaterSimulationInjection DisplacementTarget => _InjectShape; + internal bool Movable => _Placement != Placement.Fixed; + + // Currently sim will be placed _depth below global sea level + internal Vector3 Origin + { + get + { + var result = transform.position; + + var water = WaterRenderer.Instance; + + if (_Placement == Placement.Viewpoint && water != null) + { + result = water.Viewpoint.position.XNZ(transform.position.y); + } + + if (Movable) + { + result.x = Mathf.Round(result.x / _ActualTexelSize) * _ActualTexelSize; + result.z = Mathf.Round(result.z / _ActualTexelSize) * _ActualTexelSize; + } + + if (water != null && (!water.LevelLod.Enabled || _PlaceAtSeaLevel)) + { + result.y = water.transform.position.y; + } + + // Sim origin is at 'bottom' of domain, water height/ground height are added + result.y -= _Depth; + + return result; + } + } + + void UpdateResolution() + { + Resolution = Mathf.CeilToInt(_Width / _TexelSize); + Resolution = Mathf.Min(Resolution, _MaximumResolution); + _ActualTexelSize = _Width / Resolution; + } + + void Allocate() + { + if (_Allocated) + { + return; + } + + if (_Mode == ShallowWaterSimulationMode.Baked && !_Debug._AlwaysExecuteSimulation) + { + return; + } + + if (_ComputeShader == null) + { + _ComputeShader = WaterResources.Instance.Compute._UpdateSWS; + + _KernelInitialize = _ComputeShader.FindKernel("CrestInitialize"); + _KernelInitializeGroundHeight = _ComputeShader.FindKernel("CrestInitializeGroundHeight"); + _KernelAdvect = _ComputeShader.FindKernel("CrestAdvect"); + _KernelUpdateHeight = _ComputeShader.FindKernel("CrestUpdateHeight"); + _KernelHeightOvershootReduction = _ComputeShader.FindKernel("CrestHeightOvershootReduction"); + _KernelUpdateVelocity = _ComputeShader.FindKernel("CrestUpdateVelocity"); + _KernelBlurHeight = _ComputeShader.FindKernel("CrestBlurHeight"); + _KernelBlur = _ComputeShader.FindKernel("CrestBlur"); + _KernelMaskEdge = _ComputeShader.FindKernel("CrestMaskEdge"); + _KernelExpandEdge = _ComputeShader.FindKernel("CrestExpandEdge"); + _KernelFinalizeHeight = _ComputeShader.FindKernel("CrestFinalizeHeight"); + _KernelInjectShape = _ComputeShader.FindKernel("CrestInjectShape"); + _KernelInjectLevel = _ComputeShader.FindKernel("CrestInjectLevel"); + _KernelInjectFlow = _ComputeShader.FindKernel("CrestInjectFlow"); + _KernelInjectFoam = _ComputeShader.FindKernel("CrestInjectFoam"); + _KernelBakeFoam = _ComputeShader.FindKernel("CrestBakeFoam"); + _KernelBakeFlow = _ComputeShader.FindKernel("CrestBakeFlow"); + _KernelBakeLevel = _ComputeShader.FindKernel("CrestBakeLevel"); + } + + if (_SampleDepthProbeDirectly && TryGetComponent(out _DepthProbe)) + { + _DepthProbe.Managed = true; + _DepthProbe.Scale = new(_Width, _Width); + _DepthProbe.OverridePosition = Movable; + } + + // Empty constructer will prevent texture from flipping correctly. + var descriptor = new RenderTextureDescriptor(0, 0) + { + height = Resolution, + width = Resolution, + dimension = TextureDimension.Tex2D, + volumeDepth = 1, + enableRandomWrite = true, + colorFormat = RenderTextureFormat.RFloat, + msaaSamples = 1, + mipCount = 2, + }; + + var mipped = descriptor; + mipped.useMipMap = true; + mipped.autoGenerateMips = false; + + Helpers.SafeCreateRenderTexture("_CrestGroundHeight", ref _GroundHeight, descriptor); + Helpers.SafeCreateRenderTexture("_CrestHeight0", ref _Height0, descriptor); + Helpers.SafeCreateRenderTexture("_CrestHeight1", ref _Height1, descriptor); + Helpers.SafeCreateRenderTexture("_CrestVelocityX", ref _VelocityX, mipped); + Helpers.SafeCreateRenderTexture("_CrestVelocityY", ref _VelocityY, mipped); + Helpers.SafeCreateRenderTexture("_CrestMask", ref _Mask, descriptor); + + if (SampleWaterLevelInputsDirectly) + { + descriptor.enableRandomWrite = false; + Helpers.SafeCreateRenderTexture("_Crest_ShallowWaterLevel", ref _WaterLevel, descriptor); + } + + _Allocated = true; + } + + void Release() + { + if (_Height0 != null) _Height0.Release(); + if (_Height1 != null) _Height1.Release(); + if (_VelocityX != null) _VelocityX.Release(); + if (_VelocityY != null) _VelocityY.Release(); + if (_GroundHeight != null) _GroundHeight.Release(); + if (_Mask != null) _Mask.Release(); + if (_WaterLevel != null) _WaterLevel.Release(); + if (_SampleDepthProbeDirectly && _DepthProbe != null) _DepthProbe.Managed = false; + _FirstUpdate = true; + _Allocated = false; + } + + void Destroy() + { + Helpers.Destroy(_Height0); + Helpers.Destroy(_Height1); + Helpers.Destroy(_VelocityX); + Helpers.Destroy(_VelocityY); + Helpers.Destroy(_GroundHeight); + Helpers.Destroy(_Mask); + } + + /// + /// Resets the simulation. Needs to be called after certain property changes. + /// + /// Whether to also re-populate/re-bake the , if applicable. + public void ResetSimulation(bool populateDepthProbe = false) + { + if (populateDepthProbe && _SampleDepthProbeDirectly && (_DepthProbe != null || TryGetComponent(out _DepthProbe))) + { + _DepthProbe.Managed = true; + _DepthProbe.Scale = new(_Width, _Width); + _DepthProbe.OverridePosition = Movable; + _DepthProbe.Populate(); + } + + Release(); + Allocate(); + } + + void InitializeSimulation(CommandBuffer buffer, RenderTargetIdentifier xVelocity, RenderTargetIdentifier yVelocity) + { + // Initialize simulation data - water heights and velocities. + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelInitialize); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_HeightTarget, _Height1); + wrapper.SetTexture(ShaderIDs.s_VelocityXTarget, xVelocity); + wrapper.SetTexture(ShaderIDs.s_VelocityYTarget, yVelocity); + wrapper.SetTexture(ShaderIDs.s_LevelSource, SampleWaterLevelInputsDirectly ? _WaterLevel : Texture2D.blackTexture); + wrapper.Dispatch((_Height1.width + 7) / 8, (_Height1.height + 7) / 8, 1); + } + + void Execute(WaterRenderer water, CommandBuffer buffer) + { +#if UNITY_EDITOR + if (_Dirty) + { + return; + } +#endif + + buffer.BeginSample(k_DrawSWS); + + Allocate(); + + // Safety first. + _TimeStep = Mathf.Max(_TimeStep, 0.001f); + // Compute substeps. + _TimeToSimulate += water.DeltaTime; + var steps = _TimeToSimulate > 0f ? Mathf.CeilToInt(_TimeToSimulate / _TimeStep) : 0; + _TimeToSimulate -= steps * _TimeStep; + + var xVelocityTarget = new RenderTargetIdentifier(_VelocityX); + var yVelocityTarget = new RenderTargetIdentifier(_VelocityY); + + var origin = Origin; + + // NOTE: Initialisation of everything happens in update because it requires Crest to be initialised for + // sea floor depth and numerous other state. + if (_FirstUpdate) + { + _PreviousOrigin = origin; + _PreviousTexel = new + ( + Mathf.RoundToInt(_PreviousOrigin.x * (_GroundHeight.width / _Width)), + Mathf.RoundToInt(_PreviousOrigin.z * (_GroundHeight.height / _Width)) + ); + + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, 0); + wrapper.SetInteger(Crest.ShaderIDs.s_Resolution, _GroundHeight.width); + wrapper.SetVector(ShaderIDs.s_DomainOrigin, origin); + wrapper.SetFloat(ShaderIDs.s_DomainWidth, _Width); + wrapper.SetFloat(ShaderIDs.s_TexelSize, _ActualTexelSize); + wrapper.SetFloat(ShaderIDs.s_AddAdditionalWater, Mathf.Max(0f, _AdditionalWater)); + wrapper.SetBoolean(ShaderIDs.s_InjectLevel, _InjectShape == ShallowWaterSimulationInjection.Level); + wrapper.SetBoolean(ShaderIDs.s_SampleFromLevelInputs, SampleWaterLevelInputsDirectly); + + if (SampleWaterLevelInputsDirectly) + { + RenderLocalWaterLevel(water); + } + + PopulateGroundHeight(buffer); + + InitializeSimulation(buffer, xVelocityTarget, yVelocityTarget); + + _FirstUpdate = false; + } + + // Set once per frame properties. + { + // Initialize property wrapper. + // Use any kernel as the below value types don't require a kernel. + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, 0); + + var resolution = _GroundHeight.width; + + wrapper.SetInteger(Crest.ShaderIDs.s_Resolution, resolution); + wrapper.SetFloat(ShaderIDs.s_SimulationDeltaTime, _TimeStep); + wrapper.SetFloat(ShaderIDs.s_DomainWidth, _Width); + wrapper.SetFloat(ShaderIDs.s_DrainWaterAtBoundaries, _DrainWaterAtBoundaries); + wrapper.SetFloat(ShaderIDs.s_Evaporation, _Evaporation); + wrapper.SetFloat(ShaderIDs.s_Friction, _Friction); + wrapper.SetFloat(ShaderIDs.s_MaximumVelocity, _CourantNumber * _ActualTexelSize / _TimeStep); + wrapper.SetFloat(ShaderIDs.s_TexelSize, _ActualTexelSize); + wrapper.SetFloat(ShaderIDs.s_BlendPushUpStrength, _InjectShape == ShallowWaterSimulationInjection.Waves ? _BlendPushUpStrength : 1f); + wrapper.SetVector(ShaderIDs.s_DomainOrigin, origin); + + wrapper.SetBoolean(ShaderIDs.s_MacCormackAdvection, !_Debug._DisableStabilityImprovements && !_Debug._DisableMacCormackScheme); + wrapper.SetBoolean(ShaderIDs.s_MacCormackAdvectionForHeight, !_Debug._DisableStabilityImprovements && !_Debug._DisableMacCormackSchemeForHeight); + wrapper.SetBoolean(ShaderIDs.s_UpwindHeight, !_Debug._DisableStabilityImprovements && !_Debug._DisableUpwindHeight); + wrapper.SetBoolean(ShaderIDs.s_DepthLimiter, !_Debug._DisableStabilityImprovements && !_Debug._DisableDepthLimiter); + wrapper.SetFloat(ShaderIDs.s_OvershootReductionStrength, _OvershootReductionStrength); + } + + // Create temporaries for velocity and anything else after steps. + var temporary0 = new RenderTargetIdentifier(ShaderIDs.s_Temporary0); + var temporary1 = new RenderTargetIdentifier(ShaderIDs.s_Temporary1); + var xVelocitySource = temporary0; + var yVelocitySource = temporary1; + + var move = Movable && _PreviousOrigin != origin; + + if (move || _DynamicSeabed || _UpdateGroundHeight) + { + // Populate ground height every frame to allow dynamic scene. + PopulateGroundHeight(buffer); + } + + if (move || steps > 0) + { + // No need to clear, as overwritten (Initialize or Advect). + buffer.GetTemporaryRT(ShaderIDs.s_Temporary0, _GroundHeight.descriptor); + buffer.GetTemporaryRT(ShaderIDs.s_Temporary1, _GroundHeight.descriptor); + } + + if (move) + { + (_Height0, _Height1) = (_Height1, _Height0); + (xVelocitySource, xVelocityTarget, yVelocitySource, yVelocityTarget) = (xVelocityTarget, xVelocitySource, yVelocityTarget, yVelocitySource); + + // Initialize temporary textures so revived areas has water. + InitializeSimulation(buffer, xVelocityTarget, yVelocityTarget); + + var texel = new Vector2Int + ( + Mathf.RoundToInt(origin.x * (_GroundHeight.width / _Width)), + Mathf.RoundToInt(origin.z * (_GroundHeight.height / _Width)) + ); + + var offset = texel - _PreviousTexel; + + var source = new RectInt + ( + Mathf.Clamp(offset.x, 0, _Height1.width - 1), + Mathf.Clamp(offset.y, 0, _Height1.height - 1), + Mathf.Clamp(_Height1.width - Mathf.Abs(offset.x), 0, _Height1.width), + Mathf.Clamp(_Height1.height - Mathf.Abs(offset.y), 0, _Height1.height) + ); + + var target = new RectInt + ( + Mathf.Clamp(-offset.x, 0, _Height1.width - 1), + Mathf.Clamp(-offset.y, 0, _Height1.height - 1), + source.width, + source.height + ); + + if (source.width > 0 && source.height > 0) + { + // Swapped. So copying height source (without blur etc). + buffer.CopyTexture(_Height0, 0, 0, source.x, source.y, source.width, source.height, _Height1, 0, 0, target.x, target.y); + buffer.CopyTexture(xVelocitySource, 0, 0, source.x, source.y, source.width, source.height, xVelocityTarget, 0, 0, target.x, target.y); + buffer.CopyTexture(yVelocitySource, 0, 0, source.x, source.y, source.width, source.height, yVelocityTarget, 0, 0, target.x, target.y); + } + + // Move completed! + _PreviousOrigin = origin; + _PreviousTexel = texel; + } + + // Nothing to do. + if (!move && (steps <= 0 || _Debug._SkipUpdate)) + { + buffer.EndSample(k_DrawSWS); + return; + } + + for (var i = 0; i < steps; i++) + { + // Each stage block should leave latest state in "Target" buffer. + + // Advect + if (!_Debug._SkipAdvect) + { + (xVelocitySource, xVelocityTarget, yVelocitySource, yVelocityTarget) = (xVelocityTarget, xVelocitySource, yVelocityTarget, yVelocitySource); + + if (!_Debug._SkipAdvectHeights) + { + (_Height1, _Height0) = (_Height0, _Height1); + } + + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelAdvect); + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height0); + wrapper.SetTexture(ShaderIDs.s_HeightTarget, _Height1); + wrapper.SetTexture(ShaderIDs.s_VelocityXSource, xVelocitySource); + wrapper.SetTexture(ShaderIDs.s_VelocityXTarget, xVelocityTarget); + wrapper.SetTexture(ShaderIDs.s_VelocityYSource, yVelocitySource); + wrapper.SetTexture(ShaderIDs.s_VelocityYTarget, yVelocityTarget); + wrapper.Dispatch((_Height1.width + 7) / 8, (_Height1.height + 7) / 8, _Debug._SkipAdvectHeights ? 2 : 3); + } + + // Update H + if (!_Debug._SkipUpdateHeight) + { + (_Height0, _Height1) = (_Height1, _Height0); + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelUpdateHeight); + wrapper.SetTexture(ShaderIDs.s_VelocityXSource, xVelocityTarget); + wrapper.SetTexture(ShaderIDs.s_VelocityYSource, yVelocityTarget); + wrapper.SetTexture(ShaderIDs.s_MaskSource, _Mask); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height0); + wrapper.SetTexture(ShaderIDs.s_HeightTarget, _Height1); + wrapper.SetTexture(ShaderIDs.s_LevelSource, SampleWaterLevelInputsDirectly ? _WaterLevel : Texture2D.blackTexture); + wrapper.Dispatch((_Height1.width + 7) / 8, (_Height1.height + 7) / 8, 1); + } + + // H overshoot reduction + if (!_Debug._DisableOvershootReduction) + { + (_Height0, _Height1) = (_Height1, _Height0); + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelHeightOvershootReduction); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height0); + wrapper.SetTexture(ShaderIDs.s_HeightTarget, _Height1); + wrapper.Dispatch((_Height1.width + 7) / 8, (_Height1.height + 7) / 8, 1); + } + + // Update vels + if (!_Debug._SkipUpdateVelocities) + { + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelUpdateVelocity); + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height1); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_VelocityXTarget, xVelocityTarget); + wrapper.SetTexture(ShaderIDs.s_VelocityYTarget, yVelocityTarget); + wrapper.Dispatch((_Height1.width + 7) / 8, (_Height1.height + 7) / 8, 1); + } + } + + // + // Post-Steps + // + + if (!_Debug._SkipUpdateVelocities) + { + if (xVelocityTarget != _VelocityX) + { + buffer.CopyTexture(xVelocityTarget, 0, 0, _VelocityX, 0, 0); + buffer.CopyTexture(yVelocityTarget, 0, 0, _VelocityY, 0, 0); + } + + // This is important. Without this, there is aliasing in the injected vels which, in collaboration + // with the flow in the combine pass which has large period, makes annoying pops. Perhaps an + // alternative would be to just not add flow from SWS to big cascades. I tried something like this + // and it did not seem to help for me, so going with this. + buffer.GenerateMips(_VelocityX); + buffer.GenerateMips(_VelocityY); + } + + // Blur H postprocess to smooth out render data - only needs to be done once after any simulation updates + if (_BlurShapeForRender) + { + BlurHeight(buffer); + } + + if (_WaterEdgeMargin) + { + ExpandEdge(buffer, _WaterEdgeMarginWidth, _BlurShapeForRender); + } + else + { + // Finalize height by adding ground, origin etc similar to Expand Edge kernel. + + var source = new RenderTargetIdentifier(_Height1); + var target = new RenderTargetIdentifier(_Height0); + + if (_BlurShapeForRender) + { + source = target; + target = temporary0; + } + + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelFinalizeHeight); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_HeightSource, source); + wrapper.SetTexture(ShaderIDs.s_HeightTarget, target); + wrapper.Dispatch((_Height0.width + 7) / 8, (_Height0.height + 7) / 8, 1); + + if (_BlurShapeForRender) + { + buffer.CopyTexture(target, _Height0); + } + } + + buffer.ReleaseTemporaryRT(ShaderIDs.s_Temporary0); + buffer.ReleaseTemporaryRT(ShaderIDs.s_Temporary1); + + buffer.EndSample("SWS"); + } + + void BlurHeight(CommandBuffer buffer) + { + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelBlurHeight); + + // Cheekily write to H0, but dont flip. This is a temporary result purely for rendering. + // Next update will flip and overwrite this. + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height1); + wrapper.SetTexture(ShaderIDs.s_HeightTarget, _Height0); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.Dispatch((_Height0.width + 7) / 8, (_Height0.height + 7) / 8, 1); + } + + void ExpandEdge(CommandBuffer buffer, int iterations, bool blurred) + { + // This will always be available. + var id = ShaderIDs.s_Temporary0; + + // Expand edge is performed on the final output (including blur). + var source = new RenderTargetIdentifier(blurred ? _Height0 : _Height1); + var target = new RenderTargetIdentifier(id); + + // Mask above ground water. + { + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelMaskEdge); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_HeightSource, source); + wrapper.SetTexture(ShaderIDs.s_HeightTarget, target); + wrapper.Dispatch((_Height0.width + 7) / 8, (_Height0.height + 7) / 8, 1); + } + + // Height0 is the final target so always use it for ping-pong. + source = new RenderTargetIdentifier(_Height0); + + // Expand edge. + { + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelExpandEdge); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + for (var i = 0; i < iterations; i++) + { + (source, target) = (target, source); + wrapper.SetTexture(ShaderIDs.s_HeightSource, source); + wrapper.SetTexture(ShaderIDs.s_HeightTarget, target); + wrapper.Dispatch((_Height0.width + 7) / 8, (_Height0.height + 7) / 8, 1); + } + } + + if (target == id) + { + buffer.CopyTexture(id, _Height0); + } + } + + void PopulateGroundHeight(CommandBuffer buffer) + { + var wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelInitializeGroundHeight); + wrapper.SetTexture(ShaderIDs.s_GroundHeightTarget, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_MaskTarget, _Mask); + wrapper.SetFloat(ShaderIDs.s_ShallowMinimumDepth, _BlendDepthRange.x); + wrapper.SetFloat(ShaderIDs.s_ShallowMaximumDepth, _BlendDepthRange.y); + wrapper.SetBoolean(ShaderIDs.s_SampleFromDepthProbe, _SampleDepthProbeDirectly); + + if (_SampleDepthProbeDirectly && _DepthProbe != null) + { + _DepthProbe.Bind(wrapper); + } + else + { + wrapper.SetTexture(DepthProbe.ShaderIDs.s_DepthProbe, Texture2D.blackTexture); + } + + wrapper.Dispatch((_GroundHeight.width + 7) / 8, (_GroundHeight.height + 7) / 8, 1); + + // Blur simulation mask. + if (_BlurMaskIterations > 0 && _InjectShape == ShallowWaterSimulationInjection.Waves) + { + var temporary = ShaderIDs.s_Temporary0; + // No need to clear, as overwritten. + buffer.GetTemporaryRT(ShaderIDs.s_Temporary0, _Mask.descriptor); + var source = new RenderTargetIdentifier(_Mask); + var target = new RenderTargetIdentifier(temporary); + + wrapper = new(buffer, _ComputeShader, _KernelBlur); + for (var i = 0; i < _BlurMaskIterations; i++) + { + wrapper.SetTexture(ShaderIDs.s_MaskSource, source); + wrapper.SetTexture(ShaderIDs.s_MaskTarget, target); + (source, target) = (target, source); + + wrapper.Dispatch((_Mask.width + 7) / 8, (_Mask.height + 7) / 8, 1); + } + + buffer.ReleaseTemporaryRT(temporary); + } + + + _UpdateGroundHeight = false; + } + + internal void SetUniforms(Material material) + { + material.SetTexture(ShaderIDs.s_GroundHeight, _GroundHeight); + material.SetTexture(ShaderIDs.s_MaskSource, _Mask); + // If blurring is enabled, apply the blurred height which was put into H0 until next frame overwrites + material.SetTexture(ShaderIDs.s_Height, _Height1); + material.SetTexture(ShaderIDs.s_VelocityX, _VelocityX); + material.SetTexture(ShaderIDs.s_VelocityY, _VelocityY); + + material.SetVector(ShaderIDs.s_DomainOrigin, Origin); + material.SetFloat(ShaderIDs.s_DomainWidth, Width); + } + + + // + // Input / Behaviour + // + + // ILodInput + bool Enabled + { + get + { + var compute = WaterResources.Instance.Compute; + var disabled = _Mode != ShallowWaterSimulationMode.Baked + ? _ComputeShader == null || _Weight <= 0f + || _SampleDepthProbeDirectly && _DepthProbe == null + : compute._LevelTexture == null + || _InjectFlow && compute._FlowTexture == null + || _InjectFoam && compute._FoamTexture == null; + return !disabled; + } + } + + internal Rect Rect => new(Origin.XZ() - new Vector2(_Width, _Width) * 0.5f, new Vector2(_Width, _Width)); + + private protected override void Initialize() + { + base.Initialize(); + + UpdateResolution(); + + _Input ??= new(this); + + Allocate(); + + // Register injectors. +#if !UNITY_EDITOR + if (_InjectShape == ShallowWaterSimulationInjection.Waves) +#endif + { + ILodInput.Attach(_Input, AnimatedWavesLod.s_Inputs); + } +#if !UNITY_EDITOR + else +#endif + { + ILodInput.Attach(_Input, LevelLod.s_Inputs); + } + + + ILodInput.Attach(_Input, FlowLod.s_Inputs); + ILodInput.Attach(_Input, FoamLod.s_Inputs); + +#if CREST_DEBUG + if (_Debug._ShowSimulationDataInScene != DebugFields.SimulationData.None) + { + ILodInput.Attach(_Input, ClipLod.s_Inputs); + } +#endif + + s_Instances.Remove(this); + s_Instances.Add(this); + } + + private protected override void OnDisable() + { + base.OnDisable(); + + // If scene reload is disabled then OnDestroy is skipped. + if (!Application.isPlaying) + { + Release(); + } + + ILodInput.Detach(_Input, AnimatedWavesLod.s_Inputs); + ILodInput.Detach(_Input, LevelLod.s_Inputs); + ILodInput.Detach(_Input, FlowLod.s_Inputs); + ILodInput.Detach(_Input, FoamLod.s_Inputs); + +#if CREST_DEBUG + if (_Debug._ShowSimulationDataInScene != DebugFields.SimulationData.None) + { + ILodInput.Detach(_Input, ClipLod.s_Inputs); + } +#endif + + s_Instances.Remove(this); + } + + void OnDestroy() + { + Release(); + Destroy(); + } + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + Culling(water); + + // Runs before Execute. Overrides DepthProbe.Start data. + // Dynamic Seabed will execute the DepthProbe unlike when Fixed. + if (Movable && _SampleDepthProbeDirectly && _DepthProbe != null && (_DynamicSeabed || _PreviousOrigin != Origin)) + { + _DepthProbe.Position = Origin; + _DepthProbe.Scale = new(_Width, _Width); + _DepthProbe.Populate(); + } + + if (Enabled && _MaximumDisplacementVertical > 0f) + { + water.ReportMaximumDisplacement(0f, _MaximumDisplacementVertical, 0f); + } + +#if UNITY_EDITOR + if (!Movable && transform.hasChanged && !_FirstUpdate) + { + RequestDelayedReset(populateDepthProbe: true); + } + else if (_Dirty) + { + _DirtyTime -= Time.deltaTime; + + if (_DirtyTime <= 0f) + { + ResetSimulation(_DirtyDepthProbe); + _Dirty = false; + _DirtyDepthProbe = false; + } + } +#endif + } + + private protected override System.Action OnLateUpdateMethod => OnLateUpdate; + void OnLateUpdate(WaterRenderer water) + { + transform.hasChanged = false; + } + + private protected override System.Action OnEnableMethod => Culling; + void Culling(WaterRenderer water) + { + if (_EnableDistanceCulling && _InjectShape != ShallowWaterSimulationInjection.Level && Placement == Placement.Fixed) + { + var cullRadius = _Width * 0.5f + _CullDistance; + var offset = water.Viewpoint.position - transform.position; + var culled = !(offset.sqrMagnitude < cullRadius * cullRadius); + + // Transition to culled state. + _Weight += Time.deltaTime * _CullTransitionSpeed * (culled ? -1f : 1f); + _Weight = Mathf.Clamp01(_Weight); + + if (_Allocated && _Weight <= 0f) + { + Release(); + } + } + else + { + _Weight = 1f; + } + } + + void RenderLocalWaterLevel(WaterRenderer water) + { + _CommandBuffer ??= new(); + _CommandBuffer.Clear(); + + // Parameters override RTI values: + // https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.SetRenderTarget.html + _CommandBuffer.SetRenderTarget(_WaterLevel, 0, CubemapFace.Unknown, 0); + _CommandBuffer.ClearRenderTarget(false, true, Color.black); + + // This will work for CG but not for HDRP hlsl files. + var scale = _Width * 0.5f; + _CommandBuffer.SetViewProjectionMatrices + ( + WaterRenderer.CalculateViewMatrixFromSnappedPositionRHS(Origin), + // 20000 = above + below sea level. + Matrix4x4.Ortho(-scale, scale, -scale, scale, 1f, 20000f) + ); + + var drawn = false; + + foreach (var draw in LevelLod.s_Inputs) + { + var input = draw.Value; + if (!input.Enabled) continue; + // Skip water level input from this SWS. + if (input == _Input) continue; + // Skip compute shaders for now, as we would need an LOD-less kernel. + if (input.IsCompute) continue; + + var rect = input.Rect; + + if (rect == Rect.zero || rect.Overlaps(Rect)) + { + input.Draw(water.LevelLod, _CommandBuffer, _WaterLevel, -1, 1f, 0); + drawn = true; + } + } + + if (drawn) + { + Graphics.ExecuteCommandBuffer(_CommandBuffer); + } + } + + void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1f, int slices = -1) + { + PropertyWrapperCompute wrapper; + var targetID = Crest.ShaderIDs.s_Target; + + if (lod is AnimatedWavesLod) + { + if (_InjectShape != ShallowWaterSimulationInjection.Waves) + { + return; + } + + Execute(lod.Water, buffer); + + if (_Debug._SkipInjectShape) + { + return; + } + + wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelInjectShape); + targetID = ShaderIDs.s_ShapeTarget; + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + // The finalized height will always be written to zero. + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height0); + } + else if (lod is LevelLod) + { + if (_InjectShape != ShallowWaterSimulationInjection.Level) + { + return; + } + + if (_Mode == ShallowWaterSimulationMode.RealTime || _Debug._AlwaysExecuteSimulation) + { + Execute(lod.Water, buffer); + } + + if (_Debug._SkipInjectShape) + { + return; + } + + if (_Mode == ShallowWaterSimulationMode.Baked) + { + if (_LevelTexture == null) return; + wrapper = new PropertyWrapperCompute(buffer, WaterResources.Instance.Compute._LevelTexture, 0); + wrapper.SetInteger(Crest.ShaderIDs.s_Blend, (int)LodInputBlend.Maximum); + wrapper.SetTexture(Crest.ShaderIDs.s_Texture, _LevelTexture); + wrapper.SetKeyword(WaterResources.Instance.Keywords.LevelTextureCatmullRom, false); + } + else + { + wrapper = new PropertyWrapperCompute(buffer, _ComputeShader, _KernelInjectLevel); + targetID = ShaderIDs.s_LevelTarget; + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + // The finalized height will always be written to zero. + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height0); + } + } + else if (lod is FlowLod) + { + if (!_InjectFlow) + { + return; + } + + if (_Mode == ShallowWaterSimulationMode.Baked) + { + if (_FlowTexture == null) return; + wrapper = new(buffer, WaterResources.Instance.Compute._FlowTexture, 0); + wrapper.SetInteger(Crest.ShaderIDs.s_Blend, (int)LodInputBlend.Additive); + wrapper.SetTexture(Crest.ShaderIDs.s_Texture, _FlowTexture); + wrapper.SetBoolean(Crest.ShaderIDs.s_NegativeValues, true); + } + else + { + // One frame behind as Flow happens before Animated Waves. + wrapper = new(buffer, _ComputeShader, _KernelInjectFlow); + targetID = ShaderIDs.s_FlowTarget; + wrapper.SetTexture(ShaderIDs.s_VelocityXSource, _VelocityX); + wrapper.SetTexture(ShaderIDs.s_VelocityYSource, _VelocityY); + wrapper.SetFloat(ShaderIDs.s_InjectionStrength, _FlowStrength); + } + } +#if CREST_DEBUG + else if (lod is ClipLod) + { + var origin = Origin; + + wrapper = new PropertyWrapperCompute(buffer, WaterResources.Instance.Compute._ClipPrimitive, 0); + + wrapper.SetMatrix(Crest.ShaderIDs.s_Matrix, Matrix4x4.TRS(origin, Quaternion.identity, (Vector3.one * _Width).XNZ(100f)).inverse); + + // For culling. + wrapper.SetVector(Crest.ShaderIDs.s_Position, origin); + wrapper.SetFloat(Crest.ShaderIDs.s_Diameter, _Width); + + wrapper.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveInverted, false); + wrapper.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveSphere, false); + wrapper.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveCube, true); + wrapper.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveRectangle, false); + } +#endif + else + { + if (!_InjectFoam) + { + return; + } + + if (_Mode == ShallowWaterSimulationMode.Baked) + { + if (_FoamTexture == null) return; + wrapper = new(buffer, WaterResources.Instance.Compute._FoamTexture, 0); + wrapper.SetTexture(Crest.ShaderIDs.s_Texture, _FoamTexture); + wrapper.SetInteger(Crest.ShaderIDs.s_Blend, (int)LodInputBlend.Additive); + } + else + { + // It currently does not trigger jacobian foam term. If we added displacement to + // SWS waves it would prob help, but the quality of the shape would have to be much + // better I guess! + wrapper = new(buffer, _ComputeShader, _KernelInjectFoam); + targetID = ShaderIDs.s_FoamTarget; + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height1); + wrapper.SetTexture(ShaderIDs.s_VelocityXSource, _VelocityX); + wrapper.SetTexture(ShaderIDs.s_VelocityYSource, _VelocityY); + wrapper.SetFloat(ShaderIDs.s_InjectionStrength, _FoamStrength); + } + } + + if (_Mode == ShallowWaterSimulationMode.Baked) + { + wrapper.SetVector(Crest.ShaderIDs.s_TextureSize, Vector2.one * Width); + wrapper.SetVector(Crest.ShaderIDs.s_TexturePosition, transform.position.XZ()); + wrapper.SetVector(Crest.ShaderIDs.s_TextureRotation, new(0, 1)); + wrapper.SetVector(Crest.ShaderIDs.s_Multiplier, Vector4.one); + wrapper.SetFloat(Crest.ShaderIDs.s_FeatherWidth, 0f); + wrapper.SetFloat(LodInput.ShaderIDs.s_Weight, 1f); + } + else + { + // All require the mask. + wrapper.SetTexture(ShaderIDs.s_MaskSource, _Mask); + wrapper.SetFloat(LodInput.ShaderIDs.s_Weight, _Weight); + + if (_InjectShape == ShallowWaterSimulationInjection.Level) + { + wrapper.SetFloat(ShaderIDs.s_MarginWidth, _PaddingWidth); + } + } + + wrapper.SetTexture(targetID, target); + + var xy = lod.Resolution / Lod.k_ThreadGroupSize; + wrapper.Dispatch(xy, xy, slices); + } + + Placement GetPlacement() + { + return _InjectShape == ShallowWaterSimulationInjection.Level ? Placement.Fixed : _Placement; + } + + bool GetSampleWaterLevelInputsDirectly() + { + return _SampleWaterLevelInputsDirectly && _InjectShape == ShallowWaterSimulationInjection.Level; + } + + void SetPreset(ShallowWaterSimulationPreset previous, ShallowWaterSimulationPreset current) + { + if (previous == current) return; + + switch (_Preset) + { + case ShallowWaterSimulationPreset.Shoreline: + _InjectShape = ShallowWaterSimulationInjection.Waves; + _Mode = ShallowWaterSimulationMode.RealTime; + break; + case ShallowWaterSimulationPreset.Stream: + _InjectShape = ShallowWaterSimulationInjection.Level; + break; + } + } + } + +#if UNITY_EDITOR + sealed partial class ShallowWaterSimulation + { + bool _Dirty; + bool _DirtyDepthProbe; + float _DirtyTime; + + void RequestDelayedReset(bool populateDepthProbe = false) + { + _Dirty = true; + _DirtyTime = 0.125f; + _DirtyDepthProbe |= populateDepthProbe; + } + + private protected override void Reset() + { + UpdateResolution(); + + base.Reset(); + } + + /// + /// Bake the simulation to a texture. Only works with + /// and in the Editor. + /// + public void Bake() + { + Undo.RecordObject(this, "Bake Shallow Water Simulation"); + + var descriptor = _GroundHeight.descriptor; + descriptor.graphicsFormat = GraphicsFormat.R32G32B32A32_SFloat; + + // Bake Level + { + // Redo post-processing for now instead of continuing where left off as it can get + // complicated quickly. + var buffer = new CommandBuffer(); + BlurHeight(buffer); + // No need to clear, as overwritten. + buffer.GetTemporaryRT(ShaderIDs.s_Temporary0, _GroundHeight.descriptor); + ExpandEdge(buffer, Mathf.Max(_WaterEdgeMarginWidth, _WaterEdgeMarginBakedWidth), blurred: true); + buffer.ReleaseTemporaryRT(ShaderIDs.s_Temporary0); + Graphics.ExecuteCommandBuffer(buffer); + buffer.Release(); + + var wrapper = new PropertyWrapperComputeStandalone(_ComputeShader, _KernelBakeLevel); + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height0); + wrapper.SetFloat(ShaderIDs.s_MarginWidth, _PaddingWidth); + BakeTexture(wrapper, descriptor, ShaderIDs.s_LevelBakeTarget, "Level", ref _LevelTexture, isSingleChannel: true); + } + + // Bake Foam + if (_InjectFoam) + { + var wrapper = new PropertyWrapperComputeStandalone(_ComputeShader, _KernelBakeFoam); + wrapper.SetTexture(ShaderIDs.s_GroundHeightSource, _GroundHeight); + wrapper.SetTexture(ShaderIDs.s_HeightSource, _Height1); + wrapper.SetTexture(ShaderIDs.s_VelocityXSource, _VelocityX); + wrapper.SetTexture(ShaderIDs.s_VelocityYSource, _VelocityY); + wrapper.SetFloat(ShaderIDs.s_MarginWidth, _PaddingWidth); + wrapper.SetFloat(ShaderIDs.s_InjectionStrength, _FoamStrength); + BakeTexture(wrapper, descriptor, ShaderIDs.s_FoamBakeTarget, "Foam", ref _FoamTexture, isSingleChannel: true); + } + + // Bake Flow + if (_InjectFlow) + { + var wrapper = new PropertyWrapperComputeStandalone(_ComputeShader, _KernelBakeFlow); + wrapper.SetTexture(ShaderIDs.s_VelocityXSource, _VelocityX); + wrapper.SetTexture(ShaderIDs.s_VelocityYSource, _VelocityY); + wrapper.SetFloat(ShaderIDs.s_InjectionStrength, _FlowStrength); + wrapper.SetFloat(ShaderIDs.s_MarginWidth, _PaddingWidth); + BakeTexture(wrapper, descriptor, ShaderIDs.s_FlowBakeTarget, "Flow", ref _FlowTexture, format: TextureImporterFormat.RGFloat); + } + + _Mode = ShallowWaterSimulationMode.Baked; + } + + void BakeTexture + ( + PropertyWrapperComputeStandalone wrapper, + RenderTextureDescriptor descriptor, + int target, + string name, + ref Texture2D output, + TextureImporterFormat format = TextureImporterFormat.Automatic, + bool isSingleChannel = false + ) + { +#if d_ModuleUnityImageConversion + // Write to temporary then copy over as we need UAV access. + var temporary = RenderTexture.GetTemporary(descriptor); + // Simulation padding must completely overlap water level inputs, or there may be a gap. + Helpers.ClearRenderTexture(temporary, Color.clear, depth: false); + wrapper.SetTexture(target, temporary); + var threads = Resolution / 8; + wrapper.Dispatch(threads, threads, 1); + + // Copy texture. CopyTexture needs both to be readable for CPU copies. + // https://docs.unity3d.com/ScriptReference/Graphics.CopyTexture.html + var texture = new Texture2D(temporary.width, temporary.height, descriptor.graphicsFormat, TextureCreationFlags.None); + RenderTexture.active = temporary; + texture.ReadPixels(new(0, 0, temporary.width, temporary.height), 0, 0); + RenderTexture.active = null; + + var path = AssetDatabase.GetAssetPath(output) ?? ""; + if (path.Length <= 0) path = $"Assets/ShallowWaterSimulation_{name}_{System.Guid.NewGuid()}.exr"; + + System.IO.File.WriteAllBytes(path, texture.EncodeToEXR(Texture2D.EXRFlags.OutputAsFloat)); + AssetDatabase.ImportAsset(path); + Helpers.Destroy(texture); + output = AssetDatabase.LoadAssetAtPath(path); + + var importer = AssetImporter.GetAtPath(path) as TextureImporter; + importer.textureShape = TextureImporterShape.Texture2D; + importer.textureType = isSingleChannel ? TextureImporterType.SingleChannel : TextureImporterType.Default; + importer.sRGBTexture = false; + importer.alphaSource = TextureImporterAlphaSource.None; + importer.mipmapEnabled = false; + importer.alphaIsTransparency = false; + // Compression will clamp negative values. + importer.textureCompression = TextureImporterCompression.Uncompressed; + importer.filterMode = FilterMode.Bilinear; + importer.wrapMode = TextureWrapMode.Clamp; + + // Importer Settings + if (isSingleChannel) + { + var settings = new TextureImporterSettings(); + importer.ReadTextureSettings(settings); + settings.singleChannelComponent = TextureImporterSingleChannelComponent.Red; + importer.SetTextureSettings(settings); + format = TextureImporterFormat.RFloat; + } + + // Default Platform Settings + { + var settings = importer.GetDefaultPlatformTextureSettings(); + settings.format = format; + importer.SetPlatformTextureSettings(settings); + } + + importer.SaveAndReimport(); + + RenderTexture.ReleaseTemporary(temporary); +#else + // The problem is EncodeToEXR. DepthProbe has this without issue likely because the + // code is in an editor only assembly. + throw new System.NotSupportedException("Crest: Requires the com.unity.modules.imageconversion module. Please enable it."); +#endif + } + + private protected override void OnValidate() + { + base.OnValidate(); + UpdateResolution(); + } + + [@OnChange(skipIfInactive: false)] + void OnChange(string propertyPath, object previousValue) + { + switch (propertyPath) + { + case nameof(_Mode): + if (_SampleDepthProbeDirectly && TryGetComponent(out _DepthProbe)) + { + Undo.RecordObject(_DepthProbe, $"Modified Mode in {gameObject.name}"); + _DepthProbe.enabled = _Mode == ShallowWaterSimulationMode.RealTime; + } + break; + case nameof(_InjectShape): + if (_InjectShape == ShallowWaterSimulationInjection.Waves) _Mode = ShallowWaterSimulationMode.RealTime; + break; + case nameof(_Preset): + SetPreset((ShallowWaterSimulationPreset)previousValue, _Preset); + break; + } + + if (!isActiveAndEnabled) + { + return; + } + + var water = WaterRenderer.Instance; + switch (propertyPath) + { + case nameof(_SampleDepthProbeDirectly): + if (!_SampleDepthProbeDirectly) + { + if (_DepthProbe != null) + { + _DepthProbe.Managed = false; + _DepthProbe.Populate(); + } + + _DepthProbe = null; + } + ResetSimulation(populateDepthProbe: true); + break; + // Affects initialization, thus needs a reset. + case nameof(_AdditionalWater): + case nameof(_Depth): + case nameof(_MaximumResolution): + case nameof(_SampleWaterLevelInputsDirectly): + case nameof(_TexelSize): + ResetSimulation(); + break; + case nameof(_PlaceAtSeaLevel): + if (water != null && transform.position.y != water.SeaLevel) ResetSimulation(); + break; + case nameof(_Placement): + if (_SampleDepthProbeDirectly && _DepthProbe != null) _DepthProbe.OverridePosition = Movable; + ResetSimulation(populateDepthProbe: true); + break; + // Needs to allocate if haven't already. + case nameof(_Mode): + Allocate(); + break; + // Affects waves only, thus updating the ground height is enough. + case nameof(_BlendDepthRange): + case nameof(_BlurMaskIterations): + _UpdateGroundHeight = true; + break; + // Affects Depth Probe and dynamic control, thus needs delayed reset. + case nameof(_Width): + if (_Width != (float)previousValue) RequestDelayedReset(populateDepthProbe: true); + break; +#if CREST_DEBUG + case nameof(_Debug) + "." + nameof(_Debug._ShowSimulationDataInScene): + ILodInput.Detach(_Input, ClipLod.s_Inputs); + if (_Debug._ShowSimulationDataInScene != DebugFields.SimulationData.None) ILodInput.Attach(_Input, ClipLod.s_Inputs); + break; +#endif + } + } + + void OnGUI() + { + if (_Debug._ShowSimulationData && _Height1 != null) + { + var s = 200f; + var y = 0f; + Rect r; + + r = new Rect(200, y, s, s); + y += s + 1; + GUI.DrawTexture(r, _Height1); GUI.Label(r, _Height1.name); + + r = new Rect(200, y, s, s); + y += s + 1; + GUI.DrawTexture(r, _VelocityX); GUI.Label(r, _VelocityX.name); + + r = new Rect(200, y, s, s); + y += s + 1; + GUI.DrawTexture(r, _VelocityY); GUI.Label(r, _VelocityY.name); + + r = new Rect(200, y, s, s); + y += s + 1; + GUI.DrawTexture(r, _GroundHeight); GUI.Label(r, _GroundHeight.name); + + r = new Rect(200, y, s, s); + GUI.DrawTexture(r, _Mask); GUI.Label(r, _Mask.name); + } + } + +#if CREST_DEBUG + [UnityEditor.Callbacks.DidReloadScripts] + static void ScriptsHasBeenReloaded() + { + SceneView.duringSceneGui -= DuringSceneGUI; + SceneView.duringSceneGui += DuringSceneGUI; + } + + static void DuringSceneGUI(SceneView sceneView) + { + if (Event.current.type == EventType.KeyUp && Event.current.keyCode == KeyCode.KeypadEnter) + { + var sws = FindFirstObjectByType(); + + if (sws != null) + { + FindFirstObjectByType().ResetSimulation(); + } + } + } +#endif + } +#endif // UNITY_EDITOR + + partial class ShallowWaterSimulation + { + Input _Input; + + sealed class Input : ILodInput + { + readonly ShallowWaterSimulation _Input; + public Input(ShallowWaterSimulation input) => _Input = input; + public bool Enabled => _Input.Enabled; + public bool IsCompute => true; + // Late queue, but not too late to give opportunity to override. + public int Queue => 1000; + public int Pass => (int)DisplacementPass.LodIndependent; + public Rect Rect => _Input.Rect; + public MonoBehaviour Component => _Input; + public float Filter(WaterRenderer water, int slice) => 1f; + public void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) => _Input.Draw(lod, buffer, target, pass, weight, slice); + } + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterSimulation.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterSimulation.cs.meta new file mode 100644 index 0000000..8f215e8 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterSimulation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a87083040be2a947bf2d5f126a800e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterVisualizer.cs b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterVisualizer.cs new file mode 100644 index 0000000..42ac08b --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterVisualizer.cs @@ -0,0 +1,64 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.ShallowWater +{ + /// + /// Debug helper - designed to be used in conjunction with the SWSProbe shader to visualise simulation state. + /// + [@ExecuteDuringEditMode] + [@HelpURL("Packages/ShallowWater/Manual.html")] + [AddComponentMenu(Constants.k_MenuPrefixDebug + "Shallow Water Visualizer")] + sealed class ShallowWaterVisualizer : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + ShallowWaterSimulation _ShallowWaterSimulation; + + [SerializeField] + bool _RenderFinalHeight = true; + + Material _Material; + + static class ShaderIDs + { + public static readonly int s_RenderFinalHeight = Shader.PropertyToID("_Crest_RenderFinalHeight"); + } + + private protected override void Initialize() + { + base.Initialize(); + _Material = new Material(WaterResources.Instance.Shaders._ShallowWaterSimulationVisualizer); + } + + private protected override void OnDisable() + { + base.OnDisable(); + Helpers.Destroy(_Material); + } + + // Data is ready in LateUpdate. + private protected override System.Action OnLateUpdateMethod => OnLateUpdate; + void OnLateUpdate(WaterRenderer water) + { + var sws = _ShallowWaterSimulation; + if (sws == null) + { + var rect = new Rect(transform.position.XZ() - transform.lossyScale.XZ() * 0.5f, transform.lossyScale.XZ()); + sws = ShallowWaterSimulation.Get(rect); + if (sws == null) return; + } + + sws.SetUniforms(_Material); + _Material.SetBoolean(ShaderIDs.s_RenderFinalHeight, _RenderFinalHeight); + Graphics.RenderMesh(new RenderParams(_Material), Helpers.SphereMesh, 0, transform.localToWorldMatrix); + } + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterVisualizer.cs.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterVisualizer.cs.meta new file mode 100644 index 0000000..0271068 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/ShallowWaterVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9c803c0f80af174daad4857fd565329 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/WaveHarmonic.Crest.ShallowWater.asmdef b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/WaveHarmonic.Crest.ShallowWater.asmdef new file mode 100644 index 0000000..8829c3a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/WaveHarmonic.Crest.ShallowWater.asmdef @@ -0,0 +1,38 @@ +{ + "name": "WaveHarmonic.Crest.ShallowWater", + "rootNamespace": "", + "references": [ + "GUID:7c347618730f5467f86a58f333ce21df", + "GUID:125c216bac85c4443bfd4de6bc7eda99", + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:1ab2a6c2a51cd4b43867788dbaee1a55" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER", + "d_Crest" + ], + "versionDefines": [ + { + "name": "com.unity.modules.imageconversion", + "expression": "", + "define": "d_ModuleUnityImageConversion" + }, + { + "name": "com.waveharmonic.crest", + "expression": "", + "define": "d_Crest" + }, + { + "name": "com.waveharmonic.crest", + "expression": "5.6.0", + "define": "d_CrestValid" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/WaveHarmonic.Crest.ShallowWater.asmdef.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/WaveHarmonic.Crest.ShallowWater.asmdef.meta new file mode 100644 index 0000000..97e4e8f --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Scripts/WaveHarmonic.Crest.ShallowWater.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 98db37baed0fc4b73a47a9d66f791aae +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders.meta new file mode 100644 index 0000000..72b3a41 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90b7d9639f98040128d7bb5db90b5d7e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/ShallowWaterSimulation.compute b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/ShallowWaterSimulation.compute new file mode 100644 index 0000000..ca7f560 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/ShallowWaterSimulation.compute @@ -0,0 +1,1116 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestInitialize +#pragma kernel CrestInitializeGroundHeight +#pragma kernel CrestAdvect +#pragma kernel CrestUpdateHeight +#pragma kernel CrestHeightOvershootReduction +#pragma kernel CrestUpdateVelocity +#pragma kernel CrestBlurHeight +#pragma kernel CrestBlur +#pragma kernel CrestMaskEdge +#pragma kernel CrestExpandEdge +#pragma kernel CrestFinalizeHeight +#pragma kernel CrestInjectShape +#pragma kernel CrestInjectLevel +#pragma kernel CrestInjectFoam +#pragma kernel CrestInjectFlow +#pragma kernel CrestBakeLevel +#pragma kernel CrestBakeFoam +#pragma kernel CrestBakeFlow + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +#define FLT_MIN 1.175494351e-38 + +SamplerState linear_clamp_sampler; + +Texture2D _Crest_LevelSource; +Texture2D _Crest_HeightSource; +RWTexture2D _Crest_HeightTarget; +Texture2D _Crest_VelocityXSource; +RWTexture2D _Crest_VelocityXTarget; +Texture2D _Crest_VelocityYSource; +RWTexture2D _Crest_VelocityYTarget; +Texture2D _Crest_GroundHeightSource; +RWTexture2D _Crest_GroundHeightTarget; +Texture2D _Crest_MaskSource; +RWTexture2D _Crest_MaskTarget; + +// Injector Targets. +RWTexture2DArray _Crest_FoamTarget; +RWTexture2DArray _Crest_FlowTarget; +RWTexture2DArray _Crest_ShapeTarget; +RWTexture2DArray _Crest_LevelTarget; + +// Bake Targets. +RWTexture2D _Crest_FoamBakeTarget; +RWTexture2D _Crest_FlowBakeTarget; +RWTexture2D _Crest_LevelBakeTarget; + +// Depth Probe. +Texture2D _Crest_DepthProbe; + +CBUFFER_START(CrestBuffer) +float _Crest_SimDeltaTime; + +float _Crest_SimulationDeltaTime; +float _Crest_DomainWidth; +float3 _Crest_DomainOrigin; +uint _Crest_Resolution; +float _Crest_DrainWaterAtBoundaries; +float _Crest_Evaporation; +float _Crest_Friction; +float _Crest_MaximumVelocity; +float _Crest_AddAdditionalWater; +float _Crest_TexelSize; + +bool _Crest_MacCormackAdvection; +bool _Crest_MacCormackAdvectionForHeight; +bool _Crest_UpwindHeight; +bool _Crest_DepthLimiter; +bool _Crest_InjectLevel; + +float _Crest_OvershootReductionStrength; + +float _Crest_ShallowMinimumDepth; +float _Crest_ShallowMaximumDepth; +float _Crest_BlendPushUpStrength; + +float _Crest_InjectionStrength; +float _Crest_InjectionMaximum; +float _Crest_Weight; + +bool _Crest_SampleFromDepthProbe; +bool _Crest_SampleFromLevelInputs; +float _Crest_DepthProbeHeightOffset; +float _Crest_DepthProbeResolution; + +float _Crest_MarginWidth; +CBUFFER_END + +m_CrestNameSpace + +float2 IdToWorldXZ_H(uint2 id) +{ + // H grid is centered + return ((id + 0.5) / _Crest_Resolution - 0.5) * _Crest_DomainWidth + _Crest_DomainOrigin.xz; +} +float2 IdToWorldXZ_GroundHeight(uint2 id) +{ + // H and GroundHeight are aligned + return IdToWorldXZ_H(id); +} +float2 IdToWorldXZ_Vx(uint2 id) +{ + // Vx grid is offset right half a texel + return ((id + float2(1.0, 0.5)) / _Crest_Resolution - 0.5) * _Crest_DomainWidth + _Crest_DomainOrigin.xz; +} +float2 IdToWorldXZ_Vy(uint2 id) +{ + // Vy grid is offset forward half a texel + return ((id + float2(0.5, 1.0)) / _Crest_Resolution - 0.5) * _Crest_DomainWidth + _Crest_DomainOrigin.xz; +} + +float2 WorldXZToUv_H(float2 worldXZ) +{ + // H grid is centered + return (worldXZ - _Crest_DomainOrigin.xz) / _Crest_DomainWidth + 0.5; +} +float2 WorldXZToUv_GroundHeight(float2 worldXZ) +{ + // Aligned to H + return WorldXZToUv_H(worldXZ); +} +float2 WorldXZToUv_Vx(float2 worldXZ) +{ + // Vx grid is offset right half a texel + return (worldXZ - _Crest_DomainOrigin.xz) / _Crest_DomainWidth + 0.5 - float2(0.5 / _Crest_Resolution, 0.0); +} +float2 WorldXZToUv_Vy(float2 worldXZ) +{ + // Vy grid is offset forward half a texel + return (worldXZ - _Crest_DomainOrigin.xz) / _Crest_DomainWidth + 0.5 - float2(0.0, 0.5 / _Crest_Resolution); +} + +float SampleWaterLevel(float2 worldXZ) +{ + return _Crest_LevelSource.SampleLevel(linear_clamp_sampler, WorldXZToUv_H(worldXZ), 0.0).x; +} +float SampleH(float2 worldXZ) +{ + return _Crest_HeightSource.SampleLevel(linear_clamp_sampler, WorldXZToUv_H(worldXZ), 0.0).x; +} +float SampleGroundHeight(float2 worldXZ) +{ + return _Crest_GroundHeightSource.SampleLevel(linear_clamp_sampler, WorldXZToUv_GroundHeight(worldXZ), 0.0).x; +} +float SampleVx0(float2 worldXZ) +{ + return _Crest_VelocityXSource.SampleLevel(linear_clamp_sampler, WorldXZToUv_Vx(worldXZ), 0.0).x; +} +float SampleVy0(float2 worldXZ) +{ + return _Crest_VelocityYSource.SampleLevel(linear_clamp_sampler, WorldXZToUv_Vy(worldXZ), 0.0).x; +} + + +// +// Initialize +// + +void Initialize(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + + const float2 worldXZ = IdToWorldXZ_H(id); + + uint slice0, slice1; float alpha; + PosToSliceIndices(worldXZ, 0.0, g_Crest_LodCount - 1.0, g_Crest_WaterScale, slice0, slice1, alpha); + + float h = g_Crest_WaterCenter.y; + const float weight0 = (1.0 - alpha) * g_Crest_CascadeData[slice0].y; + const float weight1 = (1.0 - weight0) * g_Crest_CascadeData[slice1].y; + + if (_Crest_InjectLevel) + { + if (_Crest_SampleFromLevelInputs) + { + h += SampleWaterLevel(worldXZ); + } + else + { + h += + weight0 * Cascade::MakeLevel(slice0).SampleLevel(worldXZ) + + weight1 * Cascade::MakeLevel(slice1).SampleLevel(worldXZ); + } + } + + h -= _Crest_DomainOrigin.y; + + h = max(0.0, h - SampleGroundHeight(worldXZ)); + + h += _Crest_AddAdditionalWater; + + _Crest_HeightTarget[id] = h; + _Crest_VelocityXTarget[id] = 0.0; + _Crest_VelocityYTarget[id] = 0.0; +} + +// Called first. +void InitializeGroundHeight(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + + const float2 worldXZ = IdToWorldXZ_GroundHeight(id); + + uint slice0, slice1; float alpha; + PosToSliceIndices(worldXZ, 0.0, g_Crest_LodCount - 1.0, g_Crest_WaterScale, slice0, slice1, alpha); + + const float weight0 = (1.0 - alpha) * g_Crest_CascadeData[slice0].y; + const float weight1 = (1.0 - weight0) * g_Crest_CascadeData[slice1].y; + + float g; + if (_Crest_SampleFromDepthProbe) + { + // Sample from the Depth Probe directly otherwise we bake in LOD losses. + g = _Crest_DepthProbe.SampleLevel(linear_clamp_sampler, id.xy / (float)_Crest_Resolution, 0.0).x; + g += _Crest_DepthProbeHeightOffset; + } + else + { + g = weight0 * Cascade::MakeDepth(slice0).SampleSceneHeight(worldXZ) + + weight1 * Cascade::MakeDepth(slice1).SampleSceneHeight(worldXZ); + } + + // LOD losses for height should be acceptable providing height is flat (which it should be). + // Bake water level into ground by offsetting ground with water level. + if (!_Crest_InjectLevel) + { + g -= + weight0 * Cascade::MakeLevel(slice0).SampleLevel(worldXZ) + + weight1 * Cascade::MakeLevel(slice1).SampleLevel(worldXZ); + } + + // Mask is directly based off depth at the moment. + float depth = g_Crest_WaterCenter.y - g; + _Crest_MaskTarget[id] = 1.0 - saturate((depth - _Crest_ShallowMinimumDepth) / _Crest_ShallowMaximumDepth); + + g = max(0.0, g - _Crest_DomainOrigin.y); + + _Crest_GroundHeightTarget[id] = g; +} + + +// +// Advect +// + +void Advect(const uint3 id) +{ + // Vx + if (id.z == 0) + { + const float2 worldXZ = IdToWorldXZ_Vx(id.xy); + + // Advect forwards to predict advected position + const float2 worldXZAdvected_prediction = worldXZ - _Crest_SimulationDeltaTime * float2(SampleVx0(worldXZ), SampleVy0(worldXZ)); + + float2 worldXZAdvected = worldXZAdvected_prediction; + const float vxSemiLagrangian = SampleVx0(worldXZAdvected); + float vxAdvected = vxSemiLagrangian; + if (_Crest_MacCormackAdvection) + { + // Update prediction by advecting backwards to obtain a starting position and using the difference as an error term + + // Advect forwards to predict original position + const float2 worldXZ_prediction = worldXZAdvected_prediction + _Crest_SimulationDeltaTime * float2(vxSemiLagrangian, SampleVy0(worldXZAdvected_prediction)); + + // Remove half of prediction error to yield average of both + worldXZAdvected -= (worldXZ_prediction - worldXZ) / 2.0; + + float vxAdvectedNew = SampleVx0(worldXZAdvected); + + const float4 vxsUsedForFirstSLStep = _Crest_VelocityXSource.Gather(linear_clamp_sampler, WorldXZToUv_Vx(worldXZ)); + const float vxMin = min(min(vxsUsedForFirstSLStep[0], vxsUsedForFirstSLStep[1]), min(vxsUsedForFirstSLStep[2], vxsUsedForFirstSLStep[3])); + const float vxMax = max(max(vxsUsedForFirstSLStep[0], vxsUsedForFirstSLStep[1]), max(vxsUsedForFirstSLStep[2], vxsUsedForFirstSLStep[3])); + + if (vxAdvectedNew >= vxMin && vxAdvectedNew <= vxMax) + { + vxAdvected = vxAdvectedNew; + } + } + + // Abs to silence 3571 which for some reason cannot disable with pragma even + // HLSLSupport can do exactly that. + const float h_vx = SampleH(worldXZAdvected); + const float friction = _Crest_Friction * _Crest_SimulationDeltaTime / max(0.001f, pow(abs(h_vx), 1.333333f)); + vxAdvected -= abs(vxAdvected) * vxAdvected * friction; + + vxAdvected = clamp(vxAdvected, -_Crest_MaximumVelocity, _Crest_MaximumVelocity); + + _Crest_VelocityXTarget[id.xy] = vxAdvected; + } + + // Vy + if (id.z == 1) + { + const float2 worldXZ = IdToWorldXZ_Vy(id.xy); + + // Advect forwards to predict advected position + const float2 worldXZAdvected_prediction = worldXZ - _Crest_SimulationDeltaTime * float2(SampleVx0(worldXZ), SampleVy0(worldXZ)); + + float2 worldXZAdvected = worldXZAdvected_prediction; + const float vySemiLagrangian = SampleVy0(worldXZAdvected); + float vyAdvected = vySemiLagrangian; + if (_Crest_MacCormackAdvection) + { + // Update prediction by advecting backwards to obtain a starting position and using the difference as an error term + + // Advect forwards to predict original position + const float2 worldXZ_prediction = worldXZAdvected_prediction + _Crest_SimulationDeltaTime * float2(SampleVx0(worldXZAdvected_prediction), vySemiLagrangian); + + // Remove half of prediction error to yield average of both + worldXZAdvected -= (worldXZ_prediction - worldXZ) / 2.0; + + float vyAdvectedNew = SampleVy0(worldXZAdvected); + + const float4 vysUsedForFirstSLStep = _Crest_VelocityYSource.Gather(linear_clamp_sampler, WorldXZToUv_Vy(worldXZ)); + const float vyMin = min(min(vysUsedForFirstSLStep[0], vysUsedForFirstSLStep[1]), min(vysUsedForFirstSLStep[2], vysUsedForFirstSLStep[3])); + const float vyMax = max(max(vysUsedForFirstSLStep[0], vysUsedForFirstSLStep[1]), max(vysUsedForFirstSLStep[2], vysUsedForFirstSLStep[3])); + + if (vyAdvectedNew >= vyMin && vyAdvectedNew <= vyMax) + { + vyAdvected = vyAdvectedNew; + } + } + + // Abs to silence 3571 which for some reason cannot disable with pragma even + // HLSLSupport can do exactly that. + const float h_vy = SampleH(worldXZAdvected); + const float friction = _Crest_Friction * _Crest_SimulationDeltaTime / max(0.001f, pow(abs(h_vy), 1.333333f)); + vyAdvected -= abs(vyAdvected) * vyAdvected * friction; + + vyAdvected = clamp(vyAdvected, -_Crest_MaximumVelocity, _Crest_MaximumVelocity); + + _Crest_VelocityYTarget[id.xy] = vyAdvected; + } + + // H + if (id.z == 2) + { + const float2 worldXZ = IdToWorldXZ_H(id.xy); + + // Advect forwards to predict advected position + const float2 worldXZAdvected_prediction = worldXZ - _Crest_SimulationDeltaTime * float2(SampleVx0(worldXZ), SampleVy0(worldXZ)); + + float2 worldXZAdvected = worldXZAdvected_prediction; + if (_Crest_MacCormackAdvectionForHeight) + { + // Update prediction by advecting backwards to obtain a starting position and using the difference as an error term + + // Advect forwards to predict original position + const float2 worldXZ_prediction = worldXZAdvected_prediction + _Crest_SimulationDeltaTime * float2(SampleVx0(worldXZAdvected_prediction), SampleVy0(worldXZAdvected_prediction)); + + // Remove half of prediction error to yield average of both + worldXZAdvected -= (worldXZ_prediction - worldXZ) / 2.0; + } + + _Crest_HeightTarget[id.xy] = SampleH(worldXZAdvected); + } +} + + +// +// Update Height +// + +float HeightAdjustment(uint2 id) +{ + const float gravity = 9.81f; + float hn = _Crest_HeightSource[id + uint2(0, 1)]; + float hs = _Crest_HeightSource[id - uint2(0, 1)]; + float he = _Crest_HeightSource[id + uint2(1, 0)]; + float hw = _Crest_HeightSource[id - uint2(1, 0)]; + float h_avg = 0.25 * (hn + hs + he + hw); + float beta = 2.0; + float minThickness = beta * _Crest_TexelSize / (gravity * _Crest_SimulationDeltaTime); + return max(0.0, h_avg - minThickness); +} + +void UpdateHeight(const uint3 i_ID) +{ + const int2 id = i_ID.xy; + + // Fix height at border to prevent instability. + if (i_ID.x == 0 || i_ID.y == 0 || i_ID.x == _Crest_Resolution - 1 || i_ID.y == _Crest_Resolution - 1) + { + _Crest_HeightTarget[id] = _Crest_HeightSource[id]; + return; + } + + float h = _Crest_HeightSource[id]; + + const uint x = id.x; + const uint y = id.y; + + const float2 worldXZ = IdToWorldXZ_H(id); + + float pump = 0.0; + + if (h > 0.01) + { + // Drain water out at boundary of domain. + { + const float2 offset = abs(id / float(_Crest_Resolution) - 0.5); + pump += _Crest_DrainWaterAtBoundaries * smoothstep(0.4, 0.5, max(offset.x, offset.y)); + } + + // Blend waves into simulation. Pumps water in. + { + uint slice0, slice1; float alpha; + PosToSliceIndices(worldXZ, 0.0, g_Crest_LodCount - 1.0, g_Crest_WaterScale, slice0, slice1, alpha); + + const float weight0 = (1.0 - alpha) * g_Crest_CascadeData[slice0].y; + const float weight1 = (1.0 - weight0) * g_Crest_CascadeData[slice1].y; + + float waterY = g_Crest_WaterCenter.y; + + // If injecting to height then ignore waves. + if (_Crest_InjectLevel) + { + if (_Crest_SampleFromLevelInputs) + { + waterY += SampleWaterLevel(worldXZ); + } + else + { + waterY += + weight0 * Cascade::MakeLevel(slice0).SampleLevel(worldXZ) + + weight1 * Cascade::MakeLevel(slice1).SampleLevel(worldXZ); + } + } + else + { + waterY += + weight0 * Cascade::MakeAnimatedWaves(slice0).SampleAnimatedWaves(worldXZ).y + + weight1 * Cascade::MakeAnimatedWaves(slice1).SampleAnimatedWaves(worldXZ).y; + } + + float simulationY = h + _Crest_DomainOrigin.y + _Crest_GroundHeightSource[id]; + if (waterY > simulationY) + { + // This is tricksy. Don't apply forces from waves in deep, but also don't apply in very shallow. + // The latter will mean that the SWS is held at sea level instead of being allowed to drop below. + // I tried asserting disp.y > somevalue but that led to a whole different set of issues. Therefore + // settle for a y=4x(1-x) weight that chooses the mid point of the mask blend. Seems to work. + float maskWeight = 1.0; + if (!_Crest_InjectLevel) + { + maskWeight = _Crest_MaskSource[id]; + maskWeight *= 4.0 * (1.0 - maskWeight); + } + + pump += _Crest_BlendPushUpStrength * maskWeight * (waterY - simulationY); + } + } + } + + // Update height based on total flow in minus total flow out. + // Prevents wave reflections at domain boundary. + float drain = 30.0; + float vxp = (x == uint(_Crest_Resolution - 1)) ? drain : _Crest_VelocityXSource[id]; + float vyp = (y == uint(_Crest_Resolution - 1)) ? drain : _Crest_VelocityYSource[id]; + float vxm = (x == 0) ? -drain : _Crest_VelocityXSource[uint2(x - 1, y)]; + float vym = (y == 0) ? -drain : _Crest_VelocityYSource[uint2(x, y - 1)]; + + // FIXME: Causes jitters which triggers foam. + float hvel; + if (_Crest_UpwindHeight) + { + // Get forward or backward diffs respectively. + float h = _Crest_HeightSource[id]; + float2 hx = vxp <= 0.0 + ? float2(h, _Crest_HeightSource[id + uint2(1, 0)]) + : float2(_Crest_HeightSource[id - uint2(1, 0)], h); + float2 hy = vyp <= 0.0 + ? float2(h, _Crest_HeightSource[id + uint2(0, 1)]) + : float2(_Crest_HeightSource[id - uint2(0, 1)], h); + + if (_Crest_DepthLimiter) + { + const float h_adj = HeightAdjustment(id); + hx -= h_adj; + hy -= h_adj; + } + + hvel = -(vxp * hx[1] - vxm * hx[0] + vyp * hy[1] - vym * hy[0]) / _Crest_TexelSize; + } + else + { + const float dx = (vxp - vxm) / _Crest_TexelSize; + const float dy = (vyp - vym) / _Crest_TexelSize; + const float divergence = dx + dy; + + if (_Crest_DepthLimiter) + { + hvel = -(h - HeightAdjustment(id)) * divergence; + } + else + { + hvel = -h * divergence; + } + } + + h += _Crest_SimulationDeltaTime * hvel + pump - _Crest_Evaporation; + h = max(h, 0.0); + + // // Dry - force to zero. + // if (h < 0.001) h = 0.0; + + _Crest_HeightTarget[id] = h; +} + + +// +// Height Overshoot Reduction +// + +void HeightOvershootReduction(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + + float h = _Crest_HeightSource[id]; + + if (any(id == 0) || any(id == _Crest_Resolution - 1)) + { + // Don't do this at boundary + _Crest_HeightTarget[id] = h; + return; + } + + float y = _Crest_HeightSource[id] + _Crest_GroundHeightSource[id]; + float hn = _Crest_HeightSource[id + uint2(1, 0)]; + float hs = _Crest_HeightSource[id - uint2(1, 0)]; + float he = _Crest_HeightSource[id + uint2(1, 0)]; + float hw = _Crest_HeightSource[id - uint2(1, 0)]; + float yn = hn + _Crest_GroundHeightSource[id + uint2(1, 0)]; + float ys = hs + _Crest_GroundHeightSource[id - uint2(1, 0)]; + float ye = he + _Crest_GroundHeightSource[id + uint2(1, 0)]; + float yw = hw + _Crest_GroundHeightSource[id - uint2(1, 0)]; + + float lambdaEdge = 2.0 * _Crest_TexelSize; + + // X axis + if ((y - yw) > lambdaEdge && y > ye) + { + h += _Crest_OvershootReductionStrength * (max(0.0, 0.5 * (h + he)) - h); + } + if ((y - ye) > lambdaEdge && y > yw) + { + h += _Crest_OvershootReductionStrength * (max(0.0, 0.5 * (h + hw)) - h); + } + + // Z axis + if ((y - ys) > lambdaEdge && y > yn) + { + h += _Crest_OvershootReductionStrength * (max(0.0, 0.5 * (h + hn)) - h); + } + if ((y - yn) > lambdaEdge && y > ys) + { + h += _Crest_OvershootReductionStrength * (max(0.0, 0.5 * (h + hs)) - h); + } + + _Crest_HeightTarget[id] = h; +} + + +// +// Update Velocity +// + +void UpdateVelocity(const uint3 i_ID) +{ + const int2 id = i_ID.xy; + + // Clear velocity at border to prevent water leaking. + if (i_ID.x == 0 || i_ID.y == 0 || i_ID.x == _Crest_Resolution - 1 || i_ID.y == _Crest_Resolution - 1) + { + _Crest_VelocityXTarget[id] = 0; + _Crest_VelocityYTarget[id] = 0; + return; + } + + // Height before vel + const float2 worldXZ_H0 = IdToWorldXZ_H(id); + const float g0 = _Crest_GroundHeightSource[id]; + const float h0 = _Crest_HeightSource[id]; + + const uint x = id.x; + const uint y = id.y; + const uint xp = min(x + 1, _Crest_Resolution - 1); + const uint yp = min(y + 1, _Crest_Resolution - 1); + + const float gravity = 9.81f; + + // Vx + { + float vx = _Crest_VelocityXTarget[id]; + + const float2 worldXZ_H1 = IdToWorldXZ_H(uint2(xp, y)); + const float g1 = _Crest_GroundHeightSource[uint2(xp, y)]; + const float h1 = _Crest_HeightSource[uint2(xp, y)]; + + const float hdiff = (h1 + g1) - (h0 + g0); + //if (fabs(hdiff) > maxDiff) hdiff = sign(hdiff) * maxDiff; + + float accel = -gravity * hdiff / _Crest_TexelSize; + + vx += _Crest_SimulationDeltaTime * accel; + + // Kill velocity if totally dry + if (h0 < 0.001 && h1 < 0.001) + { + vx = 0.0; + } + else if (accel < 0 && h1 < 0.001) + { + // Don't produce acceleration from water flowing in from a dry cell + vx = 0.0; + } + else if (accel > 0 && h0 < 0.001) + { + // Don't produce acceleration from water flowing in from a dry cell + vx = 0.0; + } + + _Crest_VelocityXTarget[id] = vx; + + if (h0 < 0.001 && h1 < 0.001) _Crest_VelocityXTarget[id] = 0.0; + } + + // Vy + { + float vy = _Crest_VelocityYTarget[id]; + + const float2 worldXZ_H1 = IdToWorldXZ_H(uint2(x, yp)); + const float g1 = _Crest_GroundHeightSource[uint2(x, yp)]; + const float h1 = _Crest_HeightSource[uint2(x, yp)]; + + const float hdiff = (h1 + g1) - (h0 + g0); + //if (fabs(hdiff) > maxDiff) hdiff = sign(hdiff) * maxDiff; + + float accel = -gravity * hdiff / _Crest_TexelSize; + + vy += _Crest_SimulationDeltaTime * accel; + + // Kill velocity if totally dry + if (h0 < 0.001 && h1 < 0.001) + { + vy = 0.0; + } + else if (accel < 0 && h1 < 0.001) + { + // Don't produce acceleration from water flowing in from a dry cell + vy = 0.0; + } + else if (accel > 0 && h0 < 0.001) + { + // Don't produce acceleration from water flowing in from a dry cell + vy = 0.0; + } + + _Crest_VelocityYTarget[id] = vy; + } +} + + +// +// Blur +// + +void Blur(const uint3 i_ID) +{ + const int2 id = i_ID.xy; + const int resolution = _Crest_Resolution; + + float result = 0.0; + const int radius = 1; + float sampleCount = 0.0; + for (int y = -radius; y <= radius; y++) + { + for (int x = -radius; x <= radius; x++) + { + int2 idx = id + int2(x, y); + // Skip pixel if outside. Clamping coordinates produced bad values at edge. + if (any(idx < 0) || any(idx >= resolution)) continue; + result += _Crest_MaskSource[idx]; + sampleCount += 1.0; + } + } + + _Crest_MaskTarget[id] = result / sampleCount; +} + +void BlurHeight(const uint3 i_ID) +{ + const int2 id = i_ID.xy; + + float result = 0.0; + float twt = 0.0; + const int rad = 1; + + float hcenter = _Crest_HeightSource[id]; + if (hcenter < 0.001) + { + _Crest_HeightTarget[id] = 0.0; + return; + } + + for (int y = -rad; y <= rad; y++) + { + for (int x = -rad; x <= rad; x++) + { + int2 idx; + // Need to cast otherwise load will wrap around at edges. + idx.x = clamp(id.x + x, 0, (int)_Crest_Resolution - 1); + idx.y = clamp(id.y + y, 0, (int)_Crest_Resolution - 1); + + float h = _Crest_HeightSource[idx]; + if (h >= 0.001) + { + result += h + _Crest_GroundHeightSource[idx]; + twt += 1.0; + } + } + } + + if (twt > 0.0) + { + float blurredY = result / twt; + _Crest_HeightTarget[id] = max(blurredY - _Crest_GroundHeightSource[id], 0.0); + } + else + { + _Crest_HeightTarget[id] = hcenter; + } +} + +void AddAboveGroundHeight(const uint2 i_Coordinates, const float i_Ground, inout float io_Height, inout float io_Samples) +{ + float h = _Crest_HeightSource[i_Coordinates]; + + if (h > FLT_MIN) + { + // Make sure we do not push water through ground. + if (h < i_Ground) + { + io_Height += h; + io_Samples += 1.0; + } + } +} + +void MaskOut(const uint2 i_Coordinates, const float i_HeightBelowGround, inout bool i_Mask) +{ + const float h = _Crest_HeightSource[i_Coordinates]; + + if (h > 0.0) + { + const float g = _Crest_GroundHeightSource[i_Coordinates]; + i_Mask = i_Mask || (i_HeightBelowGround < (h + g)); + } +} + +void MaskEdge(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + + float h = _Crest_HeightSource[id]; + + // Mask above ground height so we do not process it in expand edge. + bool mask = h > 0.0; + + // Add ground height to water height to get world height of surface. + h += _Crest_GroundHeightSource[id]; + + if (!mask) + { + const int3 dd = int3(1, -1, 0); + MaskOut(id + dd.xx, h, mask); + MaskOut(id + dd.xy, h, mask); + MaskOut(id + dd.xz, h, mask); + MaskOut(id + dd.yx, h, mask); + MaskOut(id + dd.yy, h, mask); + MaskOut(id + dd.yz, h, mask); + MaskOut(id + dd.zx, h, mask); + MaskOut(id + dd.zy, h, mask); + } + + if (mask) + { + // Move to world space. + h += _Crest_DomainOrigin.y; + // Make relative to sea level. + h -= g_Crest_WaterCenter.y; + } + else + { + h = FLT_MIN; + } + + _Crest_HeightTarget[id] = h; +} + +void ExpandEdge(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + const int3 dd = int3(1, -1, 0); + + float h = _Crest_HeightSource[id]; + + if (h > FLT_MIN) + { + _Crest_HeightTarget[id] = h; + return; + } + + const float g = _Crest_GroundHeightSource[id] + _Crest_DomainOrigin.y - g_Crest_WaterCenter.y; + + // Add margin inside geometry to prevent rise or drops at intersections. + + float samples = 0.0; + h = 0.0; + + AddAboveGroundHeight(id + dd.xx, g, h, samples); + AddAboveGroundHeight(id + dd.xy, g, h, samples); + AddAboveGroundHeight(id + dd.xz, g, h, samples); + AddAboveGroundHeight(id + dd.yx, g, h, samples); + AddAboveGroundHeight(id + dd.yy, g, h, samples); + AddAboveGroundHeight(id + dd.yz, g, h, samples); + AddAboveGroundHeight(id + dd.zx, g, h, samples); + AddAboveGroundHeight(id + dd.zy, g, h, samples); + + // Found a height. + if (samples > 0.0) + { + // Includes ground, sea level and origin. + h /= samples; + } + + _Crest_HeightTarget[id] = h; +} + +void FinalizeHeight(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + float h = _Crest_HeightSource[id]; + + // Clip doesn't work if ground is below sea level - it will make the water pop back up to sea level/anim waves. + // Same for multiplying down alpha blend weight. This does something reasonable - yanks down water when almost dry.. + h -= 0.1 * (1.0 - saturate(h / 0.02)); + + // Add ground height to water height to get world height of surface. + h += _Crest_GroundHeightSource[id]; + + // Move to world space. + h += _Crest_DomainOrigin.y; + // Make relative to sea level. + h -= g_Crest_WaterCenter.y; + + _Crest_HeightTarget[id] = h; +} + + +// +// Injectors +// + +float WaterHeight(float2 i_UV, float i_Current = 0.0) +{ + float h = _Crest_HeightSource.SampleLevel(LODData_linear_clamp_sampler, i_UV, 0.0).x; + + // Reject any samples below ground. + if (h < 0.001) + { + // Return the current height to not trigger the curve test. + h = i_Current; + } + else + { + // Add ground height to water height to get height of surface + h += _Crest_GroundHeightSource.SampleLevel(LODData_linear_clamp_sampler, i_UV, 0.0).x; + } + + // Silences: shader warning use of potentially uninitialized variable. + return h; +} + +float ComputeAlpha(const float2 i_UV) +{ + // Domain mask. + const float2 offset = abs(i_UV - 0.5); + float alpha = smoothstep(0.5, 0.45, max(offset.x, offset.y)); + + if (alpha >= 0.0) + { + // Simulation mask. + alpha *= _Crest_MaskSource.SampleLevel(LODData_linear_clamp_sampler, i_UV, 0.0); + } + + return alpha; +} + +float ComputeAlphaFromMargin(const float2 i_Position) +{ + float alpha = 1.0; + float2 position = abs(i_Position - _Crest_DomainOrigin.xz); + if (max(position.x, position.y) > (_Crest_DomainWidth.x * 0.5 - _Crest_MarginWidth)) alpha = 0.0; + return alpha; +} + +void InjectShape(const uint3 i_ID) +{ + const float2 position = Cascade::MakeAnimatedWaves(i_ID.z).IDToWorld(i_ID.xy); + const float2 uv = (position - _Crest_DomainOrigin.xz) / _Crest_DomainWidth + 0.5; + + // Over scan to ensure signal continued off the edges which helps at low LODs. + if (any(uv != saturate(uv))) return; + + float alpha = _Crest_Weight * ComputeAlpha(uv); + if (alpha <= 0.0) return; + + float h = _Crest_HeightSource.SampleLevel(LODData_linear_clamp_sampler, uv, 0.0).x; + + // Power up alpha to bring anim waves further in towards shore. + alpha = pow(alpha, 2.0); + + float4 result = _Crest_ShapeTarget[i_ID]; + + // Alpha blend. + result.xyz *= 1.0 - alpha; + result.xyz += float3(0, h * alpha, 0); + + _Crest_ShapeTarget[i_ID] = result; +} + +void InjectLevel(const uint3 i_ID) +{ + const float2 position = Cascade::MakeLevel(i_ID.z).IDToWorld(i_ID.xy); + const float2 uv = (position - _Crest_DomainOrigin.xz) / _Crest_DomainWidth + 0.5; + + // Over scan to ensure signal continued off the edges which helps at low LODs. + if (any(uv != saturate(uv))) return; + + float alpha = _Crest_Weight * ComputeAlphaFromMargin(position); + if (alpha <= 0.0) return; + + float h = _Crest_HeightSource.SampleLevel(LODData_linear_clamp_sampler, uv, 0.0).x; + + float result = _Crest_Weight * _Crest_LevelTarget[i_ID]; + + // Height is a source of water and should be the minimum height. + // The simulation will still ripple over the top which is acceptable. + result = max(result, h); + + _Crest_LevelTarget[i_ID] = result; +} + +void InjectFoam(const uint3 i_ID) +{ + const float2 position = Cascade::MakeFoam(i_ID.z).IDToWorld(i_ID.xy); + const float2 uv = (position - _Crest_DomainOrigin.xz) / _Crest_DomainWidth + 0.5; + + // Over scan to ensure signal continued off the edges which helps at low LODs. + if (any(uv != saturate(uv))) return; + + float alpha = _Crest_Weight * (_Crest_InjectLevel ? ComputeAlphaFromMargin(position) : ComputeAlpha(uv)); + if (alpha <= 0.0) return; + + // Use approximation of max curvature as foam term. Seems to grab leading wave edge alright. + const float2 dx = float2(1.0 / _Crest_Resolution, 0.0); + const float h = WaterHeight(uv); + if (h <= 0.0) return; + const float h_xm = WaterHeight(uv - dx.xy, h); + const float h_xp = WaterHeight(uv + dx.xy, h); + const float h_zm = WaterHeight(uv - dx.yx, h); + const float h_zp = WaterHeight(uv + dx.yx, h); + const float curvature = max(abs(h_xp + h_xm - 2.0 * h), abs(h_zp + h_zm - 2.0 * h)) / (2.0 * dx.x * _Crest_DomainWidth); + + float foam = 10.0 * curvature; + + // Apply velocity to flow to prevent foam at edges of geometry. + const float vx = _Crest_VelocityXSource.SampleLevel(LODData_linear_clamp_sampler, uv, 0.0); + const float vy = _Crest_VelocityYSource.SampleLevel(LODData_linear_clamp_sampler, uv, 0.0); + foam *= length(float2(vx, vy)); + + foam *= alpha; + + // Integrate. + foam *= _Crest_SimDeltaTime; + + foam *= _Crest_InjectionStrength; + + _Crest_FoamTarget[i_ID] += foam; +} + +void InjectFlow(const uint3 i_ID) +{ + const Cascade cascade = Cascade::MakeFlow(i_ID.z); + const float2 position = cascade.IDToWorld(i_ID.xy); + const float2 uv = (position - _Crest_DomainOrigin.xz) / _Crest_DomainWidth + 0.5; + + // Over scan to ensure signal continued off the edges which helps at low LODs. + if (any(uv != saturate(uv))) return; + + float alpha = _Crest_Weight * (_Crest_InjectLevel ? ComputeAlphaFromMargin(position) : ComputeAlpha(uv)); + if (alpha <= 0.0) return; + + float mip; + { + const float3 uv = cascade.IDToUV(i_ID.xy); + const float2 dd = float2(cascade._OneOverResolution * 8.0, 0); + const float2 dx = cascade.UVToWorld(uv + dd.xyy) - position; + const float2 dy = cascade.UVToWorld(uv + dd.yxy) - position; + // Calculate the rate of change in x and y directions. + const float2 rateOfChange = float2(length(dx.xy), length(dy.xy)); + mip = log2(max(rateOfChange.x, rateOfChange.y)); + } + + // These should use mip maps. Without this bad pops ensue from aliasing x combine-pass-flow. + const float vx = _Crest_VelocityXSource.SampleLevel(LODData_linear_clamp_sampler, uv, mip); + const float vy = _Crest_VelocityYSource.SampleLevel(LODData_linear_clamp_sampler, uv, mip); + + float2 result = _Crest_FlowTarget[i_ID]; + + // Alpha blend. + result *= 1.0 - alpha; + result += float2(vx, vy) * _Crest_InjectionStrength * alpha; + + _Crest_FlowTarget[i_ID] = result; +} + + +// +// Baking +// + +// Copy texture. Here because script code path simpler if same for all outputs +// rather than using CopyTexture. +void BakeLevel(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + _Crest_LevelBakeTarget[id] = _Crest_HeightSource[id]; +} + +void BakeFoam(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + const float2 uv = id / (float)_Crest_Resolution; + + // Over scan to ensure signal continued off the edges which helps at low LODs. + if (any(uv != saturate(uv))) return; + + float alpha = ComputeAlphaFromMargin(IdToWorldXZ_H(id)); + if (alpha <= 0.0) return; + + // Cannot load texture as curvature is not picked up. Must need interpolation. + const float2 dx = float2(1.0 / _Crest_Resolution, 0.0); + const float h = WaterHeight(uv); + if (h <= 0.0) + { + _Crest_FoamBakeTarget[id] = 0.0; + return; + } + const float h_xm = WaterHeight(uv - dx.xy, h); + const float h_xp = WaterHeight(uv + dx.xy, h); + const float h_zm = WaterHeight(uv - dx.yx, h); + const float h_zp = WaterHeight(uv + dx.yx, h); + const float curvature = max(abs(h_xp + h_xm - 2.0 * h), abs(h_zp + h_zm - 2.0 * h)) / (2.0 * dx.x * _Crest_DomainWidth); + + float foam = 10.0 * curvature; + + foam *= length(float2(_Crest_VelocityXSource[id], _Crest_VelocityYSource[id])); + + foam *= _Crest_InjectionStrength; + + _Crest_FoamBakeTarget[id] = foam; +} + +void BakeFlow(const uint3 i_ID) +{ + const uint2 id = i_ID.xy; + float alpha = ComputeAlphaFromMargin(IdToWorldXZ_H(id)); + if (alpha <= 0.0) return; + _Crest_FlowBakeTarget[id.xy] = float2(_Crest_VelocityXSource[id], _Crest_VelocityYSource[id]) * _Crest_InjectionStrength; +} + +m_CrestNameSpaceEnd + +m_CrestKernelDefault(Initialize); +m_CrestKernelDefault(InitializeGroundHeight); +m_CrestKernelDefault(Advect); +m_CrestKernelDefault(UpdateHeight); +m_CrestKernelDefault(HeightOvershootReduction); +m_CrestKernelDefault(UpdateVelocity); +m_CrestKernelDefault(BlurHeight); +m_CrestKernelDefault(Blur); +m_CrestKernelDefault(MaskEdge); +m_CrestKernelDefault(ExpandEdge); +m_CrestKernelDefault(FinalizeHeight); + +m_CrestInputKernelDefault(InjectShape); +m_CrestInputKernelDefault(InjectLevel); +m_CrestInputKernelDefault(InjectFoam); +m_CrestInputKernelDefault(InjectFlow); + +m_CrestKernelDefault(BakeLevel); +m_CrestKernelDefault(BakeFoam); +m_CrestKernelDefault(BakeFlow); diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/ShallowWaterSimulation.compute.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/ShallowWaterSimulation.compute.meta new file mode 100644 index 0000000..8edad05 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/ShallowWaterSimulation.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0af900407c415484e8b1482da8ec3881 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/Visualizer.shader b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/Visualizer.shader new file mode 100644 index 0000000..571f76b --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/Visualizer.shader @@ -0,0 +1,87 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest/Debug/Shallow Water Visualizer" +{ + SubShader + { + Tags { "RenderType"="Opaque" } + + Pass + { + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariables.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + + CBUFFER_START(CrestBuffer) + half _Crest_DomainWidth; + float3 _Crest_DomainOrigin; + bool _Crest_RenderFinalHeight; + CBUFFER_END + + Texture2D _Crest_Height; + Texture2D _Crest_GroundHeight; + + struct Attributes + { + float3 positionOS : POSITION; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float3 normalWS : TEXCOORD0; + }; + + float CalculatePositionY(float2 worldXZ) + { + float2 uv = (worldXZ - _Crest_DomainOrigin.xz) / _Crest_DomainWidth + 0.5; + + float h = _Crest_Height.SampleLevel(LODData_linear_clamp_sampler, uv, 0.0).x; + float g = _Crest_GroundHeight.SampleLevel(LODData_linear_clamp_sampler, uv, 0.0).x; + + float y = g + _Crest_DomainOrigin.y; + + if (_Crest_RenderFinalHeight) + { + y += h; + } + + return y; + } + + Varyings Vertex(Attributes input) + { + Varyings output; + + output.positionCS = TransformObjectToHClip(input.positionOS); + float3 positionWS = mul(UNITY_MATRIX_M, float4(input.positionOS, 1.0)).xyz; + + float y = CalculatePositionY(positionWS.xz); + positionWS.y = y; + + float dx = 0.01; + float ydx = CalculatePositionY(positionWS.xz + float2(dx, 0.0)); + float ydz = CalculatePositionY(positionWS.xz + float2(0.0, dx)); + + output.positionCS = mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); + + output.normalWS = float3((y - ydx) / dx, 1.0, (y - ydz) / dx); + + return output; + } + + half4 Fragment(Varyings input) : SV_Target + { + input.normalWS = normalize(input.normalWS); + return half4(input.normalWS, 1.0); + } + ENDHLSL + } + } +} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/Visualizer.shader.meta b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/Visualizer.shader.meta new file mode 100644 index 0000000..741d7d0 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Runtime/Shaders/Visualizer.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 613caf76dccc3ea45b0501b731a55ec2 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach.meta new file mode 100644 index 0000000..cfacd06 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f572b7334d0147b79df9eb94f2503a5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials.meta new file mode 100644 index 0000000..0d8f54a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: beda8c35ca2f44eda8430cd756b444ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Skybox.mat b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Skybox.mat new file mode 100644 index 0000000..16659b4 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Skybox.mat @@ -0,0 +1,30 @@ +%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: Beach_Skybox + m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _Rotation: 12 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Skybox.mat.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Skybox.mat.meta new file mode 100644 index 0000000..160bcd5 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Skybox.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3cc19cc9306194b059fe31ca3c4a841b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Water.mat b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Water.mat new file mode 100644 index 0000000..441f361 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Water.mat @@ -0,0 +1,107 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5994654682710206810 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-4042563326011365698 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Beach_Water + m_Shader: {fileID: -6465566751694194690, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_Parent: {fileID: -876546973899608171, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_ModifiedSerializedProperties: 24 + m_ValidKeywords: + - CREST_FLOW_ON + - _ALPHATEST_ON + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _SPECULAR_SETUP + - _SURFACE_TYPE_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + MotionVector: User + RenderType: Transparent + disabledShaderPasses: + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - CREST_FLOW: 1 + - _AlphaDstBlend: 10 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_DstBlend: 10 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_SrcBlend: 5 + - _BUILTIN_ZWrite: 1 + - _Crest_FoamFeather: 1 + - _CullMode: 0 + - _CullModeForward: 0 + - _DstBlend: 10 + - _QueueControl: 1 + - _SrcBlend: 5 + - _ZTestGBuffer: 3 + m_Colors: + - _Crest_Absorption: {r: 0.27652168, g: 0.08252846, b: 0.07064475, a: 1} + - _Crest_AbsorptionColor: {r: 0.664938, g: 0.8853371, b: 0.90099996, a: 0.105882354} + - _Crest_Scattering: {r: 0.011904758, g: 0.054761898, b: 0.1, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &4748330692745026848 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Water.mat.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Water.mat.meta new file mode 100644 index 0000000..8f80a7c --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Materials/Beach_Water.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9f3a9e9913da84b378fcbf5dd1f912b8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs.meta new file mode 100644 index 0000000..4b78a3c --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc6a902e467124df1a5d04c69f5cfbee +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs/Beach_Scene.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs/Beach_Scene.prefab new file mode 100644 index 0000000..78235e8 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs/Beach_Scene.prefab @@ -0,0 +1,2309 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &500528965128727000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8609792547240146600} + - component: {fileID: 1696523817327012908} + m_Layer: 0 + m_Name: Waves + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8609792547240146600 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 500528965128727000} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 106167211924268354} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1696523817327012908 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 500528965128727000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 5 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Spectrum: {fileID: 0} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 0.76119405 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: -104.77612 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &2248114183228678662 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5669970946232439895} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5669970946232439895 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2248114183228678662} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 3369968984622558964} + - {fileID: 8185967281873239260} + m_Father: {fileID: 6722545905680127086} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3100029780207971777 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4682245877935220536} + - component: {fileID: 466786077928517085} + - component: {fileID: 7820292986042801606} + - component: {fileID: 6087185861204275229} + m_Layer: 31 + m_Name: Terrain + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!4 &4682245877935220536 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3100029780207971777} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -500, y: -50, z: -500} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1247928352190458286} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!218 &466786077928517085 +Terrain: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3100029780207971777} + m_Enabled: 1 + serializedVersion: 6 + m_TerrainData: {fileID: 15600000, guid: 795a7e9d9baf8408c88e4bf9bb76538e, type: 2} + m_TreeDistance: 5000 + m_TreeBillboardDistance: 50 + m_TreeCrossFadeLength: 5 + m_TreeMaximumFullLODCount: 50 + m_DetailObjectDistance: 80 + m_DetailObjectDensity: 1 + m_HeightmapPixelError: 5 + m_SplatMapDistance: 1000 + m_HeightmapMinimumLODSimplification: 0 + m_HeightmapMaximumLOD: 0 + m_ShadowCastingMode: 2 + m_DrawHeightmap: 1 + m_DrawInstanced: 1 + m_DrawTreesAndFoliage: 0 + m_StaticShadowCaster: 0 + m_IgnoreQualitySettings: 0 + m_ReflectionProbeUsage: 1 + m_MaterialTemplate: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2} + m_BakeLightProbesForTrees: 1 + m_PreserveTreePrototypeLayers: 0 + m_DeringLightProbesForTrees: 1 + m_ReceiveGI: 1 + m_ScaleInLightmap: 0.0256 + m_LightmapParameters: {fileID: 15203, guid: 0000000000000000f000000000000000, type: 0} + m_GroupingID: 0 + m_RenderingLayerMask: 1 + m_AllowAutoConnect: 1 + m_EnableHeightmapRayTracing: 1 + m_EnableTreesAndDetailsRayTracing: 0 + m_TreeMotionVectorModeOverride: 3 +--- !u!154 &7820292986042801606 +TerrainCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3100029780207971777} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_TerrainData: {fileID: 15600000, guid: 795a7e9d9baf8408c88e4bf9bb76538e, type: 2} + m_EnableTreeColliders: 0 +--- !u!114 &6087185861204275229 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3100029780207971777} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e49c7e9e3297f44b3a07573b45ec815d, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Material: {fileID: 10650, guid: 0000000000000000f000000000000000, type: 0} + _MaterialHDRP: {fileID: 2100000, guid: 22ff8771d87ef27429e670136399094b, type: 2} + _MaterialURP: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2} +--- !u!1 &3346479803504508987 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 106167211924268354} + - component: {fileID: 8030153365830182461} + m_Layer: 0 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &106167211924268354 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3346479803504508987} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 8609792547240146600} + - {fileID: 7503417248560286303} + m_Father: {fileID: 6722545905680127086} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8030153365830182461 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3346479803504508987} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e64c239f69eea46778ded6dcc3427a34, type: 3} + m_Name: + m_EditorClassIdentifier: + _Layer: 4 + _Material: {fileID: 2100000, guid: 9f3a9e9913da84b378fcbf5dd1f912b8, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Version: 1 + _Camera: {fileID: 0} + _TimeProvider: {fileID: 0} + _WindZone: {fileID: 0} + _OverrideWindZoneWindSpeed: 0 + _WindSpeed: 150 + _OverrideWindZoneWindDirection: 0 + _WindDirection: 0 + _OverrideWindZoneWindTurbulence: 0 + _WindTurbulence: 0.145 + _OverrideGravity: 0 + _GravityOverride: -9.8 + _GravityMultiplier: 1 + _PrimaryLight: {fileID: 0} + _InjectionPoint: 0 + _WriteToColorTexture: 1 + _WriteToDepthTexture: 1 + _WriteMotionVectors: 1 + _OverrideRenderHDR: 0 + _RenderHDR: 1 + _Surface: + rid: 1002 + _ScaleRange: {x: 4, y: 256} + _DropDetailHeightBasedOnWaves: 0.3 + _Slices: 9 + _Resolution: 768 + _GeometryDownSampleFactor: 2 + _ExtentsSizeMultiplier: 100 + _Viewpoint: {fileID: 0} + _CenterOfDetailDisplacementCorrection: 1 + _SampleTerrainHeightForScale: 1 + _ForceScaleChangeSmoothing: 0 + _TeleportThreshold: 10 + _AnimatedWavesLod: + rid: 162836874658316288 + _DepthLod: + rid: 162836874658316289 + _LevelLod: + rid: 162836874658316290 + _FoamLod: + rid: 162836874658316291 + _DynamicWavesLod: + rid: 162836874658316292 + _FlowLod: + rid: 162836874658316293 + _ShadowLod: + rid: 162836874658316294 + _AbsorptionLod: + rid: 1000 + _ScatteringLod: + rid: 1001 + _ClipLod: + rid: 162836874658316295 + _AlbedoLod: + rid: 162836874658316296 + _Reflections: + rid: 162836874658316297 + _Underwater: + rid: 162836874658316298 + _Meniscus: + rid: 1003 + _Portals: + rid: 162836874658316299 + _ShowWaterProxyPlane: 0 + _EditModeFrameRate: 30 + _FollowSceneCamera: 1 + _HeightQueries: 1 + _Debug: + _AttachDebugGUI: 0 + _ShowHiddenObjects: 0 + _DisableFollowViewpoint: 0 + _DestroyResourcesInOnDisable: 0 + _DrawLodOutline: 0 + _ShowDebugInformation: 0 + _LogScaleChange: 0 + _PauseOnScaleChange: 0 + _IgnoreWavesForScaleChange: 0 + _ForceNoGraphics: 0 + _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + references: + version: 2 + RefIds: + - rid: 1000 + type: {class: AbsorptionLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 7 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 1.026, g: 2.085, b: 2.5500002, a: 0.306} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1001 + type: {class: ScatteringLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 23 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 0, g: 0.588, b: 1.2, a: 6} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1002 + type: {class: SurfaceRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 9f3a9e9913da84b378fcbf5dd1f912b8, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Debug: + _UniformTiles: 0 + _DisableSkirt: 0 + - rid: 1003 + type: {class: Meniscus, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 238e45299a5ec46308e9bf99ddf67963, type: 2} + - rid: 162836874658316288 + type: {class: AnimatedWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 48 + _WaveResolutionMultiplier: 2 + _AttenuationInShallows: 0.95 + _ShallowsMaximumDepth: 1000 + _CollisionSource: 2 + _CollisionLayers: -1 + _MaximumQueryCount: 4096 + _BakedWaveData: {fileID: 0} + - rid: 162836874658316289 + type: {class: DepthLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 46 + _IncludeTerrainHeight: 0 + _EnableSignedDistanceFields: 1 + - rid: 162836874658316290 + type: {class: LevelLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 300 + _TextureFormat: 45 + - rid: 162836874658316291 + type: {class: FoamLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 45 + _SimulationFrequency: 30 + _Prewarm: 1 + _Settings: {fileID: 11400000, guid: 0a2c1b990ef0647a383d218455508a27, type: 2} + - rid: 162836874658316292 + type: {class: DynamicWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 512 + _TextureFormatMode: 300 + _TextureFormat: 46 + _SimulationFrequency: 60 + _AttenuationInShallows: 1 + _Settings: {fileID: 0} + - rid: 162836874658316293 + type: {class: FlowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 128 + _TextureFormatMode: 100 + _TextureFormat: 46 + - rid: 162836874658316294 + type: {class: ShadowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 6 + _SimulationFrequency: 60 + _DynamicSoftShadows: 1 + _SoftJitterExtinctionFactor: 0.75 + _JitterDiameterSoft: 15 + _CurrentFrameWeightSoft: 0.03 + _JitterDiameterHard: 0.6 + _CurrentFrameWeightHard: 0.15 + _AllowNullLight: 0 + _AllowNoShadows: 0 + - rid: 162836874658316295 + type: {class: ClipLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 5 + _DefaultClippingState: 0 + - rid: 162836874658316296 + type: {class: AlbedoLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 768 + _TextureFormatMode: 100 + _TextureFormat: 8 + - rid: 162836874658316297 + type: {class: WaterReflections, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 0 + _Mode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 1 + _Resolution: 256 + _RenderOnlySingleCamera: 0 + _Sky: 0 + _DisablePixelLights: 1 + _DisableShadows: 1 + _HDR: 1 + _Stencil: 0 + _AllowMSAA: 0 + _QualitySettingsOverride: + _OverrideLodBias: 0 + _LodBias: 0.5 + _OverrideMaximumLodLevel: 0 + _MaximumLodLevel: 1 + _OverrideTerrainPixelError: 0 + _TerrainPixelError: 10 + _ClipPlaneOffset: 0 + _FarClipPlane: 1000 + _DisableOcclusionCulling: 1 + _RefreshPerFrames: 1 + _FrameRefreshOffset: 0 + _UseObliqueMatrix: 1 + _NonObliqueNearSurface: 0 + _NonObliqueNearSurfaceThreshold: 0.05 + _Debug: + _ShowHiddenObjects: 0 + _DisableRecursiveRendering: 0 + - rid: 162836874658316298 + type: {class: UnderwaterRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: f2b096e4d95e646c49d48ece0afa0547, type: 2} + _EnvironmentalLightingEnable: 0 + _EnvironmentalLightingWeight: 1 + _EnvironmentalLightingVolumeProfile: {fileID: 0} + _AllCameras: 0 + _CopyWaterMaterialParametersEachFrame: 1 + _FarPlaneMultiplier: 0.68 + _CullLimit: 0.001 + _Debug: + _VisualizeMask: 0 + _DisableMask: 0 + _VisualizeStencil: 0 + _DisableHeightAboveWaterOptimization: 0 + _DisableArtifactCorrection: 0 + _OnlyReflectionCameras: 0 + - rid: 162836874658316299 + type: {class: PortalRenderer, ns: WaveHarmonic.Crest.Portals, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _Mode: 2 + _Geometry: {fileID: 0} + _Invert: 0 +--- !u!1 &5380638823946181067 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7503417248560286303} + - component: {fileID: 122188446994512578} + - component: {fileID: 2445687726205438228} + m_Layer: 0 + m_Name: Shallow Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7503417248560286303 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5380638823946181067} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -323, y: 0, z: -326.1} + m_LocalScale: {x: 128, y: 1, z: 128} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 106167211924268354} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &122188446994512578 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5380638823946181067} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9a87083040be2a947bf2d5f126a800e4, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Preset: 1 + _Width: 128 + _Depth: 2 + _Placement: 0 + _PlaceAtSeaLevel: 1 + _Friction: 0.02 + _DynamicSeabed: 0 + _SampleDepthProbeDirectly: 1 + _SampleWaterLevelInputsDirectly: 1 + _AdditionalWater: 0 + _DrainWaterAtBoundaries: -0.01 + _Evaporation: 0 + _BlendDepthRange: {x: 0, y: 3} + _BlendPushUpStrength: 0.1 + _EnableDistanceCulling: 0 + _CullDistance: 75 + _CullTransitionSpeed: 0.5 + _TimeStep: 0.01 + _CourantNumber: 0.5 + _OvershootReductionStrength: 0.25 + _TexelSize: 0.0625 + _MaximumResolution: 1024 + _BlurShapeForRender: 1 + _BlurMaskIterations: 10 + _WaterEdgeMargin: 1 + _WaterEdgeMarginWidth: 4 + _WaterEdgeMarginBakedWidth: 32 + _Mode: 0 + _InjectShape: 1 + _LevelTexture: {fileID: 0} + _MaximumDisplacementVertical: 0 + _PaddingWidth: 2 + _InjectFlow: 1 + _FlowTexture: {fileID: 0} + _FlowStrength: 1 + _InjectFoam: 1 + _FoamTexture: {fileID: 0} + _FoamStrength: 0.5 + _Debug: + _SkipUpdate: 0 + _SkipUpdateHeight: 0 + _SkipUpdateVelocities: 0 + _SkipAdvect: 0 + _SkipAdvectHeights: 0 + _DisableStabilityImprovements: 0 + _DisableMacCormackScheme: 0 + _DisableMacCormackSchemeForHeight: 0 + _DisableUpwindHeight: 0 + _DisableDepthLimiter: 0 + _DisableOvershootReduction: 0 + _AlwaysExecuteSimulation: 0 + _SkipInjectShape: 0 + _ShowSimulationData: 0 + _ShowSimulationDataInScene: 0 +--- !u!114 &2445687726205438228 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5380638823946181067} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70deb49b538e247b9ab1bf7773d16809, type: 3} + m_Name: + m_EditorClassIdentifier: + _Type: 0 + _RefreshMode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 2147483649 + _Resolution: 1024 + _CaptureRange: {x: -1000, y: 100} + _FillHolesCaptureHeight: 0 + _EnableBackFaceInclusion: 1 + _QualitySettingsOverride: + _OverrideLodBias: 1 + _LodBias: Infinity + _OverrideMaximumLodLevel: 1 + _MaximumLodLevel: 0 + _OverrideTerrainPixelError: 1 + _TerrainPixelError: 0 + _SavedTexture: {fileID: 0} + _GenerateSignedDistanceField: 1 + _AdditionalJumpFloodRounds: 7 + _Debug: + _ForceAlwaysUpdateDebug: 0 + _ShowHiddenObjects: 0 + _ShowSimulationDataInScene: 0 + _Version: 1 +--- !u!1 &5518571198563152509 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3623959134223671661} + - component: {fileID: 2892243981918257904} + m_Layer: 0 + m_Name: Depth Probe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3623959134223671661 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5518571198563152509} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -299, y: 0, z: -320} + m_LocalScale: {x: 400, y: 1, z: 400} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1247928352190458286} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2892243981918257904 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5518571198563152509} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70deb49b538e247b9ab1bf7773d16809, type: 3} + m_Name: + m_EditorClassIdentifier: + _Type: 0 + _RefreshMode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 2147483648 + _Resolution: 512 + _CaptureRange: {x: -1000, y: 100} + _FillHolesCaptureHeight: 0 + _EnableBackFaceInclusion: 1 + _QualitySettingsOverride: + _OverrideLodBias: 1 + _LodBias: Infinity + _OverrideMaximumLodLevel: 1 + _MaximumLodLevel: 0 + _OverrideTerrainPixelError: 1 + _TerrainPixelError: 0 + _SavedTexture: {fileID: 0} + _GenerateSignedDistanceField: 1 + _AdditionalJumpFloodRounds: 7 + _Debug: + _ForceAlwaysUpdateDebug: 0 + _ShowHiddenObjects: 0 + _ShowSimulationDataInScene: 0 + _Version: 1 +--- !u!1 &6039876383580551393 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2427288521484247103} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2427288521484247103 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6039876383580551393} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 178800688571301925} + - {fileID: 8829073919524098785} + - {fileID: 7322179407985237919} + m_Father: {fileID: 6722545905680127086} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7596605291968733702 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1247928352190458286} + m_Layer: 0 + m_Name: Environment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1247928352190458286 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7596605291968733702} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 7938971758796787378} + - {fileID: 4682245877935220536} + - {fileID: 3623959134223671661} + m_Father: {fileID: 6722545905680127086} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8399213631255980749 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7938971758796787378} + m_Layer: 0 + m_Name: Rocks + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7938971758796787378 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8399213631255980749} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 2910416392369106427} + - {fileID: 1986407428178769009} + - {fileID: 1012151880701697099} + - {fileID: 2774976562991348545} + - {fileID: 3469434088266725575} + - {fileID: 7695351659104187654} + - {fileID: 5094283331497342911} + - {fileID: 6186807514685781954} + - {fileID: 6087013536502808476} + m_Father: {fileID: 1247928352190458286} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8802985210330865214 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6722545905680127086} + m_Layer: 0 + m_Name: Beach_Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6722545905680127086 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8802985210330865214} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5669970946232439895} + - {fileID: 2427288521484247103} + - {fileID: 106167211924268354} + - {fileID: 1247928352190458286} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &337025658049290353 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.x + value: 2.7808003 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.y + value: 2.7807996 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.z + value: 2.7807999 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.x + value: -300.47 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.y + value: -1.54 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.z + value: -337.53 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.8883727 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.005060061 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.45809343 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.03031019 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.076 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 54.525 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.354 + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_Name + value: Rocks_01_C + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b423bf7a132bc5348a001906e8cc291b, type: 3} +--- !u!4 &7695351659104187654 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + m_PrefabInstance: {fileID: 337025658049290353} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &904862544298052755 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5669970946232439895} + m_Modifications: + - target: {fileID: 6079220456006713144, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_Name + value: Post-Processing + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5e01cffb9e8324147affb8e08fd5ed13, type: 3} +--- !u!4 &8185967281873239260 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + m_PrefabInstance: {fileID: 904862544298052755} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &922502922613022520 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5669970946232439895} + m_Modifications: + - target: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_Name + value: Camera + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.x + value: -334.50903 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.y + value: 4.05268 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.z + value: -354.99826 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.97533154 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.12830949 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.17808306 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.02348732 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c26fe2b4fef6c484089497b549dd6b04, type: 3} +--- !u!4 &3369968984622558964 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 922502922613022520} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1229556587225151146 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2427288521484247103} + m_Modifications: + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.18892908 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.07825698 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.9043557 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.3745964 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5304508333967466499, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_Name + value: Sun + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 774ab582b39374a7e9d5dac8e31b9a5a, type: 3} +--- !u!4 &178800688571301925 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + m_PrefabInstance: {fileID: 1229556587225151146} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &2304887824100470236 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 4001800002490710713, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4001868460905879681, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4001916033514215127, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002198735768388743, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Name + value: Rocks_01_A + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.x + value: 2.1962993 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.y + value: 2.1963 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.z + value: 2.196299 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.x + value: -304.2 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.55 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.z + value: -316.63 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.37714875 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.06494639 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.9234919 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.026523726 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 135.57 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.046 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 22afbe6f819a3d24f9715685e137cf23, type: 3} +--- !u!4 &2910416392369106427 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + m_PrefabInstance: {fileID: 2304887824100470236} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &2616671664387288852 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.x + value: 1.926958 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.y + value: 1.926958 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.z + value: 1.926959 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.x + value: -307.54 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.y + value: -3.83 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.z + value: -306.35 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.74191254 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.13775901 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.6438566 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.12663698 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -21.56 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 81.782 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.648 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Name + value: Rocks_03 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7129578638580487585, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7130365165781936757, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7130507600156305085, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7131167526129675643, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6e74665197120c846b9f23c9fdf26789, type: 3} +--- !u!4 &5094283331497342911 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + m_PrefabInstance: {fileID: 2616671664387288852} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3174571554076439638 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 4001800002490710713, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4001868460905879681, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4001916033514215127, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002198735768388743, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Name + value: Rocks_01_A + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.x + value: 2.1962993 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.y + value: 2.1963 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.z + value: 2.196299 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.x + value: -306.11 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.y + value: -2.66 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.z + value: -346.42 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.92099994 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.026948856 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.38319385 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.06477118 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 405.181 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.046 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 22afbe6f819a3d24f9715685e137cf23, type: 3} +--- !u!4 &1986407428178769009 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + m_PrefabInstance: {fileID: 3174571554076439638} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3902106064156194949 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2427288521484247103} + m_Modifications: + - target: {fileID: 963553959586484309, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_Name + value: Lighting + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bece9afbf3ddd49059dd73ba2cc986f6, type: 3} +--- !u!4 &7322179407985237919 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + m_PrefabInstance: {fileID: 3902106064156194949} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3934919292017682231 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.x + value: 1.926958 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.y + value: 1.9269581 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.z + value: 1.9269586 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.x + value: -353.74 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.y + value: -4.9 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.z + value: -334.89 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.50145197 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.0024415178 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.85152847 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.1530988 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.968 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -117.777 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.395 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Name + value: Rocks_03 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7129578638580487585, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7130365165781936757, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7130507600156305085, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7131167526129675643, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6e74665197120c846b9f23c9fdf26789, type: 3} +--- !u!4 &6087013536502808476 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + m_PrefabInstance: {fileID: 3934919292017682231} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3979275616488124265 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.x + value: 1.926958 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.y + value: 1.926958 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalScale.z + value: 1.926959 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.x + value: -336.96 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.y + value: -3.83 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalPosition.z + value: -314.8 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.75030226 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.024465017 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.65797436 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.059311163 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.59 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 82.309 + objectReference: {fileID: 0} + - target: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.278 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Name + value: Rocks_03 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7129480598278614191, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7129578638580487585, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7130365165781936757, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7130507600156305085, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7131167526129675643, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6e74665197120c846b9f23c9fdf26789, type: 3} +--- !u!4 &6186807514685781954 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7125484819499571371, guid: 6e74665197120c846b9f23c9fdf26789, + type: 3} + m_PrefabInstance: {fileID: 3979275616488124265} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &4149110273584929900 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 4001800002490710713, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4001868460905879681, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4001916033514215127, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002198735768388743, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Name + value: Rocks_01_A + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4002682753704487717, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.x + value: 2.1962996 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.y + value: 2.1962998 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalScale.z + value: 2.196299 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.x + value: -336.1 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.55 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalPosition.z + value: -305.8 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.37165272 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.06510295 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.9257175 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.02613722 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 136.252 + objectReference: {fileID: 0} + - target: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.046 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 22afbe6f819a3d24f9715685e137cf23, type: 3} +--- !u!4 &1012151880701697099 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4008057477555011623, guid: 22afbe6f819a3d24f9715685e137cf23, + type: 3} + m_PrefabInstance: {fileID: 4149110273584929900} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &5252473665286860342 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.x + value: 2.7808 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.y + value: 2.7808 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.z + value: 2.7808 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.x + value: -292.79892 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.3297863 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.z + value: -329.22272 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.98748785 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.12004468 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.10117082 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.01488242 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -13.892 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -11.663 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.30100003 + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_Name + value: Rocks_01_C + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b423bf7a132bc5348a001906e8cc291b, type: 3} +--- !u!4 &2774976562991348545 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + m_PrefabInstance: {fileID: 5252473665286860342} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &6792516105649958320 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7938971758796787378} + m_Modifications: + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.x + value: 2.7808 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.y + value: 2.7808 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalScale.z + value: 2.7808 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.x + value: -286.12 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.22 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalPosition.z + value: -317.06 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.4722085 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.055268947 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.8731477 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.107598975 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -13.892 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -123.153 + objectReference: {fileID: 0} + - target: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.301 + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_Name + value: Rocks_01_C + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7957809826432291963, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b423bf7a132bc5348a001906e8cc291b, type: 3} +--- !u!4 &3469434088266725575 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7955110126290359671, guid: b423bf7a132bc5348a001906e8cc291b, + type: 3} + m_PrefabInstance: {fileID: 6792516105649958320} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7282285977707048229 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2427288521484247103} + m_Modifications: + - target: {fileID: 2054049920268771810, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: sharedProfile + value: + objectReference: {fileID: 11400000, guid: e9a93ddf7b06549febe0f3094eb3cefe, + type: 2} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2942909709672342223, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_Name + value: Atmosphere + objectReference: {fileID: 0} + - target: {fileID: 8705736009777882428, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: _SkyBox + value: + objectReference: {fileID: 2100000, guid: 3cc19cc9306194b059fe31ca3c4a841b, type: 2} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63a4b7e65d06948649ac3e10077d8c2e, type: 3} +--- !u!4 &8829073919524098785 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + m_PrefabInstance: {fileID: 7282285977707048229} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs/Beach_Scene.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs/Beach_Scene.prefab.meta new file mode 100644 index 0000000..43e23d1 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Prefabs/Beach_Scene.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 608e3429fd0c14b53b4116191f6dabe8 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props.meta new file mode 100644 index 0000000..4696759 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0174aaac6567456fa556380aee1e178 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR.meta new file mode 100644 index 0000000..60d0579 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b82e2720a95e49d6b13e3c810490c45 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials.meta new file mode 100644 index 0000000..2937271 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ef82132b3a09d4559bd6f7525fcb8bcc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks.mat b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks.mat new file mode 100644 index 0000000..7e8483d --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks.mat @@ -0,0 +1,434 @@ +%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: Beach_Rocks + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: + - _NORMALMAP + - _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2225 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - RayTracingPrepass + - MOTIONVECTORS + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AnisotropyMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 61b5a5de5f22277438332dd10549bb81, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 61b5a5de5f22277438332dd10549bb81, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: da86c28217cf3de43a76d7731a124ff6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _CoatMaskMap: + 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} + - _DetailMap: + 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} + - _DispTex: + m_Texture: {fileID: 2800000, guid: 36b2627314c0ff7458bdec9c1d15e485, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortionVectorMap: + 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} + - _EmissiveColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HeightMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MOS: + m_Texture: {fileID: 2800000, guid: 86bc65d715b6abc429ae4fb1b92af084, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 61b5a5de5f22277438332dd10549bb81, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskMap: + 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} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: da86c28217cf3de43a76d7731a124ff6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: e1c6267808eb2564b9064f1ed5106b2f, type: 3} + 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} + - _SpecularColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SubsurfaceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TransmissionMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TransmittanceColorMap: + 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: + - _AORemapMax: 1 + - _AORemapMin: 0 + - _ATDistance: 1 + - _AddPrecomputedVelocity: 0 + - _AlbedoAffectEmissive: 0 + - _AlphaClip: 0 + - _AlphaCutoff: 0.5 + - _AlphaCutoffEnable: 0 + - _AlphaCutoffPostpass: 0.5 + - _AlphaCutoffPrepass: 0.5 + - _AlphaCutoffShadow: 0.5 + - _AlphaDstBlend: 0 + - _AlphaRemapMax: 1 + - _AlphaRemapMin: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Anisotropy: 0 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _CastShadows: 1 + - _CoatMask: 0 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAO: 0.5 + - _DetailAlbedoMapScale: 0 + - _DetailAlbedoScale: 1 + - _DetailNormalMapScale: 1 + - _DetailNormalScale: 1 + - _DetailSmoothnessScale: 1 + - _DiffuseAO: 0 + - _DiffusionProfile: 0 + - _DiffusionProfileHash: 0 + - _DispOffset: 0.5 + - _DispPhong: 0 + - _Displacement: 0.088 + - _DisplacementLockObjectScale: 1 + - _DisplacementLockTilingScale: 1 + - _DisplacementMode: 0 + - _DistortionBlendMode: 0 + - _DistortionBlurBlendMode: 0 + - _DistortionBlurDstBlend: 1 + - _DistortionBlurRemapMax: 1 + - _DistortionBlurRemapMin: 0 + - _DistortionBlurScale: 1 + - _DistortionBlurSrcBlend: 1 + - _DistortionDepthTest: 1 + - _DistortionDstBlend: 1 + - _DistortionEnable: 0 + - _DistortionScale: 1 + - _DistortionSrcBlend: 1 + - _DistortionVectorBias: -1 + - _DistortionVectorScale: 2 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 1 + - _DstBlend: 0 + - _EdgeLength: 10.1 + - _EmissiveColorMode: 1 + - _EmissiveExposureWeight: 1 + - _EmissiveIntensity: 1 + - _EmissiveIntensityUnit: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnableGeometricSpecularAA: 0 + - _EnergyConservingSpecularColor: 1 + - _EnvironmentReflections: 1 + - _ExcludeFromTUAndAA: 0 + - _GI_AO: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _HeightAmplitude: 0.02 + - _HeightCenter: 0.5 + - _HeightMapParametrization: 0 + - _HeightMax: 1 + - _HeightMin: -1 + - _HeightOffset: 0 + - _HeightPoMAmplitude: 2 + - _HeightTessAmplitude: 2 + - _HeightTessCenter: 0.5 + - _InvTilingScale: 1 + - _Ior: 1.5 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaterialID: 1 + - _Metallic: 0 + - _MetallicRemapMax: 0 + - _MetallicRemapMin: 0 + - _Mode: 0 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _Normal_Flip_Back_Faces: 1 + - _ObjectSpaceUVMapping: 0 + - _ObjectSpaceUVMappingEmissive: 0 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _Parallax: 0.005 + - _QueueControl: -1 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SPECULARHIGHLIGHTS_OFF: 1 + - _SSRefractionProjectionModel: 0 + - _Smoothness: 0.31 + - _SmoothnessRemapMax: 1 + - _SmoothnessRemapMin: 0 + - _SmoothnessTextureChannel: 0 + - _SpecAO: 0 + - _SpecBurn: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SpecularHighlights: 1 + - _SpecularOcclusionMode: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 9 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 15 + - _StencilWriteMaskMV: 41 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _Surface: 0 + - _SurfaceType: 0 + - _Tess: 1.3 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 1 + - _TransmissionEnable: 1 + - _TransmissionMask: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVBase: 0 + - _UVDetail: 0 + - _UVEmissive: 0 + - _UVSec: 0 + - _UseEmissiveIntensity: 0 + - _UseShadowThreshold: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestModeDistortion: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteControl: 0 + - _maxDist: 25 + m_Colors: + - _BaseColor: {r: 0.4339623, g: 0.39420637, b: 0.34184766, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 0.56700003, g: 0.51591897, b: 0.44440544, a: 1} + - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} + - _Displacement_TO: {r: 1, g: 1, b: 0, a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} + - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} + - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} + - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &2197706086620354442 +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 +--- !u!114 &4380554692931032899 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &6233532979947264323 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks.mat.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks.mat.meta new file mode 100644 index 0000000..c548b43 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 771456db69106436da2ee97788477e13 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_01.mat b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_01.mat new file mode 100644 index 0000000..d2a47c5 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_01.mat @@ -0,0 +1,83 @@ +%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: Beach_Rocks_01 + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 2100000, guid: 771456db69106436da2ee97788477e13, type: 2} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: + - _NORMALMAP + - _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - RayTracingPrepass + - MOTIONVECTORS + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!114 &2197706086620354442 +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 +--- !u!114 &4380554692931032899 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &6233532979947264323 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_01.mat.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_01.mat.meta new file mode 100644 index 0000000..342074c --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_01.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 34dfbaaa4036b024e9ddf60e339194d3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_02.mat b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_02.mat new file mode 100644 index 0000000..bba722c --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_02.mat @@ -0,0 +1,108 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6804726229188060463 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &-1090719722964937430 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Beach_Rocks_02 + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 2100000, guid: 771456db69106436da2ee97788477e13, type: 2} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: + - _NORMALMAP + - _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - RayTracingPrepass + - MOTIONVECTORS + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: e4d2e6ba1b3710b468d7265fdb2e8178, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: e4d2e6ba1b3710b468d7265fdb2e8178, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 7dae416bc5cdd024e814490c64ec0046, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: e4d2e6ba1b3710b468d7265fdb2e8178, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 7dae416bc5cdd024e814490c64ec0046, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 6baeb1a69140dc4409413799b4a94598, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Parallax: 0.02 + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!114 &5604477534606191496 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_02.mat.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_02.mat.meta new file mode 100644 index 0000000..5ff0c18 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_02.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec445cf5b7f1b1948a5319317e342ce0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_03.mat b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_03.mat new file mode 100644 index 0000000..7217927 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_03.mat @@ -0,0 +1,108 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-7694236360789842960 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Beach_Rocks_03 + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 2100000, guid: 771456db69106436da2ee97788477e13, type: 2} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: + - _NORMALMAP + - _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - RayTracingPrepass + - MOTIONVECTORS + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 1e4248cafbd551c46a42d2d549782e16, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 1e4248cafbd551c46a42d2d549782e16, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 241ad574a42e48043b18246233402ac6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 1e4248cafbd551c46a42d2d549782e16, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 241ad574a42e48043b18246233402ac6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: a123b5c937d22f149beaa4a596f77717, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Parallax: 0.02 + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!114 &1519216598126387917 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &8396004880355684114 +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 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_03.mat.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_03.mat.meta new file mode 100644 index 0000000..e860873 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Materials/Beach_Rocks_03.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 77ce9408feb236347ba84bdccd758de9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs.meta new file mode 100644 index 0000000..a7444fb --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 64a2bc2d1920446efab950f378700ec5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_A.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_A.prefab new file mode 100644 index 0000000..7246ca8 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_A.prefab @@ -0,0 +1,368 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4001800002490710713 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4007996265358130763} + - component: {fileID: 4033196819969975873} + - component: {fileID: 4024944731306083955} + m_Layer: 0 + m_Name: MountainRocks01_A_LOD2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4007996265358130763 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4001800002490710713} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4008057477555011623} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4033196819969975873 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4001800002490710713} + m_Mesh: {fileID: 4300006, guid: 0bb18f6e1b1695449ba0b6ab75a16ae3, type: 3} +--- !u!23 &4024944731306083955 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4001800002490710713} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 34dfbaaa4036b024e9ddf60e339194d3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &4001868460905879681 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3999376395965082419} + - component: {fileID: 4033064875196064957} + - component: {fileID: 4025626158886625085} + m_Layer: 0 + m_Name: MountainRocks01_A_LOD0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3999376395965082419 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4001868460905879681} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4008057477555011623} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4033064875196064957 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4001868460905879681} + m_Mesh: {fileID: 4300004, guid: 0bb18f6e1b1695449ba0b6ab75a16ae3, type: 3} +--- !u!23 &4025626158886625085 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4001868460905879681} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 34dfbaaa4036b024e9ddf60e339194d3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &4001916033514215127 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3999440281400884527} + - component: {fileID: 3992857567305929563} + m_Layer: 0 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3999440281400884527 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4001916033514215127} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4008057477555011623} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &3992857567305929563 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4001916033514215127} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 0 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300006, guid: 0bb18f6e1b1695449ba0b6ab75a16ae3, type: 3} +--- !u!1 &4002198735768388743 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3999321522754877363} + - component: {fileID: 4032757162434730667} + - component: {fileID: 4025194952917531697} + m_Layer: 0 + m_Name: MountainRocks01_A_LOD1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3999321522754877363 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4002198735768388743} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4008057477555011623} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4032757162434730667 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4002198735768388743} + m_Mesh: {fileID: 4300002, guid: 0bb18f6e1b1695449ba0b6ab75a16ae3, type: 3} +--- !u!23 &4025194952917531697 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4002198735768388743} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 34dfbaaa4036b024e9ddf60e339194d3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &4002682753704487717 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4008057477555011623} + - component: {fileID: 3843649808388076123} + m_Layer: 0 + m_Name: Beach_Rocks_01_A + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4008057477555011623 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4002682753704487717} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3999376395965082419} + - {fileID: 3999321522754877363} + - {fileID: 4007996265358130763} + - {fileID: 3999440281400884527} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!205 &3843649808388076123 +LODGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4002682753704487717} + serializedVersion: 2 + m_LocalReferencePoint: {x: -0.1868267, y: 0.41261053, z: 0.0866518} + m_Size: 12.298626 + m_FadeMode: 1 + m_AnimateCrossFading: 1 + m_LastLODIsBillboard: 0 + m_LODs: + - screenRelativeHeight: 0.32129273 + fadeTransitionWidth: 0 + renderers: + - renderer: {fileID: 4025626158886625085} + - screenRelativeHeight: 0.125 + fadeTransitionWidth: 0 + renderers: + - renderer: {fileID: 4025194952917531697} + - screenRelativeHeight: 0.01 + fadeTransitionWidth: 0 + renderers: + - renderer: {fileID: 4024944731306083955} + m_Enabled: 1 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_A.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_A.prefab.meta new file mode 100644 index 0000000..9b37162 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_A.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 22afbe6f819a3d24f9715685e137cf23 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_C.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_C.prefab new file mode 100644 index 0000000..250b4c2 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_C.prefab @@ -0,0 +1,108 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7957809826432291963 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7955110126290359671} + - component: {fileID: 7934383164240814333} + - component: {fileID: 7942834061952321429} + - component: {fileID: 7965795701293661711} + m_Layer: 0 + m_Name: Beach_Rocks_01_C + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7955110126290359671 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7957809826432291963} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7934383164240814333 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7957809826432291963} + m_Mesh: {fileID: 4300000, guid: 308f055afb4aa1a418277f5c3d4a8073, type: 3} +--- !u!23 &7942834061952321429 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7957809826432291963} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 34dfbaaa4036b024e9ddf60e339194d3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &7965795701293661711 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7957809826432291963} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 0 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300000, guid: 308f055afb4aa1a418277f5c3d4a8073, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_C.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_C.prefab.meta new file mode 100644 index 0000000..a996b59 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_01_C.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b423bf7a132bc5348a001906e8cc291b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_03.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_03.prefab new file mode 100644 index 0000000..1aa1c43 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_03.prefab @@ -0,0 +1,368 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7129480598278614191 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7125484819499571371} + - component: {fileID: 6929771233754094019} + m_Layer: 0 + m_Name: Beach_Rocks_03 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7125484819499571371 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7129480598278614191} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7132585736562356983} + - {fileID: 7125464496954188397} + - {fileID: 7125811618948156335} + - {fileID: 7133038873034698207} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!205 &6929771233754094019 +LODGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7129480598278614191} + serializedVersion: 2 + m_LocalReferencePoint: {x: -0.05410576, y: 0.34712505, z: 0.13384008} + m_Size: 23.506737 + m_FadeMode: 1 + m_AnimateCrossFading: 1 + m_LastLODIsBillboard: 0 + m_LODs: + - screenRelativeHeight: 0.7195744 + fadeTransitionWidth: 0 + renderers: + - renderer: {fileID: 7107020764198466059} + - screenRelativeHeight: 0.31735748 + fadeTransitionWidth: 0 + renderers: + - renderer: {fileID: 7107037821217791949} + - screenRelativeHeight: 0.01 + fadeTransitionWidth: 0 + renderers: + - renderer: {fileID: 7107107215797476063} + m_Enabled: 1 +--- !u!1 &7129578638580487585 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7133038873034698207} + - component: {fileID: 7067882419984095281} + m_Layer: 0 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7133038873034698207 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7129578638580487585} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7125484819499571371} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &7067882419984095281 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7129578638580487585} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 0 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300006, guid: 741f96502db525040bf3b8d7c17b91ad, type: 3} +--- !u!1 &7130365165781936757 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7125811618948156335} + - component: {fileID: 7100665154125361983} + - component: {fileID: 7107107215797476063} + m_Layer: 0 + m_Name: RockMoutain03_LOD2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7125811618948156335 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7130365165781936757} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: 0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7125484819499571371} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7100665154125361983 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7130365165781936757} + m_Mesh: {fileID: 4300006, guid: 741f96502db525040bf3b8d7c17b91ad, type: 3} +--- !u!23 &7107107215797476063 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7130365165781936757} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 77ce9408feb236347ba84bdccd758de9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &7130507600156305085 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7125464496954188397} + - component: {fileID: 7099072016875874871} + - component: {fileID: 7107037821217791949} + m_Layer: 0 + m_Name: RockMoutain03_LOD1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7125464496954188397 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7130507600156305085} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: 0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7125484819499571371} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7099072016875874871 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7130507600156305085} + m_Mesh: {fileID: 4300004, guid: 741f96502db525040bf3b8d7c17b91ad, type: 3} +--- !u!23 &7107037821217791949 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7130507600156305085} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 77ce9408feb236347ba84bdccd758de9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &7131167526129675643 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7132585736562356983} + - component: {fileID: 7100701287155549511} + - component: {fileID: 7107020764198466059} + m_Layer: 0 + m_Name: RockMoutain03_LOD0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7132585736562356983 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7131167526129675643} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: 0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7125484819499571371} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7100701287155549511 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7131167526129675643} + m_Mesh: {fileID: 4300002, guid: 741f96502db525040bf3b8d7c17b91ad, type: 3} +--- !u!23 &7107020764198466059 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7131167526129675643} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 77ce9408feb236347ba84bdccd758de9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_03.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_03.prefab.meta new file mode 100644 index 0000000..7fe5936 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Prefabs/Beach_Rocks_03.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6e74665197120c846b9f23c9fdf26789 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources.meta new file mode 100644 index 0000000..58b67fa --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be61f6573d80f49cab910e5d03beba54 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes.meta new file mode 100644 index 0000000..8da3861 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b3ad218c56bc244b59ca8c9fabb59469 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_A.FBX b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_A.FBX new file mode 100644 index 0000000..a48172a Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_A.FBX differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_A.FBX.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_A.FBX.meta new file mode 100644 index 0000000..272a65e --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_A.FBX.meta @@ -0,0 +1,175 @@ +fileFormatVersion: 2 +guid: 0bb18f6e1b1695449ba0b6ab75a16ae3 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: + - first: + 1: 100000 + second: //RootNode + - first: + 1: 100002 + second: MountainRocks01_A_LOD0 + - first: + 1: 100004 + second: MountainRocks01_A_LOD1 + - first: + 1: 100006 + second: MountainRocks01_A_LOD2 + - first: + 4: 400000 + second: //RootNode + - first: + 4: 400002 + second: MountainRocks01_A_LOD0 + - first: + 4: 400004 + second: MountainRocks01_A_LOD1 + - first: + 4: 400006 + second: MountainRocks01_A_LOD2 + - first: + 23: 2300000 + second: //RootNode + - first: + 23: 2300002 + second: MountainRocks01_A_LOD0 + - first: + 23: 2300004 + second: MountainRocks01_A_LOD1 + - first: + 23: 2300006 + second: MountainRocks01_A_LOD2 + - first: + 33: 3300000 + second: //RootNode + - first: + 33: 3300002 + second: MountainRocks01_A_LOD0 + - first: + 33: 3300004 + second: MountainRocks01_A_LOD1 + - first: + 33: 3300006 + second: MountainRocks01_A_LOD2 + - first: + 43: 4300000 + second: MountainRocks01_A + - first: + 43: 4300002 + second: MountainRocks01_A_LOD1 + - first: + 43: 4300004 + second: MountainRocks01_A_LOD0 + - first: + 43: 4300006 + second: MountainRocks01_A_LOD2 + - first: + 205: 20500000 + second: //RootNode + externalObjects: {} + materials: + materialImportMode: 0 + materialName: 1 + materialSearch: 1 + materialLocation: 0 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: + - 0.25 + - 0.125 + - 0.01 + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 0 + importVisibility: 0 + importBlendShapes: 1 + importCameras: 0 + importLights: 0 + nodeNameCollisionStrategy: 0 + fileIdsGeneration: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 0 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 0 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 0 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 0 + importBlendShapeDeformPercent: 0 + remapMaterialsIfMaterialImportModeIsNone: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_C.FBX b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_C.FBX new file mode 100644 index 0000000..a455d53 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_C.FBX differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_C.FBX.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_C.FBX.meta new file mode 100644 index 0000000..8e04c75 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainRocks01_C.FBX.meta @@ -0,0 +1,124 @@ +fileFormatVersion: 2 +guid: 308f055afb4aa1a418277f5c3d4a8073 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: + - first: + 1: 100000 + second: //RootNode + - first: + 4: 400000 + second: //RootNode + - first: + 23: 2300000 + second: //RootNode + - first: + 33: 3300000 + second: //RootNode + - first: + 43: 4300000 + second: MountainRocks01_C + externalObjects: {} + materials: + materialImportMode: 0 + materialName: 1 + materialSearch: 1 + materialLocation: 0 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 0 + importVisibility: 0 + importBlendShapes: 1 + importCameras: 0 + importLights: 0 + nodeNameCollisionStrategy: 0 + fileIdsGeneration: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 0 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 0 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 0 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 0 + importBlendShapeDeformPercent: 0 + remapMaterialsIfMaterialImportModeIsNone: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainsRocks03.FBX b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainsRocks03.FBX new file mode 100644 index 0000000..f8228ae Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainsRocks03.FBX differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainsRocks03.FBX.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainsRocks03.FBX.meta new file mode 100644 index 0000000..d2972bd --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Meshes/MountainsRocks03.FBX.meta @@ -0,0 +1,175 @@ +fileFormatVersion: 2 +guid: 741f96502db525040bf3b8d7c17b91ad +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: + - first: + 1: 100000 + second: //RootNode + - first: + 1: 100002 + second: RockMoutain03_LOD0 + - first: + 1: 100004 + second: RockMoutain03_LOD1 + - first: + 1: 100006 + second: RockMoutain03_LOD2 + - first: + 4: 400000 + second: //RootNode + - first: + 4: 400002 + second: RockMoutain03_LOD0 + - first: + 4: 400004 + second: RockMoutain03_LOD1 + - first: + 4: 400006 + second: RockMoutain03_LOD2 + - first: + 23: 2300000 + second: //RootNode + - first: + 23: 2300002 + second: RockMoutain03_LOD0 + - first: + 23: 2300004 + second: RockMoutain03_LOD1 + - first: + 23: 2300006 + second: RockMoutain03_LOD2 + - first: + 33: 3300000 + second: //RootNode + - first: + 33: 3300002 + second: RockMoutain03_LOD0 + - first: + 33: 3300004 + second: RockMoutain03_LOD1 + - first: + 33: 3300006 + second: RockMoutain03_LOD2 + - first: + 43: 4300000 + second: RockMoutain03 + - first: + 43: 4300002 + second: RockMoutain03_LOD0 + - first: + 43: 4300004 + second: RockMoutain03_LOD1 + - first: + 43: 4300006 + second: RockMoutain03_LOD2 + - first: + 205: 20500000 + second: //RootNode + externalObjects: {} + materials: + materialImportMode: 0 + materialName: 0 + materialSearch: 1 + materialLocation: 0 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: + - 0.25 + - 0.125 + - 0.01 + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 0 + importVisibility: 0 + importBlendShapes: 1 + importCameras: 0 + importLights: 0 + nodeNameCollisionStrategy: 0 + fileIdsGeneration: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 0 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 0 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 0 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 0 + importBlendShapeDeformPercent: 0 + remapMaterialsIfMaterialImportModeIsNone: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Source.txt b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Source.txt new file mode 100644 index 0000000..a7ab794 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Source.txt @@ -0,0 +1,3 @@ +Photoscanned MoutainsRocks PBR by The Tales Factory +Standard Unity Asset Store EULA +https://assetstore.unity.com/packages/3d/environments/landscapes/photoscanned-moutainsrocks-pbr-130876 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Source.txt.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Source.txt.meta new file mode 100644 index 0000000..6529c86 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a171a6bab4e3f436590465d93cc2c44d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures.meta new file mode 100644 index 0000000..d0cba92 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4fc7eb14d5d974f1b9c1dd1afa3eed0a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Albedo.tga b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Albedo.tga new file mode 100644 index 0000000..f579684 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Albedo.tga differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Albedo.tga.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Albedo.tga.meta new file mode 100644 index 0000000..64d3032 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Albedo.tga.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 61b5a5de5f22277438332dd10549bb81 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 16 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Normal.tga b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Normal.tga new file mode 100644 index 0000000..aab382f Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Normal.tga differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Normal.tga.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Normal.tga.meta new file mode 100644 index 0000000..1435875 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Normal.tga.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: da86c28217cf3de43a76d7731a124ff6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 16 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Occlusion.tga b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Occlusion.tga new file mode 100644 index 0000000..4b8045d Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Occlusion.tga differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Occlusion.tga.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Occlusion.tga.meta new file mode 100644 index 0000000..86ea1be --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks01_MountainsRocks01_Occlusion.tga.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: e1c6267808eb2564b9064f1ed5106b2f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Albedo.tga b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Albedo.tga new file mode 100644 index 0000000..88b7c0e Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Albedo.tga differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Albedo.tga.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Albedo.tga.meta new file mode 100644 index 0000000..19950c9 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Albedo.tga.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 1e4248cafbd551c46a42d2d549782e16 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 16 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Normal.tga b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Normal.tga new file mode 100644 index 0000000..1e60980 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Normal.tga differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Normal.tga.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Normal.tga.meta new file mode 100644 index 0000000..2e14589 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Normal.tga.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 241ad574a42e48043b18246233402ac6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 16 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Occlusion.tga b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Occlusion.tga new file mode 100644 index 0000000..061e36d Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Occlusion.tga differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Occlusion.tga.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Occlusion.tga.meta new file mode 100644 index 0000000..013fc48 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Props/PhotoscannedMountainsRocksPBR/Sources/Textures/MountainsRocks03_RockMoutain03_Occlusion.tga.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: a123b5c937d22f149beaa4a596f77717 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 16 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes.meta new file mode 100644 index 0000000..64d14cd --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8bad53bfa8f22416fbbee48d4675e9eb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes/Beach.unity b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes/Beach.unity new file mode 100644 index 0000000..923babf --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes/Beach.unity @@ -0,0 +1,247 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 3cc19cc9306194b059fe31ca3c4a841b, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 4890085278179872738, guid: 6e72aca972f324f7886200f86939d735, + type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &34390402 +GameObject: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 34390404} + - component: {fileID: 34390403} + m_Layer: 0 + m_Name: StaticLightingSky + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &34390403 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 34390402} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 441482e8936e35048a1dffac814e3ef8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Profile: {fileID: 0} + m_StaticLightingSkyUniqueID: 0 + m_StaticLightingCloudsUniqueID: 0 + m_StaticLightingVolumetricClouds: 0 +--- !u!4 &34390404 +Transform: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 34390402} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &4120667251611423247 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6722545905680127086, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8802985210330865214, guid: 608e3429fd0c14b53b4116191f6dabe8, + type: 3} + propertyPath: m_Name + value: Scene + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 608e3429fd0c14b53b4116191f6dabe8, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 34390404} + - {fileID: 4120667251611423247} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes/Beach.unity.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes/Beach.unity.meta new file mode 100644 index 0000000..55a70ce --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Scenes/Beach.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4e90eaa0c0f384ba98dd8ddb10bd1a19 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings.meta new file mode 100644 index 0000000..11762bf --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f659fb00221e245d6b950f6faa0542a1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Atmosphere.asset b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Atmosphere.asset new file mode 100644 index 0000000..c46567e --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Atmosphere.asset @@ -0,0 +1,137 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: Beach_Atmosphere + m_EditorClassIdentifier: + components: + - {fileID: 5979967998024641912} +--- !u!114 &5979967998024641912 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 59b6606ef2548734bb6d11b9d160bc7e, type: 3} + m_Name: HDRISky + m_EditorClassIdentifier: + active: 1 + rotation: + m_OverrideState: 1 + m_Value: 12 + skyIntensityMode: + m_OverrideState: 0 + m_Value: 0 + exposure: + m_OverrideState: 0 + m_Value: 0 + multiplier: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxValue: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxColor: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + desiredLuxValue: + m_OverrideState: 0 + m_Value: 20000 + updateMode: + m_OverrideState: 0 + m_Value: 0 + updatePeriod: + m_OverrideState: 0 + m_Value: 0 + includeSunInBaking: + m_OverrideState: 0 + m_Value: 0 + hdriSky: + m_OverrideState: 0 + m_Value: {fileID: 0} + distortionMode: + m_OverrideState: 0 + m_Value: 0 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollOrientation: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 0 + additiveValue: 0 + multiplyValue: 1 + scrollSpeed: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 100 + additiveValue: 0 + multiplyValue: 1 + enableBackplate: + m_OverrideState: 0 + m_Value: 0 + backplateType: + m_OverrideState: 0 + m_Value: 0 + groundLevel: + m_OverrideState: 0 + m_Value: 0 + scale: + m_OverrideState: 0 + m_Value: {x: 32, y: 32} + projectionDistance: + m_OverrideState: 0 + m_Value: 16 + plateRotation: + m_OverrideState: 0 + m_Value: 0 + plateTexRotation: + m_OverrideState: 0 + m_Value: 0 + plateTexOffset: + m_OverrideState: 0 + m_Value: {x: 0, y: 0} + blendAmount: + m_OverrideState: 0 + m_Value: 0 + shadowTint: + m_OverrideState: 0 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + pointLightShadow: + m_OverrideState: 0 + m_Value: 0 + dirLightShadow: + m_OverrideState: 0 + m_Value: 0 + rectLightShadow: + m_OverrideState: 0 + m_Value: 0 + m_SkyVersion: 1 + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteScrollSpeed: + m_OverrideState: 0 + m_Value: 1 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Atmosphere.asset.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Atmosphere.asset.meta new file mode 100644 index 0000000..9f0d8d2 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Atmosphere.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e9a93ddf7b06549febe0f3094eb3cefe +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Lod_Foam.asset b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Lod_Foam.asset new file mode 100644 index 0000000..f270f2a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Lod_Foam.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 03aa24b56404b45a190a2cfc0c7cc100, type: 3} + m_Name: Beach_Lod_Foam + m_EditorClassIdentifier: + _Version: 0 + _Maximum: Infinity + _FoamFadeRate: 0.2 + _WaveFoamStrength: 1 + _WaveFoamCoverage: 0.55 + _FilterWaves: 2 + _ShorelineFoamMaximumDepth: 0.65 + _ShorelineFoamStrength: 0.15 + _ShorelineFoamPriming: 5 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Lod_Foam.asset.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Lod_Foam.asset.meta new file mode 100644 index 0000000..8a6d825 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Settings/Beach_Lod_Foam.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0a2c1b990ef0647a383d218455508a27 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain.meta new file mode 100644 index 0000000..80b173c --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67f25b828696342cb9a39c030c2065d7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Beach_Terrain.asset b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Beach_Terrain.asset new file mode 100644 index 0000000..1a1e8e7 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Beach_Terrain.asset differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Beach_Terrain.asset.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Beach_Terrain.asset.meta new file mode 100644 index 0000000..2861e93 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Beach_Terrain.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 795a7e9d9baf8408c88e4bf9bb76538e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Sand.terrainlayer b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Sand.terrainlayer new file mode 100644 index 0000000..5e46db0 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Sand.terrainlayer @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1953259897 &8574412962073106934 +TerrainLayer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Sand + m_DiffuseTexture: {fileID: 2800000, guid: 3b2f0be8bf51544b9ae8c7c06b811ea1, type: 3} + m_NormalMapTexture: {fileID: 2800000, guid: eed074426350a4772aa6d43fa8ba1c15, type: 3} + m_MaskMapTexture: {fileID: 0} + m_TileSize: {x: 2, y: 2} + m_TileOffset: {x: 0, y: 0} + m_Specular: {r: 0, g: 0, b: 0, a: 0} + m_Metallic: 0 + m_Smoothness: 0 + m_NormalScale: 1 + m_DiffuseRemapMin: {x: 0, y: 0, z: 0, w: 0} + m_DiffuseRemapMax: {x: 1, y: 1, z: 1, w: 1} + m_MaskMapRemapMin: {x: 0, y: 0, z: 0, w: 0} + m_MaskMapRemapMax: {x: 1, y: 1, z: 1, w: 1} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Sand.terrainlayer.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Sand.terrainlayer.meta new file mode 100644 index 0000000..63f3547 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/Sand.terrainlayer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69230bc75e6d0430287e5109a977e3c6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 8574412962073106934 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/WetSand.terrainlayer b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/WetSand.terrainlayer new file mode 100644 index 0000000..71cb213 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/WetSand.terrainlayer @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1953259897 &8574412962073106934 +TerrainLayer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WetSand + m_DiffuseTexture: {fileID: 2800000, guid: 70c2839d32d2d4fac8a8e850e047daa8, type: 3} + m_NormalMapTexture: {fileID: 2800000, guid: ad064369b12714a7cad9b500076c379a, type: 3} + m_MaskMapTexture: {fileID: 0} + m_TileSize: {x: 2, y: 2} + m_TileOffset: {x: 0, y: 0} + m_Specular: {r: 0, g: 0, b: 0, a: 0} + m_Metallic: 0 + m_Smoothness: 0 + m_NormalScale: 1 + m_DiffuseRemapMin: {x: 0, y: 0, z: 0, w: 0} + m_DiffuseRemapMax: {x: 1, y: 1, z: 1, w: 1} + m_MaskMapRemapMin: {x: 0, y: 0, z: 0, w: 0} + m_MaskMapRemapMax: {x: 1, y: 1, z: 1, w: 1} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/WetSand.terrainlayer.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/WetSand.terrainlayer.meta new file mode 100644 index 0000000..10bad48 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Terrain/WetSand.terrainlayer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4af70b5567d774bb38b44945e2d37e3f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 8574412962073106934 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures.meta new file mode 100644 index 0000000..3fa40b0 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 117052fe49f0c4f92a279840e083a7a9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG.meta new file mode 100644 index 0000000..aa8ef9a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab77f18766be24e8c97de22367eb26c8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_Color.png b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_Color.png new file mode 100644 index 0000000..8bac539 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_Color.png differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_Color.png.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_Color.png.meta new file mode 100644 index 0000000..86be6c9 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_Color.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 3b2f0be8bf51544b9ae8c7c06b811ea1 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_NormalGL.png b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_NormalGL.png new file mode 100644 index 0000000..840f59c Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_NormalGL.png differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_NormalGL.png.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_NormalGL.png.meta new file mode 100644 index 0000000..0233ceb --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Ground033_1K-PNG_NormalGL.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: eed074426350a4772aa6d43fa8ba1c15 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Source.txt b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Source.txt new file mode 100644 index 0000000..10ca129 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Source.txt @@ -0,0 +1,3 @@ +Created using Ground 033 from ambientCG.com, +licensed under the Creative Commons CC0 1.0 Universal License. +https://ambientcg.com/a/Ground033 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Source.txt.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Source.txt.meta new file mode 100644 index 0000000..02939ae --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground033_1K-PNG/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: aa6d31715387c4125a0b4e26fcf6e6a1 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG.meta new file mode 100644 index 0000000..4e704d8 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9498bd0c1ab54a22b00027002f827b5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_Color.png b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_Color.png new file mode 100644 index 0000000..7d40796 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_Color.png differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_Color.png.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_Color.png.meta new file mode 100644 index 0000000..4fe8c90 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_Color.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 70c2839d32d2d4fac8a8e850e047daa8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_NormalGL.png b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_NormalGL.png new file mode 100644 index 0000000..4199545 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_NormalGL.png differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_NormalGL.png.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_NormalGL.png.meta new file mode 100644 index 0000000..35178cd --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Ground057_1K-PNG_NormalGL.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: ad064369b12714a7cad9b500076c379a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Source.txt b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Source.txt new file mode 100644 index 0000000..1e5a369 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Source.txt @@ -0,0 +1,3 @@ +Created using Ground 057 from ambientCG.com, +licensed under the Creative Commons CC0 1.0 Universal License. +https://ambientcg.com/a/Ground057 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Source.txt.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Source.txt.meta new file mode 100644 index 0000000..4a6681e --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/Beach/Textures/Ground057_1K-PNG/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f4eb3cecdc3c74568b47ce63cb899069 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River.meta new file mode 100644 index 0000000..c56e7cc --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 61c54755c46774ee08db92b3cedb3380 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data.meta new file mode 100644 index 0000000..c308311 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c24adbf0c6a2a48c4a4a277601addb5b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data/River_Spectrum.asset b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data/River_Spectrum.asset new file mode 100644 index 0000000..9ea7e49 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data/River_Spectrum.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: River_Spectrum + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 90 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.10794 + - -6.42794 + - -5.93794 + - -5.27794 + - -4.67794 + - -3.71794 + - -3.17794 + - -2.60794 + - -1.93794 + - -1.11794 + - -0.85794 + - -0.36794 + - 0.04206 + - -8 + _PowerDisabled: 0000000000010101010101010101 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.6 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data/River_Spectrum.asset.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data/River_Spectrum.asset.meta new file mode 100644 index 0000000..3a196c4 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Data/River_Spectrum.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3a5418fe90d8b4e56ac33226cf26d531 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials.meta new file mode 100644 index 0000000..edca850 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d10419404b9b74d1abf3c2a8091edafc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials/River_Water.mat b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials/River_Water.mat new file mode 100644 index 0000000..02f105a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials/River_Water.mat @@ -0,0 +1,109 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5994654682710206810 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-4042563326011365698 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: River_Water + m_Shader: {fileID: -6465566751694194690, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_Parent: {fileID: -876546973899608171, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - CREST_FLOW_ON + - _ALPHATEST_ON + - _BUILTIN_ALPHATEST_ON + - _BUILTIN_AlphaClip + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _SPECULAR_SETUP + - _SURFACE_TYPE_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + MotionVector: User + RenderType: Transparent + disabledShaderPasses: + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - CREST_FLOW: 1 + - _AlphaDstBlend: 10 + - _BUILTIN_DstBlend: 10 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_SrcBlend: 5 + - _BUILTIN_ZWrite: 1 + - _Crest_CausticsEnabled: 0 + - _Crest_FoamFeather: 1 + - _Crest_FoamScale: 2 + - _Crest_NormalMapEnabled: 1 + - _Crest_NormalsStrengthOverall: 1 + - _CullMode: 0 + - _CullModeForward: 0 + - _DstBlend: 10 + - _QueueControl: 0 + - _SrcBlend: 5 + - _ZTestGBuffer: 3 + m_Colors: + - _DoubleSidedConstants: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &4748330692745026848 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials/River_Water.mat.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials/River_Water.mat.meta new file mode 100644 index 0000000..5ccab8b --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Materials/River_Water.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c0afaa7b76654d0b9a0090283a931a7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs.meta new file mode 100644 index 0000000..f009fb9 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6230888ef718349ba972ecc5a33058f9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs/River_Scene.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs/River_Scene.prefab new file mode 100644 index 0000000..ee5233f --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs/River_Scene.prefab @@ -0,0 +1,3384 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &12359611455926996 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4088882662646388973} + - component: {fileID: 8427949512230513141} + m_Layer: 0 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4088882662646388973 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 12359611455926996} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 7741016946220147711} + - {fileID: 5972405796698518407} + m_Father: {fileID: 1395742053880712351} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8427949512230513141 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 12359611455926996} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e64c239f69eea46778ded6dcc3427a34, type: 3} + m_Name: + m_EditorClassIdentifier: + _Layer: 4 + _Material: {fileID: 2100000, guid: 3c0afaa7b76654d0b9a0090283a931a7, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Version: 1 + _Camera: {fileID: 0} + _TimeProvider: {fileID: 0} + _WindZone: {fileID: 0} + _OverrideWindZoneWindSpeed: 0 + _WindSpeed: 150 + _OverrideWindZoneWindDirection: 0 + _WindDirection: 0 + _OverrideWindZoneWindTurbulence: 0 + _WindTurbulence: 0.145 + _OverrideGravity: 0 + _GravityOverride: -9.8 + _GravityMultiplier: 1 + _PrimaryLight: {fileID: 0} + _InjectionPoint: 0 + _WriteToColorTexture: 1 + _WriteToDepthTexture: 1 + _WriteMotionVectors: 1 + _OverrideRenderHDR: 0 + _RenderHDR: 1 + _Surface: + rid: 1002 + _ScaleRange: {x: 4, y: 256} + _DropDetailHeightBasedOnWaves: 0 + _Slices: 7 + _Resolution: 512 + _GeometryDownSampleFactor: 2 + _ExtentsSizeMultiplier: 100 + _Viewpoint: {fileID: 0} + _CenterOfDetailDisplacementCorrection: 1 + _SampleTerrainHeightForScale: 1 + _ForceScaleChangeSmoothing: 0 + _TeleportThreshold: 10 + _AnimatedWavesLod: + rid: 7000983362431877122 + _DepthLod: + rid: 7000983362431877123 + _LevelLod: + rid: 7000983362431877124 + _FoamLod: + rid: 7000983362431877125 + _DynamicWavesLod: + rid: 7000983362431877126 + _FlowLod: + rid: 7000983362431877127 + _ShadowLod: + rid: 7000983362431877128 + _AbsorptionLod: + rid: 1000 + _ScatteringLod: + rid: 1001 + _ClipLod: + rid: 7000983362431877129 + _AlbedoLod: + rid: 7000983362431877130 + _Reflections: + rid: 7000983362431877131 + _Underwater: + rid: 7000983362431877132 + _Meniscus: + rid: 1003 + _Portals: + rid: 7000983362431877133 + _ShowWaterProxyPlane: 0 + _EditModeFrameRate: 30 + _FollowSceneCamera: 1 + _HeightQueries: 1 + _Debug: + _AttachDebugGUI: 0 + _ShowHiddenObjects: 0 + _DisableFollowViewpoint: 0 + _DestroyResourcesInOnDisable: 0 + _DrawLodOutline: 0 + _ShowDebugInformation: 0 + _LogScaleChange: 0 + _PauseOnScaleChange: 0 + _IgnoreWavesForScaleChange: 0 + _ForceNoGraphics: 0 + _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + references: + version: 2 + RefIds: + - rid: 1000 + type: {class: AbsorptionLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 7 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 1.026, g: 2.085, b: 2.5500002, a: 0.306} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1001 + type: {class: ScatteringLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 23 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 0, g: 0.588, b: 1.2, a: 6} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1002 + type: {class: SurfaceRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 3c0afaa7b76654d0b9a0090283a931a7, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Debug: + _UniformTiles: 0 + _DisableSkirt: 0 + - rid: 1003 + type: {class: Meniscus, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 238e45299a5ec46308e9bf99ddf67963, type: 2} + - rid: 7000983362431877122 + type: {class: AnimatedWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 48 + _WaveResolutionMultiplier: 2 + _AttenuationInShallows: 1 + _ShallowsMaximumDepth: 3 + _CollisionSource: 2 + _CollisionLayers: -1 + _MaximumQueryCount: 4096 + _BakedWaveData: {fileID: 0} + - rid: 7000983362431877123 + type: {class: DepthLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 46 + _IncludeTerrainHeight: 0 + _EnableSignedDistanceFields: 1 + - rid: 7000983362431877124 + type: {class: LevelLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 300 + _TextureFormat: 45 + - rid: 7000983362431877125 + type: {class: FoamLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 45 + _SimulationFrequency: 30 + _Prewarm: 1 + _Settings: {fileID: 11400000, guid: ecf87873110b84378a15fbe66bb0a41b, type: 2} + - rid: 7000983362431877126 + type: {class: DynamicWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 512 + _TextureFormatMode: 300 + _TextureFormat: 46 + _SimulationFrequency: 60 + _AttenuationInShallows: 1 + _Settings: {fileID: 0} + - rid: 7000983362431877127 + type: {class: FlowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 128 + _TextureFormatMode: 100 + _TextureFormat: 46 + - rid: 7000983362431877128 + type: {class: ShadowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 6 + _SimulationFrequency: 60 + _DynamicSoftShadows: 1 + _SoftJitterExtinctionFactor: 0.75 + _JitterDiameterSoft: 15 + _CurrentFrameWeightSoft: 0.03 + _JitterDiameterHard: 0.6 + _CurrentFrameWeightHard: 0.15 + _AllowNullLight: 0 + _AllowNoShadows: 0 + - rid: 7000983362431877129 + type: {class: ClipLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 5 + _DefaultClippingState: 0 + - rid: 7000983362431877130 + type: {class: AlbedoLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 768 + _TextureFormatMode: 100 + _TextureFormat: 8 + - rid: 7000983362431877131 + type: {class: WaterReflections, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 0 + _Mode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 1 + _Resolution: 256 + _RenderOnlySingleCamera: 0 + _Sky: 0 + _DisablePixelLights: 1 + _DisableShadows: 1 + _HDR: 1 + _Stencil: 0 + _AllowMSAA: 0 + _QualitySettingsOverride: + _OverrideLodBias: 0 + _LodBias: 0.5 + _OverrideMaximumLodLevel: 0 + _MaximumLodLevel: 1 + _OverrideTerrainPixelError: 0 + _TerrainPixelError: 10 + _ClipPlaneOffset: 0 + _FarClipPlane: 1000 + _DisableOcclusionCulling: 1 + _RefreshPerFrames: 1 + _FrameRefreshOffset: 0 + _UseObliqueMatrix: 1 + _NonObliqueNearSurface: 0 + _NonObliqueNearSurfaceThreshold: 0.05 + _Debug: + _ShowHiddenObjects: 0 + _DisableRecursiveRendering: 0 + - rid: 7000983362431877132 + type: {class: UnderwaterRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: f2b096e4d95e646c49d48ece0afa0547, type: 2} + _EnvironmentalLightingEnable: 0 + _EnvironmentalLightingWeight: 1 + _EnvironmentalLightingVolumeProfile: {fileID: 0} + _AllCameras: 0 + _CopyWaterMaterialParametersEachFrame: 1 + _FarPlaneMultiplier: 0.68 + _CullLimit: 0.001 + _Debug: + _VisualizeMask: 0 + _DisableMask: 0 + _VisualizeStencil: 0 + _DisableHeightAboveWaterOptimization: 0 + _DisableArtifactCorrection: 0 + _OnlyReflectionCameras: 0 + - rid: 7000983362431877133 + type: {class: PortalRenderer, ns: WaveHarmonic.Crest.Portals, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _Mode: 2 + _Geometry: {fileID: 0} + _Invert: 0 +--- !u!1 &1020980343231628668 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8467863637850930443} + - component: {fileID: 1940856061548157001} + m_Layer: 0 + m_Name: Lower Lake + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8467863637850930443 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1020980343231628668} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 82.5, y: 5.11, z: 20.48} + m_LocalScale: {x: 20, y: 40, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5972405796698518407} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &1940856061548157001 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1020980343231628668} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4edd034314af4679ba066d79580dc1d, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 7 + _Weight: 1 + _Queue: 0 + _Blend: 0 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 1790563051476090880 + _DrawBounds: 0 + _OverrideHeight: 0 + _HeightRange: {x: -100, y: 100} + _Version: 1 + references: + version: 2 + RefIds: + - rid: 1790563051476090880 + type: {class: LevelGeometryLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 1940856061548157001} + _Geometry: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1095983012310862697 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1797437123073308413} + m_Layer: 0 + m_Name: Rocks + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1797437123073308413 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1095983012310862697} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 8126386832092772026} + - {fileID: 2443760194990343673} + - {fileID: 576760522377659833} + - {fileID: 191219875336768422} + - {fileID: 3741208176659308090} + - {fileID: 8254921078966363976} + - {fileID: 589313464002553648} + - {fileID: 4179549508784535428} + - {fileID: 2597417704489697020} + - {fileID: 6336324341114153421} + - {fileID: 6559091743067559027} + - {fileID: 9014185170525150822} + - {fileID: 1494439052992245319} + - {fileID: 316432520812771183} + - {fileID: 2831518371175514555} + - {fileID: 8851709656945360763} + - {fileID: 8795637539784805971} + - {fileID: 3328043941943069902} + - {fileID: 3653953723876183928} + - {fileID: 5030452250825116913} + - {fileID: 3957633230822681217} + - {fileID: 8414354562148722942} + - {fileID: 4814173199877216585} + m_Father: {fileID: 2963044197998998021} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1667316526013732550 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8518063449728252689} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8518063449728252689 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1667316526013732550} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 6813415163750874970} + - {fileID: 3390121929715549705} + - {fileID: 4219678492117686297} + m_Father: {fileID: 1395742053880712351} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3388084798414284514 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2996559850084528445} + - component: {fileID: 4821652768968063271} + m_Layer: 0 + m_Name: Upper Lake + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2996559850084528445 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3388084798414284514} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 130.05, y: 16.86, z: 10.55} + m_LocalScale: {x: 17.37, y: 28.73, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5972405796698518407} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &4821652768968063271 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3388084798414284514} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4edd034314af4679ba066d79580dc1d, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 7 + _Weight: 1 + _Queue: 0 + _Blend: 0 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 1790563051476090929 + _DrawBounds: 0 + _OverrideHeight: 0 + _HeightRange: {x: -100, y: 100} + _Version: 1 + references: + version: 2 + RefIds: + - rid: 1790563051476090929 + type: {class: LevelGeometryLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 4821652768968063271} + _Geometry: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &5807071863337433624 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7741016946220147711} + - component: {fileID: 8764914699052382764} + m_Layer: 0 + m_Name: Waves + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7741016946220147711 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5807071863337433624} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 4088882662646388973} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8764914699052382764 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5807071863337433624} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 5 + _Weight: 1 + _Queue: 0 + _Blend: 0 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: 3a5418fe90d8b4e56ac33226cf26d531, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 125.12195 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.145 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &6209579273066343583 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1395742053880712351} + m_Layer: 0 + m_Name: River_Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1395742053880712351 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6209579273066343583} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2119564229340644841} + - {fileID: 8518063449728252689} + - {fileID: 4088882662646388973} + - {fileID: 2963044197998998021} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7553694119167565188 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7347186310487439012} + - component: {fileID: 9173118453130709105} + - component: {fileID: 1718093580076659466} + m_Layer: 31 + m_Name: Terrain + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!4 &7347186310487439012 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7553694119167565188} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 50, y: 0, z: -50} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 2963044197998998021} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!218 &9173118453130709105 +Terrain: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7553694119167565188} + m_Enabled: 1 + serializedVersion: 6 + m_TerrainData: {fileID: 15600000, guid: d45a468890d48485b99fca5ee978b769, type: 2} + m_TreeDistance: 5000 + m_TreeBillboardDistance: 50 + m_TreeCrossFadeLength: 5 + m_TreeMaximumFullLODCount: 50 + m_DetailObjectDistance: 80 + m_DetailObjectDensity: 1 + m_HeightmapPixelError: 5 + m_SplatMapDistance: 1000 + m_HeightmapMinimumLODSimplification: 0 + m_HeightmapMaximumLOD: 0 + m_ShadowCastingMode: 2 + m_DrawHeightmap: 1 + m_DrawInstanced: 0 + m_DrawTreesAndFoliage: 1 + m_StaticShadowCaster: 0 + m_IgnoreQualitySettings: 0 + m_ReflectionProbeUsage: 1 + m_MaterialTemplate: {fileID: 10650, guid: 0000000000000000f000000000000000, type: 0} + m_BakeLightProbesForTrees: 1 + m_PreserveTreePrototypeLayers: 0 + m_DeringLightProbesForTrees: 1 + m_ReceiveGI: 1 + m_ScaleInLightmap: 0.0256 + m_LightmapParameters: {fileID: 15203, guid: 0000000000000000f000000000000000, type: 0} + m_GroupingID: 0 + m_RenderingLayerMask: 1 + m_AllowAutoConnect: 1 + m_EnableHeightmapRayTracing: 1 + m_EnableTreesAndDetailsRayTracing: 0 + m_TreeMotionVectorModeOverride: 3 +--- !u!154 &1718093580076659466 +TerrainCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7553694119167565188} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_TerrainData: {fileID: 15600000, guid: d45a468890d48485b99fca5ee978b769, type: 2} + m_EnableTreeColliders: 1 +--- !u!1 &8401688394622220963 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5972405796698518407} + m_Layer: 0 + m_Name: Bodies + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5972405796698518407 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8401688394622220963} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 6364306438577549498} + - {fileID: 2996559850084528445} + - {fileID: 8467863637850930443} + m_Father: {fileID: 4088882662646388973} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8639566901132044709 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2119564229340644841} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2119564229340644841 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8639566901132044709} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 3027092538604765390} + - {fileID: 1743139209657707752} + m_Father: {fileID: 1395742053880712351} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8989256522517758903 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6364306438577549498} + - component: {fileID: 9192577471958641087} + - component: {fileID: 7940750380843477946} + m_Layer: 0 + m_Name: River + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6364306438577549498 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8989256522517758903} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 107.7, y: 0, z: -24.9} + m_LocalScale: {x: 70, y: 1, z: 70} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5972405796698518407} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &9192577471958641087 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8989256522517758903} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9a87083040be2a947bf2d5f126a800e4, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Preset: 2 + _Width: 70 + _Depth: 1 + _Placement: 0 + _PlaceAtSeaLevel: 1 + _Friction: 0.1 + _DynamicSeabed: 0 + _SampleDepthProbeDirectly: 1 + _SampleWaterLevelInputsDirectly: 1 + _AdditionalWater: 0 + _DrainWaterAtBoundaries: 0 + _Evaporation: 0 + _BlendDepthRange: {x: 0, y: 4} + _BlendPushUpStrength: 1 + _EnableDistanceCulling: 0 + _CullDistance: 75 + _CullTransitionSpeed: 0.5 + _TimeStep: 0.01666667 + _CourantNumber: 0.475 + _OvershootReductionStrength: 0.25 + _TexelSize: 0.0625 + _MaximumResolution: 768 + _BlurShapeForRender: 1 + _BlurMaskIterations: 10 + _WaterEdgeMargin: 1 + _WaterEdgeMarginWidth: 8 + _WaterEdgeMarginBakedWidth: 32 + _Mode: 0 + _InjectShape: 2 + _LevelTexture: {fileID: 2800000, guid: 24c6e7f123e1941b59d237d1abe05628, type: 3} + _MaximumDisplacementVertical: 100 + _PaddingWidth: 2 + _InjectFlow: 1 + _FlowTexture: {fileID: 2800000, guid: 450d37331825842f388924ea69dc9b30, type: 3} + _FlowStrength: 1 + _InjectFoam: 1 + _FoamTexture: {fileID: 2800000, guid: ec916cbff6aad41fd8fd9d58b3dbd40e, type: 3} + _FoamStrength: 0.3 + _Debug: + _SkipUpdate: 0 + _SkipUpdateHeight: 0 + _SkipUpdateVelocities: 0 + _SkipAdvect: 0 + _SkipAdvectHeights: 0 + _DisableStabilityImprovements: 0 + _DisableMacCormackScheme: 0 + _DisableMacCormackSchemeForHeight: 0 + _DisableUpwindHeight: 0 + _DisableDepthLimiter: 0 + _DisableOvershootReduction: 0 + _AlwaysExecuteSimulation: 1 + _SkipInjectShape: 0 + _ShowSimulationData: 0 + _ShowSimulationDataInScene: 0 +--- !u!114 &7940750380843477946 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8989256522517758903} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70deb49b538e247b9ab1bf7773d16809, type: 3} + m_Name: + m_EditorClassIdentifier: + _Type: 0 + _RefreshMode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 2147483649 + _Resolution: 1024 + _CaptureRange: {x: -1000, y: 100} + _FillHolesCaptureHeight: 0 + _EnableBackFaceInclusion: 1 + _QualitySettingsOverride: + _OverrideLodBias: 1 + _LodBias: Infinity + _OverrideMaximumLodLevel: 1 + _MaximumLodLevel: 0 + _OverrideTerrainPixelError: 1 + _TerrainPixelError: 0 + _SavedTexture: {fileID: 0} + _GenerateSignedDistanceField: 1 + _AdditionalJumpFloodRounds: 7 + _Debug: + _ForceAlwaysUpdateDebug: 0 + _ShowHiddenObjects: 0 + _ShowSimulationDataInScene: 0 + _Version: 1 +--- !u!1 &9019526915926749875 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2963044197998998021} + m_Layer: 0 + m_Name: Environment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2963044197998998021 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9019526915926749875} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 7347186310487439012} + - {fileID: 1797437123073308413} + m_Father: {fileID: 1395742053880712351} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &66573576061047372 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalScale.x + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalScale.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalScale.z + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.x + value: 99.42 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.27 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.z + value: -22.1 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 648533235605357392, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_Name + value: River_Rocks_2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 40233e759b9f549539f7d447b2f7c0af, type: 3} +--- !u!4 &191219875336768422 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + m_PrefabInstance: {fileID: 66573576061047372} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &270446227837381359 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.x + value: 2.4999998 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.y + value: 2.5000002 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.z + value: 2.5 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.x + value: 100.71 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.62 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.z + value: -21.23 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.98536944 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.15241411 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.07537305 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.011658489 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -17.374 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.17 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.76 + objectReference: {fileID: 0} + - target: {fileID: 8792257075096557341, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_Name + value: River_Rocks_4 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84abedbc7f85f4f469c7220fb2bfc78f, type: 3} +--- !u!4 &8254921078966363976 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + m_PrefabInstance: {fileID: 270446227837381359} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &579715078549205250 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2119564229340644841} + m_Modifications: + - target: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_Name + value: Camera + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.x + value: 98.77208 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.y + value: 21.526186 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.z + value: -35.098743 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.95872533 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.22431105 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.1701575 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.039709464 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c26fe2b4fef6c484089497b549dd6b04, type: 3} +--- !u!4 &3027092538604765390 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 579715078549205250} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1296919683427703102 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6945626157949959423, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 (3) + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.x + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.y + value: 3.3400002 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.z + value: 3.68 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.x + value: 126.88 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.y + value: 15.15 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.z + value: -16.21 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.5916758 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.80617607 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -252.552 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_ConstrainProportionsScale + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8602d844b80dd46adb55fb29573b3c60, type: 3} +--- !u!4 &8851709656945360763 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + m_PrefabInstance: {fileID: 1296919683427703102} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1599010118900004899 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6945626157949959423, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.x + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.y + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.z + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.x + value: 89.2 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.y + value: 5.81 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.z + value: -12.88 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8602d844b80dd46adb55fb29573b3c60, type: 3} +--- !u!4 &9014185170525150822 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + m_PrefabInstance: {fileID: 1599010118900004899} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &2300715405984599739 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6945626157949959423, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 (3) + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.z + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.x + value: 102.066 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.747 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.z + value: -22.767 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.8235286 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.11890595 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.14937805 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.53418 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.078 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 21.92 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 66.341 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8602d844b80dd46adb55fb29573b3c60, type: 3} +--- !u!4 &8414354562148722942 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + m_PrefabInstance: {fileID: 2300715405984599739} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &2783412585406325866 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.x + value: 2.4999998 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.y + value: 2.5000002 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.z + value: 2.5 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.x + value: 100.71 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.62 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.z + value: -21.23 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.98536944 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.15241411 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.07537305 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.011658489 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -17.374 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.17 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.76 + objectReference: {fileID: 0} + - target: {fileID: 8792257075096557341, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_Name + value: River_Rocks_4 (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84abedbc7f85f4f469c7220fb2bfc78f, type: 3} +--- !u!4 &6336324341114153421 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + m_PrefabInstance: {fileID: 2783412585406325866} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &2791411040278310954 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 8570444726160424675, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_Name + value: River_Rocks_6 (4) + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.x + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.y + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.z + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.x + value: 93.71 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.49 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.z + value: -18.43 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.8103254 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.5859802 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -71.745 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8a46b87981fbc476abf4f6d9418c8096, type: 3} +--- !u!4 &6559091743067559027 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + m_PrefabInstance: {fileID: 2791411040278310954} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3019491582817074956 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6945626157949959423, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 (2) + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.x + value: 0.4999999 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.z + value: 0.49999985 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.x + value: 101.589 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.745 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.z + value: -23.307 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.56161517 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.2085993 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.75056994 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.27878234 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10.614 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 102.56 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -39.581 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8602d844b80dd46adb55fb29573b3c60, type: 3} +--- !u!4 &4814173199877216585 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + m_PrefabInstance: {fileID: 3019491582817074956} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3379884686758783668 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6945626157949959423, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.z + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.x + value: 102.73 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.y + value: 7.024 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.z + value: -22.34 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8602d844b80dd46adb55fb29573b3c60, type: 3} +--- !u!4 &5030452250825116913 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + m_PrefabInstance: {fileID: 3379884686758783668} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3496177175325456845 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8518063449728252689} + m_Modifications: + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2942909709672342223, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_Name + value: Atmosphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63a4b7e65d06948649ac3e10077d8c2e, type: 3} +--- !u!4 &3390121929715549705 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + m_PrefabInstance: {fileID: 3496177175325456845} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3530451208955336338 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.x + value: 102.87 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.83 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.z + value: -23.42 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.06747475 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.67349696 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.06302713 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.73340076 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -190.564 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -94.951996 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.8200073 + objectReference: {fileID: 0} + - target: {fileID: 648533235605357392, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_Name + value: River_Rocks_2 (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 40233e759b9f549539f7d447b2f7c0af, type: 3} +--- !u!4 &3653953723876183928 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + m_PrefabInstance: {fileID: 3530451208955336338} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3576047382928426960 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalScale.x + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalScale.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalScale.z + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.x + value: 98.09 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.46 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.z + value: -20.12 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.9701297 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.018770529 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.2418144 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.0046787397 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.217 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -27.993 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 648533235605357392, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_Name + value: River_Rocks_2 (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 40233e759b9f549539f7d447b2f7c0af, type: 3} +--- !u!4 &3741208176659308090 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + m_PrefabInstance: {fileID: 3576047382928426960} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &4976125530228400883 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalScale.x + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalScale.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalScale.z + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalPosition.x + value: 103.15 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.78 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalPosition.z + value: -20.43 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7270538 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.13313511 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.6625324 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.12132019 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -20.754 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 84.683 + objectReference: {fileID: 0} + - target: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4504680061625519859, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + propertyPath: m_Name + value: River_Rocks_8 (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 4d3a638b96a0740acad16f75907743c5, type: 3} +--- !u!4 &8126386832092772026 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3875354122211890249, guid: 4d3a638b96a0740acad16f75907743c5, + type: 3} + m_PrefabInstance: {fileID: 4976125530228400883} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &5426610739093273123 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.x + value: 2.5000002 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.y + value: 2.4999998 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.z + value: 2.5 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.x + value: 101.8 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.y + value: 7.07 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.z + value: -25.93 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.49853745 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.1063734 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.85831934 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.058591977 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.926 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 120.464 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.292 + objectReference: {fileID: 0} + - target: {fileID: 8792257075096557341, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_Name + value: River_Rocks_4 (3) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84abedbc7f85f4f469c7220fb2bfc78f, type: 3} +--- !u!4 &4179549508784535428 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + m_PrefabInstance: {fileID: 5426610739093273123} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &5504401948429527038 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6945626157949959423, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 (2) + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.x + value: 3.1699996 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.y + value: 3.17 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.z + value: 3.17 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.x + value: 122.66 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.y + value: 14.67 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.z + value: -17.58 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.6272076 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.38455454 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.55120254 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.39357877 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.78 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -275.549 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 66.741 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8602d844b80dd46adb55fb29573b3c60, type: 3} +--- !u!4 &2831518371175514555 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + m_PrefabInstance: {fileID: 5504401948429527038} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &5613004158086531541 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8518063449728252689} + m_Modifications: + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.7179891 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.2974008 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.5814164 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.24083056 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5304508333967466499, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_Name + value: Sun + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.w + value: -1.0495928e-21 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.x + value: 4e-45 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.y + value: 4.9e-44 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 774ab582b39374a7e9d5dac8e31b9a5a, type: 3} +--- !u!4 &6813415163750874970 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + m_PrefabInstance: {fileID: 5613004158086531541} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &6144156972344210267 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.x + value: 2.5 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.y + value: 2.4999998 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.z + value: 2.5 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.x + value: 124.331 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.y + value: 15.794 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.z + value: -20.047 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.98921585 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.01122717 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.13152896 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.06345264 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.316 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 15.168 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.382 + objectReference: {fileID: 0} + - target: {fileID: 8792257075096557341, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_Name + value: River_Rocks_4 (4) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84abedbc7f85f4f469c7220fb2bfc78f, type: 3} +--- !u!4 &2597417704489697020 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + m_PrefabInstance: {fileID: 6144156972344210267} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &6652516275202990496 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 8570444726160424675, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_Name + value: River_Rocks_6 (2) + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.x + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.y + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.z + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.x + value: 106.87 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.y + value: 7.17 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.z + value: -20.74 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.9710375 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.23892713 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 27.646 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8a46b87981fbc476abf4f6d9418c8096, type: 3} +--- !u!4 &2443760194990343673 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + m_PrefabInstance: {fileID: 6652516275202990496} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &6756618696631995588 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6945626157949959423, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 (1) + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.z + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.x + value: 102.87118 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.836 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.z + value: -22.956854 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.58013576 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.40916535 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.6032874 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.36341527 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.078 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 93.6 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 66.341 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8602d844b80dd46adb55fb29573b3c60, type: 3} +--- !u!4 &3957633230822681217 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + m_PrefabInstance: {fileID: 6756618696631995588} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7039725011541977080 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 4960264602429190540, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_Name + value: River_Rocks_3 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalPosition.x + value: 102.08 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalPosition.y + value: 6.84 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalPosition.z + value: -22.21 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.9255601 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.37860078 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 44.494 + objectReference: {fileID: 0} + - target: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, type: 3} +--- !u!4 &3328043941943069902 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 5736942489928739638, guid: b9e6050eba9c94bbe8f2b388f80cc4cd, + type: 3} + m_PrefabInstance: {fileID: 7039725011541977080} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7287965007403605159 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2119564229340644841} + m_Modifications: + - target: {fileID: 6079220456006713144, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_Name + value: Post-Processing + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5e01cffb9e8324147affb8e08fd5ed13, type: 3} +--- !u!4 &1743139209657707752 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + m_PrefabInstance: {fileID: 7287965007403605159} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7581181676177948419 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8518063449728252689} + m_Modifications: + - target: {fileID: 963553959586484309, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_Name + value: Lighting + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bece9afbf3ddd49059dd73ba2cc986f6, type: 3} +--- !u!4 &4219678492117686297 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + m_PrefabInstance: {fileID: 7581181676177948419} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8483257907181461984 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 8570444726160424675, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_Name + value: River_Rocks_6 (3) + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.x + value: -2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.y + value: -2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.z + value: -2 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.x + value: 104.71 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.y + value: 7.57 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.z + value: -19.7 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.9867837 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.1620432 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -18.651 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8a46b87981fbc476abf4f6d9418c8096, type: 3} +--- !u!4 &576760522377659833 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + m_PrefabInstance: {fileID: 8483257907181461984} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8672732883687593913 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.x + value: 101.23 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.y + value: 7.1851215 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalPosition.z + value: -19.72 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.9776437 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.21026824 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -24.276 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 648533235605357392, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + propertyPath: m_Name + value: River_Rocks_2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 40233e759b9f549539f7d447b2f7c0af, type: 3} +--- !u!4 &8795637539784805971 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 165468967546821098, guid: 40233e759b9f549539f7d447b2f7c0af, + type: 3} + m_PrefabInstance: {fileID: 8672732883687593913} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8746596222678198935 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.x + value: 2.4999998 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.y + value: 2.5 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalScale.z + value: 2.5 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.x + value: 103.93 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.y + value: 7.07 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalPosition.z + value: -25.26 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.9970338 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.010329243 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.07626529 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.00079010427 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.173 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.75 + objectReference: {fileID: 0} + - target: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.181 + objectReference: {fileID: 0} + - target: {fileID: 8792257075096557341, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + propertyPath: m_Name + value: River_Rocks_4 (2) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84abedbc7f85f4f469c7220fb2bfc78f, type: 3} +--- !u!4 &589313464002553648 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8164902521399922087, guid: 84abedbc7f85f4f469c7220fb2bfc78f, + type: 3} + m_PrefabInstance: {fileID: 8746596222678198935} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8781939069576024886 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6115710937068508270, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.x + value: -0.009 + objectReference: {fileID: 0} + - target: {fileID: 6115710937068508270, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.002 + objectReference: {fileID: 0} + - target: {fileID: 6115710937068508270, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.009 + objectReference: {fileID: 0} + - target: {fileID: 8570444726160424675, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_Name + value: River_Rocks_6 (7) + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.x + value: 3.5 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.y + value: 3.5 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalScale.z + value: 3.5 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.x + value: 121.88 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.y + value: 14.66 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalPosition.z + value: -16.57 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.4553732 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.6466548 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.6076203 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.0725982 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 42.622 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -218.642 + objectReference: {fileID: 0} + - target: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -282.012 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8a46b87981fbc476abf4f6d9418c8096, type: 3} +--- !u!4 &316432520812771183 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9059983223426720857, guid: 8a46b87981fbc476abf4f6d9418c8096, + type: 3} + m_PrefabInstance: {fileID: 8781939069576024886} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &9193345451966203906 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1797437123073308413} + m_Modifications: + - target: {fileID: 6945626157949959423, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 (1) + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.x + value: -2 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.y + value: -2 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalScale.z + value: -2 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.x + value: 88.73 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.y + value: 5.67 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalPosition.z + value: -11.71 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8602d844b80dd46adb55fb29573b3c60, type: 3} +--- !u!4 &1494439052992245319 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7721424432143853125, guid: 8602d844b80dd46adb55fb29573b3c60, + type: 3} + m_PrefabInstance: {fileID: 9193345451966203906} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs/River_Scene.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs/River_Scene.prefab.meta new file mode 100644 index 0000000..41c8038 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Prefabs/River_Scene.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3ef658b53e32d45c49e30f89b7eb1d6c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props.meta new file mode 100644 index 0000000..699c5a7 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 630dcd368e4f0496490a1e06ac5cc280 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks.meta new file mode 100644 index 0000000..9a05d27 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5604ccf82e2f74a92baefa28bbd9aa56 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials.meta new file mode 100644 index 0000000..70ab82a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b36c2e0f798554811af90f5fd440a3a2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials/River_Rocks.mat b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials/River_Rocks.mat new file mode 100644 index 0000000..e4395dd --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials/River_Rocks.mat @@ -0,0 +1,223 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8809510013997332584 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-7341708559167123484 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &-908390253939417639 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: River_Rocks + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: df4f674b58fa548b28be7c7dbdafae8d, type: 3} + 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: 2800000, guid: 9d09cb7a68b6f43d2a6c67d65e0fe8ca, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 1716dcefd808e41ffb65bfe48f365d4b, type: 3} + 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} + - 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: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaCutoffEnable: 1 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _CastShadows: 1 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoMapScale: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _ExcludeFromTUAndAA: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _Normal_Flip_Back_Faces: 1 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 1 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SPECULARHIGHLIGHTS_OFF: 1 + - _Smoothness: 0.467 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 9 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 15 + - _StencilWriteMaskMV: 41 + - _SupportDecals: 1 + - _Surface: 0 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 3 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteControl: 0 + m_Colors: + - _Color: {r: 0.95731175, g: 1, b: 0.936, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 0} + - _SpecularColor: {r: 0.19999987, g: 0.19999987, b: 0.19999987, a: 0} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials/River_Rocks.mat.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials/River_Rocks.mat.meta new file mode 100644 index 0000000..2705cda --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Materials/River_Rocks.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f815eb94e461542318582f4fad9d9f29 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs.meta new file mode 100644 index 0000000..524967a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 957d26982d7474aa7a0760c740e95bc3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks.prefab new file mode 100644 index 0000000..c2a7ccd --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks.prefab @@ -0,0 +1,110 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &4770917562100121679 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8428954980326238777, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: f815eb94e461542318582f4fad9d9f29, type: 2} + - target: {fileID: -8367197949238459352, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: f815eb94e461542318582f4fad9d9f29, type: 2} + - target: {fileID: -7206131731897801335, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: f815eb94e461542318582f4fad9d9f29, type: 2} + - target: {fileID: -4982575473978090623, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: f815eb94e461542318582f4fad9d9f29, type: 2} + - target: {fileID: -2948771633777158598, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: f815eb94e461542318582f4fad9d9f29, type: 2} + - target: {fileID: -2302356373486275898, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: f815eb94e461542318582f4fad9d9f29, type: 2} + - target: {fileID: 919132149155446097, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Name + value: River_Rocks + objectReference: {fileID: 0} + - target: {fileID: 1905805599344130455, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: f815eb94e461542318582f4fad9d9f29, type: 2} + - target: {fileID: 7368743845736150974, guid: 5a4197775d65a46aaa9acae8881d06b2, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: f815eb94e461542318582f4fad9d9f29, type: 2} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5a4197775d65a46aaa9acae8881d06b2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks.prefab.meta new file mode 100644 index 0000000..b415d75 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 851808b2a8d5a4725b748d818a2a6df2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_1.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_1.prefab new file mode 100644 index 0000000..e9f6bb8 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_1.prefab @@ -0,0 +1,225 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &3099891307050009881 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 402365700275511756, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 878255009017175938, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1185608322517906359, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2739060878388682722, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3304399188521138605, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3411914326454395478, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722075694076961635, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5689416248541822238, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_Name + value: River_Rocks_1 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 851808b2a8d5a4725b748d818a2a6df2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_1.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_1.prefab.meta new file mode 100644 index 0000000..a2f7e70 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_1.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 665308787655740cdaacadc2fd9cf284 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_2.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_2.prefab new file mode 100644 index 0000000..31c1b47 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_2.prefab @@ -0,0 +1,230 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &5184998205449928270 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 402365700275511756, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 878255009017175938, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1185608322517906359, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2739060878388682722, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3304399188521138605, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3411914326454395478, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722075694076961635, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5689416248541822238, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_Name + value: River_Rocks_2 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9190208821620096637, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 851808b2a8d5a4725b748d818a2a6df2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_2.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_2.prefab.meta new file mode 100644 index 0000000..2534eb0 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_2.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 40233e759b9f549539f7d447b2f7c0af +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_3.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_3.prefab new file mode 100644 index 0000000..4476aee --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_3.prefab @@ -0,0 +1,230 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &730352313416797330 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 402365700275511756, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 878255009017175938, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1185608322517906359, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2739060878388682722, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3304399188521138605, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3411914326454395478, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722075694076961635, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5689416248541822238, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_Name + value: River_Rocks_3 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9190208821620096637, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 851808b2a8d5a4725b748d818a2a6df2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_3.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_3.prefab.meta new file mode 100644 index 0000000..cce7041 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_3.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b9e6050eba9c94bbe8f2b388f80cc4cd +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_4.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_4.prefab new file mode 100644 index 0000000..e5821c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_4.prefab @@ -0,0 +1,230 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &3814692743752460803 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 402365700275511756, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 878255009017175938, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1185608322517906359, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2739060878388682722, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3304399188521138605, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3411914326454395478, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722075694076961635, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5689416248541822238, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_Name + value: River_Rocks_4 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9190208821620096637, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 851808b2a8d5a4725b748d818a2a6df2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_4.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_4.prefab.meta new file mode 100644 index 0000000..f0744bd --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_4.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 84abedbc7f85f4f469c7220fb2bfc78f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_5.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_5.prefab new file mode 100644 index 0000000..a0d6ab4 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_5.prefab @@ -0,0 +1,230 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &3943949758298431614 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 402365700275511756, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 878255009017175938, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1185608322517906359, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2739060878388682722, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3304399188521138605, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3411914326454395478, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722075694076961635, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5689416248541822238, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_Name + value: River_Rocks_5 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9190208821620096637, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 851808b2a8d5a4725b748d818a2a6df2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_5.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_5.prefab.meta new file mode 100644 index 0000000..dd86d48 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_5.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3cb6d24cd91604f77a0918d74eceaecd +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_6.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_6.prefab new file mode 100644 index 0000000..d737661 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_6.prefab @@ -0,0 +1,230 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &4036505092629906429 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 402365700275511756, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 878255009017175938, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1185608322517906359, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2739060878388682722, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3304399188521138605, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3411914326454395478, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722075694076961635, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5689416248541822238, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_Name + value: River_Rocks_6 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9190208821620096637, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 851808b2a8d5a4725b748d818a2a6df2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_6.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_6.prefab.meta new file mode 100644 index 0000000..cccadfd --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_6.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8a46b87981fbc476abf4f6d9418c8096 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_7.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_7.prefab new file mode 100644 index 0000000..cb58e2c --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_7.prefab @@ -0,0 +1,230 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &3357169501017670113 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 402365700275511756, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 878255009017175938, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1185608322517906359, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2739060878388682722, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3304399188521138605, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3411914326454395478, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722075694076961635, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5689416248541822238, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_Name + value: River_Rocks_7 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9190208821620096637, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 851808b2a8d5a4725b748d818a2a6df2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_7.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_7.prefab.meta new file mode 100644 index 0000000..df2fe8e --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_7.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8602d844b80dd46adb55fb29573b3c60 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_8.prefab b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_8.prefab new file mode 100644 index 0000000..0634389 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_8.prefab @@ -0,0 +1,230 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &8103958463078659053 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 402365700275511756, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 878255009017175938, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1185608322517906359, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1605894942097295512, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2739060878388682722, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3304399188521138605, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3411914326454395478, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4722075694076961635, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5025750293587683236, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5689416248541822238, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_Name + value: River_Rocks_8 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5763246048786159777, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6312857216489648639, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7800846022303097499, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7844097712159086483, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8591273644774780669, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8731103880038882045, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8932506003540781851, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9190208821620096637, guid: 851808b2a8d5a4725b748d818a2a6df2, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 851808b2a8d5a4725b748d818a2a6df2, type: 3} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_8.prefab.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_8.prefab.meta new file mode 100644 index 0000000..9ce6a66 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Prefabs/River_Rocks_8.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4d3a638b96a0740acad16f75907743c5 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources.meta new file mode 100644 index 0000000..202b41f --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e59273278baff44e2b9d189da90e59fe +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/Source.txt b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/Source.txt new file mode 100644 index 0000000..6e67dc6 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/Source.txt @@ -0,0 +1,2 @@ +"Set of Modular Rocks" (https://skfb.ly/oGBSx) by Cleuza Costa is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/). +https://sketchfab.com/3d-models/set-of-modular-rocks-f435208fadd24363ad285d8e505a794d diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/Source.txt.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/Source.txt.meta new file mode 100644 index 0000000..6b509d0 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cd74c2ef0358248b08c33b2c92acf914 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low.fbx b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low.fbx new file mode 100644 index 0000000..a4e5847 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low.fbx differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low.fbx.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low.fbx.meta new file mode 100644 index 0000000..b65e08a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low.fbx.meta @@ -0,0 +1,109 @@ +fileFormatVersion: 2 +guid: 5a4197775d65a46aaa9acae8881d06b2 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_BaseColor.png b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_BaseColor.png new file mode 100644 index 0000000..2e87df7 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_BaseColor.png differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_BaseColor.png.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_BaseColor.png.meta new file mode 100644 index 0000000..ed74603 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_BaseColor.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 9d09cb7a68b6f43d2a6c67d65e0fe8ca +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Metallic.png b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Metallic.png new file mode 100644 index 0000000..02fc399 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Metallic.png differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Metallic.png.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Metallic.png.meta new file mode 100644 index 0000000..bae99dc --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Metallic.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 1716dcefd808e41ffb65bfe48f365d4b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Normal.png b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Normal.png new file mode 100644 index 0000000..e90e5e9 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Normal.png differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Normal.png.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Normal.png.meta new file mode 100644 index 0000000..0302a66 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Normal.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: df4f674b58fa548b28be7c7dbdafae8d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Roughness.png b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Roughness.png new file mode 100644 index 0000000..e7dd7cc Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Roughness.png differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Roughness.png.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Roughness.png.meta new file mode 100644 index 0000000..bc20e32 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Props/SetOfModularRocks/Sources/rocks_low_rocks_texture_Roughness.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 913a00cb70c804eda937b2cc57ff794f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes.meta new file mode 100644 index 0000000..58d0a95 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e50cf59867154dbda970f4161367c6d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes/River.unity b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes/River.unity new file mode 100644 index 0000000..82a8065 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes/River.unity @@ -0,0 +1,199 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000000, guid: 61a04ecf9a42f478484b3ee8e49dd08b, + type: 2} + m_LightingSettings: {fileID: 4890085278179872738, guid: 6e72aca972f324f7886200f86939d735, + type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &188239911440951982 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1395742053880712351, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6209579273066343583, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, + type: 3} + propertyPath: m_Name + value: Scene + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3ef658b53e32d45c49e30f89b7eb1d6c, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 188239911440951982} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes/River.unity.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes/River.unity.meta new file mode 100644 index 0000000..ee15985 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Scenes/River.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 36c007ea258c841f78d21589d328b50b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings.meta new file mode 100644 index 0000000..5f2b726 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cdb782fb2004a42ef8d71d888fc937df +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings/River_Lod_Foam.asset b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings/River_Lod_Foam.asset new file mode 100644 index 0000000..f96c380 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings/River_Lod_Foam.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 03aa24b56404b45a190a2cfc0c7cc100, type: 3} + m_Name: River_Lod_Foam + m_EditorClassIdentifier: + _Version: 0 + _Maximum: Infinity + _FoamFadeRate: 0.25 + _WaveFoamStrength: 1 + _WaveFoamCoverage: 0 + _FilterWaves: 2 + _ShorelineFoamMaximumDepth: 0.644 + _ShorelineFoamStrength: 0 + _ShorelineFoamPriming: 5 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings/River_Lod_Foam.asset.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings/River_Lod_Foam.asset.meta new file mode 100644 index 0000000..5633a1a --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Settings/River_Lod_Foam.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ecf87873110b84378a15fbe66bb0a41b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain.meta new file mode 100644 index 0000000..cc7f9c3 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d21ece9fd24574033a813ea9b996ca72 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Grass.terrainlayer b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Grass.terrainlayer new file mode 100644 index 0000000..ce6f9ac --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Grass.terrainlayer @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1953259897 &8574412962073106934 +TerrainLayer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: River_Grass + m_DiffuseTexture: {fileID: 2800000, guid: 3889d2e3065324298915c7dc8c217a76, type: 3} + m_NormalMapTexture: {fileID: 2800000, guid: 44bad67befe3b416ca7f443082d89cbd, type: 3} + m_MaskMapTexture: {fileID: 2800000, guid: af7dd0fb2371c453eb1f9ba3a41e071c, type: 3} + m_TileSize: {x: 2, y: 2} + m_TileOffset: {x: 0, y: 0} + m_Specular: {r: 0, g: 0, b: 0, a: 0} + m_Metallic: 0 + m_Smoothness: 0 + m_NormalScale: 1 + m_DiffuseRemapMin: {x: 0, y: 0, z: 0, w: 0} + m_DiffuseRemapMax: {x: 1, y: 1, z: 1, w: 1} + m_MaskMapRemapMin: {x: 0, y: 0, z: 0, w: 0} + m_MaskMapRemapMax: {x: 1, y: 1, z: 1, w: 1} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Grass.terrainlayer.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Grass.terrainlayer.meta new file mode 100644 index 0000000..0a9da91 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Grass.terrainlayer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3cbad80b8eb2f440b86eba5de5ecc236 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 8574412962073106934 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Sand.terrainlayer b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Sand.terrainlayer new file mode 100644 index 0000000..c6bddd5 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Sand.terrainlayer @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1953259897 &8574412962073106934 +TerrainLayer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: River_Sand + m_DiffuseTexture: {fileID: 2800000, guid: 23f2e9e0ff93b4a5cad4c5564824bc33, type: 3} + m_NormalMapTexture: {fileID: 2800000, guid: 1178c4145389f4312a5cd5db6733e5b5, type: 3} + m_MaskMapTexture: {fileID: 2800000, guid: 0b00140d958854b31ae2b4ba09716df6, type: 3} + m_TileSize: {x: 2, y: 2} + m_TileOffset: {x: 0, y: 0} + m_Specular: {r: 0, g: 0, b: 0, a: 0} + m_Metallic: 0 + m_Smoothness: 0 + m_NormalScale: 1 + m_DiffuseRemapMin: {x: 0, y: 0, z: 0, w: 0} + m_DiffuseRemapMax: {x: 1, y: 1, z: 1, w: 1} + m_MaskMapRemapMin: {x: 0, y: 0, z: 0, w: 0} + m_MaskMapRemapMax: {x: 1, y: 1, z: 1, w: 1} diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Sand.terrainlayer.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Sand.terrainlayer.meta new file mode 100644 index 0000000..d7c8f05 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Sand.terrainlayer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7953c040653564ea7aacd04a17450c74 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 8574412962073106934 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Terrain.asset b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Terrain.asset new file mode 100644 index 0000000..54ed083 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Terrain.asset differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Terrain.asset.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Terrain.asset.meta new file mode 100644 index 0000000..629a799 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Terrain/River_Terrain.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d45a468890d48485b99fca5ee978b769 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 15600000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures.meta new file mode 100644 index 0000000..c1f0849 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c609d8cc5f7d744828085ee96efdb238 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A.meta new file mode 100644 index 0000000..f577723 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 565668974548f4c7296b7d481288ceb6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_BaseColor.tif b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_BaseColor.tif new file mode 100644 index 0000000..7d88138 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_BaseColor.tif differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_BaseColor.tif.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_BaseColor.tif.meta new file mode 100644 index 0000000..ab19783 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_BaseColor.tif.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 23f2e9e0ff93b4a5cad4c5564824bc33 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 4 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 0 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_MaskMap.tif b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_MaskMap.tif new file mode 100644 index 0000000..bf1d23b Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_MaskMap.tif differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_MaskMap.tif.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_MaskMap.tif.meta new file mode 100644 index 0000000..7d4473f --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_MaskMap.tif.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 0b00140d958854b31ae2b4ba09716df6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 4 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_Normal.tif b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_Normal.tif new file mode 100644 index 0000000..3105513 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_Normal.tif differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_Normal.tif.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_Normal.tif.meta new file mode 100644 index 0000000..62bbfa4 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/River_Black_Sand_A_Normal.tif.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 1178c4145389f4312a5cd5db6733e5b5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 4 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/Source.txt b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/Source.txt new file mode 100644 index 0000000..093a93f --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/Source.txt @@ -0,0 +1,3 @@ +The Unity Terrain - URP Demo Scene +Standard Unity Asset Store EULA +https://assetstore.unity.com/packages/3d/environments/unity-terrain-urp-demo-scene-213197 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/Source.txt.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/Source.txt.meta new file mode 100644 index 0000000..e09cca2 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Black_Sand_A/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bf70ac2c0b0fb4ef483ce09ad04cca44 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A.meta new file mode 100644 index 0000000..42ac5dc --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 12c7e0f29d83346e18d49060d07641fc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_BaseColor.tif b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_BaseColor.tif new file mode 100644 index 0000000..65d778a Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_BaseColor.tif differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_BaseColor.tif.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_BaseColor.tif.meta new file mode 100644 index 0000000..6e090ac --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_BaseColor.tif.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 3889d2e3065324298915c7dc8c217a76 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 4 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_MaskMap.tif b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_MaskMap.tif new file mode 100644 index 0000000..5803506 Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_MaskMap.tif differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_MaskMap.tif.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_MaskMap.tif.meta new file mode 100644 index 0000000..1cd8b5e --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_MaskMap.tif.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: af7dd0fb2371c453eb1f9ba3a41e071c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 4 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 25 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_Normal.tif b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_Normal.tif new file mode 100644 index 0000000..5d0507a Binary files /dev/null and b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_Normal.tif differ diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_Normal.tif.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_Normal.tif.meta new file mode 100644 index 0000000..56ada92 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/River_Grass_A_Normal.tif.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 44bad67befe3b416ca7f443082d89cbd +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 4 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 27 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 27 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/Source.txt b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/Source.txt new file mode 100644 index 0000000..093a93f --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/Source.txt @@ -0,0 +1,3 @@ +The Unity Terrain - URP Demo Scene +Standard Unity Asset Store EULA +https://assetstore.unity.com/packages/3d/environments/unity-terrain-urp-demo-scene-213197 diff --git a/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/Source.txt.meta b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/Source.txt.meta new file mode 100644 index 0000000..636e251 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/Samples~/River/Textures/Grass_A/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5d4020d9c6c2c42a49eebf59ae396c55 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest.shallow-water/package.json b/Packages/com.waveharmonic.crest.shallow-water/package.json new file mode 100644 index 0000000..3207c50 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/package.json @@ -0,0 +1,30 @@ +{ + "name": "com.waveharmonic.crest.shallow-water", + "version": "1.3.3", + "displayName": "Crest - Shallow Water", + "description": "Shallow Water Simulation for Crest.", + "unity": "2022.3", + "hideInEditor": false, + "documentationUrl": "https://docs.crest.waveharmonic.com/Packages/ShallowWater/Introduction.html", + "changelogUrl": "https://docs.crest.waveharmonic.com/Packages/ShallowWater/History.html", + "author": { + "name": "Wave Harmonic", + "email": "support@waveharmonic.com", + "url": "https://waveharmonic.com/" + }, + "samples": [ + { + "displayName": "Beach", + "description": "Demonstrates the shoreline preset.", + "path": "Samples~/Beach" + }, + { + "displayName": "Stream", + "description": "Demonstrates the stream preset.", + "path": "Samples~/River" + } + ], + "dependencies": { + "com.waveharmonic.crest": "5.6.0" + } +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest.shallow-water/package.json.meta b/Packages/com.waveharmonic.crest.shallow-water/package.json.meta new file mode 100644 index 0000000..4e352e5 --- /dev/null +++ b/Packages/com.waveharmonic.crest.shallow-water/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 36acb52d9b87645e68bdb5432524a2b5 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Documentation~/API.pdf b/Packages/com.waveharmonic.crest/Documentation~/API.pdf new file mode 100644 index 0000000..bff449f Binary files /dev/null and b/Packages/com.waveharmonic.crest/Documentation~/API.pdf differ diff --git a/Packages/com.waveharmonic.crest/Documentation~/API.pdf.meta b/Packages/com.waveharmonic.crest/Documentation~/API.pdf.meta new file mode 100644 index 0000000..ea428fa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Documentation~/API.pdf.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1c86a082904904ed8b5bac5029f5b811 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Documentation~/Manual.pdf b/Packages/com.waveharmonic.crest/Documentation~/Manual.pdf new file mode 100644 index 0000000..5e7788d Binary files /dev/null and b/Packages/com.waveharmonic.crest/Documentation~/Manual.pdf differ diff --git a/Packages/com.waveharmonic.crest/Documentation~/Manual.pdf.meta b/Packages/com.waveharmonic.crest/Documentation~/Manual.pdf.meta new file mode 100644 index 0000000..aa21640 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Documentation~/Manual.pdf.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 735ed5b3b44b54da1af9edc799f25799 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor.meta b/Packages/com.waveharmonic.crest/Editor.meta new file mode 100644 index 0000000..b6a229f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7c5b0e70850c4b5b9cc74cde678c8f5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Icons.meta b/Packages/com.waveharmonic.crest/Editor/Icons.meta new file mode 100644 index 0000000..9e68bce --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Icons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 07713a05ee7134f699db61252add8587 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Icons/Logomark.png b/Packages/com.waveharmonic.crest/Editor/Icons/Logomark.png new file mode 100644 index 0000000..639e754 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Editor/Icons/Logomark.png differ diff --git a/Packages/com.waveharmonic.crest/Editor/Icons/Logomark.png.meta b/Packages/com.waveharmonic.crest/Editor/Icons/Logomark.png.meta new file mode 100644 index 0000000..7df6548 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Icons/Logomark.png.meta @@ -0,0 +1,114 @@ +fileFormatVersion: 2 +guid: 72a325a76c6624c768822a08fe625d55 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts.meta b/Packages/com.waveharmonic.crest/Editor/Scripts.meta new file mode 100644 index 0000000..488f979 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9e5b7e45774a04476ac12d691fec9152 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Assembly.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Assembly.cs new file mode 100644 index 0000000..822b457 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Assembly.cs @@ -0,0 +1,19 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.CPUQueries.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Paint.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShallowWater.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Splines.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Watercraft.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Whirlpool.Editor")] + +// Define empty namespaces for when assemblies are not present. +namespace UnityEditor.Rendering.HighDefinition { } +namespace UnityEngine.Rendering.HighDefinition { } +namespace UnityEngine.Rendering.Universal { } +namespace WaveHarmonic.Crest.Paint { } +namespace WaveHarmonic.Crest.Splines { } diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Assembly.cs.meta new file mode 100644 index 0000000..c5cda04 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8bd644d8cd9e34f6aaa99d6b83420b22 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/BuildProcessor.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/BuildProcessor.cs new file mode 100644 index 0000000..b2a7aed --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/BuildProcessor.cs @@ -0,0 +1,378 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using WaveHarmonic.Crest.Editor.Settings; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEditor.Rendering; +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest.Editor.Build +{ + sealed class LegacyShaderGraphProcessor : IPreprocessShaders, IPostprocessBuildWithReport + { + static readonly ShaderTagId s_ShaderGraphShaderShaderTagId = new("ShaderGraphShader"); + + public int callbackOrder => -1; + + int _VariantCount; + int _VariantCountStripped; + + bool LogVariantStripping => +#if CREST_DEBUG + true; +#else + false; +#endif + + static readonly string[] s_ShadowCollectorKeywords = { "SHADOWS_SINGLE_CASCADE", "SHADOWS_SPLIT_SPHERES", "SHADOWS_SOFT" }; + + public void OnProcessShader(Shader shader, ShaderSnippetData snippet, IList data) + { + // Not one of our shaders. + if (!shader.name.StartsWithNoAlloc("Hidden/Crest/") && !shader.name.StartsWithNoAlloc("Crest/")) + { + return; + } + + // Not a Shader Graph. + if (shader.GetSubShaderTag(snippet, s_ShaderGraphShaderShaderTagId) != "true") + { + return; + } + + // Sub-shader is not targeting the built-in render pipeline. + if (shader.TryGetRenderPipelineTag(snippet, out _)) + { + return; + } + + // Only strip if there is a sub-shader per render pipeline. + if (shader.subshaderCount < 3) + { + return; + } + + _VariantCount += data.Count; + + // Strip BIRP sub-shader if not using BIRP, as Unity only strips HDRP/URP sub-shaders. + if (!RenderPipelineHelper.IsLegacy) + { + _VariantCountStripped += data.Count; + data.Clear(); + return; + } + + for (var i = data.Count - 1; i >= 0; --i) + { + var strip = false; + var keywords = data[i].shaderKeywordSet.GetShaderKeywords(); + var isLightingPass = snippet.passType is PassType.ForwardBase or PassType.ForwardAdd; + var isTransparent = keywords.Any(x => x.name == "_BUILTIN_SURFACE_TYPE_TRANSPARENT"); + var isTransparentShadowReceiver = keywords.Any(x => x.name == "_BUILTIN_TRANSPARENT_RECEIVES_SHADOWS"); + + // Invalid combination. + if (isLightingPass && !isTransparent && isTransparentShadowReceiver) + { + strip = true; + } + + if (!strip) + { + foreach (var keyword in keywords) + { + var name = keyword.name; + strip = + // Invalid combination. + isLightingPass && (!isTransparent || !isTransparentShadowReceiver) && s_ShadowCollectorKeywords.Contains(keyword.name); + + if (strip) break; + } + } + + if (strip) + { + _VariantCountStripped++; + data.RemoveAt(i); + } + } + } + + public void OnPostprocessBuild(BuildReport report) + { + if (LogVariantStripping) + { + Debug.Log($"Crest: {_VariantCountStripped} / {_VariantCount} stripped from Crest BIRP. Total variants: {_VariantCount - _VariantCountStripped}"); + } + } + } + + sealed class BuildProcessor : IPreprocessComputeShaders, IPreprocessShaders, IPostprocessBuildWithReport + { + public int callbackOrder => 0; + + int _VariantCount; + int _VariantCountStripped; + + ProjectSettings _Settings; + WaterResources _Resources; + + void Logger(string message) + { + Debug.Log(message); + } + + bool StripShader(Object shader, IList data) + { + _Settings = ProjectSettings.Instance; + _Resources = WaterResources.Instance; + + if (!AssetDatabase.GetAssetPath(shader).StartsWithNoAlloc("Packages/com.waveharmonic.crest")) + { + return false; + } + + if (shader.name.StartsWithNoAlloc("Hidden/Crest/Samples/")) + { + return false; + } + + if (_Settings.DebugEnableStrippingLogging) + { + Logger($"Shader: '{shader.name}' @ {AssetDatabase.GetAssetPath(shader)}"); + } + + _VariantCount += data.Count; + + if (ShouldStripShader(shader)) + { + if (_Settings.LogStrippedVariants) + { + Logger($"Stripping Shader: {shader.name}"); + } + + _VariantCountStripped += data.Count; + data.Clear(); + return false; + } + + return true; + } + + bool ShouldStripVariant(Object shader, ShaderCompilerData data, string[] keywords) + { + return false; + } + + bool ShouldStripVariant(ProjectSettings.State state, ShaderCompilerData data, string[] keywords, LocalKeyword keyword, Object shader0, Object shader1) + { + if (shader0 != shader1) + { + return false; + } + + return state switch + { + ProjectSettings.State.Disabled => data.shaderKeywordSet.IsEnabled(keyword), + // Strip if keyword is not enabled and appears in one other variant. + ProjectSettings.State.Enabled => !data.shaderKeywordSet.IsEnabled(keyword) && ArrayUtility.Contains(keywords, keyword.name), + _ => false, + }; + } + + bool ShouldStripVariant(ProjectSettings.State state, ShaderCompilerData data, string[] keywords, ShaderKeyword keyword) + { + return state switch + { + ProjectSettings.State.Disabled => data.shaderKeywordSet.IsEnabled(keyword), + // Strip if keyword is not enabled and appears in one other variant. + ProjectSettings.State.Enabled => !data.shaderKeywordSet.IsEnabled(keyword) && ArrayUtility.Contains(keywords, keyword.name), + _ => false, + }; + } + + bool ShouldStripVariant(Object shader, ShaderKeyword[] keywords) + { + // Strip debug variants. + if (!EditorUserBuildSettings.development) + { + foreach (var keyword in keywords) + { + if (keyword.name.StartsWithNoAlloc("_DEBUG")) + { + if (_Settings.LogStrippedVariants) + { + Logger($"Stripping Keyword: {keyword.name}"); + } + + return true; + } + } + } + + return false; + } + + bool ShouldStripShader(Object shader) + { + if (!EditorUserBuildSettings.development) + { + if (shader.name.Contains("Debug")) + { + return true; + } + } + + return false; + } + + void StripKeywords(Object shader, IList data) + { + // Get all keywords for this kernel/stage. + string[] keywords; + { + var set = new HashSet(); + for (var i = 0; i < data.Count; i++) + { + // Each ShaderCompilerData is a variant which is a combination of keywords. Since each list will be + // different, simply getting a list of all keywords is not possible. This also appears to be the only + // way to get a list of keywords without trying to extract them from shader property names. Lastly, + // shader_feature will be returned only if they are enabled. + set.UnionWith(data[i].shaderKeywordSet.GetShaderKeywords()); + } + + keywords = set.Select(x => x.name).ToArray(); + } + + for (var i = data.Count - 1; i >= 0; --i) + { + if (_Settings.LogStrippedVariants) + { + Logger($"Keywords: {string.Join(", ", data[i].shaderKeywordSet.GetShaderKeywords())}"); + } + + if (ShouldStripVariant(shader, data[i].shaderKeywordSet.GetShaderKeywords())) + { + _VariantCountStripped++; + data.RemoveAt(i); + continue; + } + + if (ShouldStripVariant(shader, data[i], keywords)) + { + _VariantCountStripped++; + data.RemoveAt(i); + continue; + } + + if (_Settings.LogKeptVariants) + { + Logger($"Keywords: {string.Join(", ", data[i].shaderKeywordSet.GetShaderKeywords())}"); + } + } + } + + bool ShouldStripSubShader(Shader shader, ShaderSnippetData snippet) + { + if (!shader.name.StartsWithNoAlloc("Crest/") && !shader.name.StartsWithNoAlloc("Hidden/Crest/")) + { + return false; + } + + // There will be at least three sub-shaders if one per render pipeline. + if (shader.subshaderCount <= 2) + { + return false; + } + + // Strip BIRP sub-shader if not using BIRP as Unity only strips HDRP/URP sub-shaders. + if (!RenderPipelineHelper.IsLegacy && !shader.TryGetRenderPipelineTag(snippet, out _)) + { + return true; + } + + return false; + } + + public void OnProcessShader(Shader shader, ShaderSnippetData snippet, IList data) + { + // Fixes point light cookie variant trigger shader compiler error: + // > Shader error in 'Crest/Water': call to 'texCUBE' is ambiguous at + // > Buidin/Library/PackageCache/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/PBRForwardAddPass.hlsl(58) (on gamecore_scarlett) + if (ProjectSettings.Instance.StripBrokenVariants && RenderPipelineHelper.IsLegacy && shader.name == "Crest/Water") + { + var pointCookie = new LocalKeyword(shader, "POINT_COOKIE"); + + for (var i = data.Count - 1; i >= 0; --i) + { + var d = data[i]; + + if (d.buildTarget != BuildTarget.GameCoreXboxSeries && d.shaderCompilerPlatform != ShaderCompilerPlatform.GameCoreXboxSeries) + { + continue; + } + + if (d.shaderKeywordSet.IsEnabled(pointCookie)) + { + _VariantCountStripped++; + data.RemoveAt(i); + Debug.Log($"Crest: Removing POINT_COOKIE {shader.name} {d.buildTarget} {d.shaderCompilerPlatform}"); + continue; + } + } + } + + if (!StripShader(shader, data)) + { + return; + } + + if (ShouldStripSubShader(shader, snippet)) + { + _VariantCountStripped += data.Count; + data.Clear(); + return; + } + + if (_Settings.DebugEnableStrippingLogging) + { + Logger($"Pass {snippet.passName} Type {snippet.passType} Stage {snippet.shaderType}"); + } + + // TODO: Add stripping specific to pixel shaders here. + + StripKeywords(shader, data); + } + + public void OnProcessComputeShader(ComputeShader shader, string kernel, IList data) + { + if (!StripShader(shader, data)) + { + return; + } + + if (_Settings.DebugEnableStrippingLogging) + { + Logger($"Kernel {kernel}"); + } + + // TODO: Add stripping specific to compute shaders here. + StripKeywords(shader, data); + } + + public void OnPostprocessBuild(BuildReport report) + { + _Settings = ProjectSettings.Instance; + _Resources = WaterResources.Instance; + + if (_Settings.DebugEnableStrippingLogging) + { + Debug.Log($"Crest: {_VariantCountStripped} / {_VariantCount} stripped from Crest. Total variants: {_VariantCount - _VariantCountStripped}"); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/BuildProcessor.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/BuildProcessor.cs.meta new file mode 100644 index 0000000..3dd2533 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/BuildProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc038d319256b40b6912636ac2129a2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Editors.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Editors.cs new file mode 100644 index 0000000..03f19be --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Editors.cs @@ -0,0 +1,511 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Editor +{ + [CustomEditor(typeof(WaterRenderer))] + sealed class WaterRendererEditor : Inspector + { + // Whether validation was triggered by user request, which should never skip console logging. + internal static bool ManualValidation { get; private set; } + + WaterRenderer _Target; + + protected override void OnEnable() + { + base.OnEnable(); + _Target = (WaterRenderer)target; + } + + protected override void RenderInspectorGUI() + { + var target = this.target as WaterRenderer; + + var currentAssignedTP = serializedObject.FindProperty(nameof(WaterRenderer._TimeProvider)).objectReferenceValue; + + base.RenderInspectorGUI(); + + // Detect if user changed TP, if so update stack + var newlyAssignedTP = serializedObject.FindProperty(nameof(WaterRenderer._TimeProvider)).objectReferenceValue; + if (currentAssignedTP != newlyAssignedTP) + { + if (currentAssignedTP != null) + { + target.TimeProviders.Pop(currentAssignedTP as TimeProvider); + } + if (newlyAssignedTP != null) + { + target.TimeProviders.Push(newlyAssignedTP as TimeProvider); + } + } + + // Display version in information box. + { + // Fix leftover nesting from drawers. + EditorGUI.indentLevel = 0; + + var padding = GUI.skin.GetStyle("HelpBox").padding; + GUI.skin.GetStyle("HelpBox").padding = new(10, 10, 10, 10); + +#if CREST_DEBUG + if (target._Debug._ShowDebugInformation) + { + EditorGUILayout.Space(); + + var baseScale = target.CalcLodScale(0); + var baseTexelSize = 2f * 2f * baseScale / target.LodResolution; + + var message = ""; + for (var i = 0; i < target.LodLevels; i++) + { + message += $"LOD: {i}\n"; + message += $"Scale: {target.CalcLodScale(i)}\n"; + message += $"Texel: {2f * 2f * target.CalcLodScale(i) / target.LodResolution}\n"; + message += $"Minimum Slice: {Mathf.Floor(Mathf.Log(Mathf.Max(i / baseTexelSize, 1f), 2f))}"; + if (i < target.LodLevels - 1) message += "\n\n"; + } + + if (target.Surface.Material.HasVector(WaterRenderer.ShaderIDs.s_Absorption)) + { + message += $"\n\nDepth Fog Density: {target.Surface.Material.GetVector(WaterRenderer.ShaderIDs.s_Absorption)}"; + } + + EditorGUILayout.HelpBox(message, MessageType.None); + } +#endif + + GUI.skin.GetStyle("HelpBox").padding = padding; + } + } + + protected override void RenderBottomButtons() + { + base.RenderBottomButtons(); + + var target = this.target as WaterRenderer; + + EditorGUILayout.Space(); + +#if CREST_DEBUG + if (GUILayout.Button("Change Scale")) + { + var scale = target.ScaleRange; + scale.x = scale.x == 4f ? 256f : 4f; + target.ScaleRange = scale; + EditorApplication.isPaused = false; + } +#endif + + if (GUILayout.Button("Validate Setup")) + { + ManualValidation = true; + + ValidatedHelper.ExecuteValidators(target, ValidatedHelper.DebugLog); + + foreach (var component in FindObjectsByType(FindObjectsSortMode.None)) + { + if (component is WaterRenderer) continue; + ValidatedHelper.ExecuteValidators(component, ValidatedHelper.DebugLog); + } + + Debug.Log("Crest: Validation complete!", target); + + ManualValidation = false; + } + } + } + + [CustomEditor(typeof(WaveSpectrum))] + sealed class WaveSpectrumEditor : Inspector, IEmbeddableEditor + { + static readonly string[] s_ModelDescriptions = new[] + { + "Select an option to author waves using a spectrum model.", + "Fully developed sea with infinite fetch.", + }; + + static readonly GUIContent s_TimeScaleLabel = new("Time Scale"); + + System.Type _HostComponentType = null; + public void SetTypeOfHostComponent(System.Type hostComponentType) + { + _HostComponentType = hostComponentType; + } + + protected override void OnEnable() + { + base.OnEnable(); + + Undo.undoRedoEvent -= OnUndoRedo; + Undo.undoRedoEvent += OnUndoRedo; + } + + protected override void OnDisable() + { + base.OnDisable(); + Undo.undoRedoEvent -= OnUndoRedo; + } + + void OnUndoRedo(in UndoRedoInfo info) + { + var target = (WaveSpectrum)this.target; + + if (info.undoName == "Change Spectrum") + { + target.InitializeHandControls(); + } + } + + protected override void RenderInspectorGUI() + { + // Display a notice if its being edited as a standalone asset (not embedded in a component) because + // it displays the FFT-interface. + if (_HostComponentType == null) + { + EditorGUILayout.HelpBox("This editor is displaying the FFT spectrum settings. " + + "To edit settings specific to the ShapeGerstner component, assign this asset to a ShapeGerstner component " + + "and edit it there by expanding the Spectrum field.", MessageType.Info); + EditorGUILayout.Space(); + } + + base.RenderInspectorGUI(); + + EditorGUI.BeginChangeCheck(); + + var beingEditedOnGerstnerComponent = _HostComponentType == typeof(ShapeGerstner); + + var showAdvancedControls = false; + if (beingEditedOnGerstnerComponent) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(WaveSpectrum._GravityScale))); + + EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(WaveSpectrum._WaveDirectionVariance))); + + EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(WaveSpectrum._ShowAdvancedControls))); + showAdvancedControls = serializedObject.FindProperty(nameof(WaveSpectrum._ShowAdvancedControls)).boolValue; + } + else + { + EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(WaveSpectrum._GravityScale)), s_TimeScaleLabel); + } + + var spSpectrumModel = serializedObject.FindProperty(nameof(WaveSpectrum._Model)); + var spectraIndex = serializedObject.FindProperty(nameof(WaveSpectrum._Model)).enumValueIndex; + var spectrumModel = (WaveSpectrum.SpectrumModel)Mathf.Clamp(spectraIndex, 0, 1); + + EditorGUILayout.Space(); + + var spDisabled = serializedObject.FindProperty(nameof(WaveSpectrum._PowerDisabled)); + EditorGUILayout.BeginHorizontal(); + var allEnabled = true; + for (var i = 0; i < spDisabled.arraySize; i++) + { + if (spDisabled.GetArrayElementAtIndex(i).boolValue) allEnabled = false; + } + var toggle = allEnabled; + if (toggle != EditorGUILayout.Toggle(toggle, GUILayout.Width(13f))) + { + for (var i = 0; i < spDisabled.arraySize; i++) + { + spDisabled.GetArrayElementAtIndex(i).boolValue = toggle; + } + } + EditorGUILayout.LabelField("Spectrum", EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + + var spec = target as WaveSpectrum; + + var spPower = serializedObject.FindProperty(nameof(WaveSpectrum._PowerLogarithmicScales)); + var spChopScales = serializedObject.FindProperty(nameof(WaveSpectrum._ChopScales)); + var spGravScales = serializedObject.FindProperty(nameof(WaveSpectrum._GravityScales)); + + // Disable sliders if authoring with model. + var canEditSpectrum = spectrumModel == WaveSpectrum.SpectrumModel.None; + + for (var i = 0; i < spPower.arraySize; i++) + { + EditorGUILayout.BeginHorizontal(); + + var spDisabled_i = spDisabled.GetArrayElementAtIndex(i); + spDisabled_i.boolValue = !EditorGUILayout.Toggle(!spDisabled_i.boolValue, GUILayout.Width(15f)); + + var smallWL = WaveSpectrum.SmallWavelength(i); + var spPower_i = spPower.GetArrayElementAtIndex(i); + + var isPowerDisabled = spDisabled_i.boolValue; + var powerValue = isPowerDisabled ? WaveSpectrum.s_MinimumPowerLog : spPower_i.floatValue; + + if (showAdvancedControls) + { + EditorGUILayout.LabelField(string.Format("{0}", smallWL), EditorStyles.boldLabel); + EditorGUILayout.EndHorizontal(); + + // Disable slider if authoring with model. + using (new EditorGUI.DisabledGroupScope(!canEditSpectrum || spDisabled_i.boolValue)) + { + powerValue = EditorGUILayout.Slider(" Power", powerValue, WaveSpectrum.s_MinimumPowerLog, WaveSpectrum.s_MaximumPowerLog); + } + } + else + { + EditorGUILayout.LabelField(string.Format("{0}", smallWL), GUILayout.Width(50f)); + + // Disable slider if authoring with model. + using (new EditorGUI.DisabledGroupScope(!canEditSpectrum || spDisabled_i.boolValue)) + { + powerValue = EditorGUILayout.Slider(powerValue, WaveSpectrum.s_MinimumPowerLog, WaveSpectrum.s_MaximumPowerLog); + } + + EditorGUILayout.EndHorizontal(); + // This will create a tooltip for slider. + GUI.Label(GUILayoutUtility.GetLastRect(), new GUIContent("", powerValue.ToString())); + } + + // If the power is disabled, we are using the MIN_POWER_LOG value so we don't want to store it. + if (!isPowerDisabled) + { + spPower_i.floatValue = powerValue; + } + + if (showAdvancedControls) + { + EditorGUILayout.Slider(spChopScales.GetArrayElementAtIndex(i), 0f, 4f, " Chop Scale"); + EditorGUILayout.Slider(spGravScales.GetArrayElementAtIndex(i), 0f, 4f, " Grav Scale"); + } + } + + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Empirical Spectra", EditorStyles.boldLabel); + + EditorGUILayout.BeginHorizontal(); + spectrumModel = (WaveSpectrum.SpectrumModel)EditorGUILayout.EnumPopup(spectrumModel); + spSpectrumModel.enumValueIndex = (int)spectrumModel; + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.Space(); + EditorGUILayout.HelpBox(s_ModelDescriptions[(int)spectrumModel], MessageType.Info); + EditorGUILayout.Space(); + + if (spectrumModel == WaveSpectrum.SpectrumModel.None) + { + Undo.RecordObject(spec, "Change Spectrum"); + } + else + { + // It doesn't seem to matter where this is called. + Undo.RecordObject(spec, $"Apply {ObjectNames.NicifyVariableName(spectrumModel.ToString())} Spectrum"); + + + // Descriptions from this very useful paper: + // https://hal.archives-ouvertes.fr/file/index/docid/307938/filename/frechot_realistic_simulation_of_ocean_surface_using_wave_spectra.pdf + + switch (spectrumModel) + { + case WaveSpectrum.SpectrumModel.PiersonMoskowitz: + var water = WaterRenderer.Instance; + spec.ApplyPiersonMoskowitzSpectrum(water != null ? water.Gravity : Mathf.Abs(Physics.gravity.y)); + break; + } + } + + if (EditorGUI.EndChangeCheck()) + { + // NOTE: Undo/Redo will not update for some reason. + serializedObject.ApplyModifiedProperties(); + spec.InitializeHandControls(); + } + + if (GUI.changed) + { + // We need to call this otherwise any property which has HideInInspector won't save. + EditorUtility.SetDirty(spec); + } + } + } + + [CustomEditor(typeof(LodSettings), true)] + sealed class SimSettingsBaseEditor : Inspector + { + protected override void RenderInspectorGUI() + { + EditorGUILayout.Space(); + if (GUILayout.Button("Open Online Help Page")) + { + var targetType = target.GetType(); + var helpAttribute = (HelpURL)System.Attribute.GetCustomAttribute(targetType, typeof(HelpURL)); + Debug.AssertFormat(helpAttribute != null, "Crest: Could not get HelpURL attribute from {0}.", targetType); + Application.OpenURL(helpAttribute.URL); + } + EditorGUILayout.Space(); + + base.RenderInspectorGUI(); + } + } + + [CustomEditor(typeof(WaterChunkRenderer)), CanEditMultipleObjects] + sealed class WaterChunkRendererEditor : Inspector + { + Renderer _Renderer; + protected override void RenderInspectorGUI() + { + base.RenderInspectorGUI(); + + var target = this.target as WaterChunkRenderer; + + if (_Renderer == null) + { + _Renderer = target.GetComponent(); + } + + GUI.enabled = false; + var boundsXZ = new Bounds(target._UnexpandedBoundsXZ.center.XNZ(), target._UnexpandedBoundsXZ.size.XNZ()); + EditorGUILayout.BoundsField("Bounds XZ", boundsXZ); + EditorGUILayout.BoundsField("Expanded Bounds", _Renderer.bounds); + GUI.enabled = true; + } + } + + [CustomEditor(typeof(DepthProbe))] + sealed class DepthProbeEditor : Inspector + { + [InitializeOnLoadMethod] + static void OnLoad() + { + // Allows DepthProbe to trigger a bake without referencing assembly. + DepthProbe.OnBakeRequest -= Bake; + DepthProbe.OnBakeRequest += Bake; + } + + protected override void RenderBottomButtons() + { + base.RenderBottomButtons(); + + EditorGUILayout.Space(); + + var target = this.target as DepthProbe; + + var isBaked = target.Type == DepthProbeMode.Baked; + var onDemand = target.Type == DepthProbeMode.RealTime && target.RefreshMode == DepthProbeRefreshMode.ViaScripting; + var canBake = !onDemand && !Application.isPlaying; + var canPopulate = Application.isPlaying ? onDemand : target.Type != DepthProbeMode.Baked; + + if (isBaked ? GUILayout.Button("Switch to Real-Time") : target.SavedTexture != null && GUILayout.Button("Switch to Baked")) + { + Undo.RecordObject(target, isBaked ? "Switch to Real-Time" : "Switch to Baked"); + target.Type = isBaked ? DepthProbeMode.RealTime : DepthProbeMode.Baked; + EditorUtility.SetDirty(target); + } + + if (canPopulate && GUILayout.Button("Populate")) + { + target.Populate(); + } + + if (canBake && GUILayout.Button("Bake")) + { + Bake(target); + } + } + + internal static void Bake(DepthProbe target) + { + target.ForcePopulate(); + + var rt = target.RealtimeTexture; + RenderTexture.active = rt; + var tex = new Texture2D(rt.width, rt.height, TextureFormat.RGBAHalf, false); + tex.ReadPixels(new(0, 0, rt.width, rt.height), 0, 0); + RenderTexture.active = null; + + byte[] bytes; + bytes = tex.EncodeToEXR(Texture2D.EXRFlags.OutputAsFloat); + + var path = target.SavedTexture + ? AssetDatabase.GetAssetPath(target.SavedTexture) + : $"Assets/DepthProbe_{System.Guid.NewGuid()}.exr"; + System.IO.File.WriteAllBytes(path, bytes); + AssetDatabase.ImportAsset(path); + + if (target.SavedTexture == null) + { + var serializedObject = new SerializedObject(target); + serializedObject.FindProperty(nameof(DepthProbe._SavedTexture)).objectReferenceValue = AssetDatabase.LoadAssetAtPath(path); + serializedObject.FindProperty(nameof(DepthProbe._Type)).enumValueIndex = (int)DepthProbeMode.Baked; + serializedObject.ApplyModifiedProperties(); + } + + var ti = AssetImporter.GetAtPath(path) as TextureImporter; + ti.textureShape = TextureImporterShape.Texture2D; + ti.sRGBTexture = false; + ti.alphaSource = TextureImporterAlphaSource.None; + ti.mipmapEnabled = false; + ti.alphaIsTransparency = false; + // Compression will clamp negative values. + ti.textureCompression = TextureImporterCompression.Uncompressed; + ti.filterMode = FilterMode.Bilinear; + ti.wrapMode = TextureWrapMode.Clamp; + // Values are slightly different with NPOT Scale applied. + ti.npotScale = TextureImporterNPOTScale.None; + + // Set single component. + if (!target._GenerateSignedDistanceField) + { + ti.textureType = TextureImporterType.SingleChannel; + + var settings = new TextureImporterSettings(); + ti.ReadTextureSettings(settings); + settings.singleChannelComponent = TextureImporterSingleChannelComponent.Red; + ti.SetTextureSettings(settings); + } + else + { + ti.textureType = TextureImporterType.Default; + } + + // Set format. + { + var settings = ti.GetDefaultPlatformTextureSettings(); + settings.format = target._GenerateSignedDistanceField ? TextureImporterFormat.RGFloat : TextureImporterFormat.RFloat; + ti.SetPlatformTextureSettings(settings); + } + + ti.SaveAndReimport(); + + Debug.Log("Crest: Probe saved to " + path, AssetDatabase.LoadAssetAtPath(path)); + } + } + + [CustomEditor(typeof(QueryEvents))] + sealed class QueryEventsEditor : Inspector + { + protected override void RenderInspectorGUI() + { + EditorGUILayout.Space(); + EditorGUILayout.HelpBox + ( + "For the Above/Below Water Surface Events, whenever this game object goes below or above the water " + + "surface, the appropriate event is fired once per state change. It can be used to trigger audio to " + + "play underwater and much more. For the Distance From Water Surface event, it will pass the " + + "distance every frame (passing normalised distance to audio volume as an example).", + MessageType.Info + ); + EditorGUILayout.Space(); + + base.RenderInspectorGUI(); + } + } + + [CustomEditor(typeof(NetworkedTimeProvider))] + sealed class NetworkedTimeProviderEditor : Inspector + { + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox($"Assign this component to the {nameof(WaterRenderer)} component and set the TimeOffsetToServer property of this component (at runtime from C#) to the delta from this client's time to the shared server time.", MessageType.Info); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Editors.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Editors.cs.meta new file mode 100644 index 0000000..ffafee5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Editors.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d45e90774186f434b9c6d8dd507d22b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Gizmos.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Gizmos.cs new file mode 100644 index 0000000..c29972f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Gizmos.cs @@ -0,0 +1,421 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Linq; +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Editor +{ + static class Visualizers + { +#if CREST_DEBUG + static Material s_VisualizeMaterial; + static Material VisualizeMaterial => s_VisualizeMaterial != null ? s_VisualizeMaterial + : s_VisualizeMaterial = new(Shader.Find("Local/Debug/Visualize Signed Texture")); +#endif + + static void DrawLine(Vector3 start, Vector3 end, Color color, float _) + { + Gizmos.color = color; + Gizmos.DrawLine(start, end); + } + + [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected)] + static void DrawGizmos(WaterRenderer target, GizmoType type) + { +#if CREST_DEBUG + if (target._Debug._DrawLodOutline) + { + // Each LOD could have its own position due to snapping. + foreach (var simulation in target.Simulations.Cast()) + { + if (!simulation._Enabled) continue; + + for (var index = 0; index < simulation.Slices; index++) + { + Gizmos.color = simulation.GizmoColor; + var rect = simulation.Cascades[index].TexelRect; + + Gizmos.DrawWireCube + ( + rect.center.XNZ(target.SeaLevel), + rect.size.XNZ() + ); + } + } + } +#endif + + // Don't need proxy if in play mode + if (Application.isPlaying) + { + return; + } + + // Create proxy if not present already, and proxy enabled + if (target._ProxyPlane == null && target._ShowWaterProxyPlane) + { + target._ProxyPlane = GameObject.CreatePrimitive(PrimitiveType.Quad); + Helpers.Destroy(target._ProxyPlane.GetComponent()); + target._ProxyPlane.hideFlags = HideFlags.HideAndDontSave; + target._ProxyPlane.transform.parent = target.transform; + target._ProxyPlane.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.Euler(90f, 0f, 0f)); + target._ProxyPlane.transform.localScale = 1000000f * Vector3.one; + + target._ProxyPlane.GetComponent().sharedMaterial = new(Shader.Find(WaterRenderer.k_ProxyShader)); + } + + // Change active state of proxy if necessary + if (target._ProxyPlane != null && target._ProxyPlane.activeSelf != target._ShowWaterProxyPlane) + { + target._ProxyPlane.SetActive(target._ShowWaterProxyPlane); + + // Scene view doesnt automatically refresh which makes the option confusing, so force it + EditorWindow view = EditorWindow.GetWindow(); + view.Repaint(); + } + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawGizmos(LodInput target, GizmoType type) + { + if (!target.Enabled) return; + + if (target._DrawBounds) + { + var rect = target.Rect; + if (rect != Rect.zero) + { + var water = WaterRenderer.Instance; + var height = water ? water.SeaLevel : target.transform.position.y; + Gizmos.color = Color.magenta; + Gizmos.DrawWireCube + ( + new(rect.center.x, height, rect.center.y), + new(rect.size.x, 0, rect.size.y) + ); + } + } + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawRendererGizmos(LodInput target, GizmoType type) + { + if (!target.Enabled) return; + if (target.Data is not RendererLodInputData data) return; + + var renderer = data._Renderer; + + if (renderer != null && renderer.TryGetComponent(out var mf)) + { + var transform = renderer.transform; + Gizmos.color = target.GizmoColor; + Gizmos.DrawWireMesh(mf.sharedMesh, transform.position, transform.rotation, transform.lossyScale); + } + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawGeometryGizmos(LodInput target, GizmoType type) + { + if (!target.Enabled) return; + if (target.Data is not GeometryLodInputData data) return; + + var geometry = data._Geometry; + + if (geometry != null) + { + var transform = target.transform; + Gizmos.color = target.GizmoColor; + Gizmos.DrawWireMesh(geometry, transform.position, transform.rotation, transform.lossyScale); + } + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawWatertightHullGizmos(WatertightHull target, GizmoType type) + { + if (!target.Enabled) return; + + var transform = target.transform; + + Gizmos.color = ClipLod.s_GizmoColor; + Gizmos.DrawMesh(target._Mesh, submeshIndex: 0, transform.position, transform.rotation, transform.lossyScale); + Gizmos.DrawWireMesh(target._Mesh, transform.position, transform.rotation, transform.lossyScale); + + if (target._Debug._DrawBounds) + { + var rect = target.Rect; + if (rect != Rect.zero) + { + var water = WaterRenderer.Instance; + var height = water ? water.SeaLevel : target.transform.position.y; + Gizmos.color = Color.magenta; + Gizmos.DrawWireCube + ( + new(rect.center.x, height, rect.center.y), + new(rect.size.x, 0, rect.size.y) + ); + } + } + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawTextureGizmos(LodInput target, GizmoType type) + { + if (!target.Enabled) return; + if (target.Data is not TextureLodInputData) return; + + Gizmos.color = target.GizmoColor; + Gizmos.matrix = Matrix4x4.TRS + ( + target.transform.position, + Quaternion.Euler(Vector3.up * target.transform.rotation.eulerAngles.y), + target.transform.lossyScale.XNZ() + ); + Gizmos.DrawWireCube(Vector3.zero, Vector3.one); + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawGizmos(ClipLodInput target, GizmoType type) + { + if (!target.Enabled) return; + Gizmos.color = target.GizmoColor; + + if (target.Mode == LodInputMode.Primitive) + { + Gizmos.matrix = target.transform.localToWorldMatrix; + + switch (target._Primitive) + { + case LodInputPrimitive.Sphere: + // Use Unity's UV sphere mesh for gizmos as Gizmos.DrawSphere is too low resolution. + // Render mesh and wire sphere at default size (0.5m radius) which is scaled by gizmo matrix. + Gizmos.DrawMesh(Helpers.SphereMesh, submeshIndex: 0, Vector3.zero, Quaternion.identity, Vector3.one); + Gizmos.DrawWireSphere(Vector3.zero, 0.5f); + break; + case LodInputPrimitive.Cube: + // Render mesh and wire box at default size which is scaled by gizmo matrix. + Gizmos.DrawCube(Vector3.zero, Vector3.one); + Gizmos.DrawWireCube(Vector3.zero, Vector3.one); + break; + case LodInputPrimitive.Quad: + // Face quad upwards. + Gizmos.matrix *= Matrix4x4.Rotate(Quaternion.AngleAxis(90, Vector3.right)); + Gizmos.DrawMesh(Helpers.QuadMesh, submeshIndex: 0, Vector3.zero, Quaternion.identity, Vector3.one); + Gizmos.DrawWireMesh(Helpers.QuadMesh, submeshIndex: 0, Vector3.zero, Quaternion.identity, Vector3.one); + break; + default: + Debug.LogError("Crest: Not a valid primitive type!"); + break; + } + } + } + + [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected)] + static void DrawGizmos(CollisionAreaVisualizer target, GizmoType type) + { + var water = WaterRenderer.Instance; + if (water == null) return; + target.Render(water, DrawLine); + } + + [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected)] + static void DrawGizmos(DepthProbe target, GizmoType type) + { +#if CREST_DEBUG + if (target._Debug._ShowSimulationDataInScene) + { + VisualizeMaterial.mainTexture = target.Texture; + VisualizeMaterial.SetPass(0); + Graphics.DrawMeshNow + ( + Helpers.QuadMesh, + Matrix4x4.TRS(target.Position, Quaternion.Euler(90f, 0, 0), target.Scale) + ); + } +#endif + + if (!type.HasFlag(GizmoType.Selected)) + { + return; + } + + // Lod Input gizmo. + Gizmos.matrix = Matrix4x4.TRS(target.Position, target.Rotation, target.Scale.XNZ(1f)); + Gizmos.color = DepthLod.s_GizmoColor; + Gizmos.DrawWireCube(Vector3.zero, new(1f, 0f, 1f)); + + if (target.Type == DepthProbeMode.RealTime) + { + Gizmos.color = Color.white; + + var scale = Vector3.one; + var position = Vector3.zero; + + position.y = Mathf.LerpUnclamped(target._CaptureRange.x, target._CaptureRange.y, target._CaptureRange.y / scale.y); + position.y *= 0.5f; + Gizmos.DrawWireCube(position, scale.XNZ(-target._CaptureRange.x + target._CaptureRange.y)); + + position.y = target._CaptureRange.y + target._FillHolesCaptureHeight * 0.5f; + Gizmos.DrawWireCube(position, scale.XNZ(target._FillHolesCaptureHeight)); + + var size = Gizmos.matrix.lossyScale.XZ(); + var offset = Vector3.one * 0.5f; + var height0 = target._CaptureRange.y; + var height1 = target._CaptureRange.x; + var height2 = target._CaptureRange.y + target._FillHolesCaptureHeight; + + DrawGrid(size, offset.XNZ(-height0)); + DrawGrid(size, offset.XNZ(-height1)); + DrawGrid(size, offset.XNZ(-height2)); + + Gizmos.color = new(1f, 1f, 1f, 0.2f); + Gizmos.DrawCube(Vector3.zero.XNZ(height0), Vector3.one.XNZ()); + Gizmos.DrawCube(Vector3.zero.XNZ(height1), Vector3.one.XNZ()); + Gizmos.DrawCube(Vector3.zero.XNZ(height2), Vector3.one.XNZ()); + } + } + + [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected)] + static void DrawGizmos(ShapeWaves target, GizmoType type) + { + if (!target.Enabled) return; + + if (target._DrawBounds) + { + // Render bounds. + var water = WaterRenderer.Instance; + var rect = target._Rect; + if (water != null && rect != null && target.Mode != LodInputMode.Global) + { + Gizmos.DrawWireCube(new(rect.center.x, water.SeaLevel, rect.center.y), new(rect.size.x, 0, rect.size.y)); + } + } + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawGizmos(SphereWaterInteraction target, GizmoType type) + { + Gizmos.color = DynamicWavesLod.s_GizmoColor; + Gizmos.DrawWireSphere(target.transform.position + target._VelocityOffset * target._Velocity, target._Radius); + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawGizmos(WaterBody target, GizmoType type) + { + var oldColor = Gizmos.color; + Gizmos.color = new(1f, 1f, 1f, 0.5f); + var center = target.AABB.center; + var size = 2f * new Vector3(target.AABB.extents.x, 1f, target.AABB.extents.z); + Gizmos.DrawCube(center, size); + Gizmos.color = Color.white; + Gizmos.DrawWireCube(center, size); + Gizmos.color = oldColor; + } + + [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected)] + static void DrawGizmos(WaterChunkRenderer target, GizmoType type) + { + if (target._DrawRenderBounds) + { + target.Rend.bounds.GizmosDraw(); + } + + if (!type.HasFlag(GizmoType.Selected)) + { + return; + } + + if (target.Rend != null) + { + target.Rend.bounds.GizmosDraw(); + } + + if (WaterBody.WaterBodies.Count > 0) + { + Gizmos.color = Color.green; + Gizmos.DrawWireCube + ( + target._UnexpandedBoundsXZ.center.XNZ(target.transform.position.y), + target._UnexpandedBoundsXZ.size.XNZ() + ); + } + } + + [DrawGizmo(GizmoType.Selected)] + static void DrawGizmos(FloatingObject target, GizmoType type) + { + if (!target.TryGetComponent(out var physics)) return; + + Gizmos.color = Color.yellow; + Gizmos.DrawCube(target.transform.TransformPoint(physics.centerOfMass), Vector3.one * 0.25f); + + if (target.Model != FloatingObjectModel.Probes) return; + + for (var i = 0; i < target._Probes.Length; i++) + { + var point = target._Probes[i]; + + var transformedPoint = target.transform.TransformPoint(point._Position + new Vector3(0, physics.centerOfMass.y, 0)); + + Gizmos.color = Color.red; + Gizmos.DrawCube(transformedPoint, Vector3.one * 0.5f); + } + } + + static void DrawGrid(Vector2 size, Vector3 offset) + { + var xPoints = new Vector3[Mathf.FloorToInt(size.x / 2f) * 2]; + var zPoints = new Vector3[Mathf.FloorToInt(size.y / 2f) * 2]; + var xCellSize = 1f / size.x; + var zCellSize = 1f / size.y; + var xSize = size.x; + var zSize = size.y; + + for (var x = 0; x < xPoints.Length; x += 2) + { + xPoints[x + 0] = new Vector3(x * xCellSize, 0, 0) - offset; + xPoints[x + 1] = new Vector3(x * xCellSize, 0, xSize * xCellSize) - offset; + } + + Gizmos.DrawLineList(xPoints); + + for (var z = 0; z < zPoints.Length; z += 2) + { + zPoints[z + 0] = new Vector3(0, 0, z * zCellSize) - offset; + zPoints[z + 1] = new Vector3(zSize * zCellSize, 0, z * zCellSize) - offset; + } + + Gizmos.DrawLineList(zPoints); + } + } + + static class BoundsHelper + { + internal static void GizmosDraw(this Bounds b) + { + var xmin = b.min.x; + var ymin = b.min.y; + var zmin = b.min.z; + var xmax = b.max.x; + var ymax = b.max.y; + var zmax = b.max.z; + + Gizmos.DrawLine(new(xmin, ymin, zmin), new(xmin, ymin, zmax)); + Gizmos.DrawLine(new(xmin, ymin, zmin), new(xmax, ymin, zmin)); + Gizmos.DrawLine(new(xmax, ymin, zmax), new(xmin, ymin, zmax)); + Gizmos.DrawLine(new(xmax, ymin, zmax), new(xmax, ymin, zmin)); + + Gizmos.DrawLine(new(xmin, ymax, zmin), new(xmin, ymax, zmax)); + Gizmos.DrawLine(new(xmin, ymax, zmin), new(xmax, ymax, zmin)); + Gizmos.DrawLine(new(xmax, ymax, zmax), new(xmin, ymax, zmax)); + Gizmos.DrawLine(new(xmax, ymax, zmax), new(xmax, ymax, zmin)); + + Gizmos.DrawLine(new(xmax, ymax, zmax), new(xmax, ymin, zmax)); + Gizmos.DrawLine(new(xmin, ymin, zmin), new(xmin, ymax, zmin)); + Gizmos.DrawLine(new(xmax, ymin, zmin), new(xmax, ymax, zmin)); + Gizmos.DrawLine(new(xmin, ymax, zmax), new(xmin, ymin, zmax)); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Gizmos.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Gizmos.cs.meta new file mode 100644 index 0000000..85c7d6a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Gizmos.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93b89233ebf2e4123858483445c37f78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations.meta new file mode 100644 index 0000000..6348edf --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a3e0b453103a74daca45936217eebd16 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia.meta new file mode 100644 index 0000000..e855382 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb1244c01f9e04d40886857fd9febf62 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/Assembly.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/Assembly.cs new file mode 100644 index 0000000..758e483 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/Assembly.cs @@ -0,0 +1,6 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Define empty namespaces for when assemblies are not present. + +namespace WaveHarmonic.Crest.ShallowWater { } diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/Assembly.cs.meta new file mode 100644 index 0000000..ed25b29 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a1364267b3de043daae23dda97c99063 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/GRC_Crest.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/GRC_Crest.cs new file mode 100644 index 0000000..273ca16 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/GRC_Crest.cs @@ -0,0 +1,259 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// This file is subject to the MIT License as seen in the root of this folder structure (LICENSE) + +using Gaia; +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.ShallowWater; + +namespace WaveHarmonic.Crest +{ + sealed class GRC_Crest : GaiaRuntimeComponent + { + [SerializeField] + bool _Wind = true; + + [SerializeField] + bool _Swell = true; + + [SerializeField] + bool _ShallowWater = true; + + GUIContent _HelpLink; + GUIContent _PanelLabel; + + /// + public override GUIContent PanelLabel + { + get + { + if (_PanelLabel == null || _PanelLabel.text == "") + { + _PanelLabel = new GUIContent("Crest Water", "Adds Crest Water to your scene."); + } + + return _PanelLabel; + } + } + + /// + public override void Initialize() + { + // Order components appear in the UI. Try to keep in alphabetical order. + m_orderNumber = 210; + + if (_HelpLink == null || _HelpLink.text == "") + { + _HelpLink = new GUIContent("Crest Online documentation", "Opens the documentation for the Crest Water System in your browser."); + } + } + + /// + public override void DrawUI() + { + // Displays "?" help button. + DisplayHelp + ( + "This module adds the Crest Water System to your scene. Please visit the link to learn more:", + _HelpLink, + "https://docs.crest.waveharmonic.com/About/Introduction.html" + ); + + EditorGUI.BeginChangeCheck(); + + { + _Swell = EditorGUILayout.Toggle("Swell Waves", _Swell); + DisplayHelp("Whether to add swell waves to the scene. Swell waves will come from conditions far away from the scene. Modify the component after creation to customize."); + + _Wind = EditorGUILayout.Toggle("Wind Waves", _Wind); + DisplayHelp("Whether to add wind waves to the scene. These waves are based on local wind conditions. Requires Gaia's Wind Zone (note that the defaul wind value will produce no waves). Modify the component after creation to customize."); + +#if d_WaveHarmonic_Crest_ShallowWater + _ShallowWater = EditorGUILayout.Toggle("Shoreline Simulation", _ShallowWater); + DisplayHelp("Whether to add a shoreline shallow water simulation to the scene. Modify the component after creation to customize."); +#endif + + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Remove")) RemoveFromScene(); + GUILayout.Space(15); + if (GUILayout.Button("Apply")) AddToScene(); + GUILayout.EndHorizontal(); + } + + if (EditorGUI.EndChangeCheck()) + { + EditorUtility.SetDirty(this); + } + } + + /// Called when either "Apply" or "Create Runtime" is pressed. + /// + public override void AddToScene() + { + // Re-initialize to keep user's changes. + var water = FindFirstObjectByType(FindObjectsInactive.Include); + + if (water == null) + { + water = new GameObject("Water").AddComponent(); + } + + // Sea level is height above terrain bottom. + var seaLevel = GaiaAPI.GetSeaLevel(); + + water.transform.position = new Vector3(0f, seaLevel, 0f); + + var managed = water.transform.Find("Managed"); + + if (managed == null) + { + managed = new GameObject("Managed").transform; + } + + managed.SetParent(water.transform, worldPositionStays: false); + + // Wind + if (_Wind) + { + var wind = FindFirstObjectByType(); + + if (wind != null) + { + water.WindZone = wind.GetComponent(); + } + } + + // Depth + water.DepthLod.IncludeTerrainHeight = false; + + foreach (var terrain in FindObjectsByType(FindObjectsInactive.Include, FindObjectsSortMode.None)) + { + var dp = terrain.GetComponentInChildren(includeInactive: true); + + if (dp == null) + { + dp = new GameObject("WaterDepthProbe").AddComponent(); + } + + dp.gameObject.layer = water.Surface.Layer; + dp.transform.SetParent(terrain.transform, worldPositionStays: false); + dp.transform.localPosition = terrain.terrainData.size * 0.5f; + var position = dp.transform.position; + position.y = seaLevel; + dp.transform.position = position; + dp.transform.localScale = new(terrain.terrainData.size.x, 1f, terrain.terrainData.size.z); + dp.Layers = 1 << terrain.gameObject.layer; + // 1m below terrain bottom to 1m above maximum terrain height. + dp.CaptureRange = new(-seaLevel + -1f, terrain.terrainData.size.y - seaLevel + 1); + dp.Resolution = terrain.terrainData.heightmapResolution - 1; + dp.Populate(); + } + + // Wind Waves + if (_Wind && water.WindZone != null) + { + GetOrAddComponentToScene(managed, "WaterWindWaves", out _); + } + else + { + RemoveComponentFromScene(managed); + } + + // Swell Waves + if (_Swell) + { + GetOrAddComponentToScene(managed, "WaterSwellWaves", out var waves); + + waves.OverrideGlobalWindDirection = true; + waves.OverrideGlobalWindSpeed = true; + waves.ReverseWaveWeight = 0; + waves.Swell = true; + + if (!waves.TryGetComponent(out var fft)) + { + fft = waves.gameObject.AddComponent(); + fft.Spectrum = AssetDatabase.LoadAssetAtPath("Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesSwell.asset"); + } + + fft.OverrideGlobalWindDirection = true; + fft.OverrideGlobalWindSpeed = true; + fft.OverrideGlobalWindTurbulence = true; + fft.WindAlignment = 0.5f; + } + else + { + RemoveComponentFromScene(managed); + } + +#if d_WaveHarmonic_Crest_ShallowWater + if (_ShallowWater) + { + water.FlowLod.Enabled = true; + + if (GetOrAddComponentToScene(managed, "ShorelineSimulation", out var sws)) + { + water.Surface.Material = AssetDatabase.LoadAssetAtPath("Packages/com.waveharmonic.crest/Runtime/Materials/Water (Flow).mat"); + sws.Width = 256; + } + + if (!sws.TryGetComponent(out var dp)) + { + dp = sws.gameObject.AddComponent(); + } + + dp.GenerateSignedDistanceField = false; + + sws.Preset = ShallowWaterSimulationPreset.Shoreline; + sws.Placement = Placement.Viewpoint; + sws.DynamicSeabed = true; + } + else + { + RemoveComponentFromScene(managed); + } +#endif + } + + bool GetOrAddComponentToScene(Transform managed, string name, out T component) where T : MonoBehaviour + { + component = managed.GetComponentInChildren(); + + var create = component == null; + + if (create) + { + component = new GameObject(name).AddComponent(); + component.transform.SetParent(managed.transform, worldPositionStays: false); + } + + return create; + } + + void RemoveComponentFromScene(Transform managed) where T : MonoBehaviour + { + var component = managed.GetComponentInChildren(); + + if (component != null) + { + DestroyImmediate(component.gameObject); + } + } + + /// Called when "Remove" is pressed. + /// + public override void RemoveFromScene() + { + var water = FindFirstObjectByType(FindObjectsInactive.Include); + if (water != null) DestroyImmediate(water.gameObject); + + foreach (var terrain in FindObjectsByType(FindObjectsInactive.Include, FindObjectsSortMode.None)) + { + var depthCache = terrain.GetComponentInChildren(includeInactive: true); + if (depthCache != null) DestroyImmediate(depthCache.gameObject); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/GRC_Crest.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/GRC_Crest.cs.meta new file mode 100644 index 0000000..1bcd3fd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/GRC_Crest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f9d5fab14f7242db80be581a62d53c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/WaveHarmonic.Crest.Integration.Gaia.asmdef b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/WaveHarmonic.Crest.Integration.Gaia.asmdef new file mode 100644 index 0000000..554564d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/WaveHarmonic.Crest.Integration.Gaia.asmdef @@ -0,0 +1,32 @@ +{ + "name": "WaveHarmonic.Crest.Integration.Gaia", + "rootNamespace": "", + "references": [ + "GUID:532136e3ad79fba44b9e7d74f4e53abe", + "GUID:cc49c744ac0d6fa459f6fb20f0066991", + "GUID:7c347618730f5467f86a58f333ce21df", + "GUID:98db37baed0fc4b73a47a9d66f791aae", + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:d365b04c036e04304a59ef9aa90b3924" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER", + "GAIA_2023" + ], + "versionDefines": [ + { + "name": "com.waveharmonic.crest.shallow-water", + "expression": "", + "define": "d_WaveHarmonic_Crest_ShallowWater" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/WaveHarmonic.Crest.Integration.Gaia.asmdef.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/WaveHarmonic.Crest.Integration.Gaia.asmdef.meta new file mode 100644 index 0000000..3e117d4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Integrations/Gaia/WaveHarmonic.Crest.Integration.Gaia.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1c4070cb1d689471b80e17ee7aa518e6 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialDrawers.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialDrawers.cs new file mode 100644 index 0000000..c9fe8f8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialDrawers.cs @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Repository of custom material property drawers. +// All drawers must be prefixed with Crest as they are global. + +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ + static class MaterialAttributes + { + internal sealed class MaterialAttribute + { + public Vector2Int _IntegerRange; + } + + internal static readonly Dictionary s_Common = new() + { + + }; + + internal static readonly Dictionary> s_Grouped = new() + { + { + UnderwaterRenderer.k_ShaderNameEffect, new() + { + { "_Crest_DataSliceOffset", new() { _IntegerRange = new(0, Lod.k_MaximumSlices - 2) } }, + } + }, + }; + } + + sealed class CrestIntegerRangeDrawer : MaterialPropertyDrawer + { + // Adapted from: + // https://github.com/Unity-Technologies/UnityCsReference/blob/b44c4cc9e4ce3dfa0bab2fe4bf7efae880c5a175/Editor/Mono/Inspector/MaterialEditor.cs#L1277-L1298 + public override void OnGUI(Rect position, MaterialProperty property, GUIContent label, MaterialEditor editor) + { + MaterialEditor.BeginProperty(position, property); + + EditorGUI.BeginChangeCheck(); + + // For range properties we want to show the slider so we adjust label width to use default width (setting it to 0) + // See SetDefaultGUIWidths where we set: EditorGUIUtility.labelWidth = GUIClip.visibleRect.width - EditorGUIUtility.fieldWidth - 17; + var oldLabelWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = 0f; + + var material = editor.target as Material; + var shader = material.shader; + + var attribute = MaterialAttributes.s_Grouped.GetValueOrDefault(shader.name, null)?.GetValueOrDefault(property.name, null); + attribute ??= MaterialAttributes.s_Common[property.name]; + + var newValue = EditorGUI.IntSlider(position, label, property.intValue, attribute._IntegerRange.x, attribute._IntegerRange.y); + + EditorGUIUtility.labelWidth = oldLabelWidth; + + if (EditorGUI.EndChangeCheck()) + { + property.intValue = newValue; + } + + MaterialEditor.EndProperty(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialDrawers.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialDrawers.cs.meta new file mode 100644 index 0000000..7cda33a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialDrawers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5c616b1730474d5f99e11c506d35e9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialTooltips.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialTooltips.cs new file mode 100644 index 0000000..38eebcb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialTooltips.cs @@ -0,0 +1,353 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEditor.Rendering; +using UnityEditor.Rendering.HighDefinition; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ + static class MaterialTooltips + { + internal static readonly Dictionary s_Common = new() + { + // Feather + { "_Crest_Feather", "Feather the edges of the mesh using the texture coordinates. Easiest to understand with a plane" }, + { "_Crest_FeatherWidth", "How far from edge to feather" }, + }; + + internal static readonly Dictionary> s_Grouped = new() + { + { + "Crest/Inputs/Animated Waves/Add From Texture", new() + { + { "_Crest_HeightsOnly", "Treats the texture as a heightmap and reads from the R channel" }, + } + }, + { + "Crest/Inputs/Flow/Add From Texture", new() + { + { "_Crest_FlipX", "Flips the X direction (R channel)" }, + { "_Crest_FlipZ", "Flips the Z direction (Y channel)" }, + { "_Crest_NegativeValues", "Whether the texture supports negative values otherwise assumes data is packed in 0-1 range" }, + } + }, + { + "Crest/Inputs/All/Scale", new() + { + { "_Crest_Scale", "Scale the water data. Zero is no data and one leaves data untouched" }, + { "_Crest_ApplyTexture", "Use the texture instead of the scale value" }, + { "_Crest_Invert", "Inverts the scale value" }, + } + }, + { + "Crest/Inputs/Shape Waves/Add From Geometry", new() + { + { "_Crest_FeatherWaveStart", "Controls ramp distance over which waves grow/fade as they move forwards" }, + } + }, + { + UnderwaterRenderer.k_ShaderNameEffect, new() + { + { "_Crest_ExtinctionMultiplier", "Scales the depth fog density. Useful to reduce the intensity of the depth fog when underwater only" }, + { "_Crest_SunBoost", "Boost the intensity of the sun scattering" }, + { "_Crest_OutScatteringFactor", "Applied to the water depth when calculating out-scattering. Less means it gets darker deeper" }, + { "_Crest_OutScatteringExtinctionFactor", "Applied to the distance where the out-scattering gradient is calculated. Lower decreases out-scattering influence" }, + { "_Crest_DitheringEnabled", "Dithering will reduce banding" }, + { "_Crest_DitheringIntensity", "Increase if banding persists" }, + { "_Crest_MeniscusEnabled", "Add a meniscus to the boundary between water and air" }, + { "_Crest_DataSliceOffset", "How much to smooth water data such as water depth, light scattering, shadowing. Helps to smooth flickering that can occur under camera motion" }, + } + }, + { + WaterShaderUtility.k_ShaderName, new() + { + { "_Crest_NormalsStrengthOverall", "Strength of the final surface normal (both wave normal and normal map)" }, + { "_Crest_NormalMapEnabled", "Whether to add normal detail from a texture. Can be used to add visual detail to the water surface" }, + { "_Crest_NormalMapTexture", "Normal map texture" }, + { "_Crest_NormalMapStrength", "Strength of normal map influence" }, + { "_Crest_NormalMapScale", "Base scale of multi-scale normal map texture" }, + { "_Crest_NormalMapScrollSpeed", "Speed of the normal maps scrolling" }, + { "_Crest_AbsorptionColor", "Works as a color (ie red adds red rather than subtracts red). This value is converted to real absorption values (proportion of light getting absorbed by water in atoms per meter). Alpha channel is for density. High alpha and darker color reduces transparency" }, + { "_Crest_Scattering", "Light scattered by the water towards the viewer (in-scattered) per meter. Brighter color reduces transparency" }, + { "_Crest_Anisotropy", "The directionality of the scattering where zero means scattered in all directions. The further towards one, the less visible soft shadows will be" }, + { "_Crest_DirectTerm", "Scale direct light contribution to volume lighting" }, + { "_Crest_AmbientTerm", "Scale ambient light contribution to volume lighting" }, + { "_Crest_SSSEnabled", "Whether to to emulate light scattering through waves" }, + { "_Crest_SSSIntensity", "Direct light contribution intensity. Applied to the scattering color. This effect is best if subtle" }, + { "_Crest_SSSPinchMinimum", "Higher the value the more scattering is towards the peaks of the waves" }, + { "_Crest_SSSPinchMaximum", "Higher the value for more scattering" }, + { "_Crest_SSSPinchFalloff", "Falloff for pinch minimum/maximum" }, + { "_Crest_SSSDirectionalFalloff", "Falloff for direct light scattering to affect directionality" }, + { "_Crest_Specular", "Strength of specular lighting response" }, + { "_Crest_Occlusion", "Strength of reflection" }, + { "_Crest_OcclusionUnderwater", "Strength of reflection when underwater. Keep this at zero to avoid skybox reflections which look incorrect when underwater, unless you want reflections from Planar Reflections or probes" }, + { "_Crest_Smoothness", "Smoothness of surface. A value of one is ideal for flat water only" }, + { "_Crest_SmoothnessFar", "Material smoothness at far distance from camera. Helps to spread out specular highlight in mid-to-background. From a theory point of view, models transfer of normal detail to microfacets in BRDF" }, + { "_Crest_SmoothnessFarDistance", "Definition of far distance" }, + { "_Crest_SmoothnessFalloff", "How smoothness varies between near and far distance" }, + { "_Crest_MinimumReflectionDirectionY", "Limits the reflection direction on the Y axis. Zero prevents reflections below the horizon. Small values above zero can be used to reduce horizon reflection contributions. Values above zero will negatively affect dynamic reflections like planar or SSR" }, + { "_Crest_PlanarReflectionsEnabled", "Dynamically rendered 'reflection plane' style reflections. Requires Reflections to be enabled on the Water Renderer" }, + { "_Crest_PlanarReflectionsIntensity", "Intensity of the planar reflections" }, + { "_Crest_PlanarReflectionsDistortion", "How much the water normal affects the planar reflection" }, + { "_Crest_PlanarReflectionsRoughness", "Controls the mipmap range" }, + { "_Crest_RefractionStrength", "How strongly light is refracted when passing through water surface" }, + { "_Crest_RefractiveIndexOfWater", "Index of refraction of water - typically left at 1.333. Changing this value can increase/decrease the size of the Snell's window" }, + { "_Crest_TotalInternalReflectionIntensity", "Zero will make the underwater reflections transparent. Slightly semi-transparency is a zero performance cost alternative to TIR" }, + { "_Crest_ShadowsEnabled", "Whether to receive shadow data. Does not affect shadow contributions from Unity" }, + { "_Crest_ShadowCasterThreshold", "Same concept as Alpha Clip Threshold but for foam casted shadows" }, + { "_Crest_FoamEnabled", "Enable foam layer on water surface" }, + { "_Crest_FoamTexture", "Foam texture" }, + { "_Crest_FoamScale", "Scale of multi-scale foam texture" }, + { "_Crest_FoamScrollSpeed", "Speed of the foam scrolling. This speed is slower than the other scroll speeds, as it scrolls in one direction only" }, + { "_Crest_FoamFeather", "Controls how gradual the transition is from full foam to no foam. Higher values look more realistic and can help mitigate flow phasing" }, + { "_Crest_FoamIntensityAlbedo", "Scale intensity of diffuse lighting" }, + { "_Crest_FoamSmoothness", "Smoothness of foam material" }, + { "_Crest_FoamNormalStrength", "Strength of the generated normals" }, + { "_Crest_CausticsEnabled", "Approximate rays being focused/defocused on underwater surfaces" }, + { "_Crest_CausticsTexture", "Caustics texture" }, + { "_Crest_CausticsStrength", "Intensity of caustics effect" }, + { "_Crest_CausticsTextureScale", "Caustics texture scale" }, + { "_Crest_CausticsScrollSpeed", "Speed of the caustics scrolling" }, + { "_Crest_CausticsTextureAverage", "The 'mid' value of the caustics texture, around which the caustic texture values are scaled. Decreasing this value will reduce the caustics darkening underwater surfaces" }, + { "_Crest_CausticsFocalDepth", "The depth at which the caustics are in focus" }, + { "_Crest_CausticsDepthOfField", "The range of depths over which the caustics are in focus" }, + { "_Crest_CausticsDistortionTexture", "Texture to distort caustics. Only applicable to underwater effect for now" }, + { "_Crest_CausticsDistortionStrength", "How much the caustics texture is distorted" }, + { "_Crest_CausticsDistortionScale", "The scale of the distortion pattern used to distort the caustics" }, + { "_Crest_CausticsMotionBlur", "How much caustics are blurred when advected by flow" }, + { "CREST_FLOW", "Flow is horizontal motion of water. Flow must be enabled on the Water Renderer to generate flow data" }, + { "_Crest_AlbedoEnabled", "Enable the Albedo simulation layer. Albedo must be enabled on the Water" }, + { "_Crest_AlbedoIgnoreFoam", "Whether Albedo renders over the top of foam or not." }, + } + }, + }; + } + + static class WaterShaderUtility + { + public const string k_ShaderName = "Crest/Water"; + + internal static void UpdateAbsorptionFromColor(Material material) + { + if (!material.HasProperty(WaterRenderer.ShaderIDs.s_Absorption) || !material.HasProperty(WaterRenderer.ShaderIDs.s_AbsorptionColor)) + { + return; + } + + // Convert an authored absorption colour to density values. + WaterRenderer.UpdateAbsorptionFromColor(material); + + if (!material.IsPropertyOverriden(WaterRenderer.ShaderIDs.s_AbsorptionColor)) + { + material.RevertPropertyOverride(WaterRenderer.ShaderIDs.s_Absorption); + } + } + + internal static MaterialProperty[] FilterProperties(MaterialProperty[] properties) + { + // Show specular control. + var specular = true; + + if (!RenderPipelineHelper.IsHighDefinition) + { + specular = properties + .First(x => x.name == (RenderPipelineHelper.IsLegacy ? "_BUILTIN_WorkflowMode" : "_WorkflowMode")).floatValue == 0; + } +#if UNITY_6000_0_OR_NEWER + else + { + // Always show specular control for U5, as it cannot be overriden by the material. + specular = properties + .First(x => x.name == "_MaterialID").floatValue == 4; + } +#endif + + return properties + .Where(x => (specular || x.name != "_Crest_Specular") && x.name != "_Crest_Absorption") + .ToArray(); + } + } + + /// + /// Supports tooltips and skips rendering render pipeline properties like "Queue". + /// + sealed class CustomShaderGUI : ShaderGUI + { + static readonly GUIContent s_Label = new(); + + public override void OnMaterialPreviewGUI(MaterialEditor materialEditor, Rect r, GUIStyle background) + { + + } + + public override void OnGUI(MaterialEditor editor, MaterialProperty[] properties) + { + var material = editor.target as Material; + var shader = material.shader; + var grouped = MaterialTooltips.s_Grouped.GetValueOrDefault(shader.name, null); + + WaterShaderUtility.UpdateAbsorptionFromColor((Material)editor.target); + + foreach (var property in properties) + { +#if UNITY_6000_2_OR_NEWER + if ((property.propertyFlags & UnityEngine.Rendering.ShaderPropertyFlags.HideInInspector) != 0) continue; +#else + if ((property.flags & MaterialProperty.PropFlags.HideInInspector) != 0) continue; +#endif + + var name = property.name; + s_Label.text = property.displayName; + s_Label.tooltip = grouped?.GetValueOrDefault(name, null); + s_Label.tooltip ??= MaterialTooltips.s_Common.GetValueOrDefault(name, null); + editor.ShaderProperty(property, s_Label); + } + } + } + +#if d_UnityShaderGraph + class LegacyCustomShaderGUI : ShaderGraph.CustomBuiltInLitGUI + { + MaterialEditor _Editor; + MaterialProperty[] _Properties; + protected string _ShaderName; + + public override void OnMaterialPreviewGUI(MaterialEditor materialEditor, Rect r, GUIStyle background) + { + + } + + public override void OnGUI(MaterialEditor editor, MaterialProperty[] properties) + { + properties = properties.Where(x => x.name != "_Crest_Version").ToArray(); + + _Editor = editor; + _Properties = properties; + base.OnGUI(editor, properties); + } + + protected override void DrawSurfaceInputs(Material material) + { + ShaderGraphPropertyDrawers.DrawShaderGraphGUI(_Editor, _Properties, MaterialTooltips.s_Grouped[_ShaderName]); + } + } + + // Warning! Renaming this class is a breaking change due to users potentially + // exporting the shader to integrate with other assets. + sealed class LegacyWaterShaderGUI : LegacyCustomShaderGUI + { + public override void OnGUI(MaterialEditor editor, MaterialProperty[] properties) + { + _ShaderName = WaterShaderUtility.k_ShaderName; + properties = WaterShaderUtility.FilterProperties(properties); + + base.OnGUI(editor, properties); + WaterShaderUtility.UpdateAbsorptionFromColor(editor.target as Material); + } + } + +#if d_UnityURP + class UniversalCustomShaderGUI : ShaderGraphLitGUI + { + MaterialEditor _Editor; + MaterialProperty[] _Properties; + protected string _ShaderName; + + public override void OnMaterialPreviewGUI(MaterialEditor materialEditor, Rect r, GUIStyle background) + { + + } + + public override void OnGUI(MaterialEditor editor, MaterialProperty[] properties) + { + properties = properties.Where(x => x.name != "_Crest_Version").ToArray(); + + _Editor = editor; + _Properties = properties; + + base.OnGUI(editor, properties); + } + + public override void DrawSurfaceInputs(Material material) + { + ShaderGraphPropertyDrawers.DrawShaderGraphGUI(_Editor, _Properties, MaterialTooltips.s_Grouped[_ShaderName]); + } + } + + // Warning! Renaming this class is a breaking change due to users potentially + // exporting the shader to integrate with other assets. + sealed class UniversalWaterShaderGUI : UniversalCustomShaderGUI + { + public override void OnGUI(MaterialEditor editor, MaterialProperty[] properties) + { + _ShaderName = WaterShaderUtility.k_ShaderName; + properties = WaterShaderUtility.FilterProperties(properties); + + base.OnGUI(editor, properties); + WaterShaderUtility.UpdateAbsorptionFromColor(editor.target as Material); + } + } +#endif // d_UnityURP + +#if d_UnityHDRP + sealed class CustomShaderGraphUIBlock : MaterialUIBlock + { + public override void LoadMaterialProperties() { } + + public override void OnGUI() + { + using var header = new MaterialHeaderScope("Exposed Properties", (uint)ExpandableBit.ShaderGraph, materialEditor); + + if (!header.expanded) + { + return; + } + + var name = (materialEditor.customShaderGUI as HighDefinitionCustomShaderGUI)._ShaderName; + ShaderGraphPropertyDrawers.DrawShaderGraphGUI(materialEditor, properties, MaterialTooltips.s_Grouped[name]); + } + } + + class HighDefinitionCustomShaderGUI : LightingShaderGraphGUI + { + internal string _ShaderName; + + public HighDefinitionCustomShaderGUI() + { + // Add refraction block. + uiBlocks.Insert(1, new TransparencyUIBlock(MaterialUIBlock.ExpandableBit.Transparency, TransparencyUIBlock.Features.Refraction)); + // Remove the ShaderGraphUIBlock to avoid having duplicated properties in the UI. + uiBlocks.RemoveAll(x => x is ShaderGraphUIBlock); + // Insert the custom block just after the Surface Option block. + uiBlocks.Insert(1, new CustomShaderGraphUIBlock()); + } + + protected override void OnMaterialGUI(MaterialEditor editor, MaterialProperty[] properties) + { + properties = properties.Where(x => x.name != "_Crest_Version").ToArray(); + + base.OnMaterialGUI(editor, properties); + WaterShaderUtility.UpdateAbsorptionFromColor(editor.target as Material); + } + } + + // Warning! Renaming this class is a breaking change due to users potentially + // exporting the shader to integrate with other assets. + sealed class HighDefinitionWaterShaderGUI : HighDefinitionCustomShaderGUI + { + protected override void OnMaterialGUI(MaterialEditor editor, MaterialProperty[] properties) + { + _ShaderName = WaterShaderUtility.k_ShaderName; + properties = WaterShaderUtility.FilterProperties(properties); + + base.OnMaterialGUI(editor, properties); + WaterShaderUtility.UpdateAbsorptionFromColor(editor.target as Material); + } + } +#endif // d_UnityHDRP +#endif // d_UnityShaderGraph +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialTooltips.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialTooltips.cs.meta new file mode 100644 index 0000000..60a3438 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/MaterialTooltips.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03f27e0acbab243d09a4e509eb3777fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/OptionalLod.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/OptionalLod.cs new file mode 100644 index 0000000..dbe4819 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/OptionalLod.cs @@ -0,0 +1,164 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; + +namespace WaveHarmonic.Crest.Editor +{ + class OptionalLod + { + internal string _MaterialProperty; + + internal string PropertyName { get; private set; } + internal string PropertyLabel { get; private set; } + internal System.Type Dependency { get; private set; } + + internal Lod GetLod(WaterRenderer water) => PropertyName switch + { + nameof(WaterRenderer._AbsorptionLod) => water.AbsorptionLod, + nameof(WaterRenderer._AlbedoLod) => water.AlbedoLod, + nameof(WaterRenderer._AnimatedWavesLod) => water.AnimatedWavesLod, + nameof(WaterRenderer._ClipLod) => water.ClipLod, + nameof(WaterRenderer._DepthLod) => water.DepthLod, + nameof(WaterRenderer._DynamicWavesLod) => water.DynamicWavesLod, + nameof(WaterRenderer._FlowLod) => water.FlowLod, + nameof(WaterRenderer._FoamLod) => water.FoamLod, + nameof(WaterRenderer._LevelLod) => water.LevelLod, + nameof(WaterRenderer._ScatteringLod) => water.ScatteringLod, + nameof(WaterRenderer._ShadowLod) => water.ShadowLod, + _ => throw new System.NotImplementedException(), + }; + + + // Optional. Not all simulations will have a corresponding keyword. + internal bool HasMaterialToggle => !string.IsNullOrEmpty(MaterialProperty); + + // Needed as clip surface material toggle is Alpha Clipping. + internal virtual string MaterialProperty => _MaterialProperty; + internal virtual string MaterialPropertyPath => $"{PropertyLabel} > Enabled"; + internal virtual string MaterialKeyword => $"{MaterialProperty}_ON"; + + internal static OptionalLod Get(System.Type type) + { + return s_Lods.GetValueOrDefault(s_Mapping.GetValueOrDefault(type, type), null); + } + + static readonly Dictionary s_Lods = new() + { + { + typeof(AbsorptionLod), new ColorOptionLod() + { + PropertyLabel = "Absorption", + PropertyName = nameof(WaterRenderer._AbsorptionLod), + } + }, + { + typeof(AlbedoLod), new() + { + PropertyLabel = "Albedo", + PropertyName = nameof(WaterRenderer._AlbedoLod), + _MaterialProperty = "_Crest_AlbedoEnabled", + } + }, + { + typeof(AnimatedWavesLod), new() + { + PropertyLabel = "Animate Waves", + PropertyName = nameof(WaterRenderer._AnimatedWavesLod), + } + }, + { + typeof(ClipLod), new ClipOptionalLod() + { + PropertyLabel = "Clip Surface", + PropertyName = nameof(WaterRenderer._ClipLod), + } + }, + { + typeof(DepthLod), new() + { + PropertyLabel = "Water Depth", + PropertyName = nameof(WaterRenderer._DepthLod), + } + }, + { + typeof(DynamicWavesLod), new() + { + PropertyLabel = "Dynamic Waves", + PropertyName = nameof(WaterRenderer._DynamicWavesLod), + Dependency = typeof(AnimatedWavesLod), + } + }, + { + typeof(FlowLod), new() + { + PropertyLabel = "Flow", + PropertyName = nameof(WaterRenderer._FlowLod), + _MaterialProperty = "CREST_FLOW", + } + }, + { + typeof(FoamLod), new() + { + PropertyLabel = "Foam", + PropertyName = nameof(WaterRenderer._FoamLod), + _MaterialProperty = "_Crest_FoamEnabled", + } + }, + { + typeof(LevelLod), new() + { + PropertyLabel = "Water Level", + PropertyName = nameof(WaterRenderer._LevelLod), + _MaterialProperty = "_Crest_LevelEnabled", + Dependency = typeof(AnimatedWavesLod), + + } + }, + { + typeof(ScatteringLod), new ColorOptionLod() + { + PropertyLabel = "Scattering", + PropertyName = nameof(WaterRenderer._ScatteringLod), + } + }, + { + typeof(ShadowLod), new() + { + PropertyLabel = "Shadow", + PropertyName = nameof(WaterRenderer._ShadowLod), + _MaterialProperty = "_Crest_ShadowsEnabled", + } + }, + }; + + static readonly Dictionary s_Mapping = new() + { + { typeof(AbsorptionLodInput), typeof(AbsorptionLod) }, + { typeof(AlbedoLodInput), typeof(AlbedoLod) }, + { typeof(AnimatedWavesLodInput), typeof(AnimatedWavesLod) }, + { typeof(ClipLodInput), typeof(ClipLod) }, + { typeof(DepthLodInput), typeof(DepthLod) }, + { typeof(DynamicWavesLodInput), typeof(DynamicWavesLod) }, + { typeof(FlowLodInput), typeof(FlowLod) }, + { typeof(FoamLodInput), typeof(FoamLod) }, + { typeof(LevelLodInput), typeof(LevelLod) }, + { typeof(ScatteringLodInput), typeof(ScatteringLod) }, + { typeof(ShadowLodInput), typeof(ShadowLod) }, + }; + } + + sealed class ClipOptionalLod : OptionalLod + { + // BIRP SG has prefixes for Unity properties but other RPs do not. These prefixes + // are for serialisation only and are not used in the shader. + internal override string MaterialPropertyPath => "Alpha Clipping"; + internal override string MaterialProperty => (RenderPipelineHelper.IsLegacy ? "_BUILTIN" : "") + "_AlphaClip"; + internal override string MaterialKeyword => (RenderPipelineHelper.IsLegacy ? "_BUILTIN" : "") + "_ALPHATEST_ON"; + } + + sealed class ColorOptionLod : OptionalLod + { + internal override string MaterialPropertyPath => $"Volume Lighting > Sample {PropertyLabel} Simulation"; + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/OptionalLod.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/OptionalLod.cs.meta new file mode 100644 index 0000000..bcca5c6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/OptionalLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8aa89e81afc448e38e1e4a046cdfacc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Previews.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Previews.cs new file mode 100644 index 0000000..ef39fdb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Previews.cs @@ -0,0 +1,296 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ + // + // Lod + // + + abstract class LodPreview : TexturePreview + { + protected abstract Lod Lod { get; } + protected abstract bool VisualizeNegatives { get; } + protected virtual bool ForceAlpha => false; + public override GUIContent GetPreviewTitle() => new(Lod.Name); + protected RenderTexture _TemporaryTexture; + protected override Texture OriginalTexture + { + get + { + var water = (WaterRenderer)target; + + if ((!Application.isPlaying && !water.runInEditMode) || !water.isActiveAndEnabled) + { + return null; + } + + if (!Lod.Enabled) + { + return null; + } + + var texture = Lod.DataTexture; + + if (texture == null) + { + return null; + } + + return texture; + } + } + + protected override Texture ModifiedTexture => _TemporaryTexture; + + public override void OnPreviewSettings() + { + base.OnPreviewSettings(); + // OnPreviewSettings is called after OnPreviewGUI so release here. + RenderTexture.ReleaseTemporary(_TemporaryTexture); + _TemporaryTexture = null; + } + + public override void OnPreviewGUI(Rect rect, GUIStyle background) + { + var texture = Lod.DataTexture; + var descriptor = texture.descriptor; + _TemporaryTexture = RenderTexture.GetTemporary(descriptor); + _TemporaryTexture.name = "Crest Preview (Temporary)"; + Graphics.CopyTexture(texture, _TemporaryTexture); + + if (VisualizeNegatives) + { + var wrapper = new PropertyWrapperComputeStandalone(EditorHelpers.VisualizeNegativeValuesShader, 1); + wrapper.SetTexture(ShaderIDs.s_Target, _TemporaryTexture); + wrapper.Dispatch + ( + Lod.Resolution / Lod.k_ThreadGroupSizeX, + Lod.Resolution / Lod.k_ThreadGroupSizeY, + Lod.Slices + ); + } + + ModifyTexture(); + + if (ForceAlpha) + { + // Set alpha to one otherwise it shows nothing when set to RGB. + var clear = WaterResources.Instance.Compute._Clear; + if (clear != null) + { + clear.SetTexture(0, ShaderIDs.s_Target, _TemporaryTexture); + clear.SetVector(ShaderIDs.s_ClearMask, Color.black); + clear.SetVector(ShaderIDs.s_ClearColor, Color.black); + clear.Dispatch + ( + 0, + Lod.Resolution / Lod.k_ThreadGroupSizeX, + Lod.Resolution / Lod.k_ThreadGroupSizeY, + Lod.Slices + ); + } + } + + base.OnPreviewGUI(rect, background); + } + + + protected virtual void ModifyTexture() + { + + } + + public override void Cleanup() + { + base.Cleanup(); + RenderTexture.ReleaseTemporary(_TemporaryTexture); + } + + // FIXME: Without constructor Unity complains: + // WaveHarmonic.Crest.Editor.LodPreview does not contain a default constructor, it + // will not be registered as a preview handler. Use the Initialize function to set + // up your object instead. + public LodPreview() { } + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class AbsorptionLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._AbsorptionLod; + protected override bool VisualizeNegatives => false; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class AlbedoLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._AlbedoLod; + protected override bool VisualizeNegatives => false; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class AnimatedWavesLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._AnimatedWavesLod; + protected override bool VisualizeNegatives => true; + protected override bool ForceAlpha => true; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class ClipLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._ClipLod; + protected override bool VisualizeNegatives => false; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class DepthLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._DepthLod; + protected override bool VisualizeNegatives => true; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class DynamicWavesLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._DynamicWavesLod; + // Negatives do not visualize well, and obscure positives too much. + protected override bool VisualizeNegatives => false; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class FlowLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._FlowLod; + protected override bool VisualizeNegatives => true; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class FoamLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._FoamLod; + protected override bool VisualizeNegatives => false; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class LevelLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._LevelLod; + protected override bool VisualizeNegatives => true; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class ScatteringLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._ScatteringLod; + protected override bool VisualizeNegatives => false; + protected override bool ForceAlpha => true; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class ShadowLodPreview : LodPreview + { + protected override Lod Lod => (target as WaterRenderer)._ShadowLod; + protected override bool VisualizeNegatives => false; + } + + + // + // LodInput + // + + // Adding abstract causes exception: + // does not contain a default constructor, it will not be registered as a preview + // handler. Use the Initialize function to set up your object instead. + class ShapeWavesPreview : TexturePreview + { + public override GUIContent GetPreviewTitle() => new($"{target.GetType().Name}: Wave Buffer"); + protected override Texture OriginalTexture => (target as ShapeWaves).WaveBuffer; + } + + [CustomPreview(typeof(ShapeFFT))] + sealed class ShapeFFTPreview : ShapeWavesPreview + { + } + + [CustomPreview(typeof(ShapeGerstner))] + sealed class ShapeGerstnerPreview : ShapeWavesPreview + { + } + + [CustomPreview(typeof(DepthProbe))] + sealed class DepthProbePreview : TexturePreview + { + public override GUIContent GetPreviewTitle() => new("Depth Probe"); + protected override Texture OriginalTexture => (target as DepthProbe).Texture; + } + +#if CREST_DEBUG + [CustomPreview(typeof(DepthProbe))] + sealed class DepthProbeCameraPreview : TexturePreview + { + public override GUIContent GetPreviewTitle() => new("Depth Probe: Camera"); + protected override Texture OriginalTexture + { + get + { + var target = this.target as DepthProbe; + if (target._Camera == null) return null; + return target._Camera.targetTexture; + } + } + } +#endif + + + // + // Other + // + +#if CREST_DEBUG + [CustomPreview(typeof(WaterRenderer))] + sealed class WaterLevelDepthPreview : TexturePreview + { + public override GUIContent GetPreviewTitle() => new("Water Level Screen-Space Depth"); + protected override Texture OriginalTexture => (target as WaterRenderer).Surface.WaterLevelDepthTexture; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class WaterLinePreview : TexturePreview + { + public override GUIContent GetPreviewTitle() => new("Pre-Computed Displacement"); + protected override Texture OriginalTexture => (target as WaterRenderer).Surface.HeightRT; + } + + [CustomPreview(typeof(WaterRenderer))] + sealed class WaterVolumeMaskPreview : TexturePreview + { + public override GUIContent GetPreviewTitle() => new("Water Volume Mask"); + protected override Texture OriginalTexture + { + get + { + var target = this.target as WaterRenderer; + return target._Mask?.ColorT != null && target._Mask?.ColorT.width > 0 + ? target._Mask.ColorT + : null; + } + } + } +#endif + + [CustomPreview(typeof(WaterRenderer))] + sealed class ReflectionPreview : TexturePreview + { + static readonly PropertyInfo s_DefaultReflection = typeof(RenderSettings).GetProperty("defaultReflection", BindingFlags.NonPublic | BindingFlags.Static); + + public override GUIContent GetPreviewTitle() => new("Water Reflections"); + protected override Texture OriginalTexture => (target as WaterRenderer)._Reflections._Enabled + ? (target as WaterRenderer)._Reflections.ReflectionTexture + : s_DefaultReflection?.GetValue(null) as Texture; + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Previews.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Previews.cs.meta new file mode 100644 index 0000000..0ad2eda --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Previews.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d305aa5a62d74c33bd73632e91b5ca8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/ProjectSettings.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/ProjectSettings.cs new file mode 100644 index 0000000..7697c57 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/ProjectSettings.cs @@ -0,0 +1,275 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.IO; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; + +namespace WaveHarmonic.Crest.Editor.Settings +{ + [FilePath(k_Path, FilePathAttribute.Location.ProjectFolder)] + sealed class ProjectSettings : ScriptableSingleton + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#pragma warning disable IDE0032 // Use auto property + + [@Heading("Variant Stripping", Heading.Style.Settings)] + + [@Group] + + [@DecoratedField, SerializeField] + bool _DebugEnableStrippingLogging; + + [@Predicated(nameof(_DebugEnableStrippingLogging))] + [@DecoratedField, SerializeField] + bool _DebugOnlyLogRemainingVariants; + + [Tooltip("Whether to strip broken variants.\n\nCurrently, the only known case is the point cookie variant being broken on Xbox.")] + [@DecoratedField, SerializeField] + bool _StripBrokenVariants = true; + + [@Heading("Features", Heading.Style.Settings)] + + [@Group] + + [Tooltip("Whether to use full precision sampling for half precision platforms (typically mobile).\n\nThis will solve rendering artifacts like minor bumps and staircasing.")] + [@DecoratedField, SerializeField] + bool _FullPrecisionDisplacementOnHalfPrecisionPlatforms = true; + + [Tooltip("Whether to render atmospheric scattering (ie fog) for pixels receiving aquatic scattering (underwater only).\n\nWhen disabled, if a pixel is receiving aquatic scattering, then it will not receive atmospheric scattering.")] + [@DecoratedField, SerializeField] + bool _RenderAtmosphericScatteringWhenUnderWater; + + [Tooltip("Renders the underwater effect after transparency and uses the more expensive mask.\n\nYou may need this if rendering the underwater to multiple cameras. The other benefit is that transparent objects will be fogged (albeit incorrectly).\n\nThe downsides are that there can be artifacts if waves are very choppy, has a less impressive meniscus, and generally more expensive to execute.")] + [@DecoratedField, SerializeField] + bool _LegacyUnderwater; + +#pragma warning restore IDE0032 // Use auto property + + internal const string k_Path = "ProjectSettings/Packages/com.waveharmonic.crest/Settings.asset"; + + internal enum State + { + Dynamic, + Disabled, + Enabled, + } + + internal static ProjectSettings Instance => instance; + + internal bool StripBrokenVariants => _StripBrokenVariants; + internal bool DebugEnableStrippingLogging => _DebugEnableStrippingLogging; + internal bool LogStrippedVariants => _DebugEnableStrippingLogging && !_DebugOnlyLogRemainingVariants; + internal bool LogKeptVariants => _DebugEnableStrippingLogging && _DebugOnlyLogRemainingVariants; + internal bool FullPrecisionDisplacementOnHalfPrecisionPlatforms => _FullPrecisionDisplacementOnHalfPrecisionPlatforms; + internal bool RenderAtmosphericScatteringWhenUnderWater => _RenderAtmosphericScatteringWhenUnderWater; + internal bool LegacyUnderwater => _LegacyUnderwater; + + + void OnEnable() + { + // Fixes not being editable. + hideFlags = HideFlags.HideAndDontSave & ~HideFlags.NotEditable; + } + + + internal static void Save() + { + instance.Save(saveAsText: true); + } + + [@OnChange(skipIfInactive: false)] + void OnChange(string path, object previous) + { + switch (path) + { + case nameof(_FullPrecisionDisplacementOnHalfPrecisionPlatforms): + case nameof(_RenderAtmosphericScatteringWhenUnderWater): + case nameof(_LegacyUnderwater): + UpdateSymbols(); + break; + } + } + + void UpdateScriptingSymbols() + { + ScriptingSymbols.Set(ProjectSymbols.k_LegacyUnderwaterScriptingSymbol, _LegacyUnderwater); + } + + void UpdateSymbols() + { + UpdateScriptingSymbols(); + ShaderSettingsGenerator.Generate(); + } + + sealed class ProjectSymbols : AssetModificationProcessor + { + public const string k_LegacyUnderwaterScriptingSymbol = "d_Crest_LegacyUnderwater"; + + static FileSystemWatcher s_Watcher; + + // Will run on load and recompile preventing symbol removal in player settings. + [InitializeOnLoadMethod] + static void OnLoad() + { + if (Instance != null) + { + Instance.UpdateScriptingSymbols(); + } + + Directory.CreateDirectory(Path.GetDirectoryName(k_Path)); + + s_Watcher = new(Path.GetDirectoryName(k_Path)) + { + Filter = Path.GetFileName(k_Path), + NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size, + EnableRaisingEvents = true + }; + + s_Watcher.Changed -= OnChanged; + s_Watcher.Changed += OnChanged; + } + + // Handle external edits. Possibly unreliable, but not important if fails. + static void OnChanged(object sender, FileSystemEventArgs e) + { + EditorApplication.delayCall += () => + { + // Destroy instance to reflect changes. + Helpers.Destroy(Instance); + typeof(ScriptableSingleton) + .GetField("s_Instance", BindingFlags.Static | BindingFlags.NonPublic) + .SetValue(null, null); + Instance.UpdateSymbols(); + }; + } + + static AssetDeleteResult OnWillDeleteAsset(string path, RemoveAssetOptions options) + { + // Only remove symbols if this file is deleted. + if (Path.GetFullPath(path) == GetCurrentFileName()) + { + ScriptingSymbols.Remove(ScriptingSymbols.Symbols.Where(x => x.StartsWith("d_Crest_")).ToArray()); + } + + return AssetDeleteResult.DidNotDelete; + } + + static string GetCurrentFileName([System.Runtime.CompilerServices.CallerFilePath] string fileName = null) + { + return fileName; + } + } + } + + sealed class SettingsProvider : UnityEditor.SettingsProvider + { + static readonly string[] s_ShaderGraphs = new string[] + { + "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Water.shadergraph", + "Packages/com.waveharmonic.crest/Shared/Shaders/Lit.shadergraph", + "Packages/com.waveharmonic.crest.paint/Samples/Colorado/Shaders/SpeedTree8_PBRLit.shadergraph", + "Packages/com.waveharmonic.crest.paint/Samples/Colorado/Shaders/Environment (Splat Map).shadergraph", + }; + + UnityEditor.Editor _Editor; + + SettingsProvider(string path, SettingsScope scope = SettingsScope.User) : base(path, scope) + { + // Empty + } + + static bool IsSettingsAvailable() + { + return File.Exists(ProjectSettings.k_Path); + } + + public override void OnActivate(string searchContext, VisualElement rootElement) + { + base.OnActivate(searchContext, rootElement); + _Editor = UnityEditor.Editor.CreateEditor(ProjectSettings.Instance); + Undo.undoRedoPerformed -= OnUndoRedo; + Undo.undoRedoPerformed += OnUndoRedo; + } + + public override void OnDeactivate() + { + base.OnDeactivate(); + Helpers.Destroy(_Editor); + Undo.undoRedoPerformed -= OnUndoRedo; + } + + void OnUndoRedo() + { + ProjectSettings.Save(); + } + + public override void OnGUI(string searchContext) + { + if (_Editor.target == null) + { + Helpers.Destroy(_Editor); + _Editor = UnityEditor.Editor.CreateEditor(ProjectSettings.Instance); + return; + } + + // Reset foldout values. + DecoratedDrawer.s_IsFoldout = false; + DecoratedDrawer.s_IsFoldoutOpen = false; + + EditorGUI.BeginChangeCheck(); + + // Pad similar to settings header. + var style = new GUIStyle(); + style.padding.left = 8; + + // Same label with as other settings. + EditorGUIUtility.labelWidth = 251; + + EditorGUILayout.BeginVertical(style); + _Editor.OnInspectorGUI(); + EditorGUILayout.EndVertical(); + + // Commit all changes. Normally settings are written when user hits save or exits + // without any undo/redo entry and dirty state. No idea how to do the same. + // SaveChanges and hasUnsavedChanges on custom editor did not work. + // Not sure if hooking into EditorSceneManager.sceneSaving is correct. + if (EditorGUI.EndChangeCheck()) + { + ProjectSettings.Save(); + } + + GUILayout.Space(10 * 2); + + if (GUILayout.Button("Repair Shaders")) + { + foreach (var path in s_ShaderGraphs) + { + if (!File.Exists(path)) continue; + AssetDatabase.ImportAsset(path); + } + } + } + + [SettingsProvider] + static UnityEditor.SettingsProvider Create() + { + if (ProjectSettings.Instance) + { + var provider = new SettingsProvider("Project/Crest", SettingsScope.Project); + provider.keywords = GetSearchKeywordsFromSerializedObject(new(ProjectSettings.Instance)); + return provider; + } + + // Settings Asset doesn't exist yet; no need to display anything in the Settings window. + return null; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/ProjectSettings.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/ProjectSettings.cs.meta new file mode 100644 index 0000000..333cbac --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/ProjectSettings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8ac118e410ac44d44a323c7c14819660 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _ArtifactsShader: {fileID: 7200000, guid: 08549c36146ad4899a07193754b21ea2, type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements.meta new file mode 100644 index 0000000..93ed231 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26ea4863bc6b64a0ead57ac5251f169b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/Requirements.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/Requirements.cs new file mode 100644 index 0000000..e49af48 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/Requirements.cs @@ -0,0 +1,34 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if !UNITY_2022_3_OR_NEWER +#error "Crest requires Unity version 2022.3 at a minimum." +#endif + +#if d_UpdateCPUQueries +#error "Your Crest - CPU Queries package needs to be updated to be compatible with this version of Crest." +#endif + +#if d_UpdatePaint +#error "Your Crest - Paint package needs to be updated to be compatible with this version of Crest." +#endif + +#if d_UpdatePortals +#error "Your Crest - Portals package needs to be updated to be compatible with this version of Crest." +#endif + +#if d_UpdateShallowWater +#error "Your Crest - Shallow Water package needs to be updated to be compatible with this version of Crest." +#endif + +#if d_UpdateShiftingOrigin +#error "Your Crest - Shifting Origin package needs to be updated to be compatible with this version of Crest." +#endif + +#if d_UpdateSplines +#error "Your Crest - Splines package needs to be updated to be compatible with this version of Crest." +#endif + +#if d_UpdateWhirlpool +#error "Your Crest - Whirlpool package needs to be updated to be compatible with this version of Crest." +#endif diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/Requirements.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/Requirements.cs.meta new file mode 100644 index 0000000..51f2ca3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/Requirements.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d837eafb40b24492abeb48eefb7936f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/WaveHarmonic.Crest.Editor.Requirements.asmdef b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/WaveHarmonic.Crest.Editor.Requirements.asmdef new file mode 100644 index 0000000..9f4cb7f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/WaveHarmonic.Crest.Editor.Requirements.asmdef @@ -0,0 +1,52 @@ +{ + "name": "WaveHarmonic.Crest.Editor.Dependents", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.waveharmonic.crest.cpu-queries", + "expression": "(,1.0.8)", + "define": "d_UpdateCPUQueries" + }, + { + "name": "com.waveharmonic.crest.paint", + "expression": "(,1.2.3)", + "define": "d_UpdatePaint" + }, + { + "name": "com.waveharmonic.crest.portals", + "expression": "(,1.2.5)", + "define": "d_UpdatePortals" + }, + { + "name": "com.waveharmonic.crest.shallow-water", + "expression": "(,1.3.3)", + "define": "d_UpdateShallowWater" + }, + { + "name": "com.waveharmonic.crest.shifting-origin", + "expression": "(,1.3.0)", + "define": "d_UpdateShiftingOrigin" + }, + { + "name": "com.waveharmonic.crest.splines", + "expression": "(,1.4.2)", + "define": "d_UpdateSplines" + }, + { + "name": "com.waveharmonic.crest.whirlpool", + "expression": "(,1.0.3)", + "define": "d_UpdateWhirlpool" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/WaveHarmonic.Crest.Editor.Requirements.asmdef.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/WaveHarmonic.Crest.Editor.Requirements.asmdef.meta new file mode 100644 index 0000000..5bb61f9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Requirements/WaveHarmonic.Crest.Editor.Requirements.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f9ef151b7b8ca4034bc5cdd0c2a6465d +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/ShaderSettings.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/ShaderSettings.cs new file mode 100644 index 0000000..772cb5a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/ShaderSettings.cs @@ -0,0 +1,130 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Linq; +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEditor.Compilation; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Editor.Settings; + +namespace WaveHarmonic.Crest.Editor +{ + static class ShaderSettingsGenerator + { + [DidReloadScripts] + static void OnReloadScripts() + { + EditorApplication.update -= GenerateAfterReloadScripts; + EditorApplication.update += GenerateAfterReloadScripts; + } + + static async void GenerateAfterReloadScripts() + { + if (EditorApplication.isCompiling) + { + return; + } + + EditorApplication.update -= GenerateAfterReloadScripts; + + // Generate HLSL from C#. Only targets WaveHarmonic.Crest assemblies. + await ShaderGeneratorUtility.GenerateAll(); + AssetDatabase.Refresh(); + } + + internal static void Generate() + { + if (EditorApplication.isCompiling) + { + return; + } + + // Could not ShaderGeneratorUtility.GenerateAll to work without recompiling… + CompilationPipeline.RequestScriptCompilation(); + } + + sealed class AssetPostProcessor : AssetPostprocessor + { + const string k_SettingsPath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl"; + + static async void OnPostprocessAllAssets(string[] imported, string[] deleted, string[] movedTo, string[] movedFrom, bool domainReload) + { + // Unused. + _ = deleted; _ = movedTo; _ = movedFrom; _ = domainReload; + + if (EditorApplication.isCompiling) + { +#if CREST_DEBUG + if (imported.Contains(k_SettingsPath)) + { + UnityEngine.Debug.Log($"Crest: Settings.Crest.hlsl changed during compilation!"); + } +#endif + return; + } + + if (EditorApplication.isUpdating) + { +#if CREST_DEBUG + if (imported.Contains(k_SettingsPath)) + { + UnityEngine.Debug.Log($"Crest: Settings.Crest.hlsl changed during asset database update!"); + } +#endif + return; + } + + // Regenerate if file changed like re-importing. + if (imported.Contains(k_SettingsPath)) + { +#if CREST_DEBUG + UnityEngine.Debug.Log($"Crest: Settings.Crest.hlsl changed!"); +#endif + // Generate HLSL from C#. Only targets WaveHarmonic.Crest assemblies. + await ShaderGeneratorUtility.GenerateAll(); + AssetDatabase.Refresh(); + } + } + } + } + + [GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest")] + sealed class ShaderSettings + { + // These two are here for compute shaders. + public static int s_CrestPackageHDRP = 0 +#if d_UnityHDRP + + 1 +#endif + ; + + public static int s_CrestPackageURP = 0 +#if d_UnityURP + + 1 +#endif + ; + + public static int s_CrestPortals = +#if d_CrestPortals + 1 +#else + 0 +#endif + ; + + public static int s_CrestShiftingOrigin = +#if d_WaveHarmonic_Crest_ShiftingOrigin + 1 +#else + 0 +#endif + ; + + public static int s_CrestFullPrecisionDisplacement = ProjectSettings.Instance.FullPrecisionDisplacementOnHalfPrecisionPlatforms ? 1 : 0; + + public static int s_CrestDiscardAtmosphericScattering = ProjectSettings.Instance.RenderAtmosphericScatteringWhenUnderWater ? 0 : 1; + + public static int s_CrestLegacyUnderwater = ProjectSettings.Instance.LegacyUnderwater ? 1 : 0; + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/ShaderSettings.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/ShaderSettings.cs.meta new file mode 100644 index 0000000..0a31c48 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/ShaderSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 615f0aaf5e0444d73850b23c48e7fe01 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.cs new file mode 100644 index 0000000..8ec8653 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.cs @@ -0,0 +1,39 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ + static class Utility + { + static int s_LastCheckedForWater = -1; + static WaterRenderer s_Water; + public static WaterRenderer Water + { + get + { + if (s_LastCheckedForWater == Time.frameCount) + { + return s_Water; + } + + s_LastCheckedForWater = Time.frameCount; + + // Gets the water from the current stage. + return s_Water = UnityEditor.SceneManagement.StageUtility + .GetCurrentStageHandle() + .FindComponentsOfType() + .FirstOrDefault(); + } + } + + [InitializeOnEnterPlayMode] + static void OnEnterPlayMode() + { + s_LastCheckedForWater = -1; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.cs.meta new file mode 100644 index 0000000..e30841f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8451c0a25aa54024ab200d641ea2f0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.meta new file mode 100644 index 0000000..037f68c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc4f7260556e24b6a87482a4cad878a9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges.meta new file mode 100644 index 0000000..6126fc7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1db68a6c1808a4d4d9099ac4c9f9812c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core.meta new file mode 100644 index 0000000..49ed0eb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: abe8bdec24030408b8a545ae03e751f6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor.meta new file mode 100644 index 0000000..cd67e5a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8b444bc1fb43438aadcfff26a9342e3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/Assembly.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/Assembly.cs new file mode 100644 index 0000000..c56cf55 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/Assembly.cs @@ -0,0 +1,7 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Shared.Editor")] diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/Assembly.cs.meta new file mode 100644 index 0000000..9f0b1e4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebc89e55d7e224f58b73430f7f836895 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/WaveHarmonic.Crest.Bridge.asmref b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/WaveHarmonic.Crest.Bridge.asmref new file mode 100644 index 0000000..283920c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/WaveHarmonic.Crest.Bridge.asmref @@ -0,0 +1,3 @@ +{ + "reference": "GUID:3eae0364be2026648bf74846acb8a731" +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/WaveHarmonic.Crest.Bridge.asmref.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/WaveHarmonic.Crest.Bridge.asmref.meta new file mode 100644 index 0000000..a59e63b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Editor/WaveHarmonic.Crest.Bridge.asmref.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5373b95f6a6234bd9acf598c2856b1c9 +AssemblyDefinitionReferenceImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal.meta new file mode 100644 index 0000000..6a6b14f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9efee046059b1440a932e76cb96a30d0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor.meta new file mode 100644 index 0000000..f992dcb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 645345341492f4e7daaf6a332bf6d944 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/Assembly.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/Assembly.cs new file mode 100644 index 0000000..fe8ba86 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/Assembly.cs @@ -0,0 +1,6 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Editor")] diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/Assembly.cs.meta new file mode 100644 index 0000000..a391eff --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89ed50bd0e0cc4e0593b1eb86b22e426 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/WaveHarmonic.Crest.Bridge.asmref b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/WaveHarmonic.Crest.Bridge.asmref new file mode 100644 index 0000000..583b71c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/WaveHarmonic.Crest.Bridge.asmref @@ -0,0 +1,3 @@ +{ + "reference": "GUID:c579267770062bf448e75eb160330b7f" +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/WaveHarmonic.Crest.Bridge.asmref.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/WaveHarmonic.Crest.Bridge.asmref.meta new file mode 100644 index 0000000..6e59345 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Editor/WaveHarmonic.Crest.Bridge.asmref.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b4e50428db6234431b8ab6d9fe9af9ad +AssemblyDefinitionReferenceImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph.meta new file mode 100644 index 0000000..d6ceb52 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab8bbb10bd06a476aa3c33abddbdd42d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor.meta new file mode 100644 index 0000000..0614699 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: abd60842ea94549cbbde56358927ae18 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/Assembly.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/Assembly.cs new file mode 100644 index 0000000..491610c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/Assembly.cs @@ -0,0 +1,6 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Shared.Editor")] diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/Assembly.cs.meta new file mode 100644 index 0000000..8cc48e9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88af6858f7fbe4851ae792f703289573 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/WaveHarmonic.Crest.Bridge.asmref b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/WaveHarmonic.Crest.Bridge.asmref new file mode 100644 index 0000000..6f5b7c2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/WaveHarmonic.Crest.Bridge.asmref @@ -0,0 +1,3 @@ +{ + "reference": "GUID:be0903cd8e1546f498710afdc59db5eb" +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/WaveHarmonic.Crest.Bridge.asmref.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/WaveHarmonic.Crest.Bridge.asmref.meta new file mode 100644 index 0000000..fe56a95 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Bridges/Unity.ShaderGraph/Editor/WaveHarmonic.Crest.Bridge.asmref.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d1d2e8dc2707d4ea38f4e65cafa7ab83 +AssemblyDefinitionReferenceImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared.meta new file mode 100644 index 0000000..3af2f38 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2df0bac542844fa0a8e4ad57f8e16a0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Assembly.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Assembly.cs new file mode 100644 index 0000000..ec28d92 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Assembly.cs @@ -0,0 +1,24 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Examples")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.CPUQueries")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.CPUQueries.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Paint")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Paint.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShallowWater")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShallowWater.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShiftingOrigin")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShiftingOrigin.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Splines")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Splines.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Watercraft")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Watercraft.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Whirlpool")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Whirlpool.Editor")] diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Assembly.cs.meta new file mode 100644 index 0000000..e09570f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 959b22cf6debd4b5398062eb810543b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes.meta new file mode 100644 index 0000000..cff2e94 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70a73c2fbd8a142b3956c49e19e17c31 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Attributes.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Attributes.cs new file mode 100644 index 0000000..ea71396 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Attributes.cs @@ -0,0 +1,1093 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Adapted from: +// https://forum.unity.com/threads/drawing-a-field-using-multiple-property-drawers.479377/ + +// DecoratedProperty renders the field and Decorator decorates said field. The decorator changes the +// GUI state so that the decorated field receives that state. The DecoratedDrawer targets DecoratedProperty, +// calls Decorator.Decorate for each decorator and reverts GUI state. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using UnityEditor.Rendering; +using WaveHarmonic.Crest.Attributes; +using WaveHarmonic.Crest.Editor; +using UnityEditor.SceneManagement; + +namespace WaveHarmonic.Crest.Attributes +{ + /// + /// Renders a property field accommodating decorator properties. + /// + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] + abstract class DecoratedProperty : PropertyAttribute + { + /// + /// Override this method to customise the label. + /// + internal virtual GUIContent BuildLabel(GUIContent label) => label; + + /// + /// Override this method to make your own IMGUI based GUI for the property. + /// + internal abstract void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer); + + /// + /// A new control rectangle is required. Only override as false if the attribute needs to create it itself. + /// See the embedded attribute as an example. + /// + internal virtual bool NeedsControlRectangle(SerializedProperty property) => true; + } + + /// + /// Decorates a decorator field by changing GUI state. + /// + [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] + abstract class Decorator : PropertyAttribute + { + public abstract bool AlwaysVisible { get; } + + /// + /// Override this method to customise the label. + /// + internal virtual GUIContent BuildLabel(GUIContent label) => label; + + /// + /// Override this method to additively change the appearance of a decorated field. + /// + internal virtual void Decorate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + + } + + internal virtual void DecorateAfter(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + + } + } + + /// + /// An OnValidate replacement. + /// + [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] + abstract class Validator : PropertyAttribute + { + internal abstract void Validate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer, object previous); + } +} + +namespace WaveHarmonic.Crest +{ + /// + /// Renders the property using EditorGUI.PropertyField. + /// + sealed class DecoratedField : DecoratedProperty + { + public readonly bool _CustomFoldout; + + public DecoratedField(bool isCustomFoldout = false) + { + _CustomFoldout = isCustomFoldout; + } + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + var isCustomFoldout = _CustomFoldout && (property.propertyType == SerializedPropertyType.Generic || property.propertyType == SerializedPropertyType.ManagedReference); + + if (isCustomFoldout) + { + // Draw top border. + var rect = position; + rect.xMin = 0; + rect.xMax = 100000; + rect.height = 1; + EditorGUI.DrawRect(rect, new(0.1f, 0.1f, 0.1f, 1f)); + + // Draw background. + var background = position; + background.xMin = 0; + background.xMax = 100000; + background.yMin += 1; + background.yMax = background.yMin + EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing * 2; + EditorGUI.DrawRect(background, new(0.1f, 0.1f, 0.1f, 0.2f)); + + position.yMin += EditorGUIUtility.standardVerticalSpacing + 1; + position.yMax -= EditorGUIUtility.standardVerticalSpacing + 1; + } + + // FIXME: InvalidOperationException: Stack empty. + // System.Collections.Generic.Stack`1[T].Pop()(at:0) + EditorGUI.PropertyField(position, property, label, true); + + if (isCustomFoldout) + { + var background = position; + background.xMin = 0; + background.xMax = 100000; + background.yMin += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + background.yMax = background.yMin + 1; + EditorGUI.DrawRect(background, property.isExpanded ? new(0.1f, 0.1f, 0.1f, 0.5f) : new(0.1f, 0.1f, 0.1f, 1f)); + EditorGUILayout.Space(1); + + if (property.isExpanded) + { + EditorGUILayout.Space(EditorGUIUtility.standardVerticalSpacing * 3); + } + } + } + } + + /// + /// Renders foldout without the foldout. + /// + sealed class Stripped : DecoratedProperty + { + internal override bool NeedsControlRectangle(SerializedProperty property) => false; + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + property.isExpanded = true; + DecoratedDrawer.s_TemporaryColor = true; + DecoratedDrawer.s_PreviousColor = GUI.color; + + GUI.color = new(0, 0, 0, 0); + + EditorGUI.indentLevel -= 1; + EditorGUI.PropertyField(position, property, label, true); + EditorGUI.indentLevel += 1; + } + } + + /// + /// Renders the property using EditorGUI.Delayed*. + /// + sealed class Delayed : DecoratedProperty + { + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + switch (property.propertyType) + { + case SerializedPropertyType.Float: + EditorGUI.DelayedFloatField(position, property, label); + break; + case SerializedPropertyType.Integer: + EditorGUI.DelayedIntField(position, property, label); + break; + case SerializedPropertyType.String: + EditorGUI.DelayedTextField(position, property, label); + break; + default: + EditorGUI.LabelField(position, label.text, "Delayed: must be float, integer, or string."); + break; + } + } + } + + sealed class Group : Decorator + { + public enum Style + { + None, + Foldout, + Accordian, + } + + readonly GUIContent _Title; + readonly bool _IsEnd; + readonly bool _CustomFoldout; + + string _IsExpandedKey; + + public static bool s_Foldout = false; + + public override bool AlwaysVisible => true; + + readonly Style _Style; + + /// + /// Begins (and subsequently ends) a group of fields. They can be ordered and styled. + /// + /// Title of the group. + /// The appearance of the group. + /// Pass "true" if this field is an object which would normally be a foldout but you want accordian styling. Also set this value on the DecoratedField attribute. Other parameters are ignored with this set. + public Group(string title = null, Style style = Style.Foldout, bool isCustomFoldout = false) + { + _IsEnd = title == null || style == Style.None; + _Title = _IsEnd ? null : new(title); + _CustomFoldout = isCustomFoldout; + _Style = _IsEnd ? Style.None : style; + } + + internal override void Decorate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + if (DecoratedDrawer.s_IsFoldoutOpen) + { + --EditorGUI.indentLevel; + + if (!_IsEnd || _CustomFoldout) + { + EditorGUILayout.GetControlRect(false, EditorGUIUtility.standardVerticalSpacing * 3); + } + } + else if (_Style == Style.Accordian || _CustomFoldout) + { + // HACK: Otherwise anything groups following an embedded will be indented. + EditorGUI.indentLevel = 0; + } + + DecoratedDrawer.s_IsFoldout = DecoratedDrawer.s_IsFoldoutOpen = false; + + if (_CustomFoldout) + { + return; + } + + if (_IsEnd) + { + EditorGUILayout.GetControlRect(false, EditorGUIUtility.standardVerticalSpacing * 3); + return; + } + + DecoratedDrawer.s_IsFoldout = true; + + Rect rect; + Rect background; + + if (_Style == Style.Accordian) + { + // Draw top border. + rect = EditorGUILayout.GetControlRect(GUILayout.Height(1)); + rect.xMin = 0; + rect.xMax = 100000; + rect.height = 1; + EditorGUI.DrawRect(rect, new(0.1f, 0.1f, 0.1f, 1f)); + + rect = EditorGUILayout.GetControlRect(true); + + // Draw background. + background = rect; + background.xMin = 0; + background.xMax = 100000; + background.yMin -= 2; + background.yMax += 2; + EditorGUI.DrawRect(background, new(0.1f, 0.1f, 0.1f, 0.2f)); + } + else + { + rect = EditorGUILayout.GetControlRect(); + background = new Rect(); + } + + // Cannot use "property.isExpanded" as this will be used by nested built-in foldouts. + _IsExpandedKey ??= $"{property.serializedObject.targetObject.GetType().FullName}.{property.propertyPath}"; + var isExpanded = SessionState.GetBool(_IsExpandedKey, false); + + isExpanded = EditorGUI.Foldout(rect, isExpanded, _Title, toggleOnLabelClick: true); + DecoratedDrawer.s_IsFoldoutOpen = isExpanded; + + SessionState.SetBool(_IsExpandedKey, isExpanded); + + if (_Style != Style.Accordian) + { + EditorGUI.indentLevel++; + return; + } + + if (isExpanded) + { + // Draw bottom border (lighter when open). + rect = EditorGUILayout.GetControlRect(GUILayout.Height(1)); + rect.xMin = 0; + rect.xMax = 100000; + rect.height = 1; + EditorGUI.DrawRect(rect, new(0.1f, 0.1f, 0.1f, 0.5f)); + + ++EditorGUI.indentLevel; + + EditorGUILayout.GetControlRect(false, EditorGUIUtility.standardVerticalSpacing * 2); + } + else + { + // Draw bottom border. This will have same position as top border for next foldout. + background.yMax += 1; + background.yMin = background.yMax - 1; + EditorGUI.DrawRect(background, new(0.1f, 0.1f, 0.1f, 1f)); + } + } + } + + sealed class Stepped : DecoratedProperty + { + readonly int _Minimum; + readonly int _Maximum; + readonly int _Step; + readonly bool _Power; + + public Stepped(int minimum, int maximum, int step = 1, bool power = false) + { + _Minimum = minimum; + _Maximum = maximum; + _Step = step; + _Power = power; + } + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + if (property.propertyType == SerializedPropertyType.Integer) + { + property.intValue = EditorGUI.IntSlider(position, label, property.intValue, _Minimum, _Maximum); + property.intValue = _Power + ? Mathf.ClosestPowerOfTwo(property.intValue) + : property.intValue / _Step * _Step; + property.intValue = property.intValue; + } + else + { + EditorGUI.LabelField(position, label.text, "Use Stepped with int."); + } + } + } + + sealed class Minimum : Attributes.Validator + { + readonly float _Minimum; + + public Minimum(float minimum) + { + _Minimum = minimum; + } + + internal override void Validate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer, object previous) + { + switch (property.propertyType) + { + case SerializedPropertyType.Float: + property.floatValue = Mathf.Max(_Minimum, property.floatValue); + break; + case SerializedPropertyType.Integer: + property.floatValue = Mathf.Max((int)_Minimum, property.intValue); + break; + case SerializedPropertyType.Vector2: + var vector2Value = property.vector2Value; + vector2Value.x = Mathf.Max(_Minimum, vector2Value.x); + vector2Value.y = Mathf.Max(_Minimum, vector2Value.y); + property.vector2Value = vector2Value; + break; + case SerializedPropertyType.Vector2Int: + var vector2IntValue = property.vector2IntValue; + vector2IntValue.x = Mathf.Max((int)_Minimum, vector2IntValue.x); + vector2IntValue.y = Mathf.Max((int)_Minimum, vector2IntValue.y); + property.vector2Value = vector2IntValue; + break; + default: + EditorGUI.LabelField(position, label.text, "Minimum: must be float, integer, or string."); + break; + } + } + } + + sealed class Maximum : Attributes.Validator + { + readonly float _Maximum; + + public Maximum(float maximum) + { + _Maximum = maximum; + } + + internal override void Validate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer, object previous) + { + switch (property.propertyType) + { + case SerializedPropertyType.Float: + property.floatValue = Mathf.Min(_Maximum, property.floatValue); + break; + case SerializedPropertyType.Integer: + property.intValue = Mathf.Min((int)_Maximum, property.intValue); + break; + case SerializedPropertyType.Vector2: + var vector2Value = property.vector2Value; + vector2Value.x = Mathf.Min(_Maximum, vector2Value.x); + vector2Value.y = Mathf.Min(_Maximum, vector2Value.y); + property.vector2Value = vector2Value; + break; + case SerializedPropertyType.Vector2Int: + var vector2IntValue = property.vector2IntValue; + vector2IntValue.x = Mathf.Min((int)_Maximum, vector2IntValue.x); + vector2IntValue.y = Mathf.Min((int)_Maximum, vector2IntValue.y); + property.vector2IntValue = vector2IntValue; + break; + default: + EditorGUI.LabelField(position, label.text, "Maximum: must be float, integer, or string."); + break; + } + } + } + + /// + /// Renders the property using EditorGUI.Slider. + /// + sealed class Range : DecoratedProperty + { + readonly float _Minimum; + readonly float _Maximum; + readonly float _PowerScale; + readonly int _Step; + readonly bool _Power; + readonly bool _Delayed; + readonly Clamp _Clamp; + + [Flags] + public enum Clamp + { + None = 0, + Minimum = 1, + Maximum = 2, + Both = Minimum | Maximum, + } + + public Range(float minimum, float maximum, Clamp clamp = Clamp.Both, float scale = 1f, bool delayed = false, int step = 0, bool power = false) + { + _Minimum = minimum; + _Maximum = maximum; + _Step = step; + _Power = power; + _PowerScale = scale; + _Clamp = clamp; + _Delayed = delayed; + } + + static readonly FieldInfo s_RecycledEditor = typeof(EditorGUI).GetField("s_RecycledEditor", BindingFlags.NonPublic | BindingFlags.Static); + static readonly MethodInfo s_DoFloatField = typeof(EditorGUI).GetMethod("DoFloatField", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { Assembly.GetAssembly(typeof(EditorGUI)).GetType("UnityEditor.EditorGUI+RecycledTextEditor"), typeof(Rect), typeof(Rect), typeof(int), typeof(float), typeof(string), typeof(GUIStyle), typeof(bool), typeof(float) }, null); + static readonly object[] s_Arguments = new object[] { null, null, null, null, null, "g7", null, true, null }; + + // For label dragging. + float FloatField(Rect position, Rect dragHotZone, float value, float minimum, float maximum) + { + s_Arguments[0] = s_RecycledEditor.GetValue(null); + s_Arguments[1] = position; + s_Arguments[2] = dragHotZone; + s_Arguments[3] = GUIUtility.GetControlID("EditorTextField".GetHashCode(), FocusType.Keyboard, position); + s_Arguments[4] = value; + s_Arguments[6] = EditorStyles.numberField; + s_Arguments[8] = Math.Abs(maximum - minimum) / 100f * 0.03f; + return (float)s_DoFloatField.Invoke(null, s_Arguments); + } + + static MethodInfo s_PowerSliderMethod; + + internal static void PowerSlider(Rect position, SerializedProperty property, float minimum, float maximum, float power, GUIContent label) + { + if (s_PowerSliderMethod == null) + { + // Grab the internal PowerSlider method. + s_PowerSliderMethod = typeof(EditorGUI).GetMethod + ( + name: "PowerSlider", + bindingAttr: BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(Rect), typeof(GUIContent), typeof(float), typeof(float), typeof(float), typeof(float) }, + modifiers: null + ); + } + + // Render slider and apply value to SerializedProperty. + label = EditorGUI.BeginProperty(position, label, property); + EditorGUI.BeginChangeCheck(); + var newValue = (float)s_PowerSliderMethod.Invoke(null, new object[] { position, label, property.floatValue, minimum, maximum, power }); + if (EditorGUI.EndChangeCheck()) + { + property.floatValue = newValue; + } + EditorGUI.EndProperty(); + } + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + var isVector = property.propertyType is SerializedPropertyType.Vector2 or SerializedPropertyType.Vector2Int; + var isInteger = property.propertyType is SerializedPropertyType.Integer or SerializedPropertyType.Vector2Int; + + if (property.propertyType != SerializedPropertyType.Float && !isVector && !isInteger) + { + EditorGUI.LabelField(position, label.text, "Range: must be float, integer, or vector2."); + } + + // Power provided so use PowerSlider. + if (_PowerScale != 1f) + { + if (property.propertyType != SerializedPropertyType.Float) + { + // We could fallback to Slider, but better to raise an issue. + EditorGUI.LabelField(position, label.text, "Range: must be float if power is provided."); + return; + } + + PowerSlider(position, property, _Minimum, _Maximum, _PowerScale, label); + return; + } + + label = EditorGUI.BeginProperty(position, label, property); + + var dragHotZone = position; + position = EditorGUI.PrefixLabel(position, label); + dragHotZone.xMax = position.xMin; + + // Otherwise fields will have indentation. + var indent = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + + if (isVector) + { + var range = isInteger ? property.vector2IntValue : property.vector2Value; + + var xMax = position.xMax; + position.width = EditorGUIUtility.fieldWidth; + + range.x = _Delayed + ? EditorGUI.DelayedFloatField(position, range.x) + : EditorGUI.FloatField(position, range.x); + range.x = Mathf.Min(range.x, range.y); + + position.xMin = position.xMax + 6f; + position.xMax = xMax - (EditorGUIUtility.fieldWidth + 6f); + position.width = Mathf.Max(position.width, 19f); + + EditorGUI.MinMaxSlider(position, ref range.x, ref range.y, _Minimum, _Maximum); + + position.xMin = position.xMax + 5f; + position.width = EditorGUIUtility.fieldWidth; + + range.y = _Delayed + ? EditorGUI.DelayedFloatField(position, range.y) + : EditorGUI.FloatField(position, range.y); + range.y = Mathf.Max(range.x, range.y); + + if (_Clamp.HasFlag(Clamp.Minimum)) range.x = Mathf.Max(range.x, _Minimum); + if (_Clamp.HasFlag(Clamp.Maximum)) range.y = Mathf.Min(range.y, _Maximum); + + if (isInteger) property.vector2IntValue = Vector2Int.RoundToInt(range); + else property.vector2Value = range; + } + else + { + var range = isInteger ? property.intValue : property.floatValue; + + using (var check = new EditorGUI.ChangeCheckScope()) + { + position.xMax -= EditorGUIUtility.fieldWidth + 6f; + position.width = Mathf.Max(position.width, 19f); + + // If we go outside of the range then the thumb control will disappear. + var clamped = Mathf.Clamp(range, _Minimum, _Maximum); + clamped = GUI.HorizontalSlider(position, clamped, _Minimum, _Maximum); + if (check.changed) range = clamped; + } + + position.xMin = position.xMax + 5f; + position.width = EditorGUIUtility.fieldWidth; + + // There does not seem to be a functional difference with using integer vs float + // fields since we handle rounding ourselves. + range = _Delayed + ? EditorGUI.DelayedFloatField(position, range) +#if UNITY_6000_0_OR_NEWER + : EditorGUI.FloatField(position, range); +#else + : FloatField(position, dragHotZone, range, _Minimum, _Maximum); +#endif + + if (_Step > 0) + { + var integer = Mathf.RoundToInt(range); + range = _Power ? Mathf.ClosestPowerOfTwo(integer) : integer / _Step * _Step; + } + + if (_Clamp.HasFlag(Clamp.Minimum)) range = Mathf.Max(range, _Minimum); + if (_Clamp.HasFlag(Clamp.Maximum)) range = Mathf.Min(range, _Maximum); + + if (isInteger) property.intValue = Mathf.RoundToInt(range); + else property.floatValue = range; + } + + EditorGUI.indentLevel = indent; + EditorGUI.EndProperty(); + } + } + + sealed class InlineToggle : DecoratedProperty + { + // Add extra y offset. Needed for foldouts in foldouts so far. + readonly bool _Fix; + + public InlineToggle(bool fix = false) + { + _Fix = fix; + } + + internal override bool NeedsControlRectangle(SerializedProperty property) + { + return false; + } + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + var r = position; + r.x -= 16f; + // Align with Space offset. + if (drawer.Space > 0) r.y += drawer.Space + 2f; + if (_Fix) r.y += EditorGUIUtility.singleLineHeight + 2f; + // Seems to be needed. + r.width = 16f * (1f + EditorGUI.indentLevel); + r.height = EditorGUIUtility.singleLineHeight; + label.text = ""; + + using (new EditorGUI.PropertyScope(r, label, property)) + { + EditorGUI.BeginProperty(r, label, property); + // Passing a tooltip to Toggle does nothing. + GUI.Label(r, label); + property.boolValue = EditorGUI.Toggle(r, property.boolValue); + EditorGUI.EndProperty(); + } + } + } + + /// + /// Allows an enum to render only a subset of options in subclasses. + /// + sealed class Filtered : DecoratedProperty + { + public enum Mode + { + Include, + Exclude, + } + + bool _Initialized; + + readonly bool _HasUnset = false; + readonly int _Unset = -1; + + bool _Invalid; + readonly List _InvalidValues = new(); + + public Filtered() + { + } + + public Filtered(int unset) + { + _Unset = unset; + _HasUnset = true; + } + + GUIContent[] _Labels; + int[] _Values; + bool _UnsetHidden = false; + + readonly GUIContent _InvalidLabel = new("Invalid"); + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + if (property.propertyType != SerializedPropertyType.Enum) + { + EditorGUI.LabelField(position, label.text, "Filtered: must be an enum."); + return; + } + + var attributes = property + .GetDefiningBoxedObject() + .GetType() + .GetCustomAttributes(true) + .Where(x => x._Property == property.name); + + if (attributes.Count() == 0) + { + EditorGUI.PropertyField(position, property, label); + return; + } + + Debug.AssertFormat(attributes.Count() == 1, "Crest: {0}.{1} has a subclass with too many DynamicEnumFilters", + drawer.fieldInfo.FieldType, property.name); + + var attribute = attributes.First(); + var rebuild = false; + rebuild |= !_Initialized; + rebuild |= _HasUnset && _UnsetHidden != (property.intValue != _Unset); + rebuild |= _Invalid != _InvalidValues.Contains(property.intValue); + + if (rebuild) + { + var labels = Enum.GetNames(drawer.fieldInfo.FieldType).Select(x => new GUIContent(x)).ToList(); + var values = ((int[])Enum.GetValues(drawer.fieldInfo.FieldType)).ToList(); + + _Invalid = false; + _UnsetHidden = false; + + // Filter enum entries. + for (var i = 0; i < labels.Count; i++) + { + // If this enum has an "unset" value, and "unset" is not the current value, filter it out. + if (_HasUnset && values[i] == _Unset && property.intValue != _Unset) + { + labels.RemoveAt(i); + values.RemoveAt(i); + i--; + _UnsetHidden = true; + continue; + } + + if (attribute._Mode == Mode.Exclude && attribute._Values.Contains(values[i]) || + attribute._Mode == Mode.Include && !attribute._Values.Contains(values[i])) + { + if (!_Initialized) + { + _InvalidValues.Add(values[i]); + } + + if (property.intValue == values[i]) + { + _Invalid = true; + labels[i] = _InvalidLabel; + } + else + { + labels.RemoveAt(i); + values.RemoveAt(i); + i--; + } + } + } + + _Labels = labels.ToArray(); + _Values = values.ToArray(); + _Initialized = true; + } + + property.intValue = EditorGUI.IntPopup(position, label, property.intValue, _Labels, _Values); + } + } + + /// + /// Marks which enum options this subclass wants to use. Companion to Filtered. + /// Usage: [FilterEnum("_mode", Filtered.Mode.Include, (int)Mode.One, (int)Mode.Two)] + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] + sealed class FilterEnum : Attribute + { + public string _Property; + public Filtered.Mode _Mode; + internal int[] _Values; + + public FilterEnum(string property, Filtered.Mode mode, params int[] values) + { + _Mode = mode; + _Values = values; + _Property = property; + } + } + + sealed class ShowComputedProperty : Decorator + { + readonly string _PropertyName; + PropertyInfo _PropertyInfo; + object _Target; + Array _EnumValues; + + public override bool AlwaysVisible => true; + + public ShowComputedProperty(string name) + { + _PropertyName = name; + } + + internal override void DecorateAfter(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + if (!DecoratedDrawer.s_HideInInspector) + { + return; + } + + // Do not execute for now as some components are not active in prefab stage. + if (PrefabStageUtility.GetCurrentPrefabStage() != null) + { + return; + } + + _Target ??= property.GetDefiningBoxedObject(); + _PropertyInfo ??= _Target.GetType().GetProperty(_PropertyName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); + + EditorGUI.BeginDisabledGroup(true); + + // Have to do this manually as PropertyField requires changing the property value + // but will mess with OnChange check. + switch (property.propertyType) + { + case SerializedPropertyType.Float: + EditorGUILayout.FloatField(label, (float)_PropertyInfo.GetValue(_Target)); + break; + case SerializedPropertyType.Integer: + EditorGUILayout.IntField(label, (int)_PropertyInfo.GetValue(_Target)); + break; + case SerializedPropertyType.Enum: + _EnumValues ??= Enum.GetValues(_PropertyInfo.PropertyType); + EditorGUILayout.Popup(label, Array.IndexOf(_EnumValues, _PropertyInfo.GetValue(_Target)), property.enumDisplayNames); + break; + } + + EditorGUI.EndDisabledGroup(); + } + } + + /// + /// Manually provide a label (ie rename) for fields. + /// + sealed class Label : Decorator + { + + readonly string _Label; + + public override bool AlwaysVisible => false; + + public Label(string label) + { + _Label = label; + } + + internal override GUIContent BuildLabel(GUIContent label) + { + label = base.BuildLabel(label); + label.text = _Label; + return label; + } + + internal override void Decorate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + // Empty + } + } + + /// + /// Drop-in replacement for Header. Use when hiding property with Predicated. + /// + sealed class Heading : Decorator + { + readonly GUIContent _Text; + readonly string _HelpLink; + readonly Style _Style; + readonly bool _AlwaysVisible; + readonly bool _AlwaysEnabled; + + public enum Style + { + Normal, + Settings + } + + public Heading(string heading, Style style = Style.Normal, bool alwaysVisible = false, bool alwaysEnabled = false, string helpLink = null) + { + _Text = EditorGUIUtility.TrTextContent(heading); + _HelpLink = helpLink; + _Style = style; + _AlwaysVisible = alwaysVisible; + _AlwaysEnabled = alwaysEnabled; + } + + public override bool AlwaysVisible => _AlwaysVisible || _Style == Style.Settings; + + internal override void Decorate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + var enabled = GUI.enabled; + if (_AlwaysEnabled) GUI.enabled = true; + + switch (_Style) + { + case Style.Normal: + // Register margin with IMGUI so subsequent spacing is correct. + EditorGUILayout.GetControlRect(false, EditorGUIUtility.singleLineHeight * 0.5f); + GUI.Label(EditorGUI.IndentedRect(EditorGUILayout.GetControlRect(true)), _Text, EditorStyles.boldLabel); + break; + case Style.Settings: + // Draws the section header found in SRP global settings files. + CoreEditorUtils.DrawSectionHeader(_Text, _HelpLink); + break; + } + + GUI.enabled = enabled; + } + } + + /// + /// Drop-in replacement for Space but supports our Decorator system. + /// + sealed class Space : Decorator + { + public readonly float _Height; + readonly bool _AlwaysVisible; + + public Space(float height, bool isAlwaysVisible = false) + { + _Height = height; + _AlwaysVisible = isAlwaysVisible; + } + + public override bool AlwaysVisible => _AlwaysVisible; + + internal override void Decorate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + EditorGUILayout.GetControlRect(false, _Height); + } + } + + sealed class PrefabField : DecoratedProperty + { + readonly EditorHelpers.CreateInstance _CreateInstance; + readonly string _Title; + readonly string _DefaultName; + + public PrefabField(string title, string name) + { + _CreateInstance = x => x.serializedObject.GetDefaultReference(x.name); + _DefaultName = name; + _Title = title; + } + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + EditorHelpers.AssetField + ( + typeof(GameObject), + label, + property, + position, + _Title, + _DefaultName, + "prefab", + string.Empty, + _CreateInstance + ); + } + } + + sealed class MaterialField : DecoratedProperty + { + readonly EditorHelpers.CreateInstance _CreateInstance; + readonly string _Title; + readonly string _DefaultName; + readonly string _MaterialVariantPropertyName; + + public MaterialField(string shader, string title = "Create Material", string name = "Material", string parent = null) + { + _CreateInstance = x => new Material(Shader.Find(shader)); + _DefaultName = name; + _Title = title; + _MaterialVariantPropertyName = parent; + } + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + var old = property.objectReferenceValue; + + EditorHelpers.AssetField + ( + typeof(Material), + label, + property, + position, + _Title, + _DefaultName, + "mat", + string.Empty, + _CreateInstance + ); + + // If we just created the material then parent. + if (old != property.objectReferenceValue && _MaterialVariantPropertyName != null && property.objectReferenceValue != null) + { + var parent = (Material)property.serializedObject.FindProperty(_MaterialVariantPropertyName).objectReferenceValue; + if (parent == null) return; + var child = (Material)property.objectReferenceValue; + child.parent = parent; + // After parenting it will have overrides. + child.RevertAllPropertyOverrides(); + } + } + } + + sealed class AttachMaterialEditor : Attribute + { + public int Order { get; private set; } + + public AttachMaterialEditor(int order = 0) + { + Order = order; + } + } + + sealed class Disabled : Decorator + { + public override bool AlwaysVisible => false; + + internal override void Decorate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + GUI.enabled = false; + } + } + + sealed class WarnIfAbove : Attributes.Validator + { + readonly float _Maximum; + + public WarnIfAbove(float maximum) + { + _Maximum = maximum; + } + + internal override void Validate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer, object previous) + { + var warn = false; + + if (previous == property.boxedValue) + { + return; + } + + switch (property.propertyType) + { + case SerializedPropertyType.Float: + var newValue = property.floatValue; + var oldValue = (float)previous; + warn = newValue > _Maximum && newValue > oldValue && oldValue <= _Maximum; + break; + case SerializedPropertyType.Integer: + warn = property.intValue > _Maximum && property.intValue > (int)previous; + break; + default: + EditorGUI.LabelField(position, label.text, "Maximum: must be float or integer."); + break; + } + + if (warn) + { + var revert = EditorUtility.DisplayDialog + ( + "Warning!", + $"The entered value ({property.boxedValue}) is about to exceed the recommended maximum ({_Maximum}). " + + "A value this large could potentially freeze or even crash your computer.", + "Revert", + "Continue" + ); + + if (revert) + { + property.boxedValue = previous; + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Attributes.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Attributes.cs.meta new file mode 100644 index 0000000..4aafefa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Attributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4feed62e65f34662aea25208d1ce0bf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Embedded.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Embedded.cs new file mode 100644 index 0000000..7c95474 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Embedded.cs @@ -0,0 +1,31 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Attributes; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest +{ + sealed class Embedded : DecoratedProperty + { + internal EmbeddedAssetEditor _Editor; + public int BottomMargin { get; private set; } + public string DefaultPropertyName { get; private set; } + + public Embedded(int margin = 0, string defaultPropertyName = null) + { + _Editor = new(); + BottomMargin = margin; + DefaultPropertyName = defaultPropertyName; + } + + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + _Editor.DrawEditorCombo(this, label, drawer, property, "asset"); + } + + internal override bool NeedsControlRectangle(SerializedProperty property) => false; + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Embedded.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Embedded.cs.meta new file mode 100644 index 0000000..b9ca7c6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Embedded.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c024c6def66044f1cb4783f23a050bec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpBox.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpBox.cs new file mode 100644 index 0000000..77ea34c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpBox.cs @@ -0,0 +1,72 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Attributes; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest +{ + sealed class HelpBox : Decorator + { + // Define our own as Unity's won't be available in builds. + public enum MessageType + { + Info, + Warning, + Error, + } + + public string _Message; + public MessageType _MessageType; + public Visibility _Visibility; + + public enum Visibility + { + Always, + PropertyEnabled, + PropertyDisabled, + } + + readonly GUIContent _GuiContent; + + public override bool AlwaysVisible => false; + + public HelpBox(string message, MessageType messageType = MessageType.Info, Visibility visibility = Visibility.Always) + { + _Message = message; + _MessageType = messageType; + _Visibility = visibility; + _GuiContent = new(message); + } + + internal override void Decorate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + if (_Visibility == Visibility.PropertyEnabled && !GUI.enabled || _Visibility == Visibility.PropertyDisabled && GUI.enabled) + { + return; + } + + // Enable rich text in help boxes. Store original so we can revert since this might be a "hack". + var style = GUI.skin.GetStyle("HelpBox"); + var styleRichText = style.richText; + style.richText = true; + + var height = style.CalcHeight(_GuiContent, EditorGUIUtility.currentViewWidth); + if (height <= EditorGUIUtility.singleLineHeight) + { + // This gets internal layout of the help box right but breaks down if multiline. + height += style.padding.horizontal + style.lineHeight; + } + + // Always get a new control rect so we don't have to deal with positions and offsets. + position = EditorGUILayout.GetControlRect(true, height, style); + // + 1 maps our MessageType to Unity's. + EditorGUI.HelpBox(position, _Message, (UnityEditor.MessageType)_MessageType + 1); + + // Revert skin since it persists. + style.richText = styleRichText; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpBox.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpBox.cs.meta new file mode 100644 index 0000000..f67a6aa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpBox.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49c68d73fb5ce4690a444ab84a0abc8e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpURL.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpURL.cs new file mode 100644 index 0000000..74553cd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpURL.cs @@ -0,0 +1,25 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Constructs a custom link to Crest's documentation for the help URL button. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum, AllowMultiple = false)] + sealed class HelpURL : HelpURLAttribute + { + public HelpURL(string path = "") : base(GetPageLink(path)) + { + // Blank. + } + + public static string GetPageLink(string path) + { + return "https://docs.crest.waveharmonic.com/" + path; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpURL.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpURL.cs.meta new file mode 100644 index 0000000..c5f51c3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/HelpURL.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f113b211b4a014cf19cf7828018f49d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Layer.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Layer.cs new file mode 100644 index 0000000..bbbeaae --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Layer.cs @@ -0,0 +1,18 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Attributes; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest +{ + sealed class Layer : DecoratedProperty + { + internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + property.intValue = EditorGUI.LayerField(position, label, property.intValue); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Layer.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Layer.cs.meta new file mode 100644 index 0000000..9a9c6e5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Layer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a25b1272591fc4fd6a34265f20064746 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/OnChange.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/OnChange.cs new file mode 100644 index 0000000..9dbc790 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/OnChange.cs @@ -0,0 +1,33 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; + +namespace WaveHarmonic.Crest +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + sealed class OnChange : Attribute + { + public Type Type { get; } + public bool SkipIfInactive { get; } + + /// + /// Register an instance method as an OnChange handler. + /// + public OnChange(bool skipIfInactive = true) + { + SkipIfInactive = skipIfInactive; + } + + /// + /// Register a static method as an OnChange handler. + /// + /// The type to target. + /// Skip this handler if component is inactive. + public OnChange(Type type, bool skipIfInactive = true) + { + Type = type; + SkipIfInactive = skipIfInactive; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/OnChange.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/OnChange.cs.meta new file mode 100644 index 0000000..556d02e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/OnChange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 75d2e7be9abf446048de686f69cb485c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Predicated.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Predicated.cs new file mode 100644 index 0000000..79f7c28 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Predicated.cs @@ -0,0 +1,219 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Attributes; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest +{ + sealed class Predicated : Decorator + { + enum Mode + { + Property, + Member, + Type, + RenderPipeline, + } + + readonly Mode _Mode; + + readonly bool _Inverted; + readonly bool _Hide; + + readonly string _PropertyName; + readonly object _DisableValue; + + readonly Type _Type; + readonly MemberInfo _Member; + + readonly RenderPipeline _RenderPipeline; + + /// + /// The field with this attribute will be drawn enabled/disabled based on return of method. + /// + /// The type to call the method on. Must be either a static type or the type the field is defined on. + /// Member name. Method must match signature: bool MethodName(Component component). Can be any visibility and static or instance. + /// + /// Flip behaviour - for example disable if a bool field is set to true (instead of false). + /// Hide this component in the inspector. + public Predicated(Type type, string member, object disableValue, bool inverted = false, bool hide = false) + { + _Mode = Mode.Member; + _Inverted = inverted; + _Hide = hide; + _Type = type; + _DisableValue = disableValue; + _Member = _Type.GetMember(member, Helpers.s_AnyMethod)[0]; + } + + /// + public Predicated(Type type, string member, bool inverted = false, bool hide = false) : this(type, member, true, inverted, hide) + { + + } + + /// + /// Enable/Disable field depending on the current type of the component. + /// + /// If a component of this type is not attached to this GameObject, disable the GUI (or enable if inverted is true). + /// Flip behaviour - for example disable if a bool field is set to true (instead of false). + /// Hide this component in the inspector. + public Predicated(Type type, bool inverted = false, bool hide = false) + { + _Mode = Mode.Type; + _Inverted = inverted; + _Hide = hide; + _Type = type; + } + + /// + /// The field with this attribute will be drawn enabled/disabled based on another field. For example can be used + /// to disable a field if a toggle is false. + /// + /// The name of the other property whose value dictates whether this field is enabled or not. + /// Flip behaviour - for example disable if a bool field is set to true (instead of false). + /// If the field has this value, disable the GUI (or enable if inverted is true). + /// Hide this component in the inspector. + public Predicated(string property, bool inverted = false, object disableValue = null, bool hide = false) + { + _Mode = Mode.Property; + _Inverted = inverted; + _Hide = hide; + _PropertyName = property; + _DisableValue = disableValue; + } + + /// + /// Field is predicated (enabled/shown) on which render pipeline is active. + /// + /// Enable if this render pipeline is active. + /// Invert behaviour. + /// Hide instead of disable. + public Predicated(RenderPipeline rp, bool inverted = false, bool hide = false) + { + _Mode = Mode.RenderPipeline; + _Inverted = inverted; + _Hide = hide; + _RenderPipeline = rp; + } + + public override bool AlwaysVisible => true; + + public bool GUIEnabled(SerializedProperty property) + { + return _Inverted != property.propertyType switch + { + // Enable GUI if int value of field is not equal to 0, or whatever the disable-value is set to + SerializedPropertyType.Integer => property.intValue != ((int?)_DisableValue ?? 0), + // Enable GUI if disable-value is 0 and field is true, or disable-value is not 0 and field is false + SerializedPropertyType.Boolean => property.boolValue ^ (((int?)_DisableValue ?? 0) != 0), + SerializedPropertyType.Float => property.floatValue != ((float?)_DisableValue ?? 0), + SerializedPropertyType.String => property.stringValue != ((string)_DisableValue ?? ""), + // Must pass nameof enum entry as we are comparing names because index != value. + SerializedPropertyType.Enum => property.enumNames[property.enumValueIndex] != ((string)_DisableValue ?? ""), + SerializedPropertyType.ObjectReference => property.objectReferenceValue != null, + SerializedPropertyType.ManagedReference => property.managedReferenceValue != null, + _ => throw new ArgumentException($"Crest.Predicated: property type on {property.serializedObject.targetObject} not implemented yet: {property.propertyType}."), + }; + } + + internal override void Decorate(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer) + { + var enabled = true; + + if (_Mode == Mode.Property) + { + var propertyPath = _PropertyName; + + if (property.depth > 0) + { + // Get the property path so we can find it from the serialized object. + propertyPath = $"{string.Join(".", property.propertyPath.Split(".", StringSplitOptions.None)[0..^1])}.{propertyPath}"; + } + + // Get the other property to be the predicate for the enabled/disabled state of this property. + // Do not use property.FindPropertyRelative as it does not work with nested properties. + // Try and find the nested property first and then fallback to the root object. + var otherProperty = property.serializedObject.FindProperty(propertyPath) ?? property.serializedObject.FindProperty(_PropertyName); + Debug.AssertFormat(otherProperty != null, "Crest.Predicated: {0} or {1} property on {2} ({3}) could not be found!", propertyPath, _PropertyName, property.serializedObject.targetObject.GetType(), property.name); + + if (otherProperty != null) + { + enabled = GUIEnabled(otherProperty); + } + } + else if (_Mode == Mode.Member) + { + // Static is both abstract and sealed: https://stackoverflow.com/a/1175950 + object @object = _Type.IsAbstract && _Type.IsSealed ? null : property.serializedObject.targetObject; + + // If this is a nested type, grab that type. This may not be suitable in all cases. + if (property.depth > 0) + { + // Get the property path so we can find it from the serialized object. + var propertyPath = string.Join(".", property.propertyPath.Split(".", StringSplitOptions.None)[0..^1]); + + var otherProperty = property.serializedObject.FindProperty(propertyPath); + + @object = otherProperty.propertyType switch + { + SerializedPropertyType.ManagedReference => otherProperty.managedReferenceValue, + SerializedPropertyType.Generic => otherProperty.boxedValue, + _ => @object, + }; + } + + if (_Member is PropertyInfo autoProperty) + { + // == operator does not work. + enabled = !autoProperty.GetValue(@object).Equals(_DisableValue); + } + else if (_Member is MethodInfo method) + { + enabled = !method.Invoke(@object, new object[] { }).Equals(_DisableValue); + } + + if (_Inverted) enabled = !enabled; + } + else if (_Mode == Mode.Type) + { + var type = property.serializedObject.targetObject.GetType(); + + // If this is a nested type, grab that type. This may not be suitable in all cases. + if (property.depth > 0) + { + // Get the property path so we can find it from the serialized object. + var propertyPath = string.Join(".", property.propertyPath.Split(".", StringSplitOptions.None)[0..^1]); + + var otherProperty = property.serializedObject.FindProperty(propertyPath); + + type = otherProperty.propertyType switch + { + SerializedPropertyType.ManagedReference => otherProperty.managedReferenceValue.GetType(), + SerializedPropertyType.Generic => otherProperty.boxedValue.GetType(), + _ => type, + }; + } + + var enabledByTypeCheck = _Type.IsAssignableFrom(type); + if (_Inverted) enabledByTypeCheck = !enabledByTypeCheck; + enabled = enabledByTypeCheck && enabled; + } + else if (_Mode == Mode.RenderPipeline) + { + enabled = RenderPipelineHelper.RenderPipeline == _RenderPipeline != _Inverted; + } + + // Keep current disabled state. + GUI.enabled &= enabled; + + // Keep previous hidden state. + DecoratedDrawer.s_HideInInspector = DecoratedDrawer.s_HideInInspector || (_Hide && !enabled); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Predicated.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Predicated.cs.meta new file mode 100644 index 0000000..983ac93 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Predicated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a36938141700f4f47b31f7565311ace0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/DecoratedDrawer.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/DecoratedDrawer.cs new file mode 100644 index 0000000..48088bb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/DecoratedDrawer.cs @@ -0,0 +1,229 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Adapted from: +// https://forum.unity.com/threads/drawing-a-field-using-multiple-property-drawers.479377/ + +// This class draws all the attributes which inherit from DecoratedProperty. This class may need to be +// extended to handle reseting GUI states as we need them. + +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using UnityEngine.Events; +using WaveHarmonic.Crest.Attributes; + +namespace WaveHarmonic.Crest.Editor +{ + [CustomPropertyDrawer(typeof(DecoratedProperty), true)] + sealed class DecoratedDrawer : PropertyDrawer + { + internal static bool s_HideInInspector = false; + public static bool s_IsFoldout = false; + public static bool s_IsFoldoutOpen = false; + + public static bool s_TemporaryColor; + public static Color s_PreviousColor; + + public float Space { get; private set; } + + List _Decorators = null; + List Decorators + { + get + { + // Populate list with decorators. + _Decorators ??= fieldInfo + .GetCustomAttributes(typeof(Decorator), false) + .ToList(); + + return _Decorators; + } + } + + List _Validators = null; + List Validators => _Validators ??= fieldInfo + .GetCustomAttributes(typeof(Attributes.Validator), false) + .Cast() + .ToList(); + + static List<(MethodInfo, OnChange)> s_OnChangeHandlers; + static List<(MethodInfo, OnChange)> OnChangeHandlers => s_OnChangeHandlers ??= TypeCache + .GetMethodsWithAttribute() + .Select(x => (x, x.GetCustomAttribute())) + .ToList(); + + [InitializeOnLoadMethod] + static void OnDomainReload() + { + s_OnChangeHandlers = null; + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + // Make original control rectangle be invisible because we always create our own. Zero still adds a little + // height which becomes noticeable once multiple properties are hidden. This could be some GUI style + // property but could not find which one. + return -2f; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + // Store the original GUI state so it can be reset later. + var originalColor = GUI.color; + var originalEnabled = GUI.enabled; + + if (s_TemporaryColor) GUI.color = s_PreviousColor; + + // Execute all non visual attributes like Predicated. If these change any IMGUI + // properties they might be overriden with EditorGUI.GetPropertyHeight call. + for (var index = 0; index < Decorators.Count; index++) + { + var attribute = (Decorator)Decorators[index]; + if (!attribute.AlwaysVisible) continue; + attribute.Decorate(position, property, label, this); + } + + Space = 0; + + // Execute all labels + for (var index = 0; index < Decorators.Count; index++) + { + var attribute = (Decorator)Decorators[index]; + if (attribute is Space space) Space = space._Height; + label = attribute.BuildLabel(label); + } + + if (!s_HideInInspector && (!s_IsFoldout || s_IsFoldoutOpen)) + { + // Execute all visual attributes. + for (var index = 0; index < Decorators.Count; index++) + { + var attribute = (Decorator)Decorators[index]; + if (attribute.AlwaysVisible) continue; + attribute.Decorate(position, property, label, this); + } + + var a = (DecoratedProperty)attribute; + position = a.NeedsControlRectangle(property) + ? EditorGUILayout.GetControlRect(true, EditorGUI.GetPropertyHeight(property, label, true)) + : position; + + // Call for labels again as EditorGUI.GetPropertyHeight will revert them. + // Specifically for nested classes where the label will revert once opened. + for (var index = 0; index < Decorators.Count; index++) + { + var attribute = (Decorator)Decorators[index]; + if (attribute.AlwaysVisible) continue; + label = attribute.BuildLabel(label); + } + + var skipChange = fieldInfo.FieldType == typeof(UnityEvent); + + if (!skipChange) + { + EditorGUI.BeginChangeCheck(); + } + + var oldValue = skipChange ? null : property.boxedValue; + a.OnGUI(position, property, label, this); + + for (var index = 0; index < Validators.Count; index++) + { + Validators[index].Validate(position, property, label, this, oldValue); + } + + // Guard against foldouts triggering change check due to changing isExpanded. + if (!skipChange && EditorGUI.EndChangeCheck() && oldValue != property.boxedValue) + { + // Apply any changes. + property.serializedObject.ApplyModifiedProperties(); + + OnChange(property, oldValue); + } + + for (var index = 0; index < Decorators.Count; index++) + { + var attribute = (Decorator)Decorators[index]; + if (attribute.AlwaysVisible) continue; + attribute.DecorateAfter(position, property, label, this); + } + } + + if (!s_IsFoldout || s_IsFoldoutOpen) + { + for (var index = 0; index < Decorators.Count; index++) + { + var attribute = (Decorator)Decorators[index]; + if (!attribute.AlwaysVisible) continue; + attribute.DecorateAfter(position, property, label, this); + } + } + + // Handle resetting the GUI state. + s_HideInInspector = false; + GUI.color = originalColor; + GUI.enabled = originalEnabled; + } + + public static void OnChange(SerializedProperty property, object oldValue) + { + var target = property.serializedObject.targetObject; + // This is the type the field is declared on so it will work for nested objects. + var targetType = target.GetType(); + + var isActive = true; + if (property.serializedObject.targetObject is Crest.Internal.EditorBehaviour c && !c.isActiveAndEnabled) + { + isActive = false; + } + + // Send event to target. + foreach (var (method, attribute) in OnChangeHandlers) + { + if (attribute.SkipIfInactive && !isActive) continue; + var type = attribute.Type ?? method.DeclaringType; + if (!type.IsAssignableFrom(targetType)) continue; + + if (attribute.Type == null) + { + method.Invoke(target, new object[] { property.propertyPath, oldValue }); + } + else + { + method.Invoke(null, new object[] { target, property.propertyPath, oldValue, property }); + } + } + + // Propagate event to nested classes. + for (var i = 0; i < property.depth; i++) + { + var chunks = property.propertyPath.Split("."); + var nestedProperty = property.serializedObject.FindProperty(string.Join(".", chunks[..(i + 1)])); + if (nestedProperty.propertyType != SerializedPropertyType.ManagedReference) continue; + var relativePath = string.Join(".", chunks[(i + 1)..]); + + var nestedTarget = nestedProperty.managedReferenceValue; + var nestedTargetType = nestedTarget.GetType(); + + foreach (var (method, attribute) in OnChangeHandlers) + { + if (attribute.SkipIfInactive && !isActive) continue; + var type = attribute.Type ?? method.DeclaringType; + if (!type.IsAssignableFrom(nestedTargetType)) continue; + + if (attribute.Type == null) + { + method.Invoke(nestedTarget, new object[] { relativePath, oldValue }); + } + else + { + method.Invoke(null, new object[] { nestedTarget, relativePath, oldValue, property }); + } + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/DecoratedDrawer.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/DecoratedDrawer.cs.meta new file mode 100644 index 0000000..3280a3b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/DecoratedDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb1d9ebb9335a411586a683ac6f78acd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/EmbeddedAssetHelpers.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/EmbeddedAssetHelpers.cs new file mode 100644 index 0000000..319d41c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/EmbeddedAssetHelpers.cs @@ -0,0 +1,265 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// This file is subject to the Unity Companion License: +// https://github.com/Unity-Technologies/com.unity.cinemachine/blob/593fa283bee378322337e5d9f5a7b91331a45799/LICENSE.md + +// Lovingly adapted from Cinemachine: +// https://github.com/Unity-Technologies/com.unity.cinemachine/blob/593fa283bee378322337e5d9f5a7b91331a45799/Editor/Utility/EmbeddedAssetHelpers.cs + +using System.Reflection; +using UnityEditor; +using UnityEditor.VersionControl; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ + /// + /// Interface for editors that receive an argument + /// + interface IEmbeddableEditor + { + void SetTypeOfHostComponent(System.Type hostType); + } + + /// + /// Helper for drawing embedded asset editors + /// + sealed class EmbeddedAssetEditor + { + /// + /// Create in OnEnable() + /// + public EmbeddedAssetEditor() + { + _CreateButtonGUIContent = new("Create Asset", "Create a new shared settings asset"); + } + + /// + /// Called after the asset editor is created, in case it needs + /// to be customized + /// + public OnCreateEditorDelegate _OnCreateEditor; + public delegate void OnCreateEditorDelegate(UnityEditor.Editor editor); + + /// + /// Called when the asset being edited was changed by the user. + /// + public OnChangedDelegate _OnChanged; + public delegate void OnChangedDelegate(System.Type type, Object obj); + + /// + /// Free the resources in OnDisable() + /// + public void OnDisable() + { + DestroyEditor(); + Helpers.Destroy(_DefaultTarget); + } + + /// + /// Customize this after creation if you want + /// + public GUIContent _CreateButtonGUIContent; + + UnityEditor.Editor _Editor = null; + + System.Type _Type; + + Object _DefaultTarget; + FieldInfo _DefaultTargetField; + + const int k_IndentOffset = 3; + + public void DrawEditorCombo(Embedded embedded, GUIContent label, PropertyDrawer drawer, SerializedProperty property, string extension) + { + _Type = drawer.fieldInfo.FieldType; + + DrawEditorCombo + ( + embedded, + label, + $"Create {property.displayName} Asset", + $"{property.displayName.Replace(' ', '_')}", + extension, + string.Empty, + false, + property + ); + } + + /// + /// Call this from OnInspectorGUI. Will draw the asset reference field, and + /// the embedded editor, or a Create Asset button, if no asset is set. + /// + public void DrawEditorCombo + ( + Embedded embedded, + GUIContent label, + string title, + string defaultName, + string extension, + string message, + bool indent, + SerializedProperty property + ) + { + UpdateEditor(property, embedded); + + EditorGUI.BeginChangeCheck(); + var rect = AssetField(label, property, title, defaultName, extension, message); + + if (EditorGUI.EndChangeCheck()) + { + property.serializedObject.ApplyModifiedProperties(); + UpdateEditor(property, embedded); + } + + // Display embedded editor. + if (_Editor != null) + { + var foldoutRect = new Rect(rect.x - k_IndentOffset, rect.y, rect.width + k_IndentOffset, EditorGUIUtility.singleLineHeight); + property.isExpanded = EditorGUI.Foldout(foldoutRect, property.isExpanded, GUIContent.none, true); + + var canEditAsset = AssetDatabase.IsOpenForEdit(_Editor.target, StatusQueryOptions.UseCachedIfPossible); + + // We take the current GUI state into account to support attribute stacking. + var guiEnabled = GUI.enabled; + GUI.enabled = guiEnabled && canEditAsset; + + if (property.isExpanded) + { + var level = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + EditorGUILayout.BeginHorizontal(); + // NOTE: Tweaked for current usage but probably will not work everywhere. + if (level > 0) GUILayout.Space(8 * (level + 2)); + EditorGUILayout.BeginVertical(GUI.skin.box); + + if ((_Editor.target.hideFlags & HideFlags.NotEditable) == 0) + { + EditorGUILayout.HelpBox("This is a shared asset. Changes made here will apply to all users of this asset.", MessageType.Info); + } + EditorGUI.BeginChangeCheck(); + _Editor.OnInspectorGUI(); + if (EditorGUI.EndChangeCheck() && (_OnChanged != null)) + _OnChanged(_Type, property.objectReferenceValue); + EditorGUILayout.EndVertical(); + EditorGUILayout.EndHorizontal(); + + if (embedded.BottomMargin > 0) + { + EditorGUILayout.Space(embedded.BottomMargin); + } + } + + // Enable GUI so the checkout button works. + GUI.enabled = true; + + if (_Editor.target != null) + { + if (!canEditAsset && GUILayout.Button("Check out")) + { + var task = Provider.Checkout(AssetDatabase.GetAssetPath(_Editor.target), CheckoutMode.Asset); + task.Wait(); + } + } + + // Restore stacked GUI enabled state. + GUI.enabled = guiEnabled; + } + } + + Rect AssetField + ( + GUIContent label, + SerializedProperty property, + string title, + string defaultName, + string extension, + string message + ) + { + return EditorHelpers.AssetField + ( + _Type, + label, + property, + EditorGUILayout.GetControlRect(true), + title, + defaultName, + extension, + message, + x => ScriptableObject.CreateInstance(_Type) + ); + } + + public void DestroyEditor() + { + if (_Editor != null) + { + Object.DestroyImmediate(_Editor); + _Editor = null; + } + } + + public void UpdateEditor(SerializedProperty property, Embedded embedded) + { + var target = property.objectReferenceValue; + var hasDefaultField = !string.IsNullOrEmpty(embedded.DefaultPropertyName); + + if (target == null) + { + if (!hasDefaultField) + { + if (_DefaultTarget == null) + { + _DefaultTarget = ScriptableObject.CreateInstance(_Type); + _DefaultTarget.hideFlags = HideFlags.DontSave | HideFlags.NotEditable; + } + } + else + { + if (_DefaultTargetField == null) + { + _DefaultTargetField = property.serializedObject.targetObject.GetType().GetField(embedded.DefaultPropertyName, Helpers.s_AnyMethod); + } + + // Always call, as it is dynamic. + _DefaultTarget = (Object)_DefaultTargetField.GetValue(property.serializedObject.targetObject); + } + } + + if (target == null) + { + target = _DefaultTarget; + } + + // Destroy the editor if target has changed. + if (_Editor != null && _Editor.target != target) + { + DestroyEditor(); + } + + if (_Editor != null) + { + return; + } + + // NOTE: This is triggered twice on asset switch for some reason. + // Create editor if need one. + if (target != null) + { + _Editor = UnityEditor.Editor.CreateEditor(target); + + // Pass through argument for editors that receive it + if (property.serializedObject.targetObject != null) + { + (_Editor as IEmbeddableEditor)?.SetTypeOfHostComponent(property.serializedObject.targetObject.GetType()); + } + + _OnCreateEditor?.Invoke(_Editor); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/EmbeddedAssetHelpers.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/EmbeddedAssetHelpers.cs.meta new file mode 100644 index 0000000..afe17f0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/EmbeddedAssetHelpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13b989c062ddf461a9afd71ab6da8921 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Helpers.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Helpers.cs new file mode 100644 index 0000000..7464fbd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Helpers.cs @@ -0,0 +1,488 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Reflection; +using System.Text.RegularExpressions; +using UnityEditor; +using UnityEditor.Rendering; +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest.Editor +{ + /// + /// Provides general helper functions for the editor. + /// + static partial class EditorHelpers + { + internal static ComputeShader s_VisualizeNegativeValuesShader; + internal static ComputeShader VisualizeNegativeValuesShader + { + get + { + if (s_VisualizeNegativeValuesShader == null) + { + s_VisualizeNegativeValuesShader = AssetDatabase.LoadAssetAtPath("Packages/com.waveharmonic.crest/Editor/Shaders/VisualizeNegativeValues.compute"); + } + + return s_VisualizeNegativeValuesShader; + } + } + + public static LayerMask LayerMaskField(string label, LayerMask layerMask) + { + // Adapted from: http://answers.unity.com/answers/1387522/view.html + var temporary = EditorGUILayout.MaskField( + label, + UnityEditorInternal.InternalEditorUtility.LayerMaskToConcatenatedLayersMask(layerMask), + UnityEditorInternal.InternalEditorUtility.layers); + return UnityEditorInternal.InternalEditorUtility.ConcatenatedLayersMaskToLayerMask(temporary); + } + + /// Attempts to get the scene view this camera is rendering. + /// The scene view or null if not found. + public static SceneView GetSceneViewFromSceneCamera(Camera camera) + { + foreach (SceneView sceneView in SceneView.sceneViews) + { + if (sceneView.camera == camera) + { + return sceneView; + } + } + + return null; + } + + /// Get time passed to animated materials. + public static float GetShaderTime() + { + // When "Always Refresh" is disabled, Unity passes zero. Also uses realtimeSinceStartup: + // https://github.com/Unity-Technologies/Graphics/blob/5743e39cdf0795cf7cbeb7ba8ffbbcc7ca200709/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs#L116 + return !Application.isPlaying && SceneView.lastActiveSceneView != null && + !SceneView.lastActiveSceneView.sceneViewState.alwaysRefresh ? 0f : Time.realtimeSinceStartup; + } + + public static GameObject GetGameObject(SerializedObject serializedObject) + { + // We will either get the component or the GameObject it is attached to. + return serializedObject.targetObject is GameObject + ? serializedObject.targetObject as GameObject + : (serializedObject.targetObject as Component).gameObject; + } + + public static Material CreateSerializedMaterial(string shaderPath, string message) + { + var shader = Shader.Find(shaderPath); + Debug.Assert(shader != null, "Crest: Cannot create required material because shader is null"); + + var material = new Material(shader); + + // Record the material and any subsequent changes. + Undo.RegisterCreatedObjectUndo(material, message); + Undo.RegisterCompleteObjectUndo(material, message); + + return material; + } + + public static Material CreateSerializedMaterial(string shaderPath) + { + return CreateSerializedMaterial(shaderPath, Undo.GetCurrentGroupName()); + } + + public static Object GetDefaultReference(this SerializedObject self, string property) + { + var path = AssetDatabase.GetAssetPath(MonoScript.FromMonoBehaviour(self.targetObject as MonoBehaviour)); + var importer = AssetImporter.GetAtPath(path) as MonoImporter; + return importer.GetDefaultReference(property); + } + + public static object GetDefiningBoxedObject(this SerializedProperty property) + { + object target = property.serializedObject.targetObject; + + if (property.depth > 0) + { + // Get the property path so we can find it from the serialized object. + var path = string.Join(".", property.propertyPath.Split(".", System.StringSplitOptions.None)[0..^1]); + var other = property.serializedObject.FindProperty(path); + // Boxed value can handle both managed and generic with caveats: + // https://docs.unity3d.com/ScriptReference/SerializedProperty-boxedValue.html + // Not sure if it will be a new or same instance as in the scene. + target = other.boxedValue; + } + + return target; + } + + internal delegate Object CreateInstance(SerializedProperty property); + + internal static Rect AssetField + ( + System.Type type, + GUIContent label, + SerializedProperty property, + Rect rect, + string title, + string defaultName, + string extension, + string message, + CreateInstance create + ) + { + var hSpace = 5; + var buttonWidth = 45; + var buttonCount = 2; + + rect.width -= buttonWidth * buttonCount + hSpace; + EditorGUI.PropertyField(rect, property, label); + + var r = new Rect(rect); + + r.x += r.width + hSpace; + r.width = buttonWidth; + if (GUI.Button(r, "New", EditorStyles.miniButtonLeft)) + { + var path = EditorUtility.SaveFilePanelInProject(title, defaultName, extension, message); + if (!string.IsNullOrEmpty(path)) + { + var asset = create(property); + if (asset != null) + { + if (extension == "prefab") + { + PrefabUtility.SaveAsPrefabAsset(asset as GameObject, path); + } + else + { + AssetDatabase.CreateAsset(asset, path); + } + + property.objectReferenceValue = AssetDatabase.LoadAssetAtPath(path); + property.serializedObject.ApplyModifiedProperties(); + } + else + { + Debug.LogError($"Crest: Could not create file"); + } + } + } + + // Only allow cloning if extensions match. Guards against cloning Shader Graph if + // using its embedded material. + var cloneable = property.objectReferenceValue != null; + cloneable = cloneable && Path.GetExtension(AssetDatabase.GetAssetPath(property.objectReferenceValue)) == $".{extension}"; + + EditorGUI.BeginDisabledGroup(!cloneable); + r.x += r.width; + if (GUI.Button(r, "Clone", EditorStyles.miniButtonRight)) + { + var oldPath = AssetDatabase.GetAssetPath(property.objectReferenceValue); + var newPath = oldPath; + if (!newPath.StartsWithNoAlloc("Assets")) newPath = Path.Join("Assets", Path.GetFileName(newPath)); + newPath = AssetDatabase.GenerateUniqueAssetPath(newPath); + AssetDatabase.CopyAsset(oldPath, newPath); + property.objectReferenceValue = AssetDatabase.LoadAssetAtPath(newPath); + } + EditorGUI.EndDisabledGroup(); + + return rect; + } + + internal static void RichTextHelpBox(string message, MessageType type) + { + var styleRichText = GUI.skin.GetStyle("HelpBox").richText; + GUI.skin.GetStyle("HelpBox").richText = true; + + EditorGUILayout.HelpBox(message, type); + + // Revert skin since it persists. + GUI.skin.GetStyle("HelpBox").richText = styleRichText; + } + + // Prettify nameof. + internal static string Pretty(this string text) + { + // Regular expression to split on transitions from lower to upper case and keep acronyms together + return Regex.Replace(text, @"([a-z])([A-Z])|([A-Z])([A-Z][a-z])", "$1$3 $2$4").Replace("_", ""); + } + + internal static string Italic(this string text) + { + return $"{text}"; + } + + public static void MarkCurrentStageAsDirty() + { + var stage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage(); + + if (stage != null) + { + UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(stage.scene); + } + else + { + UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEngine.SceneManagement.SceneManager.GetActiveScene()); + } + } + } + + static partial class Extensions + { + internal static string GetSubShaderTag([DisallowNull] this Shader shader, ShaderSnippetData snippet, ShaderTagId id) + { + var data = ShaderUtil.GetShaderData(shader); + if (data == null) return null; + + var index = (int)snippet.pass.SubshaderIndex; + if (index < 0 || index >= shader.subshaderCount) return null; + + var subShader = data.GetSerializedSubshader(index); + if (subShader == null) return null; + + var tag = subShader.FindTagValue(id); + if (string.IsNullOrEmpty(tag.name)) return null; + + return tag.name; + } + } + + static partial class EditorHelpers + { + const int k_ButtonDropDownWidth = 15; + + static readonly GUIContent s_ButtonDropDownIcon = new(EditorGUIUtility.FindTexture("icon dropdown@2x")); + static readonly PropertyInfo s_TopLevel = typeof(GUILayoutUtility).GetProperty("topLevel", BindingFlags.NonPublic | BindingFlags.Static); + static readonly MethodInfo s_GetLast = typeof(GUILayoutUtility).Assembly.GetType("UnityEngine.GUILayoutGroup").GetMethod("GetLast", BindingFlags.Public | BindingFlags.Instance); + + // Only way to identify the caller is its rect. + static Rect s_ButtonChooser; + static int s_ButtonChoice = -2; + + // Normal button or split button with dropdown. + public static bool Button + ( + GUIContent label, + out int choice, + string[] labels, + bool disableMain = false, + bool disableDropDown = false, + bool centerLabel = false, + bool expandWidth = true, + int minimumWidth = 0 + ) + { + choice = -2; + var chosen = false; + + var hasDropDown = labels?.Length > 0; + var skin = GUI.skin.button; + + using (new EditorGUI.DisabledGroupScope(disableMain)) + { + var style = new GUIStyle(hasDropDown ? EditorStyles.miniButtonLeft : EditorStyles.miniButton) + { + padding = skin.padding, + stretchHeight = skin.stretchHeight, + fixedHeight = skin.fixedHeight + }; + + var width = style.CalcSize(label).x + style.padding.left + + style.padding.right + style.border.left + style.border.right; + width = Mathf.Max(width, minimumWidth); + // TODO: Add option to disable this (consistent width). + if (!hasDropDown && minimumWidth > 0) width += k_ButtonDropDownWidth; + if (centerLabel && hasDropDown) style.padding.left += k_ButtonDropDownWidth; + + if (GUILayout.Button(label, style, expandWidth ? GUILayout.ExpandWidth(true) : GUILayout.Width(width))) + { + choice = -1; + chosen = true; + } + } + + if (hasDropDown) + { + using (new EditorGUI.DisabledGroupScope(disableDropDown)) + { + // TODO: color interior border same as exterior (lighten). + var style = new GUIStyle(EditorStyles.miniButtonRight) + { + padding = new(1, 1, 3, 3), + stretchHeight = skin.stretchHeight, + fixedHeight = skin.fixedHeight + }; + + var rect = (Rect)s_GetLast.Invoke(s_TopLevel.GetValue(null), null); + rect.width += k_ButtonDropDownWidth; + + if (s_ButtonChoice > -1 && s_ButtonChooser == rect) + { + choice = s_ButtonChoice; + chosen = true; + s_ButtonChoice = -2; + s_ButtonChooser = Rect.zero; + } + + if (GUILayout.Button(s_ButtonDropDownIcon, style, GUILayout.Width(k_ButtonDropDownWidth), GUILayout.ExpandHeight(true))) + { + var menu = new GenericMenu(); + + for (var i = 0; i < labels.Length; i++) + { + menu.AddItem(new(labels[i]), false, x => { s_ButtonChoice = (int)x; s_ButtonChooser = rect; }, i); + } + + menu.DropDown(rect); + } + } + } + + return chosen; + } + } + + static partial class EditorHelpers + { + // Adapted from (public API may support this in future): + // com.unity.splines@2.7.2/Editor/Components/SplineContainerEditor.cs + static GUIStyle s_HelpLabelStyle; + static GUIStyle HelpLabelStyle => s_HelpLabelStyle ??= new(EditorStyles.label) + { + wordWrap = EditorStyles.helpBox.wordWrap, + fontSize = EditorStyles.helpBox.fontSize, + padding = new(-2, 0, 0, 0), + richText = true, + }; + + static readonly MethodInfo s_GetHelpIcon = typeof(EditorGUIUtility).GetMethod("GetHelpIcon", BindingFlags.Static | BindingFlags.NonPublic); + + internal static int? HelpBox + ( + GUIContent message, + MessageType type, + GUIContent button = null, + string[] buttons = null, + bool buttonCenterLabel = false, + int buttonMinimumWidth = 0 + ) + { + return HelpBox + ( + message, + new GUIContent((Texture2D)s_GetHelpIcon.Invoke(null, new object[] { type })), + button, + buttons, + buttonCenterLabel, + buttonMinimumWidth + ); + } + + internal static int? HelpBox + ( + GUIContent message, + GUIContent icon, + GUIContent button = null, + string[] buttons = null, + bool buttonCenterLabel = false, + int buttonMinimumWidth = 0 + ) + { + int? result = null; + + // Box + EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); + + // Icon + EditorGUIUtility.SetIconSize(new(32f, 32f)); + EditorGUILayout.LabelField(icon, GUILayout.Width(34), GUILayout.MinHeight(34), GUILayout.ExpandHeight(true)); + EditorGUIUtility.SetIconSize(Vector2.zero); + + // Text + EditorGUILayout.LabelField(message, HelpLabelStyle, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + + // Button + if (button != null) + { + GUILayout.FlexibleSpace(); + + EditorGUILayout.BeginVertical(); + GUILayout.FlexibleSpace(); + + EditorGUILayout.BeginHorizontal(); + + if (Button(button, out var choice, buttons, centerLabel: buttonCenterLabel, minimumWidth: buttonMinimumWidth, expandWidth: false)) + { + result = choice; + } + + EditorGUILayout.EndHorizontal(); + + GUILayout.FlexibleSpace(); + EditorGUILayout.EndVertical(); + + } + + EditorGUILayout.EndHorizontal(); + + return result; + } + } + + namespace Internal + { + static class Extensions + { + // Recursively find the field owner (instance). + public static bool FindOwner(this FieldInfo field, ref object target) + { + if (field.DeclaringType.IsAssignableFrom(target.GetType())) + { + return true; + } + + return field.FindOwnerInFields(ref target); + } + + public static bool FindOwnerInFields(this FieldInfo targetField, ref object target) + { + if (target == null) + { + return false; + } + + var fields = target.GetType() + .GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + + foreach (var field in fields) + { + if (field.GetCustomAttribute() == null) + { + continue; + } + + var value = field.GetValue(target); + if (value == null) + { + continue; + } + + if (targetField.DeclaringType.IsAssignableFrom(value.GetType())) + { + target = value; + return true; + } + + if (FindOwnerInFields(targetField, ref value)) + { + return true; + } + } + + return false; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Helpers.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Helpers.cs.meta new file mode 100644 index 0000000..5d0e431 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Helpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19e5156bd1ea44af484895930b902df7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.Validation.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.Validation.cs new file mode 100644 index 0000000..9141083 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.Validation.cs @@ -0,0 +1,159 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Text.RegularExpressions; +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ + partial class Inspector + { + static readonly string[] s_FixButtonDropDown = { "Inspect" }; + static readonly GUIContent s_FixButtonContent = new("Fix"); + static readonly GUIContent s_InspectButtonContent = new("Inspect", "Jump to object to resolve issue."); + + protected virtual void RenderValidationMessages() + { + // This is a static list so we need to clear it before use. Not sure if this will ever be a threaded + // operation which would be an issue. + foreach (var messages in ValidatedHelper.s_Messages) + { + messages.Clear(); + } + + ValidatedHelper.ExecuteValidators(target, ValidatedHelper.HelpBox); + + // We only want space before and after the list of help boxes. We don't want space between. + var needsSpaceAbove = true; + + // Work out if button label needs aligning. + var needsAlignment = false; + var hasBoth = false; + var hasEither = false; + for (var messageTypeIndex = 0; messageTypeIndex < ValidatedHelper.s_Messages.Length; messageTypeIndex++) + { + var messages = ValidatedHelper.s_Messages[messageTypeIndex]; + + if (messages.Count > 0) + { + var messageType = (MessageType)ValidatedHelper.s_Messages.Length - messageTypeIndex; + + foreach (var message in messages) + { + var hasFix = message._Action != null; + var hasInspect = false; + + if (message._Object != null) + { + var casted = message._Object as MonoBehaviour; + + if (Selection.activeObject != message._Object && (casted == null || casted.gameObject != Selection.activeObject)) + { + hasInspect = true; + } + } + + if (hasFix && hasInspect) hasBoth = true; + if (hasInspect != hasFix) hasEither = true; + if (hasBoth && hasEither) goto exit; + } + } + } + + exit: + needsAlignment = hasBoth && hasEither; + + // We loop through in reverse order so errors appears at the top. + for (var messageTypeIndex = 0; messageTypeIndex < ValidatedHelper.s_Messages.Length; messageTypeIndex++) + { + var messages = ValidatedHelper.s_Messages[messageTypeIndex]; + + if (messages.Count > 0) + { + if (needsSpaceAbove) + { + EditorGUILayout.Space(); + needsSpaceAbove = false; + } + + // Map Validated.MessageType to HelpBox.MessageType. + var messageType = (MessageType)ValidatedHelper.s_Messages.Length - messageTypeIndex; + + foreach (var message in messages) + { + EditorGUILayout.BeginHorizontal(); + + var originalGUIEnabled = GUI.enabled; + + if ((message._Action == ValidatedHelper.FixAddMissingMathPackage || message._Action == ValidatedHelper.FixAddMissingBurstPackage) && PackageManagerHelpers.IsBusy) + { + GUI.enabled = false; + } + + if (message._FixDescription != null) + { + var sanitized = Regex.Replace(message._FixDescription, @"<[^<>]*>", "'"); + s_FixButtonContent.tooltip = $"Fix: {sanitized}"; + } + else + { + s_FixButtonContent.tooltip = "Fix issue"; + } + + var canFix = message._Action != null; + var canInspect = false; + + // Jump to object button. + if (message._Object != null) + { + // Selection.activeObject can be message._object.gameObject instead of the component + // itself. We soft cast to MonoBehaviour to get the gameObject for comparison. + // Alternatively, we could always pass gameObject instead of "this". + var casted = message._Object as MonoBehaviour; + + if (Selection.activeObject != message._Object && (casted == null || casted.gameObject != Selection.activeObject)) + { + canInspect = true; + } + } + + var result = EditorHelpers.HelpBox + ( + new($"{message._Message} {message._FixDescription}"), + messageType, + canFix ? s_FixButtonContent : canInspect ? s_InspectButtonContent : null, + buttons: canInspect && canFix ? s_FixButtonDropDown : null, + buttonCenterLabel: needsAlignment, + buttonMinimumWidth: 72 + ); + + if (canFix && result == -1) + { + // Run fix function. + var serializedObject = new SerializedObject(message._Object); + // Property is optional. + var property = message._PropertyPath != null ? serializedObject?.FindProperty(message._PropertyPath) : null; + var oldValue = property?.boxedValue; + message._Action.Invoke(serializedObject, property); + if (serializedObject.ApplyModifiedProperties()) + { + // SerializedObject does this for us, but gives the history item a nicer label. + Undo.RecordObject(message._Object, s_FixButtonContent.tooltip); + DecoratedDrawer.OnChange(property, oldValue); + } + } + else if (canInspect && result != null) + { + Selection.activeObject = message._Object; + } + + GUI.enabled = originalGUIEnabled; + + EditorGUILayout.EndHorizontal(); + } + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.Validation.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.Validation.cs.meta new file mode 100644 index 0000000..925df2e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.Validation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2125841df4154bd89cf5af6847a0d40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.cs new file mode 100644 index 0000000..c8a6eaf --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.cs @@ -0,0 +1,238 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Editor.Internal; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Editor +{ + /// + /// Base editor. Needed as custom drawers require a custom editor to work. + /// + [CustomEditor(typeof(EditorBehaviour), editorForChildClasses: true)] + partial class Inspector : UnityEditor.Editor + { + public const int k_FieldGroupOrder = 1000; + const string k_NoPrefabModeSupportWarning = "Prefab mode is not supported. Changes made in prefab mode will not be reflected in the scene view. Save this prefab to see changes."; + + internal static Inspector Current { get; private set; } + + readonly Dictionary _MaterialOwners = new(); + readonly Dictionary _MaterialEditors = new(); + + public override bool RequiresConstantRepaint() => TexturePreview.s_ActiveInstance?.Open == true; + + static readonly IOrderedEnumerable s_AttachMaterialEditors = TypeCache + .GetFieldsWithAttribute() + .OrderBy(x => x.GetCustomAttribute().Order); + + readonly Utility.SortedList _Properties = new(Helpers.DuplicateComparison); + + protected virtual void OnEnable() + { + _MaterialOwners.Clear(); + + foreach (var field in s_AttachMaterialEditors) + { + var target = (object)this.target; + + if (field.FindOwner(ref target)) + { + _MaterialOwners.Add(field, target); + } + } + } + + public override void OnInspectorGUI() + { + // Reset foldout values. + DecoratedDrawer.s_IsFoldout = false; + DecoratedDrawer.s_IsFoldoutOpen = false; + + // Make sure we adhere to flags. + var enabled = GUI.enabled; + GUI.enabled = (target.hideFlags & HideFlags.NotEditable) == 0; + + RenderBeforeInspectorGUI(); + RenderInspectorGUI(); + RenderValidationMessages(); + + EditorGUI.BeginDisabledGroup(target is Behaviour component && !component.isActiveAndEnabled); + RenderBottomButtons(); + EditorGUI.EndDisabledGroup(); + + RenderAfterInspectorGUI(); + + GUI.enabled = enabled; + } + + protected virtual void OnDisable() + { + foreach (var (_, editor) in _MaterialEditors) + { + Helpers.Destroy(editor); + } + } + + protected virtual void RenderBeforeInspectorGUI() + { + if (this.target is EditorBehaviour target && target._IsPrefabStageInstance) + { + EditorGUILayout.Space(); + EditorGUILayout.HelpBox(k_NoPrefabModeSupportWarning, MessageType.Warning); + EditorGUILayout.Space(); + } + } + + protected virtual void RenderInspectorGUI() + { + var previous = Current; + Current = this; + + _Properties.Clear(); + + serializedObject.Update(); + + using var iterator = serializedObject.GetIterator(); + if (iterator.NextVisible(true)) + { + var index = 0; + var group = 0; + Type type = null; + + do + { + var property = serializedObject.FindProperty(iterator.name); + if (iterator.name == "m_Script") + { +#if CREST_DEBUG + _Properties.Add(index++, property); +#endif + continue; + } + + var field = property.GetFieldInfo(out _); + + // If field is on a new type (inheritance) then reset the group to prevent group leakage. + if (field.DeclaringType != type) + { + group = 0; + type = field.DeclaringType; + } + + // Null checking but there should always be one DecoratedProperty. + var order = field.GetCustomAttribute()?.order ?? 0; + group = field.GetCustomAttribute()?.order * k_FieldGroupOrder ?? group; + _Properties.Add(order + group + index++, property); + } + while (iterator.NextVisible(false)); + } + + foreach (var (_, property) in _Properties) + { +#if CREST_DEBUG + using (new EditorGUI.DisabledGroupScope(property.name == "m_Script")) +#endif + { + // Only support top level ordering for now. + EditorGUILayout.PropertyField(property, includeChildren: true); + } + } + + // Need to call just in case there is no decorated property. + serializedObject.ApplyModifiedProperties(); + + // Restore previous in case this is a nested editor. + Current = previous; + + // Fixes indented validation etc. + EditorGUI.indentLevel = 0; + } + + protected virtual void RenderBottomButtons() + { + + } + + protected virtual void RenderAfterInspectorGUI() + { + foreach (var mapping in _MaterialOwners) + { + var material = (Material)mapping.Key.GetValue(mapping.Value); + if (material != null) + { + DrawMaterialEditor(material); + } + } + } + + // Adapted from: http://answers.unity.com/answers/975894/view.html + void DrawMaterialEditor(Material material) + { + MaterialEditor editor; + if (!_MaterialEditors.ContainsKey(material)) + { + editor = (MaterialEditor)CreateEditor(material); + _MaterialEditors[material] = editor; + } + else + { + editor = _MaterialEditors[material]; + } + + // Check material again as sometimes null. + if (editor != null && material != null) + { + EditorGUILayout.Space(); + + // Draw the material's foldout and the material shader field. Required to call OnInspectorGUI. + editor.DrawHeader(); + + var path = AssetDatabase.GetAssetPath(material); + + // We need to prevent the user from editing Unity's default materials. + // Check Editor.IsEnabled in Editor.cs for further filtering. + var isEditable = (material.hideFlags & HideFlags.NotEditable) == 0; + +#if !CREST_DEBUG + // Do not allow editing of our assets. + isEditable &= !path.StartsWithNoAlloc("Packages/com.waveharmonic"); +#endif + + using (new EditorGUI.DisabledGroupScope(!isEditable)) + { + // Draw the material properties. Works only if the foldout of DrawHeader is open. + editor.OnInspectorGUI(); + } + } + } + } + + // Adapted from: + // https://gist.github.com/thebeardphantom/1ad9aee0ef8de6271fff39f1a6a3d66d + static partial class Extensions + { + static readonly MethodInfo s_GetFieldInfoFromProperty; + + static Extensions() + { + var utility = typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.ScriptAttributeUtility"); + Debug.Assert(utility != null, "Crest: ScriptAttributeUtility not found!"); + + s_GetFieldInfoFromProperty = utility.GetMethod("GetFieldInfoFromProperty", BindingFlags.NonPublic | BindingFlags.Static); + Debug.Assert(s_GetFieldInfoFromProperty != null, "Crest: GetFieldInfoFromProperty not found!"); + } + + public static FieldInfo GetFieldInfo(this SerializedProperty property, out Type type) + { + type = null; + return (FieldInfo)s_GetFieldInfoFromProperty.Invoke(null, new object[] { property, type }); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.cs.meta new file mode 100644 index 0000000..9e3362c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Inspector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db8aed30f95c447c3b9491865a600372 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/MaterialEditors.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/MaterialEditors.cs new file mode 100644 index 0000000..b3dc848 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/MaterialEditors.cs @@ -0,0 +1,54 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ + /// + /// Adds a deprecated message to shaders. + /// + /// USAGE + /// Add to bottom of Shader block: + /// CustomEditor "Crest.ObsoleteShaderGUI" + /// Optionally add to Properties block: + /// [HideInInspector] _ObsoleteMessage("The additional message.", Float) = 0 + /// + sealed class ObsoleteShaderGUI : ShaderGUI + { + public override void OnGUI(MaterialEditor editor, MaterialProperty[] properties) + { + // Enable rich text in help boxes. Store original so we can revert since this might be a "hack". + var styleRichText = GUI.skin.GetStyle("HelpBox").richText; + GUI.skin.GetStyle("HelpBox").richText = true; + + var message = ""; + + { + var property = FindProperty("_Message", properties, propertyIsMandatory: false); + if (property != null) + { + message += property.displayName; + } + } + + { + var property = FindProperty("_ObsoleteMessage", properties, propertyIsMandatory: false); + if (property != null) + { + message += "This shader is deprecated and will be removed in a future version. " + property.displayName; + } + } + + EditorGUILayout.HelpBox(message, MessageType.Warning); + EditorGUILayout.Space(3f); + + // Revert skin since it persists. + GUI.skin.GetStyle("HelpBox").richText = styleRichText; + + // Render the default GUI. + base.OnGUI(editor, properties); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/MaterialEditors.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/MaterialEditors.cs.meta new file mode 100644 index 0000000..f9e6b2a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/MaterialEditors.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a7b7bf49879b47f5b5e4fe887760848 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/PackageManagerHelpers.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/PackageManagerHelpers.cs new file mode 100644 index 0000000..f47386b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/PackageManagerHelpers.cs @@ -0,0 +1,41 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Helpers for using the Unity Package Manager. + +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEditor.PackageManager.Requests; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ + static class PackageManagerHelpers + { + static AddRequest s_Request; + public static bool IsBusy => s_Request?.IsCompleted == false; + + public static void AddMissingPackage(string packageName) + { + s_Request = Client.Add(packageName); + EditorApplication.update += AddMissingPackageProgress; + } + + static void AddMissingPackageProgress() + { + if (s_Request.IsCompleted) + { + if (s_Request.Status == StatusCode.Success) + { + Debug.Log("Installed: " + s_Request.Result.packageId); + } + else if (s_Request.Status >= StatusCode.Failure) + { + Debug.Log(s_Request.Error.message); + } + + EditorApplication.update -= AddMissingPackageProgress; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/PackageManagerHelpers.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/PackageManagerHelpers.cs.meta new file mode 100644 index 0000000..ea56a93 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/PackageManagerHelpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f5138ba66b6604da09f58ac99ee035f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ScriptingSymbols.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ScriptingSymbols.cs new file mode 100644 index 0000000..f904cef --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ScriptingSymbols.cs @@ -0,0 +1,75 @@ + +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Linq; +using UnityEditor; +using UnityEditor.Build; + +namespace WaveHarmonic.Crest.Editor.Settings +{ + static class ScriptingSymbols + { + static NamedBuildTarget CurrentNamedBuildTarget + { + get + { +#if UNITY_SERVER + return NamedBuildTarget.Server; +#else + return NamedBuildTarget.FromBuildTargetGroup(BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget)); +#endif + } + } + + public static string[] Symbols => PlayerSettings.GetScriptingDefineSymbols(CurrentNamedBuildTarget).Split(';'); + + public static void Add(string[] symbols) + { + // We remove our symbols from the list first to prevent duplicates - just to be safe. + SetScriptingDefineSymbols(Symbols.Except(symbols).Concat(symbols).ToArray()); + } + + public static void Add(string symbol) + { + Add(new string[] { symbol }); + } + + public static void Remove(string[] symbols) + { + SetScriptingDefineSymbols(Symbols.Except(symbols).ToArray()); + } + + public static void Remove(string symbol) + { + Remove(new string[] { symbol }); + } + + public static void Set(string[] symbols, bool enable) + { + if (enable) + { + Add(symbols); + } + else + { + Remove(symbols); + } + } + + public static void Set(string symbol, bool enable) + { + Set(new string[] { symbol }, enable); + } + + static void SetScriptingDefineSymbols(string[] symbols) + { + SetScriptingDefineSymbols(string.Join(";", symbols)); + } + + static void SetScriptingDefineSymbols(string symbols) + { + PlayerSettings.SetScriptingDefineSymbols(CurrentNamedBuildTarget, symbols); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ScriptingSymbols.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ScriptingSymbols.cs.meta new file mode 100644 index 0000000..66bd5bc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ScriptingSymbols.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c03a1671f6a84ed4ac42813e95a07d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGeneratorUtility.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGeneratorUtility.cs new file mode 100644 index 0000000..9ea0dc5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGeneratorUtility.cs @@ -0,0 +1,79 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Exposes a customized version of Unity's shader generator task to only generate +// our source files. + +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using UnityEditor; +using UnityEditor.Rendering; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest.Editor +{ + static class ShaderGeneratorUtility + { + static MethodInfo s_GenerateAsync; + static MethodInfo GenerateAsync => s_GenerateAsync ??= typeof(CSharpToHLSL) + .GetMethod("GenerateAsync", BindingFlags.Static | BindingFlags.NonPublic); + + static async Task InvokeAsync(this MethodInfo methodInfo, object obj, params object[] parameters) + { + dynamic awaitable = methodInfo.Invoke(obj, parameters); + await awaitable; + } + + // Adapted from: + // https://github.com/Unity-Technologies/Graphics/blob/96ba978a240e96adcb2abceb21e90b24caa484a3/Packages/com.unity.render-pipelines.core/Editor/ShaderGenerator/CSharpToHLSL.cs#L18L53 + internal static async Task GenerateAll() + { + Dictionary> sourceGenerators = null; + try + { + // Store per source file path the generator definitions + sourceGenerators = DictionaryPool>.Get(); + + // Extract all types with the GenerateHLSL tag + foreach (var type in TypeCache.GetTypesWithAttribute()) + { + // Only generate our sources as Unity's will trigger a package refresh. + if (!type.FullName.StartsWith("WaveHarmonic.Crest")) continue; + + var attr = type.GetCustomAttributes(typeof(GenerateHLSL), false).First() as GenerateHLSL; + if (!sourceGenerators.TryGetValue(attr.sourcePath, out var generators)) + { + generators = ListPool.Get(); + sourceGenerators.Add(attr.sourcePath, generators); + } + + generators.Add(new(type, attr)); + } + + // We need to force the culture to invariant, otherwise generated code can replace characters. + // For example, Turkish will replace "I" with "İ". This is a bug with GenerateAsync. + var culture = System.Globalization.CultureInfo.CurrentCulture; + System.Globalization.CultureInfo.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; + + // Generate all files + await Task.WhenAll(sourceGenerators.Select(async it => await GenerateAsync + .InvokeAsync(null, new object[] { $"{it.Key}.hlsl", $"{Path.ChangeExtension(it.Key, "custom")}.hlsl", it.Value }))); + + System.Globalization.CultureInfo.CurrentCulture = culture; + } + finally + { + // Make sure we always release pooled resources + if (sourceGenerators != null) + { + foreach (var pair in sourceGenerators) + ListPool.Release(pair.Value); + DictionaryPool>.Release(sourceGenerators); + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGeneratorUtility.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGeneratorUtility.cs.meta new file mode 100644 index 0000000..2fc060a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGeneratorUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2bf974bd66ba04a1aa65908c4308b1b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphLegacySubTarget.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphLegacySubTarget.cs new file mode 100644 index 0000000..989b078 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphLegacySubTarget.cs @@ -0,0 +1,739 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEditor.Rendering.BuiltIn; +using UnityEditor.Rendering.BuiltIn.ShaderGraph; +using UnityEditor.ShaderGraph; +using UnityEngine; +using UnityEngine.Rendering; + +#if UNITY_2022_3_OR_NEWER +using UnityEngine.UIElements; +#else +using UnityEngine.UIElements; +using UnityEditor.UIElements; +#endif + +using UnityBuiltInLitSubTarget = UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInLitSubTarget; + +namespace WaveHarmonic.Crest.Editor.ShaderGraph +{ + sealed class MaterialModificationProcessor : AssetModificationProcessor + { + static void OnWillCreateAsset(string asset) + { + if (!asset.ToLowerInvariant().EndsWith(".mat")) + { + return; + } + + MaterialPostProcessor.s_CreatedAssets.Add(asset); + } + } + + sealed class MaterialPostProcessor : AssetPostprocessor + { + public override int GetPostprocessOrder() + { + return 1; + } + + internal static readonly List s_CreatedAssets = new(); + + static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) + { + foreach (var asset in importedAssets) + { + // We only care about materials + if (!asset.EndsWith(".mat", System.StringComparison.InvariantCultureIgnoreCase)) + { + continue; + } + + // Load the material and look for it's BuiltIn ShaderID. + // We only care about versioning materials using a known BuiltIn ShaderID. + // This skips any materials that only target other render pipelines, are user shaders, + // or are shaders we don't care to version + var material = (Material)AssetDatabase.LoadAssetAtPath(asset, typeof(Material)); + var shaderID = ShaderUtils.GetShaderID(material.shader); + if (shaderID == ShaderUtils.ShaderID.Unknown) + { + continue; + } + + if (material.shader == null || material.shader.name != "Crest/Water") + { + continue; + } + + // Look for the BuiltIn AssetVersion + AssetVersion assetVersion = null; + var allAssets = AssetDatabase.LoadAllAssetsAtPath(asset); + foreach (var subAsset in allAssets) + { + if (subAsset is AssetVersion sub) + { + assetVersion = sub; + } + } + + if (!assetVersion) + { + if (s_CreatedAssets.Contains(asset)) + { + s_CreatedAssets.Remove(asset); + CustomBuiltInLitGUI.UpdateMaterial(material); + } + } + } + } + } + + class CustomBuiltInLitGUI : BuiltInLitGUI + { + MaterialEditor _MaterialEditor; + MaterialProperty[] _Properties; + + static readonly GUIContent s_WorkflowModeText = EditorGUIUtility.TrTextContent + ( + "Workflow Mode", + "Select a workflow that fits your textures. Choose between Metallic or Specular." + ); + + static readonly GUIContent s_TransparentReceiveShadowsText = EditorGUIUtility.TrTextContent + ( + "Receives Shadows", + "When enabled, other GameObjects can cast shadows onto this GameObject." + ); + + public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) + { + _MaterialEditor = materialEditor; + _Properties = properties; + + base.OnGUI(materialEditor, properties); + } + + public override void ValidateMaterial(Material material) + { + base.ValidateMaterial(material); + UpdateMaterial(material); + } + + public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader) + { + base.AssignNewShaderToMaterial(material, oldShader, newShader); + UpdateMaterial(material); + } + + protected override void DrawSurfaceOptions(Material material) + { + var materialEditor = _MaterialEditor; + var properties = _Properties; + + var workflowProperty = FindProperty(Property.SpecularWorkflowMode(), properties, false); + if (workflowProperty != null) + { + DoPopup(s_WorkflowModeText, materialEditor, workflowProperty, System.Enum.GetNames(typeof(WorkflowMode))); + } + + base.DrawSurfaceOptions(material); + + var surfaceTypeProp = FindProperty(Property.Surface(), properties, false); + if (surfaceTypeProp != null && (SurfaceType)surfaceTypeProp.floatValue == SurfaceType.Transparent) + { + var trsProperty = FindProperty(BuiltInLitSubTarget.s_TransparentReceiveShadowsProperty, properties, false); + DrawFloatToggleProperty(s_TransparentReceiveShadowsText, trsProperty); + } + } + + // Should be called by ShaderGraphMaterialsUpdater, but we will never upgrade. + public static new void UpdateMaterial(Material material) + { + if (material.HasProperty(Property.SpecularWorkflowMode())) + { + var workflow = (WorkflowMode)material.GetFloat(Property.SpecularWorkflowMode()); + CoreUtils.SetKeyword(material, BuiltInLitSubTarget.LitDefines.s_SpecularSetup.referenceName, workflow == WorkflowMode.Specular); + } + + if (material.HasProperty(BuiltInLitSubTarget.s_TransparentReceiveShadowsProperty)) + { + var receive = material.GetFloat(BuiltInLitSubTarget.s_TransparentReceiveShadowsProperty) == 1f; + CoreUtils.SetKeyword(material, BuiltInLitSubTarget.LitDefines.s_TransparentReceivesShadows.referenceName, receive); + } + } + } + + sealed class BuiltInLitSubTarget : BuiltInSubTarget + { + const string k_ShaderPath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy"; + const string k_TemplatePath = "Packages/com.waveharmonic.crest/Editor/Shaders/Templates"; + + readonly UnityBuiltInLitSubTarget _BuiltInLitSubTarget; + +#pragma warning disable IDE0032, IDE1006 + [SerializeField] + WorkflowMode m_WorkflowMode = WorkflowMode.Metallic; + + [SerializeField] + NormalDropOffSpace m_NormalDropOffSpace = NormalDropOffSpace.Tangent; + + [SerializeField] + bool m_TransparentReceiveShadows = true; +#pragma warning restore IDE0032, IDE1006 + + public static readonly string s_TransparentReceiveShadowsProperty = "_BUILTIN_TransparentReceiveShadows"; + + public BuiltInLitSubTarget() + { + _BuiltInLitSubTarget = new(); + displayName = _BuiltInLitSubTarget.displayName; + } + + protected override ShaderUtils.ShaderID shaderID => ShaderUtils.ShaderID.SG_Lit; + public override bool IsActive() => true; + + WorkflowMode WorkflowMode + { + get => m_WorkflowMode; + set => m_WorkflowMode = value; + } + + NormalDropOffSpace NormalDropOffSpace + { + get => m_NormalDropOffSpace; + set => m_NormalDropOffSpace = value; + } + + bool TransparentReceiveShadows + { + get => m_TransparentReceiveShadows; + set => m_TransparentReceiveShadows = value; + } + +#if UNITY_2022_3_OR_NEWER + static FieldInfo s_CustomEditorForRenderPipelines; + static FieldInfo CustomEditorForRenderPipelines => s_CustomEditorForRenderPipelines ??= typeof(TargetSetupContext).GetField("customEditorForRenderPipelines", BindingFlags.NonPublic | BindingFlags.Instance); +#endif + + public override void Setup(ref TargetSetupContext context) + { + _BuiltInLitSubTarget.target = target; + _BuiltInLitSubTarget.normalDropOffSpace = NormalDropOffSpace; + _BuiltInLitSubTarget.Setup(ref context); + + // Caused a crash: !context.HasCustomEditorForRenderPipeline(null) + if (string.IsNullOrEmpty(target.customEditorGUI)) + { +#if UNITY_2022_3_OR_NEWER + var editors = (List)CustomEditorForRenderPipelines.GetValue(context); + if (editors.Count > 0) + { + editors.RemoveAt(editors.Count - 1); + } + + context.AddCustomEditorForRenderPipeline(typeof(CustomBuiltInLitGUI).FullName, ""); +#else + if (context.customEditorForRenderPipelines.Count > 0) + { + context.customEditorForRenderPipelines.RemoveAt(context.customEditorForRenderPipelines.Count - 1); + } + + context.customEditorForRenderPipelines.Add((typeof(CustomBuiltInLitGUI).FullName, "")); +#endif + } + + context.subShaders.RemoveAt(0); + context.AddSubShader(SubShaders.Lit(this)); + } + + public override void ProcessPreviewMaterial(Material material) + { + _BuiltInLitSubTarget.target = target; + _BuiltInLitSubTarget.normalDropOffSpace = NormalDropOffSpace; + _BuiltInLitSubTarget.ProcessPreviewMaterial(material); + CustomBuiltInLitGUI.UpdateMaterial(material); + } + + public override void GetFields(ref TargetFieldContext context) + { + _BuiltInLitSubTarget.target = target; + _BuiltInLitSubTarget.normalDropOffSpace = NormalDropOffSpace; + _BuiltInLitSubTarget.GetFields(ref context); + // Do not use this, as we handle this properly. + context.AddField(BuiltInFields.SpecularSetup, false); + } + + public override void GetActiveBlocks(ref TargetActiveBlockContext context) + { + _BuiltInLitSubTarget.target = target; + _BuiltInLitSubTarget.normalDropOffSpace = NormalDropOffSpace; + _BuiltInLitSubTarget.GetActiveBlocks(ref context); + + context.activeBlocks.Remove(BlockFields.SurfaceDescription.Metallic); + var insertion = context.activeBlocks.FindIndex(x => x == BlockFields.SurfaceDescription.Occlusion) + 1; + + if ((WorkflowMode == WorkflowMode.Specular) || target.allowMaterialOverride) + { + context.activeBlocks.Insert(insertion, BlockFields.SurfaceDescription.Specular); + } + + if ((WorkflowMode == WorkflowMode.Metallic) || target.allowMaterialOverride) + { + context.activeBlocks.Insert(insertion, BlockFields.SurfaceDescription.Metallic); + } + } + + public override void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) + { + if (target.allowMaterialOverride) + { + collector.AddFloatProperty(Property.SpecularWorkflowMode(), (float)WorkflowMode); + } + + _BuiltInLitSubTarget.target = target; + _BuiltInLitSubTarget.normalDropOffSpace = NormalDropOffSpace; + _BuiltInLitSubTarget.CollectShaderProperties(collector, generationMode); + + if (target.allowMaterialOverride) + { + collector.AddFloatProperty(s_TransparentReceiveShadowsProperty, TransparentReceiveShadows ? 1f : 0f); + } + + // LEqual + collector.AddFloatProperty(SubShaders.k_ShadowCasterZTest, 4, UnityEditor.ShaderGraph.Internal.HLSLDeclaration.UnityPerMaterial); + } + + public override void GetPropertiesGUI(ref TargetPropertyGUIContext context, System.Action onChange, System.Action registerUndo) + { + target.AddDefaultMaterialOverrideGUI(ref context, onChange, registerUndo); + + context.AddProperty("Workflow", new EnumField(WorkflowMode.Metallic) { value = WorkflowMode }, (evt) => + { + if (Equals(WorkflowMode, evt.newValue)) + return; + + registerUndo("Change Workflow"); + WorkflowMode = (WorkflowMode)evt.newValue; + onChange(); + }); + + target.GetDefaultSurfacePropertiesGUI(ref context, onChange, registerUndo); + + context.AddProperty("Transparent Receives Shadows", new Toggle() { value = TransparentReceiveShadows }, (evt) => + { + if (Equals(TransparentReceiveShadows, evt.newValue)) + return; + + registerUndo("Change Transparent Receives Shadows"); + TransparentReceiveShadows = evt.newValue; + onChange(); + }); + + context.AddProperty("Fragment Normal Space", new EnumField(NormalDropOffSpace.Tangent) { value = NormalDropOffSpace }, (evt) => + { + if (Equals(NormalDropOffSpace, evt.newValue)) + return; + + registerUndo("Change Fragment Normal Space"); + NormalDropOffSpace = (NormalDropOffSpace)evt.newValue; + _BuiltInLitSubTarget.normalDropOffSpace = NormalDropOffSpace; + onChange(); + }); + } + + static class SubShaders + { + static readonly string s_ShaderPathDefines = $"{k_ShaderPath}/Defines.hlsl"; + static readonly string s_ShaderPathBuilding = $"{k_ShaderPath}/LegacyBuilding.hlsl"; + + // SetShaderPassEnabled on ShadowCaster pass does not work for BIRP. We set ZTest + // to Never which is the best we can do. We are still incurring the draw call cost. + // This is an issue because of the way we trigger motion vectors, but is a bug with + // Unity and should be reported. + internal const string k_ShadowCasterZTest = "_Crest_BUILTIN_ShadowCasterZTest"; + + internal static System.Type s_SubShadersType; + internal static System.Type SubShadersType => s_SubShadersType ??= typeof(UnityBuiltInLitSubTarget).GetNestedType("SubShaders", BindingFlags.Static | BindingFlags.NonPublic); + internal static MethodInfo s_LitMethod; + internal static MethodInfo LitMethod => s_LitMethod ??= SubShadersType.GetMethod("Lit", BindingFlags.Static | BindingFlags.Public); + + static void PatchIncludes(ref PassDescriptor result) + { + var includes = new IncludeCollection(); + + includes.Add(s_ShaderPathDefines, IncludeLocation.Pregraph); + includes.Add("Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/ShaderPass.hlsl", IncludeLocation.Pregraph); + + foreach (var include in result.includes) + { + includes.AddInternal(include.guid, include.path, include.location, include.fieldConditions); + } + + result.includes = includes; + } + + static void PatchSpecularIncludes(ref PassDescriptor result, string file) + { + var ic = new IncludeCollection(); + foreach (var include in result.includes) + { + if (include.path.EndsWith(file)) + { + ic.Add(s_ShaderPathBuilding, include.location); + ic.AddInternal(include.guid, include.path, include.location, include.fieldConditions); + } + else + { + ic.AddInternal(include.guid, include.path, include.location, include.fieldConditions); + } + } + + result.includes = ic; + } + + static readonly Dictionary s_Mappings = new() + { + { "SHADERPASS_FORWARD", "PBRForwardPass.hlsl" }, + { "SHADERPASS_FORWARD_ADD", "PBRForwardAddPass.hlsl" }, + { "SHADERPASS_DEFERRED", "PBRDeferredPass.hlsl" }, + }; + + static readonly string[] s_SkipVariants = new string[] + { + "LIGHTMAP_ON", + "LIGHTMAP_SHADOW_MIXING", + "DIRLIGHTMAP_COMBINED", + "DYNAMICLIGHTMAP_ON", + "SHADOWS_SHADOWMASK", + }; + + public static SubShaderDescriptor Lit(BuiltInLitSubTarget subtarget) + { + var target = subtarget.target; + var ssd = (SubShaderDescriptor)LitMethod.Invoke(null, new object[] { target, target.renderType, target.renderQueue }); + + PassCollection passes = new(); + + foreach (var item in ssd.passes) + { + // Many artifacts in U6 if our Write Depth enabled. + // Caused by _SURFACE_TYPE_TRANSPARENT in m_ValidKeywords. + if (item.descriptor.referenceName == "SceneSelectionPass") + { + continue; + } + + var result = item.descriptor; + + var keywords = new KeywordCollection(); + + foreach (var keyword in result.keywords) + { + // All others are either duplicate or unused. + if (!keyword.descriptor.referenceName.StartsWith("_BUILTIN_")) + { + continue; + } + + keywords.Add(keyword.descriptor, keyword.fieldConditions); + } + + result.keywords = keywords; + + switch (item.descriptor.referenceName) + { + case "SHADERPASS_FORWARD": + case "SHADERPASS_FORWARD_ADD": + case "SHADERPASS_DEFERRED": + AddWorkflowModeControlToPass(ref result, target, subtarget.WorkflowMode); + PatchSpecularIncludes(ref result, s_Mappings[item.descriptor.referenceName]); + + var pragmas = new PragmaCollection(); + foreach (var pragma in result.pragmas) + { + // For UAVs (RWStructuredBuffer). + if (pragma.descriptor.value.StartsWithNoAlloc("target")) + { + pragmas.Add(Pragma.Target(ShaderModel.Target45)); + continue; + } + + if (pragma.descriptor.value.StartsWithNoAlloc("vertex")) + { + pragmas.Add(Pragma.SkipVariants(s_SkipVariants)); + } + + pragmas.Add(pragma.descriptor, pragma.fieldConditions); + } + result.pragmas = pragmas; + + goto default; + default: + PatchIncludes(ref result); + break; + } + + switch (item.descriptor.referenceName) + { + case "SHADERPASS_FORWARD": + case "SHADERPASS_FORWARD_ADD": + AddReceivesShadowsControlToPass(ref result, target, subtarget.TransparentReceiveShadows); + break; + case "SHADERPASS_SHADOWCASTER": + var states = new RenderStateCollection(); + foreach (var state in result.renderStates) + { + if (state.descriptor.type == RenderStateType.ZTest) + { + states.Add(RenderState.ZTest($"[{k_ShadowCasterZTest}]")); + continue; + } + + states.Add(state.descriptor, state.fieldConditions); + } + + result.renderStates = states; + break; + } + + // Add missing cull render state. + if (item.descriptor.referenceName == "SHADERPASS_FORWARD_ADD") + { + CoreRenderStates.AddUberSwitchedCull(target, result.renderStates); + } + + // Inject MV before DO pass. + if (item.descriptor.referenceName == "SHADERPASS_DEPTHONLY") + { + var mv = LitPasses.MotionVectors(target); + PatchIncludes(ref mv); + passes.Add(mv); + } + + // Fix XR SPI. + if (result.requiredFields != null) + { + var found = false; + + foreach (var collection in result.requiredFields) + { + if (collection.field == StructFields.Attributes.instanceID) + { + found = true; + break; + } + } + + if (!found) + { + result.requiredFields.Add(StructFields.Attributes.instanceID); + } + } + + passes.Add(result); + } + + ssd.passes = passes; + + return ssd; + } + + static void AddWorkflowModeControlToPass(ref PassDescriptor pass, BuiltInTarget target, WorkflowMode workflowMode) + { + if (target.allowMaterialOverride) + { + pass.keywords.Add(LitDefines.s_SpecularSetup); + } + else if (workflowMode == WorkflowMode.Specular) + { + pass.defines.Add(LitDefines.s_SpecularSetup, 1); + } + } + + static void AddReceivesShadowsControlToPass(ref PassDescriptor pass, BuiltInTarget target, bool receives) + { + if (target.allowMaterialOverride) + { + pass.keywords.Add(LitDefines.s_TransparentReceivesShadows); + pass.keywords.Add(LitDefines.s_ShadowsSingleCascade); + pass.keywords.Add(LitDefines.s_ShadowsSplitSpheres); + pass.keywords.Add(LitDefines.s_ShadowsSoft); + } + else if (receives) + { + pass.defines.Add(LitDefines.s_TransparentReceivesShadows, 1); + pass.keywords.Add(LitDefines.s_ShadowsSingleCascade); + pass.keywords.Add(LitDefines.s_ShadowsSplitSpheres); + pass.keywords.Add(LitDefines.s_ShadowsSoft); + } + } + } + + static class LitPasses + { + static readonly string s_ShaderPathMotionVectorCommon = $"{k_ShaderPath}/MotionVectorCommon.hlsl"; + static readonly string s_ShaderPathMotionVectorPass = $"{k_ShaderPath}/MotionVectorPass.hlsl"; + + public static RenderStateDescriptor UberSwitchedCullRenderState(BuiltInTarget target) + { + if (target.allowMaterialOverride) + { + return RenderState.Cull(CoreRenderStates.Uniforms.cullMode); + } + else + { + return RenderState.Cull(CoreRenderStates.RenderFaceToCull(target.renderFace)); + } + } + + public static PassDescriptor MotionVectors(BuiltInTarget target) + { + var result = new PassDescriptor() + { + // Definition + displayName = "BuiltIn MotionVectors", + referenceName = "SHADERPASS_MOTION_VECTORS", + lightMode = "MotionVectors", + useInPreview = false, + + // Template + passTemplatePath = BuiltInTarget.kTemplatePath, + sharedTemplateDirectories = BuiltInTarget.kSharedTemplateDirectories.Union + ( + new string[] + { + k_TemplatePath, + "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph" + } + ).ToArray(), + + // Port Mask + validVertexBlocks = new BlockFieldDescriptor[] + { + BlockFields.VertexDescription.Position, + }, + validPixelBlocks = CoreBlockMasks.FragmentAlphaOnly, + + // Fields + structs = CoreStructCollections.Default, + requiredFields = new() + { + // Needed for XR, but not sure if correct. + StructFields.Attributes.instanceID, + }, + fieldDependencies = CoreFieldDependencies.Default, + + // Conditional State + renderStates = new() + { + { RenderState.ZTest(ZTest.LEqual) }, + { RenderState.ZWrite(ZWrite.On) }, + { UberSwitchedCullRenderState(target) }, + // MVs write to the depth buffer causing z-fighting. Luckily, the depth texture has + // already been updated, and will not be updated before water renders. + { RenderState.ColorMask("ColorMask RG\nOffset 1, 1") }, + }, + + pragmas = new() + { + { Pragma.Target(ShaderModel.Target35) }, // NOTE: SM 2.0 only GL + { Pragma.MultiCompileInstancing }, + { Pragma.Vertex("vert") }, + { Pragma.Fragment("frag") }, + }, + + defines = new() { CoreDefines.BuiltInTargetAPI }, + keywords = new(), + includes = new() + { + // Pre-graph + { CoreIncludes.CorePregraph }, + { CoreIncludes.ShaderGraphPregraph }, + + // Post-graph + { s_ShaderPathMotionVectorCommon, IncludeLocation.Postgraph }, + { CoreIncludes.CorePostgraph }, + { s_ShaderPathMotionVectorPass, IncludeLocation.Postgraph }, + }, + + // Custom Interpolator Support + customInterpolators = CoreCustomInterpDescriptors.Common, + }; + + // Only support time for now. + result.defines.Add(LitDefines.s_AutomaticTimeBasedMotionVectors, 1); + + CorePasses.AddAlphaClipControlToPass(ref result, target); + return result; + } + } + + internal static class LitDefines + { + public static readonly KeywordDescriptor s_AutomaticTimeBasedMotionVectors = new() + { + displayName = "Automatic Time-Based Motion Vectors", + referenceName = "AUTOMATIC_TIME_BASED_MOTION_VECTORS", + type = KeywordType.Boolean, + definition = KeywordDefinition.Predefined, + scope = KeywordScope.Local, + stages = KeywordShaderStage.Vertex, + }; + + public static readonly KeywordDescriptor s_SpecularSetup = new() + { + displayName = "Specular Setup", + referenceName = "_BUILTIN_SPECULAR_SETUP", + type = KeywordType.Boolean, + definition = KeywordDefinition.ShaderFeature, + scope = KeywordScope.Local, + stages = KeywordShaderStage.Fragment + }; + + public static readonly KeywordDescriptor s_TransparentReceivesShadows = new() + { + displayName = "Transparent Receives Shadows", + referenceName = "_BUILTIN_TRANSPARENT_RECEIVES_SHADOWS", + type = KeywordType.Boolean, + definition = KeywordDefinition.ShaderFeature, + scope = KeywordScope.Local, + stages = KeywordShaderStage.Fragment + }; + + public static readonly KeywordDescriptor s_ShadowsSingleCascade = new() + { + displayName = "Single Cascade Shadows", + referenceName = "SHADOWS_SINGLE_CASCADE", + type = KeywordType.Boolean, + definition = KeywordDefinition.MultiCompile, + scope = KeywordScope.Global, + stages = KeywordShaderStage.All, + }; + + public static readonly KeywordDescriptor s_ShadowsSoft = new() + { + displayName = "Soft Shadows", + referenceName = "SHADOWS_SOFT", + type = KeywordType.Boolean, + definition = KeywordDefinition.MultiCompile, + scope = KeywordScope.Global, + stages = KeywordShaderStage.All, + }; + + public static readonly KeywordDescriptor s_ShadowsSplitSpheres = new() + { + displayName = "Stable Fit Shadows", + referenceName = "SHADOWS_SPLIT_SPHERES", + type = KeywordType.Boolean, + definition = KeywordDefinition.MultiCompile, + scope = KeywordScope.Global, + stages = KeywordShaderStage.All, + }; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphLegacySubTarget.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphLegacySubTarget.cs.meta new file mode 100644 index 0000000..1ef0bb2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphLegacySubTarget.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4c99fd6915934b21a43efb6ca9915f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphUtility.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphUtility.cs new file mode 100644 index 0000000..4eabc77 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphUtility.cs @@ -0,0 +1,199 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma warning disable + +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using UnityEditor; +using UnityEditor.ShaderGraph; +using UnityEditor.ShaderGraph.Internal; +using UnityEngine; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Editor")] + +namespace WaveHarmonic.Crest.Editor +{ + internal static class ShaderGraphPropertyDrawers + { + static Dictionary s_CompoundPropertyFoldoutStates = new(); + static Dictionary s_Tooltips; + static readonly GUIContent s_Label = new(); + + public static void DrawShaderGraphGUI(MaterialEditor materialEditor, IEnumerable properties, Dictionary tooltips) + { + s_Tooltips = tooltips; + Material m = materialEditor.target as Material; + Shader s = m.shader; + string path = AssetDatabase.GetAssetPath(s); + ShaderGraphMetadata metadata = null; + foreach (var obj in AssetDatabase.LoadAllAssetsAtPath(path)) + { + if (obj is ShaderGraphMetadata meta) + { + metadata = meta; + break; + } + } + + if (metadata != null) + DrawShaderGraphGUI(materialEditor, properties, metadata.categoryDatas); + else + PropertiesDefaultGUI(materialEditor, properties); + } + + static void PropertiesDefaultGUI(MaterialEditor materialEditor, IEnumerable properties) + { + foreach (var property in properties) + { + if ((property.flags & (MaterialProperty.PropFlags.HideInInspector | MaterialProperty.PropFlags.PerRendererData)) != 0) + continue; + + float h = materialEditor.GetPropertyHeight(property, property.displayName); + Rect r = EditorGUILayout.GetControlRect(true, h, EditorStyles.layerMaskField); + + s_Label.text = property.displayName; + s_Label.tooltip = s_Tooltips.GetValueOrDefault(property.name, null); + materialEditor.ShaderProperty(r, property, s_Label); + } + } + + static Rect GetRect(MaterialProperty prop) + { + return EditorGUILayout.GetControlRect(true, MaterialEditor.GetDefaultPropertyHeight(prop)); + } + + static MaterialProperty FindProperty(string propertyName, IEnumerable properties) + { + foreach (var prop in properties) + { + if (prop.name == propertyName) + { + return prop; + } + } + + return null; + } + + public static void DrawShaderGraphGUI(MaterialEditor materialEditor, IEnumerable properties, IEnumerable categoryDatas) + { + foreach (MinimalCategoryData mcd in categoryDatas) + { + DrawCategory(materialEditor, properties, mcd); + } + } + + static void DrawCategory(MaterialEditor materialEditor, IEnumerable properties, MinimalCategoryData minimalCategoryData) + { + if (minimalCategoryData.categoryName.Length > 0) + { + minimalCategoryData.expanded = EditorGUILayout.BeginFoldoutHeaderGroup(minimalCategoryData.expanded, minimalCategoryData.categoryName); + } + else + { + // force draw if no category name to do foldout on + minimalCategoryData.expanded = true; + } + + if (minimalCategoryData.expanded) + { + foreach (var propData in minimalCategoryData.propertyDatas) + { + if (propData.isCompoundProperty == false) + { + MaterialProperty prop = FindProperty(propData.referenceName, properties); + if (prop == null) continue; + DrawMaterialProperty(materialEditor, prop, propData.propertyType, propData.isKeyword, propData.keywordType); + } + else + { + DrawCompoundProperty(materialEditor, properties, propData); + } + } + } + + EditorGUILayout.EndFoldoutHeaderGroup(); + } + + static void DrawCompoundProperty(MaterialEditor materialEditor, IEnumerable properties, GraphInputData compoundPropertyData) + { + EditorGUI.indentLevel++; + + bool foldoutState = true; + var exists = s_CompoundPropertyFoldoutStates.ContainsKey(compoundPropertyData); + if (!exists) + s_CompoundPropertyFoldoutStates.Add(compoundPropertyData, true); + else + foldoutState = s_CompoundPropertyFoldoutStates[compoundPropertyData]; + + foldoutState = EditorGUILayout.Foldout(foldoutState, compoundPropertyData.referenceName); + if (foldoutState) + { + EditorGUI.indentLevel++; + foreach (var subProperty in compoundPropertyData.subProperties) + { + var property = FindProperty(subProperty.referenceName, properties); + if (property == null) continue; + DrawMaterialProperty(materialEditor, property, subProperty.propertyType); + } + EditorGUI.indentLevel--; + } + + if (exists) + s_CompoundPropertyFoldoutStates[compoundPropertyData] = foldoutState; + EditorGUI.indentLevel--; + } + + static void DrawMaterialProperty(MaterialEditor materialEditor, MaterialProperty property, PropertyType propertyType, bool isKeyword = false, KeywordType keywordType = KeywordType.Boolean) + { + if (!isKeyword) + { + switch (propertyType) + { + case PropertyType.SamplerState: + case PropertyType.Matrix4: + case PropertyType.Matrix3: + case PropertyType.Matrix2: + case PropertyType.VirtualTexture: + case PropertyType.Gradient: + return; + case PropertyType.Vector3: + DrawVector3Property(materialEditor, property); + return; + case PropertyType.Vector2: + DrawVector2Property(materialEditor, property); + return; + } + } + + s_Label.text = property.displayName; + s_Label.tooltip = s_Tooltips.GetValueOrDefault(property.name, null); + materialEditor.ShaderProperty(property, s_Label); + } + + static void DrawVector2Property(MaterialEditor materialEditor, MaterialProperty property) + { + EditorGUI.BeginChangeCheck(); + EditorGUI.showMixedValue = property.hasMixedValue; + Vector2 newValue = EditorGUI.Vector2Field(GetRect(property), property.displayName, new Vector2(property.vectorValue.x, property.vectorValue.y)); + EditorGUI.showMixedValue = false; + if (EditorGUI.EndChangeCheck()) + { + property.vectorValue = newValue; + } + } + + static void DrawVector3Property(MaterialEditor materialEditor, MaterialProperty property) + { + EditorGUI.BeginChangeCheck(); + EditorGUI.showMixedValue = property.hasMixedValue; + Vector3 newValue = EditorGUI.Vector3Field(GetRect(property), property.displayName, new Vector3(property.vectorValue.x, property.vectorValue.y, property.vectorValue.z)); + EditorGUI.showMixedValue = false; + if (EditorGUI.EndChangeCheck()) + { + property.vectorValue = newValue; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphUtility.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphUtility.cs.meta new file mode 100644 index 0000000..4d4602b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/ShaderGraphUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ee5c95ce93114c1c909f5b1346d8bb0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/TexturePreview.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/TexturePreview.cs new file mode 100644 index 0000000..4abbc21 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/TexturePreview.cs @@ -0,0 +1,154 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Editor +{ + abstract class TexturePreview : ObjectPreview + { + public static TexturePreview s_ActiveInstance; + public bool Open { get; private set; } + + UnityEditor.Editor _Editor; + RenderTexture _RenderTexture; + RenderTextureDescriptor _OriginalDescriptor = new(); + Texture _Current; + protected int _Slice; + bool _First = true; + + protected abstract Texture OriginalTexture { get; } + protected virtual Texture ModifiedTexture { get; } + + Texture Texture => ModifiedTexture != null ? ModifiedTexture : OriginalTexture; + + protected virtual bool Flipped => false; + + // Preview complains if not a certain set of formats. + bool Incompatible => !(GraphicsFormatUtility.IsIEEE754Format(Texture.graphicsFormat) + || GraphicsFormatUtility.IsNormFormat(Texture.graphicsFormat)); + + public TexturePreview() { } + + public override bool HasPreviewGUI() + { + if (Event.current != null && Event.current.type == EventType.Layout) + { + Open = false; + } + + return OriginalTexture; + } + + public override void Cleanup() + { + base.Cleanup(); + Object.DestroyImmediate(_Editor); + if (_RenderTexture != null) _RenderTexture.Release(); + Object.DestroyImmediate(_RenderTexture); + } + + public override void OnPreviewSettings() + { + if (_First && Event.current.type == EventType.Repaint && !Application.isPlaying) + { + // Solves on enter edit mode: + // ArgumentException: Getting control 2's position in a group with only 2 controls when doing repaint + _First = false; + return; + } + + if (_Editor != null) _Editor.OnPreviewSettings(); + } + + public override void OnPreviewGUI(Rect rect, GUIStyle background) + { + s_ActiveInstance = this; + Open = true; + + // This check is in original. + if (Event.current.type == EventType.Repaint) + { + background.Draw(rect, false, false, false, false); + } + + if (Texture is Cubemap) + { + if (_Editor == null || _Editor.target != Texture) + { + Object.DestroyImmediate(_Editor); + _Editor = UnityEditor.Editor.CreateEditor(Texture); + } + + _Editor.DrawPreview(rect); + return; + } + + var descriptor = Texture.GetDescriptor(); + + if (Helpers.RenderTextureNeedsUpdating(descriptor, _OriginalDescriptor)) + { + _OriginalDescriptor = descriptor; + + if (Incompatible) + { + descriptor.graphicsFormat = GraphicsFormat.R32G32B32A32_SFloat; + } + + Helpers.SafeCreateRenderTexture(ref _RenderTexture, descriptor); + _RenderTexture.Create(); + Object.DestroyImmediate(_Editor); + _Editor = UnityEditor.Editor.CreateEditor(_RenderTexture); + // Reset for incompatible copy. + descriptor = _OriginalDescriptor; + } + + // Name may change without texture changing (see SWS). + _RenderTexture.name = Texture.name + " (Preview)"; + + if (Incompatible) + { + var temporary = RenderTexture.GetTemporary(descriptor); + Graphics.CopyTexture(Texture, temporary); + Helpers.Blit(temporary, _RenderTexture); + RenderTexture.ReleaseTemporary(temporary); + } + else + { + Graphics.CopyTexture(Texture, _RenderTexture); + } + + _Editor.DrawPreview(rect); + } + +#if CREST_DEBUG + public override void OnInteractivePreviewGUI(Rect rect, GUIStyle background) + { + OnPreviewGUI(rect, background); + + if (Texture is Cubemap) + { + return; + } + + // Show pixel value in preview. + _Slice = Development.Utility.GetPreviewSlice(_Editor, Texture); + var color = Development.Utility.InspectPixel(rect, OriginalTexture, Flipped, _Slice); + var text = Development.Utility.GetInspectPixelString(color, OriginalTexture); + EditorGUI.DropShadowLabel(new Rect(rect.x, rect.y, rect.width, 40), text); + } +#endif + + void Allocate(Texture texture) + { + // LOD with buffered data like foam will recreate every frame freezing controls. + if (_Editor != null && _Current == Texture) return; + _Current = texture; + Object.DestroyImmediate(_Editor); + _Editor = UnityEditor.Editor.CreateEditor(texture); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/TexturePreview.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/TexturePreview.cs.meta new file mode 100644 index 0000000..9d5f70d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/TexturePreview.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1c817389e2ce240f69487a0e78fc7091 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Validation.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Validation.cs new file mode 100644 index 0000000..3220fa2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Validation.cs @@ -0,0 +1,302 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// How to use: +// Use or inherit from Crest.Editor.Inspector to support validation messages. +// Then create a static method with Validator attribute. + +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Editor +{ + using FixValidation = System.Action; + + [System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple = true, Inherited = true)] + sealed class Validator : System.Attribute + { + public readonly System.Type _Type; + + public Validator(System.Type type) + { + _Type = type; + } + } + + // Holds the shared list for messages + static class ValidatedHelper + { + public enum MessageType + { + Error, + Warning, + Info, + } + + public struct HelpBoxMessage + { + public string _Message; + public string _FixDescription; + public Object _Object; + public FixValidation _Action; + public string _PropertyPath; + } + + // This is a shared resource. It will be cleared before use. It is only used by the HelpBox delegate since we + // want to group them by severity (MessageType). Make sure length matches MessageType length. + public static readonly List[] s_Messages = new List[] + { + new(), + new(), + new(), + }; + + public delegate void ShowMessage(string message, string fixDescription, MessageType type, Object @object = null, FixValidation action = null, string property = null); + + public static void DebugLog(string message, string fixDescription, MessageType type, Object @object = null, FixValidation action = null, string property = null) + { + // Never log info validation to console. + if (type == MessageType.Info) + { + return; + } + + message = $"Crest Validation: {message} {fixDescription} Click this message to highlight the problem object."; + + switch (type) + { + case MessageType.Error: Debug.LogError(message, @object); break; + case MessageType.Warning: Debug.LogWarning(message, @object); break; + default: Debug.Log(message, @object); break; + } + } + + public static void HelpBox(string message, string fixDescription, MessageType type, Object @object = null, FixValidation action = null, string property = null) + { + s_Messages[(int)type].Add(new() { _Message = message, _FixDescription = fixDescription, _Object = @object, _Action = action, _PropertyPath = property }); + } + + public static void Suppressed(string _0, string _1, MessageType _2, Object _3 = null, FixValidation _4 = null, string _5 = null) + { + } + + public static T FixAttachComponent(SerializedObject componentOrGameObject) + where T : Component + { + return Undo.AddComponent(EditorHelpers.GetGameObject(componentOrGameObject)); + } + + internal static void FixSetMaterialOptionEnabled(SerializedObject material, string keyword, string floatParam, bool enabled) + { + var mat = material.targetObject as Material; + Undo.RecordObject(mat, $"Enable keyword {keyword}"); + mat.SetBoolean(Shader.PropertyToID(floatParam), enabled); + if (ArrayUtility.Contains(mat.shader.keywordSpace.keywordNames, keyword)) + { + mat.SetKeyword(keyword, enabled); + } + } + + internal static void FixSetMaterialIntProperty(SerializedObject material, string label, string intParam, int value) + { + var mat = material.targetObject as Material; + Undo.RecordObject(mat, $"change {label}"); + mat.SetInteger(intParam, value); + } + + public static void FixAddMissingMathPackage(SerializedObject _0, SerializedProperty _1) + { + PackageManagerHelpers.AddMissingPackage("com.unity.mathematics"); + } + + public static void FixAddMissingBurstPackage(SerializedObject _0, SerializedProperty _1) + { + PackageManagerHelpers.AddMissingPackage("com.unity.burst"); + } + + public static bool ValidateNoScale(Object @object, Transform transform, ShowMessage showMessage) + { + if (transform.lossyScale != Vector3.one) + { + showMessage + ( + $"There must be no scale on the {@object.GetType().Name} Transform or any of its parents." + + $"The current scale is {transform.lossyScale}.", + "Reset the scale on this Transform and all parents to one.", + MessageType.Error, @object + ); + + return false; + } + + return true; + } + + public static bool ValidateNoRotation(Object @object, Transform transform, ShowMessage showMessage) + { + if (transform.eulerAngles.magnitude > 0.0001f) + { + showMessage + ( + $"There must be no rotation on the {@object.GetType().Name} Transform or any of its parents." + + $"The current rotation is {transform.eulerAngles}.", + "Reset the rotation on this Transform and all parents to zero.", + MessageType.Error, @object + ); + + return false; + } + + return true; + } + + + + public static bool ValidateRenderer + ( + Component component, + Renderer renderer, + ShowMessage showMessage, + bool checkShaderPasses, + string shaderPrefix = null + ) + where T : Renderer + { + if (renderer == null) + { + var type = typeof(T); + var name = type.Name; + + // Give users a hint as to what "Renderer" really means. + if (type == typeof(Renderer)) + { + name += " (Mesh, Trail etc)"; + } + + showMessage + ( + $"A {name} component is required but none is assigned.", + "Provide a renderer.", + MessageType.Error, component + ); + + return false; + } + + var materials = renderer.sharedMaterials; + for (var i = 0; i < materials.Length; i++) + { + // Empty material slots is a user error. Unity complains about it so we should too. + if (materials[i] == null) + { + showMessage + ( + $"{renderer.GetType().Name} used by this input ({component.GetType().Name}) has empty material slots.", + "Remove these slots or fill them with a material.", + MessageType.Error, renderer + ); + } + } + + if (renderer is MeshRenderer) + { + renderer.gameObject.TryGetComponent(out var mf); + if (mf == null) + { + showMessage + ( + $"A MeshRenderer component is being used by this input but no MeshFilter component was found so there may not be any valid geometry to render.", + "Attach a MeshFilter component.", + MessageType.Error, renderer.gameObject, + (_, _) => Undo.AddComponent(renderer.gameObject) + ); + + return false; + } + else if (mf.sharedMesh == null) + { + showMessage + ( + $"A MeshRenderer component is being used by this input but no mesh is assigned to the MeshFilter component.", + "Assign the geometry to be rendered to the MeshFilter component.", + MessageType.Error, renderer.gameObject + ); + + return false; + } + } + + if (!ValidateMaterial(renderer.gameObject, showMessage, renderer.sharedMaterial, shaderPrefix, checkShaderPasses)) + { + return false; + } + + return true; + } + + public static bool ValidateMaterial(GameObject gameObject, ShowMessage showMessage, Material material, string shaderPrefix, bool checkShaderPasses) + { + if (shaderPrefix == null && material == null) + { + showMessage + ( + $"Mesh Renderer requires a material.", + "Assign a material.", + MessageType.Error, gameObject + ); + + return false; + } + + if (!material || material.shader && (!material.shader.name.StartsWithNoAlloc(shaderPrefix) && !material.shader.name.StartsWithNoAlloc($"Hidden/{shaderPrefix}") && !material.shader.name.Contains("/All/"))) + { + showMessage + ( + $"Shader assigned to water input expected to be of type {shaderPrefix}.", + "Assign a material that uses a shader of this type.", + MessageType.Error, gameObject + ); + + return false; + } + + if (checkShaderPasses && material.passCount > 1) + { + showMessage + ( + $"The shader {material.shader.name} for material {material.name} has multiple passes which might not work as expected as only the first pass is executed. " + + "This can be ignored in most cases, like Shader Graph, as only one pass is often required.", + "To have all passes execute then set Shader Pass Index to -1.", + MessageType.Info, gameObject + ); + } + + return true; + } + + public static bool ExecuteValidators(object target, ShowMessage messenger) + { + var isValid = true; + var type = target.GetType(); + var validators = TypeCache.GetMethodsWithAttribute(); + foreach (var validator in validators) + { + var attribute = validator.GetCustomAttribute(); + if (attribute._Type.IsAssignableFrom(type)) + { + isValid = (bool)validator.Invoke(null, new object[] { target, messenger }) && isValid; + } + } + + return isValid; + } + + public static bool ExecuteValidators(Object target) + { + return ExecuteValidators(target, DebugLog); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Validation.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Validation.cs.meta new file mode 100644 index 0000000..e576435 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Validation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e9a7f4ffb1bb41999902cd4310bf2d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.Editor.asmdef b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.Editor.asmdef new file mode 100644 index 0000000..7cdcae7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.Editor.asmdef @@ -0,0 +1,23 @@ +{ + "name": "WaveHarmonic.Crest.Shared.Editor", + "rootNamespace": "", + "references": [ + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:3eae0364be2026648bf74846acb8a731", + "GUID:df380645f10b7bc4b97d4f5eb6303d95", + "GUID:be0903cd8e1546f498710afdc59db5eb" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.Editor.asmdef.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.Editor.asmdef.meta new file mode 100644 index 0000000..9f096bb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1ab2a6c2a51cd4b43867788dbaee1a55 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Validators.cs b/Packages/com.waveharmonic.crest/Editor/Scripts/Validators.cs new file mode 100644 index 0000000..dd6e1f3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Validators.cs @@ -0,0 +1,1731 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering.Universal; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Watercraft; + +using static WaveHarmonic.Crest.Editor.ValidatedHelper; +using MessageType = WaveHarmonic.Crest.Editor.ValidatedHelper.MessageType; + +namespace WaveHarmonic.Crest.Editor +{ + static class Validators + { + // HDRP sub-shader always first. + const int k_SubShaderIndexHDRP = 0; + internal static WaterRenderer Water => Utility.Water; + static readonly System.Collections.Generic.List s_Terrains = new(); + static readonly ShaderTagId s_RenderPipelineShaderTagID = new("RenderPipeline"); + + [Validator(typeof(LodInput))] + static bool ValidateTextureInput(LodInput target, ShowMessage messenger) + { + if (target.Data is not TextureLodInputData data) return true; + + var isValid = true; + + if (data._Texture == null) + { + messenger + ( + "Texture mode requires a texture.", + "Assign a texture.", + MessageType.Error, + target + ); + } + + return isValid; + } + + [Validator(typeof(LodInput))] + static bool ValidateGeometryInput(LodInput target, ShowMessage messenger) + { + if (target.Data is not GeometryLodInputData data) return true; + + var isValid = true; + + if (data._Geometry == null) + { + messenger + ( + "Geometry mode requires geometry (ie mesh).", + "Assign geometry.", + MessageType.Error, + target + ); + } + + return isValid; + } + + [Validator(typeof(LodInput))] + static bool ValidateRendererInput(LodInput target, ShowMessage messenger) + { + if (target.Data is not RendererLodInputData data) return true; + + // Check if Renderer component is attached. + var isValid = ValidateRenderer + ( + target, + data._Renderer, + messenger, + data._CheckShaderPasses && (!data._OverrideShaderPass || data._ShaderPassIndex != -1), + data._CheckShaderName ? data.ShaderPrefix : string.Empty + ); + + if (data._Renderer == null) + { + return isValid; + } + + // Can cause problems if culling masks are used. + if (!data._DisableRenderer) + { + isValid = ValidateRendererLayer(target.gameObject, messenger, Water) && isValid; + } + + var isPersistent = target is FoamLodInput or DynamicWavesLodInput or ShadowLodInput; + + var materials = data._Renderer.sharedMaterials; + for (var i = 0; i < materials.Length; i++) + { + var material = materials[i]; + if (material == null) continue; + if (material.shader == null) continue; + + if (data._OverrideShaderPass && data._ShaderPassIndex > material.shader.passCount - 1) + { + messenger + ( + $"The shader {material.shader.name} used by this input has opted for the shader pass " + + $"index {data._ShaderPassIndex}, but there is only {material.shader.passCount} passes on the shader.", + "Choose a valid shader pass.", + MessageType.Error, target + ); + } + + if (isPersistent) + { + if (material.shader.name is "Crest/Inputs/All/Utility" or "Crest/Inputs/All/Scale") + { + messenger + ( + $"The shader {material.shader.name} currently is not supported by this simulation " + + "(Foam, Dynamic Waves or Shadow) as the shader does not support time steps.", + "Choose a valid shader (not Crest/Inputs/All/Utility or Crest/Inputs/All/Scale).", + MessageType.Error, target + ); + } + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + if (AssetDatabase.GetAssetPath(material.shader).EndsWith(".shadergraph") && material.shader.FindSubshaderTagValue(k_SubShaderIndexHDRP, s_RenderPipelineShaderTagID).name == "HDRenderPipeline") + { + messenger + ( + "It appears you are using Shader Graph with the HDRP target. " + + "Make sure to use the Built-In target instead for your Shader Graph to work.", + "Remove the HDRP target and add the Built-In target.", + MessageType.Warning, material.shader + ); + } + } +#endif + } + + return isValid; + } + + static bool ValidateRendererLayer(GameObject gameObject, ShowMessage messenger, WaterRenderer water) + { + if (water != null && gameObject.layer != water.Surface.Layer) + { + var layerName = LayerMask.LayerToName(water.Surface.Layer); + messenger + ( + $"The layer is not the same as the {nameof(WaterRenderer)}.{nameof(WaterRenderer.Surface)}.{nameof(SurfaceRenderer.Layer)} ({layerName}) which can cause problems if the {layerName} layer is excluded from any culling masks.", + $"Set layer to {layerName}.", + MessageType.Warning, gameObject, + (_, _) => + { + Undo.RecordObject(gameObject, $"Change Layer to {layerName}"); + gameObject.layer = water.Surface.Layer; + } + ); + } + + // Is valid as not outright invalid but could be. + return true; + } + + static bool Validate(WaterReflections target, ShowMessage messenger, WaterRenderer water) + { + var isValid = true; + + if (!target._Enabled) + { + return isValid; + } + + var material = water.Surface.Material; + + if (material != null) + { + if (material.HasProperty(WaterRenderer.ShaderIDs.s_PlanarReflectionsEnabled) && material.GetFloat(WaterRenderer.ShaderIDs.s_PlanarReflectionsEnabled) == 0) + { + messenger + ( + $"Planar Reflections are not enabled on the {material.name} material and will not be visible.", + $"Enable Planar Reflections on the material ({material.name}) currently assigned to the {nameof(WaterRenderer)} component.", + MessageType.Warning, material + ); + } + + if (material.HasProperty(WaterRenderer.ShaderIDs.s_Occlusion) && target._Mode != WaterReflectionSide.Below && material.GetFloat(WaterRenderer.ShaderIDs.s_Occlusion) == 0) + { + messenger + ( + $"Occlusion is set to zero on the {material.name} material. Planar reflections will not be visible.", + $"Increase Occlusion on the material ({material.name}) currently assigned to the {nameof(WaterRenderer)} component.", + MessageType.Warning, material + ); + } + + if (material.HasProperty(WaterRenderer.ShaderIDs.s_OcclusionUnderwater) && target._Mode != WaterReflectionSide.Above && material.GetFloat(WaterRenderer.ShaderIDs.s_OcclusionUnderwater) == 0) + { + messenger + ( + $"Occlusion (U) is set to zero on the {material.name} material. Planar reflections will not be visible.", + $"Increase Occlusion (U) on the material ({material.name}) currently assigned to the {nameof(WaterRenderer)} component.", + MessageType.Warning, material + ); + } + } + + if (!target._Sky) + { + messenger + ( + $"Sky on Reflections is not enabled. " + + "Any custom shaders which do not write alpha (eg some tree leaves) will not appear in the final reflections.", + "Enable Sky.", + MessageType.Info, target._Water, + (_, y) => y.boolValue = true, + $"{nameof(WaterRenderer._Reflections)}.{nameof(WaterReflections._Sky)}" + + ); + } + +#if !UNITY_6000_0_OR_NEWER +#if d_UnityHDRP + if (!target._RenderOnlySingleCamera && RenderPipelineHelper.IsHighDefinition) + { + messenger + ( + $"Please note that Reflections > Render Only Single Camera has no effect for Unity 2022.3 HDRP. " + + "It is forced to enabled, as HDRP cannot render to multiple cameras, as it requires recursive rendering.", + "Upgrade to Unity 6 if you need this feature.", + MessageType.Info, target._Water + ); + } +#endif +#endif + + return isValid; + } + + static bool Validate(UnderwaterRenderer target, ShowMessage messenger, WaterRenderer water) + { + var isValid = true; + + if (!target._Enabled) + { + return isValid; + } + +#if !d_Crest_LegacyUnderwater + if (target.AllCameras) + { + messenger + ( + "All Cameras requires Legacy Underwater to be enabled.", + "Either disable All Cameras or enable Project Settings > Crest > Legacy Underwater.", + MessageType.Warning, water + ); + } +#endif + + if (target.Material != null) + { + var material = target.Material; + + if (material.shader.name.StartsWithNoAlloc("Crest/") && material.shader.name != "Crest/Underwater") + { + messenger + ( + $"The material {material.name} assigned to Underwater has the wrong shader ({material.shader.name}).", + "Use a material with the correct shader (Crest/Underwater).", + MessageType.Error, water + ); + + isValid = false; + } + } + + if (water != null && water.Surface.Material != null) + { + var material = water.Surface.Material; + + var cullModeName = +#if d_UnityURP + RenderPipelineHelper.IsUniversal ? "_Cull" : +#endif +#if d_UnityHDRP + RenderPipelineHelper.IsHighDefinition ? "_CullMode" : +#endif + "_BUILTIN_CullMode"; + + if (material.HasFloat(cullModeName) && material.GetFloat(cullModeName) == (int)CullMode.Back) + { + messenger + ( + $"Cull Mode is set to Back on material {material.name}. " + + "The underside of the water surface will not be rendered.", + $"Set Cull Mode to Off (or Front) on {material.name}.", + MessageType.Warning, material, + (material, _) => + { + FixSetMaterialIntProperty(material, "Cull Mode", cullModeName, (int)CullMode.Off); + if (RenderPipelineHelper.IsHighDefinition) + { + // HDRP material will not update without viewing it... + Selection.activeObject = material.targetObject; + } + } + ); + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + if (material.GetFloat(cullModeName) == (int)CullMode.Off && !material.IsKeywordEnabled("_DOUBLESIDED_ON")) + { + messenger + ( + $"Double-Sided is not enabled on material {material.name}. " + + "The underside of the water surface will not be rendered correctly.", + $"Enable Double-Sided on {material.name}.", + MessageType.Warning, material, + (material, _) => + { + FixSetMaterialOptionEnabled(material, "_DOUBLESIDED_ON", "_DoubleSidedEnable", enabled: true); + // HDRP material will not update without viewing it... + Selection.activeObject = material.targetObject; + } + ); + } + } +#endif + } + + return isValid; + } + + static bool Validate(Meniscus target, ShowMessage messenger, WaterRenderer water) + { + var isValid = true; + + if (!target._Enabled) + { + return isValid; + } + + if (target._Material == null) + { + messenger + ( + "The meniscus material is missing. The meniscus will not render.", + "Add the default material or your own.", + MessageType.Warning, + water, + (so, sp) => + { + sp.objectReferenceValue = AssetDatabase.LoadAssetAtPath(Meniscus.k_MaterialPath); + }, + $"{nameof(WaterRenderer._Meniscus)}.{nameof(Meniscus._Material)}" + ); + } + + return isValid; + } + + [Validator(typeof(WaterRenderer))] + static bool Validate(WaterRenderer target, ShowMessage messenger) + { + var isValid = true; + + var water = target; + + isValid = isValid && Validate(target._Underwater, messenger, target); + isValid = isValid && Validate(target._Reflections, messenger, target); + isValid = isValid && Validate(target._Meniscus, messenger, target); + isValid = isValid && ValidateNoRotation(target, target.transform, messenger); + isValid = isValid && ValidateNoScale(target, target.transform, messenger); + +#if CREST_OCEAN + messenger + ( + "The CREST_OCEAN scripting symbol is present from Crest 4. " + + "This enables migration mode. Please read the documentation for the migration guide.", + "Remove CREST_OCEAN from Project Settings > Player > Other Settings > Scripting Define Symbols once finished migrating.", + MessageType.Info, target + ); +#endif + + if (target._Resources == null) + { + messenger + ( + "The Water Renderer is missing required internal data.", + "Populate required internal data.", + MessageType.Error, target, + (_, y) => y.objectReferenceValue = WaterResources.Instance, + nameof(target._Resources) + ); + + isValid = false; + } + + if (target.Surface.Material == null) + { + messenger + ( + "No water material specified.", + $"Assign a valid water material to the Material property of the {nameof(WaterRenderer)} component.", + MessageType.Error, target + ); + + isValid = false; + } + else + { + isValid = ValidateWaterMaterial(target, messenger, water, target.Surface.Material) && isValid; + + if (RenderPipelineHelper.IsHighDefinition && target.Surface.Material.GetFloat("_RefractionModel") > 0) + { + messenger + ( + $"Refraction Model is not None for {target.Surface.Material}. " + + "This is set by default so it is available in the inspector, " + + "but it incurs an overhead and will produce a dark edge at the edge of the viewport (see Screen Space Refraction > Screen Weight Distance). " + + "Enabling the refraction model is only useful to allow volumetric clouds to render over the water surface when view from above. " + + "The refraction model has no effect on refractions.", + $"Set Refraction Model to None.", + MessageType.Info, target.Surface.Material + ); + } + + if (RenderPipelineHelper.IsHighDefinition && target.Surface.Material.HasFloat("_TransparentWritingMotionVec") && target.WriteMotionVectors != (target.Surface.Material.GetFloat("_TransparentWritingMotionVec") == 1f)) + { + messenger + ( + $"Water Renderer > Surface Renderer > Motion Vectors and Transparent Writes Motion Vectors on {target.Surface.Material} do not match. ", + $"Either disable or enable both Water Renderer > Surface Renderer > Motion Vectors and Transparent Writes Motion Vectors", + MessageType.Info, target.Surface.Material + ); + } + + ValidateMaterialParent(target.Surface.VolumeMaterial, target.Surface.Material, messenger); + } + + if (Object.FindObjectsByType(FindObjectsInactive.Exclude, FindObjectsSortMode.None).Length > 1) + { + messenger + ( + $"Multiple {nameof(WaterRenderer)} components detected in open scenes, this is not typical - usually only one {nameof(WaterRenderer)} is expected to be present.", + $"Remove extra {nameof(WaterRenderer)} components.", + MessageType.Warning, target + ); + + isValid = false; + } + + // Water Detail Parameters + var baseMeshDensity = target.LodResolution * 0.25f / target._GeometryDownSampleFactor; + + if (baseMeshDensity < 8) + { + messenger + ( + "Base mesh density is lower than 8. There will be visible gaps in the water surface.", + "Increase the LOD Data Resolution or decrease the Geometry Down Sample Factor.", + MessageType.Error, target + ); + } + else if (baseMeshDensity < 16) + { + messenger + ( + "Base mesh density is lower than 16. There will be visible transitions when traversing the water surface. ", + "Increase the LOD Data Resolution or decrease the Geometry Down Sample Factor.", + MessageType.Warning, target + ); + } + + // We need to find hidden probes too, but do not include assets. + if (Resources.FindObjectsOfTypeAll().Count(x => !EditorUtility.IsPersistent(x)) > 0) + { + messenger + ( + "There are reflection probes in the scene. These can cause tiling to appear on the water surface if not set up correctly.", + "For reflections probes that affect the water, they will either need to cover the visible water tiles or water tiles need to ignore reflection probes (can done done with Water Tile Prefab field). " + + $"For all reflection probles that include the {LayerMask.LayerToName(target.Surface.Layer)} layer, make sure they are above the water surface as underwater reflections are not supported.", + MessageType.Info, target + ); + } + + // Validate scene view effects options. + if (SceneView.lastActiveSceneView != null && !Application.isPlaying) + { + var sceneView = SceneView.lastActiveSceneView; + + // Validate "Animated Materials". + if (target != null && !target._ShowWaterProxyPlane && !sceneView.sceneViewState.alwaysRefresh) + { + messenger + ( + "Animated Materials is not enabled on the scene view. The water's framerate will appear low as updates are not real-time.", + "Enable Animated Materials on the scene view.", + MessageType.Info, target, + (_, _) => + { + SceneView.lastActiveSceneView.sceneViewState.alwaysRefresh = true; + // Required after changing sceneViewState according to: + // https://docs.unity3d.com/ScriptReference/SceneView.SceneViewState.html + SceneView.RepaintAll(); + } + ); + } + +#if d_UnityPostProcessingBroken + // Validate "Post-Processing". + // Only check built-in renderer and Camera.main with enabled PostProcessLayer component. + if (GraphicsSettings.currentRenderPipeline == null && Camera.main != null && + Camera.main.TryGetComponent(out var ppLayer) + && ppLayer.enabled && sceneView.sceneViewState.showImageEffects) + { + messenger + ( + "Post Processing is enabled on the scene view. " + + "There is a Unity bug where gizmos and grid lines will render over opaque objects. " + + "This has been resolved in Post Processing version 3.4.0.", + "Disable Post Processing on the scene view or upgrade to version 3.4.0.", + MessageType.Warning, target, + _ => + { + sceneView.sceneViewState.showImageEffects = false; + // Required after changing sceneViewState according to: + // https://docs.unity3d.com/ScriptReference/SceneView.SceneViewState.html + SceneView.RepaintAll(); + } + ); + } +#endif + } + + // Validate simulation settings. + foreach (var simulation in target.Simulations) + { + ExecuteValidators(simulation, messenger); + } + + // For safety. + if (target != null && target.Surface.Material != null) + { + foreach (var simulation in target.Simulations) + { + ValidateSimulationAndMaterial(OptionalLod.Get(simulation.GetType()), messenger, water); + } + } + + if (target.PrimaryLight == null) + { + messenger + ( + "Crest needs to know which light to use as the sun light.", + "Please add a Directional Light to the scene.", + MessageType.Warning, target + ); + } + + if (target.Viewer == null && !target.IsRunningWithoutGraphics) + { + messenger + ( + "Crest needs to know which camera to use as the main camera.", + $"Either tag a camera as Main Camera or assign the camera to the {nameof(WaterRenderer)}.", + MessageType.Error, target + ); + + isValid = false; + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + var material = target.Surface.Material; + var camera = target._Camera != null ? target._Camera : Camera.main; + var hdCamera = camera != null ? HDCamera.GetOrCreate(camera) : null; + var hdAsset = GraphicsSettings.currentRenderPipeline as HDRenderPipelineAsset; + var mvs = hdAsset.currentPlatformRenderPipelineSettings.supportMotionVectors; + + // Only check the RP asset for now. + if (mvs != water.WriteMotionVectors) + { + messenger + ( + $"Motion Vectors are{(mvs ? "" : " not")} enabled in the HD render pipeline asset, but Water Renderer > Surface Renderer > Motion Vectors is{(mvs ? " not" : "")}. " + + "Both need to be enabled for motion vectors to work, or both should be disabled to save resources. " + + "This can safely be ignored if the setup is intentional.", + "Enable or disable both.", + MessageType.Info, target + ); + } + + if (!hdAsset.currentPlatformRenderPipelineSettings.supportCustomPass) + { + messenger + ( + "Custom passes are disabled. Underwater and other features require them to work.", + "Enabled them on the global asset.", + MessageType.Error, hdCamera.camera + ); + } + + if (target.RenderBeforeTransparency && WaterRenderer.s_CameraMSAA) + { + messenger + ( + $"The water injection point is before transparency and MSAA is enabled for a camera. This combination is not currently supported for HDRP.", + "Disable MSAA or change the water injection point.", + MessageType.Error, target + ); + } + + // Seems that logging is too early for these. And edit mode has false positives. + if (Application.isPlaying && messenger == ValidatedHelper.HelpBox) + { + if (hdCamera?.frameSettings.IsEnabled(FrameSettingsField.CustomPass) == false) + { + messenger + ( + $"Custom passes are disabled for the primary camera ({camera}). Underwater and other features require them to work.", + "Enable them in the camera frame settings on the camera or the default frame settings in the global settings.", + MessageType.Error, hdCamera.camera + ); + } + + if (hdCamera?.frameSettings.IsEnabled(FrameSettingsField.Refraction) == false && material != null && SurfaceRenderer.IsTransparent(material)) + { + messenger + ( + "Refraction is disabled. Transparency requires it to work.", + "Enable it in the camera frame settings on the camera, or the default frame settings in the global settings.", + MessageType.Error, hdCamera.camera + ); + } + } + } +#endif // d_UnityHDRP + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal && target.Viewer != null) + { + var data = target.Viewer.GetUniversalAdditionalCameraData(); + + // Type is internal. + if (data != null && data.scriptableRenderer.GetType().Name == "Renderer2D") + { + messenger + ( + "Crest does not support 2D rendering.", + "Please choose a 3D template.", + MessageType.Error, target + ); + + isValid = false; + } + } +#endif // d_UnityURP + + if (!RenderPipelineHelper.IsHighDefinition && target.Surface.Material != null) + { + if (!target.Surface.AllowRenderQueueSorting && !System.Enum.IsDefined(typeof(RenderQueue), target.Surface.Material.renderQueue)) + { + var field = nameof(SurfaceRenderer.AllowRenderQueueSorting).Pretty().Italic(); + messenger + ( + $"The render queue has a sub-sort applied, but {field} is not enabled. Sub-sorting will not work.", + $"Enable {field}.", + MessageType.Warning, target + ); + } + } + + return isValid; + } + + [Validator(typeof(WaterBody))] + static bool Validate(WaterBody target, ShowMessage messenger) + { + var isValid = true; + + var water = Water; + + if (Object.FindObjectsByType(FindObjectsInactive.Include, FindObjectsSortMode.None).Length == 0) + { + messenger + ( + $"Water body {target.gameObject.name} requires an water renderer component to be present.", + $"Create a separate GameObject and add an {nameof(WaterRenderer)} component to it.", + MessageType.Error, target + ); + + isValid = false; + } + + if (Mathf.Abs(target.transform.lossyScale.x) < 2f && Mathf.Abs(target.transform.lossyScale.z) < 2f) + { + messenger + ( + $"Water body {target.gameObject.name} has a very small size (the size is set by the X & Z scale of its transform), and will be a very small body of water.", + "Increase X & Z scale on water body transform (or parents).", + MessageType.Error, target + ); + + isValid = false; + } + + if (target._Material != null) + { + isValid = ValidateWaterMaterial(target, messenger, Water, target._Material) && isValid; + ValidateMaterialParent(target._BelowSurfaceMaterial, target._Material, messenger); + } + + isValid = isValid && ValidateNoRotation(target, target.transform, messenger); + + if (target.Clipped && water != null) + { + // Validate main material, then overriden material. + ValidateLod(OptionalLod.Get(typeof(ClipLod)), messenger, water); + ValidateLod(OptionalLod.Get(typeof(ClipLod)), messenger, water, material: target._Material); + + if (water.ClipLod.DefaultClippingState == DefaultClippingState.NothingClipped) + { + messenger + ( + $"The {nameof(ClipLod.DefaultClippingState)} on the {nameof(WaterRenderer)} is set to {DefaultClippingState.NothingClipped}. " + + $"The {nameof(WaterBody.Clipped)} option will have no effect.", + $"Disable {nameof(WaterBody.Clipped)} or set {nameof(ClipLod.DefaultClippingState)} to {DefaultClippingState.NothingClipped}.", + MessageType.Warning, + water + ); + } + } + + return isValid; + } + + + /// + /// Does validation for a feature on the water component and on the material + /// + internal static bool ValidateLod(OptionalLod target, ShowMessage messenger, WaterRenderer water, string dependent = null, Material material = null, Object context = null) + { + var isValid = true; + + if (target == null || water == null) + { + return isValid; + } + + var simulation = target.GetLod(water); + + var dependentClause = "."; + + if (dependent != null) + { + dependentClause = $", as {dependent} needs it."; + } + + if (!simulation._Enabled && material == null) + { + messenger + ( + $"{target.PropertyLabel} must be enabled on the {nameof(WaterRenderer)} component{dependentClause}", + $"Enable Simulations > {target.PropertyLabel} > Enabled on the {nameof(WaterRenderer)} component.", + MessageType.Error, water, + (_, y) => + { + y.boolValue = true; + if (Water.Active) + { + // ApplyModifiedProperties is called outside of this method but need it for next + // call. Then restore so ApplyModifiedProperties check works to add undo entry. + simulation._Enabled = true; + simulation.Initialize(); + simulation._Enabled = false; + } + }, + $"{target.PropertyName}.{nameof(Lod._Enabled)}" + ); + + isValid = false; + } + + if (material == null) + { + material = water.Surface.Material; + } + + if (target.HasMaterialToggle && material != null) + { + if (material.HasProperty(target.MaterialProperty) && material.GetFloat(target.MaterialProperty) != 1f) + { + ShowMaterialValidationMessage(target, material, messenger); + isValid = false; + } + } + + if (target.Dependency != null) + { + ValidateLod(OptionalLod.Get(target.Dependency), messenger, water, dependent); + } + + return isValid; + } + + static bool ValidateSignedDistanceFieldsLod(ShowMessage messenger, WaterRenderer water, string feature) + { + var isValid = true; + + if (water != null && !water.DepthLod.EnableSignedDistanceFields) + { + messenger + ( + $"{feature} requires Signed Distance Fields to be enabled on the Water Depth Simulation.", + "Enable Signed Distance Fields", + MessageType.Error, water, + (_, y) => y.boolValue = true, + $"{nameof(WaterRenderer._DepthLod)}.{nameof(DepthLod._EnableSignedDistanceFields)}" + ); + + isValid = false; + } + + return isValid; + } + + static void ShowMaterialValidationMessage(OptionalLod target, Material material, ShowMessage messenger) + { + messenger + ( + $"{target.PropertyLabel} is not enabled ({target.MaterialPropertyPath}) on the water material and will not be visible.", + $"Enable {target.PropertyLabel} on the material currently assigned to the {nameof(WaterRenderer)} component.", + MessageType.Error, material, + (material, _) => FixSetMaterialOptionEnabled(material, target.MaterialKeyword, target.MaterialProperty, true) + ); + } + + static bool ValidateSimulationAndMaterial(OptionalLod target, ShowMessage messenger, WaterRenderer water) + { + if (target == null) + { + return true; + } + + if (!target.HasMaterialToggle) + { + return true; + } + + // These checks are not necessary for our material but there may be custom materials. + if (!water.Surface.Material.HasProperty(target.MaterialProperty)) + { + return true; + } + + var feature = target.GetLod(water); + + // There is only a problem if there is a mismatch. + if (feature._Enabled == (water.Surface.Material.GetFloat(target.MaterialProperty) == 1f)) + { + return true; + } + + if (feature._Enabled) + { + ShowMaterialValidationMessage(target, water.Surface.Material, messenger); + } + else if (messenger != DebugLog) + { + messenger + ( + $"The {target.PropertyLabel} feature is disabled on the {nameof(WaterRenderer)} but is enabled on the water material.", + $"If this is not intentional, either enable {target.PropertyLabel} on the {nameof(WaterRenderer)} to turn it on, or disable {target.MaterialPropertyPath} on the water material to save performance.", + MessageType.Warning, water + ); + } + + return false; + } + + [Validator(typeof(ShapeWaves))] + static bool Validate(ShapeWaves target, ShowMessage messenger) + { + var isValid = true; + + var water = Object.FindAnyObjectByType(FindObjectsInactive.Include); + + if (!target.OverrideGlobalWindSpeed && water != null && water.WindSpeedKPH < WaterRenderer.k_MaximumWindSpeedKPH) + { + messenger + ( + $"The wave spectrum is limited by the Global Wind Speed on the Water Renderer to {water.WindSpeedKPH} KPH.", + $"If you want fully developed waves, either override the wind speed on this component or increase the Global Wind Speed.", + MessageType.Info + ); + } + + if (target.Blend == LodInputBlend.AlphaClip && target.Mode is not (LodInputMode.Texture or LodInputMode.Paint)) + { + messenger + ( + $"Only {LodInputMode.Texture} mode supports {nameof(LodInputBlend.AlphaClip)}.", + $"Change Blend to {nameof(LodInputBlend.Alpha)}.", + MessageType.Error, target, + (_, y) => y.enumValueIndex = (int)LodInputBlend.Alpha, + nameof(ShapeWaves._Blend) + ); + } + + if (Water != null) + { + isValid &= ValidateLod(OptionalLod.Get(typeof(AnimatedWavesLod)), messenger, Water); + } + + return isValid; + } + + [Validator(typeof(SphereWaterInteraction))] + static bool Validate(SphereWaterInteraction target, ShowMessage messenger) + { + var isValid = true; + + // Validate require water feature. + if (Water != null) + { + isValid &= ValidateLod(OptionalLod.Get(typeof(DynamicWavesLod)), messenger, Water); + } + + return isValid; + } + + [Validator(typeof(WatertightHull))] + static bool Validate(WatertightHull target, ShowMessage messenger) + { + var isValid = true; + + // Validate require water feature. + if (Water != null) + { + isValid &= !target.UsesClip || ValidateLod(OptionalLod.Get(typeof(ClipLod)), messenger, Water); + isValid &= !target.UsesDisplacement || ValidateLod(OptionalLod.Get(typeof(AnimatedWavesLod)), messenger, Water); + isValid &= !target.UsesDisplacement || ValidateCollisionLayer(CollisionLayer.AfterDynamicWaves, target, messenger, "mode", target.Mode, required: true); + } + + return isValid; + } + + internal static void FixSetCollisionSourceToCompute(SerializedObject _, SerializedProperty property) + { + if (Water != null) + { + property.enumValueIndex = (int)CollisionSource.GPU; + } + } + + [Validator(typeof(FloatingObject))] + static bool Validate(FloatingObject target, ShowMessage messenger) + { + var isValid = true; + + isValid &= ValidateComponent(target, messenger, target.RigidBody); + + if (Water == null) + { + return isValid; + } + + isValid &= ValidateCollisionLayer(target.Layer, target, messenger, "layer", target.Layer, required: false); + isValid &= ValidateCollisionSource(target, messenger); + + return isValid; + } + + [Validator(typeof(CollisionAreaVisualizer))] + static bool Validate(CollisionAreaVisualizer target, ShowMessage messenger) + { + var isValid = true; + + if (Water == null) + { + return isValid; + } + + isValid &= ValidateCollisionLayer(target._Layer, target, messenger, "layer", target._Layer, required: false); + isValid &= ValidateCollisionSource(target, messenger); + + return isValid; + } + + [Validator(typeof(Controller))] + static bool Validate(Controller target, ShowMessage messenger) + { + var isValid = true; + + isValid &= ValidateComponent(target, messenger, target.Control); + isValid &= ValidateComponent(target, messenger, target.FloatingObject); + + isValid &= isValid && target.TryGetComponent(out FloatingObject fo) && fo.RigidBody != null; + + return isValid; + } + + [Validator(typeof(LodInput))] + static bool Validate(LodInput target, ShowMessage messenger) + { + var isValid = true; + + var isDataInput = target.Mode is LodInputMode.Spline or LodInputMode.Texture or LodInputMode.Renderer or LodInputMode.Paint; + + if (isDataInput) + { + // Find the type associated with the input type and mode. + var self = target.GetType(); + var types = TypeCache.GetTypesWithAttribute(); + System.Type type = null; + foreach (var t in types) + { + var attributes = t.GetCustomAttributes(); + foreach (var attribute in attributes) + { + if (!attribute._Type.IsAssignableFrom(self)) continue; + if (attribute._Mode != target.Mode) continue; + type = t; + goto exit; + } + } + + exit: + isValid = type != null; + +#if !d_CrestPaint + if (!isValid && target.Mode == LodInputMode.Paint) + { + messenger + ( + "Missing the Crest: Paint package.", + $"Install the missing package or select a valid Input Mode such as {target.DefaultMode} to use this input.", + MessageType.Error, + target, + (_, y) => y.enumValueIndex = (int)target.DefaultMode, + nameof(target.Mode) + ); + + return isValid; + } +#endif + +#if !d_CrestSpline + if (!isValid && target.Mode == LodInputMode.Spline) + { + messenger + ( + "Missing the Crest: Spline package.", + $"Install the missing package or select a valid Input Mode such as {target.DefaultMode} to use this input.", + MessageType.Error, + target, + (_, y) => y.enumValueIndex = (int)target.DefaultMode, + nameof(target.Mode) + ); + + return isValid; + } +#endif + + if (!isValid) + { + messenger + ( + "Invalid or unset Input Mode setting.", + $"Select a valid Input Mode such as {target.DefaultMode} to use this input.", + MessageType.Error, + target, + (_, y) => y.enumValueIndex = (int)target.DefaultMode, + nameof(target._Mode) + ); + + return isValid; + } + + isValid = target.Data != null; + + if (!isValid) + { + var isPrefabInstance = PrefabUtility.IsPartOfPrefabInstance(target); + messenger + ( + "Missing internal data or data type was renamed.", + isPrefabInstance ? "Repair the component in the prefab." : "Repair component.", + MessageType.Error, + target, + isPrefabInstance ? null : (_, _) => + { + Undo.RecordObject(target, "Repair"); + target.ChangeMode(target.Mode); + EditorUtility.SetDirty(target); + } + ); + + return isValid; + } + + isValid = target.Data.GetType() == type; + + // This might happen if scripting is used. + if (!isValid) + { + messenger + ( + $"Instance set to {nameof(LodInput.Data)} as incorrect type.", + "Set the correct instance type.", + MessageType.Error, + target, + (_, _) => + { + Undo.RecordObject(target, "Repair"); + target.ChangeMode(target.Mode); + EditorUtility.SetDirty(target); + } + ); + + return isValid; + } + } + + isValid &= ValidateFilteredChoice((int)target.Blend, "_Blend", target, messenger); + + // Validate that any water feature required for this input is enabled, if any + if (Water != null) + { + isValid &= ValidateLod(OptionalLod.Get(target.GetType()), messenger, Water); + } + + return isValid; + } + + [Validator(typeof(DepthProbe))] + static bool Validate(DepthProbe target, ShowMessage messenger) + { + var isValid = true; + + messenger + ( + "If you see an error RenderTexture color format cannot be set to a depth/stencil format or RenderTexture.Create failed, this is likely a bug with Unity (grab pass) or third-party, as they may be registered to execute a custom pass to the DepthProbe camera.", "", MessageType.Info, target + ); + + if (target.Outdated && (messenger != DebugLog || WaterRendererEditor.ManualValidation)) + { + messenger + ( + "Depth Probe is outdated.", + "Click Populate or re-bake the probe to bring the probe up-to-date with component changes.", + MessageType.Warning, target, + (_, _) => target.Populate() + ); + } + + if (target.Type == DepthProbeMode.Baked) + { + messenger + ( + "To change any read-only settings, switch back to real-time, adjust settings, and re-bake.", + "", + MessageType.Info, target + ); + + if (target.SavedTexture == null) + { + messenger + ( + "Depth probe type is Baked but no saved probe data is provided.", + "Assign a saved probe asset.", + MessageType.Error, target + ); + + isValid = false; + } + } + else + { + if (target._Layers == 0) + { + messenger + ( + "No layers specified for rendering into depth probe.", + "Specify one or many layers using the Layers field.", + MessageType.Error, target + ); + + isValid = false; + } +#if d_Unity_Terrain + else + { + Terrain.GetActiveTerrains(s_Terrains); + foreach (var terrain in s_Terrains) + { + if (Helpers.MaskIncludesLayer(target.Layers, terrain.gameObject.layer)) + { + continue; + } + + messenger + ( + $"There are terrains on a layer that is not in {nameof(DepthProbe)}.{nameof(DepthProbe.Layers)}.", + "This is typically mistake leading to no data (ie no shorelines). Please ignore if intentional.", + MessageType.Info, target + ); + + break; + } + } +#endif // d_Unity_Terrain + + if (target._Debug._ForceAlwaysUpdateDebug) + { + messenger + ( + $"Force Always Update Debug option is enabled on depth probe {target.gameObject.name}, which means it will render every frame instead of running from the probe.", + "Disable the Force Always Update Debug option.", + MessageType.Warning, target, + (_, y) => y.boolValue = false, + $"{nameof(DepthProbe._Debug)}.{nameof(DepthProbe._Debug._ForceAlwaysUpdateDebug)}" + ); + } + + if (target._Resolution < 4) + { + messenger + ( + $"Probe resolution {target._Resolution} is very low, which may not be intentional.", + "Increase the probe resolution.", + MessageType.Error, target + ); + + isValid = false; + } + + if (!Mathf.Approximately(target.Scale.x, target.Scale.y)) + { + messenger + ( + $"The {nameof(DepthProbe)} in real-time only supports a uniform scale for X and Z. " + + "These values currently do not match. " + + $"Its current scale in the hierarchy is: X = {target.Scale.x} Z = {target.Scale.y}.", + "Ensure the X & Z scale values are equal on this object and all parents in the hierarchy.", + MessageType.Error, target + ); + + isValid = false; + } + + // We used to test if nothing is present that would render into the probe, but these could probably come from other scenes. + } + + if (!target.Managed && target.transform.lossyScale.XZ().magnitude < 5f) + { + messenger + ( + $"{nameof(DepthProbe)} transform scale is small and will capture a small area of the world. The scale sets the size of the area that will be probed, and this probe is set to render a very small area.", + "Increase the X & Z scale to increase the size of the probe.", + MessageType.Warning, target + ); + + isValid = false; + } + + if (!target.Managed && target.transform.lossyScale.y <= 0f) + { + messenger + ( + $"{nameof(DepthProbe)} scale is zero or negative. Y should be set to 1.0, but can be other values providing it is greater than zero. Its current scale in the hierarchy is {target.transform.lossyScale.y}.", + "Set the Y scale to 1.0.", + MessageType.Error, target + ); + + isValid = false; + } + +#if d_UnityURP +#if !UNITY_6000_0_OR_NEWER +#if UNITY_2022_3_OR_NEWER + if (int.Parse(Application.unityVersion.Substring(7, 2)) < 23) + { + // Asset based validation. + foreach (var asset in GraphicsSettings.allConfiguredRenderPipelines) + { + if (asset is UniversalRenderPipelineAsset urpAsset) + { + var urpRenderers = Helpers.UniversalRendererData(urpAsset); + + foreach (var renderer in urpRenderers) + { + var urpRenderer = (UniversalRendererData)renderer; + + if (urpRenderer.depthPrimingMode != DepthPrimingMode.Disabled) + { + messenger + ( + $"{nameof(DepthPrimingMode)} is not set to {nameof(DepthPrimingMode.Disabled)}. " + + $"This can cause the {nameof(DepthProbe)} not to work. " + + $"Unity fixed this in 2022.3.23f1.", + $"If you are experiencing problems, disable depth priming or upgrade Unity.", + MessageType.Info, urpRenderer + ); + } + + foreach (var feature in renderer.rendererFeatures) + { + if (feature.GetType().Name == "ScreenSpaceAmbientOcclusion" && feature.isActive) + { + messenger + ( + $"ScreenSpaceAmbientOcclusion is is active. " + + $"This can cause the {nameof(DepthProbe)} not to work. " + + $"Unity fixed this in 2022.3.23f1.", + $"If you are experiencing problems, disable SSAO or upgrade Unity.", + MessageType.Info, urpRenderer + ); + } + } + } + } + } + } +#endif +#endif +#endif + + // Check that there are no renderers in descendants. + var renderers = target.GetComponentsInChildren(); + if (renderers.Length > 0) + { + foreach (var renderer in renderers) + { + messenger + ( + "It is not expected that a depth probe object has a Renderer component in its hierarchy." + + "The probe is typically attached to an empty GameObject. Please refer to the example content.", + "Remove the Renderer component from this object or its children.", + MessageType.Warning, renderer + ); + + // Reporting only one renderer at a time will be enough to avoid overwhelming user and UI. + break; + } + + isValid = false; + } + + var water = Water; + + // Validate require water feature. + if (water != null) + { + isValid = isValid && ValidateLod(OptionalLod.Get(typeof(DepthLod)), messenger, water); + + if (!water._DepthLod._EnableSignedDistanceFields && target._GenerateSignedDistanceField) + { + isValid = isValid && ValidateSignedDistanceFieldsLod(messenger, water, "Generate Signed Distance Field"); + } + + if (water.DepthLod.IncludeTerrainHeight && Object.FindAnyObjectByType(FindObjectsInactive.Include) != null) + { + messenger + ( + "The Water Depth data is configured to automatically include terrain height via Include Terrain Height. " + + "Using a DepthProbe is still valid to capture non-terrain details like rocks. " + + "But typically, if you are using a DepthProbe, it is best to capture the terrain too, as it is more accurate. " + + "One reason to use a DepthProbe together with the auto capture is for better real-time/on-demand depth capture performance.", + string.Empty, + MessageType.Info, water + ); + } + } + + + return isValid; + } + + [Validator(typeof(QueryEvents))] + static bool Validate(QueryEvents target, ShowMessage messenger) + { + var isValid = true; + var water = Water; + + if (!target._DistanceFromEdge.IsEmpty()) + { + isValid = isValid && ValidateLod(OptionalLod.Get(typeof(DepthLod)), messenger, water); + isValid = isValid && ValidateSignedDistanceFieldsLod(messenger, water, "Distance From Edge"); + } + + if (!target._DistanceFromSurface.IsEmpty()) + { + isValid &= ValidateCollisionLayer(target._Layer, target, messenger, "layer", target._Layer, required: false); + isValid &= ValidateCollisionSource(target, messenger); + } + + return isValid; + } + + [Validator(typeof(FoamLodSettings))] + static bool Validate(FoamLodSettings target, ShowMessage messenger) + { + var isValid = true; + + if (Water == null) + { + return isValid; + } + + if (target.FilterWaves > Water.LodLevels - 2) + { + messenger + ( + "Filter Waves is higher than the recommended maximum (LOD count - 2). There will be no whitecaps.", + "Reduce Filter Waves.", + MessageType.Warning, target + ); + } + + return isValid; + } + + [Validator(typeof(Lod))] + static bool Validate(Lod target, ShowMessage messenger) + { + var isValid = true; + + if (!target._Enabled) + { + return isValid; + } + + var optional = OptionalLod.Get(target.GetType()); + + if (Water != null && optional.Dependency != null) + { + isValid &= ValidateLod(OptionalLod.Get(optional.Dependency), messenger, Water, target.Name); + } + + return isValid; + } + + [Validator(typeof(AnimatedWavesLod))] + static bool Validate(AnimatedWavesLod target, ShowMessage messenger) + { + var isValid = true; + +#if !d_CrestCPUQueries + if (target.CollisionSource == CollisionSource.CPU) + { + messenger + ( + "Collision Source is set to CPU but the CPU Queries package is not installed.", + "Install the CPU Queries package or switch to GPU queries.", + MessageType.Warning, target.Water, + FixSetCollisionSourceToCompute + ); + } +#endif + + if (target.CollisionSource == CollisionSource.None) + { + messenger + ( + "Collision Source in Water Renderer is set to None. The floating objects in the scene will use a flat horizontal plane.", + "Set collision source to GPU.", + MessageType.Warning, target.Water, + FixSetCollisionSourceToCompute, + $"{nameof(WaterRenderer._AnimatedWavesLod)}.{nameof(AnimatedWavesLod._CollisionSource)}" + + ); + } + + return isValid; + } + + [Validator(typeof(ScatteringLod))] + static bool Validate(ScatteringLod target, ShowMessage messenger) + { + var isValid = true; + + var water = Water; + + if (!target.Enabled) + { + return isValid; + } + + if (target._ShorelineColorSource != ShorelineVolumeColorSource.None) + { + if (!water._DepthLod._Enabled) + { + ShowDependentPropertyMessage + ( + "Shoreline Scattering", + "Water Depth", + $"{nameof(WaterRenderer._DepthLod)}.{nameof(Lod._Enabled)}", + messenger, + water + ); + } + else if (target._ShorelineColorSource == ShorelineVolumeColorSource.Distance && !water._DepthLod._EnableSignedDistanceFields) + { + ShowDependentPropertyMessage + ( + "Shoreline Distance Scattering", + "Signed Distance Fields", + $"{nameof(WaterRenderer._DepthLod)}.{nameof(WaterRenderer._DepthLod._EnableSignedDistanceFields)}", + messenger, + water + ); + } + } + + return isValid; + } + + [Validator(typeof(CutsceneTimeProvider))] + static bool Validate(CutsceneTimeProvider target, ShowMessage messenger) + { + var isValid = true; + + var water = Water; + if (water == null) + { + messenger + ( + $"No water present. {nameof(CutsceneTimeProvider)} will have no effect.", + "", MessageType.Warning + ); + + isValid = false; + } + +#if d_ModuleUnityDirector + if (target._PlayableDirector == null) + { + messenger + ( + $"No {nameof(UnityEngine.Playables.PlayableDirector)} component assigned. {nameof(CutsceneTimeProvider)} will have no effect.", + $"Add a {nameof(UnityEngine.Playables.PlayableDirector)}", + MessageType.Error + ); + + isValid = false; + } +#else + messenger + ( + $"This component requires the com.unity.modules.director built-in module to function.", + $"Enable the com.unity.modules.director built-in module.", + MessageType.Error + ); + + isValid = false; +#endif + + return isValid; + } + + static bool ValidateWaterMaterial(Object target, ShowMessage messenger, WaterRenderer water, Material material) + { + var isValid = true; + + // TODO: We could be even more granular with what needs this property. + if (water._Underwater._Enabled && !material.HasVector(WaterRenderer.ShaderIDs.s_Absorption)) + { + messenger + ( + $"Material {material.name} does not have Crest Absorption property. " + + "Several features require absorption like underwater culling and lighting.", + $"Assign a valid water material.", + MessageType.Warning, target + ); + } + + return isValid; + } + + static bool ValidateMaterialParent(Material child, Material parent, ShowMessage messenger) + { + var isValid = true; + + if (child != null && child.parent != parent) + { + messenger + ( + $"The {child} does not have {parent} as a parent. " + + "Linking these materials is typically how these are used to avoid trying to keep properties in sync.", + $"Parent {parent} to {child}.", + MessageType.Info, parent, + (_, _) => + { + Undo.RecordObject(child, "Assign parent"); + child.parent = parent; + } + ); + } + + return isValid; + } + + static bool ValidateComponent(T target, ShowMessage messenger, C @object) + where T : Component + where C : Component + { + var isValid = true; + + if (@object == null && !target.gameObject.TryGetComponent(out _)) + { + messenger + ( + $"{typeof(T).Name} requires a {typeof(C).Name} to be set or present on same object.", + $"Set the {typeof(C).Name} property or add a {typeof(C).Name}.", + MessageType.Error + ); + + isValid = false; + } + + return isValid; + } + + static bool ValidateCollisionLayer(CollisionLayer layer, Object target, ShowMessage messenger, string label, object value, bool required) + { + if (Water == null) + { + return true; + } + + var layers = Water.AnimatedWavesLod._CollisionLayers; + + if (layer == CollisionLayer.Everything) + { + return true; + } + + var flag = (CollisionLayers)((int)layer << 1); + + if (!layers.HasFlag(flag)) + { + var fix = $"Enable the {flag} layer on the {nameof(WaterRenderer)}."; + if (!required) fix += " You can safely ignore this warning."; + + messenger + ( + $"The {value} {label} requires the {flag} layer which is not enabled.", + fix, + required ? MessageType.Error : MessageType.Warning, messenger == DebugLog ? target : Water, + (_, y) => y.intValue = (int)(layers | flag), + $"{nameof(WaterRenderer._AnimatedWavesLod)}.{nameof(WaterRenderer._AnimatedWavesLod._CollisionLayers)}" + ); + + return !required; + } + + return true; + } + + static bool ValidateCollisionSource(Object target, ShowMessage messenger) + { + if (Water == null) + { + return true; + } + + if (Water._AnimatedWavesLod.CollisionSource == CollisionSource.None) + { + messenger + ( + "Collision Source on the Water Renderer is set to None. The floating objects in the scene will use a flat horizontal plane.", + "Set the Collision Source to GPU to incorporate waves into physics.", + MessageType.Warning, Water, + FixSetCollisionSourceToCompute + ); + } + + return true; + } + + static bool ValidateFilteredChoice(int choice, string property, Object target, ShowMessage messenger) + { + var filter = target + .GetType() + .GetCustomAttributes(inherit: true) + .FirstOrDefault(x => x._Property == property); + + if (filter?._Values.Contains(choice) == false) + { + var label = property[1..]; + + messenger + ( + $"The {label} property is invalid.", + $"Choose a correct {label} property.", + MessageType.Error, + target + ); + + return false; + } + + return true; + } + + static void ShowDependentPropertyMessage(string dependentLabel, string dependencyLabel, string dependencyPropertyPath, ShowMessage messenger, Object dependencyContext) + { + messenger + ( + $"{dependencyLabel} is not enabled, but {dependentLabel} requires it.", + $"Enable {dependencyLabel}.", + MessageType.Warning, dependencyContext, + (_, y) => y.boolValue = true, + dependencyPropertyPath + ); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/Validators.cs.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/Validators.cs.meta new file mode 100644 index 0000000..ae77b66 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/Validators.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a336ee1d263304acd96f8fe1e4bdae7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/WaveHarmonic.Crest.Editor.asmdef b/Packages/com.waveharmonic.crest/Editor/Scripts/WaveHarmonic.Crest.Editor.asmdef new file mode 100644 index 0000000..ed39db9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/WaveHarmonic.Crest.Editor.asmdef @@ -0,0 +1,91 @@ +{ + "name": "WaveHarmonic.Crest.Editor", + "rootNamespace": "", + "references": [ + "GUID:d60799ab2a985554ea1a39cd38695018", + "GUID:3eae0364be2026648bf74846acb8a731", + "GUID:df380645f10b7bc4b97d4f5eb6303d95", + "GUID:78bd2ddd6e276394a9615c203e574844", + "GUID:457756d89b35d2941b3e7b37b4ece6f1", + "GUID:c579267770062bf448e75eb160330b7f", + "GUID:15fc0a57446b3144c949da3e2b9737a9", + "GUID:be0903cd8e1546f498710afdc59db5eb", + "GUID:7c347618730f5467f86a58f333ce21df", + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:1ab2a6c2a51cd4b43867788dbaee1a55" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER" + ], + "versionDefines": [ + { + "name": "com.unity.modules.director", + "expression": "", + "define": "d_ModuleUnityDirector" + }, + { + "name": "com.unity.modules.terrain", + "expression": "", + "define": "d_Unity_Terrain" + }, + { + "name": "com.unity.postprocessing", + "expression": "", + "define": "d_UnityPostProcessing" + }, + { + "name": "com.unity.postprocessing", + "expression": "(,3.4.0)", + "define": "d_UnityPostProcessingBroken" + }, + { + "name": "com.unity.render-pipelines.high-definition", + "expression": "", + "define": "d_UnityHDRP" + }, + { + "name": "com.unity.render-pipelines.universal", + "expression": "", + "define": "d_UnityURP" + }, + { + "name": "com.unity.shadergraph", + "expression": "", + "define": "d_UnityShaderGraph" + }, + { + "name": "com.waveharmonic.crest.cpu-queries", + "expression": "", + "define": "d_CrestCPUQueries" + }, + { + "name": "com.waveharmonic.crest.paint", + "expression": "", + "define": "d_CrestPaint" + }, + { + "name": "com.waveharmonic.crest.splines", + "expression": "", + "define": "d_CrestSpline" + }, + { + "name": "com.waveharmonic.crest.portals", + "expression": "", + "define": "d_CrestPortals" + }, + { + "name": "com.waveharmonic.crest.shifting-origin", + "expression": "", + "define": "d_WaveHarmonic_Crest_ShiftingOrigin" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Editor/Scripts/WaveHarmonic.Crest.Editor.asmdef.meta b/Packages/com.waveharmonic.crest/Editor/Scripts/WaveHarmonic.Crest.Editor.asmdef.meta new file mode 100644 index 0000000..e4bf3d5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Scripts/WaveHarmonic.Crest.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 125c216bac85c4443bfd4de6bc7eda99 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders.meta b/Packages/com.waveharmonic.crest/Editor/Shaders.meta new file mode 100644 index 0000000..7849c81 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 525c62df3abb1431ca553a741ad010ff +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/Templates.meta b/Packages/com.waveharmonic.crest/Editor/Shaders/Templates.meta new file mode 100644 index 0000000..1dec280 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/Templates.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d58ac8f98317946b3b1ac9796ddeb14c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/Templates/SharedCode.template.hlsl b/Packages/com.waveharmonic.crest/Editor/Shaders/Templates/SharedCode.template.hlsl new file mode 100644 index 0000000..0a9d7cd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/Templates/SharedCode.template.hlsl @@ -0,0 +1,6 @@ +// Shader Graph Complete +// Copyright © 2025 Wave Harmonic. All rights reserved. + +$include("Templates/SharedCode.template.hlsl") + +$VertexDescriptionInputs.TimeParameters: #define GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/Templates/SharedCode.template.hlsl.meta b/Packages/com.waveharmonic.crest/Editor/Shaders/Templates/SharedCode.template.hlsl.meta new file mode 100644 index 0000000..0dc2682 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/Templates/SharedCode.template.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ee5a966d356084782a3e3e78ec78b8e3 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/VisualizeNegativeValues.compute b/Packages/com.waveharmonic.crest/Editor/Shaders/VisualizeNegativeValues.compute new file mode 100644 index 0000000..1c7ca25 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/VisualizeNegativeValues.compute @@ -0,0 +1,34 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestVisualizeNegativeValues_Scalar +#pragma kernel CrestVisualizeNegativeValues_Array _ARRAY + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl" + +#ifdef _ARRAY +#define d_RWTexture RWTexture2DArray +#else +#define d_RWTexture RWTexture2D +#endif + +#ifdef _ARRAY +#define d_RWTextureCoordinates(id) id +#else +#define d_RWTextureCoordinates(id) id.xy +#endif + +d_RWTexture _Crest_Target; + +m_UtilityNameSpace + +void VisualizeNegativeValues(uint3 id) +{ + _Crest_Target[d_RWTextureCoordinates(id)] += 1.0; + _Crest_Target[d_RWTextureCoordinates(id)] *= 0.5; +} + +m_UtilityNameSpaceEnd + +m_UtilityKernelDefaultVariant(VisualizeNegativeValues, _Scalar) +m_UtilityKernelDefaultVariant(VisualizeNegativeValues, _Array) diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/VisualizeNegativeValues.compute.meta b/Packages/com.waveharmonic.crest/Editor/Shaders/VisualizeNegativeValues.compute.meta new file mode 100644 index 0000000..5fdbe69 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/VisualizeNegativeValues.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 29e0431627e624337b14d8521dc77485 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl new file mode 100644 index 0000000..9df01d9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl @@ -0,0 +1,85 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaterLevelDepth +#define d_WaterLevelDepth + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl" + +m_CrestNameSpace + +struct Attributes +{ + float3 positionOS : POSITION; +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; +}; + +Varyings Vertex(Attributes attributes) +{ + // This will work for all pipelines. + Varyings varyings = (Varyings)0; + + const Cascade cascade0 = Cascade::Make(_Crest_LodIndex); + const Cascade cascade1 = Cascade::Make(_Crest_LodIndex + 1); + + float3 positionWS = mul(UNITY_MATRIX_M, float4(attributes.positionOS.xyz, 1.0)).xyz; + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xz += _WorldSpaceCameraPos.xz; +#endif + + float alpha; + SnapAndTransitionVertLayout(_Crest_ChunkMeshScaleAlpha, cascade0, _Crest_ChunkGeometryGridWidth, positionWS, alpha); + + { + // :WaterGridPrecisionErrors + float2 center = UNITY_MATRIX_M._m03_m23; +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + center += _WorldSpaceCameraPos.xz; +#endif + const float2 camera = abs(_WorldSpaceCameraPos.xz); + positionWS.xz = lerp(center, positionWS.xz, lerp(1.0, 1.01, max(camera.x, camera.y) * 0.00001)); + } + + const float weight0 = (1.0 - alpha) * cascade0._Weight; + const float weight1 = (1.0 - weight0) * cascade1._Weight; + + half offset = 0.0; + if (weight0 > m_CrestSampleLodThreshold) + { + Cascade::MakeLevel(_Crest_LodIndex).SampleLevel(positionWS.xz, weight0, offset); + } + if (weight1 > m_CrestSampleLodThreshold) + { + Cascade::MakeLevel(_Crest_LodIndex + 1).SampleLevel(positionWS.xz, weight1, offset); + } + + positionWS.y += offset; + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xz -= _WorldSpaceCameraPos.xz; +#endif + + varyings.positionCS = mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); + + return varyings; +} + +half4 Fragment(Varyings varyings) +{ + return half4(0.0, 0.0, 0.0, 1.0); +} + +m_CrestNameSpaceEnd + +m_CrestVertex +m_CrestFragment(half4) + +#endif // d_WaterLevelDepth diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl.meta b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl.meta new file mode 100644 index 0000000..2dfe9ab --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b63597e54ae1f4f3f849a64b9c1ddb88 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.shader b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.shader new file mode 100644 index 0000000..388051d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.shader @@ -0,0 +1,71 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest/Editor/Water Level (Depth)" +{ + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.high-definition" + } + + Tags { "RenderPipeline"="HDRenderPipeline" } + + Pass + { + Cull Back + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + #include "Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl" + ENDHLSL + } + } + + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.universal" + } + + Tags { "RenderPipeline"="UniversalPipeline" } + + Pass + { + Cull Back + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl" + ENDHLSL + } + } + + SubShader + { + Pass + { + Cull Back + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.hlsl" + ENDHLSL + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.shader.meta b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.shader.meta new file mode 100644 index 0000000..0ad6ba5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterLevel.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cbfa79cd4adf840128ddd9c3be065074 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/WaterProxy.shader b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterProxy.shader new file mode 100644 index 0000000..13fd1aa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterProxy.shader @@ -0,0 +1,55 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest/Editor/WaterProxy" +{ + SubShader + { + Tags { "RenderType"="Transparent" "Queue"="Transparent"} + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off + Cull Off + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + // make fog work + #pragma multi_compile_fog + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + UNITY_FOG_COORDS(1) + float4 vertex : SV_POSITION; + }; + + v2f vert (appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + UNITY_TRANSFER_FOG(o, o.vertex); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + fixed4 col = fixed4(0.0, 0.3, 1.0, 0.5); + + // apply fog + UNITY_APPLY_FOG(i.fogCoord, col); + + return col; + } + ENDCG + } + } +} diff --git a/Packages/com.waveharmonic.crest/Editor/Shaders/WaterProxy.shader.meta b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterProxy.shader.meta new file mode 100644 index 0000000..fa36275 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Editor/Shaders/WaterProxy.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 64f548899ca4e4bfab9b53303d8b9c84 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/ReadMe.txt b/Packages/com.waveharmonic.crest/ReadMe.txt new file mode 100644 index 0000000..ce224dc --- /dev/null +++ b/Packages/com.waveharmonic.crest/ReadMe.txt @@ -0,0 +1,3 @@ +Thank you for purchasing! + +Offline manual is located in the Documentation~ folder in this package directory (viewable from OS file browser). diff --git a/Packages/com.waveharmonic.crest/ReadMe.txt.meta b/Packages/com.waveharmonic.crest/ReadMe.txt.meta new file mode 100644 index 0000000..257154c --- /dev/null +++ b/Packages/com.waveharmonic.crest/ReadMe.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5e5cf69a2769d4e3881aa0e323a67c5e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime.meta b/Packages/com.waveharmonic.crest/Runtime.meta new file mode 100644 index 0000000..726f617 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d405539da856b4becb9c8639d503b753 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Data.meta b/Packages/com.waveharmonic.crest/Runtime/Data.meta new file mode 100644 index 0000000..bc0bd54 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1dfc7e28d58b14deaa99d95b6ccd0cc5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra.meta b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra.meta new file mode 100644 index 0000000..f25d8be --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 59056ec4af44c42dd8f36c6a25eece46 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesCalm.asset b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesCalm.asset new file mode 100644 index 0000000..718b22d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesCalm.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: WavesCalm + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 56 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.39794 + - -7.39794 + - -7.39794 + - -5.526391 + - -4.8159227 + - -4.413246 + - -4.081862 + - -3.7773297 + - -3.8762438 + - -3.824092 + - -3.4170768 + - -3.2395759 + - -3.2135434 + - -7.39794 + _PowerDisabled: 0000000000000000000000000000 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesCalm.asset.meta b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesCalm.asset.meta new file mode 100644 index 0000000..c3e2d86 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesCalm.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2985cdff827b8472bafc9e2da18fbf06 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesDead.asset b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesDead.asset new file mode 100644 index 0000000..c2d01be --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesDead.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: WavesDead + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 56 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.39794 + - -7.39794 + - -7.39794 + - -5.526391 + - -4.8159227 + - -4.413246 + - -4.081862 + - -3.7773297 + - -3.8762438 + - -3.824092 + - -3.4170768 + - -3.2395759 + - -3.2135434 + - -7.39794 + _PowerDisabled: 0000010101010101010101010101 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesDead.asset.meta b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesDead.asset.meta new file mode 100644 index 0000000..68824f9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesDead.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1c2709c536afb4bf6b90d29d03758f0d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerate.asset b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerate.asset new file mode 100644 index 0000000..8f75377 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerate.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: WavesModerate + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 90 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.1418724 + - -6.539813 + - -5.937754 + - -5.3357 + - -4.733663 + - -4.1316957 + - -3.5300062 + - -2.929428 + - -2.3332953 + - -1.7549441 + - -1.2477198 + - -1.0250019 + - -1.9403106 + - -7.39794 + _PowerDisabled: 0000000000000000000000000000 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.54 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerate.asset.meta b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerate.asset.meta new file mode 100644 index 0000000..d3dac8b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerate.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce5a3f1aff978418c90b45d58f574528 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerateSmooth.asset b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerateSmooth.asset new file mode 100644 index 0000000..b058743 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerateSmooth.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: WavesModerateSmooth + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 90 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.39794 + - -7.39794 + - -7.39794 + - -6.302198 + - -5.9911127 + - -4.7409434 + - -4.5640044 + - -4.4886622 + - -2.9012794 + - -1.1004922 + - -0.86166644 + - -0.36967784 + - 1.3923892 + - 1.60206 + _PowerDisabled: 0000000000000000000000000000 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.6 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerateSmooth.asset.meta b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerateSmooth.asset.meta new file mode 100644 index 0000000..5c71674 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesModerateSmooth.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c508e8f723e64d21a5219d1530e6ffd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesShoreline.asset b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesShoreline.asset new file mode 100644 index 0000000..3b51127 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesShoreline.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: WavesShoreline + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 20 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.1418724 + - -6.539813 + - -5.937754 + - -5.3357 + - -4.733663 + - -3.2727537 + - -2.97585 + - -2.4583952 + - -1.6128922 + - -1.7549441 + - -1.2477198 + - -1.0250019 + - -1.9403106 + - -7.39794 + _PowerDisabled: 0101010101000100000001010101 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.54 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesShoreline.asset.meta b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesShoreline.asset.meta new file mode 100644 index 0000000..536b540 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesShoreline.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 120e704899e8944e9baf31404179e7ce +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesSwell.asset b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesSwell.asset new file mode 100644 index 0000000..9503d9c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesSwell.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: WavesSwell + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 90 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.10794 + - -6.42794 + - -5.93794 + - -5.27794 + - -4.67794 + - -3.71794 + - -3.17794 + - -2.60794 + - -1.93794 + - -1.11794 + - -0.85794 + - -0.36794 + - 0.04206 + - -8 + _PowerDisabled: 0101010101010101000000000000 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.6 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesSwell.asset.meta b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesSwell.asset.meta new file mode 100644 index 0000000..2e59737 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Data/WaveSpectra/WavesSwell.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: efa03f442951949c7bbfadb22765f653 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials.meta b/Packages/com.waveharmonic.crest/Runtime/Materials.meta new file mode 100644 index 0000000..fd47cc3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05822262553744bae9714920130c0899 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs.meta new file mode 100644 index 0000000..77cf3c0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a214bb0d815f498aaee2e050a73697f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipExcludeArea.mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipExcludeArea.mat new file mode 100644 index 0000000..0fed55f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipExcludeArea.mat @@ -0,0 +1,87 @@ +%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: ClipExcludeArea + m_Shader: {fileID: 4800000, guid: 288a089f90e714983b8a760dd49e5a5c, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _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} + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _BumpScale: 1 + - _ColorWriteMask: 4 + - _Crest_ColorMask: 15 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Crest_Value: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipExcludeArea.mat.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipExcludeArea.mat.meta new file mode 100644 index 0000000..9a4e00d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipExcludeArea.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1131dd19089574b28a35a17f1ea28f32 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipIncludeArea.mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipIncludeArea.mat new file mode 100644 index 0000000..bf972f1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipIncludeArea.mat @@ -0,0 +1,87 @@ +%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: ClipIncludeArea + m_Shader: {fileID: 4800000, guid: 288a089f90e714983b8a760dd49e5a5c, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _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} + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _BumpScale: 1 + - _ColorWriteMask: 4 + - _Crest_ColorMask: 15 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Crest_Value: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipIncludeArea.mat.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipIncludeArea.mat.meta new file mode 100644 index 0000000..6429ba2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/ClipIncludeArea.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a561aef740e74d45a7db7b9dc255dd7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/PushWaterUnderConvexHull.mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/PushWaterUnderConvexHull.mat new file mode 100644 index 0000000..32e5389 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/PushWaterUnderConvexHull.mat @@ -0,0 +1,30 @@ +%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: PushWaterUnderConvexHull + m_Shader: {fileID: 4800000, guid: 170672f06b4574545ba8305cb7d11091, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: + - _Crest_Version: 0 + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/PushWaterUnderConvexHull.mat.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/PushWaterUnderConvexHull.mat.meta new file mode 100644 index 0000000..03ae03b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/PushWaterUnderConvexHull.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fbe311c1027b04a3d8401654d4a9d72f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/WaterLevelFromGeometry.mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/WaterLevelFromGeometry.mat new file mode 100644 index 0000000..8f18bda --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/WaterLevelFromGeometry.mat @@ -0,0 +1,30 @@ +%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: WaterLevelFromGeometry + m_Shader: {fileID: 4800000, guid: 06402bee7075b4b9fafef2b1ddf3b5cc, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: + - _Crest_Version: 0 + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/WaterLevelFromGeometry.mat.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/WaterLevelFromGeometry.mat.meta new file mode 100644 index 0000000..ea28a43 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Inputs/WaterLevelFromGeometry.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0f5eb7d739bac4dcf97596cc6b192494 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Meniscus.mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Meniscus.mat new file mode 100644 index 0000000..da2e532 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Meniscus.mat @@ -0,0 +1,35 @@ +%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: Meniscus + m_Shader: {fileID: 4800000, guid: ec7c774912c6f4b3cb6d73444cdedeca, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - d_Crest_Lighting + - d_Crest_Refraction + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: + - _Crest_LightingEnabled: 1 + - _Crest_RefractionEnabled: 1 + m_Floats: + - _Crest_Radius: 0.01 + - _Crest_RefractionStrength: 0.2 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Meniscus.mat.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Meniscus.mat.meta new file mode 100644 index 0000000..df80d51 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Meniscus.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 238e45299a5ec46308e9bf99ddf67963 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Water (Flow).mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Water (Flow).mat new file mode 100644 index 0000000..691a254 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Water (Flow).mat @@ -0,0 +1,91 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3046556431833965186 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Water (Flow) + m_Shader: {fileID: -6465566751694194690, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_Parent: {fileID: 2100000, guid: 8ab064b6606504a55b489af2787350c2, type: 2} + m_ModifiedSerializedProperties: 26 + m_ValidKeywords: + - CREST_FLOW_ON + - _ALPHATEST_ON + - _BUILTIN_ALPHATEST_ON + - _BUILTIN_AlphaClip + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + MotionVector: User + RenderType: Transparent + disabledShaderPasses: + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - CREST_FLOW: 1 + - _SrcBlend: 5 + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!114 &84831097882938775 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &8072045821928201339 +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 diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Water (Flow).mat.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Water (Flow).mat.meta new file mode 100644 index 0000000..976aa5c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Water (Flow).mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4b26ad6c6869b4091881e76c99363dac +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat new file mode 100644 index 0000000..3126c4c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat @@ -0,0 +1,73 @@ +%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: Water Volume + m_Shader: {fileID: 4800000, guid: 034b985bd9c344992af148e26d2cdb24, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - d_Crest_NoMaskDepth + - d_Dithering + m_InvalidKeywords: + - _ALPHATEST_ON + - _BUILTIN_ALPHATEST_ON + - _BUILTIN_AlphaClip + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _SURFACE_TYPE_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Crest_CausticsDistortionTexture: + m_Texture: {fileID: 2800000, guid: 7aa3f69cfb40b429a865c45a7271c5f5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Crest_CausticsTexture: + m_Texture: {fileID: 2800000, guid: 1407209016967410da2ae6fdd4d97fc6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: + - _Crest_DataSliceOffset: 13 + - _Crest_DitheringEnabled: 1 + - _Crest_Version: 0 + m_Floats: + - CREST_FLOW: 0 + - _Crest_AmbientTerm: 1 + - _Crest_Anisotropy: 0.5 + - _Crest_CausticsDepthOfField: 6 + - _Crest_CausticsDistortionScale: 250 + - _Crest_CausticsDistortionStrength: 0.16 + - _Crest_CausticsEnabled: 1 + - _Crest_CausticsFocalDepth: 2 + - _Crest_CausticsMotionBlur: 1 + - _Crest_CausticsScrollSpeed: 1 + - _Crest_CausticsStrength: 3.2 + - _Crest_CausticsTextureAverage: 0.07 + - _Crest_CausticsTextureScale: 50 + - _Crest_DirectTerm: 1 + - _Crest_DitheringIntensity: 1 + - _Crest_ExtinctionMultiplier: 1 + - _Crest_OutScatteringExtinctionFactor: 0.2 + - _Crest_OutScatteringFactor: 0.2 + - _Crest_ShadowsAffectsAmbientFactor: 0.5 + - _Crest_SunBoost: 2 + m_Colors: + - _Crest_AbsorptionColor: {r: 0.3416268, g: 0.6954546, b: 0.85, a: 0.1019608} + - _Crest_Scattering: {r: 0, g: 0.09803922, b: 0.2, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat.meta new file mode 100644 index 0000000..648a6e9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2b096e4d95e646c49d48ece0afa0547 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Water.mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Water.mat new file mode 100644 index 0000000..778c36a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Water.mat @@ -0,0 +1,106 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5994654682710206810 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-4042563326011365698 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Water + m_Shader: {fileID: -6465566751694194690, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_Parent: {fileID: -876546973899608171, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - CREST_FLOW_ON + - _ALPHATEST_ON + - _BUILTIN_ALPHATEST_ON + - _BUILTIN_AlphaClip + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + MotionVector: User + RenderType: Transparent + disabledShaderPasses: + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - CREST_FLOW: 1 + - _AlphaDstBlend: 10 + - _BUILTIN_DstBlend: 10 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_SrcBlend: 5 + - _BUILTIN_ZWrite: 1 + - _CullMode: 0 + - _CullModeForward: 0 + - _DstBlend: 10 + - _QueueControl: 0 + - _RefractionModel: 0 + - _SrcBlend: 5 + - _ZTestGBuffer: 3 + - _ZWrite: 1 + m_Colors: + - _Crest_Scattering: {r: 0.19873619, g: 0.36684015, b: 0.5471698, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &4748330692745026848 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Water.mat.meta b/Packages/com.waveharmonic.crest/Runtime/Materials/Water.mat.meta new file mode 100644 index 0000000..e4329a3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Water.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8ab064b6606504a55b489af2787350c2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Prefabs.meta b/Packages/com.waveharmonic.crest/Runtime/Prefabs.meta new file mode 100644 index 0000000..82340df --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 77ee3d78b64074b2cba27c3b39c6084a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Prefabs/Chunk.prefab b/Packages/com.waveharmonic.crest/Runtime/Prefabs/Chunk.prefab new file mode 100644 index 0000000..79a692e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Prefabs/Chunk.prefab @@ -0,0 +1,75 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1516456258233481520 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5573293823876610619} + - component: {fileID: 6121422689720352427} + m_Layer: 4 + m_Name: Chunk + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5573293823876610619 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1516456258233481520} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &6121422689720352427 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1516456258233481520} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 2 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: [] + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Runtime/Prefabs/Chunk.prefab.meta b/Packages/com.waveharmonic.crest/Runtime/Prefabs/Chunk.prefab.meta new file mode 100644 index 0000000..98e032c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Prefabs/Chunk.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 17840562212c147d6bdb5144d35bc442 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts.meta new file mode 100644 index 0000000..cdeb84a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cfeba4e421ad54be597d83f0638a0c55 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Assembly.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Assembly.cs new file mode 100644 index 0000000..7b51a89 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Assembly.cs @@ -0,0 +1,33 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Define empty namespaces for when assemblies are not present. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Ripples")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.CPUQueries")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.CPUQueries.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Paint")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Paint.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Scripting")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShallowWater")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShallowWater.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Splines")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Splines.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Watercraft")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Watercraft.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Whirlpool")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Whirlpool.Editor")] + +namespace UnityEngine.InputSystem { } +namespace UnityEngine.Rendering.HighDefinition { } +namespace UnityEngine.Rendering.RenderGraphModule { } +namespace UnityEngine.Rendering.Universal { } +namespace WaveHarmonic.Crest.Editor { } +namespace WaveHarmonic.Crest.Paint { } +namespace WaveHarmonic.Crest.Splines { } +namespace WaveHarmonic.Crest.RelativeSpace { } diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Assembly.cs.meta new file mode 100644 index 0000000..540a6b6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc511f9846b8c404091aace6915510df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Constants.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Constants.cs new file mode 100644 index 0000000..c32e32f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Constants.cs @@ -0,0 +1,35 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// 9160b2d47f1cb3d7559ed4fafa79e52b9448ef2a6d863948fe3c4eeddcd958da + +namespace WaveHarmonic.Crest +{ + static class Constants + { +#if CREST_OCEAN + const string k_Prefix = "Crest 5 "; +#else + const string k_Prefix = "Crest "; +#endif + const string k_MenuScripts = "Crest/"; + public const string k_MenuPrefixScripts = k_MenuScripts + k_Prefix; + public const string k_MenuPrefixInternal = k_MenuScripts + "Internal/"; + public const string k_MenuPrefixDebug = k_MenuScripts + "Debug/" + k_Prefix; + public const string k_MenuPrefixInputs = k_MenuScripts + "Inputs/" + k_Prefix; + public const string k_MenuPrefixTime = k_MenuScripts + "Time/" + k_Prefix; + public const string k_MenuPrefixSpline = k_MenuScripts + "Spline/" + k_Prefix; + public const string k_MenuPrefixPhysics = k_MenuScripts + "Physics/" + k_Prefix; + public const string k_MenuPrefixSample = k_MenuScripts + "Sample/" + k_Prefix; + +#if UNITY_EDITOR + public const int k_FieldGroupOrder = Editor.Inspector.k_FieldGroupOrder; +#else + public const int k_FieldGroupOrder = 0; +#endif + + // Unity only supports textures up to a size of 16384, even if maxTextureSize returns a larger size. + // https://docs.unity3d.com/ScriptReference/SystemInfo-maxTextureSize.html + public const int k_MaximumTextureResolution = 16384; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Constants.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Constants.cs.meta new file mode 100644 index 0000000..67ff038 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Constants.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b3ea5ad983894f72b6478985b8238d3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data.meta new file mode 100644 index 0000000..4625e31 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 055e56f78a8f84633baaceee3f56970f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AbsorptionLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AbsorptionLod.cs new file mode 100644 index 0000000..3721fa3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AbsorptionLod.cs @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Overrides the absorption color. + /// + public sealed partial class AbsorptionLod : ColorLod + { + // Orange + internal static readonly Color s_GizmoColor = new(1f, 165f / 255f, 0f, 0.5f); + internal static readonly Color s_DefaultColor = new(0.342f, 0.695f, 0.85f, 0.102f); + + static new class ShaderIDs + { + public static readonly int s_SampleAbsorptionSimulation = Shader.PropertyToID("g_Crest_SampleAbsorptionSimulation"); + } + + internal override string ID => "Absorption"; + internal override string Name => "Absorption"; + internal override Color GizmoColor => s_GizmoColor; + private protected override bool NeedToReadWriteTextureData => true; + private protected override bool RequiresClearBorder => true; + private protected override bool AlwaysClear => true; + private protected override Color ClearColor + { + get + { + var color = Color.clear; + var surface = _Water.Surface; + + if (surface.Material != null && surface.Material.HasVector(WaterRenderer.ShaderIDs.s_Absorption)) + { + color = surface.Material.GetVector(WaterRenderer.ShaderIDs.s_Absorption); + color.a = 0f; + } + + return color; + } + } + + private protected override int GlobalShaderID => ShaderIDs.s_SampleAbsorptionSimulation; + + internal AbsorptionLod() + { + _ShorelineColor = (s_DefaultColor * 1.5f).Clamped01(); + } + + private protected override void SetShorelineColor(Color previous, Color current) + { + if (previous == current) return; + _ShorelineColorValue = WaterRenderer.CalculateAbsorptionValueFromColor(current); + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AbsorptionLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AbsorptionLod.cs.meta new file mode 100644 index 0000000..6e425d5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AbsorptionLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6548e15197394afb8759ec50e918937 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AlbedoLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AlbedoLod.cs new file mode 100644 index 0000000..a6510b9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AlbedoLod.cs @@ -0,0 +1,44 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// A color layer that can be composited onto the water surface. + /// + [FilterEnum(nameof(_TextureFormatMode), Filtered.Mode.Include, (int)LodTextureFormatMode.Performance, (int)LodTextureFormatMode.Manual)] + public sealed partial class AlbedoLod : Lod + { + internal static readonly Color s_GizmoColor = new(1f, 0f, 1f, 0.5f); + + internal override string ID => "Albedo"; + internal override Color GizmoColor => s_GizmoColor; + private protected override Color ClearColor => Color.clear; + private protected override bool NeedToReadWriteTextureData => false; + + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + LodTextureFormatMode.Manual => _TextureFormat, + _ => GraphicsFormat.R8G8B8A8_UNorm, + }; + + internal AlbedoLod() + { + _Resolution = 768; + _TextureFormat = GraphicsFormat.R8G8B8A8_UNorm; + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AlbedoLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AlbedoLod.cs.meta new file mode 100644 index 0000000..00fda23 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AlbedoLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e6e1410b6b6b14d1db0a242b6d4efef5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AnimatedWavesLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AnimatedWavesLod.cs new file mode 100644 index 0000000..d934627 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AnimatedWavesLod.cs @@ -0,0 +1,572 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + abstract class BakedWaveData : ScriptableObject + { + public abstract ICollisionProvider CreateCollisionProvider(); + public abstract float WindSpeed { get; } + } + + // + // Collision + // + + /// + /// The source of collisions (ie water shape). + /// + [@GenerateDoc] + public enum CollisionSource + { + /// + [Tooltip("No collision source. Flat water.")] + None = 0, + + // GerstnerWavesCPU = 1, + + /// + [Tooltip("Uses AsyncGPUReadback to retrieve data from GPU to CPU.\n\nThis is the most optimal approach.")] + GPU = 2, + + /// + [Tooltip("Computes data entirely on the CPU.")] + CPU = 3, + } + + /// + /// The pass to render displacement into. + /// + [@GenerateDoc] + public enum DisplacementPass + { + /// + [Tooltip("Displacement that is dependent on an LOD (eg waves).\n\nUses filtering to determine which LOD to write to.")] + LodDependent, + + /// + [Tooltip("Renders to all LODs.")] + LodIndependent, + + /// + [Tooltip("Renders to all LODs, but as a separate pass.\n\nTypically used to render visual displacement which does not affect collisions.")] + [InspectorName("Lod Independent (Last)")] + LodIndependentLast, + } + + /// + /// Flags to enable extra collsion layers. + /// + [System.Flags] + [@GenerateDoc] + public enum CollisionLayers + { + // NOTE: numbers must be in order for defaults to work (everything first). + + /// + [Tooltip("All layers.")] + Everything = -1, + + /// + [Tooltip("No extra layers (ie single layer).")] + Nothing, + + /// + [Tooltip("Separate layer for dynamic waves.\n\nDynamic waves are normally combined together for efficiency. By enabling this layer, dynamic waves are combined and added in a separate pass.")] + DynamicWaves = 1 << 1, + + /// + [Tooltip("Extra displacement layer for visual displacement.")] + Displacement = 1 << 2, + } + + /// + /// Captures waves/shape that is drawn kinematically - there is no frame-to-frame + /// state. + /// + /// + /// + /// + /// A combine pass is done which combines downwards from low detail LODs into + /// the high detail LODs. + /// + /// + /// The LOD data is passed to the water material when the surface is drawn. + /// + /// + /// adds its results into this data. They piggy back + /// off the combine pass and subsequent assignment to the water material. + /// + /// + /// The RGB channels are the XYZ displacement from a rest plane at water level to + /// the corresponding displaced position on the surface. + /// + [@FilterEnum(nameof(_TextureFormatMode), Filtered.Mode.Exclude, (int)LodTextureFormatMode.Automatic)] + public sealed partial class AnimatedWavesLod : Lod + { + [@Space(10)] + + [Tooltip("Shifts wavelengths to maintain quality for higher resolutions.\n\nSet this to 2 to improve wave quality. In some cases like flowing rivers, this can make a substantial difference to visual stability. We recommend doubling the Resolution on the WaterRenderer component to preserve detail after making this change.")] + [@Range(1f, 4f)] + [@GenerateAPI] + [SerializeField] + float _WaveResolutionMultiplier = 1f; + + [Tooltip("How much waves are dampened in shallow water.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + float _AttenuationInShallows = 0.95f; + + [Tooltip("Any water deeper than this will receive full wave strength.\n\nThe lower the value, the less effective the depth cache will be at attenuating very large waves. Set to the maximum value (1,000) to disable.")] + [@Range(1f, 1000f)] + [@GenerateAPI] + [SerializeField] + float _ShallowsMaximumDepth = 1000f; + + + [@Heading("Collisions")] + + [Tooltip("Where to obtain water shape on CPU for physics / gameplay.")] + [@GenerateAPI(Setter.Internal)] + [@DecoratedField, SerializeField] + internal CollisionSource _CollisionSource = CollisionSource.GPU; + + [Tooltip("Collision layers to enable.\n\nSome layers will have overhead with CPU, GPU and memory.")] + [@Predicated(nameof(_CollisionSource), inverted: true, nameof(CollisionSource.GPU))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal CollisionLayers _CollisionLayers = CollisionLayers.Everything; + + [Tooltip("Maximum number of wave queries that can be performed when using GPU queries.")] + [@Predicated(nameof(_CollisionSource), true, nameof(CollisionSource.GPU))] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeField] + int _MaximumQueryCount = QueryBase.k_DefaultMaximumQueryCount; + + [@Predicated(nameof(_CollisionSource), true, nameof(CollisionSource.CPU))] + [@DecoratedField, SerializeField] + internal BakedWaveData _BakedWaveData; + + + const string k_DrawCombine = "Combine"; + + + internal static new partial class ShaderIDs + { + public static readonly int s_WaveBuffer = Shader.PropertyToID("_Crest_WaveBuffer"); + public static readonly int s_DynamicWavesTarget = Shader.PropertyToID("_Crest_DynamicWavesTarget"); + public static readonly int s_AnimatedWavesTarget = Shader.PropertyToID("_Crest_AnimatedWavesTarget"); + public static readonly int s_AttenuationInShallows = Shader.PropertyToID("_Crest_AttenuationInShallows"); + } + + internal static readonly Color s_GizmoColor = new(0f, 1f, 0f, 0.5f); + + /// + /// Turn shape combine pass on/off. Debug only - stripped in builds. + /// + internal static bool s_Combine = true; + + internal override string ID => "AnimatedWaves"; + internal override string Name => "Animated Waves"; + internal override Color GizmoColor => s_GizmoColor; + private protected override bool NeedToReadWriteTextureData => true; + private protected override Color ClearColor => Color.black; + internal override int BufferCount => _Water.WriteMotionVectors ? 2 : 1; + + // NOTE: Tried RGB111110Float but errors becomes visible. One option would be to use a UNORM setup. + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + LodTextureFormatMode.Performance => GraphicsFormat.R16G16B16A16_SFloat, + LodTextureFormatMode.Precision => GraphicsFormat.R32G32B32A32_SFloat, + LodTextureFormatMode.Manual => _TextureFormat, + _ => throw new System.NotImplementedException(), + }; + + ComputeShader _CombineShader; + + int _KernalShapeCombine = -1; + int _KernalShapeCombine_DISABLE_COMBINE = -1; + int _KernalShapeCombine_FLOW_ON = -1; + int _KernalShapeCombine_FLOW_ON_DISABLE_COMBINE = -1; + int _KernalShapeCombine_DYNAMIC_WAVE_SIM_ON = -1; + int _KernalShapeCombine_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE = -1; + int _KernalShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON = -1; + int _KernalShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE = -1; + + + internal AnimatedWavesLod() + { + _Enabled = true; + _OverrideResolution = false; + _TextureFormat = GraphicsFormat.R16G16B16A16_SFloat; + } + + internal override void Initialize() + { + _CombineShader = WaterResources.Instance.Compute._ShapeCombine; + if (_CombineShader == null) + { + _Valid = false; + return; + } + + base.Initialize(); + } + + private protected override void Allocate() + { + base.Allocate(); + + _KernalShapeCombine = _CombineShader.FindKernel("ShapeCombine"); + _KernalShapeCombine_DISABLE_COMBINE = _CombineShader.FindKernel("ShapeCombine_DISABLE_COMBINE"); + _KernalShapeCombine_FLOW_ON = _CombineShader.FindKernel("ShapeCombine_FLOW_ON"); + _KernalShapeCombine_FLOW_ON_DISABLE_COMBINE = _CombineShader.FindKernel("ShapeCombine_FLOW_ON_DISABLE_COMBINE"); + _KernalShapeCombine_DYNAMIC_WAVE_SIM_ON = _CombineShader.FindKernel("ShapeCombine_DYNAMIC_WAVE_SIM_ON"); + _KernalShapeCombine_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE = _CombineShader.FindKernel("ShapeCombine_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE"); + _KernalShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON = _CombineShader.FindKernel("ShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON"); + _KernalShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE = _CombineShader.FindKernel("ShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE"); + } + + internal override void BuildCommandBuffer(WaterRenderer water, CommandBuffer buffer) + { + buffer.BeginSample(ID); + + FlipBuffers(); + + Shader.SetGlobalFloat(ShaderIDs.s_AttenuationInShallows, _AttenuationInShallows); + + // Get temporary buffer to store waves. They will be copied in the combine pass. + buffer.GetTemporaryRT(ShaderIDs.s_WaveBuffer, DataTexture.descriptor); + CoreUtils.SetRenderTarget(buffer, ShaderIDs.s_WaveBuffer, ClearFlag.Color, ClearColor); + + // LOD dependent data. + // Write to per-octave _WaveBuffers. Not the same as _AnimatedWaves. + // Draw any data with lod preference. + SubmitDraws(buffer, s_Inputs, ShaderIDs.s_WaveBuffer, (int)DisplacementPass.LodDependent, filter: true); + + var lastSlice = Slices - 1; + var threadSize = Resolution / k_ThreadGroupSize; + + // Combine the LODs - copy results from biggest LOD down to LOD 0 + { + var combineShaderKernel = _KernalShapeCombine; + var combineShaderKernel_lastLOD = _KernalShapeCombine_DISABLE_COMBINE; + { + var isFlowOn = _Water._FlowLod.Enabled; + var isDynamicWavesOn = _Water._DynamicWavesLod.Enabled && !_CollisionLayers.HasFlag(CollisionLayers.DynamicWaves); + + // Set the shader kernels that we will use. + if (isFlowOn && isDynamicWavesOn) + { + combineShaderKernel = _KernalShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON; + combineShaderKernel_lastLOD = _KernalShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE; + } + else if (isFlowOn) + { + combineShaderKernel = _KernalShapeCombine_FLOW_ON; + combineShaderKernel_lastLOD = _KernalShapeCombine_FLOW_ON_DISABLE_COMBINE; + } + else if (isDynamicWavesOn) + { + combineShaderKernel = _KernalShapeCombine_DYNAMIC_WAVE_SIM_ON; + combineShaderKernel_lastLOD = _KernalShapeCombine_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE; + } + } + + buffer.BeginSample(k_DrawCombine); + + // Combine waves. + for (var slice = lastSlice; slice >= 0; slice--) + { + var kernel = slice < lastSlice && s_Combine + ? combineShaderKernel : combineShaderKernel_lastLOD; + + var wrapper = new PropertyWrapperCompute(buffer, _CombineShader, kernel); + + // The per-octave wave buffers we read from. + wrapper.SetTexture(ShaderIDs.s_WaveBuffer, ShaderIDs.s_WaveBuffer); + + if (_Water._DynamicWavesLod.Enabled) _Water._DynamicWavesLod.Bind(wrapper); + + // Set the animated waves texture where we read/write to combine the results. Use + // compute suffix to avoid collision as a file already uses the normal name. + wrapper.SetTexture(Crest.ShaderIDs.s_Target, DataTexture); + wrapper.SetInteger(Lod.ShaderIDs.s_LodIndex, slice); + + wrapper.Dispatch(threadSize, threadSize, 1); + } + + buffer.EndSample(k_DrawCombine); + } + + buffer.ReleaseTemporaryRT(ShaderIDs.s_WaveBuffer); + + // LOD independent data. + // Draw any data that did not express a preference for one lod or another. + var drawn = SubmitDraws(buffer, s_Inputs, DataTexture, (int)DisplacementPass.LodIndependent); + + // Alpha channel is cleared in combine step, but if any inputs draw in post-combine + // step then alpha may have data. + var clear = WaterResources.Instance.Compute._Clear; + if (drawn && clear != null) + { + buffer.SetComputeTextureParam(clear, 0, Crest.ShaderIDs.s_Target, DataTexture); + buffer.SetComputeVectorParam(clear, Crest.ShaderIDs.s_ClearMask, Color.black); + buffer.SetComputeVectorParam(clear, Crest.ShaderIDs.s_ClearColor, Color.clear); + buffer.DispatchCompute + ( + clear, + 0, + Resolution / k_ThreadGroupSizeX, + Resolution / k_ThreadGroupSizeY, + Slices + ); + } + + // Pack height data into alpha channel. + // We do not add height to displacement directly for better precision and layering. + var heightShader = WaterResources.Instance.Compute._PackLevel; + if (_Water._LevelLod.Enabled && heightShader != null) + { + buffer.SetComputeTextureParam(heightShader, 0, Crest.ShaderIDs.s_Target, DataTexture); + buffer.DispatchCompute + ( + heightShader, + 0, + Resolution / k_ThreadGroupSizeX, + Resolution / k_ThreadGroupSizeY, + Slices + ); + } + + // Query collisions including only Animated Waves. + // Requires copying the water level. + // Guard not required, as Query already does this check before returning the + // correct provider, thus nothing would be reqistered nor dispatched. But seems + // right to do so anyhow. + if (_CollisionLayers != CollisionLayers.Nothing) + { + Provider.UpdateQueries(_Water, CollisionLayer.AfterAnimatedWaves); + } + + // Transfer Dynamic Waves to Animated Waves. + if (_CollisionLayers.HasFlag(CollisionLayers.DynamicWaves) && _Water._DynamicWavesLod.Enabled) + { + buffer.BeginSample(k_DrawCombine); + // Clearing not required as we overwrite enter texture. + buffer.GetTemporaryRT(ShaderIDs.s_DynamicWavesTarget, DataTexture.descriptor); + + var wrapper = new PropertyWrapperCompute(buffer, _CombineShader, 9); + + wrapper.SetTexture(ShaderIDs.s_DynamicWavesTarget, ShaderIDs.s_DynamicWavesTarget); + + _Water._DynamicWavesLod.Bind(wrapper); + + // Compute displacement from Dynamic Waves. + for (var slice = lastSlice; slice >= 0; slice--) + { + wrapper.SetInteger(Lod.ShaderIDs.s_LodIndex, slice); + wrapper.Dispatch(threadSize, threadSize, 1); + + // Change to kernel with combine enabled. + if (slice == lastSlice) + { + wrapper = new(buffer, _CombineShader, 8); + } + } + + // Copy Dynamic Waves displacement into Animated Waves. + { + wrapper = new(buffer, _CombineShader, 10); + wrapper.SetTexture(ShaderIDs.s_AnimatedWavesTarget, DataTexture); + wrapper.SetTexture(ShaderIDs.s_DynamicWavesTarget, ShaderIDs.s_DynamicWavesTarget); + wrapper.Dispatch(threadSize, threadSize, Slices); + } + + buffer.ReleaseTemporaryRT(ShaderIDs.s_DynamicWavesTarget); + buffer.EndSample(k_DrawCombine); + + // Query collisions including Dynamic Waves. + // Does not require copying the water level as they are added with zero alpha. + Provider.UpdateQueries(_Water, CollisionLayer.AfterDynamicWaves); + } + + if (_CollisionLayers.HasFlag(CollisionLayers.Displacement)) + { + // LOD independent data. + // Draw any data that did not express a preference for one lod or another. + drawn = SubmitDraws(buffer, s_Inputs, DataTexture, (int)DisplacementPass.LodIndependentLast); + } + + if (_CollisionLayers == CollisionLayers.Nothing || _CollisionLayers.HasFlag(CollisionLayers.Displacement)) + { + Queryable?.UpdateQueries(_Water); + } + + if (BufferCount > 1) + { + // Update current and previous. Latter for MVs and/or VFX. + Shader.SetGlobalTexture(_TextureSourceShaderID, _Targets.Previous(1)); + Shader.SetGlobalTexture(_TextureShaderID, DataTexture); + } + + buffer.EndSample(ID); + } + + internal override void AfterExecute() + { + Provider.SendReadBack(_Water, _CollisionLayers); + } + + /// + /// Provides water shape to CPU. + /// + private protected override ICollisionProvider CreateProvider(bool enable) + { + ICollisionProvider result = null; + + Queryable?.CleanUp(); + + if (!enable) + { + return ICollisionProvider.None; + } + + switch (_CollisionSource) + { + case CollisionSource.None: + result = ICollisionProvider.None; + break; + case CollisionSource.GPU: + if (_Valid && !_Water.IsRunningWithoutGraphics) + { + result = new CollisionQueryWithPasses(_Water); + } + + if (_Water.IsRunningWithoutGraphics) + { + Debug.LogError($"Crest: GPU queries not supported in headless/batch mode. To resolve, assign an Animated Wave Settings asset to the {nameof(WaterRenderer)} component and set the Collision Source to be a CPU option."); + } + break; + case CollisionSource.CPU: + if (_BakedWaveData != null) + { + result = _BakedWaveData.CreateCollisionProvider(); + } + break; + } + + if (result == null) + { + // This should not be hit, but can be if compute shaders aren't loaded correctly. + // They will print out appropriate errors. Don't just return null and have null reference + // exceptions spamming the logs. + return ICollisionProvider.None; + } + + return result; + } + + // + // DrawFilter + // + + internal readonly struct WavelengthFilter + { + public readonly float _Minimum; + public readonly float _Maximum; + public readonly float _TransitionThreshold; + public readonly float _ViewerAltitudeLevelAlpha; + public readonly int _Slice; + public readonly int _Slices; + + public WavelengthFilter(WaterRenderer water, int slice) + { + _Slice = slice; + _Slices = water.LodLevels; + _Maximum = water.MaximumWavelength(slice); + _Minimum = _Maximum * 0.5f; + _TransitionThreshold = water.MaximumWavelength(_Slices - 1) * 0.5f; + _ViewerAltitudeLevelAlpha = water.ViewerAltitudeLevelAlpha; + } + } + + internal static float FilterByWavelength(WavelengthFilter filter, float wavelength) + { + // No wavelength preference - don't draw per-lod + if (wavelength == 0f) + { + return 0f; + } + + // Too small for this lod + if (wavelength < filter._Minimum) + { + return 0f; + } + + // If approaching end of lod chain, start smoothly transitioning any large wavelengths across last two lods + if (wavelength >= filter._TransitionThreshold) + { + if (filter._Slice == filter._Slices - 2) + { + return 1f - filter._ViewerAltitudeLevelAlpha; + } + + if (filter._Slice == filter._Slices - 1) + { + return filter._ViewerAltitudeLevelAlpha; + } + } + else if (wavelength < filter._Maximum) + { + // Fits in this lod + return 1f; + } + + return 0f; + } + + internal static float FilterByWavelength(WaterRenderer water, int slice, float wavelength) + { + return FilterByWavelength(new(water, slice), wavelength); + } + + + // + // Inputs + // + + internal static readonly Utility.SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override Utility.SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + +#if UNITY_EDITOR + [@OnChange] + private protected override void OnChange(string propertyPath, object previousValue) + { + base.OnChange(propertyPath, previousValue); + + switch (propertyPath) + { + case nameof(_CollisionLayers): + case nameof(_CollisionSource): + if (_Water == null || !_Water.isActiveAndEnabled || !Enabled) return; + Queryable?.CleanUp(); + InitializeProvider(true); + break; + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AnimatedWavesLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AnimatedWavesLod.cs.meta new file mode 100644 index 0000000..6208715 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/AnimatedWavesLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71b85abdc5e234fe8a685d3be0b95443 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Cascade.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Cascade.cs new file mode 100644 index 0000000..51a8b30 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Cascade.cs @@ -0,0 +1,31 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + readonly struct Cascade + { + public readonly Vector2 _SnappedPosition; + public readonly float _Texel; + public readonly int _Resolution; + public readonly Vector4 Packed => new(_SnappedPosition.x, _SnappedPosition.y, _Texel, 0f); + + public Cascade(Vector2 snapped, float texel, int resolution) + { + _SnappedPosition = snapped; + _Texel = texel; + _Resolution = resolution; + } + + public readonly Rect TexelRect + { + get + { + var w = _Texel * _Resolution; + return new(_SnappedPosition.x - w / 2f, _SnappedPosition.y - w / 2f, w, w); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Cascade.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Cascade.cs.meta new file mode 100644 index 0000000..8621602 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Cascade.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a52c8c04f6c749d7a2bc6e5a4fbe9ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ClipLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ClipLod.cs new file mode 100644 index 0000000..45babc5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ClipLod.cs @@ -0,0 +1,119 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// The default state for clipping. + /// + [@GenerateDoc] + public enum DefaultClippingState + { + /// + [Tooltip("By default, nothing is clipped. Use clip inputs to remove water.")] + NothingClipped, + + /// + [Tooltip("By default, everything is clipped. Use clip inputs to add water.")] + EverythingClipped, + } + + /// + /// Drives water surface clipping (carving holes). + /// + /// + /// 0-1 values, surface clipped when > 0.5. + /// + [FilterEnum(nameof(_TextureFormatMode), Filtered.Mode.Exclude, (int)LodTextureFormatMode.Automatic)] + public sealed partial class ClipLod : Lod + { + [Tooltip("The default clipping behaviour.\n\nWhether to clip nothing by default (and clip inputs remove patches of surface), or to clip everything by default (and clip inputs add patches of surface).")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + internal DefaultClippingState _DefaultClippingState = DefaultClippingState.NothingClipped; + + static new class ShaderIDs + { + public static readonly int s_ClipByDefault = Shader.PropertyToID("g_Crest_ClipByDefault"); + } + + internal static readonly Color s_GizmoColor = new(0f, 1f, 1f, 0.5f); + + internal override string ID => "Clip"; + internal override string Name => "Clip Surface"; + internal override Color GizmoColor => s_GizmoColor; + private protected override Color ClearColor => _DefaultClippingState == DefaultClippingState.EverythingClipped ? Color.white : Color.black; + private protected override bool NeedToReadWriteTextureData => true; + private protected override bool RequiresClearBorder => true; + + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + // The clip values only really need 8bits (unless using signed distance). + LodTextureFormatMode.Performance => GraphicsFormat.R8_UNorm, + LodTextureFormatMode.Precision => GraphicsFormat.R16_UNorm, + LodTextureFormatMode.Manual => _TextureFormat, + _ => throw new System.NotImplementedException(), + }; + + internal ClipLod() + { + _TextureFormat = GraphicsFormat.R8_UNorm; + } + + internal override void SetGlobals(bool enable) + { + base.SetGlobals(enable); + Shader.SetGlobalFloat(ShaderIDs.s_ClipByDefault, enable && Enabled ? (float)_DefaultClippingState : (float)DefaultClippingState.NothingClipped); + } + + internal override void Disable() + { + base.Disable(); + Shader.SetGlobalFloat(ShaderIDs.s_ClipByDefault, (float)DefaultClippingState.NothingClipped); + } + + internal override void BuildCommandBuffer(WaterRenderer water, CommandBuffer buffer) + { + base.BuildCommandBuffer(water, buffer); + Shader.SetGlobalFloat(ShaderIDs.s_ClipByDefault, (float)_DefaultClippingState); + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + + void SetDefaultClippingState(DefaultClippingState previous, DefaultClippingState current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled || !Enabled) return; + + // Change default clipping state. + _TargetsToClear = Mathf.Max(1, _TargetsToClear); + } + +#if UNITY_EDITOR + [@OnChange] + private protected override void OnChange(string path, object previous) + { + base.OnChange(path, previous); + + switch (path) + { + case nameof(_DefaultClippingState): + SetDefaultClippingState((DefaultClippingState)previous, _DefaultClippingState); + break; + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ClipLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ClipLod.cs.meta new file mode 100644 index 0000000..f3f7096 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ClipLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ed87ea342278349c4885adef619f19cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ColorLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ColorLod.cs new file mode 100644 index 0000000..4faa61a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ColorLod.cs @@ -0,0 +1,167 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + /// + /// The source of depth color. + /// + [@GenerateDoc] + public enum ShorelineVolumeColorSource + { + /// + [Tooltip("No depth color.")] + None, + + /// + [Tooltip("Depth color based on water depth.")] + Depth, + + /// + [Tooltip("Depth color based on shoreline distance.")] + Distance, + } + + /// + /// Contains shared functionality for and . + /// + [FilterEnum(nameof(_TextureFormatMode), Filtered.Mode.Exclude, (int)LodTextureFormatMode.Automatic)] + public abstract partial class ColorLod : Lod + { + [@Space(10f)] + + [Tooltip("Source of the shoreline color.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal ShorelineVolumeColorSource _ShorelineColorSource; + + [Tooltip("Color of the shoreline color.")] + [@Predicated(nameof(_ShorelineColorSource), inverted: false, nameof(ShorelineVolumeColorSource.None), hide: true)] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + private protected Color _ShorelineColor; + + [Tooltip("The maximum distance of the shoreline color.\n\nIf using Depth, then it is maximum depth.")] + [@Predicated(nameof(_ShorelineColorSource), inverted: false, nameof(ShorelineVolumeColorSource.None), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _ShorelineColorMaximumDistance = 10f; + + [Tooltip("Shoreline color falloff value.")] + [@Predicated(nameof(_ShorelineColorSource), inverted: false, nameof(ShorelineVolumeColorSource.None), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _ShorelineColorFalloff = 2f; + + static new class ShaderIDs + { + public static readonly int s_ShorelineColor = Shader.PropertyToID("_Crest_ShorelineColor"); + public static readonly int s_ShorelineColorMaximumDistance = Shader.PropertyToID("_Crest_ShorelineColorMaximumDistance"); + public static readonly int s_ShorelineColorFalloff = Shader.PropertyToID("_Crest_ShorelineColorFalloff"); + } + + private protected abstract int GlobalShaderID { get; } + private protected abstract void SetShorelineColor(Color previous, Color current); + private protected Vector4 _ShorelineColorValue; + ShorelineColorInput _ShorelineColorInput; + + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + LodTextureFormatMode.Manual => _TextureFormat, + LodTextureFormatMode.Performance => GraphicsFormat.R8G8B8_UNorm, + LodTextureFormatMode.Precision => GraphicsFormat.R16G16B16_UNorm, + _ => throw new System.NotImplementedException($"Crest: {_TextureFormatMode} not implemented for {Name}."), + }; + + internal ColorLod() + { + // Interpolation banding with lower precision. + _TextureFormat = GraphicsFormat.R16G16B16_UNorm; + _TextureFormatMode = LodTextureFormatMode.Precision; + } + + internal override void Enable() + { + base.Enable(); + + if (Enabled) + { + _ShorelineColorInput ??= new(this); + // Convert color to value. + SetShorelineColor(Color.clear, _ShorelineColor); + Inputs.Add(_ShorelineColorInput.Queue, _ShorelineColorInput); + } + } + + internal override void SetGlobals(bool enable) + { + base.SetGlobals(enable); + + Helpers.SetGlobalBoolean(GlobalShaderID, enable && Enabled); + } + + internal override void Disable() + { + base.Disable(); + + Inputs.Remove(_ShorelineColorInput); + } + + sealed class ShorelineColorInput : ILodInput + { + public bool Enabled => _VolumeColorLod._ShorelineColorSource != ShorelineVolumeColorSource.None && + _VolumeColorLod._Water._DepthLod.Enabled; + public bool IsCompute => true; + public int Queue => int.MinValue; + public int Pass => -1; + public Rect Rect => Rect.zero; + public MonoBehaviour Component => null; + public float Filter(WaterRenderer water, int slice) => 1f; + + readonly ColorLod _VolumeColorLod; + + public ShorelineColorInput(ColorLod lod) + { + _VolumeColorLod = lod; + } + + public void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slices = -1) + { + var resources = WaterResources.Instance; + var wrapper = new PropertyWrapperCompute(buffer, resources.Compute._ShorelineColor, 0); + + wrapper.SetVector(ShaderIDs.s_ShorelineColor, _VolumeColorLod._ShorelineColorValue); + wrapper.SetFloat(ShaderIDs.s_ShorelineColorMaximumDistance, _VolumeColorLod._ShorelineColorMaximumDistance); + wrapper.SetFloat(ShaderIDs.s_ShorelineColorFalloff, _VolumeColorLod._ShorelineColorFalloff); + + wrapper.SetKeyword(WaterResources.Instance.Keywords.ShorelineColorScattering, lod.GetType() == typeof(ScatteringLod)); + wrapper.SetKeyword(WaterResources.Instance.Keywords.ShorelineColorSourceDistance, _VolumeColorLod._ShorelineColorSource == ShorelineVolumeColorSource.Distance); + wrapper.SetTexture(Crest.ShaderIDs.s_Target, target); + + var threads = lod.Resolution / k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, slices); + } + } + } + +#if UNITY_EDITOR + abstract partial class ColorLod + { + private protected override void OnChange(string propertyPath, object previousValue) + { + base.OnChange(propertyPath, previousValue); + + switch (propertyPath) + { + case nameof(_ShorelineColor): + SetShorelineColor((Color)previousValue, _ShorelineColor); + break; + } + } + } +#endif +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ColorLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ColorLod.cs.meta new file mode 100644 index 0000000..a0ada00 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ColorLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1bc55489896941859aa8af34f8c1083 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DepthLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DepthLod.cs new file mode 100644 index 0000000..87a7f47 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DepthLod.cs @@ -0,0 +1,185 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Data that gives depth of the water (height of sea level above water floor). + /// + [FilterEnum(nameof(_TextureFormatMode), Filtered.Mode.Exclude, (int)LodTextureFormatMode.Automatic)] + public sealed partial class DepthLod : Lod + { + [@Space(10)] + + [Tooltip("Whether to include the terrain height automatically.\n\nThis will not include terrain details, nor will it produce a signed-distance field. There may also be a slight deviation due to differences in height data and terrain mesh. In these cases, please use the DepthProbe.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _IncludeTerrainHeight = true; + + [Tooltip("Support signed distance field data generated from the depth probes.\n\nRequires a two component texture format.")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + internal bool _EnableSignedDistanceFields = true; + + // NOTE: Must match CREST_WATER_DEPTH_BASELINE in Constants.hlsl. + internal const float k_DepthBaseline = Mathf.Infinity; + internal static readonly Color s_GizmoColor = new(1f, 0f, 0f, 0.5f); + // We want the clear color to be the mininimum terrain height (-1000m). + // Mathf.Infinity can cause problems for distance. + static readonly Color s_NullColor = new(-k_DepthBaseline, k_DepthBaseline, 0, 0); + + internal override string ID => "Depth"; + internal override string Name => "Water Depth"; + internal override Color GizmoColor => s_GizmoColor; + private protected override Color ClearColor => s_NullColor; + private protected override bool NeedToReadWriteTextureData => true; + + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + LodTextureFormatMode.Automatic or + LodTextureFormatMode.Performance => _EnableSignedDistanceFields ? GraphicsFormat.R16G16_SFloat : GraphicsFormat.R16_SFloat, + LodTextureFormatMode.Precision => _EnableSignedDistanceFields ? GraphicsFormat.R32G32_SFloat : GraphicsFormat.R32_SFloat, + LodTextureFormatMode.Manual => _TextureFormat, + _ => throw new System.NotImplementedException(), + }; + + Texture2DArray _NullTexture; + private protected override Texture2DArray NullTexture + { + get + { + if (_NullTexture == null) + { + var texture = TextureArrayHelpers.CreateTexture2D(s_NullColor, UnityEngine.TextureFormat.RFloat); + texture.name = $"_Crest_{ID}LodTemporaryDefaultTexture"; + _NullTexture = TextureArrayHelpers.CreateTexture2DArray(texture, k_MaximumSlices); + _NullTexture.name = $"_Crest_{ID}LodDefaultTexture"; + Helpers.Destroy(texture); + } + + return _NullTexture; + } + } + + internal DepthLod() + { + _Enabled = true; + _TextureFormat = GraphicsFormat.R16G16_SFloat; + } + + private protected override IDepthProvider CreateProvider(bool enable) + { + Queryable?.CleanUp(); + // Depth is GPU only, and can only be queried using the compute path. + return enable && Enabled ? new DepthQuery(_Water) : IDepthProvider.None; + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + + void SetEnableSignedDistanceFields(bool previous, bool current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled || !Enabled) return; + + ReAllocate(); + } + +#if d_Unity_Terrain + TerrainDepthInput _TerrainDepthInput; + + internal override void Enable() + { + base.Enable(); + + if (Enabled) + { + _TerrainDepthInput ??= new(this); + Inputs.Add(_TerrainDepthInput.Queue, _TerrainDepthInput); + } + } + + internal override void Disable() + { + base.Disable(); + + Inputs.Remove(_TerrainDepthInput); + } + + sealed class TerrainDepthInput : ILodInput + { + public bool Enabled => _DepthLod._IncludeTerrainHeight; + public bool IsCompute => true; + public int Queue => int.MinValue; + public int Pass => -1; + public Rect Rect => Rect.zero; + public MonoBehaviour Component => null; + public float Filter(WaterRenderer water, int slice) => 1f; + + readonly DepthLod _DepthLod; + readonly System.Collections.Generic.List _Terrains = new(); + + public TerrainDepthInput(DepthLod lod) + { + _DepthLod = lod; + } + + public void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slices = -1) + { + var resources = WaterResources.Instance; + var wrapper = new PropertyWrapperCompute(buffer, resources.Compute._DepthTexture, 0); + + var threads = lod.Resolution / k_ThreadGroupSize; + + wrapper.SetTexture(Crest.ShaderIDs.s_Target, target); + wrapper.SetVector(Crest.ShaderIDs.s_TextureRotation, new(0, 1)); + wrapper.SetBoolean(DepthLodInput.ShaderIDs.s_SDF, false); + wrapper.SetKeyword(resources.Keywords.DepthTextureSDF, lod._Water._DepthLod._EnableSignedDistanceFields); + + Terrain.GetActiveTerrains(_Terrains); + foreach (var terrain in _Terrains) + { + var data = terrain.terrainData; + if (data == null) continue; + var size = data.size; + var position = terrain.GetPosition(); + + wrapper.SetFloat(DepthLodInput.ShaderIDs.s_HeightOffset, position.y); + wrapper.SetVector(Crest.ShaderIDs.s_Multiplier, new(size.y * 2f, 1, 1, 1)); + wrapper.SetVector(Crest.ShaderIDs.s_TexturePosition, position.XZ() + (size.XZ() * 0.5f)); + wrapper.SetVector(Crest.ShaderIDs.s_TextureSize, size.XZ()); + wrapper.SetTexture(Crest.ShaderIDs.s_Texture, data.heightmapTexture); + wrapper.Dispatch(threads, threads, slices); + } + } + } +#endif // d_Unity_Terrain + +#if UNITY_EDITOR + [@OnChange] + private protected override void OnChange(string propertyPath, object previousValue) + { + base.OnChange(propertyPath, previousValue); + + switch (propertyPath) + { + case nameof(_EnableSignedDistanceFields): + SetEnableSignedDistanceFields((bool)previousValue, _EnableSignedDistanceFields); + break; + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DepthLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DepthLod.cs.meta new file mode 100644 index 0000000..8f3359f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DepthLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 679dfc1207b124b3fa00496f7b93a5cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DynamicWavesLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DynamicWavesLod.cs new file mode 100644 index 0000000..0c3e1c5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DynamicWavesLod.cs @@ -0,0 +1,115 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// A dynamic shape simulation that moves around with a displacement LOD. + /// + public sealed partial class DynamicWavesLod : PersistentLod + { + [Tooltip("How much waves are dampened in shallow water.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + float _AttenuationInShallows = 1f; + + [Tooltip("Settings for fine tuning this simulation.")] + [@Embedded] + [@GenerateAPI(Getter.Custom)] + [SerializeField] + DynamicWavesLodSettings _Settings; + + const string k_DynamicWavesKeyword = "CREST_DYNAMIC_WAVE_SIM_ON_INTERNAL"; + + static new class ShaderIDs + { + public static readonly int s_HorizontalDisplace = Shader.PropertyToID("_Crest_HorizontalDisplace"); + public static readonly int s_DisplaceClamp = Shader.PropertyToID("_Crest_DisplaceClamp"); + public static readonly int s_Damping = Shader.PropertyToID("_Crest_Damping"); + public static readonly int s_Gravity = Shader.PropertyToID("_Crest_Gravity"); + public static readonly int s_CourantNumber = Shader.PropertyToID("_Crest_CourantNumber"); + } + + internal static readonly Color s_GizmoColor = new(0f, 1f, 0f, 0.5f); + + internal override string ID => "DynamicWaves"; + internal override string Name => "Dynamic Waves"; + internal override Color GizmoColor => s_GizmoColor; + private protected override Color ClearColor => Color.black; + private protected override ComputeShader SimulationShader => WaterResources.Instance.Compute._UpdateDynamicWaves; + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + // Try and match Animated Waves format as we copy this simulation into it. + LodTextureFormatMode.Automatic => Water == null ? GraphicsFormat.None : Water.AnimatedWavesLod.TextureFormatMode switch + { + LodTextureFormatMode.Precision => GraphicsFormat.R32G32_SFloat, + _ => GraphicsFormat.R16G16_SFloat, + }, + LodTextureFormatMode.Performance => GraphicsFormat.R16G16_SFloat, + LodTextureFormatMode.Precision => GraphicsFormat.R32G32_SFloat, + LodTextureFormatMode.Manual => _TextureFormat, + _ => throw new System.NotImplementedException(), + }; + + internal float TimeLeftToSimulate => _TimeToSimulate; + + internal DynamicWavesLod() + { + _OverrideResolution = false; + _Resolution = 512; + _TextureFormatMode = LodTextureFormatMode.Automatic; + _TextureFormat = GraphicsFormat.R16G16_SFloat; + } + + internal override void Enable() + { + base.Enable(); + + Shader.EnableKeyword(k_DynamicWavesKeyword); + } + + internal override void Disable() + { + base.Disable(); + + Shader.DisableKeyword(k_DynamicWavesKeyword); + } + + internal override void Bind(T target) + { + base.Bind(target); + target.SetFloat(ShaderIDs.s_HorizontalDisplace, Settings._HorizontalDisplace); + target.SetFloat(ShaderIDs.s_DisplaceClamp, Settings._DisplaceClamp); + } + + private protected override void SetAdditionalSimulationParameters(PropertyWrapperCompute simMaterial) + { + base.SetAdditionalSimulationParameters(simMaterial); + + simMaterial.SetFloat(ShaderIDs.s_Damping, Settings._Damping); + simMaterial.SetFloat(ShaderIDs.s_Gravity, _Water.Gravity * Settings._GravityMultiplier); + simMaterial.SetFloat(ShaderIDs.s_CourantNumber, Settings._CourantNumber); + simMaterial.SetFloat(AnimatedWavesLod.ShaderIDs.s_AttenuationInShallows, _AttenuationInShallows); + } + + private protected override void GetSubstepData(float timeToSimulate, out int substeps, out float delta) + { + substeps = Mathf.FloorToInt(timeToSimulate * _SimulationFrequency); + delta = substeps > 0 ? (1f / _SimulationFrequency) : 0f; + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DynamicWavesLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DynamicWavesLod.cs.meta new file mode 100644 index 0000000..a07485c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/DynamicWavesLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9fb0d3abd1aa34af8942b9bab09a8575 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FlowLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FlowLod.cs new file mode 100644 index 0000000..cff9f48 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FlowLod.cs @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Simulates horizontal motion of water. + /// + [FilterEnum(nameof(_TextureFormatMode), Filtered.Mode.Exclude, (int)LodTextureFormatMode.Automatic)] + public sealed partial class FlowLod : Lod + { + const string k_FlowKeyword = "CREST_FLOW_ON_INTERNAL"; + + internal static readonly Color s_GizmoColor = new(0f, 0f, 1f, 0.5f); + + internal override string ID => "Flow"; + internal override Color GizmoColor => s_GizmoColor; + private protected override Color ClearColor => Color.black; + private protected override bool NeedToReadWriteTextureData => true; + + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + LodTextureFormatMode.Performance => GraphicsFormat.R16G16_SFloat, + LodTextureFormatMode.Precision => GraphicsFormat.R32G32_SFloat, + LodTextureFormatMode.Manual => _TextureFormat, + _ => throw new System.NotImplementedException(), + }; + + internal FlowLod() + { + _Resolution = 128; + _TextureFormat = GraphicsFormat.R16G16_SFloat; + } + + internal override void Enable() + { + base.Enable(); + + Shader.EnableKeyword(k_FlowKeyword); + } + + internal override void Disable() + { + base.Disable(); + + Shader.DisableKeyword(k_FlowKeyword); + } + + private protected override IFlowProvider CreateProvider(bool enable) + { + Queryable?.CleanUp(); + // Flow is GPU only, and can only be queried using the compute path. + return enable && Enabled ? new FlowQuery(_Water) : IFlowProvider.None; + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FlowLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FlowLod.cs.meta new file mode 100644 index 0000000..95bdf4b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FlowLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37086036dea5b4927a5cdb3af2d5d869 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FoamLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FoamLod.cs new file mode 100644 index 0000000..653a820 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FoamLod.cs @@ -0,0 +1,95 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// A persistent foam simulation that moves around with a displacement LOD. The input is fully combined water surface shape. + /// + [FilterEnum(nameof(_TextureFormatMode), Filtered.Mode.Exclude, (int)LodTextureFormatMode.Automatic)] + public sealed partial class FoamLod : PersistentLod + { + [Tooltip("Prewarms the simulation on load and teleports.\n\nResults are only an approximation.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _Prewarm = true; + + [Tooltip("Settings for fine tuning this simulation.")] + [@Embedded] + [@GenerateAPI(Getter.Custom)] + [SerializeField] + FoamLodSettings _Settings; + + static new class ShaderIDs + { + public static readonly int s_MinimumWavesSlice = Shader.PropertyToID("_Crest_MinimumWavesSlice"); + public static readonly int s_FoamMaximum = Shader.PropertyToID("_Crest_FoamMaximum"); + public static readonly int s_FoamFadeRate = Shader.PropertyToID("_Crest_FoamFadeRate"); + public static readonly int s_WaveFoamStrength = Shader.PropertyToID("_Crest_WaveFoamStrength"); + public static readonly int s_WaveFoamCoverage = Shader.PropertyToID("_Crest_WaveFoamCoverage"); + public static readonly int s_ShorelineFoamMaxDepth = Shader.PropertyToID("_Crest_ShorelineFoamMaxDepth"); + public static readonly int s_ShorelineFoamStrength = Shader.PropertyToID("_Crest_ShorelineFoamStrength"); + public static readonly int s_NeedsPrewarming = Shader.PropertyToID("_Crest_NeedsPrewarming"); + public static readonly int s_FoamNegativeDepthPriming = Shader.PropertyToID("_Crest_FoamNegativeDepthPriming"); + } + + internal static readonly Color s_GizmoColor = new(1f, 1f, 1f, 0.5f); + + internal override string ID => "Foam"; + internal override Color GizmoColor => s_GizmoColor; + private protected override Color ClearColor => Color.black; + private protected override ComputeShader SimulationShader => WaterResources.Instance.Compute._UpdateFoam; + + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + LodTextureFormatMode.Performance => GraphicsFormat.R16_SFloat, + LodTextureFormatMode.Precision => GraphicsFormat.R32_SFloat, + LodTextureFormatMode.Manual => _TextureFormat, + _ => throw new System.NotImplementedException(), + }; + + private protected override void SetAdditionalSimulationParameters(PropertyWrapperCompute properties) + { + base.SetAdditionalSimulationParameters(properties); + + // Prewarm simulation for first frame or teleporting. It will not be the same results as running the + // simulation for multiple frames - but good enough. + properties.SetBoolean(ShaderIDs.s_NeedsPrewarming, _Prewarm && _NeedsPrewarmingThisStep); + properties.SetFloat(ShaderIDs.s_FoamFadeRate, Settings._FoamFadeRate); + properties.SetFloat(ShaderIDs.s_WaveFoamStrength, Settings._WaveFoamStrength); + properties.SetFloat(ShaderIDs.s_WaveFoamCoverage, Settings._WaveFoamCoverage); + properties.SetFloat(ShaderIDs.s_ShorelineFoamMaxDepth, Settings._ShorelineFoamMaximumDepth); + properties.SetFloat(ShaderIDs.s_ShorelineFoamStrength, Settings._ShorelineFoamStrength); + properties.SetFloat(ShaderIDs.s_FoamMaximum, Settings.Maximum); + properties.SetFloat(ShaderIDs.s_FoamNegativeDepthPriming, -Settings._ShorelineFoamPriming); + properties.SetInteger(ShaderIDs.s_MinimumWavesSlice, Settings.FilterWaves); + } + + private protected override void GetSubstepData(float timeToSimulate, out int substeps, out float delta) + { + substeps = Mathf.FloorToInt(timeToSimulate * _SimulationFrequency); + + delta = substeps > 0 ? (1f / _SimulationFrequency) : 0f; + } + + internal FoamLod() + { + _Enabled = true; + _TextureFormat = GraphicsFormat.R16_SFloat; + _SimulationFrequency = 30; + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FoamLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FoamLod.cs.meta new file mode 100644 index 0000000..e4f7e33 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/FoamLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42f3809132d8b485a822f0bb271f51c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated.meta new file mode 100644 index 0000000..1321022 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1ea9618107d2946a98206ac4c7772029 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated/Lod.Generated.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated/Lod.Generated.cs new file mode 100644 index 0000000..15aca1e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated/Lod.Generated.cs @@ -0,0 +1,113 @@ +// + +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + [System.Serializable] + partial class AbsorptionLod + { + } + + [System.Serializable] + partial class AlbedoLod + { + } + + [System.Serializable] + partial class AnimatedWavesLod + { + } + + [System.Serializable] + partial class ClipLod + { + } + + [System.Serializable] + partial class DepthLod + { + } + + [System.Serializable] + partial class DynamicWavesLod + { + DynamicWavesLodSettings _DefaultSettings; + + DynamicWavesLodSettings GetSettings() + { + if (_Settings != null) + { + return _Settings; + } + + if (_DefaultSettings == null) + { + _DefaultSettings = ScriptableObject.CreateInstance(); + _DefaultSettings.name = $"Default {Name} (instance)"; + _DefaultSettings.hideFlags = HideFlags.DontSave | HideFlags.NotEditable; + } + + return _DefaultSettings; + } + + internal override void Destroy() + { + base.Destroy(); + Helpers.Destroy(_DefaultSettings); + } + } + + [System.Serializable] + partial class FlowLod + { + } + + [System.Serializable] + partial class FoamLod + { + FoamLodSettings _DefaultSettings; + + FoamLodSettings GetSettings() + { + if (_Settings != null) + { + return _Settings; + } + + if (_DefaultSettings == null) + { + _DefaultSettings = ScriptableObject.CreateInstance(); + _DefaultSettings.name = $"Default {Name} (instance)"; + _DefaultSettings.hideFlags = HideFlags.DontSave | HideFlags.NotEditable; + } + + return _DefaultSettings; + } + + internal override void Destroy() + { + base.Destroy(); + Helpers.Destroy(_DefaultSettings); + } + } + + [System.Serializable] + partial class LevelLod + { + } + + [System.Serializable] + partial class ScatteringLod + { + } + + [System.Serializable] + partial class ShadowLod + { + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated/Lod.Generated.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated/Lod.Generated.cs.meta new file mode 100644 index 0000000..1e89443 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Generated/Lod.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4e88db203d9474c568c462518871bb5a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input.meta new file mode 100644 index 0000000..31f57fc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51ed544a28b134d58a41f55650e368b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AbsorptionLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AbsorptionLodInput.cs new file mode 100644 index 0000000..5a1cb4f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AbsorptionLodInput.cs @@ -0,0 +1,37 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to influence the scattering color. + /// + [@HelpURL("Manual/WaterAppearance.html#volume-color-inputs")] + public sealed partial class AbsorptionLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if d_CrestPaint + internal override LodInputMode DefaultMode => LodInputMode.Paint; +#else + internal override LodInputMode DefaultMode => LodInputMode.Renderer; +#endif + + internal override void InferBlend() + { + base.InferBlend(); + _Blend = LodInputBlend.Alpha; + } + + // Looks fine moving around. + private protected override bool FollowHorizontalMotion => true; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AbsorptionLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AbsorptionLodInput.cs.meta new file mode 100644 index 0000000..deeab97 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AbsorptionLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 247a7260095bc49429a7f7cb2a4851d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AlbedoLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AlbedoLodInput.cs new file mode 100644 index 0000000..7b81eb2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AlbedoLodInput.cs @@ -0,0 +1,24 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to influence the surface color. + /// + [@HelpURL("Manual/WaterAppearance.html#albedo-inputs")] + public sealed partial class AlbedoLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + internal override LodInputMode DefaultMode => LodInputMode.Renderer; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AlbedoLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AlbedoLodInput.cs.meta new file mode 100644 index 0000000..3ff9019 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AlbedoLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c972e8f11f2447768dc0314b7bc34a4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AnimatedWavesLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AnimatedWavesLodInput.cs new file mode 100644 index 0000000..da2b9a8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AnimatedWavesLodInput.cs @@ -0,0 +1,139 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to render into the displacment textures to + /// affect the water shape. + /// + [@HelpURL("Manual/Waves.html#animated-waves-inputs")] + public sealed partial class AnimatedWavesLodInput : LodInput + { + [@Space(10)] + + [Tooltip("When to render the input into the displacement data.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + DisplacementPass _DisplacementPass = DisplacementPass.LodIndependent; + + [Tooltip("Whether to filter this input by wavelength.\n\nIf disabled, it will render to all LODs.")] + [@Predicated(nameof(_DisplacementPass), inverted: true, nameof(DisplacementPass.LodDependent))] + [@GenerateAPI] + [DecoratedField, SerializeField] + bool _FilterByWavelength; + + [Tooltip("Which octave to render into.\n\nFor example, set this to 2 to render into the 2m-4m octave. These refer to the same octaves as the wave spectrum editor.")] + [@Predicated(nameof(_DisplacementPass), inverted: true, nameof(DisplacementPass.LodDependent))] + [@Predicated(nameof(_FilterByWavelength))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _OctaveWavelength = 512f; + + + [Header("Culling")] + + [Tooltip("Inform the system how much this input will displace the water surface vertically.\n\nThis is used to set bounding box heights for the water chunks.")] + [@GenerateAPI] + [SerializeField] + float _MaximumDisplacementVertical = 0f; + + [Tooltip("Inform the system how much this input will displace the water surface horizontally.\n\nThis is used to set bounding box widths for the water chunks.")] + [@GenerateAPI] + [SerializeField] + float _MaximumDisplacementHorizontal = 0f; + + [Tooltip("Use the bounding box of an attached renderer component to determine the maximum vertical displacement.")] + [@Predicated(nameof(_Mode), inverted: true, nameof(LodInputMode.Renderer))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _ReportRendererBounds = false; + + + internal override LodInputMode DefaultMode => LodInputMode.Renderer; + internal override int Pass => (int)_DisplacementPass; + + internal AnimatedWavesLodInput() : base() + { + _FollowHorizontalWaveMotion = true; + } + + internal override float Filter(WaterRenderer water, int slice) + { + return AnimatedWavesLod.FilterByWavelength(water, slice, _FilterByWavelength ? _OctaveWavelength : 0f); + } + + private protected override void OnUpdate(WaterRenderer water) + { + base.OnUpdate(water); + + if (!Enabled) + { + return; + } + + var maxDispVert = _MaximumDisplacementVertical; + + // let water system know how far from the sea level this shape may displace the surface + if (_ReportRendererBounds) + { + var range = Data.HeightRange; + var minY = range.x; + var maxY = range.y; + var seaLevel = water.SeaLevel; + maxDispVert = Mathf.Max(maxDispVert, Mathf.Abs(seaLevel - minY), Mathf.Abs(seaLevel - maxY)); + } + + if (_MaximumDisplacementHorizontal > 0f || maxDispVert > 0f) + { + water.ReportMaximumDisplacement(_MaximumDisplacementHorizontal, maxDispVert, 0f); + } + } + } + + partial class AnimatedWavesLodInput : ISerializationCallbackReceiver + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 1; +#pragma warning restore 414 + + [System.Obsolete("Please use DisplacementPass instead.")] + [Tooltip("When to render the input into the displacement data.\n\nIf enabled, it renders into all LODs of the simulation after the combine step rather than before with filtering. Furthermore, it will also affect dynamic waves.")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + [HideInInspector] + bool _RenderPostCombine = true; + + void SetRenderPostCombine(bool previous, bool current, bool force = false) + { + if (previous == current && !force) return; + _DisplacementPass = current ? DisplacementPass.LodIndependent : DisplacementPass.LodDependent; + } + +#pragma warning disable CS0618 // Type or member is obsolete + + /// + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + if (_Version < 1) + { + SetRenderPostCombine(_RenderPostCombine, _RenderPostCombine, force: true); + _Version = 1; + } + } + +#pragma warning restore CS0618 // Type or member is obsolete + + /// + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AnimatedWavesLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AnimatedWavesLodInput.cs.meta new file mode 100644 index 0000000..3dc451e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/AnimatedWavesLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3d64d1f50f3b548bcbe279507f0e78da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ClipLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ClipLodInput.cs new file mode 100644 index 0000000..3e30ad7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ClipLodInput.cs @@ -0,0 +1,156 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to use to clip the surface of the water. + /// + [@HelpURL("Manual/Clipping.html#clip-inputs")] + public sealed partial class ClipLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [@Heading("Primitive")] + + [Tooltip("The primitive to render (signed distance) into the simulation.")] + [@Predicated(nameof(_Mode), inverted: true, nameof(LodInputMode.Primitive), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal LodInputPrimitive _Primitive = LodInputPrimitive.Cube; + + // Only Mode.Primitive SDF supports inverted. + [Tooltip("Removes clip surface data instead of adding it.")] + [@Predicated(nameof(_Mode), inverted: true, nameof(LodInputMode.Primitive), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _Inverted; + + [@Heading("Culling")] + + [Tooltip("Prevents inputs from cancelling each other out when aligned vertically.\n\nIt is imperfect so custom logic might be needed for your use case.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Paint), hide: true)] + [@Predicated(nameof(_Mode), inverted: true, nameof(LodInputMode.Renderer))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _WaterHeightDistanceCulling = false; + + internal override LodInputMode DefaultMode => LodInputMode.Primitive; + // The clip surface samples at the displaced position in the water shader, so the displacement correction is not needed. + private protected override bool FollowHorizontalMotion => true; + + readonly SampleCollisionHelper _SampleHeightHelper = new(); + + ComputeShader PrimitiveShader => WaterResources.Instance.Compute._ClipPrimitive; + static LocalKeyword KeywordInverted => WaterResources.Instance.Keywords.ClipPrimitiveInverted; + static LocalKeyword KeywordSphere => WaterResources.Instance.Keywords.ClipPrimitiveSphere; + static LocalKeyword KeywordCube => WaterResources.Instance.Keywords.ClipPrimitiveCube; + static LocalKeyword KeywordRectangle => WaterResources.Instance.Keywords.ClipPrimitiveRectangle; + + bool _Enabled = true; + Rect _Rect; + + internal override void InferBlend() + { + base.InferBlend(); + _Blend = LodInputBlend.Maximum; + } + + internal override bool Enabled => _Enabled && Mode switch + { + LodInputMode.Primitive => enabled && PrimitiveShader != null, + _ => base.Enabled, + }; + + internal override Rect Rect + { + get + { + if (Mode == LodInputMode.Primitive) + { + if (_RecalculateBounds) + { + // This mode has full transform support so need to get rect from bounds. + _Rect = transform.Bounds().RectXZ(); + _RecalculateBounds = false; + } + + return _Rect; + } + + return base.Rect; + } + } + + internal override void Draw(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1f, int slices = -1) + { + if (Mode == LodInputMode.Primitive) + { + var wrapper = new PropertyWrapperCompute(buffer, PrimitiveShader, 0); + + wrapper.SetMatrix(Crest.ShaderIDs.s_Matrix, transform.worldToLocalMatrix); + + // For culling. + wrapper.SetVector(Crest.ShaderIDs.s_Position, transform.position); + wrapper.SetFloat(Crest.ShaderIDs.s_Diameter, transform.lossyScale.Maximum()); + + wrapper.SetKeyword(KeywordInverted, _Inverted); + wrapper.SetKeyword(KeywordSphere, _Primitive == LodInputPrimitive.Sphere); + wrapper.SetKeyword(KeywordCube, _Primitive == LodInputPrimitive.Cube); + wrapper.SetKeyword(KeywordRectangle, _Primitive == LodInputPrimitive.Quad); + + wrapper.SetTexture(Crest.ShaderIDs.s_Target, target); + + var threads = simulation.Resolution / Lod.k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, slices); + } + else + { + base.Draw(simulation, buffer, target, pass, weight, slices); + } + } + + private protected override void OnUpdate(WaterRenderer water) + { + base.OnUpdate(water); + + if (Mode != LodInputMode.Renderer) + { + _Enabled = true; + return; + } + + if (!base.Enabled) + { + return; + } + + if (Data is not RendererLodInputData data || data._Renderer == null) + { + return; + } + + // Prevents possible conflicts since overlapping doesn't work for every case for convex hull. + if (_WaterHeightDistanceCulling) + { + var position = transform.position; + + if (_SampleHeightHelper.SampleHeight(position, out var waterHeight)) + { + position.y = waterHeight; + _Enabled = Mathf.Abs(data._Renderer.bounds.ClosestPoint(position).y - waterHeight) < 1; + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ClipLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ClipLodInput.cs.meta new file mode 100644 index 0000000..18394b4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ClipLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26623fd0e291a478a9f8b68a3df7e8a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DepthLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DepthLodInput.cs new file mode 100644 index 0000000..2371e1d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DepthLodInput.cs @@ -0,0 +1,72 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// + /// Attach this to objects that you want to use to add water depth. + /// + /// + /// Renders depth every frame and should only be used for dynamic objects. For + /// static objects, use a + /// + /// + [@HelpURL("Manual/ShallowsAndShorelines.html#sea-floor-depth")] + public sealed partial class DepthLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [@Space(10)] + + [@Label("Relative Height")] + [Tooltip("Whether the data is relative to the input height.\n\nUseful for procedural placement.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _Relative = true; + + [@Label("Copy Signed Distance Field")] + [Tooltip("Whether to copy the signed distance field.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _CopySignedDistanceField; + + internal static new class ShaderIDs + { + public static readonly int s_HeightOffset = Shader.PropertyToID("_Crest_HeightOffset"); + public static readonly int s_SDF = Shader.PropertyToID("_Crest_SDF"); + } + + internal override LodInputMode DefaultMode => LodInputMode.Geometry; + + internal override void InferBlend() + { + base.InferBlend(); + _Blend = LodInputBlend.Maximum; + } + + internal override void Draw(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1f, int slice = -1) + { + var wrapper = new PropertyWrapperBuffer(buffer); + + wrapper.SetFloat(ShaderIDs.s_HeightOffset, _Relative ? transform.position.y : 0f); + + if (IsCompute) + { + wrapper.SetInteger(ShaderIDs.s_SDF, _CopySignedDistanceField ? 1 : 0); + buffer.SetKeyword(WaterResources.Instance.Compute._DepthTexture, WaterResources.Instance.Keywords.DepthTextureSDF, simulation._Water._DepthLod._EnableSignedDistanceFields); + } + + base.Draw(simulation, buffer, target, pass, weight, slice); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DepthLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DepthLodInput.cs.meta new file mode 100644 index 0000000..e435a40 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DepthLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d13f0b872e9454b5daa77afa95b12943 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DynamicWavesLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DynamicWavesLodInput.cs new file mode 100644 index 0000000..943a043 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DynamicWavesLodInput.cs @@ -0,0 +1,25 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to influence the simulation, such as + /// ripples etc. + /// + [@HelpURL("Manual/Waves.html#dynamic-waves-inputs")] + public sealed partial class DynamicWavesLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + internal override LodInputMode DefaultMode => LodInputMode.Renderer; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DynamicWavesLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DynamicWavesLodInput.cs.meta new file mode 100644 index 0000000..300956c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/DynamicWavesLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82638e366ec3c4f5587d1ff63e01d8b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FlowLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FlowLodInput.cs new file mode 100644 index 0000000..3a112dc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FlowLodInput.cs @@ -0,0 +1,34 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to influence the horizontal flow of the + /// water volume. + /// + [@HelpURL("Manual/TidesAndCurrents.html#flow-inputs")] + [FilterEnum(nameof(_Blend), Filtered.Mode.Include, (int)LodInputBlend.Additive, (int)LodInputBlend.Alpha)] + public sealed partial class FlowLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + // Countering will incur thrashing. Previously we allowed the option so the + // serialized value could be "false". + private protected override bool FollowHorizontalMotion => true; + +#if d_CrestPaint + internal override LodInputMode DefaultMode => LodInputMode.Paint; +#else + internal override LodInputMode DefaultMode => LodInputMode.Renderer; +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FlowLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FlowLodInput.cs.meta new file mode 100644 index 0000000..ec52aee --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FlowLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0cdc7659b2c244dbbb625ccd8ae65ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FoamLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FoamLodInput.cs new file mode 100644 index 0000000..91b2de6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FoamLodInput.cs @@ -0,0 +1,40 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to influence the foam simulation, such as + /// depositing foam on the surface. + /// + [@HelpURL("Manual/WaterAppearance.html#foam-inputs")] + [@FilterEnum(nameof(_Blend), Filtered.Mode.Include, (int)LodInputBlend.Additive, (int)LodInputBlend.Maximum)] + public sealed partial class FoamLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if d_CrestPaint + internal override LodInputMode DefaultMode => LodInputMode.Paint; +#else + internal override LodInputMode DefaultMode => LodInputMode.Renderer; +#endif + + internal override void InferBlend() + { + base.InferBlend(); + + if (_Mode is LodInputMode.Paint) + { + _Blend = LodInputBlend.Maximum; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FoamLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FoamLodInput.cs.meta new file mode 100644 index 0000000..6d4c57c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/FoamLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67bc7f0b9724d44ab9f0ddf0b1b5a773 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated.meta new file mode 100644 index 0000000..88b91df --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20184ba74fed44301b1efff21519c308 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated/LodInput.Generated.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated/LodInput.Generated.cs new file mode 100644 index 0000000..5e0ad15 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated/LodInput.Generated.cs @@ -0,0 +1,266 @@ +// + +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Absorption Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer, (int)LodInputMode.Texture, (int)LodInputMode.Spline, (int)LodInputMode.Paint)] + partial class AbsorptionLodInput + { + internal override Color GizmoColor => AbsorptionLod.s_GizmoColor; + private protected override SortedList Inputs => AbsorptionLod.s_Inputs; + } + + /// + [ForLodInput(typeof(AbsorptionLodInput), LodInputMode.Texture)] + [System.Serializable] + public sealed partial class AbsorptionTextureLodInputData : TextureLodInputData + { + private protected override ComputeShader TextureShader => WaterResources.Instance.Compute._AbsorptionTexture; + } + + /// + [ForLodInput(typeof(AbsorptionLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class AbsorptionRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Absorption"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Albedo Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer)] + partial class AlbedoLodInput + { + internal override Color GizmoColor => AlbedoLod.s_GizmoColor; + private protected override SortedList Inputs => AlbedoLod.s_Inputs; + } + + /// + [ForLodInput(typeof(AlbedoLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class AlbedoRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Albedo"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Animated Waves Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer)] + partial class AnimatedWavesLodInput + { + internal override Color GizmoColor => AnimatedWavesLod.s_GizmoColor; + private protected override SortedList Inputs => AnimatedWavesLod.s_Inputs; + } + + /// + [ForLodInput(typeof(AnimatedWavesLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class AnimatedWavesRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Animated Waves"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Clip Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer, (int)LodInputMode.Texture, (int)LodInputMode.Paint, (int)LodInputMode.Primitive)] + partial class ClipLodInput + { + internal override Color GizmoColor => ClipLod.s_GizmoColor; + private protected override SortedList Inputs => ClipLod.s_Inputs; + } + + /// + [ForLodInput(typeof(ClipLodInput), LodInputMode.Texture)] + [System.Serializable] + public sealed partial class ClipTextureLodInputData : TextureLodInputData + { + private protected override ComputeShader TextureShader => WaterResources.Instance.Compute._ClipTexture; + } + + /// + [ForLodInput(typeof(ClipLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class ClipRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Clip"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Water Depth Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer, (int)LodInputMode.Texture, (int)LodInputMode.Geometry)] + partial class DepthLodInput + { + internal override Color GizmoColor => DepthLod.s_GizmoColor; + private protected override SortedList Inputs => DepthLod.s_Inputs; + } + + /// + [ForLodInput(typeof(DepthLodInput), LodInputMode.Texture)] + [System.Serializable] + public sealed partial class DepthTextureLodInputData : TextureLodInputData + { + private protected override ComputeShader TextureShader => WaterResources.Instance.Compute._DepthTexture; + } + + /// + [ForLodInput(typeof(DepthLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class DepthRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Depth"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Dynamic Waves Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer)] + partial class DynamicWavesLodInput + { + internal override Color GizmoColor => DynamicWavesLod.s_GizmoColor; + private protected override SortedList Inputs => DynamicWavesLod.s_Inputs; + } + + /// + [ForLodInput(typeof(DynamicWavesLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class DynamicWavesRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Dynamic Waves"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Flow Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer, (int)LodInputMode.Texture, (int)LodInputMode.Paint, (int)LodInputMode.Spline)] + partial class FlowLodInput + { + internal override Color GizmoColor => FlowLod.s_GizmoColor; + private protected override SortedList Inputs => FlowLod.s_Inputs; + } + + /// + [ForLodInput(typeof(FlowLodInput), LodInputMode.Texture)] + [System.Serializable] + public sealed partial class FlowTextureLodInputData : DirectionalTextureLodInputData + { + private protected override ComputeShader TextureShader => WaterResources.Instance.Compute._FlowTexture; + } + + /// + [ForLodInput(typeof(FlowLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class FlowRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Flow"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Foam Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer, (int)LodInputMode.Texture, (int)LodInputMode.Paint, (int)LodInputMode.Spline)] + partial class FoamLodInput + { + internal override Color GizmoColor => FoamLod.s_GizmoColor; + private protected override SortedList Inputs => FoamLod.s_Inputs; + } + + /// + [ForLodInput(typeof(FoamLodInput), LodInputMode.Texture)] + [System.Serializable] + public sealed partial class FoamTextureLodInputData : TextureLodInputData + { + private protected override ComputeShader TextureShader => WaterResources.Instance.Compute._FoamTexture; + } + + /// + [ForLodInput(typeof(FoamLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class FoamRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Foam"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Water Level Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer, (int)LodInputMode.Texture, (int)LodInputMode.Paint, (int)LodInputMode.Spline, (int)LodInputMode.Geometry)] + partial class LevelLodInput + { + internal override Color GizmoColor => LevelLod.s_GizmoColor; + private protected override SortedList Inputs => LevelLod.s_Inputs; + } + + /// + [ForLodInput(typeof(LevelLodInput), LodInputMode.Texture)] + [System.Serializable] + public sealed partial class LevelTextureLodInputData : TextureLodInputData + { + private protected override ComputeShader TextureShader => WaterResources.Instance.Compute._LevelTexture; + } + + /// + [ForLodInput(typeof(LevelLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class LevelRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Level"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Scattering Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer, (int)LodInputMode.Texture, (int)LodInputMode.Spline, (int)LodInputMode.Paint)] + partial class ScatteringLodInput + { + internal override Color GizmoColor => ScatteringLod.s_GizmoColor; + private protected override SortedList Inputs => ScatteringLod.s_Inputs; + } + + /// + [ForLodInput(typeof(ScatteringLodInput), LodInputMode.Texture)] + [System.Serializable] + public sealed partial class ScatteringTextureLodInputData : TextureLodInputData + { + private protected override ComputeShader TextureShader => WaterResources.Instance.Compute._ScatteringTexture; + } + + /// + [ForLodInput(typeof(ScatteringLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class ScatteringRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Scattering"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Shadow Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer)] + partial class ShadowLodInput + { + internal override Color GizmoColor => ShadowLod.s_GizmoColor; + private protected override SortedList Inputs => ShadowLod.s_Inputs; + } + + /// + [ForLodInput(typeof(ShadowLodInput), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class ShadowRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Shadow"; + } + + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Shape Waves Input")] + [@FilterEnum(nameof(_Mode), Filtered.Mode.Include, (int)LodInputMode.Renderer, (int)LodInputMode.Texture, (int)LodInputMode.Paint, (int)LodInputMode.Spline, (int)LodInputMode.Global)] + partial class ShapeWaves + { + internal override Color GizmoColor => AnimatedWavesLod.s_GizmoColor; + private protected override SortedList Inputs => AnimatedWavesLod.s_Inputs; + } + + /// + [ForLodInput(typeof(ShapeWaves), LodInputMode.Texture)] + [System.Serializable] + public sealed partial class ShapeWavesTextureLodInputData : DirectionalTextureLodInputData + { + private protected override ComputeShader TextureShader => WaterResources.Instance.Compute._ShapeWavesTransfer; + } + + /// + [ForLodInput(typeof(ShapeWaves), LodInputMode.Renderer)] + [System.Serializable] + public sealed partial class ShapeWavesRendererLodInputData : RendererLodInputData + { + internal override string ShaderPrefix => "Crest/Inputs/Shape Waves"; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated/LodInput.Generated.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated/LodInput.Generated.cs.meta new file mode 100644 index 0000000..c17627a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Generated/LodInput.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 47424a406f7a145f8a8d6c207b7afc60 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/GeometryLodInputData.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/GeometryLodInputData.cs new file mode 100644 index 0000000..23beb86 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/GeometryLodInputData.cs @@ -0,0 +1,113 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// Data storage for for the Geometry input mode. + /// + [System.Serializable] + public abstract partial class GeometryLodInputData : LodInputData + { + [Tooltip("Geometry to render into the simulation.")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + internal Mesh _Geometry; + + private protected abstract Shader GeometryShader { get; } + + internal override bool IsEnabled => _Geometry != null; + + Material _Material; + + internal override void Draw(Lod lod, Component component, CommandBuffer buffer, RenderTargetIdentifier target, int slices) + { +#if UNITY_EDITOR + // Weird things happen when hitting save if this is not set here. Hitting save will + // still flicker the input, but without this it nothing renders. + if (!Application.isPlaying) LodInput.SetBlendFromPreset(_Material, _Input.Blend); +#endif + buffer.DrawMesh(_Geometry, component.transform.localToWorldMatrix, _Material); + } + + internal override void OnEnable() + { + if (_Material == null) + { + _Material = new Material(GeometryShader); + } + + LodInput.SetBlendFromPreset(_Material, _Input.Blend); + } + + internal override void OnDisable() + { + // Empty. + } + + internal override void RecalculateBounds() + { + _Bounds = _Input.transform.TransformBounds(_Geometry.bounds); + } + + internal override void RecalculateRect() + { + _Rect = Bounds.RectXZ(); + } + + void SetGeometry(Mesh previous, Mesh current) + { + if (previous == current) return; + RecalculateCulling(); + } + +#if UNITY_EDITOR + internal override void OnChange(string propertyPath, object previousValue) + { + if (_Input == null || !_Input.isActiveAndEnabled) return; + + switch (propertyPath) + { + case nameof(_Geometry): + SetGeometry((Mesh)previousValue, _Geometry); + break; + case "../" + nameof(LodInput._Blend): + LodInput.SetBlendFromPreset(_Material, _Input.Blend); + break; + } + } + + internal override bool InferMode(Component component, ref LodInputMode mode) + { + return false; + } + + internal override void Reset() + { + base.Reset(); + + _Geometry = Helpers.PlaneMesh; + } +#endif + } + + /// + [ForLodInput(typeof(LevelLodInput), LodInputMode.Geometry)] + [System.Serializable] + public sealed class LevelGeometryLodInputData : GeometryLodInputData + { + private protected override Shader GeometryShader => WaterResources.Instance.Shaders._LevelGeometry; + } + + /// + [ForLodInput(typeof(DepthLodInput), LodInputMode.Geometry)] + [System.Serializable] + public sealed class DepthGeometryLodInputData : GeometryLodInputData + { + private protected override Shader GeometryShader => WaterResources.Instance.Shaders._DepthGeometry; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/GeometryLodInputData.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/GeometryLodInputData.cs.meta new file mode 100644 index 0000000..86a02ca --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/GeometryLodInputData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 695da60ea6ccf44ea988e843144969cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/IOptionalLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/IOptionalLod.cs new file mode 100644 index 0000000..532b6d5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/IOptionalLod.cs @@ -0,0 +1,4 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Intentionally empty. diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/IOptionalLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/IOptionalLod.cs.meta new file mode 100644 index 0000000..a3020c8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/IOptionalLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc9697a0accb44ec7a0f693182937c94 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LevelLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LevelLodInput.cs new file mode 100644 index 0000000..68995c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LevelLodInput.cs @@ -0,0 +1,132 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to influence the water height. + /// + [@HelpURL("Manual/WaterBodies.html#water-bodies")] + [@FilterEnum(nameof(_Blend), Filtered.Mode.Include, (int)LodInputBlend.Off, (int)LodInputBlend.Additive, (int)LodInputBlend.Minimum, (int)LodInputBlend.Maximum)] + public sealed partial class LevelLodInput : LodInput + { + [@Heading("Water Chunk Culling")] + + [Tooltip("Whether to use the manual \"Height Range\" for water chunk culling.\n\nMandatory for non mesh inputs like \"Texture\".")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _OverrideHeight; + + [Tooltip("The minimum and maximum height value to report for water chunk culling.")] + [@Predicated(nameof(_OverrideHeight))] + [@Range(-100, 100, Range.Clamp.None)] + [@GenerateAPI] + [SerializeField] + Vector2 _HeightRange = new(-100, 100); + + LevelLodInput() + { + _FollowHorizontalWaveMotion = true; + } + + // Water level is packed into alpha using the displaced position. + private protected override bool FollowHorizontalMotion => true; + internal override LodInputMode DefaultMode => LodInputMode.Geometry; + + internal Rect _Rect; + + internal override void InferBlend() + { + base.InferBlend(); + + _Blend = LodInputBlend.Off; + + if (_Mode is LodInputMode.Paint or LodInputMode.Texture) + { + _Blend = LodInputBlend.Additive; + } + } + + private protected override void Initialize() + { + base.Initialize(); + _Reporter ??= new(this); + WaterChunkRenderer.HeightReporters.Add(_Reporter); + } + + private protected override void OnDisable() + { + base.OnDisable(); + WaterChunkRenderer.HeightReporters.Remove(_Reporter); + } + + bool ReportHeight(ref Rect bounds, ref float minimum, ref float maximum) + { + if (!Enabled) + { + return false; + } + + _Rect = Data.Rect; + + // These modes do not provide a height yet. + if (!Data.HasHeightRange && !_OverrideHeight) + { + return false; + } + + if (bounds.Overlaps(_Rect, false)) + { + var range = _OverrideHeight ? _HeightRange : Data.HeightRange; + minimum = range.x; + maximum = range.y; + return true; + } + + return false; + } + } + + partial class LevelLodInput + { + Reporter _Reporter; + + sealed class Reporter : IReportsHeight + { + readonly LevelLodInput _Input; + public Reporter(LevelLodInput input) => _Input = input; + public bool ReportHeight(ref Rect bounds, ref float minimum, ref float maximum) => _Input.ReportHeight(ref bounds, ref minimum, ref maximum); + } + } + + partial class LevelLodInput : ISerializationCallbackReceiver + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 1; +#pragma warning restore 414 + + /// + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + // Version 1 + // - Implemented blend mode but default value was serialized as Additive. + if (_Version < 1) + { + if (_Mode is LodInputMode.Spline or LodInputMode.Renderer) _Blend = LodInputBlend.Off; + _Version = 1; + } + } + + /// + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + // Empty. + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LevelLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LevelLodInput.cs.meta new file mode 100644 index 0000000..500b50b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LevelLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4edd034314af4679ba066d79580dc1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInput.cs new file mode 100644 index 0000000..621ecf8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInput.cs @@ -0,0 +1,485 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + interface ILodInput + { + const int k_QueueMaximumSubIndex = 1000; + + /// + /// Draw the input (the render target will be bound) + /// + void Draw(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1f, int slice = -1); + + float Filter(WaterRenderer water, int slice); + + /// + /// Whether to apply this input. + /// + bool Enabled { get; } + + bool IsCompute { get; } + + int Queue { get; } + + int Pass { get; } + + Rect Rect { get; } + + MonoBehaviour Component { get; } + + // Allow sorting within a queue. Callers can pass in things like sibling index to + // get deterministic sorting. + int Order => Queue * k_QueueMaximumSubIndex + Mathf.Min(Component.transform.GetSiblingIndex(), k_QueueMaximumSubIndex - 1); + + internal static void Attach(ILodInput input, Utility.SortedList inputs) + { + inputs.Remove(input); + inputs.Add(input.Order, input); + } + + internal static void Detach(ILodInput input, Utility.SortedList inputs) + { + inputs.Remove(input); + } + } + + /// + /// Base class for scripts that register inputs to the various LOD data types. + /// + [@ExecuteDuringEditMode] + [@HelpURL("Manual/WaterInputs.html")] + public abstract partial class LodInput : ManagedBehaviour + { + [Tooltip("The mode for this input.\n\nSee the manual for more details about input modes. Use AddComponent(LodInputMode) to set the mode via scripting. The mode cannot be changed after creation.")] + [@Filtered((int)LodInputMode.Unset)] + [@GenerateAPI(Setter.None)] + [SerializeField] + internal LodInputMode _Mode = LodInputMode.Unset; + + // NOTE: + // Weight and Feather do not support Depth and Clip as they do not make much sense. + // For others it is a case of only supporting unsupported mode(s). + + [Tooltip("Scales the input.")] + [@Predicated(typeof(AlbedoLodInput), inverted: true, hide: true)] + [@Predicated(typeof(ClipLodInput), inverted: true, hide: true)] + [@Predicated(typeof(DepthLodInput), inverted: true, hide: true)] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + float _Weight = 1f; + + [Tooltip("The order this input will render.\n\nOrder is Queue plus SiblingIndex")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + int _Queue; + + [Tooltip("How this input blends into existing data.\n\nSimilar to blend operations in shaders. For inputs which have materials, use the blend functionality on the shader/material.")] + [@Predicated(typeof(AbsorptionLodInput), inverted: true, hide: true)] + [@Predicated(typeof(AlbedoLodInput), inverted: true, hide: true)] + [@Predicated(typeof(AnimatedWavesLodInput), inverted: true, hide: true)] + [@Predicated(typeof(ClipLodInput), inverted: true, hide: true)] + [@Predicated(typeof(DepthLodInput), inverted: true, hide: true)] + [@Predicated(typeof(DynamicWavesLodInput), inverted: true, hide: true)] + [@Predicated(typeof(ScatteringLodInput), inverted: true, hide: true)] + [@Predicated(typeof(ShadowLodInput), inverted: true, hide: true)] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Global))] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Primitive))] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Renderer))] + [@Filtered] + [@GenerateAPI] + [SerializeField] + internal LodInputBlend _Blend = LodInputBlend.Additive; + + [@Label("Feather")] + [Tooltip("The width of the feathering to soften the edges to blend inputs.\n\nInputs that do not support feathering will have this field disabled or hidden in UI.")] + [@Predicated(typeof(AlbedoLodInput), inverted: true, hide: true)] + [@Predicated(typeof(AnimatedWavesLodInput), inverted: true, hide: true)] + [@Predicated(typeof(ClipLodInput), inverted: true, hide: true)] + [@Predicated(typeof(DepthLodInput), inverted: true, hide: true)] + [@Predicated(typeof(DynamicWavesLodInput), inverted: true, hide: true)] + [@Predicated(typeof(LevelLodInput), inverted: true, hide: true)] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Renderer))] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Global))] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Primitive))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _FeatherWidth = 0.1f; + + [Tooltip("How this input responds to horizontal displacement.\n\nIf false, data will not move horizontally with the waves. Has a small performance overhead when disabled. Only suitable for inputs of small size.")] + [@Predicated(typeof(ClipLodInput), inverted: true, hide: true)] + [@Predicated(typeof(FlowLodInput), inverted: true, hide: true)] + [@Predicated(typeof(LevelLodInput), inverted: true, hide: true)] + [@Predicated(typeof(ShapeWaves), inverted: true, hide: true)] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Global))] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Spline))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + private protected bool _FollowHorizontalWaveMotion = false; + + [@Heading("Mode")] + + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Unset), hide: true)] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Primitive), hide: true)] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Global), hide: true)] + [@Stripped] + [SerializeReference] + internal LodInputData _Data; + + // Need always visble for space to appear before foldout instead of inside. + [@Space(10, isAlwaysVisible: true)] + + [@Group("Debug", order = k_DebugGroupOrder)] + + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Global))] + [@DecoratedField, SerializeField] + internal bool _DrawBounds; + + internal const int k_DebugGroupOrder = 10; + + internal static class ShaderIDs + { + public static int s_Weight = Shader.PropertyToID("_Crest_Weight"); + public static int s_DisplacementAtInputPosition = Shader.PropertyToID("_Crest_DisplacementAtInputPosition"); + public static readonly int s_BlendSource = Shader.PropertyToID("_Crest_BlendSource"); + public static readonly int s_BlendTarget = Shader.PropertyToID("_Crest_BlendTarget"); + public static readonly int s_BlendOperation = Shader.PropertyToID("_Crest_BlendOperation"); + } + + + internal abstract Color GizmoColor { get; } + internal abstract LodInputMode DefaultMode { get; } + private protected abstract Utility.SortedList Inputs { get; } + + /// + /// Disables rendering of input into data, but continues most scripting activities. + /// + public bool ForceRenderingOff { get; set; } + + /// + /// Properties specific to . + /// + /// + /// + /// You will need to cast to a more specific type to change + /// certain properties. Types derive from and end with . + /// Consider using which will validate and cast. + /// + /// + /// and will + /// have no associated data and will be null. The rest will have an + /// type which will be prefixed with the input type and + /// then mode (eg mode for + /// will be ). + /// + /// + /// An exception is and . They + /// are derived from and use it as a prefix. (eg ). + /// + /// + public LodInputData Data { get => _Data; internal set => _Data = value; } + + /// + /// Retrieves the typed data and validates the passed type. + /// + /// + /// Validation is stripped from builds. + /// + /// The data type to cast to. + /// The casted data. + public T GetData() where T : LodInputData + { + if (_Mode is LodInputMode.Global or LodInputMode.Primitive or LodInputMode.Unset) + { + Debug.AssertFormat(false, "Crest: {0} has no associated data type.", _Mode); + return null; + } + + Debug.AssertFormat(Data is T, "Crest: Incorrect data type ({1}). The data type is {0}.", Data.GetType().BaseType.Name, typeof(T).Name); + + return Data as T; + } + + internal bool IsCompute => Mode is LodInputMode.Texture or LodInputMode.Paint or LodInputMode.Global or LodInputMode.Primitive; + internal virtual int Pass => -1; + internal virtual Rect Rect + { + get + { + var rect = Rect.zero; + if (_Data != null) + { + rect = _Data.Rect; + rect.center -= _Displacement.XZ(); + } + return rect; + } + } + + readonly SampleCollisionHelper _SampleHeightHelper = new(); + Vector3 _Displacement; + private protected bool _RecalculateBounds = true; + + internal virtual bool Enabled => enabled && !ForceRenderingOff && Mode switch + { + LodInputMode.Unset => false, + _ => Data?.IsEnabled ?? false, + }; + + // By default do not follow horizontal motion of waves. This means that the water input will appear on the surface at its XZ location, instead + // of moving horizontally with the waves. + private protected virtual bool FollowHorizontalMotion => Mode is LodInputMode.Global or LodInputMode.Spline || _FollowHorizontalWaveMotion; + + + // + // Event Methods + // + + private protected override void Initialize() + { + base.Initialize(); + Data?.OnEnable(); + Attach(); + } + + private protected override void OnDisable() + { + base.OnDisable(); + Detach(); + Data?.OnDisable(); + } + + private protected override Action OnUpdateMethod => OnUpdate; + private protected virtual void OnUpdate(WaterRenderer water) + { + if (transform.hasChanged) + { + _RecalculateBounds = true; + } + + // Input culling depends on displacement. + if (!FollowHorizontalMotion) + { + _SampleHeightHelper.SampleDisplacement(transform.position, out _Displacement); + } + else + { + _Displacement = Vector3.zero; + } + + Data?.OnUpdate(); + } + + private protected override Action OnLateUpdateMethod => OnLateUpdate; + private protected virtual void OnLateUpdate(WaterRenderer water) + { + Data?.OnLateUpdate(); + + transform.hasChanged = false; + } + + + // + // ILodInput + // + + private protected virtual void Attach() + { + _Input ??= new(this); + ILodInput.Attach(_Input, Inputs); + } + + private protected virtual void Detach() + { + ILodInput.Detach(_Input, Inputs); + } + + internal virtual void Draw(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1f, int slice = -1) + { + if (weight == 0f) + { + return; + } + + // Must use global as weight can change per slice for ShapeWaves. + var wrapper = new PropertyWrapperBuffer(buffer); + wrapper.SetFloat(ShaderIDs.s_Weight, weight * _Weight); + wrapper.SetVector(ShaderIDs.s_DisplacementAtInputPosition, _Displacement); + + Data?.Draw(simulation, this, buffer, target, slice); + } + + internal virtual float Filter(WaterRenderer water, int slice) + { + return 1f; + } + + /// + /// Sets the Blend render state using Blend present. + /// + internal static void SetBlendFromPreset(Material material, LodInputBlend preset) + { + // Blend.Additive + var source = BlendMode.One; + var target = BlendMode.One; + var operation = BlendOp.Add; + + switch (preset) + { + case LodInputBlend.Off: + source = BlendMode.One; + target = BlendMode.Zero; + break; + case LodInputBlend.Alpha or LodInputBlend.AlphaClip: + source = BlendMode.One; // We apply alpha before blending. + target = BlendMode.OneMinusSrcAlpha; + break; + case LodInputBlend.Maximum: + operation = BlendOp.Max; + break; + case LodInputBlend.Minimum: + operation = BlendOp.Min; + break; + } + + // SetInteger did not appear to work last time. Will need to revisit. + material.SetInt(ShaderIDs.s_BlendSource, (int)source); + material.SetInt(ShaderIDs.s_BlendTarget, (int)target); + material.SetInt(ShaderIDs.s_BlendOperation, (int)operation); + } + + void SetQueue(int previous, int current) + { + if (previous == current) return; + if (!isActiveAndEnabled) return; + Attach(); + } + + internal virtual void InferBlend() + { + // Correct for most cases. + _Blend = LodInputBlend.Additive; + } + + // + // Editor Only Methods + // + +#if UNITY_EDITOR + [@OnChange(skipIfInactive: false)] + void OnChange(string propertyPath, object previousValue) + { + switch (propertyPath) + { + case nameof(_Queue): + SetQueue((int)previousValue, _Queue); + break; + case nameof(_Mode): + if (!isActiveAndEnabled) { ChangeMode(Mode); break; } + OnDisable(); + ChangeMode(Mode); + UnityEditor.EditorTools.ToolManager.RefreshAvailableTools(); + OnEnable(); + break; + case nameof(_Blend): + // TODO: Make compatible with disabled. + if (isActiveAndEnabled) Data.OnChange($"../{propertyPath}", previousValue); + break; + } + } + + internal void ChangeMode(LodInputMode mode) + { + _Data = null; + + // Try to infer the mode. + var types = TypeCache.GetTypesWithAttribute(); + var self = GetType(); + foreach (var type in types) + { + var attributes = type.GetCustomAttributes(); + foreach (var attribute in attributes) + { + if (attribute._Mode != mode) continue; + if (!attribute._Type.IsAssignableFrom(self)) continue; + _Mode = mode; + InferBlend(); + _Data = (LodInputData)Activator.CreateInstance(type); + _Data._Input = this; + _Data.InferMode(this, ref _Mode); + return; + } + } + + _Mode = DefaultMode; + InferBlend(); + } + + /// + /// Called when component attached in edit mode, or when Reset clicked by user. + /// Besides recovering from Unset default value, also does a nice bit of auto-config. + /// + private protected override void Reset() + { + var types = TypeCache.GetTypesWithAttribute(); + var self = GetType(); + + // Use inferred mode. + foreach (var type in types) + { + var attributes = type.GetCustomAttributes(); + foreach (var attribute in attributes) + { + if (!attribute._Type.IsAssignableFrom(self)) continue; + + var instance = (LodInputData)Activator.CreateInstance(type); + instance._Input = this; + + if (instance.InferMode(this, ref _Mode)) + { + _Data = instance; + InferBlend(); + return; + } + } + } + + // Use default mode. + ChangeMode(DefaultMode); + + _Data?.Reset(); + + base.Reset(); + } +#endif + } + + partial class LodInput + { + Input _Input; + + sealed class Input : ILodInput + { + readonly LodInput _Input; + public Input(LodInput input) => _Input = input; + public bool Enabled => _Input.Enabled; + public bool IsCompute => _Input.IsCompute; + public int Queue => _Input.Queue; + public int Pass => _Input.Pass; + public Rect Rect => _Input.Rect; + public MonoBehaviour Component => _Input; + public float Filter(WaterRenderer water, int slice) => _Input.Filter(water, slice); + public void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) => _Input.Draw(lod, buffer, target, pass, weight, slice); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInput.cs.meta new file mode 100644 index 0000000..29b6392 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 126e7f9b525874cdbb0653a0f1662e18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInputData.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInputData.cs new file mode 100644 index 0000000..7965fd4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInputData.cs @@ -0,0 +1,199 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + [AttributeUsage(AttributeTargets.Class)] + sealed class ForLodInput : Attribute + { + public readonly Type _Type; + public readonly LodInputMode _Mode; + + public ForLodInput(Type type, LodInputMode mode) + { + _Type = type; + _Mode = mode; + } + } + + /// + /// Data storage for an input, pertinent to the associated input mode. + /// + [Serializable] + public abstract class LodInputData + { + [SerializeField, HideInInspector] + internal LodInput _Input; + + private protected Rect _Rect; + private protected Bounds _Bounds; + private protected bool _RecalculateRect = true; + private protected bool _RecalculateBounds = true; + + internal abstract bool IsEnabled { get; } + internal abstract void OnEnable(); + internal abstract void OnDisable(); + internal abstract void Draw(Lod lod, Component component, CommandBuffer buffer, RenderTargetIdentifier target, int slice); + internal abstract void RecalculateRect(); + internal abstract void RecalculateBounds(); + + internal virtual bool HasHeightRange => true; + + internal Rect Rect + { + get + { + if (_RecalculateRect) + { + RecalculateRect(); + _RecalculateRect = false; + } + + return _Rect; + } + } + + internal Bounds Bounds + { + get + { + if (_RecalculateBounds) + { + RecalculateBounds(); + _RecalculateBounds = false; + } + + return _Bounds; + } + } + + // Warning: NotImplementedException is thrown for paint and texture types. + internal Vector2 HeightRange + { + get + { + if (!HasHeightRange) return Vector2.zero; + var bounds = Bounds; + return new(bounds.min.y, bounds.max.y); + } + } + + private protected void RecalculateCulling() + { + _RecalculateRect = _RecalculateBounds = true; + } + + internal virtual void OnUpdate() + { + if (_Input.transform.hasChanged) + { + RecalculateCulling(); + } + } + + internal virtual void OnLateUpdate() + { + + } + +#if UNITY_EDITOR + internal abstract void OnChange(string propertyPath, object previousValue); + internal abstract bool InferMode(Component component, ref LodInputMode mode); + internal virtual void Reset() { } +#endif + } + + /// + /// Modes that inputs can use. Not all inputs support all modes. Refer to the UI. + /// + [@GenerateDoc] + public enum LodInputMode + { + /// + [Tooltip("Unset is the serialization default.\n\nThis will be replaced with the default mode automatically. Unset can also be used if something is invalid.")] + Unset = 0, + + /// + [Tooltip("Hand-painted data by the user.")] + Paint, + + /// + [Tooltip("Driven by a user created spline.")] + Spline, + + /// + [Tooltip("Attached 'Renderer' (mesh, particle or other) used to drive data.")] + Renderer, + + /// + [Tooltip("Driven by a mathematical primitive such as a cube or sphere.")] + Primitive, + + /// + [Tooltip("Covers the entire water area.")] + Global, + + /// + [Tooltip("Data driven by a user provided texture.")] + Texture, + + /// + [Tooltip("Renders geometry using a default material.")] + Geometry, + } + + /// + /// Blend presets for inputs. + /// + [@GenerateDoc] + public enum LodInputBlend + { + /// + [Tooltip("No blending. Overwrites.")] + Off, + + /// + [Tooltip("Additive blending.")] + Additive, + + /// + [Tooltip("Takes the minimum value.")] + Minimum, + + /// + [Tooltip("Takes the maximum value.")] + Maximum, + + /// + [Tooltip("Applies the inverse weight to the target.\n\nBasically overwrites what is already in the simulation.")] + Alpha, + + /// + [Tooltip("Same as alpha except anything above zero will overwrite rather than blend.")] + AlphaClip, + } + + /// + /// Primitive shapes. + /// + // Have this match UnityEngine.PrimitiveType. + [@GenerateDoc] + public enum LodInputPrimitive + { + /// + [Tooltip("Spheroid.")] + Sphere = 0, + + /// + [Tooltip("Cuboid.")] + Cube = 3, + + /// + [Tooltip("Quad.")] + Quad = 5, + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInputData.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInputData.cs.meta new file mode 100644 index 0000000..47a7549 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/LodInputData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a95cc8f7e50c47d8bfdda73f6da338a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe.meta new file mode 100644 index 0000000..df5d6f9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3081df6bb94d94daaa8cc2432f215251 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.HighDefinition.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.HighDefinition.cs new file mode 100644 index 0000000..b4878e5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.HighDefinition.cs @@ -0,0 +1,54 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using System.Collections.Generic; +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest +{ + partial class DepthProbe + { + static readonly List s_FrameSettingsFields = new() + { + FrameSettingsField.OpaqueObjects, + FrameSettingsField.TransparentObjects, + FrameSettingsField.TransparentPrepass, + FrameSettingsField.TransparentPostpass, + FrameSettingsField.AsyncCompute, + }; + + HDAdditionalCameraData _HDAdditionalCameraData; + + void SetUpCameraHD() + { + var additionalCameraData = _Camera.gameObject.AddComponent(); + + additionalCameraData.clearColorMode = HDAdditionalCameraData.ClearColorMode.Color; + additionalCameraData.volumeLayerMask = 0; + additionalCameraData.probeLayerMask = 0; + additionalCameraData.xrRendering = false; + + // Override camera frame settings to disable most of the expensive rendering for this camera. + // Most importantly, disable custom passes and post-processing as third-party stuff might throw + // errors because of this camera. Even with excluding a lot of HDRP features, it still does a + // lit pass which is not cheap. + additionalCameraData.customRenderingSettings = true; + + foreach (FrameSettingsField frameSetting in System.Enum.GetValues(typeof(FrameSettingsField))) + { + if (!s_FrameSettingsFields.Contains(frameSetting)) + { + // Enable override and then disable the feature. + additionalCameraData.renderingPathCustomFrameSettingsOverrideMask.mask[(uint)frameSetting] = true; + additionalCameraData.renderingPathCustomFrameSettings.SetEnabled(frameSetting, false); + } + } + + _HDAdditionalCameraData = additionalCameraData; + } + } +} + +#endif // d_UnityHDRP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.HighDefinition.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.HighDefinition.cs.meta new file mode 100644 index 0000000..188a39c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.HighDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93b38270a78f94e43bfbbe01ef2e351b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 300 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.Universal.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.Universal.cs new file mode 100644 index 0000000..e0db58e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.Universal.cs @@ -0,0 +1,24 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP + +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + partial class DepthProbe + { + void SetUpCameraURP() + { + var additionalCameraData = _Camera.GetUniversalAdditionalCameraData(); + additionalCameraData.renderShadows = false; + additionalCameraData.requiresColorTexture = false; + additionalCameraData.requiresDepthTexture = false; + additionalCameraData.renderPostProcessing = false; + additionalCameraData.allowXRRendering = false; + } + } +} + +#endif // d_UnityURP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.Universal.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.Universal.cs.meta new file mode 100644 index 0000000..3aa4c07 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.Universal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3d572236539a490aaddc647129ad141 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 300 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.cs new file mode 100644 index 0000000..c541ec5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.cs @@ -0,0 +1,1016 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// 's update mode. + /// + [@GenerateDoc] + public enum DepthProbeMode + { + /// + [Tooltip("Update in real-time in accordance to refresh mode.")] + RealTime, + + /// + [Tooltip("Baked in the editor.")] + Baked, + } + + /// + /// How the refreshes when using . + /// + [@GenerateDoc] + public enum DepthProbeRefreshMode + { + /// + [Tooltip("Populates the DepthProbe in Start.")] + OnStart = 0, + + // EveryFrame = 1, + + /// + [Tooltip("Requires manual updating via DepthProbe.Populate.")] + ViaScripting = 2, + } + + /// + /// How a component is placed in the world. + /// + [@GenerateDoc] + public enum Placement + { + /// + [Tooltip("The component is in a fixed position.")] + Fixed, + + /// + [Tooltip("The component follows the transform.")] + Transform, + + /// + [Tooltip("The component follows the viewpoint.")] + Viewpoint, + } + + /// + /// Captures scene height / water depth, and renders it into the simulation. + /// + /// + /// Caches the operation to avoid rendering it every frame. This should be used for + /// static geometry, dynamic objects should be tagged with the + /// component. + /// + [@ExecuteDuringEditMode] + [@HelpURL("Manual/ShallowsAndShorelines.html")] + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Depth Probe")] + public sealed partial class DepthProbe : ManagedBehaviour + { + [Tooltip("Specifies the setup for this probe.")] + [@GenerateAPI] + [SerializeField] + internal DepthProbeMode _Type = DepthProbeMode.RealTime; + + [Tooltip("Controls how the probe is refreshed in the Player.\n\nCall Populate() if scripting.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal DepthProbeRefreshMode _RefreshMode = DepthProbeRefreshMode.OnStart; + + + [@Heading("Capture")] + + [Tooltip("The layers to render into the probe.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [@GenerateAPI(Setter.Dirty)] + [@DecoratedField, SerializeField] + internal LayerMask _Layers = 1; // Default + + [Tooltip("The resolution of the probe.\n\nLower will be more efficient.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [@GenerateAPI(Setter.Dirty)] + [@DecoratedField, SerializeField] + internal int _Resolution = 512; + + [Tooltip("The far and near plane of the depth probe camera respectively, relative to the transform.\n\nDepth is captured top-down and orthographically. The gizmo will visualize this range as the bottom box.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [@Range(-100f, 100f, Range.Clamp.None)] + [@GenerateAPI(Setter.Dirty)] + [SerializeField] + internal Vector2 _CaptureRange = new(-1000f, 1000f); + + [Tooltip("Fills holes left by the maximum of the capture range.\n\nSetting the maximum capture range lower than the highest point of geometry can be useful for eliminating depth artifacts from overhangs, but the side effect is there will be a hole in the depth data where geometry is clipped by the near plane. This will only capture where the holes are to fill them in. This height is relative to the maximum capture range. Set to zero to skip.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [@Range(0f, 100f, Range.Clamp.Minimum)] + [UnityEngine.Serialization.FormerlySerializedAs("_MaximumHeight")] + [@GenerateAPI(Setter.Dirty)] + [SerializeField] + internal float _FillHolesCaptureHeight; + + [@Label("Enable Back-Face Inclusion")] + [Tooltip("Increase coverage by testing mesh back faces within the Fill Holes area.\n\nUses the back-faces to include meshes where the front-face is within the Fill Holes area and the back-face is within the capture area. An example would be an upright cylinder not over a hole but was not captured due to the top being clipped by the near plane.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [@Predicated(nameof(_FillHolesCaptureHeight), inverted: false, 0f)] + [@GenerateAPI(Setter.Dirty)] + [@DecoratedField, SerializeField] + bool _EnableBackFaceInclusion = true; + + [Tooltip("Overrides global quality settings.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [GenerateAPI(Setter.None)] + [@DecoratedField, SerializeField] + QualitySettingsOverride _QualitySettingsOverride = new() + { + _OverrideLodBias = true, + _LodBias = Mathf.Infinity, + _OverrideMaximumLodLevel = true, + _MaximumLodLevel = 0, + _OverrideTerrainPixelError = true, + _TerrainPixelError = 0, + }; + + [@Space(10)] + + [Tooltip("Baked probe.\n\nCan only bake in edit mode.")] + [@Disabled] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.Baked), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] +#pragma warning disable 649 + internal Texture2D _SavedTexture; +#pragma warning restore 649 + + + [@Heading("Signed Distance Field")] + + [@Label("Generate")] + [Tooltip("Generate a signed distance field for the shoreline.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [@GenerateAPI(Setter.Dirty)] + [@DecoratedField, SerializeField] + internal bool _GenerateSignedDistanceField = true; + + // Additional rounds of JFA, over the standard log2(resolution), can help reduce + // innacuracies from JFA, see paper for details. + [Tooltip("How many additional Jump Flood rounds to use.\n\nThe standard number of rounds is log2(resolution). Additional rounds can reduce innaccuracies.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [@Predicated(nameof(_GenerateSignedDistanceField))] + [@GenerateAPI(Setter.Dirty)] + [@DecoratedField, SerializeField] + int _AdditionalJumpFloodRounds = 7; + + + [@Space(10)] + + [@DecoratedField, SerializeField] + internal DebugFields _Debug = new(); + + [System.Serializable] + internal sealed class DebugFields + { + [Tooltip("Will render into the probe every frame. Intended for debugging, will generate garbage.")] + [@Predicated(nameof(_Type), inverted: true, nameof(DepthProbeMode.RealTime))] + [@DecoratedField, SerializeField] + public bool _ForceAlwaysUpdateDebug; + + [Tooltip("Shows hidden objects like the camera which renders into the probe.")] + [@DecoratedField, SerializeField] + public bool _ShowHiddenObjects; + +#if !CREST_DEBUG + [HideInInspector] +#endif + [@DecoratedField, SerializeField] + public bool _ShowSimulationDataInScene; + } + + const int k_CopyKernel = 0; + const int k_FillKernel = 1; + + internal Camera _Camera; + Rect _Rect; + bool _RecalculateBounds = true; + CommandBuffer _CommandBuffer; + + Rect Rect + { + get + { + if (_RecalculateBounds) + { + _Rect = Managed ? new(Position.XZ() - Scale * 0.5f, Scale) : transform.RectXZ(); + _RecalculateBounds = false; + } + + return _Rect; + } + } + + internal Texture Texture => _Type == DepthProbeMode.Baked ? SavedTexture : RealtimeTexture; + internal RenderTexture RealtimeTexture { get; set; } + internal RenderTexture TargetTexture { get; set; } + + // Allows another component to take control of the transform. + bool _Managed; + internal bool Managed + { + get => _Managed; + + set + { + if (_Managed != value) _RecalculateBounds = true; + _Managed = value; + } + } + + bool _OverridePosition; + internal bool OverridePosition + { + get => _OverridePosition; + + set + { + if (Managed && _OverridePosition != value) _RecalculateBounds = true; + _OverridePosition = value; + } + } + + Vector3 _Position; + internal Vector3 Position + { + get + { + return Managed && OverridePosition ? _Position.XNZ(transform.position.y) : transform.position; + } + + set + { + if (Managed && OverridePosition && _Position != value) _RecalculateBounds = true; + _Position = value; + } + } + + // Only allow axis-aligned when mananged for now. + internal Quaternion Rotation => Managed ? Quaternion.identity : Quaternion.Euler(transform.rotation.eulerAngles.NYN()); + + Vector2 _Scale; + internal Vector2 Scale + { + get => Managed ? _Scale : transform.lossyScale.XZ(); + + set + { + if (_Scale != value) _RecalculateBounds = true; + _Scale = value; + } + } + + + /// + /// Invoked before the camera renders. + /// + public static System.Action OnBeforeRender { get; set; } + + /// + /// Invoked after the camera renders. + /// + public static System.Action OnAfterRender { get; set; } + + // A background process will listen to this. Allows probe to request a bake with + // needing assembly reference (which it cannot get due to circular reference). + internal static System.Action OnBakeRequest { get; set; } + + + internal static class ShaderIDs + { + public static readonly int s_CamDepthBuffer = Shader.PropertyToID("_CamDepthBuffer"); + public static readonly int s_CustomZBufferParams = Shader.PropertyToID("_CustomZBufferParams"); + public static readonly int s_HeightNearHeightFar = Shader.PropertyToID("_HeightNearHeightFar"); + public static readonly int s_HeightOffset = Shader.PropertyToID("_HeightOffset"); + public static readonly int s_CameraDepthBufferBackfaces = Shader.PropertyToID("_Crest_CameraDepthBufferBackfaces"); + public static readonly int s_PreviousPlane = Shader.PropertyToID("_Crest_PreviousPlane"); + + // Bind + public static readonly int s_DepthProbe = Shader.PropertyToID("_Crest_DepthProbe"); + public static readonly int s_DepthProbeHeightOffset = Shader.PropertyToID("_Crest_DepthProbeHeightOffset"); + public static readonly int s_DepthProbeResolution = Shader.PropertyToID("_Crest_DepthProbeResolution"); + + + // SDF + public static readonly int s_JumpSize = Shader.PropertyToID("_Crest_JumpSize"); + public static readonly int s_WaterLevel = Shader.PropertyToID("_Crest_WaterLevel"); + public static readonly int s_ProjectionToWorld = Shader.PropertyToID("_Crest_ProjectionToWorld"); + public static readonly int s_VoronoiPingPong0 = Shader.PropertyToID("_Crest_VoronoiPingPong0"); + public static readonly int s_VoronoiPingPong1 = Shader.PropertyToID("_Crest_VoronoiPingPong1"); + } + + internal void Bind(T wrapper) where T : IPropertyWrapper + { + wrapper.SetTexture(ShaderIDs.s_DepthProbe, Texture); + wrapper.SetFloat(ShaderIDs.s_DepthProbeHeightOffset, transform.position.y); + wrapper.SetFloat(ShaderIDs.s_DepthProbeResolution, _Resolution); + } + + /// + private protected override void OnStart() + { + base.OnStart(); + + if (_Type == DepthProbeMode.RealTime && _RefreshMode == DepthProbeRefreshMode.OnStart) + { + Populate(); + } + } + + void OnDestroy() + { + if (_Camera != null) Helpers.Destroy(_Camera.gameObject); + + _CommandBuffer?.Release(); + _CommandBuffer = null; + } + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + if (transform.hasChanged) + { + _RecalculateBounds = true; + } + } + + private protected override System.Action OnLateUpdateMethod => OnLateUpdate; + void OnLateUpdate(WaterRenderer water) + { + transform.hasChanged = false; + } + + internal bool Outdated => _CurrentStateHash != _RenderedStateHash; + + bool IsTextureOutdated(RenderTexture texture, bool target) + { + return texture != null && + texture.width != _Resolution || + texture.height != _Resolution || + texture.format != (target ? RenderTextureFormat.Depth : FinalFormat); + } + + RenderTextureFormat FinalFormat => _GenerateSignedDistanceField ? RenderTextureFormat.RGFloat : RenderTextureFormat.RFloat; + + void MakeRT(RenderTexture texture, bool target) + { + var format = target ? RenderTextureFormat.Depth : FinalFormat; + var descriptor = texture.descriptor; + descriptor.colorFormat = format; + descriptor.width = descriptor.height = _Resolution; + descriptor.depthBufferBits = target ? 24 : 0; + descriptor.useMipMap = false; + // Compute always requires this to write. + descriptor.enableRandomWrite = !target; + texture.descriptor = descriptor; + texture.Create(); + Debug.Assert(SystemInfo.SupportsRenderTextureFormat(format), "Crest: The graphics device does not support the render texture format " + format.ToString()); + } + + bool InitObjects() + { + if (RealtimeTexture == null) + { + RealtimeTexture = new RenderTexture(0, 0, 0) + { + name = $"_Crest_WaterDepthCache_{gameObject.name}", + anisoLevel = 0, + }; + } + else if (IsTextureOutdated(RealtimeTexture, target: false)) + { + RealtimeTexture.Release(); + } + + if (!RealtimeTexture.IsCreated()) + { + MakeRT(RealtimeTexture, false); + } + + if (_Layers == 0) + { + Debug.LogError("Crest: No valid layers for populating depth probe, aborting.", this); + return false; + } + + if (_Camera == null) + { + _Camera = new GameObject("_Crest_DepthProbeCamera").AddComponent(); + _Camera.transform.parent = transform; + _Camera.transform.localEulerAngles = 90f * Vector3.right; + _Camera.transform.localPosition = Vector3.zero; + _Camera.transform.localScale = Vector3.one; + _Camera.orthographic = true; + _Camera.clearFlags = CameraClearFlags.Depth; + _Camera.enabled = false; + _Camera.allowMSAA = false; + _Camera.allowDynamicResolution = false; + _Camera.depthTextureMode = DepthTextureMode.Depth; + // Stops behaviour from changing in VR. I tried disabling XR before/after camera render but it makes the editor + // go bonkers with split windows. + _Camera.cameraType = CameraType.Reflection; + // I'd prefer to destroy the camera object, but I found sometimes (on first start of editor) it will fail to render. + _Camera.gameObject.SetActive(false); + + this.Manage(_Camera.gameObject); + + if (RenderPipelineHelper.IsUniversal) + { +#if d_UnityURP + SetUpCameraURP(); +#endif + } + else if (RenderPipelineHelper.IsHighDefinition) + { +#if d_UnityHDRP + SetUpCameraHD(); +#endif + } + } + + // Always update. + _Camera.orthographicSize = Mathf.Max(Scale.x * 0.5f, Scale.y * 0.5f); + _Camera.cullingMask = _Layers; + _Camera.gameObject.hideFlags = _Debug._ShowHiddenObjects ? HideFlags.DontSave : HideFlags.HideAndDontSave; + + if (TargetTexture == null) + { + TargetTexture = new RenderTexture(0, 0, 0) + { + name = $"_Crest_WaterDepthTarget_{gameObject.name}", + }; + } + else if (IsTextureOutdated(TargetTexture, target: true)) + { + TargetTexture.Release(); + } + + if (!TargetTexture.IsCreated()) + { + MakeRT(TargetTexture, true); + } + + _Camera.targetTexture = TargetTexture; + + return true; + } + + /// + /// Populates the (including re-baking). + /// + /// + /// Call this method if using , or + /// if needing the probe to be updated re-baked (re-baking editor only). + /// + public void Populate() + { + if (_Type == DepthProbeMode.Baked) + { + OnBakeRequest?.Invoke(this); + } + else + { + ForcePopulate(); + } + } + + internal void ForcePopulate() + { + if (WaterRenderer.RunningWithoutGraphics) + { + // Don't bake in headless mode + Debug.LogWarning("Crest: Depth probe will not be populated at runtime when in batched/headless mode. Please pre-bake the probe in the Editor."); + return; + } + + // Make sure we have required objects. + if (!InitObjects()) + { + return; + } + + var oldShadowDistance = 0f; + + if (RenderPipelineHelper.IsLegacy) + { + // Stop shadow passes from executing. + oldShadowDistance = QualitySettings.shadowDistance; + QualitySettings.shadowDistance = 0f; + } + + _QualitySettingsOverride.Override(); + + OnBeforeRender?.Invoke(this); + + _CommandBuffer ??= new(); + _CommandBuffer.Clear(); + _CommandBuffer.name = "Crest.DepthProbe"; + +#if UNITY_EDITOR + try +#endif + { + // Capture pass. + RenderDepthIntoProbe(k_CopyKernel, _CaptureRange.y); + + if (_FillHolesCaptureHeight > 0f) + { + Graphics.ExecuteCommandBuffer(_CommandBuffer); + _CommandBuffer.Clear(); + + // Fill holes pass. + RenderDepthIntoProbe(k_FillKernel, _CaptureRange.y + _FillHolesCaptureHeight); + } + } +#if UNITY_EDITOR + // Ensure that any global settings are restored. + finally +#endif + { + _QualitySettingsOverride.Restore(); + + // Built-in only. + if (RenderPipelineHelper.IsLegacy) + { + QualitySettings.shadowDistance = oldShadowDistance; + } + + OnAfterRender?.Invoke(this); + } + + if (_GenerateSignedDistanceField) + { + _CommandBuffer.BeginSample("SDF"); + RenderSignedDistanceField(inverted: false); + RenderSignedDistanceField(inverted: true); + _CommandBuffer.EndSample("SDF"); + } + + Graphics.ExecuteCommandBuffer(_CommandBuffer); + + HashState(ref _RenderedStateHash); + } + + void RenderDepthIntoProbe(int kernel, float height) + { + _Camera.transform.position = Position + Vector3.up * height; + _Camera.farClipPlane = -_CaptureRange.x + height; + + if (Managed) + { + _Camera.transform.forward = Vector3.down; + } + else + { + // Face down maintaining Y rotation. + var transform = _Camera.transform; + var rotation = transform.parent == null ? transform.localEulerAngles.y : transform.parent.eulerAngles.y; + transform.forward = Vector3.down; + transform.eulerAngles = transform.eulerAngles.XNZ(rotation); + } + + RenderTexture backFaces = null; + if (_EnableBackFaceInclusion && kernel == k_FillKernel) + { + var target = _Camera.targetTexture; + // No need to clear as depth is cleared by camera. + backFaces = RenderTexture.GetTemporary(target.descriptor); + _Camera.targetTexture = backFaces; + + // Does not work for HDRP (handled elsewhere). + var oldInvertCulling = GL.invertCulling; + GL.invertCulling = true; + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + _HDAdditionalCameraData.invertFaceCulling = true; + } +#endif + + // Render scene, saving depths in depth buffer. +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + Helpers.RenderCameraWithoutCustomPasses(_Camera); + } + else +#endif + { + _Camera.Render(); + } + + _Camera.targetTexture = target; + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + _HDAdditionalCameraData.invertFaceCulling = false; + } +#endif + + GL.invertCulling = oldInvertCulling; + } + + // Render scene, saving depths in depth buffer. +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + Helpers.RenderCameraWithoutCustomPasses(_Camera); + } + else +#endif + { + _Camera.Render(); + } + + var wrapper = new PropertyWrapperCompute(_CommandBuffer, WaterResources.Instance.Compute._RenderDepthProbe, kernel); + + wrapper.SetFloat(ShaderIDs.s_HeightOffset, transform.position.y); + + // Zbuffer params + //float4 _ZBufferParams; // x: 1-far/near, y: far/near, z: x/far, w: y/far + float near = _Camera.nearClipPlane, far = _Camera.farClipPlane; + wrapper.SetVector(ShaderIDs.s_CustomZBufferParams, new(1f - far / near, far / near, (1f - far / near) / far, (far / near) / far)); + + // Altitudes for near and far planes + var ymax = _Camera.transform.position.y - near; + var ymin = ymax - far; + wrapper.SetVector(ShaderIDs.s_HeightNearHeightFar, new(ymax, ymin)); + + wrapper.SetTexture(ShaderIDs.s_CamDepthBuffer, _Camera.targetTexture); + wrapper.SetTexture(Crest.ShaderIDs.s_Target, RealtimeTexture); + + if (_EnableBackFaceInclusion && kernel == k_FillKernel) + { + near = _Camera.nearClipPlane; + far = _CaptureRange.x + _CaptureRange.y; + + // Altitudes for near and far planes. + ymax = transform.position.y + _CaptureRange.y - near; + wrapper.SetTexture(ShaderIDs.s_CameraDepthBufferBackfaces, backFaces); + wrapper.SetFloat(ShaderIDs.s_PreviousPlane, ymax + _Camera.nearClipPlane); + } + + wrapper.SetKeyword(WaterResources.Instance.Keywords.DepthProbeBackFaceInclusion, _EnableBackFaceInclusion); + + var threads = RealtimeTexture.width / Lod.k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, 1); + + _Camera.transform.localPosition = Vector3.zero; + + RenderTexture.ReleaseTemporary(backFaces); + } + + void RenderSignedDistanceField(bool inverted) + { + var shader = WaterResources.Instance.Compute._JumpFloodSDF; + + if (shader == null) + { + return; + } + + var buffer = _CommandBuffer; + + var cameraToWorldMatrix = _Camera.cameraToWorldMatrix; + var projectionMatrix = _Camera.projectionMatrix; + var projectionToWorldMatrix = cameraToWorldMatrix * projectionMatrix.inverse; + + // Common uniforms. + buffer.SetComputeFloatParam(shader, DepthLodInput.ShaderIDs.s_HeightOffset, transform.position.y); + buffer.SetComputeIntParam(shader, Crest.ShaderIDs.s_TextureSize, _Resolution); + buffer.SetComputeMatrixParam(shader, ShaderIDs.s_ProjectionToWorld, projectionToWorldMatrix); + + // Allow generating without water present. + { + var water = WaterRenderer.Instance; + var height = water != null ? water.SeaLevel : transform.position.y; + buffer.SetComputeFloatParam(shader, ShaderIDs.s_WaterLevel, height); + buffer.SetKeyword(shader, WaterResources.Instance.Keywords.JumpFloodStandalone, water == null); + } + + var descriptor = new RenderTextureDescriptor(_Resolution, _Resolution) + { + autoGenerateMips = false, + colorFormat = RenderTextureFormat.RGHalf, + useMipMap = false, + enableRandomWrite = true, + depthBufferBits = 0, + }; + + var voronoiPingPong0 = ShaderIDs.s_VoronoiPingPong0; + var voronoiPingPong1 = ShaderIDs.s_VoronoiPingPong1; + + // No need to clear both are always overwritten. + buffer.GetTemporaryRT(voronoiPingPong0, descriptor); + buffer.GetTemporaryRT(voronoiPingPong1, descriptor); + + buffer.SetKeyword(shader, WaterResources.Instance.Keywords.JumpFloodInverted, inverted); + + // Initialize. + { + var kernel = shader.FindKernel("CrestInitialize"); + + buffer.SetComputeTextureParam(shader, kernel, Crest.ShaderIDs.s_Source, RealtimeTexture); + buffer.SetComputeTextureParam(shader, kernel, Crest.ShaderIDs.s_Target, voronoiPingPong0); + buffer.DispatchCompute + ( + shader, + kernel, + RealtimeTexture.width / Lod.k_ThreadGroupSize, + RealtimeTexture.height / Lod.k_ThreadGroupSize, + 1 + ); + } + + // Jump Flood. + { + var kernel = shader.FindKernel("CrestExecute"); + + for (var jumpSize = _Resolution / 2; jumpSize > 0; jumpSize /= 2) + { + ApplyJumpFlood + ( + buffer, + shader, + kernel, + jumpSize, + voronoiPingPong0, + voronoiPingPong1 + ); + (voronoiPingPong0, voronoiPingPong1) = (voronoiPingPong1, voronoiPingPong0); + } + + for (var roundNum = 0; roundNum < _AdditionalJumpFloodRounds; roundNum++) + { + var jumpSize = 1 << roundNum; + ApplyJumpFlood + ( + buffer, + shader, + kernel, + jumpSize, + voronoiPingPong0, + voronoiPingPong1 + ); + (voronoiPingPong0, voronoiPingPong1) = (voronoiPingPong1, voronoiPingPong0); + } + } + + // Apply. + { + var kernel = shader.FindKernel("CrestApply"); + buffer.SetComputeTextureParam(shader, kernel, Crest.ShaderIDs.s_Source, voronoiPingPong0); + buffer.SetComputeTextureParam(shader, kernel, Crest.ShaderIDs.s_Target, RealtimeTexture); + buffer.DispatchCompute + ( + shader, + kernel, + _Resolution / Lod.k_ThreadGroupSize, + _Resolution / Lod.k_ThreadGroupSize, + 1 + ); + } + + buffer.ReleaseTemporaryRT(voronoiPingPong0); + buffer.ReleaseTemporaryRT(voronoiPingPong1); + } + + void ApplyJumpFlood + ( + CommandBuffer buffer, + ComputeShader shader, + int kernel, + int jumpSize, + RenderTargetIdentifier source, + RenderTargetIdentifier target + ) + { + buffer.SetComputeIntParam(shader, ShaderIDs.s_JumpSize, jumpSize); + buffer.SetComputeTextureParam(shader, kernel, Crest.ShaderIDs.s_Source, source); + buffer.SetComputeTextureParam(shader, kernel, Crest.ShaderIDs.s_Target, target); + buffer.DispatchCompute + ( + shader, + kernel, + _Resolution / Lod.k_ThreadGroupSize, + _Resolution / Lod.k_ThreadGroupSize, + 1 + ); + } + + void SetDirty(I previous, I current) where I : System.IEquatable + { + if (Equals(previous, current)) return; + HashState(ref _CurrentStateHash); + } + + // LayerMask does not implement IEquatable. + void SetDirty(LayerMask previous, LayerMask current) + { + if (previous == current) return; + HashState(ref _CurrentStateHash); + } + } + + // LodInput + partial class DepthProbe + { + Input _Input; + + /// + private protected override void Initialize() + { + base.Initialize(); + _Input ??= new(this); + ILodInput.Attach(_Input, DepthLod.s_Inputs); + HashState(ref _CurrentStateHash); + +#if CREST_DEBUG + if (_Debug._ShowSimulationDataInScene) + { + ILodInput.Attach(_Input, ClipLod.s_Inputs); + } +#endif + } + + /// + private protected override void OnDisable() + { + base.OnDisable(); + ILodInput.Detach(_Input, DepthLod.s_Inputs); + +#if CREST_DEBUG + if (_Debug._ShowSimulationDataInScene) + { + ILodInput.Detach(_Input, ClipLod.s_Inputs); + } +#endif + } + + sealed class Input : ILodInput + { + public bool Enabled => _Probe.enabled && _Probe.Texture != null; + public bool IsCompute => true; + public int Queue => 0; + public int Pass => -1; + public Rect Rect => _Probe.Rect; + public MonoBehaviour Component => _Probe; + public float Filter(WaterRenderer water, int slice) => 1f; + + readonly DepthProbe _Probe; + + public Input(DepthProbe probe) + { + _Probe = probe; + } + + public void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slices = -1) + { +#if CREST_DEBUG + if (lod is ClipLod) + { + var compute = new PropertyWrapperCompute(buffer, WaterResources.Instance.Compute._ClipPrimitive, 0); + + compute.SetMatrix(Crest.ShaderIDs.s_Matrix, Matrix4x4.TRS(_Probe.Position, _Probe.Rotation, _Probe.Scale.XNZ(100f)).inverse); + + // For culling. + compute.SetVector(Crest.ShaderIDs.s_Position, _Probe.Position); + compute.SetFloat(Crest.ShaderIDs.s_Diameter, _Probe.Scale.x); + + compute.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveInverted, false); + compute.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveSphere, false); + compute.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveCube, true); + compute.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveRectangle, false); + compute.SetTexture(Crest.ShaderIDs.s_Target, target); + compute.Dispatch(lod.Resolution / Lod.k_ThreadGroupSize, lod.Resolution / Lod.k_ThreadGroupSize, slices); + return; + } +#endif + + var resources = WaterResources.Instance; + var wrapper = new PropertyWrapperCompute(buffer, resources.Compute._DepthTexture, 0); + + var position = _Probe.Position; + var matrix = Matrix4x4.TRS(position, _Probe.Rotation, _Probe.Scale.XNZ(1f)); + + // Texture Input + wrapper.SetVector(Crest.ShaderIDs.s_TextureSize, _Probe.Scale); + wrapper.SetVector(Crest.ShaderIDs.s_TexturePosition, position.XZ()); + wrapper.SetVector(Crest.ShaderIDs.s_TextureRotation, new Vector2(matrix.m20, matrix.m00).normalized); + wrapper.SetVector(Crest.ShaderIDs.s_Multiplier, Vector4.one); + wrapper.SetInteger(Crest.ShaderIDs.s_Blend, (int)LodInputBlend.Maximum); + wrapper.SetTexture(Crest.ShaderIDs.s_Texture, _Probe.Texture); + wrapper.SetTexture(Crest.ShaderIDs.s_Target, target); + + // Depth Input + wrapper.SetFloat(DepthLodInput.ShaderIDs.s_HeightOffset, position.y); + wrapper.SetInteger(DepthLodInput.ShaderIDs.s_SDF, _Probe._GenerateSignedDistanceField ? 1 : 0); + wrapper.SetKeyword(resources.Keywords.DepthTextureSDF, lod._Water._DepthLod._EnableSignedDistanceFields); + + var threads = lod.Resolution / Lod.k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, slices); + } + } + } + + sealed partial class DepthProbe + { + // Hash is used to notify whether the probe is outdated in the UI. + int _RenderedStateHash; + int _CurrentStateHash; + + [System.Diagnostics.Conditional("UNITY_EDITOR")] + void HashState(ref int hash) + { + hash = Hash.CreateHash(); + Hash.AddInt(_Layers, ref hash); + Hash.AddInt(_Resolution, ref hash); + Hash.AddObject(_CaptureRange, ref hash); + Hash.AddFloat(_FillHolesCaptureHeight, ref hash); + Hash.AddObject(_QualitySettingsOverride, ref hash); + Hash.AddBool(_EnableBackFaceInclusion, ref hash); + Hash.AddInt(_AdditionalJumpFloodRounds, ref hash); + Hash.AddBool(_GenerateSignedDistanceField, ref hash); + Hash.AddObject(Managed ? Vector3.zero : Position, ref hash); + Hash.AddObject(Managed ? Quaternion.identity : Rotation, ref hash); + Hash.AddObject(Managed ? Vector2.zero : Scale, ref hash); + } + +#if UNITY_EDITOR + private protected override void OnValidate() + { + base.OnValidate(); + // OnChange has a bug (possibly with Unity) with LayerMask where it cannot detect changes. + HashState(ref _CurrentStateHash); + } + + [@OnChange] + void OnChange(string propertyPath, object oldValue) + { +#if CREST_DEBUG + ILodInput.Detach(_Input, ClipLod.s_Inputs); + if (_Debug._ShowSimulationDataInScene) + { + ILodInput.Attach(_Input, ClipLod.s_Inputs); + } +#endif + + if (_Camera == null) return; + _Camera.gameObject.hideFlags = _Debug._ShowHiddenObjects ? HideFlags.DontSave : HideFlags.HideAndDontSave; + } + + void Update() + { + if (_Debug._ForceAlwaysUpdateDebug && _Type != DepthProbeMode.Baked) + { + Populate(); + } + + if (transform.hasChanged) + { + HashState(ref _CurrentStateHash); + } + } +#endif + } + + partial class DepthProbe : ISerializationCallbackReceiver + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 1; +#pragma warning restore 414 + + /// + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + // Version 1 (2024.06.04) + // - Added new capture options replacing Maximum Height's behaviour. + if (_Version < 1) + { + _CaptureRange.y = _FillHolesCaptureHeight; + _FillHolesCaptureHeight = 0f; + _Version = 1; + } + } + + /// + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.cs.meta new file mode 100644 index 0000000..54a516d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Probe/DepthProbe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70deb49b538e247b9ab1bf7773d16809 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 300 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/RendererLodInputData.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/RendererLodInputData.cs new file mode 100644 index 0000000..1fbce1c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/RendererLodInputData.cs @@ -0,0 +1,262 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.SceneManagement; + +namespace WaveHarmonic.Crest +{ + /// + /// Data storage for for the Renderer input mode. + /// + public abstract partial class RendererLodInputData : LodInputData + { + [Tooltip("The renderer to use for this input.\n\nCan be anything that inherits from Renderer like MeshRenderer, TrailRenderer etc.")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + internal Renderer _Renderer; + + [Tooltip("Forces the renderer to only render into the LOD data, and not to render in the scene as it normally would.")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + internal bool _DisableRenderer = true; + + [Tooltip("Whether to set the shader pass manually.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _OverrideShaderPass; + + [Tooltip("The shader pass to execute.\n\nSet to -1 to execute all passes.")] + [@Predicated(nameof(_OverrideShaderPass))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal int _ShaderPassIndex; + +#pragma warning disable 414 + [Tooltip("Check that the shader applied to this object matches the input type.\n\nFor example, an Animated Waves input object has an Animated Waves input shader.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _CheckShaderName = true; + + [Tooltip("Check that the shader applied to this object has only a single pass, as only the first pass is executed for most inputs.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _CheckShaderPasses = true; +#pragma warning restore 414 + + + // Some renderers require multiple materials like particles with trails. + // We pass this to GetSharedMaterials to avoid allocations. + internal List _Materials = new(); + MaterialPropertyBlock _MaterialPropertyBlock; + + internal abstract string ShaderPrefix { get; } + + internal override bool IsEnabled => _Renderer != null && _MaterialPropertyBlock != null; + + internal override void RecalculateRect() + { + _Rect = Rect.MinMaxRect(_Renderer.bounds.min.x, _Renderer.bounds.min.z, _Renderer.bounds.max.x, _Renderer.bounds.max.z); + } + + internal override void RecalculateBounds() + { + _Bounds = _Renderer.bounds; + } + + bool AnyOtherInputsControllingRenderer(Renderer renderer) + { + for (var index = 0; index < SceneManager.sceneCount; index++) + { + var scene = SceneManager.GetSceneAt(index); + + if (!scene.isLoaded) + { + continue; + } + + foreach (var rootGameObject in scene.GetRootGameObjects()) + { + foreach (var component in rootGameObject.GetComponentsInChildren()) + { + if (component == _Input) + { + continue; + } + + if (component.Data is not RendererLodInputData data) + { + continue; + } + + if (component.isActiveAndEnabled && data._DisableRenderer && data._Renderer == renderer) + { + return true; + } + } + } + } + + return false; + } + + internal override void OnEnable() + { + _MaterialPropertyBlock ??= new(); + + if (_Renderer == null) + { + return; + } + + _Renderer.GetSharedMaterials(_Materials); + + if (_DisableRenderer) + { + // If we disable using "enabled" then the renderer might not behave correctly (eg line/trail positions + // will not be updated). This keeps the scripting side of the component running and just disables the + // rendering. Similar to disabling the Renderer module on the Particle System. It also is not serialized. + _Renderer.forceRenderingOff = true; + } + } + + internal override void OnDisable() + { + if (_Renderer != null && _DisableRenderer && !AnyOtherInputsControllingRenderer(_Renderer)) + { + _Renderer.forceRenderingOff = false; + } + } + + internal override void OnUpdate() + { + if (_Renderer == null) + { + return; + } + + // We have to check this every time as the user could change the materials and it is too difficult to track. + // Doing this in LateUpdate could add one frame latency to receiving the change. + _Renderer.GetSharedMaterials(_Materials); + + // Always recalculate, as there are too much to track. + _RecalculateBounds = true; + _RecalculateRect = _Bounds != _Renderer.bounds; + } + + internal override void Draw(Lod lod, Component component, CommandBuffer buffer, RenderTargetIdentifier target, int slice) + { + // NOTE: Inputs will only change the first material (only ShapeWaves at the moment). + + for (var i = 0; i < _Materials.Count; i++) + { + var material = _Materials[i]; + Debug.AssertFormat(material != null, _Renderer, "Crest: Attached renderer has an empty material slot which is not allowed."); + +#if UNITY_EDITOR + // Empty material slots is a user error, but skip so we do not spam errors. + if (material == null) + { + continue; + } +#endif + + // BIRP/URP SG first pass is the right one. + // HDRP SG does not support matrix override, but users can just use BIRP instead. + var pass = 0; + + if (ShapeWaves.s_RenderPassOverride > -1) + { + // Needs to use a second pass to disable blending. + pass = ShapeWaves.s_RenderPassOverride; + } + else if (_OverrideShaderPass) + { + pass = _ShaderPassIndex; + } + + if (pass > material.shader.passCount - 1) + { + return; + } + + // Time is not set for us for some reason… Use Time.timeSinceLevelLoad as per: + // https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html + if (RenderPipelineHelper.IsLegacy || RenderPipelineHelper.IsHighDefinition) + { + _Renderer.GetPropertyBlock(_MaterialPropertyBlock); + _MaterialPropertyBlock.SetVector(ShaderIDs.Unity.s_Time, new + ( + Time.timeSinceLevelLoad / 20, + Time.timeSinceLevelLoad, + Time.timeSinceLevelLoad * 2f, + Time.timeSinceLevelLoad * 3f + )); + _Renderer.SetPropertyBlock(_MaterialPropertyBlock); + } + + // By default, shaderPass is -1 which is all passes. Shader Graph will produce multi-pass shaders + // for depth etc so we should only render one pass. Unlit SG will have the unlit pass first. + // Submesh count generally must equal number of materials. + buffer.DrawRenderer(_Renderer, material, submeshIndex: i, pass); + } + } + + void SetRenderer(Renderer previous, Renderer current) + { + if (previous == current) return; + if (_Input == null || !_Input.isActiveAndEnabled) return; + + if (previous != null && _DisableRenderer && !AnyOtherInputsControllingRenderer(previous)) + { + // Turn off if there are no other inputs have set this value. + previous.forceRenderingOff = false; + } + + if (current != null) + { + current.forceRenderingOff = true; + } + } + + void SetDisableRenderer(bool previous, bool current) + { + if (previous == current) return; + if (_Input == null || !_Input.isActiveAndEnabled) return; + + if (_Renderer != null && !AnyOtherInputsControllingRenderer(_Renderer)) + { + _Renderer.forceRenderingOff = _DisableRenderer; + } + } + +#if UNITY_EDITOR + [@OnChange] + internal override void OnChange(string propertyPath, object previousValue) + { + switch (propertyPath) + { + case nameof(_Renderer): + SetRenderer((Renderer)previousValue, _Renderer); + break; + case nameof(_DisableRenderer): + SetDisableRenderer((bool)previousValue, _DisableRenderer); + break; + } + } + + internal override bool InferMode(Component component, ref LodInputMode mode) + { + if (component.TryGetComponent(out _Renderer)) + { + mode = LodInputMode.Renderer; + return true; + } + + return false; + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/RendererLodInputData.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/RendererLodInputData.cs.meta new file mode 100644 index 0000000..06cfaa2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/RendererLodInputData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0ee0dbacf6784d1a8608ad94109098d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ScatteringLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ScatteringLodInput.cs new file mode 100644 index 0000000..ab37d95 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ScatteringLodInput.cs @@ -0,0 +1,37 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this to objects that you want to influence the scattering color. + /// + [@HelpURL("Manual/WaterAppearance.html#volume-color-inputs")] + public sealed partial class ScatteringLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if d_CrestPaint + internal override LodInputMode DefaultMode => LodInputMode.Paint; +#else + internal override LodInputMode DefaultMode => LodInputMode.Renderer; +#endif + + internal override void InferBlend() + { + base.InferBlend(); + _Blend = LodInputBlend.Alpha; + } + + // Looks fine moving around. + private protected override bool FollowHorizontalMotion => true; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ScatteringLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ScatteringLodInput.cs.meta new file mode 100644 index 0000000..772f216 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ScatteringLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c85179d3b43c5467da99463c8a2199ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ShadowLodInput.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ShadowLodInput.cs new file mode 100644 index 0000000..8d989a2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ShadowLodInput.cs @@ -0,0 +1,24 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Registers a custom input to the . + /// + /// + /// Attach this objects that you want use to override shadows. + /// + [@HelpURL("Manual/WaterAppearance.html#shadows-lod")] + public sealed partial class ShadowLodInput : LodInput + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + internal override LodInputMode DefaultMode => LodInputMode.Renderer; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ShadowLodInput.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ShadowLodInput.cs.meta new file mode 100644 index 0000000..8676123 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/ShadowLodInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fcda6c7640ad44106aa39234017df797 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape.meta new file mode 100644 index 0000000..ec3c168 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d7eafa182f969495d9e74b145310c516 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeFFT.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeFFT.cs new file mode 100644 index 0000000..1cbed83 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeFFT.cs @@ -0,0 +1,292 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + /// + /// FFT wave shape. + /// + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Shape FFT")] + public sealed partial class ShapeFFT : ShapeWaves + { + // Waves + + [Tooltip("Whether to use the wind turbulence on this component rather than the global wind turbulence.\n\nGlobal wind turbulence comes from the Water Renderer component.")] + [@GenerateAPI] + [@InlineToggle(order = -3), SerializeField] + bool _OverrideGlobalWindTurbulence; + + [Tooltip("How turbulent/chaotic the waves are.")] + [@Predicated(nameof(_OverrideGlobalWindTurbulence), hide: true)] + [@ShowComputedProperty(nameof(WindTurbulence))] + [@Range(0, 1, order = -4)] + [@GenerateAPI(Getter.Custom)] + [SerializeField] + float _WindTurbulence = 0.145f; + + [Tooltip("How aligned the waves are with wind.")] + [@Range(0, 1, order = -5)] + [@GenerateAPI] + [SerializeField] + float _WindAlignment; + + + // Generation + + [Tooltip("FFT waves will loop with a period of this many seconds.")] + [@Range(4f, 128f, Range.Clamp.Minimum)] + [@GenerateAPI] + [SerializeField] + float _TimeLoopLength = Mathf.Infinity; + + + [Header("Culling")] + + [Tooltip("Maximum amount the surface will be displaced vertically from sea level.\n\nIncrease this if gaps appear at bottom of screen.")] + [@GenerateAPI] + [SerializeField] + float _MaximumVerticalDisplacement = 10f; + + [Tooltip("Maximum amount a point on the surface will be displaced horizontally by waves from its rest position.\n\nIncrease this if gaps appear at sides of screen.")] + [@GenerateAPI] + [SerializeField] + float _MaximumHorizontalDisplacement = 15f; + + + [@Heading("Collision Data Baking")] + +#if !d_WaveHarmonic_Crest_CPUQueries + [HideInInspector] +#endif + + [Tooltip("Enable running this FFT with baked data.\n\nThis makes the FFT periodic (repeating in time).")] + [@Predicated(nameof(_Mode), inverted: true, nameof(LodInputMode.Global), hide: true)] + [@DecoratedField, SerializeField] + internal bool _EnableBakedCollision = false; + +#if !d_WaveHarmonic_Crest_CPUQueries + [HideInInspector] +#endif + + [Tooltip("Frames per second of baked data.\n\nLarger values may help the collision track the surface closely at the cost of more frames and increase baked data size.")] + [@Predicated(nameof(_EnableBakedCollision))] + [@Predicated(nameof(_Mode), inverted: true, nameof(LodInputMode.Global), hide: true)] + [@DecoratedField, SerializeField] + internal int _TimeResolution = 4; + +#if !d_WaveHarmonic_Crest_CPUQueries + [HideInInspector] +#endif + + [Tooltip("Smallest wavelength required in collision.\n\nTo preview the effect of this, disable power sliders in spectrum for smaller values than this number. Smaller values require more resolution and increase baked data size.")] + [@Predicated(nameof(_EnableBakedCollision))] + [@Predicated(nameof(_Mode), inverted: true, nameof(LodInputMode.Global), hide: true)] + [@DecoratedField, SerializeField] + internal float _SmallestWavelengthRequired = 2f; + +#if !d_WaveHarmonic_Crest_CPUQueries + [HideInInspector] +#endif + + [Tooltip("FFT waves will loop with a period of this many seconds.\n\nSmaller values decrease data size but can make waves visibly repetitive.")] + [@Predicated(nameof(_EnableBakedCollision))] + [@Predicated(nameof(_Mode), inverted: true, nameof(LodInputMode.Global), hide: true)] + [@Range(4f, 128f)] + [SerializeField] + internal float _BakedTimeLoopLength = 32f; + + internal float LoopPeriod => +#if d_WaveHarmonic_Crest_CPUQueries + _EnableBakedCollision ? _BakedTimeLoopLength : +#endif + _TimeLoopLength; + + private protected override int MinimumResolution => 16; + private protected override int MaximumResolution => int.MaxValue; + + FFTCompute _FFTCompute; + + FFTCompute.Parameters _OldFFTParameters; + internal FFTCompute.Parameters GetFFTParameters(float gravity) => new + ( + _ActiveSpectrum, + Resolution, + _TimeLoopLength, + WindSpeedMPS, + WindDirRadForFFT, + WindTurbulence, + _WindAlignment, + gravity + ); + + private protected override void OnUpdate(WaterRenderer water) + { + base.OnUpdate(water); + + // We do not filter FFTs. + _FirstCascade = 0; + _LastCascade = k_CascadeCount - 1; + + ReportMaxDisplacement(water); + + // If geometry is being used, the water input shader will rotate the waves to align to geo + var parameters = GetFFTParameters(water.Gravity); + + // Don't create tons of generators when values are varying. Notify so that existing generators may be adapted. + if (parameters.GetHashCode() != _OldFFTParameters.GetHashCode()) + { + FFTCompute.OnGenerationDataUpdated(_OldFFTParameters, parameters); + } + +#if UNITY_EDITOR + _FFTCompute = FFTCompute.GetInstance(parameters); +#endif + + _OldFFTParameters = parameters; + } + + internal override void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) + { + if (_LastGenerateFrameCount != Time.frameCount) + { + // Parameters will unlikely change as our Update is called in LateUpdate with Draw + // not too far after. + var parameters = GetFFTParameters(lod.Water.Gravity); + + _WaveBuffers = FFTCompute.GenerateDisplacements + ( + buffer, + lod.Water.CurrentTime, + parameters, + UpdateDataEachFrame + ); + +#if UNITY_EDITOR + _FFTCompute = FFTCompute.GetInstance(parameters); +#endif + + _LastGenerateFrameCount = Time.frameCount; + } + + base.Draw(lod, buffer, target, pass, weight, slice); + } + + private protected override void SetRenderParameters(WaterRenderer water, T wrapper) + { + base.SetRenderParameters(water, wrapper); + + // If using geometry, the primary wave direction is used by the input shader to + // rotate the waves relative to the geo rotation. If not, the wind direction is + // already used in the FFT generation. + var waveDir = (Mode is LodInputMode.Spline or LodInputMode.Paint) ? PrimaryWaveDirection : Vector2.right; + wrapper.SetVector(ShaderIDs.s_AxisX, waveDir); + } + + private protected override void ReportMaxDisplacement(WaterRenderer water) + { + if (!Enabled) return; + + // Apply weight or will cause popping due to scale change. + MaximumReportedHorizontalDisplacement = _MaximumHorizontalDisplacement * Weight; + MaximumReportedVerticalDisplacement = MaximumReportedWavesDisplacement = _MaximumVerticalDisplacement * Weight; + + if (Mode == LodInputMode.Global) + { + water.ReportMaximumDisplacement(MaximumReportedHorizontalDisplacement, MaximumReportedVerticalDisplacement, MaximumReportedVerticalDisplacement); + } + } + + float WindDirRadForFFT + { + get + { + // These input types use a wave direction provided by geometry or the painted user direction + if (Mode is LodInputMode.Spline or LodInputMode.Paint) + { + return 0f; + } + + return WaveDirectionHeadingAngle * Mathf.Deg2Rad; + } + } + + float GetWindTurbulence() + { + return _OverrideGlobalWindTurbulence || WaterRenderer.Instance == null ? _WindTurbulence : WaterRenderer.Instance.WindTurbulence; + } + +#if UNITY_EDITOR + void OnGUI() + { + if (_DrawSlicesInEditor) + { + _FFTCompute?.OnGUI(); + } + } +#endif + } + + partial class ShapeFFT + { + static int s_InstanceCount; + + private protected override void Awake() + { + base.Awake(); + s_InstanceCount++; + } + + private protected override void OnDestroy() + { + base.OnDestroy(); + + if (--s_InstanceCount <= 0) + { + FFTCompute.CleanUpAll(); + } + } + } + + partial class ShapeFFT : ISerializationCallbackReceiver + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 2; +#pragma warning restore 414 + + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + _Version = MigrateV1(_Version); + + if (_Version < 2) + { + _OverrideGlobalWindTurbulence = true; + } + + _Version = MigrateV2(_Version); + } + + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + // Empty. + } + } + +#if UNITY_EDITOR + partial class ShapeFFT + { + private protected override void Reset() + { + base.Reset(); + + if (_Mode != LodInputMode.Global) + { + _OverrideGlobalWindTurbulence = true; + } + } + } +#endif +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeFFT.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeFFT.cs.meta new file mode 100644 index 0000000..edb82fe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeFFT.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88bb6e05d83b64105a4d8cbd478f5916 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeGerstner.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeGerstner.cs new file mode 100644 index 0000000..de3179a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeGerstner.cs @@ -0,0 +1,654 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using Unity.Collections.LowLevel.Unsafe; +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Gerstner wave shape. + /// + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Shape Gerstner")] + public sealed partial class ShapeGerstner : ShapeWaves + { + // Waves + + [@Space(10)] + + [Tooltip("Use a swell spectrum as the default.\n\nUses a swell spectrum as default (when none is assigned), and disabled reverse waves.")] + [@GenerateAPI] + [@DecoratedField(order = -3), SerializeField] + bool _Swell = true; + + [Tooltip("The weight of the opposing, second pair of Gerstner waves.\n\nEach Gerstner wave is actually a pair of waves travelling in opposite directions (similar to FFT). This weight is applied to the wave travelling in against-wind direction. Set to zero to obtain simple single waves which are useful for shorelines waves.")] + [Predicated(nameof(_Swell), inverted: true)] + [@Range(0f, 1f, order = -4)] + [@GenerateAPI(Getter.Custom)] + [SerializeField] + float _ReverseWaveWeight = 0.5f; + + + // Generation Settings + + [Tooltip("How many wave components to generate in each octave.")] + [@Delayed] + [@GenerateAPI] + [SerializeField] + int _ComponentsPerOctave = 8; + + [Tooltip("Change to get a different set of waves.")] + [@GenerateAPI] + [SerializeField] + int _RandomSeed = 0; + + [Tooltip("Prevent data arrays from being written to so one can provide their own.")] + [@GenerateAPI] + [SerializeField] + bool _ManualGeneration; + + private protected override int MinimumResolution => 8; + private protected override int MaximumResolution => 64; + + float _WindSpeedWhenGenerated = -1f; + + const int k_MaximumWaveComponents = 1024; + + // Data for all components + + /// + /// Wavelengths. Requires Manual Generation to be enabled. + /// + [System.NonSerialized] + public float[] _Wavelengths; + + /// + /// Amplitudes. Requires Manual Generation to be enabled. + /// + [System.NonSerialized] + public float[] _Amplitudes; + + /// + /// Powers. Requires Manual Generation to be enabled. + /// + [System.NonSerialized] + public float[] _Powers; + + /// + /// Angles. Requires Manual Generation to be enabled. + /// + [System.NonSerialized] + public float[] _AngleDegrees; + + /// + /// Phases. Requires Manual Generation to be enabled. + /// + [System.NonSerialized] + public float[] _Phases; + + // Reverse. + float[] _Amplitudes2; + float[] _Phases2; + + struct GerstnerCascadeParams + { + public int _StartIndex; + } + ComputeBuffer _BufferCascadeParameters; + readonly GerstnerCascadeParams[] _CascadeParameters = new GerstnerCascadeParams[k_CascadeCount + 1]; + + // Caution - order here impact performance. Rearranging these to match order + // they're read in the compute shader made it 50% slower.. + struct GerstnerWaveComponent4 + { + public Vector4 _TwoPiOverWavelength; + public Vector4 _Amplitude; + public Vector4 _WaveDirectionX; + public Vector4 _WaveDirectionZ; + public Vector4 _Omega; + public Vector4 _Phase; + public Vector4 _ChopAmplitude; + // Waves are generated in pairs, these values are for the second in the pair + public Vector4 _Amplitude2; + public Vector4 _ChopAmplitude2; + public Vector4 _Phase2; + } + ComputeBuffer _BufferWaveData; + readonly GerstnerWaveComponent4[] _WaveData = new GerstnerWaveComponent4[k_MaximumWaveComponents / 4]; + + ComputeShader _ShaderGerstner; + int _KernelGerstner = -1; + + private protected override WaveSpectrum DefaultSpectrum => _Swell ? SwellSpectrum : WindSpectrum; + static WaveSpectrum s_SwellSpectrum; + static WaveSpectrum SwellSpectrum + { + get + { + if (s_SwellSpectrum == null) + { + s_SwellSpectrum = ScriptableObject.CreateInstance(); + s_SwellSpectrum.name = "Swell Waves (auto)"; + s_SwellSpectrum.hideFlags = HideFlags.DontSave | HideFlags.NotEditable; + s_SwellSpectrum._PowerDisabled[0] = true; + s_SwellSpectrum._PowerDisabled[1] = true; + s_SwellSpectrum._PowerDisabled[2] = true; + s_SwellSpectrum._PowerDisabled[3] = true; + s_SwellSpectrum._PowerDisabled[4] = true; + s_SwellSpectrum._PowerDisabled[5] = true; + s_SwellSpectrum._PowerDisabled[6] = true; + s_SwellSpectrum._PowerDisabled[7] = true; + s_SwellSpectrum._WaveDirectionVariance = 15f; + s_SwellSpectrum._Chop = 1.3f; + } + + return s_SwellSpectrum; + } + } + + + static new class ShaderIDs + { + public static readonly int s_FirstCascadeIndex = Shader.PropertyToID("_Crest_FirstCascadeIndex"); + public static readonly int s_TextureRes = Shader.PropertyToID("_Crest_TextureRes"); + public static readonly int s_CascadeParams = Shader.PropertyToID("_Crest_GerstnerCascadeParams"); + public static readonly int s_GerstnerWaveData = Shader.PropertyToID("_Crest_GerstnerWaveData"); + } + + + readonly float _TwoPi = 2f * Mathf.PI; + readonly float _ReciprocalTwoPi = 1f / (2f * Mathf.PI); + + internal static readonly SortedList s_Instances = new(Helpers.SiblingIndexComparison); + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void InitStatics() + { + s_Instances.Clear(); + } + + float GetReverseWaveWeight() + { + return _Swell ? 0f : _ReverseWaveWeight; + } + + void InitData() + { + if (_WaveBuffers == null) + { + _WaveBuffers = new(_Resolution, _Resolution, 0, GraphicsFormat.R16G16B16A16_SFloat); + } + else + { + _WaveBuffers.Release(); + } + + { + _WaveBuffers.width = _WaveBuffers.height = _Resolution; + _WaveBuffers.wrapMode = TextureWrapMode.Clamp; + _WaveBuffers.antiAliasing = 1; + _WaveBuffers.filterMode = FilterMode.Bilinear; + _WaveBuffers.anisoLevel = 0; + _WaveBuffers.useMipMap = false; + _WaveBuffers.name = "_Crest_GerstnerCascades"; + _WaveBuffers.dimension = TextureDimension.Tex2DArray; + _WaveBuffers.volumeDepth = k_CascadeCount; + _WaveBuffers.enableRandomWrite = true; + _WaveBuffers.Create(); + } + + _BufferCascadeParameters?.Release(); + _BufferWaveData?.Release(); + + _BufferCascadeParameters = new(k_CascadeCount + 1, UnsafeUtility.SizeOf()); + _BufferWaveData = new(k_MaximumWaveComponents / 4, UnsafeUtility.SizeOf()); + + _ShaderGerstner = WaterResources.Instance.Compute._Gerstner; + _KernelGerstner = _ShaderGerstner.FindKernel("Gerstner"); + } + + private protected override void OnUpdate(WaterRenderer water) + { + var isFirstUpdate = _FirstUpdate; + + base.OnUpdate(water); + + if (_WaveBuffers == null || _Resolution != _WaveBuffers.width || _BufferCascadeParameters == null || _BufferWaveData == null) + { + InitData(); + } + + var windSpeed = WindSpeedMPS; + if (isFirstUpdate || UpdateDataEachFrame || windSpeed != _WindSpeedWhenGenerated) + { + UpdateWaveData(water, windSpeed); + _WindSpeedWhenGenerated = windSpeed; + } + + ReportMaxDisplacement(water); + } + + internal override void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) + { + if (_LastGenerateFrameCount != Time.frameCount) + { + if (_FirstCascade >= 0 && _LastCascade >= 0) + { + UpdateGenerateWaves(buffer); + // Above changes the render target. Change it back if necessary. + if (!IsCompute) CoreUtils.SetRenderTarget(buffer, target, depthSlice: slice); + } + + _LastGenerateFrameCount = Time.frameCount; + } + + base.Draw(lod, buffer, target, pass, weight, slice); + } + + private protected override void SetRenderParameters(WaterRenderer water, T wrapper) + { + base.SetRenderParameters(water, wrapper); + wrapper.SetVector(ShapeWaves.ShaderIDs.s_AxisX, PrimaryWaveDirection); + } + + void SliceUpWaves(WaterRenderer water, float windSpeed) + { + // Do not filter cascades if blending as the blend operation might be skipped. + // Same for renderer as we do not know the blend operation. + var isFilterable = Blend != LodInputBlend.Alpha && _Mode != LodInputMode.Renderer; + + _FirstCascade = isFilterable ? -1 : 0; + _LastCascade = -2; + + var cascadeIdx = 0; + var componentIdx = 0; + var outputIdx = 0; + _CascadeParameters[0]._StartIndex = 0; + + if (_ManualGeneration) + { + for (var i = 0; i < _WaveData.Length; i++) + { + _WaveData[i]._Phase2 = Vector4.zero; + _WaveData[i]._Amplitude2 = Vector4.zero; + _WaveData[i]._ChopAmplitude2 = Vector4.zero; + } + } + + // Seek forward to first wavelength that is big enough to render into current cascades + var minWl = MinWavelength(cascadeIdx); + while (componentIdx < _Wavelengths.Length && _Wavelengths[componentIdx] < minWl) + { + componentIdx++; + } + //Debug.Log($"Crest: {cascadeIdx}: start {_cascadeParams[cascadeIdx]._startIndex} minWL {minWl}"); + + for (; componentIdx < _Wavelengths.Length; componentIdx++) + { + // Skip small amplitude waves + while (componentIdx < _Wavelengths.Length && _Amplitudes[componentIdx] < 0.001f) + { + componentIdx++; + } + if (componentIdx >= _Wavelengths.Length) break; + + // Check if we need to move to the next cascade + while (cascadeIdx < k_CascadeCount && _Wavelengths[componentIdx] >= 2f * minWl) + { + // Wrap up this cascade and begin next + + // Fill remaining elements of current vector4 with 0s + var vi = outputIdx / 4; + var ei = outputIdx - vi * 4; + + while (ei != 0) + { + _WaveData[vi]._TwoPiOverWavelength[ei] = 1f; + _WaveData[vi]._Amplitude[ei] = 0f; + _WaveData[vi]._WaveDirectionX[ei] = 0f; + _WaveData[vi]._WaveDirectionZ[ei] = 0f; + _WaveData[vi]._Omega[ei] = 0f; + _WaveData[vi]._Phase[ei] = 0f; + _WaveData[vi]._ChopAmplitude[ei] = 0f; + if (!_ManualGeneration) + { + _WaveData[vi]._Phase2[ei] = 0f; + _WaveData[vi]._Amplitude2[ei] = 0f; + _WaveData[vi]._ChopAmplitude2[ei] = 0f; + } + ei = (ei + 1) % 4; + outputIdx++; + } + + if (outputIdx > 0 && _FirstCascade < 0) _FirstCascade = cascadeIdx; + + cascadeIdx++; + _CascadeParameters[cascadeIdx]._StartIndex = outputIdx / 4; + minWl *= 2f; + + //Debug.Log($"Crest: {cascadeIdx}: start {_cascadeParams[cascadeIdx]._startIndex} minWL {minWl}"); + } + if (cascadeIdx == k_CascadeCount) break; + + { + // Pack into vector elements + var vi = outputIdx / 4; + var ei = outputIdx - vi * 4; + + _WaveData[vi]._Amplitude[ei] = _Amplitudes[componentIdx]; + + var chopScale = _ActiveSpectrum._ChopScales[componentIdx / _ComponentsPerOctave]; + _WaveData[vi]._ChopAmplitude[ei] = -chopScale * _ActiveSpectrum._Chop * _Amplitudes[componentIdx]; + + if (!_ManualGeneration) + { + _WaveData[vi]._Amplitude2[ei] = _Amplitudes2[componentIdx]; + _WaveData[vi]._ChopAmplitude2[ei] = -chopScale * _ActiveSpectrum._Chop * _Amplitudes2[componentIdx]; + } + + var angle = Mathf.Deg2Rad * _AngleDegrees[componentIdx]; + var dx = Mathf.Cos(angle); + var dz = Mathf.Sin(angle); + + var gravityScale = _ActiveSpectrum._GravityScales[componentIdx / _ComponentsPerOctave]; + var gravity = water.Gravity * _ActiveSpectrum._GravityScale; + var c = Mathf.Sqrt(_Wavelengths[componentIdx] * gravity * gravityScale * _ReciprocalTwoPi); + var k = _TwoPi / _Wavelengths[componentIdx]; + + // Constrain wave vector (wavelength and wave direction) to ensure wave tiles across domain + { + var kx = k * dx; + var kz = k * dz; + var diameter = 0.5f * (1 << cascadeIdx); + + // Number of times wave repeats across domain in x and z + var n = kx / (_TwoPi / diameter); + var m = kz / (_TwoPi / diameter); + // Ensure the wave repeats an integral number of times across domain + kx = _TwoPi * Mathf.Round(n) / diameter; + kz = _TwoPi * Mathf.Round(m) / diameter; + + // Compute new wave vector and direction + k = Mathf.Sqrt(kx * kx + kz * kz); + dx = kx / k; + dz = kz / k; + } + + _WaveData[vi]._TwoPiOverWavelength[ei] = k; + _WaveData[vi]._WaveDirectionX[ei] = dx; + _WaveData[vi]._WaveDirectionZ[ei] = dz; + + // Repeat every 2pi to keep angle bounded - helps precision on 16bit platforms + _WaveData[vi]._Omega[ei] = k * c; + _WaveData[vi]._Phase[ei] = Mathf.Repeat(_Phases[componentIdx], Mathf.PI * 2f); + + if (!_ManualGeneration) + { + _WaveData[vi]._Phase2[ei] = Mathf.Repeat(_Phases2[componentIdx], Mathf.PI * 2f); + } + + outputIdx++; + } + } + + _LastCascade = isFilterable ? cascadeIdx : k_CascadeCount - 1; + + { + // Fill remaining elements of current vector4 with 0s + var vi = outputIdx / 4; + var ei = outputIdx - vi * 4; + + while (ei != 0) + { + _WaveData[vi]._TwoPiOverWavelength[ei] = 1f; + _WaveData[vi]._Amplitude[ei] = 0f; + _WaveData[vi]._WaveDirectionX[ei] = 0f; + _WaveData[vi]._WaveDirectionZ[ei] = 0f; + _WaveData[vi]._Omega[ei] = 0f; + _WaveData[vi]._Phase[ei] = 0f; + _WaveData[vi]._ChopAmplitude[ei] = 0f; + if (!_ManualGeneration) + { + _WaveData[vi]._Phase2[ei] = 0f; + _WaveData[vi]._Amplitude2[ei] = 0f; + _WaveData[vi]._ChopAmplitude2[ei] = 0f; + } + ei = (ei + 1) % 4; + outputIdx++; + } + } + + while (cascadeIdx < k_CascadeCount) + { + cascadeIdx++; + minWl *= 2f; + _CascadeParameters[cascadeIdx]._StartIndex = outputIdx / 4; + //Debug.Log($"Crest: {cascadeIdx}: start {_cascadeParams[cascadeIdx]._startIndex} minWL {minWl}"); + } + + _BufferCascadeParameters.SetData(_CascadeParameters); + _BufferWaveData.SetData(_WaveData); + } + + void UpdateGenerateWaves(CommandBuffer buf) + { + // Clear existing waves or they could get copied. + CoreUtils.SetRenderTarget(buf, _WaveBuffers, ClearFlag.Color); + buf.SetComputeFloatParam(_ShaderGerstner, ShaderIDs.s_TextureRes, _WaveBuffers.width); + buf.SetComputeIntParam(_ShaderGerstner, ShaderIDs.s_FirstCascadeIndex, _FirstCascade); + buf.SetComputeBufferParam(_ShaderGerstner, _KernelGerstner, ShaderIDs.s_CascadeParams, _BufferCascadeParameters); + buf.SetComputeBufferParam(_ShaderGerstner, _KernelGerstner, ShaderIDs.s_GerstnerWaveData, _BufferWaveData); + buf.SetComputeTextureParam(_ShaderGerstner, _KernelGerstner, ShapeWaves.ShaderIDs.s_WaveBuffer, _WaveBuffers); + + buf.DispatchCompute(_ShaderGerstner, _KernelGerstner, _WaveBuffers.width / Lod.k_ThreadGroupSizeX, _WaveBuffers.height / Lod.k_ThreadGroupSizeY, _LastCascade - _FirstCascade + 1); + } + + /// + /// Resamples wave spectrum + /// + /// The water renderer. + /// Wind speed in m/s + void UpdateWaveData(WaterRenderer water, float windSpeed) + { + if (_ManualGeneration) + { + if (_Wavelengths != null) + { + SliceUpWaves(water, windSpeed); + } + + return; + } + + // Set random seed to get repeatable results + var randomStateBkp = Random.state; + Random.InitState(_RandomSeed); + + _ActiveSpectrum.GenerateWaveData(_ComponentsPerOctave, ref _Wavelengths, ref _AngleDegrees); + + UpdateAmplitudes(water); + + // Won't run every time so put last in the random sequence + if (_Phases == null || _Phases.Length != _Wavelengths.Length || _Phases2 == null || _Phases2.Length != _Wavelengths.Length) + { + InitPhases(); + } + + Random.state = randomStateBkp; + + SliceUpWaves(water, windSpeed); + } + + void UpdateAmplitudes(WaterRenderer water) + { + if (_Amplitudes == null || _Amplitudes.Length != _Wavelengths.Length) + { + _Amplitudes = new float[_Wavelengths.Length]; + } + if (_Amplitudes2 == null || _Amplitudes2.Length != _Wavelengths.Length) + { + _Amplitudes2 = new float[_Wavelengths.Length]; + } + if (_Powers == null || _Powers.Length != _Wavelengths.Length) + { + _Powers = new float[_Wavelengths.Length]; + } + + var windSpeed = WindSpeedMPS; + + for (var i = 0; i < _Wavelengths.Length; i++) + { + var amp = _ActiveSpectrum.GetAmplitude(_Wavelengths[i], _ComponentsPerOctave, windSpeed, water.Gravity, out _Powers[i]); + _Amplitudes[i] = Random.value * amp; + _Amplitudes2[i] = Random.value * amp * ReverseWaveWeight; + } + } + + void InitPhases() + { + // Set random seed to get repeatable results + var randomStateBkp = Random.state; + Random.InitState(_RandomSeed); + + var totalComps = _ComponentsPerOctave * WaveSpectrum.k_NumberOfOctaves; + _Phases = new float[totalComps]; + _Phases2 = new float[totalComps]; + for (var octave = 0; octave < WaveSpectrum.k_NumberOfOctaves; octave++) + { + for (var i = 0; i < _ComponentsPerOctave; i++) + { + var index = octave * _ComponentsPerOctave + i; + var rnd = (i + Random.value) / _ComponentsPerOctave; + _Phases[index] = 2f * Mathf.PI * rnd; + + var rnd2 = (i + Random.value) / _ComponentsPerOctave; + _Phases2[index] = 2f * Mathf.PI * rnd2; + } + } + + Random.state = randomStateBkp; + } + + private protected override void ReportMaxDisplacement(WaterRenderer water) + { + if (!Enabled) return; + + if (_ActiveSpectrum._ChopScales.Length != WaveSpectrum.k_NumberOfOctaves) + { + Debug.LogError($"Crest: {nameof(WaveSpectrum)} {_ActiveSpectrum.name} is out of date, please open this asset and resave in editor.", _ActiveSpectrum); + } + + if (_Wavelengths == null) + { + return; + } + + var ampSum = 0f; + for (var i = 0; i < _Wavelengths.Length; i++) + { + ampSum += _Amplitudes[i] * _ActiveSpectrum._ChopScales[i / _ComponentsPerOctave]; + } + + // Apply weight or will cause popping due to scale change. + ampSum *= Weight; + + MaximumReportedHorizontalDisplacement = ampSum * _ActiveSpectrum._Chop; + MaximumReportedVerticalDisplacement = ampSum; + MaximumReportedWavesDisplacement = ampSum; + + if (Mode == LodInputMode.Global) + { + water.ReportMaximumDisplacement(ampSum * _ActiveSpectrum._Chop, ampSum, ampSum); + } + } + + private protected override void Initialize() + { + base.Initialize(); + s_Instances.Add(transform.GetSiblingIndex(), this); + } + + private protected override void OnDisable() + { + base.OnDisable(); + + s_Instances.Remove(this); + + if (_BufferCascadeParameters != null && _BufferCascadeParameters.IsValid()) + { + _BufferCascadeParameters.Dispose(); + _BufferCascadeParameters = null; + } + if (_BufferWaveData != null && _BufferWaveData.IsValid()) + { + _BufferWaveData.Dispose(); + _BufferWaveData = null; + } + + if (_WaveBuffers != null) + { + Helpers.Destroy(_WaveBuffers); + _WaveBuffers = null; + } + } + +#if UNITY_EDITOR + void OnGUI() + { + if (_DrawSlicesInEditor && _WaveBuffers != null && _WaveBuffers.IsCreated()) + { + DebugGUI.DrawTextureArray(_WaveBuffers, 8, 0.5f); + } + } +#endif + } + + partial class ShapeGerstner + { + static int s_InstanceCount; + + private protected override void Awake() + { + base.Awake(); + s_InstanceCount++; + } + + private protected override void OnDestroy() + { + base.OnDestroy(); + + if (s_SwellSpectrum != null) + { + Helpers.Destroy(s_SwellSpectrum); + } + } + } + + partial class ShapeGerstner : ISerializationCallbackReceiver + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 2; +#pragma warning restore 414 + + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + _Version = MigrateV1(_Version); + + if (_Version < 2) + { + _Swell = false; + } + + _Version = MigrateV2(_Version); + } + + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + // Empty. + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeGerstner.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeGerstner.cs.meta new file mode 100644 index 0000000..c4f1a6a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeGerstner.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 002f2642204d348f3a2fab18595c44cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _rasterMesh: {instanceID: 0} + - _spectrum: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeWaves.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeWaves.cs new file mode 100644 index 0000000..38a9521 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeWaves.cs @@ -0,0 +1,534 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Serialization; + +namespace WaveHarmonic.Crest +{ + /// + /// Base class for Shape components. + /// + [@ExecuteDuringEditMode(ExecuteDuringEditMode.Include.None)] + [@HelpURL("Manual/Waves.html#wave-conditions")] + [@FilterEnum(nameof(_Blend), Filtered.Mode.Include, (int)LodInputBlend.Off, (int)LodInputBlend.Additive, (int)LodInputBlend.Alpha, (int)LodInputBlend.AlphaClip)] + public abstract partial class ShapeWaves : LodInput + { + [@Heading("Waves")] + + [Tooltip("The spectrum that defines the water surface shape.")] + [@Embedded(defaultPropertyName: nameof(_ActiveSpectrum))] + [@GenerateAPI] + [SerializeField] + internal WaveSpectrum _Spectrum; + + [Tooltip("Whether to evaluate the spectrum every frame.\n\nWhen false, the wave spectrum is evaluated once on startup in editor play mode and standalone builds, rather than every frame. This is less flexible, but it reduces the performance cost significantly.")] + [@GenerateAPI] + [FormerlySerializedAs("_SpectrumFixedAtRuntime")] + [SerializeField] + bool _EvaluateSpectrumAtRunTimeEveryFrame; + + [Tooltip("How much these waves respect the shallow water attenuation.\n\nAttenuation is defined on the Animated Waves. Set to zero to ignore attenuation.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + float _RespectShallowWaterAttenuation = 1f; + + [Tooltip("Whether to use the wind direction on this component rather than the global wind direction.\n\nGlobal wind direction comes from the Water Renderer component.")] + [@GenerateAPI] + [@InlineToggle, SerializeField] + bool _OverrideGlobalWindDirection; + + [@Label("Wind Direction")] + [Tooltip("Primary wave direction heading (degrees).\n\nThis is the angle from x axis in degrees that the waves are oriented towards. If a spline is being used to place the waves, this angle is relative to the spline.")] + [@Predicated(nameof(_Mode), inverted: false, nameof(LodInputMode.Paint))] + [@Predicated(nameof(_OverrideGlobalWindDirection), hide: true)] + [@ShowComputedProperty(nameof(WaveDirectionHeadingAngle))] + [@Range(-180, 180)] + [@GenerateAPI(Getter.Custom)] + [SerializeField] + private protected float _WaveDirectionHeadingAngle = 0f; + + [Tooltip("Whether to use the wind speed on this component rather than the global wind speed.\n\nGlobal wind speed comes from the Water Renderer component.")] + [@GenerateAPI] + [@InlineToggle, SerializeField] + bool _OverrideGlobalWindSpeed; + + [Tooltip("Wind speed in km/h. Controls wave conditions.")] + [@ShowComputedProperty(nameof(WindSpeedKPH))] + [@Predicated(nameof(_OverrideGlobalWindSpeed), hide: true)] + [@Range(0, 150f, scale: 2f)] + [@GenerateAPI] + [SerializeField] + float _WindSpeed = 20f; + + + [Header("Generation Settings")] + + [Tooltip("Resolution to use for wave generation buffers.\n\nLow resolutions are more efficient but can result in noticeable patterns in the shape.")] + [@Stepped(16, 512, step: 2, power: true)] + [@GenerateAPI] + [SerializeField] + private protected int _Resolution = 128; + + + // Debug + + [Tooltip("In Editor, shows the wave generation buffers on screen.")] + [@DecoratedField(order = k_DebugGroupOrder * Constants.k_FieldGroupOrder), SerializeField] + internal bool _DrawSlicesInEditor = false; + + + private protected static new class ShaderIDs + { + public static readonly int s_TransitionalWavelengthThreshold = Shader.PropertyToID("_Crest_TransitionalWavelengthThreshold"); + public static readonly int s_WaveResolutionMultiplier = Shader.PropertyToID("_Crest_WaveResolutionMultiplier"); + public static readonly int s_WaveBufferParameters = Shader.PropertyToID("_Crest_WaveBufferParameters"); + public static readonly int s_AlphaSource = Shader.PropertyToID("_Crest_AlphaSource"); + public static readonly int s_WaveBuffer = Shader.PropertyToID("_Crest_WaveBuffer"); + public static readonly int s_WaveBufferSliceIndex = Shader.PropertyToID("_Crest_WaveBufferSliceIndex"); + public static readonly int s_AverageWavelength = Shader.PropertyToID("_Crest_AverageWavelength"); + public static readonly int s_RespectShallowWaterAttenuation = Shader.PropertyToID("_Crest_RespectShallowWaterAttenuation"); + public static readonly int s_MaximumAttenuationDepth = Shader.PropertyToID("_Crest_MaximumAttenuationDepth"); + public static readonly int s_AxisX = Shader.PropertyToID("_Crest_AxisX"); + } + + private protected virtual WaveSpectrum DefaultSpectrum => WindSpectrum; + + static WaveSpectrum s_WindSpectrum; + private protected static WaveSpectrum WindSpectrum + { + get + { + if (s_WindSpectrum == null) + { + s_WindSpectrum = ScriptableObject.CreateInstance(); + s_WindSpectrum.name = "Wind Waves (instance)"; + s_WindSpectrum.hideFlags = HideFlags.DontSave | HideFlags.NotEditable; + } + + return s_WindSpectrum; + } + } + + private protected abstract int MinimumResolution { get; } + private protected abstract int MaximumResolution { get; } + + static ComputeShader s_TransferWavesComputeShader; + static LocalKeyword s_KeywordTexture; + static LocalKeyword s_KeywordTextureBlend; + readonly Vector4[] _WaveBufferParameters = new Vector4[Lod.k_MaximumSlices]; + + internal static int s_RenderPassOverride = -1; + + private protected WaveSpectrum _ActiveSpectrum = null; + private protected Vector2 PrimaryWaveDirection => new(Mathf.Cos(Mathf.PI * WaveDirectionHeadingAngle / 180f), Mathf.Sin(Mathf.PI * WaveDirectionHeadingAngle / 180f)); + + /// + /// The wind speed in kilometers per hour (KPH). + /// + /// + /// Wind speed can come from this component or the . + /// + public float WindSpeedKPH => _OverrideGlobalWindSpeed || WaterRenderer.Instance == null ? _WindSpeed : WaterRenderer.Instance.WindSpeed; + + /// + /// The wind speed in meters per second (MPS). + /// + /// /// + /// Wind speed can come from this component or the . + /// + public float WindSpeedMPS => WindSpeedKPH / 3.6f; + + private protected ShapeWaves() + { + _FollowHorizontalWaveMotion = true; + } + + private protected override void Attach() + { + base.Attach(); + _Reporter ??= new(this); + WaterChunkRenderer.DisplacementReporters.Add(_Reporter); + } + + private protected override void Detach() + { + base.Detach(); + WaterChunkRenderer.DisplacementReporters.Remove(_Reporter); + } + + internal override void Draw(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1f, int slice = -1) + { + if (weight * Weight <= 0f) + { + return; + } + + // Iterating over slices which means this is non compute so pass to graphics draw. + if (!IsCompute) + { + GraphicsDraw(simulation, buffer, target, pass, weight, slice); + return; + } + + var lodCount = simulation.Slices; + + var shape = (AnimatedWavesLod)simulation; + + var wrapper = new PropertyWrapperCompute(buffer, s_TransferWavesComputeShader, 0); + + if (_FirstCascade < 0 || _LastCascade < 0) + { + return; + } + + // Write to per-octave _WaveBuffers (ie pre-combined). Not the same as _AnimatedWaves. + wrapper.SetTexture(Crest.ShaderIDs.s_Target, target); + // Input weight. Weight for each octave calculated in compute. + wrapper.SetFloat(LodInput.ShaderIDs.s_Weight, Weight); + + var water = shape._Water; + + for (var lodIdx = lodCount - 1; lodIdx >= lodCount - slice; lodIdx--) + { + _WaveBufferParameters[lodIdx] = new(-1, -2, 0, 0); + + var found = false; + var filter = new AnimatedWavesLod.WavelengthFilter(water, lodIdx); + + for (var i = _FirstCascade; i <= _LastCascade; i++) + { + _Wavelength = MinWavelength(i) / shape.WaveResolutionMultiplier; + + // Do the weight from scratch because this is the real filter. + var w = AnimatedWavesLod.FilterByWavelength(filter, _Wavelength) * Weight; + + if (w <= 0f) + { + continue; + } + + if (!found) + { + _WaveBufferParameters[lodIdx].x = i; + found = true; + } + + _WaveBufferParameters[lodIdx].y = i; + } + } + + // Set transitional weights. + _WaveBufferParameters[lodCount - 2].w = 1f - water.ViewerAltitudeLevelAlpha; + _WaveBufferParameters[lodCount - 1].w = water.ViewerAltitudeLevelAlpha; + + SetRenderParameters(water, wrapper); + + wrapper.SetFloat(ShaderIDs.s_WaveResolutionMultiplier, shape.WaveResolutionMultiplier); + wrapper.SetFloat(ShaderIDs.s_TransitionalWavelengthThreshold, water.MaximumWavelength(water.LodLevels - 1) * 0.5f); + wrapper.SetVectorArray(ShaderIDs.s_WaveBufferParameters, _WaveBufferParameters); + + var isTexture = Mode is LodInputMode.Paint or LodInputMode.Texture; + var isAlphaBlend = Blend is LodInputBlend.Off or LodInputBlend.Alpha or LodInputBlend.AlphaClip; + + wrapper.SetKeyword(s_KeywordTexture, isTexture && !isAlphaBlend); + wrapper.SetKeyword(s_KeywordTextureBlend, isTexture && isAlphaBlend); + + if (isTexture) + { + wrapper.SetInteger(Crest.ShaderIDs.s_Blend, (int)_Blend); + } + + if (Mode == LodInputMode.Global) + { + var threads = shape.Resolution / Lod.k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, slice); + } + else + { + base.Draw(simulation, buffer, target, pass, weight, slice); + } + } + + void GraphicsDraw(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass, float weight, int slice) + { + var lod = simulation as AnimatedWavesLod; + + var wrapper = new PropertyWrapperBuffer(buffer); + SetRenderParameters(simulation._Water, wrapper); + + var isFirst = true; + + for (var i = _FirstCascade; i <= _LastCascade; i++) + { + _Wavelength = MinWavelength(i) / lod.WaveResolutionMultiplier; + + // Do the weight from scratch because this is the real filter. + weight = AnimatedWavesLod.FilterByWavelength(simulation._Water, slice, _Wavelength) * Weight; + if (weight <= 0f) continue; + + var average = _Wavelength * 1.5f * lod.WaveResolutionMultiplier; + // We only have one renderer so we need to use global. + buffer.SetGlobalFloat(ShaderIDs.s_AverageWavelength, average); + buffer.SetGlobalInt(ShaderIDs.s_WaveBufferSliceIndex, i); + + // Only apply blend mode once per component / LOD. Multiple passes can happen to gather all + // wavelengths and is incorrect to apply blend mode to those subsequent passes (ie component + // would be blending against itself). + if (!isFirst) + { + s_RenderPassOverride = 1; + } + + isFirst = false; + + base.Draw(simulation, buffer, target, pass, weight, slice); + } + + // Wavelength must be zero or waves will be filtered beforehand and not be written to every LOD. + _Wavelength = 0; + s_RenderPassOverride = -1; + } + + internal override float Filter(WaterRenderer water, int slice) + { + return 1f; + } + + private protected const int k_CascadeCount = 16; + + // First cascade of wave buffer that has waves and will be rendered. + private protected int _FirstCascade = -1; + // Last cascade of wave buffer that has waves and will be rendered. + // Default to lower than first default to break loops. + private protected int _LastCascade = -2; + + // Used to populate data on first frame. + private protected bool _FirstUpdate = true; + + // Wave generation done in Draw. Keeps track to limit to once per frame. + private protected int _LastGenerateFrameCount = -1; + + internal override bool Enabled => _FirstCascade > -1 && (WaterRenderer.Instance == null || WaterRenderer.Instance.Gravity != 0f) && Mode switch + { + LodInputMode.Global => enabled && s_TransferWavesComputeShader != null, + _ => base.Enabled, + }; + + internal override LodInputMode DefaultMode => LodInputMode.Global; + internal override int Pass => (int)DisplacementPass.LodDependent; + + private protected override bool FollowHorizontalMotion => true; + + float _Wavelength; + + private protected RenderTexture _WaveBuffers; + internal RenderTexture WaveBuffer => _WaveBuffers; + + internal Rect _Rect; + + private protected Vector2 _MaximumDisplacement; + private protected float MaximumReportedHorizontalDisplacement { get; set; } + private protected float MaximumReportedVerticalDisplacement { get; set; } + private protected float MaximumReportedWavesDisplacement { get; set; } + + + private protected bool UpdateDataEachFrame + { + get + { + var updateDataEachFrame = _EvaluateSpectrumAtRunTimeEveryFrame; +#if UNITY_EDITOR + if (!Application.isPlaying) updateDataEachFrame = true; +#endif + return updateDataEachFrame; + } + } + + /// + /// Min wavelength for a cascade in the wave buffer. Does not depend on viewpoint. + /// + private protected float MinWavelength(int cascadeIdx) + { + var diameter = 0.5f * (1 << cascadeIdx); + // Matches constant WAVE_SAMPLE_FACTOR in FFTSpectrum.compute + return diameter / 8f; + } + + private protected abstract void ReportMaxDisplacement(WaterRenderer water); + + private protected override void OnUpdate(WaterRenderer water) + { + base.OnUpdate(water); + + _ActiveSpectrum = _Spectrum != null ? _Spectrum : DefaultSpectrum; + + _FirstUpdate = false; + } + + private protected virtual void SetRenderParameters(WaterRenderer water, T wrapper) where T : IPropertyWrapper + { + wrapper.SetTexture(ShaderIDs.s_WaveBuffer, _WaveBuffers); + wrapper.SetFloat(ShaderIDs.s_RespectShallowWaterAttenuation, _RespectShallowWaterAttenuation); + wrapper.SetFloat(ShaderIDs.s_MaximumAttenuationDepth, water._AnimatedWavesLod.ShallowsMaximumDepth); + } + + private protected override void Initialize() + { + base.Initialize(); + + WaterResources.Instance.AfterEnabled -= InitializeResources; + WaterResources.Instance.AfterEnabled += InitializeResources; + InitializeResources(); + + _FirstUpdate = true; + + // Initialise with spectrum + if (_Spectrum != null) + { + _ActiveSpectrum = _Spectrum; + } + + if (_ActiveSpectrum == null) + { + _ActiveSpectrum = DefaultSpectrum; + } + } + + private protected override void OnDisable() + { + base.OnDisable(); + + WaterResources.Instance.AfterEnabled -= InitializeResources; + } + + void InitializeResources() + { + s_TransferWavesComputeShader = WaterResources.Instance.Compute._ShapeWavesTransfer; + s_KeywordTexture = WaterResources.Instance.Keywords.AnimatedWavesTransferWavesTexture; + s_KeywordTextureBlend = WaterResources.Instance.Keywords.AnimatedWavesTransferWavesTextureBlend; + } + + bool ReportDisplacement(ref Rect bounds, ref float horizontal, ref float vertical) + { + if (Mode == LodInputMode.Global || !Enabled) + { + return false; + } + + _Rect = Data.Rect; + + if (bounds.Overlaps(_Rect, false)) + { + horizontal = MaximumReportedHorizontalDisplacement; + vertical = MaximumReportedVerticalDisplacement; + return true; + } + + return false; + } + + float GetWaveDirectionHeadingAngle() + { + return _OverrideGlobalWindDirection || WaterRenderer.Instance == null ? _WaveDirectionHeadingAngle : WaterRenderer.Instance.WindDirection; + } + } + + partial class ShapeWaves + { + Reporter _Reporter; + + sealed class Reporter : IReportsDisplacement + { + readonly ShapeWaves _Input; + public Reporter(ShapeWaves input) => _Input = input; + public bool ReportDisplacement(ref Rect bounds, ref float horizontal, ref float vertical) => _Input.ReportDisplacement(ref bounds, ref horizontal, ref vertical); + } + } + + partial class ShapeWaves + { + static int s_InstanceCount = 0; + + private protected override void Awake() + { + base.Awake(); + s_InstanceCount++; + } + + private protected virtual void OnDestroy() + { + if (--s_InstanceCount <= 0) + { + if (s_WindSpectrum != null) + { + Helpers.Destroy(s_WindSpectrum); + } + } + } + } + + partial class ShapeWaves + { + [HideInInspector, SerializeField] + AlphaSource _AlphaSource; + enum AlphaSource { AlwaysOne, FromZero, FromZeroNormalized } + + private protected int MigrateV1(int version) + { + // Version 1 + // - Merge Alpha Source into Blend. + // - Rename and invert Spectrum Fixed at Run-Time + if (version < 1) + { + if (_Blend == LodInputBlend.Alpha) + { + _Blend = _AlphaSource switch + { + AlphaSource.AlwaysOne => LodInputBlend.Off, + AlphaSource.FromZero => LodInputBlend.Alpha, + AlphaSource.FromZeroNormalized => LodInputBlend.AlphaClip, + _ => _Blend, // Linter complained (linter has one off error). + }; + } + + _EvaluateSpectrumAtRunTimeEveryFrame = !_EvaluateSpectrumAtRunTimeEveryFrame; + + version = 1; + } + + return version; + } + + private protected int MigrateV2(int version) + { + // Version 2 + // - Global wind direction + if (version < 2) + { + _OverrideGlobalWindDirection = true; + version = 2; + } + + return version; + } + } + +#if UNITY_EDITOR + partial class ShapeWaves + { + private protected override void Reset() + { + base.Reset(); + + if (_Mode != LodInputMode.Global) + { + _OverrideGlobalWindSpeed = true; + _OverrideGlobalWindDirection = true; + } + } + } +#endif +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeWaves.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeWaves.cs.meta new file mode 100644 index 0000000..7effe2a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/Shape/ShapeWaves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c494780f7140b493695a431be2111449 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/SphereWaterInteraction.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/SphereWaterInteraction.cs new file mode 100644 index 0000000..f12b4f8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/SphereWaterInteraction.cs @@ -0,0 +1,293 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// Approximates the interaction between a sphere and the water. + /// + /// + /// Multiple spheres can be used to model the interaction of a non-spherical shape. + /// + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Sphere Water Interaction")] + [@HelpURL("Manual/Waves.html#adding-interaction-forces")] + public sealed partial class SphereWaterInteraction : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Tooltip("Radius of the sphere that is modelled from which the interaction forces are calculated.")] + [@Range(0.01f, 50f)] + [@GenerateAPI] + [SerializeField] + internal float _Radius = 1f; + + [Tooltip("Intensity of the forces.\n\nCan be set negative to invert.")] + [@Range(-40f, 40f)] + [@GenerateAPI] + [SerializeField] + float _Weight = 1f; + + [Tooltip("Intensity of the forces from vertical motion of the sphere.\n\nScales ripples generated from a sphere moving up or down.")] + [@Range(0f, 2f)] + [@GenerateAPI] + [SerializeField] + float _WeightVerticalMultiplier = 0.5f; + + [Tooltip("Model parameter that can be used to modify the shape of the interaction.\n\nInternally the interaction is modelled by a pair of nested spheres. The forces from the two spheres combine to create the final effect. This parameter scales the effect of the inner sphere and can be tweaked to adjust the shape of the result.")] + [@Range(0f, 10f)] + [@GenerateAPI] + [SerializeField] + float _InnerSphereMultiplier = 1.55f; + + [Tooltip("Model parameter that can be used to modify the shape of the interaction.\n\nThis parameter controls the size of the inner sphere and can be tweaked to give further control over the result.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + float _InnerSphereOffset = 0.109f; + + [Tooltip("Offset in direction of motion to help ripples appear in front of sphere.\n\nThere is some latency between applying a force to the wave simualtion and the resulting waves appearing. Applying this offset can help to ensure the waves do not lag behind the sphere.")] + [@Range(0f, 2f)] + [@GenerateAPI] + [SerializeField] + internal float _VelocityOffset = 0.04f; + + [Tooltip("How much to correct the position for horizontal wave displacement.\n\nIf set to 0, the input will always be applied at a fixed position before any horizontal displacement from waves. If waves are large then their displacement may cause the interactive waves to drift away from the object. This parameter can be increased to compensate for this displacement and combat this issue. However increasing too far can cause a feedback loop which causes strong 'ring' artifacts to appear in the dynamic waves. This parameter can be tweaked to balance this two effects.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + float _CompensateForWaveMotion = 0.45f; + + [Tooltip("Whether to improve visibility in larger LODs.\n\nIf the dynamic waves are not visible far enough in the distance from the camera, this can be used to boost the output.")] + [@GenerateAPI] + [SerializeField] + bool _BoostLargeWaves = false; + + + [Header("Limits")] + + [Tooltip("Teleport speed (km/h).\n\nIf the calculated speed is larger than this amount, the object is deemed to have teleported and the computed velocity is discarded.")] + [@GenerateAPI] + [SerializeField] + float _TeleportSpeed = 500f; + + [Tooltip("Outputs a warning to the console on teleport.")] + [@GenerateAPI] + [SerializeField] + bool _WarnOnTeleport = false; + + [Tooltip("Maximum speed clamp (km/h).\n\nUseful for controlling/limiting wake.")] + [@GenerateAPI] + [SerializeField] + float _MaximumSpeed = 100f; + + [Tooltip("Outputs a warning to the console on speed clamp.")] + [@GenerateAPI] + [SerializeField] + bool _WarnOnSpeedClamp = false; + +#pragma warning disable 414 + [Header("Debug")] + + [Tooltip("Draws debug lines at each substep position. Editor only.")] + [SerializeField] + bool _DebugSubsteps = false; +#pragma warning restore 414 + + static class ShaderIDs + { + public static readonly int s_Velocity = Shader.PropertyToID("_Crest_Velocity"); + public static readonly int s_Weight = Shader.PropertyToID("_Crest_Weight"); + public static readonly int s_Radius = Shader.PropertyToID("_Crest_Radius"); + public static readonly int s_InnerSphereOffset = Shader.PropertyToID("_Crest_InnerSphereOffset"); + public static readonly int s_InnerSphereMultiplier = Shader.PropertyToID("_Crest_InnerSphereMultiplier"); + public static readonly int s_LargeWaveMultiplier = Shader.PropertyToID("_Crest_LargeWaveMultiplier"); + } + + internal Vector3 _Velocity; + Vector3 _VelocityClamped; + Vector3 _PreviousPosition; + Vector3 _RelativeVelocity; + Vector3 _Displacement; + + float _WeightThisFrame; + + readonly SampleCollisionHelper _SampleHeightHelper = new(); + readonly SampleFlowHelper _SampleFlowHelper = new(); + + static ComputeShader ComputeShader => WaterResources.Instance.Compute._SphereWaterInteraction; + Rect Rect => new + ( + transform.position.XZ() - _Displacement.XZ() * _CompensateForWaveMotion - Vector2.one * (_Radius * 4f * 0.5f), + Vector2.one * (_Radius * 4f) + ); + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + _SampleHeightHelper.SampleDisplacement(transform.position, out _Displacement, minimumLength: 2f * _Radius); + + LateUpdateComputeVel(water); + + // Velocity relative to water + _RelativeVelocity = _VelocityClamped; + { + _SampleFlowHelper.Sample(transform.position, out var surfaceFlow, minimumLength: 2f * _Radius); + _RelativeVelocity -= new Vector3(surfaceFlow.x, 0, surfaceFlow.y); + + _RelativeVelocity.y *= _WeightVerticalMultiplier; + } + + // Use weight from user with a multiplier to make interactions look plausible + _WeightThisFrame = 3.75f * _Weight; + + var waterHeight = _Displacement.y + water.SeaLevel; + LateUpdateSphereWeight(waterHeight, ref _WeightThisFrame); + + // Weighting with this value helps keep ripples consistent for different gravity values + var gravityMul = Mathf.Sqrt(water._DynamicWavesLod.Settings._GravityMultiplier) / 5f; + _WeightThisFrame *= gravityMul; + + _PreviousPosition = transform.position; + } + + // Velocity of the sphere, relative to the water. Computes on the fly, discards if teleport detected. + void LateUpdateComputeVel(WaterRenderer water) + { + // Compue vel using finite difference + _Velocity = (transform.position - _PreviousPosition) / water.DeltaTime; + if (water.DeltaTime < 0.0001f) + { + _Velocity = Vector3.zero; + } + + var speedKmh = _Velocity.magnitude * 3.6f; + if (speedKmh > _TeleportSpeed) + { + // teleport detected + _Velocity *= 0f; + + if (_WarnOnTeleport) + { + Debug.LogWarning("Crest: Teleport detected (speed = " + speedKmh.ToString() + "), velocity discarded.", this); + } + + speedKmh = _Velocity.magnitude * 3.6f; + } + + if (speedKmh > _MaximumSpeed) + { + // limit speed to max + _VelocityClamped = _Velocity * _MaximumSpeed / speedKmh; + + if (_WarnOnSpeedClamp) + { + Debug.LogWarning("Crest: Speed (" + speedKmh.ToString() + ") exceeded max limited, clamped.", this); + } + } + else + { + _VelocityClamped = _Velocity; + } + } + + // Weight based on submerged-amount of sphere + void LateUpdateSphereWeight(float waterHeight, ref float weight) + { + var centerDepthInWater = waterHeight - transform.position.y; + + if (centerDepthInWater >= 0f) + { + // Center in water - exponential fall off of interaction influence as object gets deeper + var prop = centerDepthInWater / _Radius; + prop *= 0.5f; + weight *= Mathf.Exp(-prop * prop); + } + else + { + // Center out of water - ramp off with square root, weight goes to 0 when sphere is just touching water + var height = -centerDepthInWater; + var heightProp = 1f - Mathf.Clamp01(height / _Radius); + weight *= Mathf.Sqrt(heightProp); + } + } + + private protected override void Initialize() + { + base.Initialize(); + _Input ??= new(this); + ILodInput.Attach(_Input, DynamicWavesLod.s_Inputs); + _PreviousPosition = transform.position; + } + + private protected override void OnDisable() + { + base.OnDisable(); + ILodInput.Detach(_Input, DynamicWavesLod.s_Inputs); + } + + void Draw(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1f, int slices = -1) + { + var waves = simulation as DynamicWavesLod; + var timeBeforeCurrentTime = waves.TimeLeftToSimulate; + + var wrapper = new PropertyWrapperCompute(buffer, ComputeShader, 0); + +#if UNITY_EDITOR + // Draw debug lines at each substep position. Alternate colours each frame so that substeps are clearly visible. + if (_DebugSubsteps) + { + var col = 0.7f * (Time.frameCount % 2 == 1 ? Color.green : Color.red); + var pos = transform.position - _Velocity * (timeBeforeCurrentTime - _VelocityOffset); + var right = Vector3.Cross(Vector3.up, _Velocity.normalized); + Debug.DrawLine(pos - right + transform.up, pos + right + transform.up, col, 0.5f); + } +#endif + + // Reconstruct the position of this input at the current substep time. This produces + // much smoother interaction shapes for moving objects. Increasing sim freq helps further. + var offset = _Velocity * (timeBeforeCurrentTime - _VelocityOffset); + var displacement = _Displacement.XNZ() * _CompensateForWaveMotion; + wrapper.SetVector(Crest.ShaderIDs.s_Position, transform.position - offset - displacement); + + // Enlarge radius slightly - this tends to help waves 'wrap' the sphere slightly better + wrapper.SetFloat(ShaderIDs.s_Radius, _Radius * 1.1f); + + wrapper.SetFloat(ShaderIDs.s_Weight, _WeightThisFrame); + wrapper.SetFloat(ShaderIDs.s_InnerSphereOffset, _InnerSphereOffset); + wrapper.SetFloat(ShaderIDs.s_InnerSphereMultiplier, _InnerSphereMultiplier); + wrapper.SetFloat(ShaderIDs.s_LargeWaveMultiplier, _BoostLargeWaves ? 2f : 1f); + wrapper.SetVector(ShaderIDs.s_Velocity, _RelativeVelocity); + + wrapper.SetTexture(Crest.ShaderIDs.s_Target, target); + + var threads = simulation.Resolution / Lod.k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, slices); + } + } + + partial class SphereWaterInteraction + { + Input _Input; + + sealed class Input : ILodInput + { + readonly SphereWaterInteraction _Input; + public Input(SphereWaterInteraction input) => _Input = input; + public bool Enabled => _Input.enabled; + public bool IsCompute => true; + public int Queue => 0; + public int Pass => -1; + public Rect Rect => _Input.Rect; + public MonoBehaviour Component => _Input; + public float Filter(WaterRenderer water, int slice) => 1f; + public void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) => _Input.Draw(lod, buffer, target, pass, weight, slice); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/SphereWaterInteraction.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/SphereWaterInteraction.cs.meta new file mode 100644 index 0000000..a6fc3c2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/SphereWaterInteraction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8958fecc82ae04c7d9128101addbdc3b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/TextureLodInputData.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/TextureLodInputData.cs new file mode 100644 index 0000000..e225608 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/TextureLodInputData.cs @@ -0,0 +1,110 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// Data storage for for the Texture input mode. + /// + [System.Serializable] + public abstract partial class TextureLodInputData : LodInputData + { + [Tooltip("Texture to render into the simulation.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal Texture _Texture; + + [Tooltip("Multiplies the texture sample.\n\nThis is useful for normalized textures. The four components map to the four color/alpha components of the texture (if they exist).\n\nIf you just want to fade out the input, consider using weight instead.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + Vector4 _Multiplier = Vector4.one; + + private protected abstract ComputeShader TextureShader { get; } + internal override bool IsEnabled => _Texture != null; + internal override bool HasHeightRange => false; + + internal override void RecalculateRect() + { + _Rect = _Input.transform.RectXZ(); + } + + internal override void RecalculateBounds() + { + throw new System.NotImplementedException(); + } + + internal override void Draw(Lod lod, Component component, CommandBuffer buffer, RenderTargetIdentifier target, int slices) + { + var transform = component.transform; + var wrapper = new PropertyWrapperCompute(buffer, TextureShader, 0); + var rotation = new Vector2(transform.localToWorldMatrix.m20, transform.localToWorldMatrix.m00).normalized; + wrapper.SetVector(ShaderIDs.s_TextureSize, transform.lossyScale.XZ()); + wrapper.SetVector(ShaderIDs.s_TexturePosition, transform.position.XZ()); + wrapper.SetVector(ShaderIDs.s_TextureRotation, rotation); + wrapper.SetVector(ShaderIDs.s_Resolution, new(_Texture.width, _Texture.height)); + wrapper.SetVector(ShaderIDs.s_Multiplier, _Multiplier); + wrapper.SetFloat(ShaderIDs.s_FeatherWidth, _Input.FeatherWidth); + wrapper.SetTexture(ShaderIDs.s_Texture, _Texture); + wrapper.SetInteger(ShaderIDs.s_Blend, (int)_Input.Blend); + wrapper.SetTexture(ShaderIDs.s_Target, target); + + if (this is LevelTextureLodInputData height) + { + wrapper.SetKeyword(WaterResources.Instance.Keywords.LevelTextureCatmullRom, height._UseCatmullRomFiltering); + } + + if (this is DirectionalTextureLodInputData data) + { + wrapper.SetBoolean(ShaderIDs.s_NegativeValues, data._NegativeValues); + } + + var threads = lod.Resolution / Lod.k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, slices); + } + + internal override void OnEnable() + { + // Empty. + } + + internal override void OnDisable() + { + // Empty. + } + +#if UNITY_EDITOR + internal override void OnChange(string propertyPath, object previousValue) + { + + } + + internal override bool InferMode(Component component, ref LodInputMode mode) + { + return false; + } +#endif + } + + /// + [System.Serializable] + public abstract partial class DirectionalTextureLodInputData : TextureLodInputData + { + [Tooltip("Whether the texture supports negative values.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _NegativeValues; + } + + /// + partial class LevelTextureLodInputData + { + [Label("Filtering (High Quality)")] + [Tooltip("Helps with staircase aliasing.")] + [@DecoratedField, SerializeField] + internal bool _UseCatmullRomFiltering; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/TextureLodInputData.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/TextureLodInputData.cs.meta new file mode 100644 index 0000000..833a37c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/TextureLodInputData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba0f2ab8138ec440c970acf0e1cd3d38 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/WatertightHull.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/WatertightHull.cs new file mode 100644 index 0000000..4221031 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/WatertightHull.cs @@ -0,0 +1,275 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// The mode for . + /// + /// + /// Each mode has its strengths and weaknesses. + /// + [@GenerateDoc] + public enum WatertightHullMode + { + /// + [Tooltip("Use displacement to remove water.\n\nUsing displacement will also affect the underwater and can nest bouyant objects. Requires the displacement layer to be enabled.")] + Displacement, + + /// + [Tooltip("Clips the surface to remove water.\n\nThis option is more precise and can be submerged.")] + Clip, + } + + /// + /// Removes water from a provided hull using the clip simulation. + /// + [@ExecuteDuringEditMode] + [AddComponentMenu(Constants.k_MenuPrefixInputs + "Watertight Hull")] + [@HelpURL("Manual/Clipping.html#watertight-hull")] + public sealed partial class WatertightHull : ManagedBehaviour + { + [@Label("Convex Hull")] + [Tooltip("The convex hull to keep water out.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal Mesh _Mesh; + + [Tooltip("Order this input will render.\n\nQueue is 'Queue + SiblingIndex'")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + int _Queue; + + [@Space(10)] + + [Tooltip("Which mode to use.")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + WatertightHullMode _Mode = WatertightHullMode.Displacement; + + [Tooltip("Inverts the effect to remove clipping (ie add water).")] + [@Predicated(nameof(_Mode), inverted: true, nameof(WatertightHullMode.Clip), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _Inverted; + + [@Label("Use Clip")] + [Tooltip("Whether to also to clip the surface when using displacement mode.\n\nDisplacement mode can have a leaky hull by allowing chop top push waves across the hull boundaries slightly. Clipping the surface will remove these interior leaks.")] + [@Predicated(nameof(_Mode), inverted: true, nameof(WatertightHullMode.Displacement), hide: true)] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + bool _UseClipWithDisplacement = true; + + [@Space(10)] + + [@DecoratedField, SerializeField] + internal DebugFields _Debug = new(); + + [System.Serializable] + internal sealed class DebugFields + { + [@DecoratedField, SerializeField] + public bool _DrawBounds; + } + + Material _ClipMaterial; + Material _AnimatedWavesMaterial; + + internal bool Enabled => enabled && _Mesh != null; + + bool _RecalculateBounds = true; + Rect _Rect; + + internal Rect Rect + { + get + { + if (_RecalculateBounds) + { + _Rect = transform.TransformBounds(_Mesh.bounds).RectXZ(); + _RecalculateBounds = false; + } + + return _Rect; + } + } + + readonly SampleCollisionHelper _SampleCollisionHelper = new(); + Vector3 _Displacement; + + internal bool UsesClip => _Mode == WatertightHullMode.Clip || _UseClipWithDisplacement; + internal bool UsesDisplacement => _Mode == WatertightHullMode.Displacement; + + static class ShaderIDs + { + public static int s_Inverted = Shader.PropertyToID("_Crest_Inverted"); + } + + private protected override void Initialize() + { + base.Initialize(); + + if (UsesClip) + { + _ClipInput ??= new(this); + _ClipMaterial = new(WaterResources.Instance.Shaders._ClipConvexHull); + ILodInput.Attach(_ClipInput, ClipLod.s_Inputs); + } + + if (UsesDisplacement) + { + _AnimatedWavesInput ??= new(this); + _AnimatedWavesMaterial = new(Shader.Find("Crest/Inputs/Animated Waves/Push Water Under Convex Hull")); + _AnimatedWavesMaterial.SetFloat(LodInput.ShaderIDs.s_Weight, 1f); + ILodInput.Attach(_AnimatedWavesInput, AnimatedWavesLod.s_Inputs); + } + } + + private protected override void OnDisable() + { + base.OnDisable(); + Helpers.Destroy(_ClipMaterial); + ILodInput.Detach(_ClipInput, ClipLod.s_Inputs); + Helpers.Destroy(_AnimatedWavesMaterial); + ILodInput.Detach(_AnimatedWavesInput, AnimatedWavesLod.s_Inputs); + } + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + if (_Mode == WatertightHullMode.Displacement) + { + _SampleCollisionHelper.SampleDisplacement(transform.position, out _Displacement); + } + + if (transform.hasChanged) + { + _RecalculateBounds = true; + } + } + + private protected override System.Action OnLateUpdateMethod => OnLateUpdate; + void OnLateUpdate(WaterRenderer water) + { + transform.hasChanged = false; + } + + void DrawClip(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) + { + _ClipMaterial.SetBoolean(ShaderIDs.s_Inverted, _Inverted); + buffer.DrawMesh(_Mesh, transform.localToWorldMatrix, _ClipMaterial); + } + + void DrawDisplacement(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) + { + _AnimatedWavesMaterial.SetVector(LodInput.ShaderIDs.s_DisplacementAtInputPosition, _Displacement); + buffer.DrawMesh(_Mesh, transform.localToWorldMatrix, _AnimatedWavesMaterial); + } + + void SetQueue(int previous, int current) + { + if (previous == current) return; + if (_ClipInput == null || !isActiveAndEnabled) return; + if (UsesClip) ILodInput.Attach(_ClipInput, ClipLod.s_Inputs); + if (UsesDisplacement) ILodInput.Attach(_AnimatedWavesInput, AnimatedWavesLod.s_Inputs); + } + + void SetMode(WatertightHullMode previous, WatertightHullMode current) + { + if (previous == current) return; + OnDisable(); OnEnable(); + } + + void SetUseClipWithDisplacement(bool previous, bool current) + { + if (previous == current) return; + OnDisable(); OnEnable(); + } + +#if UNITY_EDITOR + [@OnChange] + void OnChange(string propertyPath, object previousValue) + { + switch (propertyPath) + { + case nameof(_Queue): + SetQueue((int)previousValue, _Queue); + break; + case nameof(_Mode): + SetMode((WatertightHullMode)previousValue, _Mode); + break; + case nameof(_UseClipWithDisplacement): + SetUseClipWithDisplacement((bool)previousValue, _UseClipWithDisplacement); + break; + } + } +#endif + } + + partial class WatertightHull + { + ClipInput _ClipInput; + + sealed class ClipInput : ILodInput + { + readonly WatertightHull _Input; + public ClipInput(WatertightHull input) => _Input = input; + public bool Enabled => _Input.Enabled; + public bool IsCompute => false; + public int Queue => _Input.Queue; + public int Pass => -1; + public Rect Rect => _Input.Rect; + public MonoBehaviour Component => _Input; + public float Filter(WaterRenderer water, int slice) => 1f; + public void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) => _Input.DrawClip(lod, buffer, target, pass, weight, slice); + } + } + + partial class WatertightHull + { + DisplacementInput _AnimatedWavesInput; + + sealed class DisplacementInput : ILodInput + { + readonly WatertightHull _Input; + public DisplacementInput(WatertightHull input) => _Input = input; + public bool Enabled => _Input.Enabled; + public bool IsCompute => false; + public int Queue => _Input.Queue; + public int Pass => (int)DisplacementPass.LodIndependentLast; + public Rect Rect => _Input.Rect; + public MonoBehaviour Component => _Input; + public float Filter(WaterRenderer water, int slice) => 1f; + public void Draw(Lod lod, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1, int slice = -1) => _Input.DrawDisplacement(lod, buffer, target, pass, weight, slice); + } + } + + partial class WatertightHull : ISerializationCallbackReceiver + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 1; +#pragma warning restore 414 + + /// + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + if (_Version < 1) + { + // Keep clip for existing. + _Mode = WatertightHullMode.Clip; + _Version = 1; + } + } + + /// + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/WatertightHull.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/WatertightHull.cs.meta new file mode 100644 index 0000000..802901f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Input/WatertightHull.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ba152b967dd345829964814e3b3a4e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/LevelLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/LevelLod.cs new file mode 100644 index 0000000..80ef07e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/LevelLod.cs @@ -0,0 +1,55 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// We do not add height to displacement directly for better precision and layering. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Data that gives the water level (water height at rest and gradients). + /// + public sealed partial class LevelLod : Lod + { + // Purple/Indigo + internal static readonly Color s_GizmoColor = new(75f / 255f, 0f, 130f / 255f, 0.5f); + + internal override string ID => "Level"; + internal override Color GizmoColor => s_GizmoColor; + private protected override Color ClearColor => Color.black; + private protected override bool NeedToReadWriteTextureData => true; + + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + LodTextureFormatMode.Automatic => Water == null ? GraphicsFormat.None : Water.AnimatedWavesLod.TextureFormatMode switch + { + LodTextureFormatMode.Precision => GraphicsFormat.R32_SFloat, + _ => GraphicsFormat.R16_SFloat, + }, + LodTextureFormatMode.Performance => GraphicsFormat.R16_SFloat, + LodTextureFormatMode.Precision => GraphicsFormat.R32_SFloat, + LodTextureFormatMode.Manual => _TextureFormat, + _ => throw new System.NotImplementedException(), + }; + + internal LevelLod() + { + _Enabled = false; + _OverrideResolution = false; + _TextureFormatMode = LodTextureFormatMode.Automatic; + _TextureFormat = GraphicsFormat.R16_SFloat; + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/LevelLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/LevelLod.cs.meta new file mode 100644 index 0000000..6dccd64 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/LevelLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d555bea1d2da4c5c969a1d7775ea781 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Lod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Lod.cs new file mode 100644 index 0000000..2871779 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Lod.cs @@ -0,0 +1,691 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +#if !UNITY_2023_2_OR_NEWER +using GraphicsFormatUsage = UnityEngine.Experimental.Rendering.FormatUsage; +#endif + +namespace WaveHarmonic.Crest +{ + using Inputs = SortedList; + + /// + /// Texture format preset. + /// + [@GenerateDoc] + public enum LodTextureFormatMode + { + /// + [Tooltip("Uses the Texture Format property.")] + Manual, + + /// + [Tooltip("Chooses a texture format for performance.")] + Performance = 100, + + /// + [Tooltip("Chooses a texture format for precision.\n\nThis format can reduce artifacts.")] + Precision = 200, + + /// + [Tooltip("Chooses a texture format based on another.\n\nFor example, Dynamic Waves will match precision of Animated Waves.")] + Automatic = 300, + } + + /// + /// Base class for data/behaviours created on each LOD. + /// + [System.Serializable] + public abstract partial class Lod + { + [Tooltip("Whether the simulation is enabled.")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [@DecoratedField, SerializeField] + internal bool _Enabled; + + [Tooltip("Whether to override the resolution.\n\nIf not enabled, then the simulation will use the resolution defined on the Water Renderer.")] + [@Predicated(typeof(AnimatedWavesLod), inverted: true, hide: true)] + [@GenerateAPI(Setter.Dirty)] + [@InlineToggle(fix: true), SerializeField] + internal bool _OverrideResolution = true; + + [Tooltip("The resolution of the simulation data.\n\nSet higher for sharper results at the cost of higher memory usage.")] + [@Predicated(typeof(AnimatedWavesLod), inverted: true, hide: true)] + [@Predicated(nameof(_OverrideResolution), hide: true)] + [@ShowComputedProperty(nameof(Resolution))] + [@Delayed] + [@GenerateAPI(Getter.Custom, Setter.Dirty)] + [SerializeField] + internal int _Resolution = 256; + + [Tooltip("Chooses a texture format based on a preset value.")] + [@Filtered] + [@GenerateAPI(Setter.Dirty)] + [SerializeField] + private protected LodTextureFormatMode _TextureFormatMode = LodTextureFormatMode.Performance; + + [Tooltip("The render texture format used for this simulation data.\n\nIt will be overriden if the format is incompatible with the platform.")] + [@ShowComputedProperty(nameof(RequestedTextureFormat))] + [@Predicated(nameof(_TextureFormatMode), inverted: true, nameof(LodTextureFormatMode.Manual), hide: true)] + [@GenerateAPI(Setter.Dirty)] + [@DecoratedField, SerializeField] + internal GraphicsFormat _TextureFormat; + + // NOTE: This MUST match the value in Constants.hlsl, as it + // determines the size of the texture arrays in the shaders. + internal const int k_MaximumSlices = 15; + + // NOTE: these MUST match the values in Constants.hlsl + // 64 recommended as a good common minimum: https://www.reddit.com/r/GraphicsProgramming/comments/aeyfkh/for_compute_shaders_is_there_an_ideal_numthreads/ + internal const int k_ThreadGroupSize = 8; + internal const int k_ThreadGroupSizeX = k_ThreadGroupSize; + internal const int k_ThreadGroupSizeY = k_ThreadGroupSize; + + internal static class ShaderIDs + { + public static readonly int s_LodIndex = Shader.PropertyToID("_Crest_LodIndex"); + public static readonly int s_LodChange = Shader.PropertyToID("_Crest_LodChange"); + } + + // Used for creating shader property names etc. + internal abstract string ID { get; } + internal virtual string Name => ID; + + /// + /// The requested texture format used for this simulation, either by manual mode or + /// one of the aliases. It will be overriden if the format is incompatible with the + /// platform (). + /// + private protected abstract GraphicsFormat RequestedTextureFormat { get; } + + /// + /// This is the platform compatible texture format that will used. + /// + public GraphicsFormat CompatibleTextureFormat { get; private set; } + + private protected abstract Color ClearColor { get; } + private protected abstract bool NeedToReadWriteTextureData { get; } + private protected abstract Inputs Inputs { get; } + internal abstract Color GizmoColor { get; } + internal virtual int BufferCount => 1; + private protected virtual Texture2DArray NullTexture => BlackTextureArray; + private protected virtual bool RequiresClearBorder => false; + + private protected IQueryable Queryable { get; set; } + + // This is used as alternative to Texture2D.blackTexture, as using that + // is not possible in some shaders. + static Texture2DArray s_BlackTextureArray = null; + static Texture2DArray BlackTextureArray + { + get + { + if (s_BlackTextureArray == null) + { + s_BlackTextureArray = TextureArrayHelpers.CreateTexture2DArray(Texture2D.blackTexture, k_MaximumSlices); + s_BlackTextureArray.name = "_Crest_LodBlackTexture"; + } + + return s_BlackTextureArray; + } + } + + static readonly GraphicsFormatUsage s_GraphicsFormatUsage = + // Ensures a non compressed format is returned. + GraphicsFormatUsage.LoadStore | + // All these textures are sampled at some point. + GraphicsFormatUsage.Sample | + // Always use linear filtering. + GraphicsFormatUsage.Linear; + + private protected BufferedData _Targets; + internal RenderTexture DataTexture => _Targets.Current; + internal RenderTexture GetDataTexture(int frameDelta) => _Targets.Previous(frameDelta); + + private protected Matrix4x4[] _ViewMatrices = new Matrix4x4[k_MaximumSlices]; + private protected Cascade[] _Cascades = new Cascade[k_MaximumSlices]; + internal Cascade[] Cascades => _Cascades; + private protected BufferedData _SamplingParameters; + + internal int Slices => _Water.LodLevels; + + // Currently use as a failure flag. + private protected bool _Valid; + + internal WaterRenderer _Water; + internal WaterRenderer Water => _Water; + + private protected int _TargetsToClear; + + private protected readonly int _TextureShaderID; + private protected readonly int _TextureSourceShaderID; + private protected readonly int _SamplingParametersShaderID; + private protected readonly int _SamplingParametersCascadeShaderID; + private protected readonly int _SamplingParametersCascadeSourceShaderID; + + readonly string _TextureName; + + internal Lod() + { + // @Garbage + var name = $"g_Crest_Cascade{ID}"; + _TextureShaderID = Shader.PropertyToID(name); + _TextureSourceShaderID = Shader.PropertyToID($"{name}Source"); + _SamplingParametersShaderID = Shader.PropertyToID($"g_Crest_SamplingParameters{ID}"); + _SamplingParametersCascadeShaderID = Shader.PropertyToID($"g_Crest_SamplingParametersCascade{ID}"); + _SamplingParametersCascadeSourceShaderID = Shader.PropertyToID($"g_Crest_SamplingParametersCascade{ID}Source"); + + _TextureName = $"_Crest_{ID}Lod"; + } + + private protected RenderTexture CreateLodDataTextures() + { + RenderTexture result = new(Resolution, Resolution, 0, CompatibleTextureFormat) + { + wrapMode = TextureWrapMode.Clamp, + antiAliasing = 1, + filterMode = FilterMode.Bilinear, + anisoLevel = 0, + useMipMap = false, + name = _TextureName, + dimension = TextureDimension.Tex2DArray, + volumeDepth = Slices, + enableRandomWrite = NeedToReadWriteTextureData + }; + result.Create(); + return result; + } + + private protected void FlipBuffers() + { + if (_ReAllocateTexture) + { + ReAllocate(); + } + +#if UNITY_EDITOR + // Fixes flickering in frame debugger when navigating draw calls. + if (!UnityEditor.EditorApplication.isPaused || Time.deltaTime > 0) +#endif + { + _Targets.Flip(); + _SamplingParameters.Flip(); + } + + UpdateSamplingParameters(); + } + + private protected void Clear(RenderTexture target) + { + Helpers.ClearRenderTexture(target, ClearColor, depth: false); + } + + /// + /// Clears persistent LOD data. Some simulations have persistent data which can linger for a little while after + /// being disabled. This will manually clear that data. + /// + internal virtual void ClearLodData() + { + // Empty. + } + + private protected virtual bool AlwaysClear => false; + + // Only works with input-only data (ie no simulation steps). + internal virtual void BuildCommandBuffer(WaterRenderer water, CommandBuffer buffer) + { + FlipBuffers(); + + buffer.BeginSample(ID); + + if (_TargetsToClear > 0 || AlwaysClear) + { + CoreUtils.SetRenderTarget(buffer, DataTexture, ClearFlag.Color, ClearColor); + + _TargetsToClear--; + } + + if (Inputs.Count > 0) + { + SubmitDraws(buffer, Inputs, DataTexture); + + // Ensure all targets clear when there are no inputs. + _TargetsToClear = _Targets.Size; + } + + if (RequiresClearBorder) + { + ClearBorder(buffer); + } + + Queryable?.UpdateQueries(_Water); + + buffer.EndSample(ID); + } + + private protected bool SubmitDraws(CommandBuffer buffer, Inputs draws, RenderTargetIdentifier target, int pass = -1, bool filter = false) + { + var drawn = false; + + foreach (var draw in draws) + { + var input = draw.Value; + if (!input.Enabled) + { + continue; + } + + if (pass != -1) + { + var p = input.Pass; + if (p != -1 && p != pass) continue; + } + + var rect = input.Rect; + + if (input.IsCompute) + { + var smallest = 0; + if (rect != Rect.zero) + { + smallest = -1; + for (var slice = Slices - 1; slice >= 0; slice--) + { + if (rect != Rect.zero && !rect.Overlaps(Cascades[slice].TexelRect)) break; + smallest = slice; + } + + if (smallest < 0) continue; + } + + // Pass the slice count to only draw to valid slices. + input.Draw(this, buffer, target, pass, slice: Slices - smallest); + drawn = true; + continue; + } + + for (var slice = Slices - 1; slice >= 0; slice--) + { + if (rect != Rect.zero && !rect.Overlaps(Cascades[slice].TexelRect)) break; + + var weight = filter ? input.Filter(_Water, slice) : 1f; + if (weight <= 0f) continue; + + // Parameters override RTI values: + // https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.SetRenderTarget.html + CoreUtils.SetRenderTarget(buffer, target, depthSlice: slice); + buffer.SetGlobalInteger(ShaderIDs.s_LodIndex, slice); + + // This will work for CG but not for HDRP hlsl files. + buffer.SetViewProjectionMatrices(_ViewMatrices[slice], _Water.GetProjectionMatrix(slice)); + + input.Draw(this, buffer, target, pass, weight, slice); + drawn = true; + } + } + + return drawn; + } + + /// + /// Set a new origin. This is equivalent to subtracting the new origin position from any world position state. + /// + internal void SetOrigin(Vector3 newOrigin) + { + _SamplingParameters.RunLambda(data => + { + for (var index = 0; index < _Water.LodLevels; index++) + { + // We really only care about the previous states, as the current/next frame will be + // re-calculated. This realigns the snapped position with the now shifted camera. + data[index].x -= newOrigin.x; + data[index].y -= newOrigin.z; + } + }); + } + + void ClearBorder(CommandBuffer buffer) + { + var size = Resolution / 8; + + var wrapper = new PropertyWrapperCompute(buffer, WaterResources.Instance.Compute._Clear, 1); + wrapper.SetTexture(Crest.ShaderIDs.s_Target, DataTexture); + wrapper.SetVector(Crest.ShaderIDs.s_ClearColor, ClearColor); + wrapper.SetInteger(Crest.ShaderIDs.s_Resolution, Resolution); + wrapper.SetInteger(Crest.ShaderIDs.s_TargetSlice, Slices - 1); + wrapper.Dispatch(size, 1, 1); + + wrapper = new PropertyWrapperCompute(buffer, WaterResources.Instance.Compute._Clear, 2); + wrapper.SetTexture(Crest.ShaderIDs.s_Target, DataTexture); + wrapper.SetVector(Crest.ShaderIDs.s_ClearColor, ClearColor); + wrapper.SetInteger(Crest.ShaderIDs.s_Resolution, Resolution); + wrapper.SetInteger(Crest.ShaderIDs.s_TargetSlice, Slices - 1); + wrapper.Dispatch(1, size, 1); + } + + void UpdateSamplingParameters(bool initialize = false) + { + var position = _Water.Position; + var resolution = _Enabled ? Resolution : TextureArrayHelpers.k_SmallTextureSize; + + var parameters = _SamplingParameters.Current; + var levels = Slices; + + for (var slice = 0; slice < levels; slice++) + { + // Find snap period. + var texel = 2f * 2f * _Water._CascadeData.Current[slice].x / resolution; + // Snap so that shape texels are stationary. + var snapped = position - new Vector3(Mathf.Repeat(position.x, texel), 0, Mathf.Repeat(position.z, texel)); + + var cascade = new Cascade(snapped.XZ(), texel, resolution); + _Cascades[slice] = cascade; + parameters[slice] = cascade.Packed; + if (initialize && BufferCount > 1) _SamplingParameters.Previous(1)[slice] = cascade.Packed; + + _ViewMatrices[slice] = WaterRenderer.CalculateViewMatrixFromSnappedPositionRHS(snapped); + } + + if (initialize) + { + Shader.SetGlobalVector(_SamplingParametersShaderID, new(levels, resolution, 1f / resolution, 0)); + } + + Shader.SetGlobalVectorArray(_SamplingParametersCascadeShaderID, parameters); + + if (BufferCount > 1) + { + Shader.SetGlobalVectorArray(_SamplingParametersCascadeSourceShaderID, _SamplingParameters.Previous(1)); + } + } + + /// + /// Returns index of lod that completely covers the sample area. If no such lod + /// available, returns -1. + /// + internal int SuggestIndex(Rect sampleArea) + { + for (var slice = 0; slice < Slices; slice++) + { + var cascade = _Cascades[slice]; + + // Shape texture needs to completely contain sample area. + var rect = cascade.TexelRect; + + // Shrink rect by 1 texel border - this is to make finite differences fit as well. + var texel = cascade._Texel; + rect.x += texel; rect.y += texel; + rect.width -= 2f * texel; rect.height -= 2f * texel; + + if (!rect.Contains(sampleArea.min) || !rect.Contains(sampleArea.max)) + { + continue; + } + + return slice; + } + + return -1; + } + + /// + /// Returns index of lod that completely covers the sample area, and contains + /// wavelengths that repeat no more than twice across the smaller spatial length. If + /// no such lod available, returns -1. This means high frequency wavelengths are + /// filtered out, and the lod index can be used for each sample in the sample area. + /// + internal int SuggestIndexForWaves(Rect sampleArea) + { + return SuggestIndexForWaves(sampleArea, Mathf.Min(sampleArea.width, sampleArea.height)); + } + + internal int SuggestIndexForWaves(Rect sampleArea, float minimumSpatialLength) + { + var count = Slices; + + for (var index = 0; index < count; index++) + { + var cascade = _Cascades[index]; + + // Shape texture needs to completely contain sample area. + var rect = cascade.TexelRect; + + // Shrink rect by 1 texel border - this is to make finite differences fit as well. + var texel = cascade._Texel; + rect.x += texel; rect.y += texel; + rect.width -= 2f * texel; rect.height -= 2f * texel; + + if (!rect.Contains(sampleArea.min) || !rect.Contains(sampleArea.max)) + { + continue; + } + + // The smallest wavelengths should repeat no more than twice across the smaller + // spatial length. Unless we're in the last LOD - then this is the best we can do. + var minimumWavelength = _Water.MaximumWavelength(index) / 2f; + if (minimumWavelength < minimumSpatialLength / 2f && index < count - 1) + { + continue; + } + + return index; + } + + return -1; + } + + /// + /// Bind data needed to load or compute from this simulation. + /// + internal virtual void Bind(T target) where T : IPropertyWrapper + { + + } + + internal virtual void Initialize() + { + // All simulations require a GPU so do not proceed any further. + if (_Water.IsRunningWithoutGraphics) + { + _Valid = false; + return; + } + + // Validate textures. + { + // Find a compatible texture format. + CompatibleTextureFormat = Helpers.GetCompatibleTextureFormat(RequestedTextureFormat, s_GraphicsFormatUsage, Name, NeedToReadWriteTextureData); + + if (CompatibleTextureFormat == GraphicsFormat.None) + { + Debug.Log($"Crest: Disabling {Name} simulation due to no valid available texture format."); + _Valid = false; + return; + } + + Debug.Assert(Slices <= k_MaximumSlices); + } + + _Valid = true; + + Allocate(); + } + + internal virtual void SetGlobals(bool enable) + { + if (_Water.IsRunningWithoutGraphics) return; + // Bind/unbind data texture for all shaders. + Shader.SetGlobalTexture(_TextureShaderID, enable && Enabled ? DataTexture : NullTexture); + + if (BufferCount > 1) + { + Shader.SetGlobalTexture(_TextureSourceShaderID, enable && Enabled ? GetDataTexture(1) : NullTexture); + } + + if (_SamplingParameters == null || _SamplingParameters.Size != BufferCount) + { + _SamplingParameters = new(BufferCount, () => new Vector4[k_MaximumSlices]); + } + + // For safety. Disable to see if we are sampling outside of LOD chain. + _SamplingParameters.RunLambda(x => System.Array.Fill(x, Vector4.zero)); + + UpdateSamplingParameters(initialize: true); + } + + internal virtual void Enable() + { + // Blank + } + + internal virtual void Disable() + { + // Always clean up provider (CPU may be running). + Queryable?.CleanUp(); + } + + internal virtual void Destroy() + { + // Release resources and destroy object to avoid reference leak. + _Targets?.RunLambda(x => + { + if (x != null) x.Release(); + Helpers.Destroy(x); + }); + } + + internal virtual void AfterExecute() + { + + } + + private protected virtual void Allocate() + { + _Targets = new(BufferCount, CreateLodDataTextures); + _Targets.RunLambda(Clear); + + // Bind globally once here on init, which will bind to all graphics shaders (not compute) + Shader.SetGlobalTexture(_TextureShaderID, DataTexture); + + _ReAllocateTexture = false; + } + + bool GetEnabled() => _Enabled && _Valid; + + // NOTE: This could be called by the user due to API. + void SetEnabled(bool previous, bool current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled) return; + + if (current) + { + Initialize(); + Enable(); + } + else + { + Disable(); + Destroy(); + } + + SetGlobals(current); + } + + int GetResolution() => _OverrideResolution || Water == null ? _Resolution : Water.LodResolution; + + private protected void ReAllocate() + { + if (!Enabled) return; + CompatibleTextureFormat = Helpers.GetCompatibleTextureFormat(RequestedTextureFormat, s_GraphicsFormatUsage, Name, NeedToReadWriteTextureData); + var descriptor = _Targets.Current.descriptor; + descriptor.height = descriptor.width = Resolution; + descriptor.graphicsFormat = CompatibleTextureFormat; + _Targets.RunLambda(texture => + { + texture.Release(); + texture.descriptor = descriptor; + texture.Create(); + }); + + _ReAllocateTexture = false; + + UpdateSamplingParameters(initialize: true); + } + +#if UNITY_EDITOR + [@OnChange] + private protected virtual void OnChange(string propertyPath, object previousValue) + { + switch (propertyPath) + { + case nameof(_Enabled): + SetEnabled((bool)previousValue, _Enabled); + break; + case nameof(_Resolution): + case nameof(_OverrideResolution): + case nameof(_TextureFormat): + case nameof(_TextureFormatMode): + ReAllocate(); + break; + } + } +#endif + } + + // API + partial class Lod + { + bool _ReAllocateTexture; + + void SetDirty(I previous, I current) where I : System.IEquatable + { + if (Equals(previous, current)) return; + _ReAllocateTexture = true; + } + + void SetDirty(System.Enum previous, System.Enum current) + { + if (previous == current) return; + _ReAllocateTexture = true; + } + } + + /// + /// Base type for simulations with a provider. + /// + /// The query provider. + public abstract class Lod : Lod where T : IQueryProvider + { + /// + /// Provides data from the GPU to CPU. + /// + public T Provider { get; set; } + private protected abstract T CreateProvider(bool enable); + + internal override void SetGlobals(bool enable) + { + base.SetGlobals(enable); + // We should always have a provider (null provider if disabled). + InitializeProvider(enable); + } + + private protected void InitializeProvider(bool enable) + { + Provider = CreateProvider(enable); + // None providers are not IQueryable. + Queryable = Provider as IQueryable; + } + + internal override void AfterExecute() + { + Queryable?.SendReadBack(_Water); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Lod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Lod.cs.meta new file mode 100644 index 0000000..46d3e62 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Lod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d523fdd33748548f0a78d6412c5420ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/PersistentLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/PersistentLod.cs new file mode 100644 index 0000000..74b1083 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/PersistentLod.cs @@ -0,0 +1,188 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + /// + /// A persistent simulation that moves around with a displacement LOD. + /// + [System.Serializable] + public abstract partial class PersistentLod : Lod + { + [Tooltip("Frequency to run the simulation, in updates per second.\n\nLower frequencies are more efficient but may lead to visible jitter or slowness.")] + [@Range(15, 200, order = -1000)] + [@GenerateAPI] + [SerializeField] + private protected int _SimulationFrequency = 60; + + static new class ShaderIDs + { + public static readonly int s_SimDeltaTime = Shader.PropertyToID("_Crest_SimDeltaTime"); + public static readonly int s_SimDeltaTimePrev = Shader.PropertyToID("_Crest_SimDeltaTimePrev"); + public static readonly int s_TemporaryPersistentTarget = Shader.PropertyToID("_Crest_TemporaryPersistentTarget"); + } + + private protected override bool NeedToReadWriteTextureData => true; + internal override int BufferCount => 2; + + float _PreviousSubstepDeltaTime = 1f / 60f; + + // Is this the first step since being enabled? + private protected bool _NeedsPrewarmingThisStep = true; + + // This is how far the simulation time is behind Unity's time. + private protected float _TimeToSimulate = 0f; + + internal int LastUpdateSubstepCount { get; private set; } + + private protected virtual int Kernel => 0; + private protected virtual bool SkipFlipBuffers => false; + private protected abstract ComputeShader SimulationShader { get; } + private protected abstract void GetSubstepData(float timeToSimulate, out int substeps, out float delta); + + internal override void Initialize() + { + if (SimulationShader == null) + { + _Valid = false; + return; + } + + base.Initialize(); + + _NeedsPrewarmingThisStep = true; + } + + internal override void ClearLodData() + { + base.ClearLodData(); + _Targets.RunLambda(x => Clear(x)); + } + + internal override void BuildCommandBuffer(WaterRenderer water, CommandBuffer buffer) + { + buffer.BeginSample(ID); + + if (!SkipFlipBuffers) + { + FlipBuffers(); + } + + var slices = water.LodLevels; + + // How far are we behind. + _TimeToSimulate += water.DeltaTime; + + // Do a set of substeps to catch up. + GetSubstepData(_TimeToSimulate, out var substeps, out var delta); + + LastUpdateSubstepCount = substeps; + + // Even if no steps were needed this frame, the simulation still needs to advect to + // compensate for camera motion / water scale changes, so do a trivial substep. + // This could be a specialised kernel that only advects, or the simulation shader + // could have a branch for 0 delta time. + if (substeps == 0) + { + substeps = 1; + delta = 0f; + } + + if (substeps > 1) + { + // No need to clear, as the update dispatch overwrites every pixel, but finding + // artifacts if not and there is a renderer input. Happens for foam and dynamic + // waves. Confusing/concerning. + buffer.GetTemporaryRT(ShaderIDs.s_TemporaryPersistentTarget, DataTexture.descriptor); + CoreUtils.SetRenderTarget(buffer, ShaderIDs.s_TemporaryPersistentTarget, ClearFlag.Color, ClearColor); + } + + var target = new RenderTargetIdentifier(DataTexture); + var source = new RenderTargetIdentifier(ShaderIDs.s_TemporaryPersistentTarget); + var current = target; + + var wrapper = new PropertyWrapperCompute(buffer, SimulationShader, Kernel); + + for (var substep = 0; substep < substeps; substep++) + { + var isFirstStep = substep == 0; + var frame = isFirstStep ? 1 : 0; + + // Record how much we caught up + _TimeToSimulate -= delta; + + // Buffers are already flipped, but we need to ping-pong for subsequent substeps. + if (!isFirstStep) + { + // Use temporary target for ping-pong instead of flipping buffer. We do not want + // to buffer substeps as they will not match buffered cascade data etc. Each buffer + // entry must be for a single frame and substeps are "sub-frame". + (source, target) = (target, source); + } + else + { + // We only want to handle teleports for the first step. + _NeedsPrewarmingThisStep = _NeedsPrewarmingThisStep || _Water._HasTeleportedThisFrame; + } + + // Both simulation update and input draws need delta time. + buffer.SetGlobalFloat(ShaderIDs.s_SimDeltaTime, delta); + buffer.SetGlobalFloat(ShaderIDs.s_SimDeltaTimePrev, _PreviousSubstepDeltaTime); + + wrapper.SetTexture(Crest.ShaderIDs.s_Target, target); + wrapper.SetTexture(_TextureSourceShaderID, isFirstStep ? _Targets.Previous(1) : source); + + // Compute which LOD data we are sampling source data from. if a scale change has + // happened this can be any LOD up or down the chain. This is only valid on the + // first update step, after that the scale source/target data are in the right + // places. + wrapper.SetFloat(Lod.ShaderIDs.s_LodChange, isFirstStep ? _Water.ScaleDifferencePower2 : 0); + + wrapper.SetVectorArray(WaterRenderer.ShaderIDs.s_CascadeDataSource, _Water._CascadeData.Previous(frame)); + wrapper.SetVectorArray(_SamplingParametersCascadeSourceShaderID, _SamplingParameters.Previous(frame)); + + SetAdditionalSimulationParameters(wrapper); + + var threads = Resolution / k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, Slices); + + // Only add forces if we did a step. + if (delta > 0f) + { + SubmitDraws(buffer, Inputs, target); + } + + // The very first step since being enabled. + _NeedsPrewarmingThisStep = false; + _PreviousSubstepDeltaTime = delta; + } + + // Swap textures if needed. + if (target != current) + { + buffer.CopyTexture(target, DataTexture); + } + + if (substeps > 1) + { + buffer.ReleaseTemporaryRT(ShaderIDs.s_TemporaryPersistentTarget); + } + + // Set the target texture as to make sure we catch the 'pong' each frame. + Shader.SetGlobalTexture(_TextureShaderID, DataTexture); + + buffer.EndSample(ID); + } + + /// + /// Set any simulation specific shader parameters. + /// + private protected virtual void SetAdditionalSimulationParameters(PropertyWrapperCompute properties) + { + + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/PersistentLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/PersistentLod.cs.meta new file mode 100644 index 0000000..b70f03b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/PersistentLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a33890a171f8e4118b7bdcd3776449d3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query.meta new file mode 100644 index 0000000..2a78ae9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ebdcedc44819444f581a6345b643e8b3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision.meta new file mode 100644 index 0000000..4c79139 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53c547efc6e8b4d068d60adf2aae4695 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionAreaVisualizer.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionAreaVisualizer.cs new file mode 100644 index 0000000..227542e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionAreaVisualizer.cs @@ -0,0 +1,130 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Debug draw crosses in an area around the GameObject on the water surface. + /// + [@ExecuteDuringEditMode] + [AddComponentMenu(Constants.k_MenuPrefixDebug + "Collision Area Visualizer")] + sealed class CollisionAreaVisualizer : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Tooltip(ICollisionProvider.k_LayerTooltip)] + [SerializeField] + internal CollisionLayer _Layer; + + [SerializeField] + float _ObjectWidth = 0f; + + [SerializeField] + float _StepSize = 5f; + + [SerializeField] + int _Steps = 10; + + [SerializeField] + bool _UseDisplacements; + + [SerializeField] + bool _UseNormals; + + float[] _ResultHeights; + Vector3[] _ResultDisplacements; + Vector3[] _ResultNormals; + Vector3[] _SamplePositions; + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + if (water.AnimatedWavesLod.Provider == null) + { + return; + } + + if (_ResultHeights == null || _ResultHeights.Length != _Steps * _Steps) + { + _ResultHeights = new float[_Steps * _Steps]; + } + if (_ResultDisplacements == null || _ResultDisplacements.Length != _Steps * _Steps) + { + _ResultDisplacements = new Vector3[_Steps * _Steps]; + } + if (_ResultNormals == null || _ResultNormals.Length != _Steps * _Steps) + { + _ResultNormals = new Vector3[_Steps * _Steps]; + + for (var i = 0; i < _ResultNormals.Length; i++) + { + _ResultNormals[i] = Vector3.up; + } + } + if (_SamplePositions == null || _SamplePositions.Length != _Steps * _Steps) + { + _SamplePositions = new Vector3[_Steps * _Steps]; + } + + var collProvider = water.AnimatedWavesLod.Provider; + + for (var i = 0; i < _Steps; i++) + { + for (var j = 0; j < _Steps; j++) + { + _SamplePositions[j * _Steps + i] = new(((i + 0.5f) - _Steps / 2f) * _StepSize, 0f, ((j + 0.5f) - _Steps / 2f) * _StepSize); + _SamplePositions[j * _Steps + i].x += transform.position.x; + _SamplePositions[j * _Steps + i].z += transform.position.z; + } + } + + var success = _UseDisplacements + ? collProvider.RetrieveSucceeded(collProvider.Query(GetHashCode(), _ObjectWidth, _SamplePositions, _ResultDisplacements, _UseNormals ? _ResultNormals : null, null, _Layer)) + : collProvider.RetrieveSucceeded(collProvider.Query(GetHashCode(), _ObjectWidth, _SamplePositions, _ResultHeights, _UseNormals ? _ResultNormals : null, null, _Layer)); + +#if !UNITY_EDITOR + // Gizmos handle this in editor. + if (success) + { + Render(water, Debug.DrawLine); + } +#endif + } + + internal void Render(WaterRenderer water, DebugUtility.DrawLine draw) + { + if (_SamplePositions == null) + { + return; + } + + for (var i = 0; i < _Steps; i++) + { + for (var j = 0; j < _Steps; j++) + { + var result = _SamplePositions[j * _Steps + i]; + + if (_UseDisplacements) + { + result.y = water.SeaLevel; + result += _ResultDisplacements[j * _Steps + i]; + } + else + { + result.y = _ResultHeights[j * _Steps + i]; + } + + var normal = _UseNormals ? _ResultNormals[j * _Steps + i] : Vector3.up; + DebugUtility.DrawCross(draw, result, normal, Mathf.Min(_StepSize / 4f, 1f), Color.green); + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionAreaVisualizer.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionAreaVisualizer.cs.meta new file mode 100644 index 0000000..d6668dc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionAreaVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 02e47243a77e64c84b8a2d351386a074 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionProvider.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionProvider.cs new file mode 100644 index 0000000..e5ba958 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionProvider.cs @@ -0,0 +1,77 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// NOTE: DWP2 depends on this file. Any API changes need to be communicated to the DWP2 authors in advance. + +using UnityEngine; + +// Linter does not support mixing inheritdoc plus defining own parameters. +#pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) + +namespace WaveHarmonic.Crest +{ + /// + /// A layer/event where queries are executed. + /// + [@GenerateDoc] + public enum CollisionLayer + { + /// + [Tooltip("Include all displacement.")] + Everything, + + /// + [Tooltip("Only include Animated Waves.")] + AfterAnimatedWaves, + + /// + [Tooltip("Include Animated Waves and Dynamic Waves.")] + AfterDynamicWaves, + } + + /// + /// Interface for an object that returns water surface displacement and height. + /// + public interface ICollisionProvider : IQueryProvider + { + internal const string k_LayerTooltip = "Which water collision layer to target."; + + internal static NoneProvider None { get; } = new(); + + /// + /// Gives a flat, still water. + /// + internal sealed class NoneProvider : ICollisionProvider + { + public int Query(int _0, float _1, Vector3[] _2, Vector3[] result0, Vector3[] result1, Vector3[] result2, CollisionLayer _3 = CollisionLayer.Everything) + { + if (result0 != null) System.Array.Fill(result0, Vector3.zero); + if (result1 != null) System.Array.Fill(result1, Vector3.up); + if (result2 != null) System.Array.Fill(result2, Vector3.zero); + return 0; + } + + public int Query(int _0, float _1, Vector3[] _2, float[] result0, Vector3[] result1, Vector3[] result2, CollisionLayer _3 = CollisionLayer.Everything) + { + if (result0 != null) System.Array.Fill(result0, WaterRenderer.Instance.SeaLevel); + if (result1 != null) System.Array.Fill(result1, Vector3.up); + if (result2 != null) System.Array.Fill(result2, Vector3.zero); + return 0; + } + } + + /// + /// Query water physical data at a set of points. Pass in null to any out parameters that are not required. + /// + /// Resulting heights (displacement Y + sea level) at the query positions. Pass null if this information is not required. + /// Resulting normals at the query positions. Pass null if this information is not required. + /// Resulting velocities at the query positions. Pass null if this information is not required. + /// + int Query(int hash, float minimumLength, Vector3[] points, float[] heights, Vector3[] normals, Vector3[] velocities, CollisionLayer layer = CollisionLayer.Everything); + + /// Resulting displacement vectors at the query positions. Add sea level to Y to get world space height. + /// + /// + int Query(int hash, float minimumLength, Vector3[] points, Vector3[] displacements, Vector3[] normals, Vector3[] velocities, CollisionLayer layer = CollisionLayer.Everything); + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionProvider.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionProvider.cs.meta new file mode 100644 index 0000000..621117c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55075bf334a1445828a0ad179248fe9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionQuery.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionQuery.cs new file mode 100644 index 0000000..d8f4dfa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionQuery.cs @@ -0,0 +1,163 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Samples water surface shape - displacement, height, normal, velocity. + /// + sealed class CollisionQuery : QueryBase, ICollisionProvider + { + public CollisionQuery(WaterRenderer water) : base(water) { } + protected override int Kernel => 0; + + public int Query(int ownerHash, float minSpatialLength, Vector3[] queryPoints, Vector3[] resultDisplacements, Vector3[] resultNormals, Vector3[] resultVelocities, CollisionLayer layer = CollisionLayer.Everything) + { + var result = (int)QueryStatus.OK; + + if (!UpdateQueryPoints(ownerHash, minSpatialLength, queryPoints, resultNormals != null ? queryPoints : null)) + { + result |= (int)QueryStatus.PostFailed; + } + + if (!RetrieveResults(ownerHash, resultDisplacements, null, resultNormals)) + { + result |= (int)QueryStatus.RetrieveFailed; + } + + if (resultVelocities != null) + { + result |= CalculateVelocities(ownerHash, resultVelocities); + } + + return result; + } + + public int Query(int ownerHash, float minimumSpatialLength, Vector3[] queryPoints, float[] resultHeights, Vector3[] resultNormals, Vector3[] resultVelocities, CollisionLayer layer = CollisionLayer.Everything) + { + var result = (int)QueryStatus.OK; + + if (!UpdateQueryPoints(ownerHash, minimumSpatialLength, queryPoints, resultNormals != null ? queryPoints : null)) + { + result |= (int)QueryStatus.PostFailed; + } + + if (!RetrieveResults(ownerHash, null, resultHeights, resultNormals)) + { + result |= (int)QueryStatus.RetrieveFailed; + } + + if (resultVelocities != null) + { + result |= CalculateVelocities(ownerHash, resultVelocities); + } + + return result; + } + } + + sealed class CollisionQueryWithPasses : ICollisionProvider, IQueryable + { + readonly CollisionQuery _AnimatedWaves; + readonly CollisionQuery _DynamicWaves; + readonly CollisionQuery _Displacement; + readonly WaterRenderer _Water; + + public int ResultGuidCount => _AnimatedWaves.ResultGuidCount + _DynamicWaves.ResultGuidCount + _Displacement.ResultGuidCount; + public int RequestCount => _AnimatedWaves.RequestCount + _DynamicWaves.RequestCount + _Displacement.RequestCount; + public int QueryCount => _AnimatedWaves.QueryCount + _DynamicWaves.QueryCount + _Displacement.QueryCount; + + public CollisionQueryWithPasses(WaterRenderer water) + { + _Water = water; + _AnimatedWaves = new(water); + _DynamicWaves = new(water); + _Displacement = new(water); + } + + // Gets the provider for the given layer, falling back to previous layer when needed. + CollisionQuery GetProvider(CollisionLayer layer) + { + var layers = _Water.AnimatedWavesLod._CollisionLayers; + + // Displacement is the fallback if there are no layers (ie single layer). + if (layers == CollisionLayers.Nothing) + { + return _Displacement; + } + + var everything = layer == CollisionLayer.Everything; + + // Displacement is the final layer, if present. + if (everything && layers.HasFlag(CollisionLayers.Displacement)) + { + return _Displacement; + } + + // Chosen/fallback to Dynamic Waves. + if ((everything || layer >= CollisionLayer.AfterDynamicWaves) && + layers.HasFlag(CollisionLayers.DynamicWaves) && _Water.DynamicWavesLod.Enabled) + { + return _DynamicWaves; + } + + // If not single layer, this is always present. + return _AnimatedWaves; + } + + public int Query(int hash, float minimumLength, Vector3[] points, float[] heights, Vector3[] normals, Vector3[] velocities, CollisionLayer layer = CollisionLayer.Everything) + { + return GetProvider(layer).Query(hash, minimumLength, points, heights, normals, velocities); + } + + public int Query(int hash, float minimumLength, Vector3[] points, Vector3[] displacements, Vector3[] normals, Vector3[] velocities, CollisionLayer layer = CollisionLayer.Everything) + { + return GetProvider(layer).Query(hash, minimumLength, points, displacements, normals, velocities); + } + + public void UpdateQueries(WaterRenderer water, CollisionLayer layer) + { + switch (layer) + { + case CollisionLayer.Everything: _Displacement.UpdateQueries(water); break; + case CollisionLayer.AfterAnimatedWaves: _AnimatedWaves.UpdateQueries(water); break; + case CollisionLayer.AfterDynamicWaves: _DynamicWaves.UpdateQueries(water); break; + } + } + + public void UpdateQueries(WaterRenderer water) + { + _Displacement.UpdateQueries(water); + } + + public void SendReadBack(WaterRenderer water, CollisionLayers layers) + { + // Will only submit readback if there are queries. + _AnimatedWaves.SendReadBack(water); + _DynamicWaves.SendReadBack(water); + _Displacement.SendReadBack(water); + } + + public void SendReadBack(WaterRenderer water) + { + _Displacement.SendReadBack(water); + } + + public void CleanUp() + { + _AnimatedWaves.CleanUp(); + _DynamicWaves.CleanUp(); + _Displacement.CleanUp(); + } + } + + static partial class Extensions + { + public static void UpdateQueries(this ICollisionProvider self, WaterRenderer water, CollisionLayer layer) => (self as CollisionQueryWithPasses)?.UpdateQueries(water, layer); + public static void UpdateQueries(this ICollisionProvider self, WaterRenderer water) => (self as IQueryable)?.UpdateQueries(water); + public static void SendReadBack(this ICollisionProvider self, WaterRenderer water, CollisionLayers layer) => (self as CollisionQueryWithPasses)?.SendReadBack(water, layer); + public static void CleanUp(this ICollisionProvider self) => (self as IQueryable)?.CleanUp(); + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionQuery.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionQuery.cs.meta new file mode 100644 index 0000000..b447e60 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/CollisionQuery.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3cddd187674954ce1a0e2e19017a744a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceHelper.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceHelper.cs new file mode 100644 index 0000000..28b23f3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceHelper.cs @@ -0,0 +1,98 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Helper to trace a ray against the water surface. + /// + /// + /// Works by sampling at a set of points along the ray and interpolating the + /// intersection location. + /// + public sealed class RayCastHelper : Internal.SampleHelper + { + readonly float _RayStepSize; + readonly float _MinimumLength; + + /// + /// The length of the ray and the step size must be given here. The smaller the step size, the greater the accuracy. + /// + /// Length of the ray. + /// Size of the step. With length the number of steps is computed. + public RayCastHelper(float rayLength, float rayStepSize = 2f) : base(ComputeQueryCount(rayLength, ref rayStepSize)) + { + _RayStepSize = rayStepSize; + // Waves go max double along min length. Thats too much - only allow half of a wave per step. + _MinimumLength = _RayStepSize * 4f; + } + + static int ComputeQueryCount(float rayLength, ref float rayStepSize) + { + Debug.Assert(rayLength > 0f); + Debug.Assert(rayStepSize > 0f); + + var stepCount = Mathf.CeilToInt(rayLength / rayStepSize) + 1; + + var maxStepCount = 128; + if (stepCount > maxStepCount) + { + stepCount = maxStepCount; + rayStepSize = rayLength / (stepCount - 1f); + Debug.LogWarning($"Crest: RayTraceHelper: ray steps exceed maximum ({maxStepCount}), step size increased to {rayStepSize} to reduce step count."); + } + + return stepCount; + } + + /// + /// Call this once each frame to do the query. + /// + /// World space position of ray origin + /// World space ray direction + /// The distance along the ray to the first intersection with the water surface. + /// The layer this ray targets. + /// True if the results have come back from the GPU, and if the ray intersects the water surface. + public bool RayCast(Vector3 origin, Vector3 direction, out float distance, CollisionLayer layer = CollisionLayer.Everything) + { + distance = -1f; + + Validate(allowMultipleCallsPerFrame: false); + + var water = WaterRenderer.Instance; + var provider = water == null ? null : water.AnimatedWavesLod.Provider; + if (provider == null) return false; + + for (var i = 0; i < _QueryPosition.Length; i++) + { + _QueryPosition[i] = origin + i * _RayStepSize * direction; + } + + var status = provider.Query(GetHashCode(), _MinimumLength, _QueryPosition, _QueryResult, null, null, layer); + + if (!provider.RetrieveSucceeded(status)) + { + return false; + } + + // Now that data is available, compare the height of the water to the height of each point of the ray. If + // the ray crosses the surface, the distance to the intersection is interpolated from the heights. + for (var i = 1; i < _QueryPosition.Length; i++) + { + var height0 = _QueryResult[i - 1].y + water.SeaLevel - _QueryPosition[i - 1].y; + var height1 = _QueryResult[i].y + water.SeaLevel - _QueryPosition[i].y; + + if (Mathf.Sign(height0) != Mathf.Sign(height1)) + { + var prop = Mathf.Abs(height0) / (Mathf.Abs(height0) + Mathf.Abs(height1)); + distance = (i - 1 + prop) * _RayStepSize; + break; + } + } + + return distance >= 0f; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceHelper.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceHelper.cs.meta new file mode 100644 index 0000000..77172df --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1f458d6962ed46be8f00bdff45b2725 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceVisualizer.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceVisualizer.cs new file mode 100644 index 0000000..aacb941 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceVisualizer.cs @@ -0,0 +1,45 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Debug draw a line trace from this gameobjects position, in this gameobjects forward direction. + /// + [@ExecuteDuringEditMode] + [AddComponentMenu(Constants.k_MenuPrefixDebug + "Ray Cast Visualizer")] + sealed class RayTraceVisualizer : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + readonly RayCastHelper _RayCast = new(50f, 2f); + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + if (water.AnimatedWavesLod.Provider == null) + { + return; + } + + // Even if only a single ray trace is desired, this still must be called every frame until it returns true + if (_RayCast.RayCast(transform.position, transform.forward, out var dist)) + { + var endPos = transform.position + transform.forward * dist; + Debug.DrawLine(transform.position, endPos, Color.green); + DebugUtility.DrawCross(Debug.DrawLine, endPos, 2f, Color.green, 0f); + } + else + { + Debug.DrawLine(transform.position, transform.position + transform.forward * 50f, Color.red); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceVisualizer.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceVisualizer.cs.meta new file mode 100644 index 0000000..9bb58c4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Collision/RayTraceVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 159faa53a32b34aff9d79e974c14d100 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth.meta new file mode 100644 index 0000000..2c012b2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a9f84066852dc4c839cf39679aa347db +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthProvider.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthProvider.cs new file mode 100644 index 0000000..acaa355 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthProvider.cs @@ -0,0 +1,34 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +// Linter does not support mixing inheritdoc plus defining own parameters. +#pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) + +namespace WaveHarmonic.Crest +{ + /// + /// Interface for an object that returns water depth and distance to water edge. + /// + public interface IDepthProvider : IQueryProvider + { + internal static NoneProvider None { get; } = new(); + + internal sealed class NoneProvider : IDepthProvider + { + public int Query(int _0, float _1, Vector3[] _2, Vector3[] result) + { + if (result != null) System.Array.Clear(result, 0, result.Length); + return 0; + } + } + + /// + /// Query water depth data at a set of points. + /// + /// Water depth and distance to shoreline (XY respectively). Both are signed. + /// + int Query(int hash, float minimumLength, Vector3[] points, Vector3[] results); + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthProvider.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthProvider.cs.meta new file mode 100644 index 0000000..eaa0bf2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c8c76a0ab417499bb25ecea61560108 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthQuery.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthQuery.cs new file mode 100644 index 0000000..aaf71d6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthQuery.cs @@ -0,0 +1,30 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + sealed class DepthQuery : QueryBase, IDepthProvider + { + public DepthQuery(WaterRenderer water) : base(water) { } + protected override int Kernel => 2; + + public override int Query(int hash, float minimumSpatialLength, Vector3[] queries, Vector3[] results) + { + var id = base.Query(hash, minimumSpatialLength, queries, results); + + // Infinity will become NaN. Convert back to infinity. + // Negative infinity should not happen. + for (var i = 0; i < results.Length; i++) + { + var value = results[i]; + if (float.IsNaN(value.x)) value.x = float.PositiveInfinity; + if (float.IsNaN(value.y)) value.y = float.PositiveInfinity; + results[i] = value; + } + + return id; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthQuery.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthQuery.cs.meta new file mode 100644 index 0000000..a21e0fc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Depth/DepthQuery.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 92350636082384718babd120eff1cbf0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow.meta new file mode 100644 index 0000000..6c44f99 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cacd27cd27186443ba5376920b9fd300 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowProvider.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowProvider.cs new file mode 100644 index 0000000..ac3e4df --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowProvider.cs @@ -0,0 +1,37 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +// Linter does not support mixing inheritdoc + defining own parameters. +#pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) + +namespace WaveHarmonic.Crest +{ + /// + /// Interface for an object that returns water surface displacement and height. + /// + public interface IFlowProvider : IQueryProvider + { + internal static NoneProvider None { get; } = new(); + + /// + /// Gives a stationary water (no horizontal flow). + /// + internal sealed class NoneProvider : IFlowProvider + { + public int Query(int _0, float _1, Vector3[] _2, Vector3[] result) + { + if (result != null) System.Array.Clear(result, 0, result.Length); + return 0; + } + } + + /// + /// Query water flow data (horizontal motion) at a set of points. + /// + /// Water surface flow velocities at the query positions. + /// + int Query(int hash, float minimumLength, Vector3[] points, Vector3[] results); + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowProvider.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowProvider.cs.meta new file mode 100644 index 0000000..4fce3e2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c710a5a446bea43bdbd39db4be198f98 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowQuery.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowQuery.cs new file mode 100644 index 0000000..36fface --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowQuery.cs @@ -0,0 +1,14 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +namespace WaveHarmonic.Crest +{ + /// + /// Samples horizontal motion of water volume + /// + sealed class FlowQuery : QueryBase, IFlowProvider + { + public FlowQuery(WaterRenderer water) : base(water) { } + protected override int Kernel => 1; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowQuery.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowQuery.cs.meta new file mode 100644 index 0000000..09c3816 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Flow/FlowQuery.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a646106f5d35b4abea362416da973f83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Query.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Query.cs new file mode 100644 index 0000000..f2f85be --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Query.cs @@ -0,0 +1,650 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Potential improvements +// - Half return values +// - Half minGridSize + +using System.Collections.Generic; +using Unity.Collections; +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + /// + /// Base interface for providers. + /// + public interface IQueryProvider + { + // NOTE: Here for documentation reuse. + /// Unique ID for calling code. Typically acquired by calling GetHashCode. + /// The minimum spatial length of the object, such as the width of a boat. Useful for filtering out detail when not needed. Set to zero to get full available detail. + /// The world space points that will be queried. + /// The layer this query targets. + /// The status of the query. + internal static int Query(int hash, float minimumLength, Vector3[] points, int layer) => 0; + + /// + /// Check if the query results could be retrieved successfully using the return code + /// from Query method. + /// + /// The query status returned from Query. + /// Whether the retrieve was successful. + bool RetrieveSucceeded(int status) + { + return (status & (int)QueryBase.QueryStatus.RetrieveFailed) == 0; + } + } + + interface IQueryable + { + int ResultGuidCount { get; } + int RequestCount { get; } + int QueryCount { get; } + void UpdateQueries(WaterRenderer water); + void SendReadBack(WaterRenderer water); + void CleanUp(); + } + + /// + /// Provides heights and other physical data about the water surface. Works by uploading query positions to GPU and computing + /// the data and then transferring back the results asynchronously. An exception to this is water surface velocities - these can + /// not be computed on the GPU and are instead computed on the CPU by retaining last frames' query results and computing finite diffs. + /// + abstract class QueryBase : IQueryable + { + protected abstract int Kernel { get; } + + // 4 was enough for a long time, but Linux setups seems to demand 7 + const int k_MaximumRequests = 7; + const int k_MaximumGuids = 1024; + + // We need only two additional queries to compute normals. + const int k_NormalAdditionalQueryCount = 2; + + readonly WaterRenderer _Water; + + readonly PropertyWrapperCompute _Wrapper; + + readonly System.Action _DataArrivedAction; + + // Must match value in compute shader + const int k_ComputeGroupSize = 64; + + static class ShaderIDs + { + public static readonly int s_QueryPositions_MinimumGridSizes = Shader.PropertyToID("_Crest_QueryPositions_MinimumGridSizes"); + } + + + const float k_FiniteDifferenceDx = 0.1f; + + readonly ComputeBuffer _ComputeBufferQueries; + readonly ComputeBuffer _ComputeBufferResults; + + internal const int k_DefaultMaximumQueryCount = 4096; + + readonly int _MaximumQueryCount = k_DefaultMaximumQueryCount; + readonly Vector3[] _QueryPositionXZ_MinimumGridSize = new Vector3[k_DefaultMaximumQueryCount]; + + /// + /// Holds information about all query points. Maps from unique hash code to position in point array. + /// + sealed class SegmentRegistrar + { + // Map from guids to (segment start index, segment end index, frame number when query was made) + public Dictionary _Segments = new(); + public int _QueryCount = 0; + } + + /// + /// Since query results return asynchronously and may not return at all (in theory), we keep a ringbuffer + /// of the registrars of the last frames so that when data does come back it can be interpreted correctly. + /// + sealed class SegmentRegistrarRingBuffer + { + // Requests in flight plus 2 held values, plus one current + static readonly int s_PoolSize = k_MaximumRequests + 2 + 1; + + readonly SegmentRegistrar[] _Segments = new SegmentRegistrar[s_PoolSize]; + + public int _SegmentRelease = 0; + public int _SegmentAcquire = 0; + + public SegmentRegistrar Current => _Segments[_SegmentAcquire]; + + public SegmentRegistrarRingBuffer() + { + for (var i = 0; i < _Segments.Length; i++) + { + _Segments[i] = new(); + } + } + + public void AcquireNew() + { + var lastIndex = _SegmentAcquire; + + { + var newSegmentAcquire = (_SegmentAcquire + 1) % _Segments.Length; + + if (newSegmentAcquire == _SegmentRelease) + { + // The last index has incremented and landed on the first index. This shouldn't happen normally, but + // can happen if the Scene and Game view are not visible, in which case async readbacks dont get processed + // and the pipeline blocks up. +#if !UNITY_EDITOR + Debug.LogError("Crest: Query ring buffer exhausted. Please report this to developers."); +#endif + return; + } + + _SegmentAcquire = newSegmentAcquire; + } + + // Copy the registrations across from the previous frame. This makes queries persistent. This is needed because + // queries are often made from FixedUpdate(), and at high framerates this may not be called, which would mean + // the query would get lost and this leads to stuttering and other artifacts. + { + _Segments[_SegmentAcquire]._QueryCount = 0; + _Segments[_SegmentAcquire]._Segments.Clear(); + + foreach (var segment in _Segments[lastIndex]._Segments) + { + var age = Time.frameCount - segment.Value.z; + + // Don't keep queries around if they have not be active in the last 10 frames + if (age < 10) + { + // Compute a new segment range - we may have removed some segments that were too old, so this ensures + // we have a nice compact array of queries each frame rather than accumulating persistent air bubbles + var newSegment = segment.Value; + newSegment.x = _Segments[_SegmentAcquire]._QueryCount; + newSegment.y = newSegment.x + (segment.Value.y - segment.Value.x); + _Segments[_SegmentAcquire]._QueryCount = newSegment.y + 1; + + _Segments[_SegmentAcquire]._Segments.Add(segment.Key, newSegment); + } + } + } + } + + public void ReleaseLast() + { + _SegmentRelease = (_SegmentRelease + 1) % _Segments.Length; + } + + public void RemoveRegistrations(int key) + { + // Remove the guid for all of the next spare segment registrars. However, don't touch the ones that are being + // used for active requests. + var i = _SegmentAcquire; + while (true) + { + if (_Segments[i]._Segments.ContainsKey(key)) + { + _Segments[i]._Segments.Remove(key); + } + + i = (i + 1) % _Segments.Length; + + if (i == _SegmentRelease) + { + break; + } + } + } + + public void ClearAvailable() + { + // Extreme approach - flush all segments for next spare registrars (but don't touch ones being used for active requests) + var i = _SegmentAcquire; + while (true) + { + _Segments[i]._Segments.Clear(); + _Segments[i]._QueryCount = 0; + + i = (i + 1) % _Segments.Length; + + if (i == _SegmentRelease) + { + break; + } + } + } + + public void ClearAll() + { + for (var i = 0; i < _Segments.Length; i++) + { + _Segments[i]._QueryCount = 0; + _Segments[i]._Segments.Clear(); + } + } + } + + readonly SegmentRegistrarRingBuffer _SegmentRegistrarRingBuffer = new(); + + NativeArray _QueryResults; + float _QueryResultsTime = -1f; + Dictionary _ResultSegments; + + NativeArray _QueryResultsLast; + float _QueryResultsTimeLast = -1f; + Dictionary _ResultSegmentsLast; + + struct ReadbackRequest + { + public AsyncGPUReadbackRequest _Request; + public float _DataTimestamp; + public Dictionary _Segments; + } + + readonly List _Requests = new(); + + public enum QueryStatus + { + OK = 0, + RetrieveFailed = 1, + PostFailed = 2, + NotEnoughDataForVels = 4, + VelocityDataInvalidated = 8, + InvalidDtForVelocity = 16, + } + + public QueryBase(WaterRenderer water) + { + _Water = water; + + _DataArrivedAction = new(DataArrived); + + if (_MaximumQueryCount != water._AnimatedWavesLod.MaximumQueryCount) + { + _MaximumQueryCount = water._AnimatedWavesLod.MaximumQueryCount; + _QueryPositionXZ_MinimumGridSize = new Vector3[_MaximumQueryCount]; + } + + _ComputeBufferQueries = new(_MaximumQueryCount, 12, ComputeBufferType.Default); + _ComputeBufferResults = new(_MaximumQueryCount, 12, ComputeBufferType.Default); + + _QueryResults = new(_MaximumQueryCount, Allocator.Persistent, NativeArrayOptions.ClearMemory); + _QueryResultsLast = new(_MaximumQueryCount, Allocator.Persistent, NativeArrayOptions.ClearMemory); + + var shader = WaterResources.Instance.Compute._Query; + if (shader == null) + { + Debug.LogError($"Crest: Could not load Query compute shader"); + return; + } + _Wrapper = new(water.SimulationBuffer, shader, Kernel); + } + + /// + /// Takes a unique request ID and some world space XZ positions, and computes the displacement vector that lands at this position, + /// to a good approximation. The world space height of the water at that position is then SeaLevel + displacement.y. + /// + protected bool UpdateQueryPoints(int ownerHash, float minSpatialLength, Vector3[] queryPoints, Vector3[] queryNormals) + { + if (queryPoints.Length + _SegmentRegistrarRingBuffer.Current._QueryCount > _MaximumQueryCount) + { + Debug.LogError($"Crest: Max query count ({_MaximumQueryCount}) exceeded, increase the max query count in the Animated Waves Settings to support a higher number of queries."); + return false; + } + + var segmentRetrieved = false; + + // We'll send in 2 points to get normals + var countPts = queryPoints != null ? queryPoints.Length : 0; + var countNorms = queryNormals != null ? queryNormals.Length : 0; + var countTotal = countPts + countNorms * k_NormalAdditionalQueryCount; + + if (_SegmentRegistrarRingBuffer.Current._Segments.TryGetValue(ownerHash, out var segment)) + { + var segmentSize = segment.y - segment.x + 1; + if (segmentSize == countTotal) + { + // Update frame count + segment.z = Time.frameCount; + _SegmentRegistrarRingBuffer.Current._Segments[ownerHash] = segment; + + segmentRetrieved = true; + } + else + { + _SegmentRegistrarRingBuffer.Current._Segments.Remove(ownerHash); + } + } + + if (countTotal == 0) + { + // No query data + return false; + } + + if (!segmentRetrieved) + { + if (_SegmentRegistrarRingBuffer.Current._Segments.Count >= k_MaximumGuids) + { + Debug.LogError("Crest: Too many guids registered with CollProviderCompute. Increase s_maxGuids."); + return false; + } + + segment.x = _SegmentRegistrarRingBuffer.Current._QueryCount; + segment.y = segment.x + countTotal - 1; + segment.z = Time.frameCount; + _SegmentRegistrarRingBuffer.Current._Segments.Add(ownerHash, segment); + + _SegmentRegistrarRingBuffer.Current._QueryCount += countTotal; + + //Debug.Log("Crest: Added points for " + guid); + } + + // The smallest wavelengths should repeat no more than twice across the smaller spatial length. Unless we're + // in the last LOD - then this is the best we can do. + var minWavelength = minSpatialLength / 2f; + var samplesPerWave = 2f; + var minGridSize = minWavelength / samplesPerWave; + + if (countPts + segment.x > _QueryPositionXZ_MinimumGridSize.Length) + { + Debug.LogError("Crest: Too many wave height queries. Increase Max Query Count in the Animated Waves Settings."); + return false; + } + + for (var pointi = 0; pointi < countPts; pointi++) + { + _QueryPositionXZ_MinimumGridSize[pointi + segment.x].x = queryPoints[pointi].x; + _QueryPositionXZ_MinimumGridSize[pointi + segment.x].y = queryPoints[pointi].z; + _QueryPositionXZ_MinimumGridSize[pointi + segment.x].z = minGridSize; + } + + // To compute each normal, post 2 query points (reuse point above) + for (var normi = 0; normi < countNorms; normi++) + { + var arrIdx = segment.x + countPts + k_NormalAdditionalQueryCount * normi; + + _QueryPositionXZ_MinimumGridSize[arrIdx].x = queryNormals[normi].x + k_FiniteDifferenceDx; + _QueryPositionXZ_MinimumGridSize[arrIdx].y = queryNormals[normi].z; + _QueryPositionXZ_MinimumGridSize[arrIdx].z = minGridSize; + + arrIdx += 1; + + _QueryPositionXZ_MinimumGridSize[arrIdx].x = queryNormals[normi].x; + _QueryPositionXZ_MinimumGridSize[arrIdx].y = queryNormals[normi].z + k_FiniteDifferenceDx; + _QueryPositionXZ_MinimumGridSize[arrIdx].z = minGridSize; + } + + return true; + } + + /// + /// Signal that we're no longer servicing queries. Note this leaves an air bubble in the query buffer. + /// + void RemoveQueryPoints(int guid) + { + _SegmentRegistrarRingBuffer.RemoveRegistrations(guid); + } + + /// + /// Remove air bubbles from the query array. Currently this lazily just nukes all the registered + /// query IDs so they'll be recreated next time (generating garbage). + /// + void CompactQueryStorage() + { + _SegmentRegistrarRingBuffer.ClearAvailable(); + } + + /// + /// Copy out displacements, heights, normals. Pass null if info is not required. + /// + protected bool RetrieveResults(int guid, Vector3[] displacements, float[] heights, Vector3[] normals) + { + if (_ResultSegments == null) + { + return false; + } + + // Check if there are results that came back for this guid + if (!_ResultSegments.TryGetValue(guid, out var segment)) + { + // Guid not found - no result + return false; + } + + var countPoints = 0; + if (displacements != null) countPoints = displacements.Length; + if (heights != null) countPoints = heights.Length; + if (displacements != null && heights != null) Debug.Assert(displacements.Length == heights.Length); + var countNorms = normals != null ? normals.Length : 0; + + if (countPoints > 0) + { + // Retrieve Results + if (displacements != null) _QueryResults.Slice(segment.x, countPoints).CopyTo(displacements); + + // Retrieve Result heights + if (heights != null) + { + var seaLevel = _Water.SeaLevel; + for (var i = 0; i < countPoints; i++) + { + heights[i] = seaLevel + _QueryResults[i + segment.x].y; + } + } + } + + if (countNorms > 0) + { + var firstNorm = segment.x + countPoints; + + var dx = -Vector3.right * k_FiniteDifferenceDx; + var dz = -Vector3.forward * k_FiniteDifferenceDx; + for (var i = 0; i < countNorms; i++) + { + var p = _QueryResults[i + segment.x]; + var px = dx + _QueryResults[firstNorm + k_NormalAdditionalQueryCount * i]; + var pz = dz + _QueryResults[firstNorm + k_NormalAdditionalQueryCount * i + 1]; + + normals[i] = Vector3.Cross(p - px, p - pz).normalized; + normals[i].y *= -1f; + } + } + + return true; + } + + /// + /// Compute time derivative of the displacements by calculating difference from last query. More complicated than it would seem - results + /// may not be available in one or both of the results, or the query locations in the array may change. + /// + protected int CalculateVelocities(int ownerHash, Vector3[] results) + { + // Need at least 2 returned results to do finite difference + if (_QueryResultsTime < 0f || _QueryResultsTimeLast < 0f) + { + return 1; + } + + if (!_ResultSegments.TryGetValue(ownerHash, out var segment)) + { + return (int)QueryStatus.RetrieveFailed; + } + + if (!_ResultSegmentsLast.TryGetValue(ownerHash, out var segmentLast)) + { + return (int)QueryStatus.NotEnoughDataForVels; + } + + if ((segment.y - segment.x) != (segmentLast.y - segmentLast.x)) + { + // Number of queries changed - can't handle that + return (int)QueryStatus.VelocityDataInvalidated; + } + + var dt = _QueryResultsTime - _QueryResultsTimeLast; + if (dt < 0.0001f) + { + return (int)QueryStatus.InvalidDtForVelocity; + } + + var count = results.Length; + for (var i = 0; i < count; i++) + { + results[i] = (_QueryResults[i + segment.x] - _QueryResultsLast[i + segmentLast.x]) / dt; + } + + return 0; + } + + /// + /// Per-frame update callback. + /// + /// The current . + public void UpdateQueries(WaterRenderer water) + { +#if UNITY_EDITOR + // Seems to be a terrible memory leak coming from creating async GPU readbacks. + // This was marked as resolved by Unity and confirmed fixed by forum posts. + // May be worth keeping. See issue #630 for more details. + if (!water._HeightQueries && !Application.isPlaying) return; +#endif + + if (_SegmentRegistrarRingBuffer.Current._QueryCount > 0) + { + ExecuteQueries(); + } + } + + public void SendReadBack(WaterRenderer water) + { +#if UNITY_EDITOR + // Seems to be a terrible memory leak coming from creating async GPU readbacks. + // This was marked as resolved by Unity and confirmed fixed by forum posts. + // May be worth keeping. See issue #630 for more details. + if (!water._HeightQueries && !Application.isPlaying) return; +#endif + + if (_SegmentRegistrarRingBuffer.Current._QueryCount > 0) + { + // Remove oldest requests if we have hit the limit + while (_Requests.Count >= k_MaximumRequests) + { + _Requests.RemoveAt(0); + } + + ReadbackRequest request; + request._DataTimestamp = Time.time - Time.deltaTime; + request._Request = AsyncGPUReadback.Request(_ComputeBufferResults, _DataArrivedAction); + request._Segments = _SegmentRegistrarRingBuffer.Current._Segments; + _Requests.Add(request); + + _SegmentRegistrarRingBuffer.AcquireNew(); + } + } + + void ExecuteQueries() + { + _ComputeBufferQueries.SetData(_QueryPositionXZ_MinimumGridSize, 0, 0, _SegmentRegistrarRingBuffer.Current._QueryCount); + _Wrapper.SetBuffer(ShaderIDs.s_QueryPositions_MinimumGridSizes, _ComputeBufferQueries); + _Wrapper.SetBuffer(Crest.ShaderIDs.s_Target, _ComputeBufferResults); + + var numGroups = (_SegmentRegistrarRingBuffer.Current._QueryCount + k_ComputeGroupSize - 1) / k_ComputeGroupSize; + _Wrapper.Dispatch(numGroups, 1, 1); + } + + /// + /// Called when a compute buffer has been read back from the GPU to the CPU. + /// + void DataArrived(AsyncGPUReadbackRequest req) + { + // Can get callbacks after disable, so detect this. + if (!_QueryResults.IsCreated) + { + _Requests.Clear(); + return; + } + + // Remove any error requests + for (var i = _Requests.Count - 1; i >= 0; --i) + { + if (_Requests[i]._Request.hasError) + { + _Requests.RemoveAt(i); + _SegmentRegistrarRingBuffer.ReleaseLast(); + } + } + + // Find the last request that was completed + var lastDoneIndex = _Requests.Count - 1; + while (lastDoneIndex >= 0 && !_Requests[lastDoneIndex]._Request.done) + { + --lastDoneIndex; + } + + // If there is a completed request, process it + if (lastDoneIndex >= 0) + { + // Update "last" results + (_QueryResults, _QueryResultsLast) = (_QueryResultsLast, _QueryResults); + _QueryResultsTimeLast = _QueryResultsTime; + _ResultSegmentsLast = _ResultSegments; + + var data = _Requests[lastDoneIndex]._Request.GetData(); + data.CopyTo(_QueryResults); + _QueryResultsTime = _Requests[lastDoneIndex]._DataTimestamp; + _ResultSegments = _Requests[lastDoneIndex]._Segments; + } + + // Remove all the requests up to the last completed one + for (var i = lastDoneIndex; i >= 0; --i) + { + _Requests.RemoveAt(i); + _SegmentRegistrarRingBuffer.ReleaseLast(); + } + } + + /// + /// On destroy, to clean up resources. + /// + public void CleanUp() + { + _ComputeBufferQueries.Dispose(); + _ComputeBufferResults.Dispose(); + + if (_QueryResults.IsCreated) _QueryResults.Dispose(); + if (_QueryResultsLast.IsCreated) _QueryResultsLast.Dispose(); + + _SegmentRegistrarRingBuffer.ClearAll(); + } + + public virtual int Query(int ownerHash, float minSpatialLength, Vector3[] queryPoints, Vector3[] results) + { + var result = (int)QueryStatus.OK; + + if (!UpdateQueryPoints(ownerHash, minSpatialLength, queryPoints, null)) + { + result |= (int)QueryStatus.PostFailed; + } + + if (!RetrieveResults(ownerHash, results, null, null)) + { + result |= (int)QueryStatus.RetrieveFailed; + } + + return result; + } + + public int ResultGuidCount => _ResultSegments != null ? _ResultSegments.Count : 0; + + public int RequestCount => _Requests != null ? _Requests.Count : 0; + + public int QueryCount => _SegmentRegistrarRingBuffer != null ? _SegmentRegistrarRingBuffer.Current._QueryCount : 0; + } + + static partial class Extensions + { + public static void UpdateQueries(this IQueryProvider self, WaterRenderer water) => (self as IQueryable)?.UpdateQueries(water); + public static void CleanUp(this IQueryProvider self) => (self as IQueryable)?.CleanUp(); + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Query.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Query.cs.meta new file mode 100644 index 0000000..eea3ffe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/Query.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b047926acd1d644acb5797a1d2b7b7b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/QueryEvents.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/QueryEvents.cs new file mode 100644 index 0000000..504b3e1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/QueryEvents.cs @@ -0,0 +1,263 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Events; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// What transform to use for queries. + /// + [@GenerateDoc] + public enum QuerySource + { + /// + [Tooltip("This game object's transform.")] + Transform, + + /// + [Tooltip("The viewer's transform.\n\nThe viewer is the main camera the system uses.")] + Viewer + } + + /// + /// Emits events (UnityEvents) based on the sampled water data. + /// + [AddComponentMenu(Constants.k_MenuPrefixScripts + "Query Events")] + [@HelpURL("Manual/Events.html#query-events")] + public sealed partial class QueryEvents : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + + [Tooltip("What transform should the queries be based on.\n\n\"Viewer\" will reuse queries already performed by the Water Renderer")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + QuerySource _Source; + + [Tooltip(ICollisionProvider.k_LayerTooltip)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal CollisionLayer _Layer; + + + [Header("Distance From Water Surface")] + + [Tooltip("The minimum wavelength for queries.\n\nThe higher the value, the more smaller waves will be ignored when sampling the water surface.")] + [@Predicated(nameof(_Source), inverted: true, nameof(QuerySource.Transform))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _MinimumWavelength = 1f; + + [@Label("Signed")] + [Tooltip("Whether to keep the sign of the value (ie positive/negative).\n\nA positive value means the query point is above the surface, while a negative means it below the surface.")] + [@Predicated(nameof(_DistanceFromSurfaceUseCurve), inverted: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _DistanceFromSurfaceSigned; + + [@Label("Maximum Distance")] + [Tooltip("The maximum distance.\n\nAlways use a real distance in real units (ie not normalized).")] + [@GenerateAPI] + [UnityEngine.Serialization.FormerlySerializedAs("_MaximumDistance")] + [@DecoratedField, SerializeField] + float _DistanceFromSurfaceMaximum = 100f; + + [@Label("Use Curve")] + [Tooltip("Whether to apply a curve to the distance.\n\nNormalizes and inverts the distance to be between zero and one, then applies a curve.")] + [@GenerateAPI] + [UnityEngine.Serialization.FormerlySerializedAs("_NormaliseDistance")] + [@DecoratedField, SerializeField] + bool _DistanceFromSurfaceUseCurve = true; + + [@Label("Curve")] + [Tooltip("Apply a curve to the distance.\n\nValues towards \"one\" means closer to the water surface.")] + [@Predicated(nameof(_DistanceFromSurfaceUseCurve))] + [@GenerateAPI] + [UnityEngine.Serialization.FormerlySerializedAs("_DistanceCurve")] + [@DecoratedField, SerializeField] + AnimationCurve _DistanceFromSurfaceCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f); + + + [Header("Distance From Water Edge")] + + [@Label("Signed")] + [Tooltip("Whether to keep the sign of the value (ie positive/negative).\n\nA positive value means the query point is over water, while a negative means it is over land.")] + [@Predicated(nameof(_DistanceFromEdgeUseCurve), inverted: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _DistanceFromEdgeSigned; + + [@Label("Maximum Distance")] + [Tooltip("The maximum distance.\n\nAlways use a real distance in real units (ie not normalized).")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _DistanceFromEdgeMaximum = 100f; + + [@Label("Use Curve")] + [Tooltip("Apply a curve to the distance.\n\nNormalizes and inverts the distance to be between zero and one, then applies a curve.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _DistanceFromEdgeUseCurve = true; + + [@Label("Curve")] + [Tooltip("Apply a curve to the distance.\n\nValues towards \"one\" means closer to the water's edge.")] + [@Predicated(nameof(_DistanceFromEdgeUseCurve))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + AnimationCurve _DistanceFromEdgeCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f); + + + [Header("Events")] + + [Tooltip("Triggers when game object goes below water surface.\n\nTriggers once per state change.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + UnityEvent _OnBelowWater = new(); + + [Tooltip("Triggers when game object goes above water surface.\n\nTriggers once per state change.")] + [@GenerateAPI] + [SerializeField] + UnityEvent _OnAboveWater = new(); + + [Tooltip("Sends the distance from the water surface.")] + [@GenerateAPI] + [UnityEngine.Serialization.FormerlySerializedAs("_DistanceFromWater")] + [SerializeField] + internal UnityEvent _DistanceFromSurface = new(); + + [Tooltip("Sends the distance from the water's edge.")] + [@GenerateAPI] + [SerializeField] + internal UnityEvent _DistanceFromEdge = new(); + + bool HasOnBelowWater => OnBelowWater != null || !_OnBelowWater.IsEmpty(); + bool HasOnAboveWater => OnAboveWater != null || !_OnAboveWater.IsEmpty(); + bool HasDistanceFromSurface => DistanceFromSurface != null || !_DistanceFromSurface.IsEmpty(); + bool HasDistanceFromEdge => DistanceFromEdge != null || !_DistanceFromEdge.IsEmpty(); + + // Store state + bool _IsAboveSurface = false; + bool _IsFirstUpdate = true; + readonly SampleCollisionHelper _SampleHeightHelper = new(); + readonly SampleDepthHelper _SampleDepthHelper = new(); + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + // Transform requires queries which need to be in Update. + if (_Source != QuerySource.Transform) return; + SendDistanceFromSurface(water); + SendDistanceFromEdge(water); + } + + private protected override System.Action OnLateUpdateMethod => OnLateUpdate; + void OnLateUpdate(WaterRenderer water) + { + // Viewer is set between Update and LateUpdate. + if (_Source != QuerySource.Viewer) return; + SendDistanceFromSurface(water); + SendDistanceFromEdge(water); + } + + void SendDistanceFromSurface(WaterRenderer water) + { + if (!HasDistanceFromSurface && !HasOnAboveWater && !HasOnBelowWater) + { + return; + } + + var distance = water.ViewerHeightAboveWater; + + if (_Source == QuerySource.Transform) + { + if (!_SampleHeightHelper.SampleHeight(transform.position, out var height, minimumLength: 2f * _MinimumWavelength, _Layer)) return; + distance = transform.position.y - height; + } + + var isAboveSurface = distance > 0; + + // Has the below/above water surface state changed? + if (_IsAboveSurface != isAboveSurface || _IsFirstUpdate) + { + _IsAboveSurface = isAboveSurface; + _IsFirstUpdate = false; + + if (_IsAboveSurface) + { + _OnAboveWater?.Invoke(); + OnAboveWater?.Invoke(); + } + else + { + _OnBelowWater?.Invoke(); + OnBelowWater?.Invoke(); + } + } + + // Save some processing when not being used. + if (HasDistanceFromSurface) + { + distance = Mathf.Clamp(distance, -_DistanceFromSurfaceMaximum, _DistanceFromSurfaceMaximum); + + // Throw away sign when using a curve. Cannot think of a use case for negative + // normalized numbers. + if (!_DistanceFromSurfaceSigned || _DistanceFromSurfaceUseCurve) + { + distance = Mathf.Abs(distance); + } + + if (_DistanceFromSurfaceUseCurve) + { + // Normalize for the curve. Invert so towards one is closer to target. + distance = _DistanceFromSurfaceCurve.Evaluate(1f - distance / _DistanceFromSurfaceMaximum); + } + + _DistanceFromSurface?.Invoke(distance); + DistanceFromSurface?.Invoke(distance); + } + } + + void SendDistanceFromEdge(WaterRenderer water) + { + // No events to process. + if (!HasDistanceFromEdge) + { + return; + } + + var distance = water.ViewerDistanceToShoreline; + + if (_Source == QuerySource.Transform) + { + if (!_SampleDepthHelper.SampleDistanceToWaterEdge(transform.position, out distance)) + { + return; + } + } + + distance = Mathf.Clamp(distance, -_DistanceFromEdgeMaximum, _DistanceFromEdgeMaximum); + + // Throw away sign when using a curve. Cannot think of a use case for negative + // normalized numbers. + if (!_DistanceFromEdgeSigned || _DistanceFromEdgeUseCurve) + { + distance = Mathf.Abs(distance); + } + + if (_DistanceFromEdgeUseCurve) + { + // Normalize for the curve. Invert so towards one is closer to target. + distance = _DistanceFromEdgeCurve.Evaluate(1f - distance / _DistanceFromEdgeMaximum); + } + + _DistanceFromEdge?.Invoke(distance); + DistanceFromEdge?.Invoke(distance); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/QueryEvents.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/QueryEvents.cs.meta new file mode 100644 index 0000000..05aa07a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/QueryEvents.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 555f01a6f203a4b6db9ec558f7451e4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/SamplingHelpers.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/SamplingHelpers.cs new file mode 100644 index 0000000..efff75d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/SamplingHelpers.cs @@ -0,0 +1,320 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +// Linter does not support mixing inheritdoc plus defining own parameters. +#pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) + +namespace WaveHarmonic.Crest.Internal +{ + /// + /// Base class for sample helpers which sample a single point. + /// + /// + /// It is not particularly efficient to sample a single point, but is a fairly + /// common case. + /// + public abstract class SampleHelper + { + private protected readonly Vector3[] _QueryPosition; + private protected readonly Vector3[] _QueryResult; + + int _LastFrame = -1; + + private protected SampleHelper(int queryCount = 1) + { + _QueryPosition = new Vector3[queryCount]; + _QueryResult = new Vector3[queryCount]; + } + + [System.Diagnostics.Conditional("UNITY_EDITOR")] + private protected void Validate(bool allowMultipleCallsPerFrame) + { + if (Application.isPlaying && !Time.inFixedTimeStep && !allowMultipleCallsPerFrame && _LastFrame == Time.frameCount) + { + var type = GetType().Name; + Debug.LogWarning($"Crest: {type} sample called multiple times in one frame which is not expected. Each {type} object services a single sample per frame. To perform multiple queries, create multiple {type} objects or use the query provider API directly."); + } + + _LastFrame = Time.frameCount; + } + + // The first method is there just to get inheritdoc to work as it does not like + // inheriting params plus adding additional params. + + /// + /// Only call once per frame. + /// + /// World space position to sample. + /// + /// The smallest length scale you are interested in. If you are sampling data for boat physics, + /// pass in the boats width. Larger objects will ignore smaller details in the data. + /// + /// The collision layer to target. + /// Whether the query was successful. + bool Sample(Vector3 position, float minimumLength, CollisionLayer layer) => false; + } +} + +namespace WaveHarmonic.Crest +{ + /// + /// Helper to obtain the water surface collision at a single point per frame. + /// + /// + public sealed class SampleCollisionHelper : Internal.SampleHelper + { + readonly Vector3[] _QueryResultNormal = new Vector3[1]; + readonly Vector3[] _QueryResultVelocity = new Vector3[1]; + + enum QueryType + { + Displacement, + Height, + } + + [System.Flags] + enum QueryOptions + { + None, + Velocity, + Normal, + All = Velocity | Normal, + } + + bool Sample(int id, Vector3 position, out Vector3 displacement, out float height, out Vector3 velocity, out Vector3 normal, QueryType type, QueryOptions options, CollisionLayer layer = CollisionLayer.Everything, float minimumLength = 0f, bool allowMultipleCallsPerFrame = false) + { + var water = WaterRenderer.Instance; + var provider = water == null ? null : water.AnimatedWavesLod.Provider; + + height = 0f; + displacement = Vector3.zero; + velocity = Vector3.zero; + normal = Vector3.up; + + if (provider == null) + { + return false; + } + + var isHeight = type == QueryType.Height; + var isDisplacement = type == QueryType.Displacement; + var isVelocity = (options & QueryOptions.Velocity) == QueryOptions.Velocity; + var isNormal = (options & QueryOptions.Normal) == QueryOptions.Normal; + + Validate(allowMultipleCallsPerFrame); + + _QueryPosition[0] = position; + + var status = provider.Query + ( + id, + minimumLength, + _QueryPosition, + _QueryResult, + isNormal ? _QueryResultNormal : null, + isVelocity ? _QueryResultVelocity : null, + layer + ); + + if (!provider.RetrieveSucceeded(status)) + { + height = water.SeaLevel; + return false; + } + + if (isHeight) height = _QueryResult[0].y + water.SeaLevel; + if (isDisplacement) displacement = _QueryResult[0]; + if (isVelocity) velocity = _QueryResultVelocity[0]; + if (isNormal) normal = _QueryResultNormal[0]; + + return true; + } + + internal bool SampleHeight(int id, Vector3 position, out float height, CollisionLayer layer = CollisionLayer.Everything, float minimumLength = 0f, bool allowMultipleCallsPerFrame = false) + { + return Sample(id, position, out _, out height, out _, out _, QueryType.Height, QueryOptions.None, layer, minimumLength, allowMultipleCallsPerFrame); + } + + internal bool SampleHeight(int id, Vector3 position, out float height, out Vector3 velocity, CollisionLayer layer = CollisionLayer.Everything, float minimumLength = 0f, bool allowMultipleCallsPerFrame = false) + { + return Sample(id, position, out _, out height, out velocity, out _, QueryType.Height, QueryOptions.Velocity, layer, minimumLength, allowMultipleCallsPerFrame); + } + + internal bool SampleHeight(int id, Vector3 position, out float height, out Vector3 velocity, out Vector3 normal, CollisionLayer layer = CollisionLayer.Everything, float minimumLength = 0f, bool allowMultipleCallsPerFrame = false) + { + return Sample(id, position, out _, out height, out velocity, out normal, QueryType.Height, QueryOptions.All, layer, minimumLength, allowMultipleCallsPerFrame); + } + + internal bool SampleDisplacement(int id, Vector3 position, out Vector3 displacement, out Vector3 velocity, out Vector3 normal, CollisionLayer layer = CollisionLayer.Everything, float minimumLength = 0f, bool allowMultipleCallsPerFrame = false) + { + return Sample(id, position, out displacement, out _, out velocity, out normal, QueryType.Displacement, QueryOptions.All, layer, minimumLength, allowMultipleCallsPerFrame); + } + + internal bool SampleDisplacement(int id, Vector3 position, out Vector3 displacement, out Vector3 velocity, CollisionLayer layer = CollisionLayer.Everything, float minimumLength = 0f, bool allowMultipleCallsPerFrame = false) + { + return Sample(id, position, out displacement, out _, out velocity, out _, QueryType.Displacement, QueryOptions.Velocity, layer, minimumLength, allowMultipleCallsPerFrame); + } + + internal bool SampleDisplacement(int id, Vector3 position, out Vector3 displacement, CollisionLayer layer = CollisionLayer.Everything, float minimumLength = 0f, bool allowMultipleCallsPerFrame = false) + { + return Sample(id, position, out displacement, out _, out _, out _, QueryType.Displacement, QueryOptions.None, layer, minimumLength, allowMultipleCallsPerFrame); + } + + // The first method is there just to get inheritdoc to work as it does not like + // inheriting params plus adding additional params. + + /// + /// Sample displacement data. + /// + /// The water surface displacement to point. + /// The water surface height. + /// The velocity of the water surface excluding flow velocity. + /// The water surface normal. + /// + bool Sample(Vector3 position, float height, Vector3 displacement, Vector3 normal, Vector3 velocity, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => false; + + /// + [System.Obsolete("Please use SampleDisplacement instead. Be wary that the new API has switch the normal parameter with velocity.")] + public bool Sample(Vector3 position, out Vector3 displacement, out Vector3 normal, out Vector3 velocity, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleDisplacement(GetHashCode(), position, out displacement, out velocity, out normal, layer, minimumLength); + + /// + [System.Obsolete("Please use SampleHeight instead. Be wary that the new API has switch the normal parameter with velocity.")] + public bool Sample(Vector3 position, out float height, out Vector3 normal, out Vector3 velocity, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleHeight(GetHashCode(), position, out height, out velocity, out normal, layer, minimumLength); + + /// + [System.Obsolete("Please use SampleHeight instead. Be wary that the new API has switch the normal parameter with velocity.")] + public bool Sample(Vector3 position, out float height, out Vector3 normal, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleHeight(GetHashCode(), position, out height, out _, out normal, layer, minimumLength); + + /// + [System.Obsolete("Please use SampleHeight instead. Be wary that the new API has switch the normal parameter with velocity.")] + public bool Sample(Vector3 position, out float height, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleHeight(GetHashCode(), position, out height, layer, minimumLength); + + + /// + public bool SampleDisplacement(Vector3 position, out Vector3 displacement, out Vector3 velocity, out Vector3 normal, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleDisplacement(GetHashCode(), position, out displacement, out velocity, out normal, layer, minimumLength); + + /// + public bool SampleDisplacement(Vector3 position, out Vector3 displacement, out Vector3 velocity, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleDisplacement(GetHashCode(), position, out displacement, out velocity, layer, minimumLength); + + /// + public bool SampleDisplacement(Vector3 position, out Vector3 displacement, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleDisplacement(GetHashCode(), position, out displacement, layer, minimumLength); + + /// + public bool SampleHeight(Vector3 position, out float height, out Vector3 velocity, out Vector3 normal, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleHeight(GetHashCode(), position, out height, out velocity, out normal, layer, minimumLength); + + /// + public bool SampleHeight(Vector3 position, out float height, out Vector3 velocity, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleHeight(GetHashCode(), position, out height, out velocity, layer, minimumLength); + + /// + public bool SampleHeight(Vector3 position, out float height, float minimumLength = 0f, CollisionLayer layer = CollisionLayer.Everything) => SampleHeight(GetHashCode(), position, out height, layer, minimumLength); + } + + /// + /// Helper to obtain the flow data (horizontal water motion) at a single point. + /// + /// + public sealed class SampleFlowHelper : Internal.SampleHelper + { + /// + /// Sample flow data. + /// + /// Filled with resulting flow. + /// Whether the query was successful. + /// + public bool Sample(Vector3 position, out Vector2 flow, float minimumLength = 0f) + { + var water = WaterRenderer.Instance; + var flowProvider = water == null ? null : water.FlowLod.Provider; + + if (flowProvider == null) + { + flow = Vector2.zero; + return false; + } + + Validate(false); + + _QueryPosition[0] = position; + + var status = flowProvider.Query(GetHashCode(), minimumLength, _QueryPosition, _QueryResult); + + if (!flowProvider.RetrieveSucceeded(status)) + { + flow = Vector2.zero; + return false; + } + + // We don't support float2 queries unfortunately, so unpack from float3 + flow.x = _QueryResult[0].x; + flow.y = _QueryResult[0].z; + + return true; + } + } + + /// + /// Helper to obtain the depth data at a single point. + /// + public sealed class SampleDepthHelper : Internal.SampleHelper + { + bool Sample(Vector3 position, out Vector2 result) + { + var water = WaterRenderer.Instance; + var depthProvider = water == null ? null : water.DepthLod.Provider; + + if (depthProvider == null) + { + result = Vector2.zero; + return false; + } + + Validate(false); + + _QueryPosition[0] = position; + + var status = depthProvider.Query(GetHashCode(), minimumLength: 0, _QueryPosition, _QueryResult); + if (!depthProvider.RetrieveSucceeded(status)) + { + result = Vector2.zero; + return false; + } + + result = _QueryResult[0]; + return true; + } + + /// + /// Sample both the water depth and water edge distance. + /// + /// Filled by the water depth at the query position. + /// Filled by the distance to water edge at the query position. + /// + bool Sample(Vector3 position, out float depth, out float distance) + { + var success = Sample(position, out var result); + depth = result.x; + distance = result.y; + return success; + } + + /// Sample water depth. + /// + bool SampleWaterDepth(Vector3 position, out float depth) + { + var success = Sample(position, out var result); + depth = result.x; + return success; + } + + /// Sample water edge distance. + /// + public bool SampleDistanceToWaterEdge(Vector3 position, out float distance) + { + var success = Sample(position, out var result); + distance = result.y; + return success; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/SamplingHelpers.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/SamplingHelpers.cs.meta new file mode 100644 index 0000000..cb6c488 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Query/SamplingHelpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4b71f2a526b64377bc96c6e283e4535 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsHDRP.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsHDRP.cs new file mode 100644 index 0000000..2752196 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsHDRP.cs @@ -0,0 +1,95 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest +{ + sealed class SampleShadowsHDRP : CustomPass + { + static SampleShadowsHDRP s_Instance; + static readonly string s_Name = "Sample Shadows"; + + WaterRenderer _Water; + int _XrTargetEyeIndex = -1; + + protected override void Execute(CustomPassContext context) + { + var water = _Water; + + if (!water._ShadowLod.Enabled) + { + return; + } + +#if UNITY_EDITOR + if (!WaterRenderer.IsWithinEditorUpdate) + { + return; + } +#endif + + var camera = context.hdCamera.camera; + + // Custom passes execute for every camera. We only support one camera for now. + if (!ReferenceEquals(camera, water.Viewer)) return; + // TODO: bail when not executing for main light or when no main light exists? + // if (renderingData.lightData.mainLightIndex == -1) return; + + camera.TryGetComponent(out var cameraData); + + // Skip the right eye for multi-pass as data is not stereo. + if (Rendering.HDRP.SkipPassXR(ref _XrTargetEyeIndex, cameraData)) + { + return; + } + + // Disable for XR SPI otherwise input will not have correct world position. + Rendering.HDRP.DisableXR(context.cmd, cameraData); + + water._ShadowLod.BuildCommandBuffer(water, context.cmd); + + // Restore matrices otherwise remaining render will have incorrect matrices. Each pass is responsible for + // restoring matrices if required. + context.cmd.SetViewProjectionMatrices(camera.worldToCameraMatrix, camera.projectionMatrix); + + // Restore XR SPI as we cannot rely on remaining pipeline to do it for us. + Rendering.HDRP.EnableXR(context.cmd, cameraData); + } + + internal static void Enable(WaterRenderer water) + { + var gameObject = CustomPassHelpers.CreateOrUpdate + ( + parent: water.Container.transform, + s_Name, + hide: !water._Debug._ShowHiddenObjects + ); + + CustomPassHelpers.CreateOrUpdate + ( + gameObject, + ref s_Instance, + WaterRenderer.k_DrawLodData, + // Earliest point after shadow maps have populated. + CustomPassInjectionPoint.AfterOpaqueAndSky + ); + + s_Instance._Water = water; + } + + internal static void Disable() + { + // It should be safe to rely on this reference for this reference to fail. + if (s_Instance != null && s_Instance._GameObject != null) + { + // Will also trigger Cleanup below. + s_Instance._GameObject.SetActive(false); + } + } + } +} + +#endif // d_UnityHDRP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsHDRP.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsHDRP.cs.meta new file mode 100644 index 0000000..25953f4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsHDRP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7615ccf335b7f4009b603ea10c9da3b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.RenderGraph.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.RenderGraph.cs new file mode 100644 index 0000000..de8c675 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.RenderGraph.cs @@ -0,0 +1,61 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP +#if UNITY_6000_0_OR_NEWER + +using UnityEngine.Rendering; +using UnityEngine.Rendering.RenderGraphModule; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + partial class SampleShadowsURP : ScriptableRenderPass + { + class PassData + { +#pragma warning disable IDE1006 // Naming Styles + public UniversalCameraData cameraData; + public UniversalLightData lightData; + public CullingResults cullResults; +#pragma warning restore IDE1006 // Naming Styles + + public void Init(ContextContainer frameData, IUnsafeRenderGraphBuilder builder = null) + { + cameraData = frameData.Get(); + lightData = frameData.Get(); + cullResults = frameData.Get().cullResults; + } + } + + readonly PassData _PassData = new(); + + public override void RecordRenderGraph(RenderGraph graph, ContextContainer frame) + { + using (var builder = graph.AddUnsafePass(WaterRenderer.k_DrawLodData, out var data)) + { + data.Init(frame, builder); + builder.AllowPassCulling(false); + + builder.SetRenderFunc((data, context) => + { + var buffer = CommandBufferHelpers.GetNativeCommandBuffer(context.cmd); + Execute(context.GetRenderContext(), buffer, data); + }); + } + } + + [System.Obsolete] + public override void Execute(ScriptableRenderContext context, ref RenderingData data) + { + _PassData.Init(data.GetFrameData()); + var buffer = CommandBufferPool.Get(WaterRenderer.k_DrawLodData); + Execute(context, buffer, _PassData); + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); + } + } +} + +#endif // UNITY_6000_0_OR_NEWER +#endif // d_UnityURP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.RenderGraph.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.RenderGraph.cs.meta new file mode 100644 index 0000000..3ce86fc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.RenderGraph.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7fa132cd90fd84d65bfdbdeaa68b9ff4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.cs new file mode 100644 index 0000000..545a5cd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.cs @@ -0,0 +1,111 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP + +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + sealed partial class SampleShadowsURP : ScriptableRenderPass + { + static SampleShadowsURP s_Instance; + internal static bool Created => s_Instance != null; + + WaterRenderer _Water; + + SampleShadowsURP(RenderPassEvent renderPassEvent) + { + this.renderPassEvent = renderPassEvent; + } + + internal static void Enable(WaterRenderer water) + { + s_Instance ??= new(RenderPassEvent.AfterRenderingShadows); + s_Instance._Water = water; + } + + internal static void EnqueuePass(ScriptableRenderContext context, Camera camera) + { + if (s_Instance == null) + { + return; + } + + var water = s_Instance._Water; + + if (!water._ShadowLod.Enabled) + { + return; + } + +#if UNITY_EDITOR + if (!WaterRenderer.IsWithinEditorUpdate) + { + return; + } +#endif + + // Only sample shadows for the main camera. + if (!ReferenceEquals(water.Viewer, camera)) + { + return; + } + + if (camera.TryGetComponent(out var cameraData)) + { + cameraData.scriptableRenderer.EnqueuePass(s_Instance); + } + } + +#if UNITY_6000_0_OR_NEWER + void Execute(ScriptableRenderContext context, CommandBuffer buffer, PassData renderingData) +#else + public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) +#endif + { + var water = _Water; + + if (water == null || !water._ShadowLod.Enabled) + { + return; + } + + // TODO: This may not be the same as WaterRenderer._primaryLight. Not certain how to support overriding the + // main light for shadows yet. + var mainLightIndex = renderingData.lightData.mainLightIndex; + + if (mainLightIndex == -1) + { + return; + } + + var camera = renderingData.cameraData.camera; + +#if !UNITY_6000_0_OR_NEWER + var buffer = CommandBufferPool.Get(WaterRenderer.k_DrawLodData); +#endif + + // Disable for XR SPI otherwise input will not have correct world position. + Rendering.URP.DisableXR(buffer, renderingData.cameraData); + + water._ShadowLod.BuildCommandBuffer(water, buffer); + + // Restore matrices otherwise remaining render will have incorrect matrices. Each pass is responsible for + // restoring matrices if required. + buffer.SetViewProjectionMatrices(camera.worldToCameraMatrix, camera.projectionMatrix); + + // Restore XR SPI as we cannot rely on remaining pipeline to do it for us. + Rendering.URP.EnableXR(buffer, renderingData.cameraData); + +#if !UNITY_6000_0_OR_NEWER + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); +#endif + } + } +} + +#endif // d_UnityURP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.cs.meta new file mode 100644 index 0000000..31cc909 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/SampleShadowsURP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4a20bc0762fc450da9b6532d131c32a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ScatteringLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ScatteringLod.cs new file mode 100644 index 0000000..8a30e9b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ScatteringLod.cs @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Overrides the main scattering color. + /// + public sealed partial class ScatteringLod : ColorLod + { + // Orange + internal static readonly Color s_GizmoColor = new(1f, 165f / 255f, 0f, 0.5f); + internal static readonly Color s_DefaultColor = new(0f, 0.098f, 0.2f, 1f); + + static new class ShaderIDs + { + public static readonly int s_SampleScatteringSimulation = Shader.PropertyToID("g_Crest_SampleScatteringSimulation"); + } + + internal override string ID => "Scattering"; + internal override string Name => "Scattering"; + internal override Color GizmoColor => s_GizmoColor; + private protected override bool NeedToReadWriteTextureData => true; + private protected override bool RequiresClearBorder => true; + private protected override bool AlwaysClear => true; + private protected override Color ClearColor + { + get + { + var color = Color.clear; + var surface = _Water.Surface; + + if (surface.Material != null && surface.Material.HasColor(WaterRenderer.ShaderIDs.s_Scattering)) + { + color = surface.Material.GetColor(WaterRenderer.ShaderIDs.s_Scattering).MaybeLinear(); + color.a = 0f; + } + + return color; + } + } + + private protected override int GlobalShaderID => ShaderIDs.s_SampleScatteringSimulation; + + internal ScatteringLod() + { + _ShorelineColor = (s_DefaultColor * 6f).Clamped01(); + } + + private protected override void SetShorelineColor(Color previous, Color current) + { + if (previous == current) return; + _ShorelineColorValue = current.MaybeLinear(); + } + + internal static readonly SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ScatteringLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ScatteringLod.cs.meta new file mode 100644 index 0000000..8d63d36 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ScatteringLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: deecfdb8a1d08431388635f0e1c8914f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings.meta new file mode 100644 index 0000000..b36ea00 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93bf0c7e03d72494b9ec5ff10d2f178f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/DynamicWavesLodSettings.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/DynamicWavesLodSettings.cs new file mode 100644 index 0000000..b070873 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/DynamicWavesLodSettings.cs @@ -0,0 +1,56 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Settings for fine tuning the . + /// + [CreateAssetMenu(fileName = "DynamicWavesSettings", menuName = "Crest/Simulation Settings/Dynamic Waves")] + [@HelpURL("Manual/Waves.html#dynamic-waves-settings")] + public sealed partial class DynamicWavesLodSettings : LodSettings + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Header("Simulation")] + + [Tooltip("How much energy is dissipated each frame.\n\nHelps simulation stability, but limits how far ripples will propagate. Set this as large as possible/acceptable. Default is 0.05.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + internal float _Damping = 0.05f; + + [Tooltip("Stability control.\n\nLower values means more stable simulation, but may slow down some dynamic waves. This value should be set as large as possible until simulation instabilities/flickering begin to appear. Default is 0.7.")] + [@Range(0.1f, 1f)] + [@GenerateAPI] + [SerializeField] + internal float _CourantNumber = 0.7f; + + + [Header("Displacement Generation")] + + [Tooltip("Induce horizontal displacements to sharpen simulated waves.")] + [@Range(0f, 20f)] + [@GenerateAPI] + [SerializeField] + internal float _HorizontalDisplace = 3f; + + [Tooltip("Clamp displacement to help prevent self-intersection in steep waves.\n\nZero means unclamped.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + internal float _DisplaceClamp = 0.3f; + + + [Tooltip("Multiplier for gravity.\n\nMore gravity means dynamic waves will travel faster. Higher values can be a source of instability.")] + [@Range(0f, 64f)] + [@GenerateAPI] + [SerializeField] + internal float _GravityMultiplier = 1f; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/DynamicWavesLodSettings.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/DynamicWavesLodSettings.cs.meta new file mode 100644 index 0000000..0347cf1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/DynamicWavesLodSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7df05608a083e4ad4bc4758f1df0ee29 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 72a325a76c6624c768822a08fe625d55, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/FoamLodSettings.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/FoamLodSettings.cs new file mode 100644 index 0000000..28a8653 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/FoamLodSettings.cs @@ -0,0 +1,76 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Settings for fine tuning the . + /// + [CreateAssetMenu(fileName = "FoamSettings", menuName = "Crest/Simulation Settings/Foam")] + [@HelpURL("Manual/WaterAppearance.html#foam-settings")] + public sealed partial class FoamLodSettings : LodSettings + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + + [Header("General settings")] + + [Tooltip("Foam will not exceed this value in the simulation which can be used to prevent foam from accumulating too much.")] + [Min(0f)] + [@GenerateAPI] + [SerializeField] + float _Maximum = 10f; + + [Tooltip("How quickly foam dissipates.\n\nLow values mean foam remains on surface for longer. This setting should be balanced with the generation *strength* parameters below.")] + [@Range(0f, 20f)] + [@GenerateAPI] + [SerializeField] + internal float _FoamFadeRate = 0.8f; + + [Header("Whitecaps")] + + [Tooltip("Scales intensity of foam generated from waves.\n\nThis setting should be balanced with the Foam Fade Rate setting.")] + [@Range(0f, 5f)] + [@GenerateAPI] + [SerializeField] + internal float _WaveFoamStrength = 1f; + + [Tooltip("How much of the waves generate foam.\n\nHigher values will lower the threshold for foam generation, giving a larger area.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + internal float _WaveFoamCoverage = 0.55f; + + [Tooltip("The minimum LOD to sample waves from.\n\nZero means all waves and increasing will exclude lower wavelengths which can help with too much foam near the camera.")] + [@Range(0, Lod.k_MaximumSlices - 2)] + [@GenerateAPI] + [SerializeField] + internal int _FilterWaves = 2; + + + [Header("Shoreline")] + + [Tooltip("Foam will be generated in water shallower than this depth.\n\nControls how wide the band of foam at the shoreline will be. Note that this is not a distance to shoreline, but a threshold on water depth, so the width of the foam band can vary based on terrain slope. To address this limitation we allow foam to be manually added from geometry or from a texture, see the next section.")] + [@Range(0.01f, 3f)] + [@GenerateAPI] + [SerializeField] + internal float _ShorelineFoamMaximumDepth = 0.65f; + + [Tooltip("Scales intensity of foam generated in shallow water.\n\nThis setting should be balanced with the Foam Fade Rate setting.")] + [@Range(0f, 5f)] + [@GenerateAPI] + [SerializeField] + internal float _ShorelineFoamStrength = 2f; + + [Tooltip("Primes foam when terrain height is this value above water.\n\nThis ignores other foam settings and writes a constant foam value.")] + [@Range(0f, 5f, Range.Clamp.Minimum)] + [@GenerateAPI] + [SerializeField] + internal float _ShorelineFoamPriming = 5f; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/FoamLodSettings.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/FoamLodSettings.cs.meta new file mode 100644 index 0000000..9dacae7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/FoamLodSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03aa24b56404b45a190a2cfc0c7cc100 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 72a325a76c6624c768822a08fe625d55, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/LodSettings.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/LodSettings.cs new file mode 100644 index 0000000..1087bf9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/LodSettings.cs @@ -0,0 +1,15 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Base class for simulation settings. + /// + public abstract partial class LodSettings : ScriptableObject + { + + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/LodSettings.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/LodSettings.cs.meta new file mode 100644 index 0000000..0156619 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/Settings/LodSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 21a1aacea74a443d0a2a6b4ee75e2c25 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.Legacy.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.Legacy.cs new file mode 100644 index 0000000..ecab8be --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.Legacy.cs @@ -0,0 +1,119 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + partial class ShadowLod + { + internal void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + // TODO: refactor this similar to MaskRenderer. + if (!RenderPipelineHelper.IsLegacy) + { +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + SampleShadowsURP.EnqueuePass(context, camera); + } +#endif + + return; + } + +#if UNITY_EDITOR + // Do not execute when editor is not active to conserve power and prevent possible leaks. + if (!UnityEditorInternal.InternalEditorUtility.isApplicationActive) + { + CopyShadowMapBuffer?.Clear(); + return; + } + + if (!WaterRenderer.IsWithinEditorUpdate) + { + CopyShadowMapBuffer?.Clear(); + return; + } +#endif + + var water = _Water; + + if (water == null) + { + return; + } + + if (!WaterRenderer.ShouldRender(camera, water.Surface.Layer)) + { + return; + } + + if (camera == water.Viewer && CopyShadowMapBuffer != null) + { + if (_Light != null) + { + // Calling this in OnPreRender was too late to be executed in the same frame. + _Light.RemoveCommandBuffer(LightEvent.BeforeScreenspaceMask, CopyShadowMapBuffer); + _Light.AddCommandBuffer(LightEvent.BeforeScreenspaceMask, CopyShadowMapBuffer); + } + + // Disable for XR SPI otherwise input will not have correct world position. + Rendering.BIRP.DisableXR(CopyShadowMapBuffer, camera); + + BuildCommandBuffer(water, CopyShadowMapBuffer); + + // Restore XR SPI as we cannot rely on remaining pipeline to do it for us. + Rendering.BIRP.EnableXR(CopyShadowMapBuffer, camera); + } + } + + internal void OnEndCameraRendering(Camera camera) + { + if (!RenderPipelineHelper.IsLegacy) + { + return; + } + +#if UNITY_EDITOR + // Do not execute when editor is not active to conserve power and prevent possible leaks. + if (!UnityEditorInternal.InternalEditorUtility.isApplicationActive) + { + CopyShadowMapBuffer?.Clear(); + return; + } + + if (!WaterRenderer.IsWithinEditorUpdate) + { + CopyShadowMapBuffer?.Clear(); + return; + } +#endif + + var water = _Water; + + if (water == null) + { + return; + } + + if (!WaterRenderer.ShouldRender(camera, water.Surface.Layer)) + { + return; + } + + if (camera == water.Viewer) + { + // CBs added to a light are executed for every camera, but the LOD data is only + // supports a single camera. Removing the CB after the camera renders restricts the + // CB to one camera. Careful of recursive rendering for planar reflections, as it + // executes a camera within this camera's frame. + if (_Light != null && CopyShadowMapBuffer != null) + { + _Light.RemoveCommandBuffer(LightEvent.BeforeScreenspaceMask, CopyShadowMapBuffer); + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.Legacy.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.Legacy.cs.meta new file mode 100644 index 0000000..51cbf52 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.Legacy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a4edb90370784ae2be24a7f430ee23e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.cs new file mode 100644 index 0000000..71e0a1f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.cs @@ -0,0 +1,535 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// BIRP fallback not really tested yet - shaders need fixing up. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Stores shadowing data to use during water shading. + /// + /// + /// Shadowing is persistent and supports sampling across many frames and jittered + /// sampling for (very) soft shadows. Soft shadows is red, hard shadows is green. + /// + [FilterEnum(nameof(_TextureFormatMode), Filtered.Mode.Exclude, (int)LodTextureFormatMode.Automatic)] + public sealed partial class ShadowLod : PersistentLod + { + [@Space(10)] + + [Tooltip("Whether to vary soft shadow jitter by scattering/absorption density.")] + [@DecoratedField, SerializeField] + bool _DynamicSoftShadows = true; + + [Tooltip("Factor control for dynamic soft jitter.")] + [@Predicated(nameof(_DynamicSoftShadows), hide: true)] + [@Range(0f, 1f, Range.Clamp.Minimum)] + [SerializeField] + float _SoftJitterExtinctionFactor = 0.75f; + + [Tooltip("Jitter diameter for soft shadows, controls softness of this shadowing component.")] + [@Predicated(nameof(_DynamicSoftShadows), hide: true, inverted: true)] + [@Range(0f, k_MaximumJitter)] + [@GenerateAPI] + [SerializeField] + internal float _JitterDiameterSoft = 15f; + + [Tooltip("Current frame weight for accumulation over frames for soft shadows.\n\nRoughly means 'responsiveness' for soft shadows.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + internal float _CurrentFrameWeightSoft = 0.03f; + + [Tooltip("Jitter diameter for hard shadows, controls softness of this shadowing component.")] + [@Range(0f, k_MaximumJitter)] + [@GenerateAPI] + [SerializeField] + internal float _JitterDiameterHard = 0.6f; + + [Tooltip("Current frame weight for accumulation over frames for hard shadows.\n\nRoughly means 'responsiveness' for hard shadows.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + internal float _CurrentFrameWeightHard = 0.15f; + + [@Space(10)] + + [Tooltip("Whether to disable the null light warning, use this if you assign it dynamically and expect it to be null at points")] + [@DecoratedField, SerializeField] + internal bool _AllowNullLight = false; + + [Tooltip("Whether to disable the no shadows warning. Use this if you toggle the shadows on the primary light dynamically.")] + [@DecoratedField, SerializeField] + internal bool _AllowNoShadows = false; + + static new class ShaderIDs + { + public static readonly int s_DynamicSoftShadowsFactor = Shader.PropertyToID("g_Crest_DynamicSoftShadowsFactor"); + public static readonly int s_SampleColorMap = Shader.PropertyToID("_Crest_SampleColorMap"); + public static readonly int s_CenterPos = Shader.PropertyToID("_Crest_CenterPos"); + public static readonly int s_Scale = Shader.PropertyToID("_Crest_Scale"); + public static readonly int s_JitterDiameters_CurrentFrameWeights = Shader.PropertyToID("_Crest_JitterDiameters_CurrentFrameWeights"); + public static readonly int s_MainCameraProjectionMatrix = Shader.PropertyToID("_Crest_MainCameraProjectionMatrix"); + + // BIRP only. + public static readonly int s_ShadowPassExecuteLastFrame = Shader.PropertyToID("_Crest_ShadowPassExecuteLastFrame"); + public static readonly int s_ClearShadows = Shader.PropertyToID("_Crest_ClearShadows"); + } + + const string k_DrawLodSample = "Sample"; + + const float k_MaximumJitter = 32f; + + internal static readonly Color s_GizmoColor = new(0f, 0f, 0f, 0.5f); + internal static bool s_ProcessData = true; + + internal override string ID => "Shadow"; + internal override string Name => "Shadows"; + internal override Color GizmoColor => s_GizmoColor; + private protected override Color ClearColor => Color.black; + private protected override bool NeedToReadWriteTextureData => true; + internal override int BufferCount => 2; + + private protected override GraphicsFormat RequestedTextureFormat => _TextureFormatMode switch + { + LodTextureFormatMode.Performance => GraphicsFormat.R8G8_UNorm, + LodTextureFormatMode.Precision => GraphicsFormat.R16G16_UNorm, + LodTextureFormatMode.Manual => _TextureFormat, + _ => throw new System.NotImplementedException(), + }; + + Light _Light; + + // SRP version needs access to this externally, hence internal get. + internal CommandBuffer CopyShadowMapBuffer { get; private set; } + PropertyWrapperMaterial[] _RenderMaterial; + + enum Error + { + None, + NoLight, + NoShadows, + IncorrectLightType, + } + + Error _Error; + + private protected override int Kernel => (int)RenderPipelineHelper.RenderPipeline; + private protected override bool SkipFlipBuffers => true; + private protected override ComputeShader SimulationShader => WaterResources.Instance.Compute._UpdateShadow; + + bool _IsSimulationBuffer; + + + internal override void Initialize() + { + if (WaterResources.Instance.Shaders._UpdateShadow == null) + { + _Valid = false; + return; + } + + var isShadowsDisabled = false; + + if (RenderPipelineHelper.IsLegacy) + { + if (QualitySettings.shadows == UnityEngine.ShadowQuality.Disable) + { + isShadowsDisabled = true; + } + } + else if (RenderPipelineHelper.IsUniversal) + { +#if d_UnityURP + var asset = GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset; + + // TODO: Support single casacades as it is possible. + if (asset && asset.shadowCascadeCount < 2) + { + Debug.LogError("Crest shadowing requires shadow cascades to be enabled on the pipeline asset.", asset); + _Valid = false; + return; + } + + if (asset.mainLightRenderingMode == LightRenderingMode.Disabled) + { + Debug.LogError("Crest: Main Light must be enabled to enable water shadowing.", _Water); + _Valid = false; + return; + } + + isShadowsDisabled = !asset.supportsMainLightShadows; +#endif + } + + if (isShadowsDisabled) + { + Debug.LogError("Crest: Shadows must be enabled in the quality settings to enable water shadowing.", _Water); + _Valid = false; + return; + } + + base.Initialize(); + } + + internal override void SetGlobals(bool enable) + { + base.SetGlobals(enable); + Shader.SetGlobalFloat(ShaderIDs.s_DynamicSoftShadowsFactor, 1f); + + if (RenderPipelineHelper.IsLegacy) + { + Helpers.SetGlobalBoolean(ShaderIDs.s_ShadowPassExecuteLastFrame, true); + } + } + + internal override void Enable() + { + base.Enable(); + + CleanUpShadowCommandBuffers(); + + if (RenderPipelineHelper.IsHighDefinition) + { +#if d_UnityHDRP + SampleShadowsHDRP.Enable(_Water); +#endif + } + else if (RenderPipelineHelper.IsUniversal) + { +#if d_UnityURP + SampleShadowsURP.Enable(_Water); +#endif + } + } + + internal override void Disable() + { + base.Disable(); + + CleanUpShadowCommandBuffers(); + Shader.SetGlobalFloat(ShaderIDs.s_DynamicSoftShadowsFactor, 1f); + +#if d_UnityHDRP + SampleShadowsHDRP.Disable(); +#endif + } + + internal override void Destroy() + { + base.Destroy(); + + for (var index = 0; index < _RenderMaterial.Length; index++) + { + Helpers.Destroy(_RenderMaterial[index].Material); + } + } + + private protected override void Allocate() + { + base.Allocate(); + + _Targets.RunLambda(buffer => Clear(buffer)); + + { + _RenderMaterial = new PropertyWrapperMaterial[Slices]; + var shader = WaterResources.Instance.Shaders._UpdateShadow; + for (var i = 0; i < _RenderMaterial.Length; i++) + { + _RenderMaterial[i] = new(shader); + _RenderMaterial[i].SetInteger(Lod.ShaderIDs.s_LodIndex, i); + } + } + + // Enable sample shadows custom pass. + if (RenderPipelineHelper.IsHighDefinition) + { +#if d_UnityHDRP + SampleShadowsHDRP.Enable(_Water); +#endif + } + else if (RenderPipelineHelper.IsUniversal) + { +#if d_UnityURP + SampleShadowsURP.Enable(_Water); +#endif + } + } + + internal override void ClearLodData() + { + base.ClearLodData(); + _Targets.RunLambda(buffer => Clear(buffer)); + } + + /// + /// Validates the primary light. + /// + /// + /// Whether the light is valid. An invalid light should be treated as a developer error and not recoverable. + /// + bool ValidateLight() + { + if (_Light == null) + { + if (!_AllowNullLight) + { + if (_Error != Error.NoLight) + { + Debug.LogWarning($"Crest: Primary light must be specified on {nameof(WaterRenderer)} script to enable shadows.", _Water); + _Error = Error.NoLight; + } + return false; + } + + return true; + } + + if (_Light.shadows == LightShadows.None) + { + if (!_AllowNoShadows) + { + if (_Error != Error.NoShadows) + { + Debug.LogWarning("Crest: Shadows must be enabled on primary light to enable water shadowing (types Hard and Soft are equivalent for the water system).", _Light); + _Error = Error.NoShadows; + } + return false; + } + } + + if (_Light.type != LightType.Directional) + { + if (_Error != Error.IncorrectLightType) + { + Debug.LogError("Crest: Primary light must be of type Directional.", _Light); + _Error = Error.IncorrectLightType; + } + return false; + } + + _Error = Error.None; + return true; + } + + /// + /// Stores the primary light. + /// + /// + /// Whether there is a light that casts shadows. + /// + bool SetUpLight() + { + if (_Light == null) + { + _Light = _Water.PrimaryLight; + + if (_Light == null) + { + return false; + } + } + + if (_Light.shadows == LightShadows.None) + { + return false; + } + + return true; + } + + /// + /// May happen if scenes change etc + /// + void ClearBufferIfLightChanged() + { + if (_Light != _Water.PrimaryLight) + { + _Targets.RunLambda(buffer => Clear(buffer)); + CleanUpShadowCommandBuffers(); + _Light = null; + } + } + + void CleanUpShadowCommandBuffers() + { + if (!RenderPipelineHelper.IsLegacy) + { + return; + } + + CopyShadowMapBuffer?.Release(); + CopyShadowMapBuffer = null; + } + + void Update(CommandBuffer buffer) + { + // If disabled then we hit a failure state. Try and recover in edit mode by proceeding. + if (!_Valid && Application.isPlaying) + { + return; + } + + ClearBufferIfLightChanged(); + + var hasShadowCastingLight = SetUpLight(); + // If in play mode, and this becomes false, then we hit a failed state and will not recover. + _Valid = ValidateLight(); + + if (!s_ProcessData || !_Valid || !hasShadowCastingLight) + { + if (CopyShadowMapBuffer != null) + { + // If we have a command buffer, then there is likely shadow data so we need to clear it. + _Targets.RunLambda(buffer => Clear(buffer)); + CleanUpShadowCommandBuffers(); + } + + return; + } + + CopyShadowMapBuffer ??= new() { name = WaterRenderer.k_DrawLodData }; + CopyShadowMapBuffer.Clear(); + + FlipBuffers(); + + // clear the shadow collection. it will be overwritten with shadow values IF the shadows render, + // which only happens if there are (nontransparent) shadow receivers around. this is only reliable + // in play mode, so don't do it in edit mode. +#if UNITY_EDITOR + if (Application.isPlaying) +#endif + { + buffer.BeginSample(ID); + CoreUtils.SetRenderTarget(buffer, DataTexture, ClearFlag.Color, ClearColor); + buffer.EndSample(ID); + } + } + + internal override void BuildCommandBuffer(WaterRenderer water, CommandBuffer buffer) + { + var isSimulationBuffer = buffer == _Water.SimulationBuffer; + + _IsSimulationBuffer = isSimulationBuffer; + + if (isSimulationBuffer) + { + var skip = true; + if (RenderPipelineHelper.IsLegacy) + { + // If no shadow casters are present, BIRP will not execute the command buffer + // leaving outdated shadows in data. We set a flag to determine if the command + // buffer was executed. There will a 1-frame delay. + skip = Helpers.GetGlobalBoolean(ShaderIDs.s_ShadowPassExecuteLastFrame); + Helpers.SetGlobalBoolean(ShaderIDs.s_ShadowPassExecuteLastFrame, false); + } + + Update(buffer); + + // Only do a partial update when called by WaterRenderer as we want to execute + // with the camera's command buffer (in frame). + if (skip) + { + return; + } + } + + // Cache the camera for further down. + var camera = water.Viewer; + + if (camera == null) + { + return; + } + + base.BuildCommandBuffer(water, buffer); + + if (RenderPipelineHelper.IsLegacy && !isSimulationBuffer) + { + buffer.SetGlobalBoolean(ShaderIDs.s_ShadowPassExecuteLastFrame, true); + } + } + + private protected override void GetSubstepData(float timeToSimulate, out int substeps, out float delta) + { + substeps = Mathf.FloorToInt(timeToSimulate * _SimulationFrequency); + delta = substeps > 0 ? (1f / _SimulationFrequency) : 0f; + } + + private protected override void SetAdditionalSimulationParameters(PropertyWrapperCompute properties) + { + base.SetAdditionalSimulationParameters(properties); + + var jitter = new Vector4 + ( + _JitterDiameterSoft, + _JitterDiameterHard, + _CurrentFrameWeightSoft, + _CurrentFrameWeightHard + ); + + var waterMaterial = _Water.Surface.Material; + var hasColor = waterMaterial != null && waterMaterial.HasVector(WaterRenderer.ShaderIDs.s_Absorption) && waterMaterial.HasProperty(WaterRenderer.ShaderIDs.s_Scattering); + var absorption = hasColor ? waterMaterial.GetVector(WaterRenderer.ShaderIDs.s_Absorption).XYZ() : Vector3.zero; + var scattering = hasColor ? ((Vector4)waterMaterial.GetColor(WaterRenderer.ShaderIDs.s_Scattering).MaybeLinear()).XYZ() : Vector3.zero; + var sampleAbsorption = _Water.AbsorptionLod.Enabled; + var sampleScattering = _Water.ScatteringLod.Enabled; + var sampleColor = sampleAbsorption || sampleScattering; + + if (_DynamicSoftShadows && hasColor && !sampleColor) + { + // This approximates varying of soft shadowing by volume scattering/absorption density. + var extinction = absorption + scattering; + var factor = Mathf.Clamp01(Mathf.Min(Mathf.Min(extinction.x, extinction.y), extinction.z) * _SoftJitterExtinctionFactor); + jitter.x = (1f - factor) * k_MaximumJitter; + } + + Shader.SetGlobalFloat(ShaderIDs.s_DynamicSoftShadowsFactor, _DynamicSoftShadows ? _SoftJitterExtinctionFactor : 1f); + + var camera = _Water.Viewer; + + properties.SetVector(ShaderIDs.s_JitterDiameters_CurrentFrameWeights, jitter); + properties.SetMatrix(ShaderIDs.s_MainCameraProjectionMatrix, GL.GetGPUProjectionMatrix(camera.projectionMatrix, renderIntoTexture: true) * camera.worldToCameraMatrix); + + // Dynamic Soft Shadows. + properties.SetBoolean(ShaderIDs.s_SampleColorMap, _DynamicSoftShadows && sampleColor); + + if (_DynamicSoftShadows && sampleColor) + { + properties.SetVector(WaterRenderer.ShaderIDs.s_Absorption, absorption); + properties.SetVector(WaterRenderer.ShaderIDs.s_Scattering, scattering); + } + + if (RenderPipelineHelper.IsLegacy) + { + // If we are executing the simulation buffer, then we are clearing. + properties.SetBoolean(ShaderIDs.s_ClearShadows, _IsSimulationBuffer); + + properties.SetKeyword(new LocalKeyword(SimulationShader, "SHADOWS_SINGLE_CASCADE"), QualitySettings.shadowCascades == 1); + properties.SetKeyword(new LocalKeyword(SimulationShader, "SHADOWS_SPLIT_SPHERES"), QualitySettings.shadowProjection == ShadowProjection.StableFit); + } + } + + internal ShadowLod() + { + _Enabled = true; + _TextureFormat = GraphicsFormat.R8G8_UNorm; + } + + internal static SortedList s_Inputs = new(Helpers.DuplicateComparison); + private protected override SortedList Inputs => s_Inputs; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnLoad() + { + s_Inputs.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.cs.meta new file mode 100644 index 0000000..ac9f503 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Data/ShadowLod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 18a4c9a716729461c93494dbfc77c80e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug.meta new file mode 100644 index 0000000..d536673 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7bf87413682064486955955cc36a07e1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug/DebugGUI.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug/DebugGUI.cs new file mode 100644 index 0000000..38c19d3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug/DebugGUI.cs @@ -0,0 +1,485 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityInputSystem && ENABLE_INPUT_SYSTEM +#define INPUT_SYSTEM_ENABLED +#endif + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.InputSystem; +using UnityEngine.SceneManagement; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + [@ExecuteDuringEditMode] + [AddComponentMenu(Constants.k_MenuPrefixDebug + "Debug GUI")] + sealed class DebugGUI : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + bool _ShowWaterData = true; + + [SerializeField] + bool _GuiVisible = true; + + [SerializeField] + bool _DrawLodDatasActualSize = false; + + [UnityEngine.Range(0f, 1f)] + [SerializeField] + float _PausedScroll; + + + [Header("Simulations")] + + [SerializeField] + bool _DrawAnimatedWaves = true; + + [SerializeField] + bool _DrawDynamicWaves = false; + + [SerializeField] + bool _DrawFoam = false; + + [SerializeField] + bool _DrawFlow = false; + + [SerializeField] + bool _DrawShadow = false; + + [SerializeField] + bool _DrawDepth = false; + + [SerializeField] + bool _DrawClip = false; + + + const float k_ScrollBarWidth = 20f; + float _Scroll; + + static readonly float s_LeftPanelWidth = 180f; + static readonly float s_BottomPanelHeight = 25f; + static readonly Color s_GuiColor = Color.black * 0.7f; + + WaterRenderer _Water; + + static class ShaderIDs + { + public static readonly int s_Depth = Shader.PropertyToID("_Depth"); + public static readonly int s_Scale = Shader.PropertyToID("_Scale"); + public static readonly int s_Bias = Shader.PropertyToID("_Bias"); + } + + static readonly Dictionary s_SimulationNames = new(); + + static Material s_DebugArrayMaterial; + static Material DebugArrayMaterial + { + get + { + if (s_DebugArrayMaterial == null) s_DebugArrayMaterial = new(WaterResources.Instance.Shaders._DebugTextureArray); + return s_DebugArrayMaterial; + } + } + + static DebugGUI s_Instance; + + private protected override System.Action OnUpdateMethod => OnUpdate; + + public static bool OverGUI(Vector2 screenPosition) + { + if (s_Instance == null) + { + return false; + } + + // Over left panel. + if (s_Instance._GuiVisible && screenPosition.x < s_LeftPanelWidth) + { + return true; + } + + // Over bottom panel. + if (s_Instance._ShowWaterData && screenPosition.y < s_BottomPanelHeight) + { + return true; + } + + // Over scroll bar. + if (s_Instance._ShowWaterData && screenPosition.x > Screen.width - k_ScrollBarWidth) + { + return true; + } + + return false; + } + + private protected override void Initialize() + { + base.Initialize(); + s_Instance = this; + } + + private protected override void OnDisable() + { + base.OnDisable(); + s_Instance = null; + } + + void OnDestroy() + { + // Safe as there should only be one instance at a time. + Helpers.Destroy(s_DebugArrayMaterial); + } + + Vector3 _ViewerPositionLastFrame; + Vector3 _ViewerVelocity; + + void OnUpdate(WaterRenderer water) + { + _Water = water; + + if (_Water.Viewpoint != null) + { + _ViewerVelocity = (_Water.Viewpoint.position - _ViewerPositionLastFrame) / Time.deltaTime; + _ViewerPositionLastFrame = _Water != null ? _Water.Viewpoint.position : Vector3.zero; + } + + // New input system works even when game view is not focused. + if (!Application.isFocused) + { + return; + } + +#if INPUT_SYSTEM_ENABLED + if (Keyboard.current.gKey.wasPressedThisFrame) +#else + if (Input.GetKeyDown(KeyCode.G)) +#endif + { + ToggleGUI(); + } +#if INPUT_SYSTEM_ENABLED + if (Keyboard.current.fKey.wasPressedThisFrame) +#else + if (Input.GetKeyDown(KeyCode.F)) +#endif + { + Time.timeScale = Time.timeScale == 0f ? 1f : 0f; + } +#if INPUT_SYSTEM_ENABLED + if (Keyboard.current.rKey.wasPressedThisFrame) +#else + if (Input.GetKeyDown(KeyCode.R)) +#endif + { + SceneManager.LoadScene(SceneManager.GetSceneAt(0).buildIndex); + } + } + + void OnGUI() + { + _Water = WaterRenderer.Instance; + + var bkp = GUI.color; + + if (_GuiVisible) + { + GUI.skin.toggle.normal.textColor = Color.white; + GUI.skin.label.normal.textColor = Color.white; + + float x = 5f, y = 0f; + float w = s_LeftPanelWidth - 2f * x, h = 25f; + + GUI.color = s_GuiColor; + GUI.DrawTexture(new(0, 0, w + 2f * x, Screen.height), Texture2D.whiteTexture); + GUI.color = Color.white; + + GUI.changed = false; + var freeze = GUI.Toggle(new(x, y, w, h), Time.timeScale == 0f, "Freeze time (F)"); y += h; + if (GUI.changed) + { + Time.timeScale = freeze ? 0f : 1f; + } + + // Time scale + if (_Water) + { + GUI.Label(new(x, y, w, h), $"Time Scale: {Time.timeScale}"); y += h; + Time.timeScale = GUI.HorizontalSlider(new(x, y, w, h), Time.timeScale, 1f, 30f); y += h; + } + + // Global wind speed + if (_Water) + { + GUI.Label(new(x, y, w, h), "Global Wind Speed"); y += h; + _Water._WindSpeed = GUI.HorizontalSlider(new(x, y, w, h), _Water._WindSpeed, 0f, 150f); y += h; + } + + OnGUIGerstnerSection(x, ref y, w, h); + + _ShowWaterData = GUI.Toggle(new(x, y, w, h), _ShowWaterData, "Show sim data"); y += h; + + AnimatedWavesLod.s_Combine = GUI.Toggle(new(x, y, w, h), AnimatedWavesLod.s_Combine, "Shape combine pass"); y += h; + + ShadowLod.s_ProcessData = GUI.Toggle(new(x, y, w, h), ShadowLod.s_ProcessData, "Process Shadows"); y += h; + + if (_Water) + { + if (_Water._DynamicWavesLod.Enabled) + { + var dt = 1f / _Water._DynamicWavesLod.SimulationFrequency; + var steps = _Water._DynamicWavesLod.LastUpdateSubstepCount; + GUI.Label(new(x, y, w, h), string.Format("Sim steps: {0:0.00000} x {1}", dt, steps)); y += h; + } + + if (_Water.AnimatedWavesLod.Provider is IQueryable querySystem) + { + GUI.Label(new(x, y, w, h), $"Query result GUIDs: {querySystem.ResultGuidCount}"); y += h; + GUI.Label(new(x, y, w, h), $"Queries in flight: {querySystem.RequestCount}"); y += h; + GUI.Label(new(x, y, w, h), $"Query Count: {querySystem.QueryCount}"); y += h; + } + +#if UNITY_EDITOR + if (GUI.Button(new(x, y, w, h), "Select Water Material")) + { + var path = UnityEditor.AssetDatabase.GetAssetPath(_Water.Surface.Material); + var asset = UnityEditor.AssetDatabase.LoadMainAssetAtPath(path); + UnityEditor.Selection.activeObject = asset; + } + y += h; +#endif + } + + if (GUI.Button(new(x, y, w, h), "Hide GUI (G)")) + { + ToggleGUI(); + } + y += h; + } + + // draw source textures to screen + if (_ShowWaterData && _Water != null) + { + DrawShapeTargets(); + } + + GUI.color = bkp; + } + + void OnGUIGerstnerSection(float x, ref float y, float w, float h) + { + GUI.Label(new(x, y, w, h), "Gerstner weight(s)"); y += h; + + foreach (var gerstner in ShapeGerstner.s_Instances) + { + var specW = 75f; + gerstner.Value.Weight = GUI.HorizontalSlider(new(x, y, w - specW - 5f, h), gerstner.Value.Weight, 0f, 1f); + +#if UNITY_EDITOR + if (GUI.Button(new(x + w - specW, y, specW, h), "Spectrum")) + { + var path = UnityEditor.AssetDatabase.GetAssetPath(gerstner.Value._Spectrum); + var asset = UnityEditor.AssetDatabase.LoadMainAssetAtPath(path); + UnityEditor.Selection.activeObject = asset; + } +#endif + y += h; + } + + GUI.Label(new(x, y, w, h), $"FFT generator(s): {FFTCompute.GeneratorCount}"); y += h; + } + + void DrawShapeTargets() + { + // Draw bottom panel for toggles + var bottomBar = new Rect(_GuiVisible ? s_LeftPanelWidth : 0, + Screen.height - s_BottomPanelHeight, Screen.width, s_BottomPanelHeight); + GUI.color = s_GuiColor; + GUI.DrawTexture(bottomBar, Texture2D.whiteTexture); + GUI.color = Color.white; + + // Show viewer height above water in bottom panel + bottomBar.x += 10; + GUI.Label(bottomBar, "Viewer Height Above Water: " + _Water.ViewerHeightAboveWater); + + // Viewer speed + { + bottomBar.x += 250; + GUI.Label(bottomBar, "Speed: " + (3.6f * _ViewerVelocity.magnitude) + "km/h"); + } + + // Draw sim data + DrawSims(); + } + + void DrawSims() + { + var column = 1f; + + DrawVerticalScrollBar(); + + DrawSim(_Water._AnimatedWavesLod, ref _DrawAnimatedWaves, ref column, 0.5f); + DrawSim(_Water._DynamicWavesLod, ref _DrawDynamicWaves, ref column, 0.5f, 2f); + DrawSim(_Water._FoamLod, ref _DrawFoam, ref column); + DrawSim(_Water._FlowLod, ref _DrawFlow, ref column, 0.5f, 2f); + DrawSim(_Water._ShadowLod, ref _DrawShadow, ref column); + DrawSim(_Water._DepthLod, ref _DrawDepth, ref column); + DrawSim(_Water._ClipLod, ref _DrawClip, ref column); + } + + void DrawVerticalScrollBar() + { + if (!_DrawLodDatasActualSize) + { + return; + } + + // Data is uniform so use animated waves since it should always be there. + var lodData = _Water._AnimatedWavesLod; + + // Make scroll bar wider as resizable window hover area covers part of it. + var style = GUI.skin.verticalScrollbar; + style.fixedWidth = k_ScrollBarWidth; + + var height = Screen.height - s_BottomPanelHeight; + var rect = new Rect(Screen.width - style.fixedWidth, 0f, style.fixedWidth, height); + + // Background. + GUI.color = s_GuiColor; + GUI.DrawTexture(rect, Texture2D.whiteTexture); + GUI.color = Color.white; + + var scrollSize = lodData.DataTexture.height * lodData.DataTexture.volumeDepth - height; + +#if UNITY_EDITOR + if (UnityEditor.EditorApplication.isPaused) + { + _Scroll = _PausedScroll * scrollSize; + } +#endif + + _Scroll = GUI.VerticalScrollbar + ( + rect, + _Scroll, + size: height, + topValue: 0f, + bottomValue: lodData.DataTexture.height * lodData.DataTexture.volumeDepth, + style + ); + +#if UNITY_EDITOR + if (!UnityEditor.EditorApplication.isPaused) + { + _PausedScroll = Mathf.Clamp01(_Scroll / scrollSize); + } +#endif + } + + void DrawSim(Lod lodData, ref bool doDraw, ref float offset, float bias = 0f, float scale = 1f) + { + if (lodData == null) return; + if (!lodData.Enabled) return; + + // Compute short names that will fit in UI and cache them. + var type = lodData.GetType(); + if (!s_SimulationNames.ContainsKey(type)) + { + s_SimulationNames.Add(type, lodData.ID); + } + + var isRightmost = offset == 1f; + + // Zero out here so we maintain scroll when switching back to actual size. + var scroll = _DrawLodDatasActualSize ? _Scroll : 0f; + + var togglesBegin = Screen.height - s_BottomPanelHeight; + var b = 7f; + var h = _DrawLodDatasActualSize ? lodData.DataTexture.height : togglesBegin / lodData.DataTexture.volumeDepth; + var w = h + b; + var x = Screen.width - w * offset + b * (offset - 1f); + if (_DrawLodDatasActualSize) x -= k_ScrollBarWidth; + + if (doDraw) + { + // Background behind slices + GUI.color = s_GuiColor; + GUI.DrawTexture(new(x, 0, isRightmost ? w : w - b, Screen.height - s_BottomPanelHeight), Texture2D.whiteTexture); + GUI.color = Color.white; + + // Only use Graphics.DrawTexture in EventType.Repaint events if called in OnGUI + if (Event.current.type == EventType.Repaint) + { + for (var idx = 0; idx < lodData.DataTexture.volumeDepth; idx++) + { + var y = idx * h; + if (isRightmost) w += b; + + // Render specific slice of 2D texture array + DebugArrayMaterial.SetInteger(ShaderIDs.s_Depth, idx); + DebugArrayMaterial.SetFloat(ShaderIDs.s_Scale, scale); + DebugArrayMaterial.SetFloat(ShaderIDs.s_Bias, bias); + Graphics.DrawTexture(new(x + b, (y + b / 2f) - scroll, h - b, h - b), lodData.DataTexture, DebugArrayMaterial); + } + } + } + + doDraw = GUI.Toggle(new(x + b, togglesBegin, w - 2f * b, s_BottomPanelHeight), doDraw, s_SimulationNames[type]); + + offset++; + } + + public static void DrawTextureArray(RenderTexture data, int columnOffsetFromRightSide, float bias = 0f, float scale = 1f) + { + var offset = columnOffsetFromRightSide; + + var togglesBegin = Screen.height - s_BottomPanelHeight; + var b = 1f; + var h = togglesBegin / data.volumeDepth; + var w = h + b; + var x = Screen.width - w * offset + b * (offset - 1f); + + { + // Background behind slices + GUI.color = s_GuiColor; + GUI.DrawTexture(new(x, 0, offset == 1f ? w : w - b, Screen.height - s_BottomPanelHeight), Texture2D.whiteTexture); + GUI.color = Color.white; + + // Only use Graphics.DrawTexture in EventType.Repaint events if called in OnGUI + if (Event.current.type == EventType.Repaint) + { + for (var idx = 0; idx < data.volumeDepth; idx++) + { + var y = idx * h; + if (offset == 1f) w += b; + + // Render specific slice of 2D texture array + DebugArrayMaterial.SetInteger(ShaderIDs.s_Depth, idx); + DebugArrayMaterial.SetFloat(ShaderIDs.s_Scale, scale); + DebugArrayMaterial.SetFloat(ShaderIDs.s_Bias, bias); + Graphics.DrawTexture(new(x + b, y + b / 2f, h - b, h - b), data, DebugArrayMaterial); + } + } + } + } + + void ToggleGUI() + { + _GuiVisible = !_GuiVisible; + } + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void InitStatics() + { + // Init here from 2019.3 onwards + s_SimulationNames.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug/DebugGUI.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug/DebugGUI.cs.meta new file mode 100644 index 0000000..bde764c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Debug/DebugGUI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a99f334f87d2427296c00a43de30529 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Deprecated.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Deprecated.cs new file mode 100644 index 0000000..912ff29 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Deprecated.cs @@ -0,0 +1,154 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + partial class WaterRenderer + { + const string k_SurfaceRendererObsoleteMessage = "This property can now be found on WaterRenderer.Surface"; + + // + // Fields + // + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("The water chunk renderers will have this layer.")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [SerializeField] + int _Layer = 4; // Water + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("Material to use for the water surface.")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [SerializeField] + internal Material _Material = null; + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("Underwater will copy from this material if set.\n\nUseful for overriding properties for the underwater effect. To see what properties can be overriden, see the disabled properties on the underwater material. This does not affect the surface.")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [SerializeField] + internal Material _VolumeMaterial = null; + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("Template for water chunks as a prefab.\n\nThe only requirements are that the prefab must contain a MeshRenderer at the root and not a MeshFilter or WaterChunkRenderer. MR values will be overwritten where necessary and the prefabs are linked in edit mode.")] + [SerializeField] + internal GameObject _ChunkTemplate; + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("Have the water surface cast shadows for albedo (both foam and custom).")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [SerializeField] + internal bool _CastShadows; + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("Whether 'Water Body' components will cull the water tiles.\n\nDisable if you want to use the 'Material Override' feature and still have an ocean.")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [SerializeField] + bool _WaterBodyCulling = true; + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("How many frames to distribute the chunk bounds calculation.\n\nThe chunk bounds are calculated per frame to ensure culling is correct when using inputs that affect displacement. Some performance can be saved by distributing the load over several frames. The higher the frames, the longer it will take - lowest being instant.")] + [@Range(1, 30, Range.Clamp.Minimum)] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [SerializeField] + int _TimeSliceBoundsUpdateFrameCount = 1; + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("How to handle self-intersections of the water surface.\n\nThey can be caused by choppy waves which can cause a flipped underwater effect. When not using the portals/volumes, this fix is only applied when within 2 metres of the water surface. Automatic will disable the fix if portals/volumes are used which is the recommend setting.")] + [SerializeField] + internal SurfaceRenderer.SurfaceSelfIntersectionFixMode _SurfaceSelfIntersectionFixMode = SurfaceRenderer.SurfaceSelfIntersectionFixMode.Automatic; + + [Obsolete(k_SurfaceRendererObsoleteMessage)] + [HideInInspector] + [Tooltip("Whether to allow sorting using the render queue.\n\nIf you need to change the minor part of the render queue (eg +100), then enable this option. As a side effect, it will also disable the front-to-back rendering optimization for Crest. This option does not affect changing the major part of the render queue (eg AlphaTest, Transparent), as that is always allowed.\n\nRender queue sorting is required for some third-party integrations.")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [SerializeField] + bool _AllowRenderQueueSorting; + + + // + // API + // + + int GetLayer() + { + return Surface.Layer; + } + + void SetLayer(int previous, int current) + { + Surface.Layer = current; + } + + Material GetMaterial() + { + return Surface.Material; + } + + void SetMaterial(Material previous, Material current) + { + Surface.Material = current; + } + + Material GetVolumeMaterial() + { + return Surface.VolumeMaterial; + } + + void SetVolumeMaterial(Material previous, Material current) + { + Surface.VolumeMaterial = current; + } + + bool GetCastShadows() + { + return Surface.CastShadows; + } + + void SetCastShadows(bool previous, bool current) + { + Surface.CastShadows = current; + } + + bool GetWaterBodyCulling() + { + return Surface.WaterBodyCulling; + } + + void SetWaterBodyCulling(bool previous, bool current) + { + Surface.WaterBodyCulling = current; + } + + int GetTimeSliceBoundsUpdateFrameCount() + { + return Surface.TimeSliceBoundsUpdateFrameCount; + } + + void SetTimeSliceBoundsUpdateFrameCount(int previous, int current) + { + Surface.TimeSliceBoundsUpdateFrameCount = current; + } + + bool GetAllowRenderQueueSorting() + { + return Surface.AllowRenderQueueSorting; + } + + void SetAllowRenderQueueSorting(bool previous, bool current) + { + Surface.AllowRenderQueueSorting = current; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Deprecated.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Deprecated.cs.meta new file mode 100644 index 0000000..8d2f70a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Deprecated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40c7e9cba055f4ed9a6dfb8dc5de0051 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated.meta new file mode 100644 index 0000000..66319c5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a07c6d3c380ca4b3190a8f93a15b6acf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/API.Generated.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/API.Generated.cs new file mode 100644 index 0000000..01b9078 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/API.Generated.cs @@ -0,0 +1,1987 @@ +// + +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +namespace WaveHarmonic.Crest +{ + partial class AnimatedWavesLod + { + /// + /// How much waves are dampened in shallow water. + /// + public float AttenuationInShallows { get => _AttenuationInShallows; set => _AttenuationInShallows = value; } + + /// + /// Collision layers to enable. + /// + /// + /// Some layers will have overhead with CPU, GPU and memory. + /// + public CollisionLayers CollisionLayers { get => _CollisionLayers; set => _CollisionLayers = value; } + + /// + /// Where to obtain water shape on CPU for physics / gameplay. + /// + public CollisionSource CollisionSource { get => _CollisionSource; internal set => _CollisionSource = value; } + + /// + /// Maximum number of wave queries that can be performed when using GPU queries. + /// + public int MaximumQueryCount => _MaximumQueryCount; + + /// + /// Any water deeper than this will receive full wave strength. + /// + /// + /// The lower the value, the less effective the depth cache will be at attenuating very large waves. Set to the maximum value (1,000) to disable. + /// + public float ShallowsMaximumDepth { get => _ShallowsMaximumDepth; set => _ShallowsMaximumDepth = value; } + + /// + /// Shifts wavelengths to maintain quality for higher resolutions. + /// + /// + /// Set this to 2 to improve wave quality. In some cases like flowing rivers, this can make a substantial difference to visual stability. We recommend doubling the Resolution on the WaterRenderer component to preserve detail after making this change. + /// + public float WaveResolutionMultiplier { get => _WaveResolutionMultiplier; set => _WaveResolutionMultiplier = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class AnimatedWavesLodInput + { + /// + /// When to render the input into the displacement data. + /// + public DisplacementPass DisplacementPass { get => _DisplacementPass; set => _DisplacementPass = value; } + + /// + /// Whether to filter this input by wavelength. + /// + /// + /// If disabled, it will render to all LODs. + /// + public bool FilterByWavelength { get => _FilterByWavelength; set => _FilterByWavelength = value; } + + /// + /// Inform the system how much this input will displace the water surface horizontally. + /// + /// + /// This is used to set bounding box widths for the water chunks. + /// + public float MaximumDisplacementHorizontal { get => _MaximumDisplacementHorizontal; set => _MaximumDisplacementHorizontal = value; } + + /// + /// Inform the system how much this input will displace the water surface vertically. + /// + /// + /// This is used to set bounding box heights for the water chunks. + /// + public float MaximumDisplacementVertical { get => _MaximumDisplacementVertical; set => _MaximumDisplacementVertical = value; } + + /// + /// Which octave to render into. + /// + /// + /// For example, set this to 2 to render into the 2m-4m octave. These refer to the same octaves as the wave spectrum editor. + /// + public float OctaveWavelength { get => _OctaveWavelength; set => _OctaveWavelength = value; } + + /// + /// When to render the input into the displacement data. + /// + /// + /// If enabled, it renders into all LODs of the simulation after the combine step rather than before with filtering. Furthermore, it will also affect dynamic waves. + /// + [System.Obsolete("Please use DisplacementPass instead.")] + public bool RenderPostCombine { get => _RenderPostCombine; set => SetRenderPostCombine(_RenderPostCombine, _RenderPostCombine = value); } + + /// + /// Use the bounding box of an attached renderer component to determine the maximum vertical displacement. + /// + public bool ReportRendererBounds { get => _ReportRendererBounds; set => _ReportRendererBounds = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class ClipLod + { + /// + /// The default clipping behaviour. + /// + /// + /// Whether to clip nothing by default (and clip inputs remove patches of surface), or to clip everything by default (and clip inputs add patches of surface). + /// + public DefaultClippingState DefaultClippingState { get => _DefaultClippingState; set => SetDefaultClippingState(_DefaultClippingState, _DefaultClippingState = value); } + } +} + +namespace WaveHarmonic.Crest +{ + partial class ClipLodInput + { + /// + /// Removes clip surface data instead of adding it. + /// + public bool Inverted { get => _Inverted; set => _Inverted = value; } + + /// + /// The primitive to render (signed distance) into the simulation. + /// + public LodInputPrimitive Primitive { get => _Primitive; set => _Primitive = value; } + + /// + /// Prevents inputs from cancelling each other out when aligned vertically. + /// + /// + /// It is imperfect so custom logic might be needed for your use case. + /// + public bool WaterHeightDistanceCulling { get => _WaterHeightDistanceCulling; set => _WaterHeightDistanceCulling = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class ColorLod + { + /// + /// Color of the shoreline color. + /// + public UnityEngine.Color ShorelineColor { get => _ShorelineColor; set => SetShorelineColor(_ShorelineColor, _ShorelineColor = value); } + + /// + /// Shoreline color falloff value. + /// + public float ShorelineColorFalloff { get => _ShorelineColorFalloff; set => _ShorelineColorFalloff = value; } + + /// + /// The maximum distance of the shoreline color. + /// + /// + /// If using Depth, then it is maximum depth. + /// + public float ShorelineColorMaximumDistance { get => _ShorelineColorMaximumDistance; set => _ShorelineColorMaximumDistance = value; } + + /// + /// Source of the shoreline color. + /// + public ShorelineVolumeColorSource ShorelineColorSource { get => _ShorelineColorSource; set => _ShorelineColorSource = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class CustomTimeProvider + { + /// + /// The delta time override value. + /// + public float DeltaTime { get => _DeltaTime; set => _DeltaTime = value; } + + /// + /// Whether to override the water simulation time. + /// + /// + /// This in particular affects dynamic elements of the simulation like the foam simulation and the ripple simulation. + /// + public bool OverrideDeltaTime { get => _OverrideDeltaTime; set => _OverrideDeltaTime = value; } + + /// + /// Whether to override the water simulation time. + /// + public bool OverrideTime { get => _OverrideTime; set => _OverrideTime = value; } + + /// + /// Freeze progression of time. Only works properly in Play mode. + /// + public bool Paused { get => _Paused; set => _Paused = value; } + + /// + /// The time override value. + /// + public float TimeOverride { get => _Time; set => _Time = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class CutsceneTimeProvider + { + /// + /// Assign this time provider to the water system when this component becomes active. + /// + public bool AssignToWaterComponentOnEnable { get => _AssignToWaterComponentOnEnable; set => _AssignToWaterComponentOnEnable = value; } + +#if d_ModuleUnityDirector + /// + /// Playable Director to take time from. + /// + public UnityEngine.Playables.PlayableDirector PlayableDirector { get => _PlayableDirector; set => _PlayableDirector = value; } +#endif + + /// + /// Restore the time provider that was previously assigned to water system when this component disables. + /// + public bool RestorePreviousTimeProviderOnDisable { get => _RestorePreviousTimeProviderOnDisable; set => _RestorePreviousTimeProviderOnDisable = value; } + + /// + /// Time offset which will be added to the Timeline time. + /// + public float TimeOffset { get => _TimeOffset; set => _TimeOffset = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class DepthLod + { + /// + /// Support signed distance field data generated from the depth probes. + /// + /// + /// Requires a two component texture format. + /// + public bool EnableSignedDistanceFields { get => _EnableSignedDistanceFields; set => SetEnableSignedDistanceFields(_EnableSignedDistanceFields, _EnableSignedDistanceFields = value); } + + /// + /// Whether to include the terrain height automatically. + /// + /// + /// This will not include terrain details, nor will it produce a signed-distance field. There may also be a slight deviation due to differences in height data and terrain mesh. In these cases, please use the DepthProbe. + /// + public bool IncludeTerrainHeight { get => _IncludeTerrainHeight; set => _IncludeTerrainHeight = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class DepthLodInput + { + /// + /// Whether to copy the signed distance field. + /// + public bool CopySignedDistanceField { get => _CopySignedDistanceField; set => _CopySignedDistanceField = value; } + + /// + /// Whether the data is relative to the input height. + /// + /// + /// Useful for procedural placement. + /// + public bool Relative { get => _Relative; set => _Relative = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class DepthProbe + { + /// + /// How many additional Jump Flood rounds to use. + /// + /// + /// The standard number of rounds is log2(resolution). Additional rounds can reduce innaccuracies. + /// + public int AdditionalJumpFloodRounds { get => _AdditionalJumpFloodRounds; set => SetDirty(_AdditionalJumpFloodRounds, _AdditionalJumpFloodRounds = value); } + + /// + /// The far and near plane of the depth probe camera respectively, relative to the transform. + /// + /// + /// Depth is captured top-down and orthographically. The gizmo will visualize this range as the bottom box. + /// + public UnityEngine.Vector2 CaptureRange { get => _CaptureRange; set => SetDirty(_CaptureRange, _CaptureRange = value); } + + /// + /// Increase coverage by testing mesh back faces within the Fill Holes area. + /// + /// + /// Uses the back-faces to include meshes where the front-face is within the Fill Holes area and the back-face is within the capture area. An example would be an upright cylinder not over a hole but was not captured due to the top being clipped by the near plane. + /// + public bool EnableBackFaceInclusion { get => _EnableBackFaceInclusion; set => SetDirty(_EnableBackFaceInclusion, _EnableBackFaceInclusion = value); } + + /// + /// Fills holes left by the maximum of the capture range. + /// + /// + /// Setting the maximum capture range lower than the highest point of geometry can be useful for eliminating depth artifacts from overhangs, but the side effect is there will be a hole in the depth data where geometry is clipped by the near plane. This will only capture where the holes are to fill them in. This height is relative to the maximum capture range. Set to zero to skip. + /// + public float FillHolesCaptureHeight { get => _FillHolesCaptureHeight; set => SetDirty(_FillHolesCaptureHeight, _FillHolesCaptureHeight = value); } + + /// + /// Generate a signed distance field for the shoreline. + /// + public bool GenerateSignedDistanceField { get => _GenerateSignedDistanceField; set => SetDirty(_GenerateSignedDistanceField, _GenerateSignedDistanceField = value); } + + /// + /// The layers to render into the probe. + /// + public UnityEngine.LayerMask Layers { get => _Layers; set => SetDirty(_Layers, _Layers = value); } + + /// + /// Overrides global quality settings. + /// + public QualitySettingsOverride QualitySettingsOverride => _QualitySettingsOverride; + + /// + /// Controls how the probe is refreshed in the Player. + /// + /// + /// Call Populate() if scripting. + /// + public DepthProbeRefreshMode RefreshMode { get => _RefreshMode; set => _RefreshMode = value; } + + /// + /// The resolution of the probe. + /// + /// + /// Lower will be more efficient. + /// + public int Resolution { get => _Resolution; set => SetDirty(_Resolution, _Resolution = value); } + + /// + /// Baked probe. + /// + /// + /// Can only bake in edit mode. + /// + public UnityEngine.Texture2D SavedTexture { get => _SavedTexture; set => _SavedTexture = value; } + + /// + /// Specifies the setup for this probe. + /// + public DepthProbeMode Type { get => _Type; set => _Type = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class DirectionalTextureLodInputData + { + /// + /// Whether the texture supports negative values. + /// + public bool NegativeValues { get => _NegativeValues; set => _NegativeValues = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class DynamicWavesLod + { + /// + /// How much waves are dampened in shallow water. + /// + public float AttenuationInShallows { get => _AttenuationInShallows; set => _AttenuationInShallows = value; } + + /// + /// Settings for fine tuning this simulation. + /// + public DynamicWavesLodSettings Settings { get => GetSettings(); set => _Settings = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class DynamicWavesLodSettings + { + /// + /// Stability control. + /// + /// + /// Lower values means more stable simulation, but may slow down some dynamic waves. This value should be set as large as possible until simulation instabilities/flickering begin to appear. Default is 0.7. + /// + public float CourantNumber { get => _CourantNumber; set => _CourantNumber = value; } + + /// + /// How much energy is dissipated each frame. + /// + /// + /// Helps simulation stability, but limits how far ripples will propagate. Set this as large as possible/acceptable. Default is 0.05. + /// + public float Damping { get => _Damping; set => _Damping = value; } + + /// + /// Clamp displacement to help prevent self-intersection in steep waves. + /// + /// + /// Zero means unclamped. + /// + public float DisplaceClamp { get => _DisplaceClamp; set => _DisplaceClamp = value; } + + /// + /// Multiplier for gravity. + /// + /// + /// More gravity means dynamic waves will travel faster. Higher values can be a source of instability. + /// + public float GravityMultiplier { get => _GravityMultiplier; set => _GravityMultiplier = value; } + + /// + /// Induce horizontal displacements to sharpen simulated waves. + /// + public float HorizontalDisplace { get => _HorizontalDisplace; set => _HorizontalDisplace = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class FloatingObject + { + /// + /// Approximate hydrodynamics of 'surfing' down waves. + /// + public float AccelerateDownhill { get => _AccelerateDownhill; set => _AccelerateDownhill = value; } + + /// + /// Angular drag when in water. + /// + /// + /// Additive to the angular drag declared on the rigid body. + /// + public float AngularDrag { get => _AngularDrag; set => _AngularDrag = value; } + + /// + /// Strength of buoyancy force. + /// + /// + /// For probes, roughly a mass to force ratio of 100 to 1 to keep the center of mass near the surface. For Align Normal, default value is for a default sphere with a default rigidbody. + /// + public float BuoyancyForceStrength { get => _BuoyancyForceStrength; set => _BuoyancyForceStrength = value; } + + /// + /// Strength of torque applied to match boat orientation to water normal. + /// + public float BuoyancyTorqueStrength { get => _BuoyancyTorqueStrength; set => _BuoyancyTorqueStrength = value; } + + /// + /// Height offset from transform center to bottom of boat (if any). + /// + /// + /// Default value is for a default sphere. Having this value be an accurate measurement from center to bottom is not necessary. + /// + public float CenterToBottomOffset { get => _CenterToBottomOffset; set => _CenterToBottomOffset = value; } + + /// + /// Drag when in water. + /// + /// + /// Additive to the drag declared on the rigid body. + /// + public UnityEngine.Vector3 Drag { get => _Drag; set => _Drag = value; } + + /// + /// Vertical offset for where drag force should be applied. + /// + public float ForceHeightOffset { get => _ForceHeightOffset; set => _ForceHeightOffset = value; } + + /// + /// Which water collision layer to target. + /// + public CollisionLayer Layer { get => _Layer; set => _Layer = value; } + + /// + /// Clamps the buoyancy force to this value. + /// + /// + /// Useful for handling fully submerged objects. + /// + public float MaximumBuoyancyForce { get => _MaximumBuoyancyForce; set => _MaximumBuoyancyForce = value; } + + /// + /// The model to use for buoyancy. + /// + /// + /// Align Normal is simple and only uses a few queries whilst Probes is more advanced and uses a few queries per probe. Cannot be changed at runtime after Start. + /// + public FloatingObjectModel Model { get => _Model; set => _Model = value; } + + /// + /// Length dimension of boat. + /// + /// + /// Only used if Use Boat Length is enabled. + /// + public float ObjectLength { get => _ObjectLength; set => _ObjectLength = value; } + + /// + /// Width of object for physics purposes. + /// + /// + /// The larger this value, the more filtered/smooth the wave response will be. If larger wavelengths cannot be filtered, increase the LOD Levels + /// + public float ObjectWidth { get => _ObjectWidth; set => _ObjectWidth = value; } + + /// + /// Query points for buoyancy. + /// + /// + /// Only applicable to Probes model. + /// + public FloatingObjectProbe[] Probes { get => _Probes; set => _Probes = value; } + + /// + /// The rigid body to affect. + /// + /// + /// It will automatically get the sibling rigid body if not set. + /// + public UnityEngine.Rigidbody RigidBody { get => _RigidBody; set => _RigidBody = value; } + + /// + /// Computes a separate normal based on boat length to get more accurate orientations. + /// + /// + /// Requires the cost of an extra collision sample. + /// + public bool UseObjectLength { get => _UseObjectLength; set => _UseObjectLength = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class FoamLod + { + /// + /// Prewarms the simulation on load and teleports. + /// + /// + /// Results are only an approximation. + /// + public bool Prewarm { get => _Prewarm; set => _Prewarm = value; } + + /// + /// Settings for fine tuning this simulation. + /// + public FoamLodSettings Settings { get => GetSettings(); set => _Settings = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class FoamLodSettings + { + /// + /// The minimum LOD to sample waves from. + /// + /// + /// Zero means all waves and increasing will exclude lower wavelengths which can help with too much foam near the camera. + /// + public int FilterWaves { get => _FilterWaves; set => _FilterWaves = value; } + + /// + /// How quickly foam dissipates. + /// + /// + /// Low values mean foam remains on surface for longer. This setting should be balanced with the generation *strength* parameters below. + /// + public float FoamFadeRate { get => _FoamFadeRate; set => _FoamFadeRate = value; } + + /// + /// Foam will not exceed this value in the simulation which can be used to prevent foam from accumulating too much. + /// + public float Maximum { get => _Maximum; set => _Maximum = value; } + + /// + /// Foam will be generated in water shallower than this depth. + /// + /// + /// Controls how wide the band of foam at the shoreline will be. Note that this is not a distance to shoreline, but a threshold on water depth, so the width of the foam band can vary based on terrain slope. To address this limitation we allow foam to be manually added from geometry or from a texture, see the next section. + /// + public float ShorelineFoamMaximumDepth { get => _ShorelineFoamMaximumDepth; set => _ShorelineFoamMaximumDepth = value; } + + /// + /// Primes foam when terrain height is this value above water. + /// + /// + /// This ignores other foam settings and writes a constant foam value. + /// + public float ShorelineFoamPriming { get => _ShorelineFoamPriming; set => _ShorelineFoamPriming = value; } + + /// + /// Scales intensity of foam generated in shallow water. + /// + /// + /// This setting should be balanced with the Foam Fade Rate setting. + /// + public float ShorelineFoamStrength { get => _ShorelineFoamStrength; set => _ShorelineFoamStrength = value; } + + /// + /// How much of the waves generate foam. + /// + /// + /// Higher values will lower the threshold for foam generation, giving a larger area. + /// + public float WaveFoamCoverage { get => _WaveFoamCoverage; set => _WaveFoamCoverage = value; } + + /// + /// Scales intensity of foam generated from waves. + /// + /// + /// This setting should be balanced with the Foam Fade Rate setting. + /// + public float WaveFoamStrength { get => _WaveFoamStrength; set => _WaveFoamStrength = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class GeometryLodInputData + { + /// + /// Geometry to render into the simulation. + /// + public UnityEngine.Mesh Geometry { get => _Geometry; set => SetGeometry(_Geometry, _Geometry = value); } + } +} + +namespace WaveHarmonic.Crest +{ + partial class LevelLodInput + { + /// + /// The minimum and maximum height value to report for water chunk culling. + /// + public UnityEngine.Vector2 HeightRange { get => _HeightRange; set => _HeightRange = value; } + + /// + /// Whether to use the manual "Height Range" for water chunk culling. + /// + /// + /// Mandatory for non mesh inputs like "Texture". + /// + public bool OverrideHeight { get => _OverrideHeight; set => _OverrideHeight = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class Lod + { + /// + /// Whether the simulation is enabled. + /// + public bool Enabled { get => GetEnabled(); set => SetEnabled(_Enabled, _Enabled = value); } + + /// + /// Whether to override the resolution. + /// + /// + /// If not enabled, then the simulation will use the resolution defined on the Water Renderer. + /// + public bool OverrideResolution { get => _OverrideResolution; set => SetDirty(_OverrideResolution, _OverrideResolution = value); } + + /// + /// The resolution of the simulation data. + /// + /// + /// Set higher for sharper results at the cost of higher memory usage. + /// + public int Resolution { get => GetResolution(); set => SetDirty(_Resolution, _Resolution = value); } + + /// + /// The render texture format used for this simulation data. + /// + /// + /// It will be overriden if the format is incompatible with the platform. + /// + public UnityEngine.Experimental.Rendering.GraphicsFormat TextureFormat { get => _TextureFormat; set => SetDirty(_TextureFormat, _TextureFormat = value); } + + /// + /// Chooses a texture format based on a preset value. + /// + public LodTextureFormatMode TextureFormatMode { get => _TextureFormatMode; set => SetDirty(_TextureFormatMode, _TextureFormatMode = value); } + } +} + +namespace WaveHarmonic.Crest +{ + partial class LodInput + { + /// + /// How this input blends into existing data. + /// + /// + /// Similar to blend operations in shaders. For inputs which have materials, use the blend functionality on the shader/material. + /// + public LodInputBlend Blend { get => _Blend; set => _Blend = value; } + + /// + /// The width of the feathering to soften the edges to blend inputs. + /// + /// + /// Inputs that do not support feathering will have this field disabled or hidden in UI. + /// + public float FeatherWidth { get => _FeatherWidth; set => _FeatherWidth = value; } + + /// + /// How this input responds to horizontal displacement. + /// + /// + /// If false, data will not move horizontally with the waves. Has a small performance overhead when disabled. Only suitable for inputs of small size. + /// + public bool FollowHorizontalWaveMotion { get => _FollowHorizontalWaveMotion; set => _FollowHorizontalWaveMotion = value; } + + /// + /// The mode for this input. + /// + /// + /// See the manual for more details about input modes. Use AddComponent(LodInputMode) to set the mode via scripting. The mode cannot be changed after creation. + /// + public LodInputMode Mode => _Mode; + + /// + /// The order this input will render. + /// + /// + /// Order is Queue plus SiblingIndex + /// + public int Queue { get => _Queue; set => SetQueue(_Queue, _Queue = value); } + + /// + /// Scales the input. + /// + public float Weight { get => _Weight; set => _Weight = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class Meniscus + { + /// + /// Whether the meniscus is enabled. + /// + public bool Enabled { get => GetEnabled(); set => SetEnabled(_Enabled, _Enabled = value); } + + /// + /// Any camera with this layer in its culling mask will render the meniscus. + /// + public int Layer { get => _Layer; set => _Layer = value; } + + /// + /// The meniscus material. + /// + public UnityEngine.Material Material { get => _Material; set => SetMaterial(_Material, _Material = value); } + } +} + +namespace WaveHarmonic.Crest +{ + partial class PersistentLod + { + /// + /// Frequency to run the simulation, in updates per second. + /// + /// + /// Lower frequencies are more efficient but may lead to visible jitter or slowness. + /// + public int SimulationFrequency { get => _SimulationFrequency; set => _SimulationFrequency = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class QualitySettingsOverride + { + /// + /// Overrides the LOD bias for meshes. + /// + /// + /// Highest quality is infinity. + /// + public float LodBias { get => _LodBias; set => _LodBias = value; } + + /// + /// Overrides the maximum LOD level. + /// + /// + /// Highest quality is zero. + /// + public int MaximumLodLevel { get => _MaximumLodLevel; set => _MaximumLodLevel = value; } + + /// + /// Whether to override the LOD bias. + /// + public bool OverrideLodBias { get => _OverrideLodBias; set => _OverrideLodBias = value; } + + /// + /// Whether to override the maximum LOD level. + /// + public bool OverrideMaximumLodLevel { get => _OverrideMaximumLodLevel; set => _OverrideMaximumLodLevel = value; } + + /// + /// Whether to override the terrain pixel error. + /// + public bool OverrideTerrainPixelError { get => _OverrideTerrainPixelError; set => _OverrideTerrainPixelError = value; } + + /// + /// Overrides the pixel error value for terrains. + /// + /// + /// Highest quality is zero. + /// + public float TerrainPixelError { get => _TerrainPixelError; set => _TerrainPixelError = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class QueryEvents + { + /// + /// Sends the distance from the water's edge. + /// + public System.Action DistanceFromEdge { get; set; } + + /// + /// Apply a curve to the distance. + /// + /// + /// Values towards "one" means closer to the water's edge. + /// + public UnityEngine.AnimationCurve DistanceFromEdgeCurve { get => _DistanceFromEdgeCurve; set => _DistanceFromEdgeCurve = value; } + + /// + /// The maximum distance. + /// + /// + /// Always use a real distance in real units (ie not normalized). + /// + public float DistanceFromEdgeMaximum { get => _DistanceFromEdgeMaximum; set => _DistanceFromEdgeMaximum = value; } + + /// + /// Whether to keep the sign of the value (ie positive/negative). + /// + /// + /// A positive value means the query point is over water, while a negative means it is over land. + /// + public bool DistanceFromEdgeSigned { get => _DistanceFromEdgeSigned; set => _DistanceFromEdgeSigned = value; } + + /// + /// Apply a curve to the distance. + /// + /// + /// Normalizes and inverts the distance to be between zero and one, then applies a curve. + /// + public bool DistanceFromEdgeUseCurve { get => _DistanceFromEdgeUseCurve; set => _DistanceFromEdgeUseCurve = value; } + + /// + /// Sends the distance from the water surface. + /// + public System.Action DistanceFromSurface { get; set; } + + /// + /// Apply a curve to the distance. + /// + /// + /// Values towards "one" means closer to the water surface. + /// + public UnityEngine.AnimationCurve DistanceFromSurfaceCurve { get => _DistanceFromSurfaceCurve; set => _DistanceFromSurfaceCurve = value; } + + /// + /// The maximum distance. + /// + /// + /// Always use a real distance in real units (ie not normalized). + /// + public float DistanceFromSurfaceMaximum { get => _DistanceFromSurfaceMaximum; set => _DistanceFromSurfaceMaximum = value; } + + /// + /// Whether to keep the sign of the value (ie positive/negative). + /// + /// + /// A positive value means the query point is above the surface, while a negative means it below the surface. + /// + public bool DistanceFromSurfaceSigned { get => _DistanceFromSurfaceSigned; set => _DistanceFromSurfaceSigned = value; } + + /// + /// Whether to apply a curve to the distance. + /// + /// + /// Normalizes and inverts the distance to be between zero and one, then applies a curve. + /// + public bool DistanceFromSurfaceUseCurve { get => _DistanceFromSurfaceUseCurve; set => _DistanceFromSurfaceUseCurve = value; } + + /// + /// Which water collision layer to target. + /// + public CollisionLayer Layer { get => _Layer; set => _Layer = value; } + + /// + /// The minimum wavelength for queries. + /// + /// + /// The higher the value, the more smaller waves will be ignored when sampling the water surface. + /// + public float MinimumWavelength { get => _MinimumWavelength; set => _MinimumWavelength = value; } + + /// + /// Triggers when game object goes above water surface. + /// + /// + /// Triggers once per state change. + /// + public System.Action OnAboveWater { get; set; } + + /// + /// Triggers when game object goes below water surface. + /// + /// + /// Triggers once per state change. + /// + public System.Action OnBelowWater { get; set; } + + /// + /// What transform should the queries be based on. + /// + /// + /// "Viewer" will reuse queries already performed by the Water Renderer + /// + public QuerySource Source { get => _Source; set => _Source = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class RendererLodInputData + { + /// + /// Check that the shader applied to this object matches the input type. + /// + /// + /// For example, an Animated Waves input object has an Animated Waves input shader. + /// + public bool CheckShaderName { get => _CheckShaderName; set => _CheckShaderName = value; } + + /// + /// Check that the shader applied to this object has only a single pass, as only the first pass is executed for most inputs. + /// + public bool CheckShaderPasses { get => _CheckShaderPasses; set => _CheckShaderPasses = value; } + + /// + /// Forces the renderer to only render into the LOD data, and not to render in the scene as it normally would. + /// + public bool DisableRenderer { get => _DisableRenderer; set => SetDisableRenderer(_DisableRenderer, _DisableRenderer = value); } + + /// + /// Whether to set the shader pass manually. + /// + public bool OverrideShaderPass { get => _OverrideShaderPass; set => _OverrideShaderPass = value; } + + /// + /// The renderer to use for this input. + /// + /// + /// Can be anything that inherits from Renderer like MeshRenderer, TrailRenderer etc. + /// + public UnityEngine.Renderer Renderer { get => _Renderer; set => SetRenderer(_Renderer, _Renderer = value); } + + /// + /// The shader pass to execute. + /// + /// + /// Set to -1 to execute all passes. + /// + public int ShaderPassIndex { get => _ShaderPassIndex; set => _ShaderPassIndex = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class ShadowLod + { + /// + /// Current frame weight for accumulation over frames for hard shadows. + /// + /// + /// Roughly means 'responsiveness' for hard shadows. + /// + public float CurrentFrameWeightHard { get => _CurrentFrameWeightHard; set => _CurrentFrameWeightHard = value; } + + /// + /// Current frame weight for accumulation over frames for soft shadows. + /// + /// + /// Roughly means 'responsiveness' for soft shadows. + /// + public float CurrentFrameWeightSoft { get => _CurrentFrameWeightSoft; set => _CurrentFrameWeightSoft = value; } + + /// + /// Jitter diameter for hard shadows, controls softness of this shadowing component. + /// + public float JitterDiameterHard { get => _JitterDiameterHard; set => _JitterDiameterHard = value; } + + /// + /// Jitter diameter for soft shadows, controls softness of this shadowing component. + /// + public float JitterDiameterSoft { get => _JitterDiameterSoft; set => _JitterDiameterSoft = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class ShapeFFT + { + /// + /// Maximum amount a point on the surface will be displaced horizontally by waves from its rest position. + /// + /// + /// Increase this if gaps appear at sides of screen. + /// + public float MaximumHorizontalDisplacement { get => _MaximumHorizontalDisplacement; set => _MaximumHorizontalDisplacement = value; } + + /// + /// Maximum amount the surface will be displaced vertically from sea level. + /// + /// + /// Increase this if gaps appear at bottom of screen. + /// + public float MaximumVerticalDisplacement { get => _MaximumVerticalDisplacement; set => _MaximumVerticalDisplacement = value; } + + /// + /// Whether to use the wind turbulence on this component rather than the global wind turbulence. + /// + /// + /// Global wind turbulence comes from the Water Renderer component. + /// + public bool OverrideGlobalWindTurbulence { get => _OverrideGlobalWindTurbulence; set => _OverrideGlobalWindTurbulence = value; } + + /// + /// FFT waves will loop with a period of this many seconds. + /// + public float TimeLoopLength { get => _TimeLoopLength; set => _TimeLoopLength = value; } + + /// + /// How aligned the waves are with wind. + /// + public float WindAlignment { get => _WindAlignment; set => _WindAlignment = value; } + + /// + /// How turbulent/chaotic the waves are. + /// + public float WindTurbulence { get => GetWindTurbulence(); set => _WindTurbulence = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class ShapeGerstner + { + /// + /// How many wave components to generate in each octave. + /// + public int ComponentsPerOctave { get => _ComponentsPerOctave; set => _ComponentsPerOctave = value; } + + /// + /// Prevent data arrays from being written to so one can provide their own. + /// + public bool ManualGeneration { get => _ManualGeneration; set => _ManualGeneration = value; } + + /// + /// Change to get a different set of waves. + /// + public int RandomSeed { get => _RandomSeed; set => _RandomSeed = value; } + + /// + /// The weight of the opposing, second pair of Gerstner waves. + /// + /// + /// Each Gerstner wave is actually a pair of waves travelling in opposite directions (similar to FFT). This weight is applied to the wave travelling in against-wind direction. Set to zero to obtain simple single waves which are useful for shorelines waves. + /// + public float ReverseWaveWeight { get => GetReverseWaveWeight(); set => _ReverseWaveWeight = value; } + + /// + /// Use a swell spectrum as the default. + /// + /// + /// Uses a swell spectrum as default (when none is assigned), and disabled reverse waves. + /// + public bool Swell { get => _Swell; set => _Swell = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class ShapeWaves + { + /// + /// Whether to evaluate the spectrum every frame. + /// + /// + /// When false, the wave spectrum is evaluated once on startup in editor play mode and standalone builds, rather than every frame. This is less flexible, but it reduces the performance cost significantly. + /// + public bool EvaluateSpectrumAtRunTimeEveryFrame { get => _EvaluateSpectrumAtRunTimeEveryFrame; set => _EvaluateSpectrumAtRunTimeEveryFrame = value; } + + /// + /// Whether to use the wind direction on this component rather than the global wind direction. + /// + /// + /// Global wind direction comes from the Water Renderer component. + /// + public bool OverrideGlobalWindDirection { get => _OverrideGlobalWindDirection; set => _OverrideGlobalWindDirection = value; } + + /// + /// Whether to use the wind speed on this component rather than the global wind speed. + /// + /// + /// Global wind speed comes from the Water Renderer component. + /// + public bool OverrideGlobalWindSpeed { get => _OverrideGlobalWindSpeed; set => _OverrideGlobalWindSpeed = value; } + + /// + /// Resolution to use for wave generation buffers. + /// + /// + /// Low resolutions are more efficient but can result in noticeable patterns in the shape. + /// + public int Resolution { get => _Resolution; set => _Resolution = value; } + + /// + /// How much these waves respect the shallow water attenuation. + /// + /// + /// Attenuation is defined on the Animated Waves. Set to zero to ignore attenuation. + /// + public float RespectShallowWaterAttenuation { get => _RespectShallowWaterAttenuation; set => _RespectShallowWaterAttenuation = value; } + + /// + /// The spectrum that defines the water surface shape. + /// + public WaveSpectrum Spectrum { get => _Spectrum; set => _Spectrum = value; } + + /// + /// Primary wave direction heading (degrees). + /// + /// + /// This is the angle from x axis in degrees that the waves are oriented towards. If a spline is being used to place the waves, this angle is relative to the spline. + /// + public float WaveDirectionHeadingAngle { get => GetWaveDirectionHeadingAngle(); set => _WaveDirectionHeadingAngle = value; } + + /// + /// Wind speed in km/h. Controls wave conditions. + /// + public float WindSpeed { get => _WindSpeed; set => _WindSpeed = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class SphereWaterInteraction + { + /// + /// Whether to improve visibility in larger LODs. + /// + /// + /// If the dynamic waves are not visible far enough in the distance from the camera, this can be used to boost the output. + /// + public bool BoostLargeWaves { get => _BoostLargeWaves; set => _BoostLargeWaves = value; } + + /// + /// How much to correct the position for horizontal wave displacement. + /// + /// + /// If set to 0, the input will always be applied at a fixed position before any horizontal displacement from waves. If waves are large then their displacement may cause the interactive waves to drift away from the object. This parameter can be increased to compensate for this displacement and combat this issue. However increasing too far can cause a feedback loop which causes strong 'ring' artifacts to appear in the dynamic waves. This parameter can be tweaked to balance this two effects. + /// + public float CompensateForWaveMotion { get => _CompensateForWaveMotion; set => _CompensateForWaveMotion = value; } + + /// + /// Model parameter that can be used to modify the shape of the interaction. + /// + /// + /// Internally the interaction is modelled by a pair of nested spheres. The forces from the two spheres combine to create the final effect. This parameter scales the effect of the inner sphere and can be tweaked to adjust the shape of the result. + /// + public float InnerSphereMultiplier { get => _InnerSphereMultiplier; set => _InnerSphereMultiplier = value; } + + /// + /// Model parameter that can be used to modify the shape of the interaction. + /// + /// + /// This parameter controls the size of the inner sphere and can be tweaked to give further control over the result. + /// + public float InnerSphereOffset { get => _InnerSphereOffset; set => _InnerSphereOffset = value; } + + /// + /// Maximum speed clamp (km/h). + /// + /// + /// Useful for controlling/limiting wake. + /// + public float MaximumSpeed { get => _MaximumSpeed; set => _MaximumSpeed = value; } + + /// + /// Radius of the sphere that is modelled from which the interaction forces are calculated. + /// + public float Radius { get => _Radius; set => _Radius = value; } + + /// + /// Teleport speed (km/h). + /// + /// + /// If the calculated speed is larger than this amount, the object is deemed to have teleported and the computed velocity is discarded. + /// + public float TeleportSpeed { get => _TeleportSpeed; set => _TeleportSpeed = value; } + + /// + /// Offset in direction of motion to help ripples appear in front of sphere. + /// + /// + /// There is some latency between applying a force to the wave simualtion and the resulting waves appearing. Applying this offset can help to ensure the waves do not lag behind the sphere. + /// + public float VelocityOffset { get => _VelocityOffset; set => _VelocityOffset = value; } + + /// + /// Outputs a warning to the console on speed clamp. + /// + public bool WarnOnSpeedClamp { get => _WarnOnSpeedClamp; set => _WarnOnSpeedClamp = value; } + + /// + /// Outputs a warning to the console on teleport. + /// + public bool WarnOnTeleport { get => _WarnOnTeleport; set => _WarnOnTeleport = value; } + + /// + /// Intensity of the forces. + /// + /// + /// Can be set negative to invert. + /// + public float Weight { get => _Weight; set => _Weight = value; } + + /// + /// Intensity of the forces from vertical motion of the sphere. + /// + /// + /// Scales ripples generated from a sphere moving up or down. + /// + public float WeightVerticalMultiplier { get => _WeightVerticalMultiplier; set => _WeightVerticalMultiplier = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + /// + /// Whether to allow sorting using the render queue. + /// + /// + /// If you need to change the minor part of the render queue (eg +100), then enable this option. As a side effect, it will also disable the front-to-back rendering optimization for Crest. This option does not affect changing the major part of the render queue (eg AlphaTest, Transparent), as that is always allowed. + /// + public bool AllowRenderQueueSorting { get => _AllowRenderQueueSorting; set => _AllowRenderQueueSorting = value; } + + /// + /// Have the water surface cast shadows for albedo (both foam and custom). + /// + public bool CastShadows { get => GetCastShadows(); set => _CastShadows = value; } + + /// + /// Whether the underwater effect is enabled. + /// + /// + /// Allocates/releases resources if state has changed. + /// + public bool Enabled { get => GetEnabled(); set => SetEnabled(_Enabled, _Enabled = value); } + + /// + /// The water chunk renderers will have this layer. + /// + public int Layer { get => _Layer; set => _Layer = value; } + + /// + /// Material to use for the water surface. + /// + public UnityEngine.Material Material { get => _Material; set => _Material = value; } + + /// + /// How many frames to distribute the chunk bounds calculation. + /// + /// + /// The chunk bounds are calculated per frame to ensure culling is correct when using inputs that affect displacement. Some performance can be saved by distributing the load over several frames. The higher the frames, the longer it will take - lowest being instant. + /// + public int TimeSliceBoundsUpdateFrameCount { get => _TimeSliceBoundsUpdateFrameCount; set => _TimeSliceBoundsUpdateFrameCount = value; } + + /// + /// Underwater will copy from this material if set. + /// + /// + /// Useful for overriding properties for the underwater effect. To see what properties can be overriden, see the disabled properties on the underwater material. This does not affect the surface. + /// + public UnityEngine.Material VolumeMaterial { get => _VolumeMaterial; set => _VolumeMaterial = value; } + + /// + /// Whether 'Water Body' components will cull the water tiles. + /// + /// + /// Disable if you want to use the 'Material Override' feature and still have an ocean. + /// + public bool WaterBodyCulling { get => _WaterBodyCulling; set => _WaterBodyCulling = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class TextureLodInputData + { + /// + /// Multiplies the texture sample. + /// + /// + /// This is useful for normalized textures. The four components map to the four color/alpha components of the texture (if they exist). + /// + public UnityEngine.Vector4 Multiplier { get => _Multiplier; set => _Multiplier = value; } + + /// + /// Texture to render into the simulation. + /// + public UnityEngine.Texture Texture { get => _Texture; set => _Texture = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class UnderwaterRenderer + { + /// + /// Whether to execute for all cameras. + /// + /// + /// If disabled, then additionally ignore any camera that is not the view camera or our reflection camera. It will require managing culling masks of all cameras. + /// + public bool AllCameras { get => _AllCameras; set => _AllCameras = value; } + + /// + /// Copying parameters each frame ensures underwater appearance stays consistent with the water surface. + /// + /// + /// Has a small overhead so should be disabled if not needed. + /// + public bool CopyWaterMaterialParametersEachFrame { get => _CopyWaterMaterialParametersEachFrame; set => _CopyWaterMaterialParametersEachFrame = value; } + + /// + /// Proportion of visibility below which the water surface will be culled when underwater. + /// + /// + /// The larger the number, the closer to the camera the water tiles will be culled. + /// + public float CullLimit { get => _CullLimit; set => _CullLimit = value; } + + /// + /// Whether the underwater effect is enabled. + /// + /// + /// Allocates/releases resources if state has changed. + /// + public bool Enabled { get => _Enabled; set => SetEnabled(_Enabled, _Enabled = value); } + + /// + /// Provides out-scattering based on the camera's underwater depth. + /// + /// + /// It scales down environmental lighting (sun, reflections, ambient etc) with the underwater depth. This works with vanilla lighting, but uncommon or custom lighting will require a custom solution (use this for reference) + /// + public bool AffectsEnvironmentalLighting { get => _EnvironmentalLightingEnable; set => SetAffectsEnvironmentalLighting(_EnvironmentalLightingEnable, _EnvironmentalLightingEnable = value); } + + /// + /// How much this effect applies. + /// + /// + /// Values less than 1 attenuate light less underwater. Value of 1 is physically based. + /// + public float EnvironmentalLightingWeight { get => _EnvironmentalLightingWeight; set => _EnvironmentalLightingWeight = value; } + + /// + /// Adjusts the far plane for horizon line calculation. Helps with horizon line issue. + /// + public float FarPlaneMultiplier { get => _FarPlaneMultiplier; set => _FarPlaneMultiplier = value; } + + /// + /// Any camera or probe with this layer in its culling mask will render underwater. + /// + public int Layer { get => _Layer; set => _Layer = value; } + + /// + /// The underwater material. The water surface material is copied into this material. + /// + public UnityEngine.Material Material { get => _Material; set => _Material = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class WaterBody + { + /// + /// Overrides the property on the Water Renderer with the same name when the camera is inside the bounds. + /// + public UnityEngine.Material BelowSurfaceMaterial { get => _BelowSurfaceMaterial; set => _BelowSurfaceMaterial = value; } + + /// + /// Makes sure this water body is not clipped. + /// + /// + /// If clipping is enabled and set to clip everywhere by default, this option will register this water body to ensure its area does not get clipped. + /// + public bool Clipped { get => _Clip; set => _Clip = value; } + + /// + /// Water chunks that overlap this waterbody area will be assigned this material. + /// + /// + /// This is useful for varying water appearance across different water bodies. If no override material is specified, the default material assigned to the WaterRenderer component will be used. + /// + public UnityEngine.Material AboveSurfaceMaterial { get => _Material; set => _Material = value; } + + /// + /// Overrides the Water Renderer's volume material when the camera is inside the bounds. + /// + public UnityEngine.Material VolumeMaterial { get => _VolumeMaterial; set => _VolumeMaterial = value; } + } +} + +namespace WaveHarmonic.Crest.Watercraft +{ + partial class Controller + { + /// + /// Applies a curve to buoyancy changes. + /// + public UnityEngine.AnimationCurve BuoyancyCurveFactor { get => _BuoyancyCurveFactor; set => _BuoyancyCurveFactor = value; } + + /// + /// The accompanied control script to take input from. + /// + public Control Control { get => _Control; set => _Control = value; } + + /// + /// The accompanied buoyancy script. + /// + public WaveHarmonic.Crest.FloatingObject FloatingObject { get => _FloatingObject; set => _FloatingObject = value; } + + /// + /// Vertical offset from the center of mass for where move force should be applied. + /// + public float ForceHeightOffset { get => _ForceHeightOffset; set => _ForceHeightOffset = value; } + + /// + /// How quickly the watercraft turns from steering. + /// + public float SteerPower { get => _SteerPower; set => _SteerPower = value; } + + /// + /// How quickly the watercraft moves from thrust. + /// + public float ThrustPower { get => _ThrustPower; set => _ThrustPower = value; } + + /// + /// Rolls the watercraft when turning. + /// + public float TurningHeel { get => _TurningHeel; set => _TurningHeel = value; } + } +} + +namespace WaveHarmonic.Crest.Watercraft +{ + partial class FixedControl + { + /// + /// Constantly move. + /// + public float Move { get => _Move; set => _Move = value; } + + /// + /// Constantly turn. + /// + public float Turn { get => _Turn; set => _Turn = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class WaterReflections + { + /// + /// Whether to allow MSAA. + /// + public bool AllowMSAA { get => _AllowMSAA; set => _AllowMSAA = value; } + + /// + /// The near clip plane clips any geometry before it, removing it from reflections. + /// + /// + /// Can be used to reduce reflection leaks and support varied water level. + /// + public float ClipPlaneOffset { get => _ClipPlaneOffset; set => _ClipPlaneOffset = value; } + + /// + /// Disables occlusion culling. + /// + public bool DisableOcclusionCulling { get => _DisableOcclusionCulling; set => _DisableOcclusionCulling = value; } + + /// + /// Disables pixel lights (BIRP only). + /// + public bool DisablePixelLights { get => _DisablePixelLights; set => _DisablePixelLights = value; } + + /// + /// Disables shadows. + /// + public bool DisableShadows { get => _DisableShadows; set => _DisableShadows = value; } + + /// + /// Whether planar reflections are enabled. + /// + /// + /// Allocates/releases resources if state has changed. + /// + public bool Enabled { get => _Enabled; set => SetEnabled(_Enabled, _Enabled = value); } + + /// + /// Anything beyond the far clip plane is not rendered. + /// + public float FarClipPlane { get => _FarClipPlane; set => _FarClipPlane = value; } + + /// + /// Whether to allow HDR. + /// + public bool HDR { get => _HDR; set => _HDR = value; } + + /// + /// The layers to rendering into reflections. + /// + public UnityEngine.LayerMask Layers { get => _Layers; set => _Layers = value; } + + /// + /// What side of the water surface to render planar reflections for. + /// + public WaterReflectionSide ReflectionSide { get => _Mode; set => _Mode = value; } + + /// + /// Planar relfections using an oblique frustum for better performance. + /// + /// + /// This can cause depth issues for TIRs, especially near the surface. + /// + public bool NonObliqueNearSurface { get => _NonObliqueNearSurface; set => _NonObliqueNearSurface = value; } + + /// + /// If within this distance from the surface, disable the oblique matrix. + /// + public float NonObliqueNearSurfaceThreshold { get => _NonObliqueNearSurfaceThreshold; set => _NonObliqueNearSurfaceThreshold = value; } + + /// + /// Overrides global quality settings. + /// + public QualitySettingsOverride QualitySettingsOverride { get => _QualitySettingsOverride; set => _QualitySettingsOverride = value; } + + /// + /// Whether to render to the viewer camera only. + /// + /// + /// When disabled, reflections will render for all cameras rendering the water layer, which currently this prevents Refresh Rate from working. Enabling will unlock the Refresh Rate heading. + /// + public bool RenderOnlySingleCamera { get => _RenderOnlySingleCamera; set => _RenderOnlySingleCamera = value; } + + /// + /// Resolution of the reflection texture. + /// + public int Resolution { get => _Resolution; set => _Resolution = value; } + + /// + /// Whether to render the sky or fallback to default reflections. + /// + /// + /// Not rendering the sky can prevent other custom shaders (like tree leaves) from being in the final output. Enable for best compatibility. + /// + public bool Sky { get => _Sky; set => _Sky = value; } + + /// + /// Whether to allow stencil operations. + /// + public bool Stencil { get => _Stencil; set => _Stencil = value; } + + /// + /// An oblique matrix will clip anything below the surface for free. + /// + /// + /// Disable if you have problems with certain effects. Disabling can cause other artifacts like objects below the surface to appear in reflections. + /// + public bool UseObliqueMatrix { get => _UseObliqueMatrix; set => _UseObliqueMatrix = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class WaterRenderer + { + /// + /// Absorption information - gives color to water. + /// + public AbsorptionLod AbsorptionLod => _AbsorptionLod; + + /// + /// Albedo - a colour layer composited onto the water surface. + /// + public AlbedoLod AlbedoLod => _AlbedoLod; + + /// + /// Whether to allow sorting using the render queue. + /// + /// + /// If you need to change the minor part of the render queue (eg +100), then enable this option. As a side effect, it will also disable the front-to-back rendering optimization for Crest. This option does not affect changing the major part of the render queue (eg AlphaTest, Transparent), as that is always allowed. + /// + [System.Obsolete("This property can now be found on WaterRenderer.Surface")] + public bool AllowRenderQueueSorting { get => GetAllowRenderQueueSorting(); set => SetAllowRenderQueueSorting(_AllowRenderQueueSorting, _AllowRenderQueueSorting = value); } + + /// + /// All waves (including Dynamic Waves) are written to this simulation. + /// + public AnimatedWavesLod AnimatedWavesLod => _AnimatedWavesLod; + + /// + /// The camera which drives the water data. + /// + /// + /// Setting this is optional. Defaults to the main camera. + /// + public UnityEngine.Camera Viewer { get => GetViewer(); set => _Camera = value; } + + /// + /// Have the water surface cast shadows for albedo (both foam and custom). + /// + [System.Obsolete("This property can now be found on WaterRenderer.Surface")] + public bool CastShadows { get => GetCastShadows(); set => SetCastShadows(_CastShadows, _CastShadows = value); } + + /// + /// Keep the center of detail from drifting from the viewpoint. + /// + /// + /// Large horizontal displacement can displace the center of detail. This uses queries to keep the center of detail aligned. + /// + public bool CenterOfDetailDisplacementCorrection { get => _CenterOfDetailDisplacementCorrection; set => _CenterOfDetailDisplacementCorrection = value; } + + /// + /// Clip surface information for clipping the water surface. + /// + public ClipLod ClipLod => _ClipLod; + + /// + /// Water depth information used for shallow water, shoreline foam, wave attenuation, among others. + /// + public DepthLod DepthLod => _DepthLod; + + /// + /// Drops the height for maximum water detail based on waves. + /// + /// + /// This means if there are big waves, max detail level is reached at a lower height, which can help visual range when there are very large waves and camera is at sea level. + /// + public float DropDetailHeightBasedOnWaves { get => _DropDetailHeightBasedOnWaves; set => _DropDetailHeightBasedOnWaves = value; } + + /// + /// Dynamic waves generated from interactions with objects such as boats. + /// + public DynamicWavesLod DynamicWavesLod => _DynamicWavesLod; + + /// + /// Applied to the extents' far vertices to make them larger. + /// + /// + /// Increase if the extents do not reach the horizon or you see the underwater effect at the horizon. + /// + public float ExtentsSizeMultiplier { get => _ExtentsSizeMultiplier; set => _ExtentsSizeMultiplier = value; } + + /// + /// Horizontal motion of water body, akin to water currents. + /// + public FlowLod FlowLod => _FlowLod; + + /// + /// Simulation of foam created in choppy water and dissipating over time. + /// + public FoamLod FoamLod => _FoamLod; + + /// + /// Forces smoothing for scale changes. + /// + /// + /// When water level varies, smoothing scale change can prevent pops when the viewer's height above water sharply changes. Smoothing is disabled when terrain sampling is enabled or the water level simulation is disabled. + /// + public bool ForceScaleChangeSmoothing { get => _ForceScaleChangeSmoothing; set => _ForceScaleChangeSmoothing = value; } + + /// + /// How much of the water shape gets tessellated by geometry. + /// + /// + /// For example, if set to four, every geometry quad will span 4x4 LOD data texels. a value of 2 will generate one vert per 2x2 LOD data texels. A value of 1 means a vert is generated for every LOD data texel. Larger values give lower fidelity surface shape with higher performance. + /// + public int GeometryDownSampleFactor { get => _GeometryDownSampleFactor; set => _GeometryDownSampleFactor = value; } + + /// + /// Multiplier for physics gravity. + /// + public float GravityMultiplier { get => _GravityMultiplier; set => _GravityMultiplier = value; } + + /// + /// Gravity for all wave calculations. + /// + public float GravityOverride { get => _GravityOverride; set => _GravityOverride = value; } + + /// + /// When in the render pipeline the water is rendered. + /// + /// + /// Default is the old behaviour which is controlled by Unity. + /// + public WaterInjectionPoint InjectionPoint { get => _InjectionPoint; set => _InjectionPoint = value; } + + /// + /// The water chunk renderers will have this layer. + /// + [System.Obsolete("This property can now be found on WaterRenderer.Surface")] + public int Layer { get => GetLayer(); set => SetLayer(_Layer, _Layer = value); } + + /// + /// Varying water level to support water bodies at different heights and rivers to run down slopes. + /// + public LevelLod LevelLod => _LevelLod; + + /// + /// Material to use for the water surface. + /// + [System.Obsolete("This property can now be found on WaterRenderer.Surface")] + public UnityEngine.Material Material { get => GetMaterial(); set => SetMaterial(_Material, _Material = value); } + + /// + /// The meniscus module. + /// + public Meniscus Meniscus => _Meniscus; + + /// + /// Provide your own gravity value instead of Physics.gravity. + /// + public bool OverrideGravity { get => _OverrideGravity; set => _OverrideGravity = value; } + + /// + /// Whether to override the automatic detection of framebuffer HDR rendering (BIRP only). + /// + /// + /// Rendering using HDR formats is optional, but there is no way for us to determine if HDR rendering is enabled in the Graphics Settings. We make an educated based on which platform is the target. If you see rendering issues, try disabling this. + /// + public bool OverrideRenderHDR { get => _OverrideRenderHDR; set => _OverrideRenderHDR = value; } + + /// + /// The portal renderer. + /// + public Portals.PortalRenderer Portals => _Portals; + + /// + /// The primary light that affects the water. + /// + /// + /// Setting this is optional. This should be a directional light. Defaults to RenderSettings.sun. + /// + public UnityEngine.Light PrimaryLight { get => GetPrimaryLight(); set => _PrimaryLight = value; } + + /// + /// The reflection renderer. + /// + public WaterReflections Reflections => _Reflections; + + /// + /// Force HDR format usage (BIRP only). + /// + /// + /// If enabled, we assume the framebuffer is an HDR format, otherwise an LDR format. + /// + public bool RenderHDR { get => _RenderHDR; set => _RenderHDR = value; } + + /// + /// The resolution of the various water LOD data. + /// + /// + /// This includes mesh density, displacement textures, foam data, dynamic wave simulation, etc. Sets the 'detail' present in the water - larger values give more detail at increased run-time expense. This value can be overriden per LOD in their respective settings except for Animated Waves which is tied to this value. + /// + public int LodResolution { get => _Resolution; set => _Resolution = value; } + + /// + /// Also checks terrain height when determining the scale. + /// + /// + /// The scale is changed based on the viewer's height above the water surface. This can be a problem with varied water level, as the viewer may not be directly over the higher water level leading to a height difference, and thus incorrect scale. + /// + public bool SampleTerrainHeightForScale { get => _SampleTerrainHeightForScale; set => _SampleTerrainHeightForScale = value; } + + /// + /// The scale the water can be (infinity for no maximum). + /// + /// + /// Water is scaled horizontally with viewer height, to keep the meshing suitable for elevated viewpoints. This sets the minimum and maximum the water will be scaled. Low minimum values give lots of detail, but will limit the horizontal extents of the water detail. Increasing the minimum value can be a great performance saving for mobile as it will reduce draw calls. + /// + public UnityEngine.Vector2 ScaleRange { get => _ScaleRange; set => _ScaleRange = value; } + + /// + /// Scattering information - gives color to water. + /// + public ScatteringLod ScatteringLod => _ScatteringLod; + + /// + /// Shadow information used for lighting water. + /// + public ShadowLod ShadowLod => _ShadowLod; + + /// + /// Number of levels of details (chunks, scales etc) to generate. + /// + /// + /// The horizontal range of the water surface doubles for each added LOD, while GPU processing time increases linearly. The higher the number, the further out detail will be. Furthermore, the higher the count, the more larger wavelengths can be filtering in queries. + /// + public int LodLevels { get => _Slices; set => _Slices = value; } + + /// + /// The water surface renderer. + /// + public SurfaceRenderer Surface => _Surface; + + /// + /// The distance threshold for when the viewer has considered to have teleported. + /// + /// + /// This is used to prevent popping, and for prewarming simulations. Threshold is in Unity units. + /// + public float TeleportThreshold { get => _TeleportThreshold; set => _TeleportThreshold = value; } + + /// + /// How many frames to distribute the chunk bounds calculation. + /// + /// + /// The chunk bounds are calculated per frame to ensure culling is correct when using inputs that affect displacement. Some performance can be saved by distributing the load over several frames. The higher the frames, the longer it will take - lowest being instant. + /// + [System.Obsolete("This property can now be found on WaterRenderer.Surface")] + public int TimeSliceBoundsUpdateFrameCount { get => GetTimeSliceBoundsUpdateFrameCount(); set => SetTimeSliceBoundsUpdateFrameCount(_TimeSliceBoundsUpdateFrameCount, _TimeSliceBoundsUpdateFrameCount = value); } + + /// + /// The underwater renderer. + /// + public UnderwaterRenderer Underwater => _Underwater; + + /// + /// The viewpoint which drives the water detail - the center of the LOD system. + /// + /// + /// Setting this is optional. Defaults to the camera. + /// + public UnityEngine.Transform Viewpoint { get => GetViewpoint(); set => _Viewpoint = value; } + + /// + /// Underwater will copy from this material if set. + /// + /// + /// Useful for overriding properties for the underwater effect. To see what properties can be overriden, see the disabled properties on the underwater material. This does not affect the surface. + /// + [System.Obsolete("This property can now be found on WaterRenderer.Surface")] + public UnityEngine.Material VolumeMaterial { get => GetVolumeMaterial(); set => SetVolumeMaterial(_VolumeMaterial, _VolumeMaterial = value); } + + /// + /// Whether 'Water Body' components will cull the water tiles. + /// + /// + /// Disable if you want to use the 'Material Override' feature and still have an ocean. + /// + [System.Obsolete("This property can now be found on WaterRenderer.Surface")] + public bool WaterBodyCulling { get => GetWaterBodyCulling(); set => SetWaterBodyCulling(_WaterBodyCulling, _WaterBodyCulling = value); } + + /// + /// Base wind direction in degrees. + /// + /// + /// Controls wave conditions. Can be overridden on Shape* components. + /// + public float WindDirection { get => GetWindDirection(); set => _WindDirection = value; } + + /// + /// Base wind speed in km/h. + /// + /// + /// Controls wave conditions. Can be overridden on Shape* components. + /// + public float WindSpeed { get => GetWindSpeed(); set => _WindSpeed = value; } + + /// + /// Base wind turbulence. + /// + /// + /// Controls wave conditions. Can be overridden on ShapeFFT components. + /// + public float WindTurbulence { get => GetWindTurbulence(); set => _WindTurbulence = value; } + + /// + /// Uses a provided WindZone as the source of global wind. + /// + /// + /// It must be directional. Wind speed units are presumed to be in m/s. + /// + public UnityEngine.WindZone WindZone { get => _WindZone; set => _WindZone = value; } + + /// + /// Whether to enable motion vector support. + /// + public bool WriteMotionVectors { get => GetWriteMotionVectors(); set => _WriteMotionVectors = value; } + + /// + /// Whether to write the water surface color to the color/opaque texture. + /// + /// + /// This is likely only beneficial if the water injection point is before transparency, and there are shaders which need it (like refraction). + /// + public bool WriteToColorTexture { get => GetWriteToColorTexture(); set => _WriteToColorTexture = value; } + + /// + /// Whether to write the water surface depth to the depth texture. + /// + /// + /// The water surface writes to the depth buffer, but Unity does not copy it to the depth texture for post-processing effects like Depth of Field (or refraction). This will copy the depth buffer to the depth texture. + /// + public bool WriteToDepthTexture { get => GetWriteToDepthTexture(); set => _WriteToDepthTexture = value; } + } +} + +namespace WaveHarmonic.Crest +{ + partial class WatertightHull + { + /// + /// Inverts the effect to remove clipping (ie add water). + /// + public bool Inverted { get => _Inverted; set => _Inverted = value; } + + /// + /// The convex hull to keep water out. + /// + public UnityEngine.Mesh Mesh { get => _Mesh; set => _Mesh = value; } + + /// + /// Which mode to use. + /// + public WatertightHullMode Mode { get => _Mode; set => SetMode(_Mode, _Mode = value); } + + /// + /// Order this input will render. + /// + /// + /// Queue is 'Queue + SiblingIndex' + /// + public int Queue { get => _Queue; set => SetQueue(_Queue, _Queue = value); } + + /// + /// Whether to also to clip the surface when using displacement mode. + /// + /// + /// Displacement mode can have a leaky hull by allowing chop top push waves across the hull boundaries slightly. Clipping the surface will remove these interior leaks. + /// + public bool UseClipWithDisplacement { get => _UseClipWithDisplacement; set => SetUseClipWithDisplacement(_UseClipWithDisplacement, _UseClipWithDisplacement = value); } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/API.Generated.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/API.Generated.cs.meta new file mode 100644 index 0000000..fa835c0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/API.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 72ab8f86c06904e6dac398cb493f96b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/Documentation.Generated.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/Documentation.Generated.cs new file mode 100644 index 0000000..cb31f4f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/Documentation.Generated.cs @@ -0,0 +1,453 @@ +// + +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +namespace WaveHarmonic.Crest.Generated +{ + enum CollisionLayer + { + /// + /// Include all displacement. + /// + Everything, + + /// + /// Only include Animated Waves. + /// + AfterAnimatedWaves, + + /// + /// Include Animated Waves and Dynamic Waves. + /// + AfterDynamicWaves, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum CollisionLayers + { + /// + /// All layers. + /// + Everything, + + /// + /// No extra layers (ie single layer). + /// + Nothing, + + /// + /// Separate layer for dynamic waves. + /// + /// + /// Dynamic waves are normally combined together for efficiency. By enabling this layer, dynamic waves are combined and added in a separate pass. + /// + DynamicWaves, + + /// + /// Extra displacement layer for visual displacement. + /// + Displacement, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum CollisionSource + { + /// + /// No collision source. Flat water. + /// + None, + + /// + /// Uses AsyncGPUReadback to retrieve data from GPU to CPU. + /// + /// + /// This is the most optimal approach. + /// + GPU, + + /// + /// Computes data entirely on the CPU. + /// + CPU, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum DefaultClippingState + { + /// + /// By default, nothing is clipped. Use clip inputs to remove water. + /// + NothingClipped, + + /// + /// By default, everything is clipped. Use clip inputs to add water. + /// + EverythingClipped, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum DepthProbeMode + { + /// + /// Update in real-time in accordance to refresh mode. + /// + RealTime, + + /// + /// Baked in the editor. + /// + Baked, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum DepthProbeRefreshMode + { + /// + /// Populates the DepthProbe in Start. + /// + OnStart, + + /// + /// Requires manual updating via DepthProbe.Populate. + /// + ViaScripting, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum DisplacementPass + { + /// + /// Displacement that is dependent on an LOD (eg waves). + /// + /// + /// Uses filtering to determine which LOD to write to. + /// + LodDependent, + + /// + /// Renders to all LODs. + /// + LodIndependent, + + /// + /// Renders to all LODs, but as a separate pass. + /// + /// + /// Typically used to render visual displacement which does not affect collisions. + /// + LodIndependentLast, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum FloatingObjectModel + { + /// + /// A simple model which aligns the object with the wave normal. + /// + AlignNormal, + + /// + /// A more advanced model which samples water at the probes positions. + /// + Probes, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum LodInputBlend + { + /// + /// No blending. Overwrites. + /// + Off, + + /// + /// Additive blending. + /// + Additive, + + /// + /// Takes the minimum value. + /// + Minimum, + + /// + /// Takes the maximum value. + /// + Maximum, + + /// + /// Applies the inverse weight to the target. + /// + /// + /// Basically overwrites what is already in the simulation. + /// + Alpha, + + /// + /// Same as alpha except anything above zero will overwrite rather than blend. + /// + AlphaClip, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum LodInputMode + { + /// + /// Unset is the serialization default. + /// + /// + /// This will be replaced with the default mode automatically. Unset can also be used if something is invalid. + /// + Unset, + + /// + /// Hand-painted data by the user. + /// + Paint, + + /// + /// Driven by a user created spline. + /// + Spline, + + /// + /// Attached 'Renderer' (mesh, particle or other) used to drive data. + /// + Renderer, + + /// + /// Driven by a mathematical primitive such as a cube or sphere. + /// + Primitive, + + /// + /// Covers the entire water area. + /// + Global, + + /// + /// Data driven by a user provided texture. + /// + Texture, + + /// + /// Renders geometry using a default material. + /// + Geometry, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum LodInputPrimitive + { + /// + /// Spheroid. + /// + Sphere, + + /// + /// Cuboid. + /// + Cube, + + /// + /// Quad. + /// + Quad, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum LodTextureFormatMode + { + /// + /// Uses the Texture Format property. + /// + Manual, + + /// + /// Chooses a texture format for performance. + /// + Performance, + + /// + /// Chooses a texture format for precision. + /// + /// + /// This format can reduce artifacts. + /// + Precision, + + /// + /// Chooses a texture format based on another. + /// + /// + /// For example, Dynamic Waves will match precision of Animated Waves. + /// + Automatic, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum Placement + { + /// + /// The component is in a fixed position. + /// + Fixed, + + /// + /// The component follows the transform. + /// + Transform, + + /// + /// The component follows the viewpoint. + /// + Viewpoint, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum QuerySource + { + /// + /// This game object's transform. + /// + Transform, + + /// + /// The viewer's transform. + /// + /// + /// The viewer is the main camera the system uses. + /// + Viewer, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum ShorelineVolumeColorSource + { + /// + /// No depth color. + /// + None, + + /// + /// Depth color based on water depth. + /// + Depth, + + /// + /// Depth color based on shoreline distance. + /// + Distance, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum WaterInjectionPoint + { + /// + /// Renders in the default pass. + /// + /// + /// For the water surface, this will be determined by the material (opaque or transparent). This pass is controlled by Unity, and is not compatible with certain features like soft particles. + /// + Default, + + /// + /// Renders before the transparent pass. + /// + /// + /// This has advantages like being compatible with soft particles, refractive shaders, and possibly third-party fog. + /// + BeforeTransparent, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum WaterReflectionSide + { + /// + /// Both sides. Most expensive. + /// + Both, + + /// + /// Above only. Typical for planar reflections. + /// + Above, + + /// + /// Below only. For total internal reflections. + /// + Below, + } +} + + +namespace WaveHarmonic.Crest.Generated +{ + enum WatertightHullMode + { + /// + /// Use displacement to remove water. + /// + /// + /// Using displacement will also affect the underwater and can nest bouyant objects. Requires the displacement layer to be enabled. + /// + Displacement, + + /// + /// Clips the surface to remove water. + /// + /// + /// This option is more precise and can be submerged. + /// + Clip, + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/Documentation.Generated.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/Documentation.Generated.cs.meta new file mode 100644 index 0000000..54053f3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Generated/Documentation.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b32089d5327840948a90ac2add66a1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction.meta new file mode 100644 index 0000000..beda451 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9916067faf7834d31ab306b56819c799 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction/FloatingObject.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction/FloatingObject.cs new file mode 100644 index 0000000..87cbaff --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction/FloatingObject.cs @@ -0,0 +1,376 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Different physics models for + /// + [@GenerateDoc] + public enum FloatingObjectModel + { + /// + [Tooltip("A simple model which aligns the object with the wave normal.")] + AlignNormal, + + /// + [Tooltip("A more advanced model which samples water at the probes positions.")] + Probes, + } + + /// + /// Probes for the model. + /// + [System.Serializable] + public struct FloatingObjectProbe + { + /// + /// How much this probe affects the outcome (not a physical weight). + /// + [SerializeField] + public float _Weight; + + /// + /// The position of the probe. + /// + [SerializeField] + public Vector3 _Position; + } + + /// + /// Physics including buoyancy and drag. + /// + [@HelpURL("Manual/FloatingObjects.html#physics")] + [AddComponentMenu(Constants.k_MenuPrefixPhysics + "Floating Object")] + public sealed partial class FloatingObject : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + + [Tooltip("The rigid body to affect.\n\nIt will automatically get the sibling rigid body if not set.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + Rigidbody _RigidBody; + + [Tooltip("The model to use for buoyancy.\n\nAlign Normal is simple and only uses a few queries whilst Probes is more advanced and uses a few queries per probe. Cannot be changed at runtime after Start.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + FloatingObjectModel _Model = FloatingObjectModel.AlignNormal; + + [Tooltip(ICollisionProvider.k_LayerTooltip)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + CollisionLayer _Layer = CollisionLayer.AfterAnimatedWaves; + + + [Header("Buoyancy")] + + [@Label("Force Strength")] + [Tooltip("Strength of buoyancy force.\n\nFor probes, roughly a mass to force ratio of 100 to 1 to keep the center of mass near the surface. For Align Normal, default value is for a default sphere with a default rigidbody.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _BuoyancyForceStrength = 10f; + + [@Label("Torque Strength")] + [Tooltip("Strength of torque applied to match boat orientation to water normal.")] + [@Predicated(nameof(_Model), inverted: true, nameof(FloatingObjectModel.AlignNormal), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _BuoyancyTorqueStrength = 8f; + + [@Label("Maximum Force")] + [Tooltip("Clamps the buoyancy force to this value.\n\nUseful for handling fully submerged objects.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _MaximumBuoyancyForce = 100f; + + [@Label("Height Offset")] + [Tooltip("Height offset from transform center to bottom of boat (if any).\n\nDefault value is for a default sphere. Having this value be an accurate measurement from center to bottom is not necessary.")] + [@Predicated(nameof(_Model), true, nameof(FloatingObjectModel.AlignNormal), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _CenterToBottomOffset = -1f; + + [Tooltip("Approximate hydrodynamics of 'surfing' down waves.")] + [@Predicated(nameof(_Model), true, nameof(FloatingObjectModel.AlignNormal))] + [@Range(0, 1)] + [@GenerateAPI] + [SerializeField] + float _AccelerateDownhill; + + [UnityEngine.Space(10)] + + [Tooltip("Query points for buoyancy.\n\nOnly applicable to Probes model.")] + [@GenerateAPI] + [SerializeField] + internal FloatingObjectProbe[] _Probes = new FloatingObjectProbe[] { }; + + + [Header("Drag")] + + [Tooltip("Drag when in water.\n\nAdditive to the drag declared on the rigid body.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + Vector3 _Drag = new(2f, 3f, 1f); + + [Tooltip("Angular drag when in water.\n\nAdditive to the angular drag declared on the rigid body.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _AngularDrag = 0.2f; + + [Tooltip("Vertical offset for where drag force should be applied.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _ForceHeightOffset; + + + [Header("Wave Response")] + + [Tooltip("Width of object for physics purposes.\n\nThe larger this value, the more filtered/smooth the wave response will be. If larger wavelengths cannot be filtered, increase the LOD Levels")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _ObjectWidth = 3f; + + [Tooltip("Computes a separate normal based on boat length to get more accurate orientations.\n\nRequires the cost of an extra collision sample.")] + [@Predicated(nameof(_Model), true, nameof(FloatingObjectModel.AlignNormal), hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _UseObjectLength; + + [Tooltip("Length dimension of boat.\n\nOnly used if Use Boat Length is enabled.")] + [@Predicated(nameof(_Model), true, nameof(FloatingObjectModel.AlignNormal), hide: true)] + [@Predicated(nameof(_UseObjectLength))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _ObjectLength = 3f; + + // Debug + [UnityEngine.Space(10)] + + [@DecoratedField, SerializeField] + DebugFields _Debug = new(); + + [System.Serializable] + sealed class DebugFields + { + [Tooltip("Draw queries for each force point as gizmos.")] + [@DecoratedField, SerializeField] + internal bool _DrawQueries = false; + } + + internal const string k_FixedUpdateMarker = "Crest.FloatingObject.FixedUpdate"; + + static readonly Unity.Profiling.ProfilerMarker s_FixedUpdateMarker = new(k_FixedUpdateMarker); + + /// + /// Is any part of this object in water. + /// + public bool InWater { get; private set; } + + readonly SampleCollisionHelper _SampleHeightHelper = new(); + readonly SampleFlowHelper _SampleFlowHelper = new(); + + Vector3[] _QueryPoints; + Vector3[] _QueryResultDisplacements; + Vector3[] _QueryResultVelocities; + Vector3[] _QueryResultNormal; + + internal FloatingObjectProbe[] _Probe = new FloatingObjectProbe[] { new() { _Weight = 1f } }; + + const float k_WaterDensity = 1000; + + float _TotalWeight; + + bool Advanced => _Model == FloatingObjectModel.Probes; + + private protected override void OnStart() + { + base.OnStart(); + + if (_RigidBody == null) TryGetComponent(out _RigidBody); + + var points = Advanced ? _Probes : _Probe; + // Advanced needs an extra spot for the center. + var length = Advanced ? points.Length + 1 : points.Length; + _QueryPoints = new Vector3[length]; + _QueryResultDisplacements = new Vector3[length]; + _QueryResultVelocities = new Vector3[length]; + if (!Advanced) _QueryResultNormal = new Vector3[length]; + } + + private protected override System.Action OnFixedUpdateMethod => OnFixedUpdate; + void OnFixedUpdate(WaterRenderer water) + { + s_FixedUpdateMarker.Begin(this); + + var points = Advanced ? _Probes : _Probe; + + // Queries + { + var collisions = water.AnimatedWavesLod.Provider; + + _TotalWeight = 0; + + // Update query points. + for (var i = 0; i < points.Length; i++) + { + var point = points[i]; + _TotalWeight += point._Weight; + _QueryPoints[i] = transform.TransformPoint(point._Position + new Vector3(0, _RigidBody.centerOfMass.y, 0)); + } + + _QueryPoints[^1] = transform.position + new Vector3(0, _RigidBody.centerOfMass.y, 0); + + collisions.Query(GetHashCode(), _ObjectWidth, _QueryPoints, _QueryResultDisplacements, _QueryResultNormal, _QueryResultVelocities, _Layer); + + if (Advanced && _Debug._DrawQueries) + { + for (var i = 0; i < points.Length; i++) + { + var query = _QueryPoints[i]; + query.y = water.SeaLevel + _QueryResultDisplacements[i].y; + DebugUtility.DrawCross(Debug.DrawLine, query, 1f, Color.magenta); + } + } + } + + // We could filter the surface velocity as the minimum of the last 2 frames. There + // is a hard case where a wavelength is turned on/off which generates single frame + // velocity spikes - because the surface legitimately moves very fast. + var surfaceVelocity = _QueryResultVelocities[^1]; + _SampleFlowHelper.Sample(transform.position, out var surfaceFlow, minimumLength: _ObjectWidth); + surfaceVelocity += new Vector3(surfaceFlow.x, 0, surfaceFlow.y); + + if (_Debug._DrawQueries) + { + Debug.DrawLine(transform.position + 5f * Vector3.up, transform.position + 5f * Vector3.up + surfaceVelocity, new(1, 1, 1, 0.6f)); + } + + // Buoyancy + if (Advanced) + { + var archimedesForceMagnitude = k_WaterDensity * Mathf.Abs(Physics.gravity.y); + InWater = false; + + for (var i = 0; i < points.Length; i++) + { + var height = water.SeaLevel + _QueryResultDisplacements[i].y; + var difference = height - _QueryPoints[i].y; + if (difference > 0) + { + InWater = true; + if (_TotalWeight > 0f) + { + var force = _BuoyancyForceStrength * points[i]._Weight * archimedesForceMagnitude * difference * Vector3.up / _TotalWeight; + if (_MaximumBuoyancyForce < Mathf.Infinity) + { + force = Vector3.ClampMagnitude(force, _MaximumBuoyancyForce); + } + _RigidBody.AddForceAtPosition(force, _QueryPoints[i]); + } + } + } + + if (!InWater) + { + s_FixedUpdateMarker.End(); + return; + } + } + else + { + var height = _QueryResultDisplacements[0].y + water.SeaLevel; + var bottomDepth = height - transform.position.y - _CenterToBottomOffset; + var normal = _QueryResultNormal[0]; + + if (_Debug._DrawQueries) + { + var surfPos = transform.position; + surfPos.y = height; + DebugUtility.DrawCross(Debug.DrawLine, surfPos, normal, 1f, Color.red); + } + + InWater = bottomDepth > 0f; + if (!InWater) + { + s_FixedUpdateMarker.End(); + return; + } + + var buoyancy = _BuoyancyForceStrength * bottomDepth * bottomDepth * bottomDepth * -Physics.gravity.normalized; + if (_MaximumBuoyancyForce < Mathf.Infinity) + { + buoyancy = Vector3.ClampMagnitude(buoyancy, _MaximumBuoyancyForce); + } + _RigidBody.AddForce(buoyancy, ForceMode.Acceleration); + + // Approximate hydrodynamics of sliding along water + if (_AccelerateDownhill > 0f) + { + _RigidBody.AddForce(_AccelerateDownhill * -Physics.gravity.y * new Vector3(normal.x, 0f, normal.z), ForceMode.Acceleration); + } + + // Orientation + // Align to water normal. One normal by default, but can use a separate normal + // based on boat length vs width. This gives varying rotations based on boat + // dimensions. + { + var normalLatitudinal = normal; + var normalLongitudinal = Vector3.up; + + if (_UseObjectLength) + { + if (_SampleHeightHelper.SampleHeight(transform.position, out _, out _, out normalLongitudinal, minimumLength: _ObjectLength, _Layer)) + { + var f = transform.forward; + f.y = 0f; + f.Normalize(); + normalLatitudinal -= Vector3.Dot(f, normalLatitudinal) * f; + + var r = transform.right; + r.y = 0f; + r.Normalize(); + normalLongitudinal -= Vector3.Dot(r, normalLongitudinal) * r; + } + } + + if (_Debug._DrawQueries) Debug.DrawLine(transform.position, transform.position + 5f * normalLatitudinal, Color.green); + if (_Debug._DrawQueries && _UseObjectLength) Debug.DrawLine(transform.position, transform.position + 5f * normalLongitudinal, Color.yellow); + + var torqueWidth = Vector3.Cross(transform.up, normalLatitudinal); + _RigidBody.AddTorque(torqueWidth * _BuoyancyTorqueStrength, ForceMode.Acceleration); + if (_UseObjectLength) + { + var torqueLength = Vector3.Cross(transform.up, normalLongitudinal); + _RigidBody.AddTorque(torqueLength * _BuoyancyTorqueStrength, ForceMode.Acceleration); + } + + _RigidBody.AddTorque(-_AngularDrag * _RigidBody.angularVelocity); + } + } + + // Apply drag relative to water + if (_Drag != Vector3.zero) + { +#if UNITY_6000_0_OR_NEWER + var velocityRelativeToWater = _RigidBody.linearVelocity - surfaceVelocity; +#else + var velocityRelativeToWater = _RigidBody.velocity - surfaceVelocity; +#endif + var forcePosition = _RigidBody.worldCenterOfMass + _ForceHeightOffset * Vector3.up; + _RigidBody.AddForceAtPosition(_Drag.x * Vector3.Dot(transform.right, -velocityRelativeToWater) * transform.right, forcePosition, ForceMode.Acceleration); + _RigidBody.AddForceAtPosition(_Drag.y * Vector3.Dot(Vector3.up, -velocityRelativeToWater) * Vector3.up, forcePosition, ForceMode.Acceleration); + _RigidBody.AddForceAtPosition(_Drag.z * Vector3.Dot(transform.forward, -velocityRelativeToWater) * transform.forward, forcePosition, ForceMode.Acceleration); + } + + s_FixedUpdateMarker.End(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction/FloatingObject.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction/FloatingObject.cs.meta new file mode 100644 index 0000000..5c9de40 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Interaction/FloatingObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eba37e6f7ba7a4a488c7831f45a078b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask.meta new file mode 100644 index 0000000..2c770a5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d77fc8cd36304f9fa96e0e42b525c5e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.HighDefinition.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.HighDefinition.cs new file mode 100644 index 0000000..3e70350 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.HighDefinition.cs @@ -0,0 +1,97 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest +{ + sealed class MaskRendererHDRP : MaskRenderer + { + const string k_Name = "Water Mask"; + MaskCustomPass _MaskCustomPass; + GameObject _GameObject; + + public MaskRendererHDRP(WaterRenderer water) : base(water) { } + + public override void Enable() + { + base.Enable(); + + _GameObject = CustomPassHelpers.CreateOrUpdate + ( + parent: _Water.Container.transform, + k_Name, + hide: !_Water._Debug._ShowHiddenObjects + ); + + CustomPassHelpers.CreateOrUpdate + ( + _GameObject, + ref _MaskCustomPass, + UnderwaterRenderer.k_DrawMask, + CustomPassInjectionPoint.BeforeRendering + ); + + _MaskCustomPass._MaskPass = this; + } + + public override void Disable() + { + base.Disable(); + + if (_GameObject != null) + { + // Will also trigger Cleanup below. + _GameObject.SetActive(false); + } + } + + public override void OnBeginCameraRendering(Camera camera) + { + + } + + public override void OnEndCameraRendering(Camera camera) + { + + } + + sealed class MaskCustomPass : CustomPass + { + internal MaskRenderer _MaskPass; + + // Called when the custom pass object is enabled making it somewhat useless. + protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) + { + _MaskPass.Allocate(); + } + + protected override void Cleanup() + { + _MaskPass.Release(); + } + + protected override void Execute(CustomPassContext context) + { + var camera = context.hdCamera.camera; + + if (!_MaskPass.ShouldExecute(camera)) + { + return; + } + + // HDRP does not need ReAllocate. But it is easier to also call Allocate here. + // Allocating RTHandles outside the render loop raises an error. Seriously, do not + // attempt to optmize this away. + _MaskPass.Allocate(); + _MaskPass.Execute(camera, context.cmd); + } + } + } +} + +#endif // d_UnityHDRP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.HighDefinition.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.HighDefinition.cs.meta new file mode 100644 index 0000000..842e1c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.HighDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c293f6238a2e7418f9348c7c99b8aacf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Legacy.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Legacy.cs new file mode 100644 index 0000000..1bd46ea --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Legacy.cs @@ -0,0 +1,63 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + sealed class MaskRendererBIRP : MaskRenderer + { + CommandBuffer _Commands; + + public MaskRendererBIRP(WaterRenderer water) : base(water) { } + + public override void Enable() + { + base.Enable(); + Allocate(); + } + + + public override void OnBeginCameraRendering(Camera camera) + { + if (!ShouldExecute(camera)) + { + return; + } + + + _Commands ??= new() + { + name = UnderwaterRenderer.k_DrawMask, + }; + + _Water.UpdateMatrices(camera); + + var descriptor = Rendering.BIRP.GetCameraTargetDescriptor(camera); + descriptor.useDynamicScale = camera.allowDynamicResolution; + + Allocate(); + + ReAllocate(descriptor); + Execute(camera, _Commands); + + // Handles both forward and deferred. + camera.AddCommandBuffer(CameraEvent.BeforeGBuffer, _Commands); + camera.AddCommandBuffer(CameraEvent.BeforeDepthTexture, _Commands); + } + + public override void OnEndCameraRendering(Camera camera) + { + if (_Commands == null) + { + return; + } + + camera.RemoveCommandBuffer(CameraEvent.BeforeGBuffer, _Commands); + camera.RemoveCommandBuffer(CameraEvent.BeforeDepthTexture, _Commands); + + _Commands.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Legacy.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Legacy.cs.meta new file mode 100644 index 0000000..c4bc204 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Legacy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8abc65ea1dd9433c972aa074694f5b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Universal.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Universal.cs new file mode 100644 index 0000000..8d5fcf4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Universal.cs @@ -0,0 +1,103 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP + +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + sealed class MaskRendererURP : MaskRenderer + { + readonly MaskRenderPass _MaskRenderPass = new(); + + public MaskRendererURP(WaterRenderer water) : base(water) { } + + public override void OnBeginCameraRendering(Camera camera) + { + if (!ShouldExecute(camera)) + { + return; + } + + _MaskRenderPass._Renderer = this; + _MaskRenderPass.EnqueuePass(camera); + } + + public override void OnEndCameraRendering(Camera camera) + { + + } + + sealed partial class MaskRenderPass : ScriptableRenderPass + { + const string k_Name = "Crest.DrawMask"; + + internal MaskRenderer _Renderer; + + public MaskRenderPass() + { + // Will always execute and matrices will be ready. + renderPassEvent = RenderPassEvent.BeforeRenderingPrePasses; + } + + internal void EnqueuePass(Camera camera) + { + // TODO: check if we need to even enqueue a pass + var renderer = camera.GetUniversalAdditionalCameraData().scriptableRenderer; + +#if UNITY_EDITOR + if (renderer == null) + { + return; + } +#endif + + _Renderer.Allocate(); + + // Enqueue the pass. This happens every frame. + renderer.EnqueuePass(this); + } + +#if UNITY_6000_0_OR_NEWER + class PassData + { + public UniversalCameraData _CameraData; + public MaskRenderer _Renderer; + } + + public override void RecordRenderGraph(UnityEngine.Rendering.RenderGraphModule.RenderGraph graph, ContextContainer frame) + { + using (var builder = graph.AddUnsafePass(k_Name, out var data)) + { + builder.AllowPassCulling(false); + + data._CameraData = frame.Get(); + data._Renderer = _Renderer; + + builder.SetRenderFunc((data, context) => + { + var buffer = CommandBufferHelpers.GetNativeCommandBuffer(context.cmd); + data._Renderer.ReAllocate(data._CameraData.cameraTargetDescriptor); + data._Renderer.Execute(data._CameraData.camera, buffer); + }); + } + } + + [System.Obsolete] +#endif + public override void Execute(ScriptableRenderContext context, ref RenderingData data) + { + var buffer = CommandBufferPool.Get(k_Name); + _Renderer.ReAllocate(data.cameraData.cameraTargetDescriptor); + _Renderer.Execute(data.cameraData.camera, buffer); + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); + } + } + } +} + +#endif // d_UnityURP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Universal.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Universal.cs.meta new file mode 100644 index 0000000..e9ec7dc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.Universal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b884ed0c0033342c78bdc398e0060299 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.cs new file mode 100644 index 0000000..4f6c36e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.cs @@ -0,0 +1,314 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + abstract partial class MaskRenderer + { + protected const string k_MaskColor = "_Crest_MaskColor"; + protected const string k_MaskDepth = "_Crest_MaskDepth"; + + public static class ShaderIDs + { + public static readonly int s_WaterMaskTexture = Shader.PropertyToID("_Crest_WaterMaskTexture"); + public static readonly int s_WaterMaskDepthTexture = Shader.PropertyToID("_Crest_WaterMaskDepthTexture"); + } + + public static MaskRenderer Instantiate(WaterRenderer water) + { +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + return new MaskRendererHDRP(water); + } + else +#endif + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + return new MaskRendererURP(water); + } + else +#endif + + { + return new MaskRendererBIRP(water); + } + } + + // For PortalRenderer. + public static System.Action s_OnAllocate; + public static System.Action s_OnRelease; + public static System.Action s_OnReAllocate; + + public MaskRenderer(WaterRenderer water) + { + _Water = water; + } + + public bool Enabled => true; //_Water.Underwater.Enabled; + + internal RenderTargetIdentifier _ColorRTI; + internal RenderTargetIdentifier _DepthRTI; + + public RenderTextureDescriptor ColorDescriptor => ColorRT.descriptor; + public RenderTextureDescriptor DepthDescriptor => DepthRT.descriptor; + + public abstract void OnBeginCameraRendering(Camera camera); + public abstract void OnEndCameraRendering(Camera camera); + + + public virtual void Enable() + { + + } + + public virtual void Disable() + { + + } + + public virtual void Destroy() + { + Release(); + } + + protected void UpdateColor(Texture color) + { + _ColorRTI = new(color, mipLevel: 0, CubemapFace.Unknown, depthSlice: -1); + Shader.SetGlobalTexture(ShaderIDs.s_WaterMaskTexture, color); + } + + protected void UpdateDepth(Texture depth) + { + _DepthRTI = new(depth, mipLevel: 0, CubemapFace.Unknown, depthSlice: -1); + Shader.SetGlobalTexture(ShaderIDs.s_WaterMaskDepthTexture, depth); + } + + + // + // Pub/Sub + // + + [System.Flags] + public enum MaskInput + { + None, + Zero = 1 << 0, + Color = 1 << 1, + Depth = 1 << 2, + Both = Color | Depth, + } + + protected MaskInput _Inputs; + + protected readonly WaterRenderer _Water; + + internal readonly Utility.SortedList _Providers = new(Helpers.DuplicateComparison); + internal readonly List _Receivers = new(); + + public interface IMaskProvider + { + MaskInput Allocate(); + MaskInput Write(Camera camera); + void OnMaskPass(CommandBuffer commands, Camera camera, MaskRenderer mask); + } + + public interface IMaskReceiver + { + MaskInput Allocate(); + } + + void Initialize() + { + _Inputs = MaskInput.None; + + foreach (var receiver in _Receivers) + { + _Inputs |= receiver.Allocate(); + } + } + + internal void Add(IMaskReceiver receiver) + { + if (_Receivers.Contains(receiver)) + { + return; + } + + _Receivers.Add(receiver); + + Initialize(); + } + + internal void Remove(IMaskReceiver receiver) + { + if (!_Receivers.Remove(receiver)) + { + return; + } + + Initialize(); + } + + internal void Add(int queue, IMaskProvider provider) + { + if (_Providers.Contains(provider)) + { + return; + } + + _Providers.Add(queue, provider); + + Initialize(); + } + + internal void Remove(IMaskProvider provider) + { + if (!_Providers.Remove(provider)) + { + return; + } + + Initialize(); + } + + public void Execute(Camera camera, CommandBuffer commands) + { + foreach (var provider in _Providers) + { + if (provider.Value.Write(camera) == MaskInput.None) + { + continue; + } + + provider.Value.OnMaskPass(commands, camera, this); + } + } + + internal bool ShouldExecute(Camera camera) + { + var input = MaskInput.None; + + foreach (var providers in _Providers) + { + input |= providers.Value.Write(camera); + } + + return input != MaskInput.None; + } + } + + // Holds common stuff for SRPs + abstract partial class MaskRenderer + { + internal RTHandle _ColorRTH; + internal RTHandle _DepthRTH; + + + // Null check due to U6 not being able to cast if null (Unity bug?). + public Texture ColorT => _ColorRTH?.rt; + public Texture DepthT => _DepthRTH?.rt; + public RTHandle ColorRTH => _ColorRTH; + public RTHandle DepthRTH => _DepthRTH; + public RenderTexture ColorRT => _ColorRTH; + public RenderTexture DepthRT => _DepthRTH; + + public void ResetRenderTarget(CommandBuffer commands) + { + CoreUtils.SetRenderTarget(commands, ColorRTH, DepthRTH); + } + + public void Allocate() + { + if (_Inputs.HasFlag(MaskInput.Color) && _ColorRTH == null) + { + _ColorRTH = RTHandles.Alloc + ( + scaleFactor: Vector2.one, + slices: TextureXR.slices, + dimension: TextureXR.dimension, + depthBufferBits: DepthBits.None, + colorFormat: GraphicsFormat.R16_SFloat, + enableRandomWrite: true, + useDynamicScale: true, + name: k_MaskColor + ); + + UpdateColor(_ColorRTH); + } + + if (_Inputs.HasFlag(MaskInput.Depth) && _DepthRTH == null) + { + _DepthRTH = RTHandles.Alloc + ( + scaleFactor: Vector2.one, + slices: TextureXR.slices, + dimension: TextureXR.dimension, + depthBufferBits: Helpers.k_DepthBits, + colorFormat: GraphicsFormat.None, + enableRandomWrite: false, + useDynamicScale: true, + name: k_MaskDepth + ); + + UpdateDepth(_DepthRTH); + } + + s_OnAllocate?.Invoke(); + } + + public void ReAllocate(RenderTextureDescriptor descriptor) + { + // Shared settings. Enabling MSAA might be a good idea except cannot enable random + // writes. Having a raster shader to remove artifacts is a workaround. + // This looks safe to do as Unity's CopyDepthPass does the same. + descriptor.bindMS = false; + descriptor.msaaSamples = 1; + + s_OnReAllocate?.Invoke(descriptor); + + if (_Inputs.HasFlag(MaskInput.Depth)) + { + descriptor.graphicsFormat = GraphicsFormat.None; + descriptor.depthBufferBits = Helpers.k_DepthBufferBits; + + if (RenderPipelineCompatibilityHelper.ReAllocateIfNeeded(ref _DepthRTH, descriptor, name: k_MaskDepth)) + { + UpdateDepth(_DepthRTH); + } + } + + if (_Inputs.HasFlag(MaskInput.Color)) + { + // NOTE: Intel iGPU for Metal and DirectX both had issues with R16 (2021.11.18). + descriptor.graphicsFormat = GraphicsFormat.R16_SFloat; + descriptor.depthBufferBits = 0; + descriptor.enableRandomWrite = true; + + if (RenderPipelineCompatibilityHelper.ReAllocateIfNeeded(ref _ColorRTH, descriptor, name: k_MaskColor)) + { + UpdateColor(_ColorRTH); + } + } + } + + public void Release() + { + _ColorRTH?.Release(); + _DepthRTH?.Release(); + + // Set to null possibly due to Initialize/Destroy overlap. + _ColorRTH = null; + _DepthRTH = null; + + s_OnRelease?.Invoke(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.cs.meta new file mode 100644 index 0000000..5a7df4f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Mask/MaskRenderer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 797f30610ca4c477fbbaaf38f758dc95 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus.meta new file mode 100644 index 0000000..1a49475 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7fc7e69b7bb948039c9252c6d788e33 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Editor.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Editor.cs new file mode 100644 index 0000000..f1f85f3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Editor.cs @@ -0,0 +1,32 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if UNITY_EDITOR + +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + partial class Meniscus + { + internal const string k_MaterialPath = "Packages/com.waveharmonic.crest/Runtime/Materials/Meniscus.mat"; + + internal void Reset() + { + _Material = AssetDatabase.LoadAssetAtPath(k_MaterialPath); + } + + [@OnChange] + void OnChange(string path, object previous) + { + switch (path) + { + case nameof(_Enabled): SetEnabled((bool)previous, _Enabled); break; + case nameof(_Material): SetMaterial((Material)previous, _Material); break; + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Editor.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Editor.cs.meta new file mode 100644 index 0000000..17d924a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Editor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20f5eb7691544460796ae81ca7816cbb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.HighDefinition.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.HighDefinition.cs new file mode 100644 index 0000000..0daab55 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.HighDefinition.cs @@ -0,0 +1,88 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest +{ + partial class Meniscus + { + internal sealed class MeniscusRendererHDRP : MeniscusRenderer + { + const string k_Name = "Meniscus"; + MeniscusCustomPass _CustomPass; + GameObject _GameObject; + + public MeniscusRendererHDRP(WaterRenderer water, Meniscus meniscus) : base(water, meniscus) + { + + } + + public override void Enable() + { + base.Enable(); + + _GameObject = CustomPassHelpers.CreateOrUpdate + ( + parent: _Water.Container.transform, + k_Name, + hide: !_Water._Debug._ShowHiddenObjects + ); + + CustomPassHelpers.CreateOrUpdate + ( + _GameObject, + ref _CustomPass, + k_Draw, + CustomPassInjectionPoint.BeforePostProcess, + priority: -1 + ); + + _CustomPass._Renderer = this; + } + + public override void Disable() + { + base.Disable(); + + if (_GameObject != null) + { + // Will also trigger Cleanup below. + _GameObject.SetActive(false); + } + } + + public override void OnBeginCameraRendering(Camera camera) + { + + } + + public override void OnEndCameraRendering(Camera camera) + { + + } + + sealed class MeniscusCustomPass : CustomPass + { + internal MeniscusRenderer _Renderer; + + protected override void Execute(CustomPassContext context) + { + var camera = context.hdCamera.camera; + + if (!_Renderer.ShouldExecute(camera)) + { + return; + } + + _Renderer.Execute(camera, new CommandWrapper(context.cmd)); + } + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.HighDefinition.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.HighDefinition.cs.meta new file mode 100644 index 0000000..7e9f4a5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.HighDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec8f31a3e4e434fa0a8e771834d9dc16 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Legacy.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Legacy.cs new file mode 100644 index 0000000..ddedc07 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Legacy.cs @@ -0,0 +1,57 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + partial class Meniscus + { + internal sealed class MeniscusRendererBIRP : MeniscusRenderer + { + CommandBuffer _Commands; + + // NOTE: This will not work for recursive rendering. + bool _CommandsRegistered; + + public MeniscusRendererBIRP(WaterRenderer water, Meniscus meniscus) : base(water, meniscus) + { + + } + + public override void OnBeginCameraRendering(Camera camera) + { + if (!ShouldExecute(camera)) + { + return; + } + + _Commands ??= new() + { + name = k_Draw, + }; + + _Commands.Clear(); + + Execute(camera, new CommandWrapper(_Commands)); + + camera.AddCommandBuffer(CameraEvent.AfterForwardAlpha, _Commands); + + _CommandsRegistered = true; + } + + public override void OnEndCameraRendering(Camera camera) + { + if (!_CommandsRegistered) + { + return; + } + + camera.RemoveCommandBuffer(CameraEvent.AfterForwardAlpha, _Commands); + + _CommandsRegistered = false; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Legacy.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Legacy.cs.meta new file mode 100644 index 0000000..fd4fac4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Legacy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a79d71a3e88424f27877abd4102b5af9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Universal.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Universal.cs new file mode 100644 index 0000000..152b56b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Universal.cs @@ -0,0 +1,118 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP + +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + partial class Meniscus + { + internal sealed class MeniscusRendererURP : MeniscusRenderer + { + readonly MeniscusRenderPass _MaskRenderPass = new(); + + public MeniscusRendererURP(WaterRenderer water, Meniscus meniscus) : base(water, meniscus) + { + + } + + public override void OnBeginCameraRendering(Camera camera) + { + if (!ShouldExecute(camera)) + { + return; + } + + _MaskRenderPass._Renderer = this; + _MaskRenderPass.EnqueuePass(camera); + } + + public override void OnEndCameraRendering(Camera camera) + { + + } + + sealed partial class MeniscusRenderPass : ScriptableRenderPass + { + const string k_Name = k_Draw; + + internal MeniscusRenderer _Renderer; + + bool _RequiresOpaqueTexture; + + public MeniscusRenderPass() + { + renderPassEvent = RenderPassEvent.AfterRenderingTransparents; + } + + internal void EnqueuePass(Camera camera) + { + // TODO: check if we need to even enqueue a pass + var renderer = camera.GetUniversalAdditionalCameraData().scriptableRenderer; + +#if UNITY_EDITOR + if (renderer == null) + { + return; + } +#endif + + _RequiresOpaqueTexture = _Renderer._Meniscus.RequiresOpaqueTexture; + + ConfigureInput(_RequiresOpaqueTexture ? ScriptableRenderPassInput.Color : ScriptableRenderPassInput.None); + + // Enqueue the pass. This happens every frame. + renderer.EnqueuePass(this); + } + +#if UNITY_6000_0_OR_NEWER + class PassData + { + public UniversalCameraData _CameraData; + public MeniscusRenderer _Renderer; + } + + public override void RecordRenderGraph(UnityEngine.Rendering.RenderGraphModule.RenderGraph graph, ContextContainer frame) + { + using (var builder = graph.AddRasterRenderPass(k_Name, out var data)) + { + builder.AllowPassCulling(false); + + var resources = frame.Get(); + + if (_RequiresOpaqueTexture) + { + builder.UseTexture(resources.cameraOpaqueTexture); + } + + data._CameraData = frame.Get(); + data._Renderer = _Renderer; + + builder.SetRenderAttachment(resources.activeColorTexture, index: 0); + + builder.SetRenderFunc((data, context) => + { + data._Renderer.Execute(data._CameraData.camera, new RasterCommandWrapper(context.cmd)); + }); + } + } + + [System.Obsolete] +#endif + public override void Execute(ScriptableRenderContext context, ref RenderingData data) + { + var buffer = CommandBufferPool.Get(k_Name); + _Renderer.Execute(data.cameraData.camera, new CommandWrapper(buffer)); + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); + } + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Universal.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Universal.cs.meta new file mode 100644 index 0000000..0654d06 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.Universal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6888087ee71bb4b378cf0e4f30479f93 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.cs new file mode 100644 index 0000000..6c3820e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.cs @@ -0,0 +1,234 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Renders the meniscus (waterline). + /// + [System.Serializable] + public sealed partial class Meniscus + { + [@Space(10)] + + [Tooltip("Whether the meniscus is enabled.")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [@DecoratedField] + [SerializeField] + internal bool _Enabled = true; + + [Tooltip("Any camera with this layer in its culling mask will render the meniscus.")] + [@Layer] + [@GenerateAPI] + [SerializeField] + int _Layer = 4; // Water + + [Tooltip("The meniscus material.")] + [@AttachMaterialEditor(order: 2)] + [@MaterialField("Crest/Meniscus", name: "Meniscus", title: "Create Meniscus Material")] + [@GenerateAPI(Setter.Custom)] + [SerializeField] + internal Material _Material; + + + WaterRenderer _Water; + + internal MeniscusRenderer Renderer { get; private set; } + + internal bool RequiresOpaqueTexture => Enabled && Material != null && Material.IsKeywordEnabled("d_Crest_Refraction"); + + /// + /// Disables rendering without de-allocating. + /// + public bool ForceRenderingOff { get; set; } + + internal void Enable() + { + Initialize(_Water); + Renderer?.Enable(); + } + + internal void Disable() + { + Renderer?.Disable(); + } + + internal void Destroy() + { + Renderer?.Destroy(); + Renderer = null; + } + + internal void OnActiveRenderPipelineTypeChanged() + { + Destroy(); + Initialize(_Water); + } + + internal void Initialize(WaterRenderer water) + { + _Water = water; + + if (!Enabled) + { + return; + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + Renderer ??= new MeniscusRendererHDRP(water, this); + } + else +#endif + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + Renderer ??= new MeniscusRendererURP(water, this); + } + else +#endif + + // Legacy + { + Renderer ??= new MeniscusRendererBIRP(water, this); + } + } + } + + // Getters/Setters + partial class Meniscus + { + bool GetEnabled() + { + return _Enabled && _Material != null; + } + + void SetEnabled(bool previous, bool current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled) return; + if (_Enabled) Enable(); else Disable(); + } + + void SetMaterial(Material previous, Material current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled) return; + if (previous == null) Enable(); else if (current == null) Disable(); + } + } + + partial class Meniscus + { + internal abstract partial class MeniscusRenderer + { + private protected const string k_Draw = "Crest.DrawWater/Meniscus"; + + private protected readonly WaterRenderer _Water; + internal readonly Meniscus _Meniscus; + + static partial class ShaderIDs + { + public static readonly int s_HorizonNormal = Shader.PropertyToID("_Crest_HorizonNormal"); + } + + public abstract void OnBeginCameraRendering(Camera camera); + public abstract void OnEndCameraRendering(Camera camera); + + public MeniscusRenderer(WaterRenderer water, Meniscus meniscus) + { + _Water = water; + _Meniscus = meniscus; + } + + public virtual void Enable() + { + + } + + public virtual void Disable() + { + + } + + public virtual void Destroy() + { + + } + + internal bool ShouldExecute(Camera camera) + { +#if UNITY_EDITOR + if (GL.wireframe) + { + return false; + } +#endif + + if (_Meniscus.ForceRenderingOff) + { + return false; + } + + // Meniscus is a product of the water surface. + if (!_Water.Surface.Enabled) + { + return false; + } + + if (camera.cameraType is not CameraType.Game and not CameraType.SceneView) + { + return false; + } + + if (!WaterRenderer.ShouldRender(camera, _Meniscus.Layer)) + { + return false; + } + +#if d_CrestPortals + if (_Water.Portals.Active) + { + // Near surface check not compatible with portals. + return true; + } +#endif + + _Water.UpdatePerCameraHeight(camera); + + // Only execute if near the surface. + if (_Water._ViewerHeightAboveWaterPerCamera is > 2f or < -8f) + { + return false; + } + + return true; + } + + internal void Execute(Camera camera, T commands) where T : ICommandWrapper + { + // Project water normal onto camera plane. + _Meniscus.Material.SetVector(ShaderIDs.s_HorizonNormal, new Vector2 + ( + Vector3.Dot(Vector3.up, camera.transform.right), + Vector3.Dot(Vector3.up, camera.transform.up) + )); + +#if d_CrestPortals + if (_Water.Portals.Active && !(_Water.Underwater.UseLegacyMask && _Water._Portals.Mode == Portals.PortalMode.Tunnel)) + { + _Water._Portals.RenderMeniscus(commands, _Meniscus.Material); + } + else +#endif + { + commands.DrawFullScreenTriangle(_Meniscus.Material, pass: _Water._Underwater.UseLegacyMask ? 4 : 0); + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.cs.meta new file mode 100644 index 0000000..0a08bb7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Meniscus/Meniscus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df109675493a845f7ad07008e1c1aaaa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting.meta new file mode 100644 index 0000000..d64a8f0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30b2c63e0d0a548f7ae93a8c7587fd83 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Assembly.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Assembly.cs new file mode 100644 index 0000000..8e969af --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Assembly.cs @@ -0,0 +1,7 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Define empty namespaces for when assemblies are not present. + +namespace WaveHarmonic.Crest.Paint { } +namespace WaveHarmonic.Crest.Splines { } diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Assembly.cs.meta new file mode 100644 index 0000000..945ff36 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6ce853c937064f0bb6379473815d4df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Extensions.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Extensions.cs new file mode 100644 index 0000000..2fe00d1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Extensions.cs @@ -0,0 +1,37 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Contains extensions to support scripting. + /// + public static partial class _Extensions + { + /// + /// AddComponent that is compatible with Crest inputs. + /// + /// The input type. + /// The game object to add the input to. + /// The input mode. Not all inputs support all modes. Refer to the UI as to what input supports what mode. + /// The newly created input component setup with the provided mode. + public static T AddComponent(this GameObject gameObject, LodInputMode mode) + where T : LodInput + { + var input = gameObject.AddComponent(); + input._Mode = mode; + // Not all modes have associated data. + if (mode is not (LodInputMode.Global or LodInputMode.Primitive or LodInputMode.Unset)) AddData(input, mode); + input.InferBlend(); + return input; + } + + static void AddData(this LodInput input, LodInputMode mode) where T : LodInputData, new() + { + input.Data = new T(); + input.Data._Input = input; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Extensions.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Extensions.cs.meta new file mode 100644 index 0000000..1db0558 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Extensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf4a91d347c104b8b9f5faa060b121ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated.meta new file mode 100644 index 0000000..80769ed --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7ee439ee99fb8490fbe84c3ea930a98c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated/Extensions.Generated.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated/Extensions.Generated.cs new file mode 100644 index 0000000..a6f2832 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated/Extensions.Generated.cs @@ -0,0 +1,81 @@ +// + +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using WaveHarmonic.Crest.Splines; +using WaveHarmonic.Crest.Paint; + +namespace WaveHarmonic.Crest +{ + static partial class _Extensions + { + static void AddData(LodInput input, LodInputMode mode) + { + switch (mode) + { + case LodInputMode.Renderer when input is AbsorptionLodInput: AddData(input, mode); break; + case LodInputMode.Texture when input is AbsorptionLodInput: AddData(input, mode); break; +#if d_CrestSplines + case LodInputMode.Spline when input is AbsorptionLodInput: AddData(input, mode); break; +#endif +#if d_CrestPaint + case LodInputMode.Paint when input is AbsorptionLodInput: AddData(input, mode); break; +#endif + case LodInputMode.Renderer when input is AlbedoLodInput: AddData(input, mode); break; + case LodInputMode.Renderer when input is AnimatedWavesLodInput: AddData(input, mode); break; + case LodInputMode.Renderer when input is ClipLodInput: AddData(input, mode); break; + case LodInputMode.Texture when input is ClipLodInput: AddData(input, mode); break; +#if d_CrestPaint + case LodInputMode.Paint when input is ClipLodInput: AddData(input, mode); break; +#endif + case LodInputMode.Renderer when input is DepthLodInput: AddData(input, mode); break; + case LodInputMode.Texture when input is DepthLodInput: AddData(input, mode); break; + case LodInputMode.Geometry when input is DepthLodInput: AddData(input, mode); break; + case LodInputMode.Renderer when input is DynamicWavesLodInput: AddData(input, mode); break; + case LodInputMode.Renderer when input is FlowLodInput: AddData(input, mode); break; + case LodInputMode.Texture when input is FlowLodInput: AddData(input, mode); break; +#if d_CrestPaint + case LodInputMode.Paint when input is FlowLodInput: AddData(input, mode); break; +#endif +#if d_CrestSplines + case LodInputMode.Spline when input is FlowLodInput: AddData(input, mode); break; +#endif + case LodInputMode.Renderer when input is FoamLodInput: AddData(input, mode); break; + case LodInputMode.Texture when input is FoamLodInput: AddData(input, mode); break; +#if d_CrestPaint + case LodInputMode.Paint when input is FoamLodInput: AddData(input, mode); break; +#endif +#if d_CrestSplines + case LodInputMode.Spline when input is FoamLodInput: AddData(input, mode); break; +#endif + case LodInputMode.Renderer when input is LevelLodInput: AddData(input, mode); break; + case LodInputMode.Texture when input is LevelLodInput: AddData(input, mode); break; +#if d_CrestPaint + case LodInputMode.Paint when input is LevelLodInput: AddData(input, mode); break; +#endif +#if d_CrestSplines + case LodInputMode.Spline when input is LevelLodInput: AddData(input, mode); break; +#endif + case LodInputMode.Geometry when input is LevelLodInput: AddData(input, mode); break; + case LodInputMode.Renderer when input is ScatteringLodInput: AddData(input, mode); break; + case LodInputMode.Texture when input is ScatteringLodInput: AddData(input, mode); break; +#if d_CrestSplines + case LodInputMode.Spline when input is ScatteringLodInput: AddData(input, mode); break; +#endif +#if d_CrestPaint + case LodInputMode.Paint when input is ScatteringLodInput: AddData(input, mode); break; +#endif + case LodInputMode.Renderer when input is ShadowLodInput: AddData(input, mode); break; + case LodInputMode.Renderer when input is ShapeWaves: AddData(input, mode); break; + case LodInputMode.Texture when input is ShapeWaves: AddData(input, mode); break; +#if d_CrestPaint + case LodInputMode.Paint when input is ShapeWaves: AddData(input, mode); break; +#endif +#if d_CrestSplines + case LodInputMode.Spline when input is ShapeWaves: AddData(input, mode); break; +#endif + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated/Extensions.Generated.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated/Extensions.Generated.cs.meta new file mode 100644 index 0000000..a87fe3d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/Generated/Extensions.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9fe46e95241264fffb8a0455642f04f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/WaveHarmonic.Crest.Scripting.asmdef b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/WaveHarmonic.Crest.Scripting.asmdef new file mode 100644 index 0000000..cdfac0d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/WaveHarmonic.Crest.Scripting.asmdef @@ -0,0 +1,30 @@ +{ + "name": "WaveHarmonic.Crest.Scripting", + "rootNamespace": "", + "references": [ + "GUID:7c347618730f5467f86a58f333ce21df", + "GUID:14c30fdc5e1c1403a8ae14a752f3df85", + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:1a8679b518d374790a83a275d183e377" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.waveharmonic.crest.splines", + "expression": "", + "define": "d_CrestSplines" + }, + { + "name": "com.waveharmonic.crest.paint", + "expression": "", + "define": "d_CrestPaint" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/WaveHarmonic.Crest.Scripting.asmdef.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/WaveHarmonic.Crest.Scripting.asmdef.meta new file mode 100644 index 0000000..669afa3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Scripting/WaveHarmonic.Crest.Scripting.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5747197954513495eaaf62d07a48b094 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface.meta new file mode 100644 index 0000000..dbc5ab4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b8e9190017c0245c9b456f589f7ae1cf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Displaced.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Displaced.cs new file mode 100644 index 0000000..e04bdd9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Displaced.cs @@ -0,0 +1,215 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +// Possible improvements: +// - Add quality property +// - Add water level separately (seems fine) +// - Loop over all chunks for larger near clip planes + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + internal const int k_SurfaceDataShaderPass = 2; + + internal static partial class ShaderIDs + { + public static int s_WaterLine = Shader.PropertyToID("_Crest_WaterLine"); + public static int s_WaterLineSnappedPosition = Shader.PropertyToID("_Crest_WaterLineSnappedPosition"); + public static int s_WaterLineResolution = Shader.PropertyToID("_Crest_WaterLineResolution"); + public static int s_WaterLineTexel = Shader.PropertyToID("_Crest_WaterLineTexel"); + } + + RenderTexture _HeightRT; + internal RenderTexture HeightRT { get => _HeightRT; } + + CommandBuffer _BeforeRenderingCommands; + Material _DisplacedMaterial; + + internal struct SurfaceDataParameters + { + public Vector2 _SnappedPosition; + public Vector2 _Resolution; + public float _Texel; + } + + internal SurfaceDataParameters _SurfaceDataParameters; + internal MaterialPropertyBlock _SurfaceDataMPB; + + internal void BindDisplacedSurfaceData(T properties) where T : IPropertyWrapper + { + properties.SetTexture(ShaderIDs.s_WaterLine, HeightRT); + properties.SetVector(ShaderIDs.s_WaterLineSnappedPosition, _SurfaceDataParameters._SnappedPosition); + properties.SetVector(ShaderIDs.s_WaterLineResolution, _SurfaceDataParameters._Resolution); + properties.SetFloat(ShaderIDs.s_WaterLineTexel, _SurfaceDataParameters._Texel); + } + + internal void UpdateDisplacedSurfaceData(Camera camera) + { + // World size of the texture. Formula should effectively cover the camera. + var size = 1f + (camera.nearClipPlane * 2f); + + // Do not use the water position. It will cause a mismatch when using displacement + // correction. + var bounds = new Bounds(camera.transform.position, Vector3.one * size); + + if (_DisplacedMaterial == null) + { + _DisplacedMaterial = new(WaterResources.Instance.Shaders._UnderwaterMask); + } + + _BeforeRenderingCommands ??= new(); + var commands = _BeforeRenderingCommands; + commands.name = "Crest.DrawMask"; + commands.Clear(); + + // TODO: add control so users can set this. + // Diminishing returns beyond 0.0125. + UpdateDisplacedSurfaceData + ( + commands, + bounds, + "_Crest_WaterLine", + ref _HeightRT, + texel: 0.0125f, + out _SurfaceDataParameters + ); + + _SurfaceDataMPB ??= new(); + var wrapper = new PropertyWrapperMPB(_SurfaceDataMPB); + BindDisplacedSurfaceData(wrapper); + + var lod = (int)Builder.PatchType.Interior; + var mpb = _PerCascadeMPB.Current[lod]; + + if (_Water.Viewpoint != camera.transform && Vector3.Distance(_Water.Viewpoint.position, camera.transform.position) > 0.01f) + { + foreach (var chunk in _Water.Surface.Chunks) + { + if (!bounds.IntersectsXZ(chunk.Rend.bounds)) + { + continue; + } + + commands.DrawMesh + ( + chunk._Mesh, + chunk.transform.localToWorldMatrix, + _DisplacedMaterial, + submeshIndex: 0, + shaderPass: k_SurfaceDataShaderPass, + chunk._MaterialPropertyBlock + ); + } + } + else + { + for (var i = 0; i < 4; i++) + { + commands.DrawMesh + ( + _Meshes[lod], + Root.localToWorldMatrix * Matrix4x4.TRS(Builder.s_OffsetsFirstLod[i].XNZ(), Quaternion.identity, Vector3.one), + _DisplacedMaterial, + submeshIndex: 0, + k_SurfaceDataShaderPass, + mpb + ); + } + } + + Graphics.ExecuteCommandBuffer(commands); + } + + internal void UpdateDisplacedSurfaceData(CommandBuffer commands, Bounds bounds, string name, ref RenderTexture target, float texel, out SurfaceDataParameters parameters) + { + var size = bounds.size.XZ(); + var position = bounds.center.XZ(); + + var scale = size; + + // TODO: texel needs to be calculates is clamped + // TODO: aspect ratio + var resolution = new Vector2Int + ( + // TODO: Floor, Ceil or Round? + Mathf.CeilToInt(size.x / texel), + Mathf.CeilToInt(size.y / texel) + ); + + // Snapping for spatial stability. Different results, but could not tell which is + // more accurate. At higher resolution, appears negligable anyway. + var snapped = position - new Vector2(Mathf.Repeat(position.x, texel), Mathf.Repeat(position.y, texel)); + + // Store for binding later. + parameters = new() + { + _SnappedPosition = snapped, + _Resolution = resolution, + _Texel = texel, + }; + + if (resolution.x > 2048 || resolution.y > 2048) + { + return; + } + + // FIXME: LOD scale less than two has cut off and fall off at edges. + var view = WaterRenderer.CalculateViewMatrixFromSnappedPositionRHS(snapped.XNZ()); + var projection = Matrix4x4.Ortho(size.x * -0.5f, size.x * 0.5f, size.y * -0.5f, size.y * 0.5f, 1f, 10000f + 10000f); + + if (target == null) + { + target = new(resolution.x, resolution.y, 0) + { + name = name, + // Needs this precision. + graphicsFormat = UnityEngine.Experimental.Rendering.GraphicsFormat.R32_SFloat + }; + } + else if (target.width != resolution.x || target.height != resolution.y) + { + target.Release(); + target.width = resolution.x; + target.height = resolution.y; + } + + if (!target.IsCreated()) + { + target.Create(); + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + var buffer = new UnityEngine.Rendering.HighDefinition.ShaderVariablesGlobal(); + + projection = GL.GetGPUProjectionMatrix(projection, true); + + // If we want to use camera relative rendering, then we should not set the matrix + // position. Instead set _WorldSpaceCameraPos_Internal. + buffer._ViewProjMatrix = projection * view; + + ConstantBuffer.PushGlobal(commands, buffer, Crest.ShaderIDs.Unity.s_ShaderVariablesGlobal); + } + else +#endif + { + commands.SetViewProjectionMatrices(view, projection); + } + + commands.SetRenderTarget(target); + commands.ClearRenderTarget(true, true, Color.clear); + + // For mask compute, meniscus etc. + commands.SetGlobalTexture(ShaderIDs.s_WaterLine, target); + commands.SetGlobalVector(ShaderIDs.s_WaterLineSnappedPosition, snapped); + commands.SetGlobalVector(ShaderIDs.s_WaterLineResolution, (Vector2)resolution); + commands.SetGlobalFloat(ShaderIDs.s_WaterLineTexel, texel); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Displaced.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Displaced.cs.meta new file mode 100644 index 0000000..fb3b1f9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Displaced.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d53923414758449c896818d2fa45191 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Editor.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Editor.cs new file mode 100644 index 0000000..eee19dc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Editor.cs @@ -0,0 +1,50 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if UNITY_EDITOR + +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + internal void Reset() + { + _Material = AssetDatabase.LoadAssetAtPath("Packages/com.waveharmonic.crest/Runtime/Materials/Water.mat"); + _ChunkTemplate = AssetDatabase.LoadAssetAtPath("Packages/com.waveharmonic.crest/Runtime/Prefabs/Chunk.prefab"); + } + + [@OnChange] + void OnChange(string path, object previous) + { + switch (path) + { + case nameof(_Enabled): + SetEnabled((bool)previous, _Enabled); + break; + case nameof(_Layer): + SetLayer((int)previous, _Layer); + break; + case nameof(_ChunkTemplate): + // We have to rebuild, as we instantiate entire GO. If we restricted it to just a + // MeshRenderer, then we could just replace those. + Rebuild(); + break; + case nameof(_CastShadows): + SetCastShadows((bool)previous, _CastShadows); + break; + case nameof(_AllowRenderQueueSorting): + SetAllowRenderQueueSorting((bool)previous, _AllowRenderQueueSorting); + break; + case nameof(_Debug) + "." + nameof(DebugFields._DisableSkirt): + case nameof(_Debug) + "." + nameof(DebugFields._UniformTiles): + Rebuild(); + break; + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Editor.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Editor.cs.meta new file mode 100644 index 0000000..02fa22d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Editor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 909d252964c5e41a8893e54eda8d7199 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.HighDefinition.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.HighDefinition.cs new file mode 100644 index 0000000..34cad4e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.HighDefinition.cs @@ -0,0 +1,133 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering.RendererUtils; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + internal sealed class WaterSurfaceCustomPass : CustomPass + { + const string k_Name = "Water Surface"; + + static WaterSurfaceCustomPass s_Instance; + + WaterRenderer _Water; + + // We disable the pass we want, so target another. + ShaderTagId _ShaderTagID = new("DepthOnly"); + + static readonly RenderTargetIdentifier[] s_RenderTargets = new RenderTargetIdentifier[2]; + + public static void Enable(WaterRenderer renderer) + { + var gameObject = CustomPassHelpers.CreateOrUpdate + ( + parent: renderer.Container.transform, + k_Name, + hide: !renderer._Debug._ShowHiddenObjects + ); + + CustomPassHelpers.CreateOrUpdate + ( + gameObject, + ref s_Instance, + WaterRenderer.k_DrawWater, + CustomPassInjectionPoint.BeforeTransparent + ); + + s_Instance._Water = renderer; + + s_Instance.targetColorBuffer = TargetBuffer.Camera; + s_Instance.targetDepthBuffer = TargetBuffer.Camera; + } + + public static void Disable() + { + // It should be safe to rely on this reference for this reference to fail. + if (s_Instance != null && s_Instance._GameObject != null) + { + // Will also trigger Cleanup below. + s_Instance._GameObject.SetActive(false); + } + } + + protected override void Execute(CustomPassContext context) + { + var hdCamera = context.hdCamera; + var camera = hdCamera.camera; + + if (!WaterRenderer.ShouldRender(camera, _Water.Surface.Layer)) + { + return; + } + + // Our reflections do not need them. + if (camera == WaterReflections.CurrentCamera) + { + return; + } + + if (_Water.Surface.Material == null) + { + return; + } + + if (hdCamera.msaaEnabled) + { + WaterRenderer.s_CameraMSAA = true; + return; + } + + var buffer = context.cmd; + + buffer.BeginSample(k_DrawWaterSurface); + + s_RenderTargets[0] = context.cameraColorBuffer; + s_RenderTargets[1] = context.cameraMotionVectorsBuffer; + + CoreUtils.SetRenderTarget(buffer, s_RenderTargets, context.cameraDepthBuffer); + + var apv = FrameSettingsField. +#if UNITY_6000_0_OR_NEWER + AdaptiveProbeVolume; +#else + ProbeVolume; +#endif + + var rendererConfiguration = HDUtils.GetRendererConfiguration + ( + context.hdCamera.frameSettings.IsEnabled(apv), + context.hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) + ); + + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.MotionVectors)) + { + rendererConfiguration |= PerObjectData.MotionVectors; + } + + var rld = new RendererListDesc(_ShaderTagID, context.cullingResults, camera) + { + layerMask = 1 << _Water.Surface.Layer, + overrideShader = _Water.Surface.Material.shader, + overrideShaderPassIndex = _Water.Surface.Material.FindPass("Forward"), + renderQueueRange = RenderQueueRange.transparent, + sortingCriteria = SortingCriteria.CommonOpaque, + excludeObjectMotionVectors = false, + rendererConfiguration = rendererConfiguration, + }; + + buffer.DrawRendererList(context.renderContext.CreateRendererList(rld)); + + buffer.EndSample(k_DrawWaterSurface); + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.HighDefinition.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.HighDefinition.cs.meta new file mode 100644 index 0000000..28893bc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.HighDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 144e7e4c014db437fbf04fcce4ae4aac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Legacy.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Legacy.cs new file mode 100644 index 0000000..80ecbd8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Legacy.cs @@ -0,0 +1,243 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + partial class ShaderIDs + { + public static readonly int s_DummyTarget = Shader.PropertyToID("_Crest_DummyTarget"); + public static readonly int s_WorldToShadow = Shader.PropertyToID("_Crest_WorldToShadow"); + + public static class Unity + { + public static readonly int s_BuiltInSurface = Shader.PropertyToID("_BUILTIN_Surface"); + public static readonly int s_BuiltInTransparentReceiveShadows = Shader.PropertyToID("_BUILTIN_TransparentReceiveShadows"); + } + } + + CommandBuffer _DrawWaterSurfaceBuffer; + + void OnBeginCameraRenderingLegacy(Camera camera) + { + _Water.UpdateMatrices(camera); + +#if UNITY_EDITOR + if (!Application.isPlaying) + { + OnPreRenderWaterLevelDepthTexture(camera); + } +#endif + + // Everything from here depends on the material being transparent. + if (!IsTransparent(Material)) + { + return; + } + + camera.depthTextureMode |= DepthTextureMode.Depth; + + _DrawWaterSurfaceBuffer ??= new() { name = WaterRenderer.k_DrawWater }; + _DrawWaterSurfaceBuffer.Clear(); + + // Create or update RT. + _Water.OnBeginCameraOpaqueTexture(camera); + + SetUpShadows(camera); + + + if (_Water.RenderBeforeTransparency) + { + Draw(_DrawWaterSurfaceBuffer, camera); + } + + camera.AddCommandBuffer(CameraEvent.BeforeForwardAlpha, _DrawWaterSurfaceBuffer); + } + + void OnEndCameraRenderingLegacy(Camera camera) + { +#if UNITY_EDITOR + if (!Application.isPlaying) + { + OnPostRenderWaterLevelDepthTexture(camera); + } +#endif + + _Water.OnEndCameraOpaqueTexture(camera); + + if (_DrawWaterSurfaceBuffer != null) + { + camera.RemoveCommandBuffer(CameraEvent.BeforeForwardAlpha, _DrawWaterSurfaceBuffer); + } + + if (QualitySettings.shadows != ShadowQuality.Disable && _Water.PrimaryLight != null) + { + if (_ScreenSpaceShadowMapBuffer != null) + { + _Water.PrimaryLight.RemoveCommandBuffer(LightEvent.AfterScreenspaceMask, _ScreenSpaceShadowMapBuffer); + } + + if (_DeferredShadowMapBuffer != null) + { + _Water.PrimaryLight.RemoveCommandBuffer(LightEvent.AfterShadowMap, _DeferredShadowMapBuffer); + } + } + + Shader.SetGlobalTexture(Crest.ShaderIDs.Unity.s_ShadowMapTexture, Texture2D.whiteTexture); + } + + // Draws the water surface including lighting. + internal void Draw(CommandBuffer commands, Camera camera) + { + commands.BeginSample(k_DrawWaterSurface); + + CoreUtils.SetRenderTarget(commands, BuiltinRenderTextureType.CameraTarget); + + var sun = RenderSettings.sun; + if (sun != null) + { + // Unity does not set up lighting for us so we will get the last value which could incorrect. + // SetGlobalColor is just an alias for SetGlobalVector (no color space conversion like Material.SetColor): + // https://docs.unity3d.com/2017.4/Documentation/ScriptReference/Shader.SetGlobalColor.html + commands.SetGlobalVector(Crest.ShaderIDs.Unity.s_LightColor0, sun.FinalColor()); + commands.SetGlobalVector(Crest.ShaderIDs.Unity.s_WorldSpaceLightPos0, -sun.transform.forward); + } + + // Always enabled. + commands.SetShaderKeyword("LIGHTPROBE_SH", true); + + UpdateChunkVisibility(camera); + + foreach (var chunk in Chunks) + { + var renderer = chunk.Rend; + + if (chunk.Rend == null) + { + continue; + } + + if (!chunk._Visible) + { + continue; + } + + if (chunk._Culled) + { + continue; + } + + if (!chunk._WaterDataHasBeenBound) + { + chunk.Bind(); + } + + var mpb = new PropertyWrapperMPB(chunk._MaterialPropertyBlock); + mpb.SetSHCoefficients(chunk.transform.position); + commands.DrawMesh(chunk._Mesh, chunk.transform.localToWorldMatrix, renderer.sharedMaterial, 0, 0, chunk._MaterialPropertyBlock); + } + + commands.EndSample(k_DrawWaterSurface); + } + } + + partial class SurfaceRenderer + { + Material _ForceShadowsMaterial; + ComputeBuffer _ShadowMatrixBuffer; + readonly Matrix4x4[] _ShadowMatrixDefaults = { Matrix4x4.zero, Matrix4x4.zero, Matrix4x4.zero, Matrix4x4.zero }; + Material _CaptureShadowMatrices; + + CommandBuffer _DeferredShadowMapBuffer; + CommandBuffer _ScreenSpaceShadowMapBuffer; + + void LegacyOnEnable() + { + _ShadowMatrixBuffer ??= new(4, sizeof(float) * 16, ComputeBufferType.Structured); + _ShadowMatrixBuffer.SetData(_ShadowMatrixDefaults); + } + + void LegacyOnDisable() + { + _ShadowMatrixBuffer?.Dispose(); + _ShadowMatrixBuffer = null; + } + + void SetUpShadows(Camera camera) + { + if (QualitySettings.shadows == ShadowQuality.Disable || _Water.PrimaryLight == null) + { + return; + } + + var transform = camera.transform; + + if (_ForceShadowsMaterial == null) + { + _ForceShadowsMaterial = new Material(WaterResources.Instance.Shaders._ForceShadows); + } + + // Force shadows, as Unity ignores transparent shadow receivers, otherwise shadow + // passes will skip if caster or receiver out of view. ShadowLod also depends on this. + Graphics.RenderMesh + ( + new(_ForceShadowsMaterial) + { + receiveShadows = true, + shadowCastingMode = ShadowCastingMode.Off, + }, + mesh: Helpers.QuadMesh, + submeshIndex: 0, + objectToWorld: QualitySettings.shadowProjection == ShadowProjection.StableFit + ? Matrix4x4.TRS(transform.position + transform.forward, Quaternion.LookRotation(transform.forward), Vector3.one * 0.01f) + // TODO: render water level inputs to support shadows for varying water level. + // Sort of works for close fit. But will decrease shadow quality. + : Matrix4x4.TRS(Vector3.up * _Water.SeaLevel, Quaternion.LookRotation(-Vector3.up), Vector3.one * 100f) + ); + + if (!Material.IsKeywordEnabled("_BUILTIN_TRANSPARENT_RECEIVES_SHADOWS")) + { + return; + } + + if (_CaptureShadowMatrices == null) + { + _CaptureShadowMatrices = new Material(WaterResources.Instance.Shaders._CaptureShadowMatrices); + } + + // Used ComputeBuffer must always be bound! + Shader.SetGlobalBuffer(ShaderIDs.s_WorldToShadow, _ShadowMatrixBuffer); + // Capture shadow matrices, as Unity clears all but the first cascade. + _ScreenSpaceShadowMapBuffer ??= new() { name = WaterRenderer.k_DrawWater }; + _ScreenSpaceShadowMapBuffer.Clear(); + // Cannot set target to None, as it will make some UI black (Unity bug?). + _ScreenSpaceShadowMapBuffer.GetTemporaryRT(ShaderIDs.s_DummyTarget, new RenderTextureDescriptor(4, 4)); + CoreUtils.SetRenderTarget(_ScreenSpaceShadowMapBuffer, ShaderIDs.s_DummyTarget); + // Setting the buffer (SetGlobalBuffer) and writing to it only worked with Metal. + // For other graphics APIs, had to use SetRandomWriteTarget. + _ScreenSpaceShadowMapBuffer.ClearRandomWriteTargets(); + _ScreenSpaceShadowMapBuffer.SetRandomWriteTarget(1, _ShadowMatrixBuffer); + _ScreenSpaceShadowMapBuffer.DrawProcedural(Matrix4x4.identity, _CaptureShadowMatrices, 0, MeshTopology.Triangles, 3); + _ScreenSpaceShadowMapBuffer.ClearRandomWriteTargets(); + _ScreenSpaceShadowMapBuffer.ReleaseTemporaryRT(ShaderIDs.s_DummyTarget); + _Water.PrimaryLight.AddCommandBuffer(LightEvent.AfterScreenspaceMask, _ScreenSpaceShadowMapBuffer); + + // Make shadow map available to transparents. + // Call this regardless of rendering path as it has no negative consequences for forward. + _DeferredShadowMapBuffer ??= new() { name = WaterRenderer.k_DrawWater }; + _DeferredShadowMapBuffer.Clear(); + _DeferredShadowMapBuffer.SetGlobalTexture(Crest.ShaderIDs.Unity.s_ShadowMapTexture, BuiltinRenderTextureType.CurrentActive); + _Water.PrimaryLight.AddCommandBuffer(LightEvent.AfterShadowMap, _DeferredShadowMapBuffer); + + // Set up shadow keywords. + _DrawWaterSurfaceBuffer.SetKeyword(new("SHADOWS_SINGLE_CASCADE"), QualitySettings.shadowCascades == 1); + _DrawWaterSurfaceBuffer.SetKeyword(new("SHADOWS_SPLIT_SPHERES"), QualitySettings.shadowProjection == ShadowProjection.StableFit); + _DrawWaterSurfaceBuffer.SetKeyword(new("SHADOWS_SOFT"), QualitySettings.shadows == ShadowQuality.All); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Legacy.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Legacy.cs.meta new file mode 100644 index 0000000..613f133 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Legacy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 729ce6767111740d78a05608c8fb03c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.HighDefinition.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.HighDefinition.cs new file mode 100644 index 0000000..0fd2f38 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.HighDefinition.cs @@ -0,0 +1,70 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + sealed class WaterLevelDepthTextureHDRP : CustomPass + { + static WaterLevelDepthTextureHDRP s_Instance; + WaterRenderer _Water; + SurfaceRenderer _Surface; + + internal static void Enable(WaterRenderer water, SurfaceRenderer surface) + { + var gameObject = CustomPassHelpers.CreateOrUpdate + ( + parent: water.Container.transform, + k_WaterLevelDepthTextureName, + hide: !water._Debug._ShowHiddenObjects + ); + + CustomPassHelpers.CreateOrUpdate + ( + gameObject, + ref s_Instance, + k_WaterLevelDepthTextureName, + CustomPassInjectionPoint.BeforeRendering + ); + + s_Instance._Water = water; + s_Instance._Surface = surface; + } + + public static void Disable() + { + // It should be safe to rely on this reference for this reference to fail. + if (s_Instance != null && s_Instance._GameObject != null) + { + // Will also trigger Cleanup below. + s_Instance._GameObject.SetActive(false); + } + } + + protected override void Execute(CustomPassContext context) + { + var camera = context.hdCamera.camera; + + if (Application.isPlaying) + { + return; + } + + if (camera.cameraType != CameraType.SceneView || camera != _Water.Viewer) + { + return; + } + + _Surface.ExecuteWaterLevelDepthTexture(camera, context.cmd); + } + } + } +} + +#endif // d_UnityHDRP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.HighDefinition.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.HighDefinition.cs.meta new file mode 100644 index 0000000..c507b45 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.HighDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8bc32c22349e84f57b3571b886bc8b63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Legacy.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Legacy.cs new file mode 100644 index 0000000..0b45290 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Legacy.cs @@ -0,0 +1,40 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + CommandBuffer _WaterLevelDepthBuffer; + + void OnPreRenderWaterLevelDepthTexture(Camera camera) + { + if (camera.cameraType != CameraType.SceneView || camera != _Water.Viewer) + { + return; + } + + _WaterLevelDepthBuffer ??= new() { name = k_WaterLevelDepthTextureName }; + _WaterLevelDepthBuffer.Clear(); + + ExecuteWaterLevelDepthTexture(camera, _WaterLevelDepthBuffer); + + // Both forward and deferred. + camera.AddCommandBuffer(CameraEvent.BeforeDepthTexture, _WaterLevelDepthBuffer); + camera.AddCommandBuffer(CameraEvent.BeforeGBuffer, _WaterLevelDepthBuffer); + } + + void OnPostRenderWaterLevelDepthTexture(Camera camera) + { + if (_WaterLevelDepthBuffer != null) + { + // Both forward and deferred. + camera.RemoveCommandBuffer(CameraEvent.BeforeDepthTexture, _WaterLevelDepthBuffer); + camera.RemoveCommandBuffer(CameraEvent.BeforeGBuffer, _WaterLevelDepthBuffer); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Legacy.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Legacy.cs.meta new file mode 100644 index 0000000..5a10c5f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Legacy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb2445377c8974383bd1b3b4afa85646 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Universal.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Universal.cs new file mode 100644 index 0000000..d48fcd3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Universal.cs @@ -0,0 +1,86 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP + +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + sealed class WaterLevelDepthTextureURP : ScriptableRenderPass + { + internal static WaterLevelDepthTextureURP s_Instance; + WaterRenderer _Water; + SurfaceRenderer _Surface; + + internal WaterLevelDepthTextureURP() + { + // Will always execute and matrices will be ready. + renderPassEvent = RenderPassEvent.BeforeRenderingPrePasses; + } + + internal static void Enable(WaterRenderer water, SurfaceRenderer surface) + { + s_Instance ??= new(); + s_Instance._Water = water; + s_Instance._Surface = surface; + } + + internal void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + if (Application.isPlaying) + { + return; + } + + if (camera.cameraType != CameraType.SceneView || camera != _Water.Viewer) + { + return; + } + + // Enqueue the pass. This happens every frame. + camera.GetUniversalAdditionalCameraData().scriptableRenderer.EnqueuePass(this); + } + +#if UNITY_6000_0_OR_NEWER + class PassData + { + public UniversalCameraData _CameraData; + public SurfaceRenderer _Surface; + } + + public override void RecordRenderGraph(UnityEngine.Rendering.RenderGraphModule.RenderGraph graph, ContextContainer frame) + { + using (var builder = graph.AddUnsafePass(k_WaterLevelDepthTextureName, out var data)) + { + builder.AllowPassCulling(false); + + data._CameraData = frame.Get(); + data._Surface = _Surface; + + builder.SetRenderFunc((data, context) => + { + var buffer = CommandBufferHelpers.GetNativeCommandBuffer(context.cmd); + _Surface.ExecuteWaterLevelDepthTexture(data._CameraData.camera, buffer); + }); + } + } + + [System.Obsolete] +#endif + public override void Execute(ScriptableRenderContext context, ref RenderingData data) + { + var buffer = CommandBufferPool.Get(k_WaterLevelDepthTextureName); + _Surface.ExecuteWaterLevelDepthTexture(data.cameraData.camera, buffer); + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); + } + } + } +} + +#endif // d_UnityURP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Universal.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Universal.cs.meta new file mode 100644 index 0000000..f50b68d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.Universal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8926d03a42e31434eb70caddd59f0466 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.cs new file mode 100644 index 0000000..d22a002 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.cs @@ -0,0 +1,86 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// FIXME: Broken for BIRP on MacOS. Either platform specific problem or bug in Unity. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + RenderTexture _WaterLevelDepthTexture; + internal RenderTexture WaterLevelDepthTexture => _WaterLevelDepthTexture; + RenderTargetIdentifier _WaterLevelDepthTarget; + Material _WaterLevelDepthMaterial; + + const string k_WaterLevelDepthTextureName = "Crest Water Level Depth Texture"; + + void ExecuteWaterLevelDepthTexture(Camera camera, CommandBuffer buffer) + { + Helpers.CreateRenderTargetTextureReference(ref _WaterLevelDepthTexture, ref _WaterLevelDepthTarget); + _WaterLevelDepthTexture.name = k_WaterLevelDepthTextureName; + + if (_WaterLevelDepthMaterial == null) + { + _WaterLevelDepthMaterial = new(Shader.Find("Hidden/Crest/Editor/Water Level (Depth)")); + } + + var descriptor = new RenderTextureDescriptor(camera.pixelWidth, camera.pixelHeight) + { + graphicsFormat = UnityEngine.Experimental.Rendering.GraphicsFormat.None, + depthBufferBits = 32, + }; + + // Depth buffer. + buffer.GetTemporaryRT(Helpers.ShaderIDs.s_MainTexture, descriptor); + CoreUtils.SetRenderTarget(buffer, Helpers.ShaderIDs.s_MainTexture, ClearFlag.Depth); + + Render(camera, buffer, _WaterLevelDepthMaterial); + + Render(camera, buffer, _WaterLevelDepthMaterial); + + // Depth texture. + // Always release to handle screen size changes. + _WaterLevelDepthTexture.Release(); + descriptor.graphicsFormat = UnityEngine.Experimental.Rendering.GraphicsFormat.R32_SFloat; + descriptor.depthBufferBits = 0; + Helpers.SafeCreateRenderTexture(ref _WaterLevelDepthTexture, descriptor); + _WaterLevelDepthTexture.Create(); + + // Convert. + Helpers.Blit(buffer, _WaterLevelDepthTarget, Helpers.UtilityMaterial, (int)Helpers.UtilityPass.Copy); + + buffer.ReleaseTemporaryRT(Helpers.ShaderIDs.s_MainTexture); + } + + void EnableWaterLevelDepthTexture() + { + if (Application.isPlaying) return; + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + WaterLevelDepthTextureURP.Enable(_Water, this); + } +#endif + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + WaterLevelDepthTextureHDRP.Enable(_Water, this); + } +#endif + } + + void DisableWaterLevelDepthTexture() + { + if (Application.isPlaying) return; + +#if d_UnityHDRP + WaterLevelDepthTextureHDRP.Disable(); +#endif + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.cs.meta new file mode 100644 index 0000000..a50c728 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.LevelDepthTexture.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b48c0a50256ea4177ba95870d7a211b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Universal.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Universal.cs new file mode 100644 index 0000000..023398f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Universal.cs @@ -0,0 +1,163 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP + +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.RendererUtils; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + internal sealed class WaterSurfaceRenderPass : ScriptableRenderPass + { + readonly WaterRenderer _Water; + public static WaterSurfaceRenderPass Instance { get; set; } + + // We disable the pass we want, so target another. + ShaderTagId _ShaderTagID = new("DepthOnly"); + + public WaterSurfaceRenderPass(WaterRenderer water) + { + _Water = water; + renderPassEvent = RenderPassEvent.BeforeRenderingTransparents; + + // Copy color happens between "after skybox" and "before transparency". + ConfigureInput(ScriptableRenderPassInput.Color | ScriptableRenderPassInput.Depth); + } + + public static void Enable(WaterRenderer water) + { +#if UNITY_EDITOR + var data = water.Viewer != null ? water.Viewer.GetUniversalAdditionalCameraData() : null; + + // Type is internal. + if (data != null && data.scriptableRenderer.GetType().Name == "Renderer2D") + { + UnityEditor.EditorUtility.DisplayDialog + ( + "Crest Error!", + "The project has been detected as a URP 2D project. Crest only supports 3D projects. " + + "You may see errors from Crest in the console, and other issues.", + "Ok" + ); + } +#endif + + Instance = new WaterSurfaceRenderPass(water); + } + + internal void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + if (!WaterRenderer.ShouldRender(camera, Instance._Water.Surface.Layer)) + { + return; + } + + // Our reflections do not need them. + if (camera == WaterReflections.CurrentCamera) + { + return; + } + + if (Instance._Water.Surface.Material == null) + { + return; + } + + if (!IsTransparent(Instance._Water.Surface.Material)) + { + return; + } + + camera.GetUniversalAdditionalCameraData().scriptableRenderer.EnqueuePass(Instance); + } + +#if UNITY_6000_0_OR_NEWER + class PassData + { + public UnityEngine.Rendering.RenderGraphModule.RendererListHandle _RendererList; + } + + readonly RenderGraphHelper.PassData _PassData = new(); + + public override void RecordRenderGraph(UnityEngine.Rendering.RenderGraphModule.RenderGraph graph, ContextContainer frame) + { + if (!_Water.RenderBeforeTransparency) + { + return; + } + + using (var builder = graph.AddRasterRenderPass("Crest.DrawWater/Surface", out var data)) + { + + var resourceData = frame.Get(); + var cameraData = frame.Get(); + var renderingData = frame.Get(); + + // Make inputs show in RG viewer. We configure them already which makes them + // available, but that might change when Unity removes compatibility mode. If that + // happens, we also have to reconsider pass culling to ensure inputs are available + // when rendering to transparent pass. + builder.UseTexture(resourceData.cameraDepthTexture, UnityEngine.Rendering.RenderGraphModule.AccessFlags.Read); + builder.UseTexture(resourceData.cameraOpaqueTexture, UnityEngine.Rendering.RenderGraphModule.AccessFlags.Read); + + // We do not want to use the back buffers, as it will prevent merging? + // This is recommended. Back buffers are used at end of frame typically. + builder.SetRenderAttachment(resourceData.activeColorTexture, 0); + builder.SetRenderAttachmentDepth(resourceData.activeDepthTexture); + + var rld = new RendererListDesc(_ShaderTagID, renderingData.cullResults, cameraData.camera) + { + layerMask = 1 << _Water.Surface.Layer, + overrideShader = _Water.Surface.Material.shader, + overrideShaderPassIndex = 0, // UniversalForward + renderQueueRange = RenderQueueRange.transparent, + sortingCriteria = SortingCriteria.CommonOpaque, + rendererConfiguration = renderingData.perObjectData, + }; + + data._RendererList = graph.CreateRendererList(rld); + builder.UseRendererList(data._RendererList); + + builder.SetRenderFunc((data, context) => + { + context.cmd.DrawRendererList(data._RendererList); + }); + } + } + + [System.Obsolete] +#endif + public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) + { + if (!_Water.RenderBeforeTransparency) + { + return; + } + + var buffer = CommandBufferPool.Get("Crest.DrawWater/Surface"); + + var rld = new RendererListDesc(_ShaderTagID, renderingData.cullResults, renderingData.cameraData.camera) + { + layerMask = 1 << _Water.Surface.Layer, + overrideShader = _Water.Surface.Material.shader, + overrideShaderPassIndex = 0, // UniversalForward + renderQueueRange = RenderQueueRange.transparent, + sortingCriteria = SortingCriteria.CommonOpaque, + rendererConfiguration = renderingData.perObjectData, + }; + + buffer.DrawRendererList(context.CreateRendererList(rld)); + + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Universal.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Universal.cs.meta new file mode 100644 index 0000000..32ddb73 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.Universal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ea612be74ded47e5a970d7e4e8d540a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.cs new file mode 100644 index 0000000..26f4466 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.cs @@ -0,0 +1,858 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Buffers; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Renders the water surface. + /// + [System.Serializable] + public sealed partial class SurfaceRenderer + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [@Space(10)] + + [Tooltip("Whether the underwater effect is enabled.\n\nAllocates/releases resources if state has changed.")] + [@GenerateAPI(Getter.Custom, Setter.Custom)] + [@DecoratedField, SerializeField] + internal bool _Enabled = true; + + [Tooltip("The water chunk renderers will have this layer.")] + [@Layer] + [@GenerateAPI] + [SerializeField] + internal int _Layer = 4; // Water + + [Tooltip("Material to use for the water surface.")] + [@AttachMaterialEditor(order: 0)] + [@MaterialField("Crest/Water", name: "Water", title: "Create Water Material")] + [@GenerateAPI] + [SerializeField] + internal Material _Material = null; + + [Tooltip("Underwater will copy from this material if set.\n\nUseful for overriding properties for the underwater effect. To see what properties can be overriden, see the disabled properties on the underwater material. This does not affect the surface.")] + [@AttachMaterialEditor(order: 1)] + [@MaterialField("Crest/Water", name: "Water (Below)", title: "Create Water Material", parent: "_Material")] + [@GenerateAPI] + [SerializeField] + internal Material _VolumeMaterial = null; + + [Tooltip("Template for water chunks as a prefab.\n\nThe only requirements are that the prefab must contain a MeshRenderer at the root and not a MeshFilter or WaterChunkRenderer. MR values will be overwritten where necessary and the prefabs are linked in edit mode.")] + [@PrefabField(title: "Create Chunk Prefab", name: "Water Chunk")] + [SerializeField] + internal GameObject _ChunkTemplate; + + [@Space(10)] + + [Tooltip("Have the water surface cast shadows for albedo (both foam and custom).")] + [@GenerateAPI(Getter.Custom)] + [@DecoratedField, SerializeField] + internal bool _CastShadows; + + [@Heading("Culling")] + + [Tooltip("Whether 'Water Body' components will cull the water tiles.\n\nDisable if you want to use the 'Material Override' feature and still have an ocean.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _WaterBodyCulling = true; + + [Tooltip("How many frames to distribute the chunk bounds calculation.\n\nThe chunk bounds are calculated per frame to ensure culling is correct when using inputs that affect displacement. Some performance can be saved by distributing the load over several frames. The higher the frames, the longer it will take - lowest being instant.")] + [@Range(1, 30, Range.Clamp.Minimum)] + [@GenerateAPI] + [SerializeField] + internal int _TimeSliceBoundsUpdateFrameCount = 1; + + [@Heading("Advanced")] + + [Tooltip("How to handle self-intersections of the water surface.\n\nThey can be caused by choppy waves which can cause a flipped underwater effect. When not using the portals/volumes, this fix is only applied when within 2 metres of the water surface. Automatic will disable the fix if portals/volumes are used which is the recommend setting.")] + [@DecoratedField, SerializeField] + internal SurfaceSelfIntersectionFixMode _SurfaceSelfIntersectionFixMode = SurfaceSelfIntersectionFixMode.Automatic; + + [Tooltip("Whether to allow sorting using the render queue.\n\nIf you need to change the minor part of the render queue (eg +100), then enable this option. As a side effect, it will also disable the front-to-back rendering optimization for Crest. This option does not affect changing the major part of the render queue (eg AlphaTest, Transparent), as that is always allowed.\n\nRender queue sorting is required for some third-party integrations.")] + [@Predicated(RenderPipeline.HighDefinition, inverted: true, hide: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _AllowRenderQueueSorting; + + [@Space(10)] + +#if !CREST_DEBUG + [HideInInspector] +#endif + [@DecoratedField, SerializeField] + internal DebugFields _Debug = new(); + + [System.Serializable] + internal sealed class DebugFields + { +#if !CREST_DEBUG + [HideInInspector] +#endif + [Tooltip("Whether to generate water geometry tiles uniformly (with overlaps).")] + [@DecoratedField, SerializeField] + public bool _UniformTiles; + +#if !CREST_DEBUG + [HideInInspector] +#endif + [Tooltip("Disable generating a wide strip of triangles at the outer edge to extend water to edge of view frustum.")] + [@DecoratedField, SerializeField] + public bool _DisableSkirt; + } + + const string k_DrawWaterSurface = "Surface"; + + internal WaterRenderer _Water; + internal Transform Root { get; private set; } + internal List Chunks { get; } = new(); + internal bool _Rebuild; + + + // + // Level of Detail + // + + // Extra frame is for motion vectors. + internal BufferedData _PerCascadeMPB = new(2, () => new MaterialPropertyBlock[Lod.k_MaximumSlices]); + + // We are computing these values to be optimal based on the base mesh vertex density. + float _LodAlphaBlackPointFade; + float _LodAlphaBlackPointWhitePointFade; + + + // + // Culling + // + + internal readonly Plane[] _CameraFrustumPlanes = new Plane[6]; + bool _CanSkipCulling; + internal bool _DoneChunkVisibility; + + + // + // Events + // + + /// + /// Invoked after water chunk modification. + /// + /// + /// Gives an opportunity to modify the renderer. + /// + public static System.Action OnCreateChunkRenderer { get; set; } + + + internal Material _MotionVectorMaterial; + + internal Material AboveOrBelowSurfaceMaterial => _VolumeMaterial == null ? _Material : _VolumeMaterial; + + + // + // Facing + // + + internal enum SurfaceSelfIntersectionFixMode + { + [Tooltip("Uses VFACE/IsFrontFace.")] + Off, + + [Tooltip("Force entire water surface to render as below water.")] + ForceBelowWater, + + [Tooltip("Force entire water surface to render as above water.")] + ForceAboveWater, + + [Tooltip("Force entire water surface to render as above or below water if beyond a distance from surface, otherwise use mask/facing.")] + On, + + [Tooltip("Force entire water surface to render as above or below water if beyond a distance from surface (except in special circumstances like Portals).")] + Automatic, + } + + enum ForceFacing + { + None, + BelowWater, + AboveWater, + Facing, + } + + + static partial class ShaderIDs + { + public static readonly int s_ForceUnderwater = Shader.PropertyToID("g_Crest_ForceUnderwater"); + public static readonly int s_LodAlphaBlackPointFade = Shader.PropertyToID("g_Crest_LodAlphaBlackPointFade"); + public static readonly int s_LodAlphaBlackPointWhitePointFade = Shader.PropertyToID("g_Crest_LodAlphaBlackPointWhitePointFade"); + + public static readonly int s_BuiltShadowCasterZTest = Shader.PropertyToID("_Crest_BUILTIN_ShadowCasterZTest"); + + public static readonly int s_ChunkMeshScaleAlpha = Shader.PropertyToID("_Crest_ChunkMeshScaleAlpha"); + public static readonly int s_ChunkGeometryGridWidth = Shader.PropertyToID("_Crest_ChunkGeometryGridWidth"); + public static readonly int s_ChunkFarNormalsWeight = Shader.PropertyToID("_Crest_ChunkFarNormalsWeight"); + public static readonly int s_ChunkNormalScrollSpeed = Shader.PropertyToID("_Crest_ChunkNormalScrollSpeed"); + public static readonly int s_ChunkMeshScaleAlphaSource = Shader.PropertyToID("_Crest_ChunkMeshScaleAlphaSource"); + public static readonly int s_ChunkGeometryGridWidthSource = Shader.PropertyToID("_Crest_ChunkGeometryGridWidthSource"); + } + + internal void Initialize() + { + Root = Builder.GenerateMesh(_Water, this, Chunks, _Water.LodResolution, _Water._GeometryDownSampleFactor, _Water.LodLevels); + + Root.position = _Water.Position; + Root.localScale = new(_Water.Scale, 1f, _Water.Scale); + + // Populate MPBs with defaults. + for (var index = 0; index < _Water.LodLevels; index++) + { + for (var frame = 0; frame < 2; frame++) + { + var mpb = new MaterialPropertyBlock(); + mpb.SetInteger(Lod.ShaderIDs.s_LodIndex, index); + mpb.SetFloat(ShaderIDs.s_ChunkFarNormalsWeight, 1f); + mpb.SetFloat(ShaderIDs.s_ChunkMeshScaleAlpha, 0f); + mpb.SetFloat(ShaderIDs.s_ChunkMeshScaleAlphaSource, 0f); + _PerCascadeMPB.Previous(frame)[index] = mpb; + } + } + + // Resolution is 4 tiles across. + var baseMeshDensity = _Water.LodResolution * 0.25f / _Water._GeometryDownSampleFactor; + // 0.4f is the "best" value when base mesh density is 8. Scaling down from there produces results similar to + // hand crafted values which looked good when the water is flat. + _LodAlphaBlackPointFade = 0.4f / (baseMeshDensity / 8f); + _LodAlphaBlackPointWhitePointFade = 1f - _LodAlphaBlackPointFade - _LodAlphaBlackPointFade; + + Shader.SetGlobalFloat(ShaderIDs.s_LodAlphaBlackPointFade, _LodAlphaBlackPointFade); + Shader.SetGlobalFloat(ShaderIDs.s_LodAlphaBlackPointWhitePointFade, _LodAlphaBlackPointWhitePointFade); + + UpdateMaterial(_Material, ref _MotionVectorMaterial); + + _CanSkipCulling = false; + + if (RenderPipelineHelper.IsLegacy) + { + LegacyOnEnable(); + } + +#if UNITY_EDITOR + EnableWaterLevelDepthTexture(); +#endif + } + + internal void OnDestroy() + { +#if UNITY_EDITOR + DisableWaterLevelDepthTexture(); +#endif + + // Clean up everything created through the Water Builder. + // Not every mesh is assigned to a chunk thus we should destroy all of them here. + for (var i = 0; i < _Meshes?.Length; i++) + { + Helpers.Destroy(_Meshes[i]); + } + + Chunks.Clear(); + CoreUtils.Destroy(_MotionVectorMaterial); + CoreUtils.Destroy(_DisplacedMaterial); + + if (Root != null) + { + CoreUtils.Destroy(Root.gameObject); + Root = null; + } + + if (RenderPipelineHelper.IsLegacy) + { + LegacyOnDisable(); + } + } + + void ShowHiddenObjects(bool show) + { + foreach (var chunk in Chunks) + { + chunk.gameObject.hideFlags = show ? HideFlags.DontSave : HideFlags.HideAndDontSave; + } + } + + // Chunk Visibility. + // check if needed here + // complicated. cos we would have to either check everything that may need it + // or have a loop going over an abstraction + internal void UpdateChunkVisibility(Camera camera) + { + if (_DoneChunkVisibility) + { + return; + } + + GeometryUtility.CalculateFrustumPlanes(camera, _CameraFrustumPlanes); + + foreach (var chunk in Chunks) + { + var renderer = chunk.Rend; + // Can happen in edit mode. + if (renderer == null) continue; + chunk._Visible = GeometryUtility.TestPlanesAABB(_CameraFrustumPlanes, renderer.bounds); + } + + _DoneChunkVisibility = true; + } + + internal void UpdateMaterial(Material material, ref Material motion) + { + if (material == null) + { + return; + } + + var enable = !_Water.RenderBeforeTransparency; + material.SetShaderPassEnabled("Forward", enable); + material.SetShaderPassEnabled("ForwardAdd", enable); + material.SetShaderPassEnabled("ForwardBase", enable); + material.SetShaderPassEnabled("UniversalForward", enable); + + // HDRP will automatically disable this pass for unknown reasons. It might be that + // we are sampling from the depth texture which does not work with shadow casting. + if (RenderPipelineHelper.IsHighDefinition) + { + material.SetShaderPassEnabled("ShadowCaster", _CastShadows); + } + + UpdateMotionVectorsMaterial(material, ref motion); + } + + internal static bool IsTransparent(Material material) + { + return RenderPipelineHelper.IsLegacy + ? material.IsKeywordEnabled("_BUILTIN_SURFACE_TYPE_TRANSPARENT") + : material.IsKeywordEnabled("_SURFACE_TYPE_TRANSPARENT"); + } + + void Rebuild() + { + OnDestroy(); + Initialize(); + _Rebuild = false; + } + + internal void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + if (!WaterRenderer.ShouldRender(camera, Layer)) + { + return; + } + + // Our planar reflection camera must never render the surface. + if (camera == WaterReflections.CurrentCamera) + { + return; + } + + if (Material == null) + { + return; + } + + WritePerCameraMaterialParameters(camera); + + // Motion Vectors. + if (ShouldRenderMotionVectors(camera) && _QueueMotionVectors) + { + UpdateChunkVisibility(camera); + + foreach (var chunk in Chunks) + { + chunk.RenderMotionVectors(this, camera); + } + } + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { +#if UNITY_EDITOR + WaterLevelDepthTextureURP.s_Instance?.OnBeginCameraRendering(context, camera); +#endif + WaterSurfaceRenderPass.Instance?.OnBeginCameraRendering(context, camera); + } + else +#endif + + if (RenderPipelineHelper.IsLegacy) + { + OnBeginCameraRenderingLegacy(camera); + } + } + + internal void OnEndCameraRendering(Camera camera) + { + _DoneChunkVisibility = false; + + if (!WaterRenderer.ShouldRender(camera, Layer)) + { + return; + } + + // Our planar reflection camera must never render the surface. + if (camera == WaterReflections.CurrentCamera) + { + return; + } + + if (RenderPipelineHelper.IsLegacy) + { + OnEndCameraRenderingLegacy(camera); + } + } + + void WritePerCameraMaterialParameters(Camera camera) + { + if (Material == null) + { + return; + } + + // If no underwater, then no need for underwater surface. + if (!_Water.Underwater.Enabled) + { + Shader.SetGlobalInteger(ShaderIDs.s_ForceUnderwater, (int)ForceFacing.AboveWater); + return; + } + + _Water.UpdatePerCameraHeight(camera); + + // Override isFrontFace when camera is far enough from the water surface to fix self-intersecting waves. + // Hack - due to SV_IsFrontFace occasionally coming through as true for back faces, + // add a param here that forces water to be in underwater state. I think the root + // cause here might be imprecision or numerical issues at water tile boundaries, although + // i'm not sure why cracks are not visible in this case. + var height = _Water._ViewerHeightAboveWaterPerCamera; + + var value = _SurfaceSelfIntersectionFixMode switch + { + SurfaceSelfIntersectionFixMode.On => + height < -2f + ? ForceFacing.BelowWater + : height > 2f + ? ForceFacing.AboveWater + : ForceFacing.None, + // Skip for portals as it is possible to see both sides of the surface at any position. + SurfaceSelfIntersectionFixMode.Automatic => + _Water.Portaled + ? ForceFacing.None + : height < -2f + ? ForceFacing.BelowWater + : height > 2f + ? ForceFacing.AboveWater + : ForceFacing.None, + // Always use facing (VFACE). + SurfaceSelfIntersectionFixMode.Off => ForceFacing.Facing, + _ => (ForceFacing)_SurfaceSelfIntersectionFixMode, + }; + + Shader.SetGlobalInteger(ShaderIDs.s_ForceUnderwater, (int)value); + } + + internal void LateUpdate() + { + if (_Rebuild) + { + Rebuild(); + } + + Root.position = _Water.Position; + Root.localScale = new(_Water.Scale, 1f, _Water.Scale); + + _PerCascadeMPB.Flip(); + WritePerCascadeInstanceData(); + + foreach (var chunk in Chunks) + { + chunk.UpdateMeshBounds(_Water, this); + } + + ApplyWaterBodyCulling(); + + LateUpdateMotionVectors(); + + UpdateMaterial(_Material, ref _MotionVectorMaterial); + + foreach (var body in WaterBody.WaterBodies) + { + if (body._Material != null) + { + UpdateMaterial(body._Material, ref body._MotionVectorMaterial); + } + } + + foreach (var chunk in Chunks) + { + chunk.OnLateUpdate(); + } + } + + void WritePerCascadeInstanceData() + { + var levels = _Water.LodLevels; + var texel = _Water.LodResolution * 0.25f / _Water._GeometryDownSampleFactor; + var mpbsCurrent = _PerCascadeMPB.Current; + var mpbsPrevious = _PerCascadeMPB.Previous(1); + + // LOD 0 + { + var mpb = mpbsCurrent[0]; + + if (_Water.WriteMotionVectors) + { + // NOTE: it may be more optimal to store in an array than fetching from MPB. + mpb.SetFloat(ShaderIDs.s_ChunkMeshScaleAlphaSource, mpbsPrevious[0].GetFloat(ShaderIDs.s_ChunkMeshScaleAlpha)); + } + + // Blend LOD 0 shape in/out to avoid pop, if scale could increase. + mpb.SetFloat(ShaderIDs.s_ChunkMeshScaleAlpha, _Water.ScaleCouldIncrease ? _Water.ViewerAltitudeLevelAlpha : 0f); + } + + // LOD N + { + var mpb = mpbsCurrent[levels - 1]; + + // Blend furthest normals scale in/out to avoid pop, if scale could reduce. + mpb.SetFloat(ShaderIDs.s_ChunkFarNormalsWeight, _Water.ScaleCouldDecrease ? _Water.ViewerAltitudeLevelAlpha : 1f); + } + + for (var index = 0; index < levels; index++) + { + var mpbCurrent = mpbsCurrent[index]; + var mpbPrevious = mpbsPrevious[index]; + + // geometry data + // compute grid size of geometry. take the long way to get there - make sure we land exactly on a power of two + // and not inherit any of the lossy-ness from lossyScale. + var scale = _Water._CascadeData.Current[index].x; + var width = scale / texel; + + if (_Water.WriteMotionVectors) + { + // NOTE: it may be more optimal to store in an array than fetching from MPB. + mpbPrevious.SetFloat(ShaderIDs.s_ChunkGeometryGridWidthSource, mpbCurrent.GetFloat(ShaderIDs.s_ChunkGeometryGridWidth)); + } + + mpbCurrent.SetFloat(ShaderIDs.s_ChunkGeometryGridWidth, width); + + var mul = 1.875f; // fudge 1 + var pow = 1.4f; // fudge 2 + var texelWidth = width / _Water._GeometryDownSampleFactor; + mpbCurrent.SetVector(ShaderIDs.s_ChunkNormalScrollSpeed, new + ( + Mathf.Pow(Mathf.Log(1f + 2f * texelWidth) * mul, pow), + Mathf.Pow(Mathf.Log(1f + 4f * texelWidth) * mul, pow), + 0, + 0 + )); + } + } + + void ApplyWaterBodyCulling() + { + var canSkipCulling = WaterBody.WaterBodies.Count == 0 && _CanSkipCulling; + + // Chunk bounds needs to be up-to-date at this point. + foreach (var tile in Chunks) + { + if (tile.Rend == null) + { + continue; + } + + tile._Culled = false; + tile.MaterialOverridden = false; + + // If there are local bodies of water, this will do overlap tests between the water tiles + // and the water bodies and turn off any that don't overlap. + if (!canSkipCulling) + { + var chunkBounds = tile.Rend.bounds; + var chunkUndisplacedBoundsXZ = tile.UnexpandedBoundsXZ; + + var largestOverlap = 0f; + var overlappingOne = false; + foreach (var body in WaterBody.WaterBodies) + { + // If tile has already been excluded from culling, then skip this iteration. But finish this + // iteration if the water body has a material override to work out most influential water body. + if (overlappingOne && body.AboveSurfaceMaterial == null) + { + continue; + } + + var bounds = body.AABB; + + var overlapping = + bounds.max.x > chunkBounds.min.x && bounds.min.x < chunkBounds.max.x && + bounds.max.z > chunkBounds.min.z && bounds.min.z < chunkBounds.max.z; + if (overlapping) + { + overlappingOne = true; + + if (body.AboveSurfaceMaterial != null) + { + var overlap = 0f; + { + // Use the unexpanded bounds to prevent leaking as generally this feature will be + // for an inland body of water where hopefully there is attenuation between it and + // the water to handle the water's displacement. The inland water body will unlikely + // have large displacement but can be mitigated with a decent buffer zone. + var xMin = Mathf.Max(bounds.min.x, chunkUndisplacedBoundsXZ.min.x); + var xMax = Mathf.Min(bounds.max.x, chunkUndisplacedBoundsXZ.max.x); + var zMin = Mathf.Max(bounds.min.z, chunkUndisplacedBoundsXZ.min.y); + var zMax = Mathf.Min(bounds.max.z, chunkUndisplacedBoundsXZ.max.y); + if (xMin < xMax && zMin < zMax) + { + overlap = (xMax - xMin) * (zMax - zMin); + } + } + + // If this water body has the most overlap, then the chunk will get its material. + if (overlap > largestOverlap) + { + tile.MaterialOverridden = true; + tile.Rend.sharedMaterial = body.AboveSurfaceMaterial; + tile._MotionVectorMaterial = body._MotionVectorMaterial; + largestOverlap = overlap; + } + } + else + { + tile.MaterialOverridden = false; + } + } + } + + tile._Culled = _WaterBodyCulling && !overlappingOne && WaterBody.WaterBodies.Count > 0; + } + + tile.Rend.enabled = !tile._Culled; + } + + // Can skip culling next time around if water body count stays at 0 + _CanSkipCulling = WaterBody.WaterBodies.Count == 0; + } + + internal void Render(Camera camera, CommandBuffer buffer, Material material = null, int pass = 0, bool culled = false) + { + var noMaterial = material == null; + + if (noMaterial && Material == null) + { + return; + } + + UpdateChunkVisibility(camera); + + // Spends approx 0.2-0.3ms here on 2018 Dell XPS 15. + foreach (var chunk in Chunks) + { + var renderer = chunk.Rend; + + // Can happen in edit mode. + if (renderer == null) + { + continue; + } + + if (!chunk._Visible) + { + continue; + } + + if (culled && chunk._Culled) + { + continue; + } + + // Make sure properties are bound for this frame. + if (!chunk._WaterDataHasBeenBound) + { + chunk.Bind(); + } + + if (noMaterial) + { + material = renderer.sharedMaterial; + } + + buffer.DrawRenderer(renderer, material, submeshIndex: 0, pass); + } + } + } + + // API + partial class SurfaceRenderer + { + bool GetEnabled() + { + return _Enabled && !_Water.IsRunningWithoutGraphics; + } + + void SetEnabled(bool previous, bool current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled) return; + if (_Enabled) Initialize(); else OnDestroy(); + } + + void SetLayer(int previous, int current) + { + if (previous == current) return; + + foreach (var chunk in Chunks) + { + chunk.gameObject.layer = current; + } + } + + bool GetCastShadows() + { + return _CastShadows; + } + + void SetCastShadows(bool previous, bool current) + { + if (previous == current) return; + + foreach (var chunk in Chunks) + { + chunk.Rend.shadowCastingMode = current ? ShadowCastingMode.On : ShadowCastingMode.Off; + } + } + + void SetAllowRenderQueueSorting(bool previous, bool current) + { + if (previous == current) return; + + foreach (var chunk in Chunks) + { + chunk.Rend.sortingOrder = current ? chunk._SortingOrder : 0; + } + } + } + + // Motion Vectors + partial class SurfaceRenderer + { + bool _QueueMotionVectors; + + bool ShouldRenderMotionVectors(Camera camera) + { + // Unity enables this when motion vectors are used - even for SRPs. + if (!camera.depthTextureMode.HasFlag(DepthTextureMode.MotionVectors)) + { + return false; + } + + return true; + } + + void LateUpdateMotionVectors() + { + _QueueMotionVectors = false; + + // Handled by Unity. + if (RenderPipelineHelper.IsHighDefinition) + { + return; + } + + if (!Application.isPlaying) + { + return; + } + + if (!_Water.WriteMotionVectors) + { + return; + } + + // This will not support WBs with material overrides, but mixing opaque and + // transparent would be odd. + if (!IsTransparent(Material)) + { + return; + } + + var pool = ArrayPool.Shared; + var cameras = pool.Rent(Camera.allCamerasCount); + Camera.GetAllCameras(cameras); + + for (var i = 0; i < Camera.allCamerasCount; i++) + { + var camera = cameras[i]; + + if (!WaterRenderer.ShouldRender(camera, _Layer)) + { + continue; + } + + if (!ShouldRenderMotionVectors(camera)) + { + continue; + } + + _QueueMotionVectors = true; + } + + pool.Return(cameras); + } + + void UpdateMotionVectorsMaterial(Material surface, ref Material motion) + { + if (!_QueueMotionVectors) + { + return; + } + + if (motion == null || motion.shader != surface.shader) + { + CoreUtils.Destroy(motion); + motion = CoreUtils.CreateEngineMaterial(surface.shader); + + // BIRP + motion.SetShaderPassEnabled("ForwardBase", false); + motion.SetShaderPassEnabled("ForwardAdd", false); + motion.SetShaderPassEnabled("Deferred", false); + + // URP + motion.SetShaderPassEnabled("UniversalForward", false); + motion.SetShaderPassEnabled("UniversalGBuffer", false); + motion.SetShaderPassEnabled("Universal2D", false); + + motion.SetShaderPassEnabled("ShadowCaster", false); + motion.SetShaderPassEnabled("DepthOnly", false); + motion.SetShaderPassEnabled("DepthNormals", false); + motion.SetShaderPassEnabled("Meta", false); + motion.SetShaderPassEnabled("SceneSelectionPass", false); + motion.SetShaderPassEnabled("Picking", false); + motion.SetShaderPassEnabled("MotionVectors", true); + } + + motion.CopyMatchingPropertiesFromMaterial(surface); + motion.renderQueue = (int)RenderQueue.Geometry; + motion.SetOverrideTag("RenderType", "Opaque"); + motion.SetFloat(Crest.ShaderIDs.Unity.s_Surface, 0); // SurfaceType.Opaque + motion.SetFloat(Crest.ShaderIDs.Unity.s_SrcBlend, 1); + motion.SetFloat(Crest.ShaderIDs.Unity.s_DstBlend, 0); + motion.SetFloat(ShaderIDs.s_BuiltShadowCasterZTest, 1); // ZTest Never + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.cs.meta new file mode 100644 index 0000000..f407404 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/SurfaceRenderer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 212222792a1a241d889bed1dc799ba37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBody.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBody.cs new file mode 100644 index 0000000..efc9884 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBody.cs @@ -0,0 +1,215 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// Demarcates an AABB area where water is present in the world. + /// + /// + /// If present, water tiles will be culled if they don't overlap any WaterBody. + /// + [@ExecuteDuringEditMode] + [AddComponentMenu(Constants.k_MenuPrefixScripts + "Water Body")] + [@HelpURL("Manual/WaterBodies.html")] + public sealed partial class WaterBody : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Tooltip("Makes sure this water body is not clipped.\n\nIf clipping is enabled and set to clip everywhere by default, this option will register this water body to ensure its area does not get clipped.")] + [@GenerateAPI(name: "Clipped")] + [SerializeField] + bool _Clip = true; + + [Tooltip("Water chunks that overlap this waterbody area will be assigned this material.\n\nThis is useful for varying water appearance across different water bodies. If no override material is specified, the default material assigned to the WaterRenderer component will be used.")] + [@AttachMaterialEditor] + [@GenerateAPI(name: "AboveSurfaceMaterial")] + [@MaterialField("Crest/Water", name: "Water", title: "Create Water Material"), SerializeField] + internal Material _Material = null; + + [Tooltip("Overrides the property on the Water Renderer with the same name when the camera is inside the bounds.")] + [@AttachMaterialEditor] + [@GenerateAPI] + [@MaterialField("Crest/Water", name: "Water (Below)", title: "Create Water Material", parent: nameof(_Material)), SerializeField] + internal Material _BelowSurfaceMaterial; + + [Tooltip("Overrides the Water Renderer's volume material when the camera is inside the bounds.")] + [@MaterialField(UnderwaterRenderer.k_ShaderNameEffect, name: "Underwater", title: "Create Underwater Material")] + [@AttachMaterialEditor] + [@GenerateAPI] + [SerializeField] + internal Material _VolumeMaterial; + + + bool _RecalculateRect = true; + bool _RecalculateBounds = true; + + internal Material _MotionVectorMaterial; + + sealed class ClipInput : ILodInput + { + readonly WaterBody _Owner; + readonly Transform _Transform; + + public bool Enabled => WaterRenderer.Instance != null && WaterRenderer.Instance._ClipLod._DefaultClippingState == DefaultClippingState.EverythingClipped; + public bool IsCompute => true; + public int Pass => -1; + + // TODO: Expose serialized queue. + public int Queue => 0; + public MonoBehaviour Component => _Owner; + + public Rect Rect => _Owner.Rect; + + public ClipInput(WaterBody owner) + { + _Owner = owner; + _Transform = owner.transform; + } + + public void Draw(Lod simulation, CommandBuffer buffer, RenderTargetIdentifier target, int pass = -1, float weight = 1f, int slices = -1) + { + var wrapper = new PropertyWrapperCompute(buffer, WaterResources.Instance.Compute._ClipPrimitive, 0); + + wrapper.SetMatrix(ShaderIDs.s_Matrix, _Transform.worldToLocalMatrix); + + // For culling. + wrapper.SetVector(ShaderIDs.s_Position, _Transform.position); + wrapper.SetFloat(ShaderIDs.s_Diameter, _Transform.lossyScale.Maximum()); + + wrapper.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveInverted, true); + wrapper.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveSphere, false); + wrapper.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveCube, false); + wrapper.SetKeyword(WaterResources.Instance.Keywords.ClipPrimitiveRectangle, true); + + wrapper.SetTexture(ShaderIDs.s_Target, target); + + var threads = simulation.Resolution / Lod.k_ThreadGroupSize; + wrapper.Dispatch(threads, threads, slices); + } + + public float Filter(WaterRenderer water, int slice) + { + return 1f; + } + } + + internal static List WaterBodies { get; } = new(); + + Bounds _Bounds; + internal Bounds AABB + { + get + { + if (_RecalculateBounds) + { + CalculateBounds(); + _RecalculateBounds = false; + } + + return _Bounds; + } + } + + Rect _Rect; + Rect Rect + { + get + { + if (_RecalculateRect) + { + _Rect = AABB.RectXZ(); + _RecalculateRect = false; + } + + return _Rect; + } + } + + internal Material AboveOrBelowSurfaceMaterial => _BelowSurfaceMaterial == null ? _Material : _BelowSurfaceMaterial; + + ClipInput _ClipInput; + + private protected override void Initialize() + { + base.Initialize(); + + CalculateBounds(); + + WaterBodies.Add(this); + + HandleClipInputRegistration(); + } + + private protected override void OnDisable() + { + base.OnDisable(); + + WaterBodies.Remove(this); + + if (_ClipInput != null) + { + ILodInput.Detach(_ClipInput, ClipLod.s_Inputs); + + _ClipInput = null; + } + } + + internal void CalculateBounds() + { + var bounds = new Bounds(); + bounds.center = transform.position; + bounds.Encapsulate(transform.TransformPoint(Vector3.right / 2f + Vector3.forward / 2f)); + bounds.Encapsulate(transform.TransformPoint(Vector3.right / 2f - Vector3.forward / 2f)); + bounds.Encapsulate(transform.TransformPoint(-Vector3.right / 2f + Vector3.forward / 2f)); + bounds.Encapsulate(transform.TransformPoint(-Vector3.right / 2f - Vector3.forward / 2f)); + + _Bounds = bounds; + } + + void HandleClipInputRegistration() + { + var registered = _ClipInput != null; + var shouldBeRegistered = _Clip; + + if (registered != shouldBeRegistered) + { + if (shouldBeRegistered) + { + _ClipInput = new(this); + + ILodInput.Attach(_ClipInput, ClipLod.s_Inputs); + } + else + { + ILodInput.Detach(_ClipInput, ClipLod.s_Inputs); + + _ClipInput = null; + } + } + } + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + if (transform.hasChanged) + { + _RecalculateRect = _RecalculateBounds = true; + } + } + + private protected override System.Action OnLateUpdateMethod => OnLateUpdate; + void OnLateUpdate(WaterRenderer water) + { + transform.hasChanged = false; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBody.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBody.cs.meta new file mode 100644 index 0000000..521afe2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBody.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12fa5fcd0e5ac436b8581c4441a2683e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBuilder.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBuilder.cs new file mode 100644 index 0000000..0e7a708 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBuilder.cs @@ -0,0 +1,539 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +//#define PROFILE_CONSTRUCTION + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + partial class SurfaceRenderer + { + // Keep references to meshes so they can be cleaned up later. + readonly Mesh[] _Meshes = new Mesh[(int)Builder.PatchType.Count]; + + /// + /// Instantiates all the water geometry, as a set of tiles. + /// + static class Builder + { + // The comments below illustrate case when BASE_VERT_DENSITY = 2. The water mesh is built up from these patches. Rotational symmetry + // is used where possible to eliminate combinations. The slim variants are used to eliminate overlap between patches. + internal enum PatchType + { + /// + /// Adds no skirt. Used in interior of highest detail LOD (0) + /// + /// 1 ------- + /// | | | + /// z ------- + /// | | | + /// 0 ------- + /// 0 1 + /// x + /// + /// + Interior, + + /// + /// Adds a full skirt all of the way around a patch + /// + /// ------------- + /// | | | | | + /// 1 ------------- + /// | | | | | + /// z ------------- + /// | | | | | + /// 0 ------------- + /// | | | | | + /// ------------- + /// 0 1 + /// x + /// + /// + Fat, + + /// + /// Adds a skirt on the right hand side of the patch + /// + /// 1 ---------- + /// | | | | + /// z ---------- + /// | | | | + /// 0 ---------- + /// 0 1 + /// x + /// + /// + FatX, + + /// + /// Adds a skirt on the right hand side of the patch, removes skirt from top + /// + FatXSlimZ, + + /// + /// Outer most side - this adds an extra skirt on the left hand side of the patch, + /// which will point outwards and be extended to Zfar + /// + /// 1 -------------------------------------------------------------------------------------- + /// | | | | + /// z -------------------------------------------------------------------------------------- + /// | | | | + /// 0 -------------------------------------------------------------------------------------- + /// 0 1 + /// x + /// + /// + FatXOuter, + + /// + /// Adds skirts at the top and right sides of the patch + /// + FatXZ, + + /// + /// Adds skirts at the top and right sides of the patch and pushes them to horizon + /// + FatXZOuter, + + /// + /// One less set of verts in x direction + /// + SlimX, + + /// + /// One less set of verts in both x and z directions + /// + SlimXZ, + + /// + /// One less set of verts in x direction, extra verts at start of z direction + /// + /// ---- + /// | | + /// 1 ---- + /// | | + /// z ---- + /// | | + /// 0 ---- + /// 0 1 + /// x + /// + /// + SlimXFatZ, + + /// + /// Number of patch types + /// + Count, + } + + // Instance Indices: + // 00 01 02 03 + // 04 05 + // 06 07 + // 08 09 10 11 + static readonly Vector2[] s_Offsets = + { + new(-1.5f, +1.5f), new(-0.5f, +1.5f), new(+0.5f, +1.5f), new(+1.5f, +1.5f), + new(-1.5f, +0.5f), new(+1.5f, +0.5f), + new(-1.5f, -0.5f), new(+1.5f, -0.5f), + new(-1.5f, -1.5f), new(-0.5f, -1.5f), new(+0.5f, -1.5f), new(+1.5f, -1.5f), + }; + + // First LOD has inside bit as well: + // 00 01 02 03 + // 04 05 06 07 + // 08 09 10 11 + // 12 13 14 15 + internal static readonly Vector2[] s_OffsetsFirstLod = + { + // Interior first for sorted rendering. + new(-0.5f, +0.5f), new(+0.5f, +0.5f), new(-0.5f, -0.5f), new(+0.5f, -0.5f), + + // Exterior. + new(-1.5f, +1.5f), new(-0.5f, +1.5f), new(+0.5f, +1.5f), new(+1.5f, +1.5f), + new(-1.5f, +0.5f), new(+1.5f, +0.5f), + new(-1.5f, -0.5f), new(+1.5f, -0.5f), + new(-1.5f, -1.5f), new(-0.5f, -1.5f), new(+0.5f, -1.5f), new(+1.5f, -1.5f), + }; + + // Usually rings have an extra side of vertices that point inwards. The outermost + // ring has both the inward vertices and also an additional outwards set of + // vertices that go to the horizon. + static readonly PatchType[] s_PatchTypes = + { + PatchType.SlimXFatZ, PatchType.SlimX, PatchType.SlimX, PatchType.SlimXZ, + PatchType.FatX, PatchType.SlimX, + PatchType.FatX, PatchType.SlimX, + PatchType.FatXZ, PatchType.FatX, PatchType.FatX, PatchType.FatXSlimZ, + }; + + // All interior - the "side" types have an extra skirt that points inwards - this + // means that this inner most section does not need any skirting. This is good, as + // this is the highest density part of the mesh. + static readonly PatchType[] s_PatchTypesFirstLod = + { + PatchType.Interior, PatchType.Interior, PatchType.Interior, PatchType.Interior, + PatchType.SlimXFatZ, PatchType.SlimX, PatchType.SlimX, PatchType.SlimXZ, + PatchType.FatX, PatchType.SlimX, + PatchType.FatX, PatchType.SlimX, + PatchType.FatXZ, PatchType.FatX, PatchType.FatX, PatchType.FatXSlimZ, + }; + + static readonly PatchType[] s_PatchTypesLastLod = + { + PatchType.FatXZOuter, PatchType.FatXOuter, PatchType.FatXOuter, PatchType.FatXZOuter, + PatchType.FatXOuter, PatchType.FatXOuter, + PatchType.FatXOuter, PatchType.FatXOuter, + PatchType.FatXZOuter, PatchType.FatXOuter, PatchType.FatXOuter, PatchType.FatXZOuter, + }; + + static int s_SiblingIndex; + + public static Transform GenerateMesh(WaterRenderer water, SurfaceRenderer surface, List tiles, int lodDataResolution, int geoDownSampleFactor, int lodCount) + { + if (lodCount < 1) + { + Debug.LogError("Crest: Invalid LOD count: " + lodCount.ToString(), water); + return null; + } + +#if PROFILE_CONSTRUCTION + var sw = new System.Diagnostics.Stopwatch(); + sw.Start(); +#endif + + s_SiblingIndex = 0; + + var root = new GameObject("Root"); + Debug.Assert(root != null, "Crest: The water Root transform could not be immediately constructed. Please report this issue to the Crest developers via our support email or GitHub at https://github.com/wave-harmonic/crest/issues ."); + + root.hideFlags = water._Debug._ShowHiddenObjects ? HideFlags.DontSave : HideFlags.HideAndDontSave; + root.transform.parent = water.Container.transform; + root.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); + root.transform.localScale = Vector3.one; + + // create mesh data + // 4 tiles across a LOD, and support lowering density by a factor + var tileResolution = Mathf.Round(0.25f * lodDataResolution / geoDownSampleFactor); + for (var i = 0; i < (int)PatchType.Count; i++) + { + surface._Meshes[i] = BuildPatch(water, (PatchType)i, tileResolution); + } + + for (var i = 0; i < lodCount; i++) + { + CreateLOD(water, surface, tiles, root.transform, i, lodCount, surface._Meshes, lodDataResolution, geoDownSampleFactor, surface.Layer); + } + +#if PROFILE_CONSTRUCTION + sw.Stop(); + Debug.Log( "Crest: Finished generating " + lodCount.ToString() + " LODs, time: " + (1000.0*sw.Elapsed.TotalSeconds).ToString(".000") + "ms" ); +#endif + + return root.transform; + } + + static Mesh BuildPatch(WaterRenderer water, PatchType pt, float vertDensity) + { + var verts = new List(); + var indices = new List(); + + // stick a bunch of verts into a 1m x 1m patch (scaling happens later) + var dx = 1f / vertDensity; + + + ////////////////////////////////////////////////////////////////////////////////// + // verts + + // see comments within PatchType for diagrams of each patch mesh + + // skirt widths on left, right, bottom and top (in order) + float skirtXminus = 0f, skirtXplus = 0f; + float skirtZminus = 0f, skirtZplus = 0f; + // set the patch size + if (pt == PatchType.Fat) { skirtXminus = skirtXplus = skirtZminus = skirtZplus = 1f; } + else if (pt is PatchType.FatX or PatchType.FatXOuter) { skirtXplus = 1f; } + else if (pt is PatchType.FatXZ or PatchType.FatXZOuter) { skirtXplus = skirtZplus = 1f; } + else if (pt == PatchType.FatXSlimZ) { skirtXplus = 1f; skirtZplus = -1f; } + else if (pt == PatchType.SlimX) { skirtXplus = -1f; } + else if (pt == PatchType.SlimXZ) { skirtXplus = skirtZplus = -1f; } + else if (pt == PatchType.SlimXFatZ) { skirtXplus = -1f; skirtZplus = 1f; } + + var sideLength_verts_x = 1f + vertDensity + skirtXminus + skirtXplus; + var sideLength_verts_z = 1f + vertDensity + skirtZminus + skirtZplus; + + var start_x = -0.5f - skirtXminus * dx; + var start_z = -0.5f - skirtZminus * dx; + var end_x = 0.5f + skirtXplus * dx; + var end_z = 0.5f + skirtZplus * dx; + + // With a default value of 100, this will reach the horizon at all levels at + // a far plane of 200k. + var extentsMultiplier = water._ExtentsSizeMultiplier * (Lod.k_MaximumSlices + 1 - water.LodLevels); + + for (float j = 0; j < sideLength_verts_z; j++) + { + // interpolate z across patch + var z = Mathf.Lerp(start_z, end_z, j / (sideLength_verts_z - 1f)); + + // push outermost edge out to horizon + if (pt == PatchType.FatXZOuter && j == sideLength_verts_z - 1f) + z *= extentsMultiplier; + + for (float i = 0; i < sideLength_verts_x; i++) + { + // interpolate x across patch + var x = Mathf.Lerp(start_x, end_x, i / (sideLength_verts_x - 1f)); + + // push outermost edge out to horizon + if (i == sideLength_verts_x - 1f && (pt == PatchType.FatXOuter || pt == PatchType.FatXZOuter)) + x *= extentsMultiplier; + + // could store something in y, although keep in mind this is a shared mesh that is shared across multiple lods + verts.Add(new(x, 0f, z)); + } + } + + + ////////////////////////////////////////////////////////////////////////////////// + // indices + + var sideLength_squares_x = (int)sideLength_verts_x - 1; + var sideLength_squares_z = (int)sideLength_verts_z - 1; + + for (var j = 0; j < sideLength_squares_z; j++) + { + for (var i = 0; i < sideLength_squares_x; i++) + { + var flipEdge = false; + + if (i % 2 == 1) flipEdge = !flipEdge; + if (j % 2 == 1) flipEdge = !flipEdge; + + var i0 = i + j * (sideLength_squares_x + 1); + var i1 = i0 + 1; + var i2 = i0 + (sideLength_squares_x + 1); + var i3 = i2 + 1; + + if (!flipEdge) + { + // tri 1 + indices.Add(i3); + indices.Add(i1); + indices.Add(i0); + + // tri 2 + indices.Add(i0); + indices.Add(i2); + indices.Add(i3); + } + else + { + // tri 1 + indices.Add(i3); + indices.Add(i1); + indices.Add(i2); + + // tri 2 + indices.Add(i0); + indices.Add(i2); + indices.Add(i1); + } + } + } + + + ////////////////////////////////////////////////////////////////////////////////// + // create mesh + + var mesh = new Mesh(); + if (verts != null && verts.Count > 0) + { + var arrV = new Vector3[verts.Count]; + verts.CopyTo(arrV); + + var arrI = new int[indices.Count]; + indices.CopyTo(arrI); + + mesh.SetIndices(null, MeshTopology.Triangles, 0); + mesh.vertices = arrV; + + // HDRP needs full data. Do this on a define to keep door open to runtime changing of RP. +#if d_UnityHDRP + var norms = new Vector3[verts.Count]; + for (var i = 0; i < norms.Length; i++) norms[i] = Vector3.up; + var tans = new Vector4[verts.Count]; + for (var i = 0; i < tans.Length; i++) tans[i] = new(1, 0, 0, 1); + + mesh.normals = norms; + mesh.tangents = tans; +#else + mesh.normals = null; +#endif + + mesh.SetIndices(arrI, MeshTopology.Triangles, 0); + + // recalculate bounds. add a little allowance for snapping. in the chunk renderer script, the bounds will be expanded further + // to allow for horizontal displacement + mesh.RecalculateBounds(); + var bounds = mesh.bounds; + // Increase snapping allowance (see #1148). Value was chosen by observation with a + // custom debug mode to show pixels that were out of bounds. + dx *= 3f; + bounds.extents = new(bounds.extents.x + dx, bounds.extents.y, bounds.extents.z + dx); + mesh.bounds = bounds; + mesh.name = pt.ToString(); + } + + return mesh; + } + + static void CreateLOD(WaterRenderer water, SurfaceRenderer surface, List tiles, Transform parent, int lodIndex, int lodCount, Mesh[] meshData, int lodDataResolution, int geoDownSampleFactor, int layer) + { + var horizScale = Mathf.Pow(2f, lodIndex); + + var isBiggestLOD = lodIndex == lodCount - 1; + var generateSkirt = isBiggestLOD; + +#if CREST_DEBUG + generateSkirt = generateSkirt && !surface._Debug._DisableSkirt; +#endif + + Vector2[] offsets; + PatchType[] patchTypes; + + if (lodIndex != 0) + { + offsets = s_Offsets; + patchTypes = generateSkirt ? s_PatchTypesLastLod : s_PatchTypes; + } + else + { + offsets = s_OffsetsFirstLod; + patchTypes = s_PatchTypesFirstLod; + } + +#if CREST_DEBUG + // debug toggle to force all patches to be the same. they'll be made with a surrounding skirt to make sure patches + // overlap + if (surface._Debug._UniformTiles) + { + patchTypes = new PatchType[patchTypes.Length]; + System.Array.Fill(patchTypes, PatchType.Fat); + } +#endif + + // create the water patches + for (var i = 0; i < offsets.Length; i++) + { + // instantiate and place patch + var patch = surface._ChunkTemplate + ? Helpers.InstantiatePrefab(surface._ChunkTemplate) + : new(); + // Also applying the hide flags to the chunk will prevent it from being pickable in the editor. + patch.hideFlags = water._Debug._ShowHiddenObjects ? HideFlags.DontSave : HideFlags.HideAndDontSave; + patch.name = $"Tile_L{lodIndex}_{patchTypes[i]}"; + patch.layer = layer; + patch.transform.parent = parent; + var pos = offsets[i]; + patch.transform.localPosition = horizScale * new Vector3(pos.x, 0f, pos.y); + // scale only horizontally, otherwise culling bounding box will be scaled up in y + patch.transform.localScale = new(horizScale, 1f, horizScale); + + if (!patch.TryGetComponent(out var mr)) + { + mr = patch.AddComponent(); + // I don't think one would use light probes for a purely specular water surface? (although diffuse + // foam shading would benefit). + mr.lightProbeUsage = LightProbeUsage.Off; + } + + var order = -lodCount + (patchTypes[i] == PatchType.Interior ? -1 : lodIndex); + + { + var mesh = meshData[(int)patchTypes[i]]; + patch.AddComponent().sharedMesh = mesh; + + var chunk = patch.AddComponent(); + chunk._Water = water; + chunk._SortingOrder = order; + chunk._SiblingIndex = s_SiblingIndex++; + + chunk.Initialize(lodIndex, mr, mesh); + + // When custom rendering, we loop over chunks to render, which means these need to + // be optimally sorted. We statically sort by LOD. Sub-sort is only done for LOD0, + // where interior tiles are placed first. Further sorting must be done dynamically. + tiles.Add(chunk); + } + + // Sorting order to stop unity drawing it back to front. Make the innermost four tiles draw first, + // followed by the rest of the tiles by LOD index. + if (RenderPipelineHelper.IsHighDefinition) + { + // HDRP has a different rendering priority system: + // https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@10.10/manual/Renderer-And-Material-Priority.html#sorting-by-renderer + mr.rendererPriority = order; + } + else if (!water.Surface.AllowRenderQueueSorting) + { + // Sorting order to stop unity drawing it back to front. make the innermost 4 tiles draw first, followed by + // the rest of the tiles by LOD index. all this happens before layer 0 - the sorting layer takes priority over the + // render queue it seems! ( https://cdry.wordpress.com/2017/04/28/unity-render-queues-vs-sorting-layers/ ). This pushes + // water rendering way early, so transparent objects will by default render afterwards, which is typical for water rendering. + mr.sortingOrder = order; + } + + mr.shadowCastingMode = water.Surface.CastShadows ? ShadowCastingMode.On : ShadowCastingMode.Off; + + // This setting is ignored by Unity for the transparent water shader. + mr.receiveShadows = false; + + mr.motionVectorGenerationMode = !water.WriteMotionVectors + ? MotionVectorGenerationMode.ForceNoMotion + : MotionVectorGenerationMode.Object; + + mr.material = water.Surface.Material; + + OnCreateChunkRenderer?.Invoke(mr); + + // rotate side patches to point the +x side outwards + var rotateXOutwards = patchTypes[i] is PatchType.FatX or PatchType.FatXOuter or PatchType.SlimX or PatchType.SlimXFatZ; + if (rotateXOutwards) + { + if (Mathf.Abs(pos.y) >= Mathf.Abs(pos.x)) + patch.transform.localEulerAngles = 90f * Mathf.Sign(pos.y) * -Vector3.up; + else + patch.transform.localEulerAngles = pos.x < 0f ? Vector3.up * 180f : Vector3.zero; + } + + // rotate the corner patches so the +x and +z sides point outwards + var rotateXZOutwards = patchTypes[i] is PatchType.FatXZ or PatchType.SlimXZ or PatchType.FatXSlimZ or PatchType.FatXZOuter; + if (rotateXZOutwards) + { + // xz direction before rotation + var from = new Vector3(1f, 0f, 1f).normalized; + // target xz direction is outwards vector given by local patch position - assumes this patch is a corner (checked below) + var to = patch.transform.localPosition.normalized; + if (Mathf.Abs(patch.transform.localPosition.x) < 0.0001f || Mathf.Abs(Mathf.Abs(patch.transform.localPosition.x) - Mathf.Abs(patch.transform.localPosition.z)) > 0.001f) + { + Debug.LogWarning("Crest: Skipped rotating a patch because it isn't a corner, click here to highlight.", patch); + continue; + } + + // Detect 180 degree rotations as it doesn't always rotate around Y + if (Vector3.Dot(from, to) < -0.99f) + patch.transform.localEulerAngles = Vector3.up * 180f; + else + patch.transform.localRotation = Quaternion.FromToRotation(from, to); + } + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBuilder.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBuilder.cs.meta new file mode 100644 index 0000000..9495afc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 74a58ee5c012f4e38be0d38da61de24a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterChunkRenderer.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterChunkRenderer.cs new file mode 100644 index 0000000..3162ffe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterChunkRenderer.cs @@ -0,0 +1,357 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + interface IReportsHeight + { + bool ReportHeight(ref Rect bounds, ref float minimum, ref float maximum); + } + + interface IReportsDisplacement + { + bool ReportDisplacement(ref Rect bounds, ref float horizontal, ref float vertical); + } + + /// + /// Sets shader parameters for each geometry tile/chunk. + /// +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [@ExecuteDuringEditMode] + sealed class WaterChunkRenderer : ManagedBehaviour + { + [SerializeField] + internal bool _DrawRenderBounds = false; + + internal const string k_UpdateMeshBoundsMarker = "Crest.WaterChunkRenderer.UpdateMeshBounds"; + + static readonly Unity.Profiling.ProfilerMarker s_UpdateMeshBoundsMarker = new(k_UpdateMeshBoundsMarker); + + internal Transform _Transform; + internal Mesh _Mesh; + public Renderer Rend { get; private set; } + internal MaterialPropertyBlock _MaterialPropertyBlock; + Matrix4x4 _CurrentObjectToWorld; + Matrix4x4 _PreviousObjectToWorld; + internal Material _MotionVectorMaterial; + internal int _SortingOrder; + internal int _SiblingIndex; + + internal Rect _UnexpandedBoundsXZ = new(); + public Rect UnexpandedBoundsXZ => _UnexpandedBoundsXZ; + + internal bool _Culled; + internal bool _Visible; + + internal WaterRenderer _Water; + + public bool MaterialOverridden { get; set; } + + // We need to ensure that all water data has been bound for the mask to + // render properly - this is something that needs to happen irrespective + // of occlusion culling because we need the mask to render as a + // contiguous surface. + internal bool _WaterDataHasBeenBound = true; + + int _LodIndex = -1; + + public static List HeightReporters { get; } = new(); + public static List DisplacementReporters { get; } = new(); + + // There is a 1-frame delay with Initialized in edit mode due to setting + // enableInEditMode in EditorApplication.update. This only really affect this + // component as it is instantiate via script, and is partial driven externally. + // So instead, call this after instantiation. + internal void Initialize(int index, Renderer renderer, Mesh mesh) + { + _LodIndex = index; + Rend = renderer; + _Mesh = mesh; + _PreviousObjectToWorld = _CurrentObjectToWorld = transform.localToWorldMatrix; + _Transform = transform; + } + + private protected override void OnStart() + { + base.OnStart(); + + UpdateMeshBounds(); + } + + internal void UpdateMeshBounds(WaterRenderer water, SurfaceRenderer surface) + { + _WaterDataHasBeenBound = false; + + var count = surface.TimeSliceBoundsUpdateFrameCount; + + // Time slice update to distribute the load. + if (count <= 1 || !(_SiblingIndex % count != Time.frameCount % surface.Chunks.Count % count)) + { + // This needs to be called on Update because the bounds depend on transform scale which can change. Also OnWillRenderObject depends on + // the bounds being correct. This could however be called on scale change events, but would add slightly more complexity. + UpdateMeshBounds(); + } + } + + bool ShouldRender(bool culled) + { + // Is visible to camera. + if (!_Visible) + { + return false; + } + + // If including culling, is it culled. + if (culled && _Culled) + { + return false; + } + + return true; + } + + internal void OnLateUpdate() + { + _PreviousObjectToWorld = _CurrentObjectToWorld; + _CurrentObjectToWorld = _Transform.localToWorldMatrix; + } + + internal void RenderMotionVectors(SurfaceRenderer surface, Camera camera) + { + if (!ShouldRender(culled: true)) + { + return; + } + + // RenderMesh will copy properties immediately, thus we need them bound. + if (!_WaterDataHasBeenBound) + { + Bind(); + } + + var material = MaterialOverridden ? _MotionVectorMaterial : surface._MotionVectorMaterial; + + var parameters = new RenderParams(material) + { + motionVectorMode = MotionVectorGenerationMode.Object, + material = material, + matProps = _MaterialPropertyBlock, + worldBounds = Rend.bounds, + layer = surface.Layer, + receiveShadows = false, + shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off, + lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off, + reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off, + camera = camera, + }; + + Graphics.RenderMesh(parameters, _Mesh, 0, _CurrentObjectToWorld, _PreviousObjectToWorld); + } + + void UpdateMeshBounds() + { + s_UpdateMeshBoundsMarker.Begin(this); + + var bounds = _Mesh.bounds; + + if (WaterBody.WaterBodies.Count > 0) + { + _UnexpandedBoundsXZ = ComputeBoundsXZ(_Transform, bounds); + } + + bounds = ExpandBoundsForDisplacements(_Transform, bounds); + + Rend.localBounds = bounds; + + s_UpdateMeshBoundsMarker.End(); + } + + public static Rect ComputeBoundsXZ(Transform transform, Bounds bounds) + { + // Since chunks are axis-aligned it is safe to rotate the bounds. + var center = transform.rotation * bounds.center * transform.lossyScale.x + transform.position; + var size = transform.rotation * bounds.size * transform.lossyScale.x; + // Rotation can make size negative. + return new(0, 0, Mathf.Abs(size.x), Mathf.Abs(size.z)) + { + center = center.XZ(), + }; + } + + // Used by the water mask system if we need to render the water mask in situations + // where the water itself doesn't need to be rendered or has otherwise been disabled + internal void Bind() + { + _MaterialPropertyBlock = _Water.Surface._PerCascadeMPB.Current[_LodIndex]; + Rend.SetPropertyBlock(_MaterialPropertyBlock); + + _WaterDataHasBeenBound = true; + } + + void OnDestroy() + { + Helpers.Destroy(_Mesh); + } + + // Called when visible to a camera + void OnWillRenderObject() + { + if (Rend == null) + { + return; + } + + if (!MaterialOverridden && Rend.sharedMaterial != _Water.Surface.Material) + { + Rend.sharedMaterial = _Water.Surface.Material; + _MotionVectorMaterial = _Water.Surface._MotionVectorMaterial; + } + + if (!_WaterDataHasBeenBound) + { + Bind(); + } + + if (_DrawRenderBounds) + { + Rend.bounds.DebugDraw(); + } + } + + // this is called every frame because the bounds are given in world space and depend on the transform scale, which + // can change depending on view altitude + public Bounds ExpandBoundsForDisplacements(Transform transform, Bounds bounds) + { + var extents = bounds.extents; + var center = bounds.center; + + var scale = transform.lossyScale; + var rotation = transform.rotation; + + var boundsPadding = _Water.MaximumHorizontalDisplacement; + var expandXZ = boundsPadding / scale.x; + var boundsY = _Water.MaximumVerticalDisplacement; + + // Extend the kinematic bounds slightly to give room for dynamic waves. + if (_Water._DynamicWavesLod.Enabled) + { + boundsY += 5f; + } + + // Extend bounds by global waves. + extents.x += expandXZ; + extents.y += boundsY; + extents.z += expandXZ; + + // Get XZ bounds. Doing this manually bypasses updating render bounds call. + Rect rect; + { + var p1 = transform.position; + var p2 = rotation * new Vector3(center.x, 0f, center.z); + var s1 = scale; + var s2 = rotation * (extents.XNZ(0f) * 2f); + + rect = new(0, 0, Mathf.Abs(s1.x * s2.x), Mathf.Abs(s1.z * s2.z)) + { + center = new(p1.x + p2.x, p1.z + p2.z) + }; + } + + // Extend bounds by local waves. + { + var totalHorizontal = 0f; + var totalVertical = 0f; + + foreach (var reporter in DisplacementReporters) + { + var horizontal = 0f; + var vertical = 0f; + if (reporter.ReportDisplacement(ref rect, ref horizontal, ref vertical)) + { + totalHorizontal += horizontal; + totalVertical += vertical; + } + } + + boundsPadding = totalHorizontal; + expandXZ = boundsPadding / scale.x; + boundsY = totalVertical; + + extents.x += expandXZ; + extents.y += boundsY; + extents.z += expandXZ; + } + + // Expand and offset bounds by height. + { + var minimumWaterLevelBounds = 0f; + var maximumWaterLevelBounds = 0f; + + foreach (var reporter in HeightReporters) + { + var minimum = 0f; + var maximum = 0f; + if (reporter.ReportHeight(ref rect, ref minimum, ref maximum)) + { + minimumWaterLevelBounds = Mathf.Max(minimumWaterLevelBounds, Mathf.Abs(Mathf.Min(minimum, _Water.SeaLevel) - _Water.SeaLevel)); + maximumWaterLevelBounds = Mathf.Max(maximumWaterLevelBounds, Mathf.Abs(Mathf.Max(maximum, _Water.SeaLevel) - _Water.SeaLevel)); + } + } + + minimumWaterLevelBounds *= 0.5f; + maximumWaterLevelBounds *= 0.5f; + + boundsY = minimumWaterLevelBounds + maximumWaterLevelBounds; + extents.y += boundsY; + bounds.extents = extents; + + var offset = maximumWaterLevelBounds - minimumWaterLevelBounds; + center.y += offset; + bounds.center = center; + } + + return bounds; + } + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void InitStatics() + { + HeightReporters.Clear(); + DisplacementReporters.Clear(); + } + } + + static class BoundsHelper + { + internal static void DebugDraw(this Bounds b) + { + var xmin = b.min.x; + var ymin = b.min.y; + var zmin = b.min.z; + var xmax = b.max.x; + var ymax = b.max.y; + var zmax = b.max.z; + + Debug.DrawLine(new(xmin, ymin, zmin), new(xmin, ymin, zmax)); + Debug.DrawLine(new(xmin, ymin, zmin), new(xmax, ymin, zmin)); + Debug.DrawLine(new(xmax, ymin, zmax), new(xmin, ymin, zmax)); + Debug.DrawLine(new(xmax, ymin, zmax), new(xmax, ymin, zmin)); + + Debug.DrawLine(new(xmin, ymax, zmin), new(xmin, ymax, zmax)); + Debug.DrawLine(new(xmin, ymax, zmin), new(xmax, ymax, zmin)); + Debug.DrawLine(new(xmax, ymax, zmax), new(xmin, ymax, zmax)); + Debug.DrawLine(new(xmax, ymax, zmax), new(xmax, ymax, zmin)); + + Debug.DrawLine(new(xmax, ymax, zmax), new(xmax, ymin, zmax)); + Debug.DrawLine(new(xmin, ymin, zmin), new(xmin, ymax, zmin)); + Debug.DrawLine(new(xmax, ymin, zmin), new(xmax, ymax, zmin)); + Debug.DrawLine(new(xmin, ymax, zmax), new(xmin, ymin, zmax)); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterChunkRenderer.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterChunkRenderer.cs.meta new file mode 100644 index 0000000..3f3c332 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterChunkRenderer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 391e7ec2ec9194dbeb14b0b0af03a29f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterReflections.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterReflections.cs new file mode 100644 index 0000000..e0cc8bd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterReflections.cs @@ -0,0 +1,887 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// This script originated from the unity standard assets. It has been modified heavily to be camera-centric (as opposed to +// geometry-centric) and assumes a single main camera which simplifies the code. + +using System; +using Unity.Collections; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + /// + /// What side of the water surface to render planar reflections for. + /// + [@GenerateDoc] + public enum WaterReflectionSide + { + /// + [Tooltip("Both sides. Most expensive.")] + Both, + + /// + [Tooltip("Above only. Typical for planar reflections.")] + Above, + + /// + [Tooltip("Below only. For total internal reflections.")] + Below, + } + + /// + /// Renders reflections for water. Currently on planar reflections. + /// + [Serializable] + public sealed partial class WaterReflections + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [@Space(10)] + + [@Label("Enable")] + [Tooltip("Whether planar reflections are enabled.\n\nAllocates/releases resources if state has changed.")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + internal bool _Enabled; + + + [@Heading("Capture")] + + [Tooltip("What side of the water surface to render planar reflections for.")] + [@GenerateAPI(name: "ReflectionSide")] + [@DecoratedField, SerializeField] + internal WaterReflectionSide _Mode = WaterReflectionSide.Above; + + [Tooltip("The layers to rendering into reflections.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + LayerMask _Layers = 1; // Default + + [Tooltip("Resolution of the reflection texture.")] + [@GenerateAPI] + [@Delayed, SerializeField] + int _Resolution = 256; + + [Tooltip("Whether to render to the viewer camera only.\n\nWhen disabled, reflections will render for all cameras rendering the water layer, which currently this prevents Refresh Rate from working. Enabling will unlock the Refresh Rate heading.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _RenderOnlySingleCamera; + + [@Space(10)] + + [Tooltip("Whether to render the sky or fallback to default reflections.\n\nNot rendering the sky can prevent other custom shaders (like tree leaves) from being in the final output. Enable for best compatibility.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _Sky = true; + + [Tooltip("Disables pixel lights (BIRP only).")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _DisablePixelLights = true; + +#pragma warning disable 414 + [Tooltip("Disables shadows.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _DisableShadows = true; +#pragma warning restore 414 + + [Tooltip("Whether to allow HDR.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _HDR = true; + + [Tooltip("Whether to allow stencil operations.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _Stencil = false; + + [Tooltip("Whether to allow MSAA.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _AllowMSAA = false; + + [@Space(10)] + + [Tooltip("Overrides global quality settings.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + QualitySettingsOverride _QualitySettingsOverride = new() + { + _OverrideLodBias = false, + _LodBias = 0.5f, + _OverrideMaximumLodLevel = false, + _MaximumLodLevel = 1, + _OverrideTerrainPixelError = false, + _TerrainPixelError = 10, + }; + + [@Heading("Culling")] + + [Tooltip("The near clip plane clips any geometry before it, removing it from reflections.\n\nCan be used to reduce reflection leaks and support varied water level.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _ClipPlaneOffset; + + [Tooltip("Anything beyond the far clip plane is not rendered.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _FarClipPlane = 1000; + + [Tooltip("Disables occlusion culling.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _DisableOcclusionCulling = true; + + + [@Heading("Refresh Rate")] + + [Tooltip("Refresh reflection every x frames (one is every frame)")] + [@Predicated(nameof(_RenderOnlySingleCamera))] + [@DecoratedField, SerializeField] + int _RefreshPerFrames = 1; + + [@Predicated(nameof(_RenderOnlySingleCamera))] + [@DecoratedField, SerializeField] + int _FrameRefreshOffset = 0; + + + [@Heading("Oblique Matrix")] + + [@Label("Enable")] + [Tooltip("An oblique matrix will clip anything below the surface for free.\n\nDisable if you have problems with certain effects. Disabling can cause other artifacts like objects below the surface to appear in reflections.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _UseObliqueMatrix = true; + + [Tooltip("Planar relfections using an oblique frustum for better performance.\n\nThis can cause depth issues for TIRs, especially near the surface.")] + [@Predicated(nameof(_UseObliqueMatrix))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _NonObliqueNearSurface; + + [Tooltip("If within this distance from the surface, disable the oblique matrix.")] + [@Predicated(nameof(_NonObliqueNearSurface))] + [@Predicated(nameof(_UseObliqueMatrix))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _NonObliqueNearSurfaceThreshold = 0.05f; + + + [@Space(10)] + + [@DecoratedField, SerializeField] + DebugFields _Debug = new(); + + [Serializable] + sealed class DebugFields + { + [@DecoratedField, SerializeField] + internal bool _ShowHiddenObjects; + + [Tooltip("Rendering reflections per-camera requires recursive rendering. Check this toggle if experiencing issues. The other downside without it is a one-frame delay.")] + [@DecoratedField, SerializeField] + internal bool _DisableRecursiveRendering; + } + + + /// + /// What side of the water surface to render planar reflections for. + /// + public WaterReflectionSide Mode { get => _Mode; set => _Mode = value; } + + + static class ShaderIDs + { + public static int s_ReflectionTexture = Shader.PropertyToID("_Crest_ReflectionTexture"); + public static int s_ReflectionPositionNormal = Shader.PropertyToID("_Crest_ReflectionPositionNormal"); + } + + // Checked in underwater to filter cameras. + internal static Camera CurrentCamera { get; private set; } + + internal WaterRenderer _Water; + internal UnderwaterRenderer _UnderWater; + + RenderTexture _ReflectionTexture; + internal RenderTexture ReflectionTexture => _ReflectionTexture; + readonly Vector4[] _ReflectionPositionNormal = new Vector4[2]; + + Camera _CameraViewpoint; + Skybox _CameraViewpointSkybox; + Camera _CameraReflections; + Skybox _CameraReflectionsSkybox; + + int RefreshPerFrames => _RenderOnlySingleCamera ? _RefreshPerFrames : 1; + long _LastRefreshOnFrame = -1; + + internal bool SupportsRecursiveRendering => +#if !UNITY_6000_0_OR_NEWER + // HDRP cannot recursive render for 2022. + !RenderPipelineHelper.IsHighDefinition && +#endif + !_Debug._DisableRecursiveRendering; + + readonly float[] _CullDistances = new float[32]; + + /// + /// Invoked when the reflection camera is created. + /// + public static Action OnCameraAdded { get; set; } + + internal void OnEnable() + { + _CameraViewpoint = _Water.Viewer; + _CameraViewpointSkybox = _CameraViewpoint.GetComponent(); + + // This is called also called every frame, but was required here as there was a + // black reflection for a frame without this earlier setup call. + CreateWaterObjects(_CameraViewpoint); + } + + internal void OnDisable() + { + Shader.SetGlobalTexture(ShaderIDs.s_ReflectionTexture, Texture2D.blackTexture); + } + + internal void OnDestroy() + { + if (_CameraReflections) + { + Helpers.Destroy(_CameraReflections.gameObject); + _CameraReflections = null; + } + + if (_ReflectionTexture) + { + _ReflectionTexture.Release(); + Helpers.Destroy(_ReflectionTexture); + _ReflectionTexture = null; + } + } + + bool ShouldRender(Camera camera) + { + // If no surface, then do not execute the reflection camera. + if (!WaterRenderer.ShouldRender(camera, _Water.Surface.Layer)) + { + return false; + } + + // This method could be executed twice: once by the camera rendering the surface, + // and once again by the planar reflection camera. For the latter, we do not want + // to proceed or infinite recursion. For safety. + if (camera == CurrentCamera) + { + return false; + } + + // Avoid these types for now. + if (camera.cameraType == CameraType.Reflection) + { + return false; + } + + return true; + } + + internal void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + if (!ShouldRender(camera)) + { + return; + } + + if (SupportsRecursiveRendering) + { + // This option only valid for recursive, otherwise, it is always single camera. + if (_RenderOnlySingleCamera && camera != _Water.Viewer) + { + return; + } + + _CameraViewpoint = camera; + LateUpdate(context); + } + + if (camera == _CameraViewpoint) + { + // TODO: Emit an event instead so WBs can listen. + Shader.SetGlobalTexture(ShaderIDs.s_ReflectionTexture, _ReflectionTexture); + } + } + + internal void OnEndCameraRendering(Camera camera) + { + if (!ShouldRender(camera)) + { + return; + } + + Shader.SetGlobalTexture(ShaderIDs.s_ReflectionTexture, Texture2D.blackTexture); + } + + internal void LateUpdate(ScriptableRenderContext context) + { + // Frame rate limiter. + if (_LastRefreshOnFrame > 0 && RefreshPerFrames > 1) + { + // Check whether we need to refresh the frame. + if (Math.Abs(_FrameRefreshOffset) % _RefreshPerFrames != Time.renderedFrameCount % _RefreshPerFrames) + { + return; + } + } + + if (_Water == null) + { + return; + } + + if (!SupportsRecursiveRendering) + { + _CameraViewpoint = _Water.Viewer; + } + + if (_CameraViewpoint == null) + { + return; + } + +#if UNITY_EDITOR + // Fix "Screen position out of view frustum" when 2D view activated. + { + var sceneView = UnityEditor.SceneView.lastActiveSceneView; + if (sceneView != null && sceneView.in2DMode && sceneView.camera == _CameraViewpoint) + { + return; + } + } +#endif + + CreateWaterObjects(_CameraViewpoint); + + if (!_CameraReflections) + { + return; + } + + UpdateCameraModes(); + ForceDistanceCulling(_FarClipPlane); + + _CameraReflections.targetTexture = _ReflectionTexture; + + // TODO: Do not do this every frame. + if (_Mode != WaterReflectionSide.Both) + { + Helpers.ClearRenderTexture(_ReflectionTexture, Color.clear, depth: false); + } + + // We do not want the water plane when rendering planar reflections. + _Water.Surface.Root.gameObject.SetActive(false); + + CurrentCamera = _CameraReflections; + + // Optionally disable pixel lights for reflection/refraction + var oldPixelLightCount = QualitySettings.pixelLightCount; + if (_DisablePixelLights) + { + QualitySettings.pixelLightCount = 0; + } + + // Optionally disable shadows. + var oldShadowQuality = QualitySettings.shadows; + if (_DisableShadows) + { + QualitySettings.shadows = UnityEngine.ShadowQuality.Disable; + } + + _QualitySettingsOverride.Override(); + + // Invert culling because view is mirrored. Does not work for HDRP (handled elsewhere). + var oldCulling = GL.invertCulling; + GL.invertCulling = !oldCulling; + +#if UNITY_EDITOR + try +#endif + { + Render(context); + } +#if UNITY_EDITOR + // Ensure that any global settings are restored. + finally +#endif + { + GL.invertCulling = oldCulling; + + // Restore shadows. + if (_DisableShadows) + { + QualitySettings.shadows = oldShadowQuality; + } + + // Restore pixel light count + if (_DisablePixelLights) + { + QualitySettings.pixelLightCount = oldPixelLightCount; + } + + _QualitySettingsOverride.Restore(); + + CurrentCamera = null; + _Water.Surface.Root.gameObject.SetActive(true); + + // Remember this frame as last refreshed. + _LastRefreshOnFrame = Time.renderedFrameCount; + } + } + + void Render(ScriptableRenderContext context) + { +#if UNITY_6000_0_OR_NEWER && d_UnityURP + _CameraReflections.targetTexture = _ReflectionTexture; +#else + var descriptor = _ReflectionTexture.descriptor; + descriptor.dimension = TextureDimension.Tex2D; + descriptor.volumeDepth = 1; + descriptor.useMipMap = false; + // No need to clear, as camera clears using the skybox. + var target = RenderTexture.GetTemporary(descriptor); + _CameraReflections.targetTexture = target; +#endif + + if (_Mode != WaterReflectionSide.Below) + { + _ReflectionPositionNormal[0] = ComputeHorizonPositionAndNormal(_CameraReflections, _Water.SeaLevel, 0.05f, false); + + if (_UnderWater._Enabled) + { + // Disable underwater layer. It is the only way to exclude probes. + _CameraReflections.cullingMask = _Layers & ~(1 << _UnderWater.Layer); + } + + RenderCamera(context, _CameraReflections, Vector3.up, false, 0); + +#if !(UNITY_6000_0_OR_NEWER && d_UnityURP) + Graphics.CopyTexture(target, 0, 0, _ReflectionTexture, 0, 0); +#endif + + _CameraReflections.ResetProjectionMatrix(); + } + + if (_Mode != WaterReflectionSide.Above) + { + _ReflectionPositionNormal[1] = ComputeHorizonPositionAndNormal(_CameraReflections, _Water.SeaLevel, -0.05f, true); + + if (_UnderWater._Enabled) + { + // Enable underwater layer. + _CameraReflections.cullingMask = _Layers | (1 << _UnderWater.Layer); + // We need the depth texture for underwater. + _CameraReflections.depthTextureMode = DepthTextureMode.Depth; + } + + RenderCamera(context, _CameraReflections, Vector3.down, _NonObliqueNearSurface, 1); + +#if !(UNITY_6000_0_OR_NEWER && d_UnityURP) + Graphics.CopyTexture(target, 0, 0, _ReflectionTexture, 1, 0); +#endif + + _CameraReflections.ResetProjectionMatrix(); + } + +#if !(UNITY_6000_0_OR_NEWER && d_UnityURP) + RenderTexture.ReleaseTemporary(target); +#endif + + _ReflectionTexture.GenerateMips(); + + Shader.SetGlobalVectorArray(ShaderIDs.s_ReflectionPositionNormal, _ReflectionPositionNormal); + } + + void RenderCamera(ScriptableRenderContext context, Camera camera, Vector3 planeNormal, bool nonObliqueNearSurface, int slice) + { + // Find out the reflection plane: position and normal in world space + var planePosition = _Water.Position; + + var offset = _ClipPlaneOffset; + { + var viewpoint = _CameraViewpoint.transform; + if (offset == 0f && viewpoint.position.y == planePosition.y) + { + // Minor offset to prevent "Screen position out of view frustum". Smallest number + // to work with both above and below. Smallest number to work with both above and + // below. Could be BIRP only. + offset = 0.00001f; + } + } + + // Reflect camera around reflection plane + var distance = -Vector3.Dot(planeNormal, planePosition) - offset; + var reflectionPlane = new Vector4(planeNormal.x, planeNormal.y, planeNormal.z, distance); + + var reflection = Matrix4x4.zero; + CalculateReflectionMatrix(ref reflection, reflectionPlane); + + camera.worldToCameraMatrix = _CameraViewpoint.worldToCameraMatrix * reflection; + + // Setup oblique projection matrix so that near plane is our reflection + // plane. This way we clip everything below/above it for free. + var clipPlane = CameraSpacePlane(camera, planePosition, planeNormal, 1.0f); + + if (_UseObliqueMatrix && (!nonObliqueNearSurface || Mathf.Abs(_CameraViewpoint.transform.position.y - planePosition.y) > _NonObliqueNearSurfaceThreshold)) + { + camera.projectionMatrix = _CameraViewpoint.CalculateObliqueMatrix(clipPlane); + } + + // Set custom culling matrix from the current camera + camera.cullingMatrix = _CameraViewpoint.projectionMatrix * _CameraViewpoint.worldToCameraMatrix; + + camera.transform.position = reflection.MultiplyPoint(_CameraViewpoint.transform.position); + var euler = _CameraViewpoint.transform.eulerAngles; + camera.transform.eulerAngles = new(-euler.x, euler.y, euler.z); + camera.cullingMatrix = camera.projectionMatrix * camera.worldToCameraMatrix; + + if (SupportsRecursiveRendering) + { + Helpers.RenderCamera(camera, context, slice); + } + else + { + camera.Render(); + } + } + + /// + /// Limit render distance for reflection camera for first 32 layers + /// + /// reflection far clip distance + void ForceDistanceCulling(float farClipPlane) + { + // Cannot use spherical culling with SRPs. Will error. + if (!RenderPipelineHelper.IsLegacy) + { + return; + } + + for (var i = 0; i < _CullDistances.Length; i++) + { + // The culling distance + _CullDistances[i] = farClipPlane; + } + _CameraReflections.layerCullDistances = _CullDistances; + _CameraReflections.layerCullSpherical = true; + } + + void UpdateCameraModes() + { +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + if (_CameraReflections.TryGetComponent(out HDAdditionalCameraData additionalCameraData)) + { + additionalCameraData.clearColorMode = _Sky ? HDAdditionalCameraData.ClearColorMode.Sky : + HDAdditionalCameraData.ClearColorMode.Color; + } + } + else +#endif + { + _CameraReflections.clearFlags = _Sky ? CameraClearFlags.Skybox : CameraClearFlags.Color; + + if (_Sky && _CameraViewpoint.TryGetComponent(out _CameraViewpointSkybox)) + { + if (_CameraReflectionsSkybox == null) + { + _CameraReflectionsSkybox = _CameraReflections.gameObject.AddComponent(); + } + + _CameraReflectionsSkybox.enabled = _CameraViewpointSkybox.enabled; + _CameraReflectionsSkybox.material = _CameraViewpointSkybox.material; + } + else + { + // Destroy otherwise skybox will not render if empty. + Helpers.Destroy(_CameraViewpointSkybox); + } + } + + // Update other values to match current camera. + // Even if we are supplying custom camera&projection matrices, + // some of values are used elsewhere (e.g. skybox uses far plane). + + _CameraReflections.farClipPlane = _CameraViewpoint.farClipPlane; + _CameraReflections.nearClipPlane = _CameraViewpoint.nearClipPlane; + _CameraReflections.orthographic = _CameraViewpoint.orthographic; + _CameraReflections.fieldOfView = _CameraViewpoint.fieldOfView; + _CameraReflections.orthographicSize = _CameraViewpoint.orthographicSize; + _CameraReflections.allowMSAA = _AllowMSAA; + _CameraReflections.aspect = _CameraViewpoint.aspect; + _CameraReflections.useOcclusionCulling = !_DisableOcclusionCulling && _CameraViewpoint.useOcclusionCulling; + _CameraReflections.depthTextureMode = _CameraViewpoint.depthTextureMode; + } + + // On-demand create any objects we need for water + void CreateWaterObjects(Camera currentCamera) + { + var format = _HDR ? RenderTextureFormat.ARGBHalf : RenderTextureFormat.ARGB32; + var stencil = _Stencil ? 24 : 16; + + // Reflection render texture + if (!_ReflectionTexture || _ReflectionTexture.width != _Resolution || _ReflectionTexture.format != format || _ReflectionTexture.depth != stencil) + { + if (_ReflectionTexture) + { + Helpers.Destroy(_ReflectionTexture); + } + + Debug.Assert(SystemInfo.SupportsRenderTextureFormat(format), "Crest: The graphics device does not support the render texture format " + format.ToString()); + _ReflectionTexture = new(_Resolution, _Resolution, stencil, format) + { + name = "_Crest_WaterReflection", + isPowerOfTwo = true, + dimension = TextureDimension.Tex2DArray, + volumeDepth = 2, + useMipMap = true, + autoGenerateMips = false, + filterMode = FilterMode.Trilinear, + }; + _ReflectionTexture.Create(); + } + + // Camera for reflection + if (!_CameraReflections) + { + var go = new GameObject("_Crest_WaterReflectionCamera"); + go.transform.SetParent(_Water.Container.transform, worldPositionStays: true); + _CameraReflections = go.AddComponent(); + _CameraReflections.enabled = false; + _CameraReflections.cullingMask = _Layers; + _CameraReflections.cameraType = CameraType.Reflection; + _CameraReflections.backgroundColor = Color.clear; + + if (RenderPipelineHelper.IsLegacy) + { + _CameraReflections.gameObject.AddComponent(); + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + var additionalCameraData = _CameraReflections.gameObject.AddComponent(); + additionalCameraData.invertFaceCulling = true; + additionalCameraData.defaultFrameSettings = FrameSettingsRenderType.RealtimeReflection; + additionalCameraData.backgroundColorHDR = Color.clear; + additionalCameraData.customRenderingSettings = true; + additionalCameraData.renderingPathCustomFrameSettingsOverrideMask.mask[(uint)FrameSettingsField.CustomPass] = true; + additionalCameraData.renderingPathCustomFrameSettings.SetEnabled(FrameSettingsField.CustomPass, true); + } +#endif + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + var additionalCameraData = _CameraReflections.gameObject.AddComponent(); + additionalCameraData.renderShadows = !_DisableShadows; + additionalCameraData.requiresColorTexture = false; + additionalCameraData.requiresDepthTexture = false; + } +#endif + OnCameraAdded?.Invoke(_CameraReflections); + } + + _CameraReflections.gameObject.hideFlags = _Debug._ShowHiddenObjects ? HideFlags.DontSave : HideFlags.HideAndDontSave; + } + + // Given position/normal of the plane, calculates plane in camera space. + Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal, float sideSign) + { + var offset = _ClipPlaneOffset; + { + var viewpoint = _CameraViewpoint.transform; + if (offset == 0f && viewpoint.position.y == 0f && viewpoint.rotation.eulerAngles.y == 0f) + { + // Minor offset to prevent "Screen position out of view frustum". Smallest number + // to work with both above and below. Smallest number to work with both above and + // below. Could be BIRP only. + offset = 0.00001f; + } + } + + var offsetPos = pos + normal * offset; + var m = cam.worldToCameraMatrix; + var cpos = m.MultiplyPoint(offsetPos); + var cnormal = m.MultiplyVector(normal).normalized * sideSign; + return new(cnormal.x, cnormal.y, cnormal.z, -Vector3.Dot(cpos, cnormal)); + } + + // Calculates reflection matrix around the given plane + static void CalculateReflectionMatrix(ref Matrix4x4 reflectionMat, Vector4 plane) + { + reflectionMat.m00 = 1F - 2F * plane[0] * plane[0]; + reflectionMat.m01 = -2F * plane[0] * plane[1]; + reflectionMat.m02 = -2F * plane[0] * plane[2]; + reflectionMat.m03 = -2F * plane[3] * plane[0]; + + reflectionMat.m10 = -2F * plane[1] * plane[0]; + reflectionMat.m11 = 1F - 2F * plane[1] * plane[1]; + reflectionMat.m12 = -2F * plane[1] * plane[2]; + reflectionMat.m13 = -2F * plane[3] * plane[1]; + + reflectionMat.m20 = -2F * plane[2] * plane[0]; + reflectionMat.m21 = -2F * plane[2] * plane[1]; + reflectionMat.m22 = 1F - 2F * plane[2] * plane[2]; + reflectionMat.m23 = -2F * plane[3] * plane[2]; + + reflectionMat.m30 = 0F; + reflectionMat.m31 = 0F; + reflectionMat.m32 = 0F; + reflectionMat.m33 = 1F; + } + + /// + /// Compute intersection between the frustum far plane and given plane, and return view space + /// position and normal for this horizon line. + /// + static Vector4 ComputeHorizonPositionAndNormal(Camera camera, float positionY, float offset, bool flipped) + { + var position = Vector2.zero; + var normal = Vector2.zero; + + // Set up back points of frustum. + var positionNDC = new NativeArray(4, Allocator.Temp); + var positionWS = new NativeArray(4, Allocator.Temp); + try + { + + var farPlane = camera.farClipPlane; + positionNDC[0] = new(0f, 0f, farPlane); + positionNDC[1] = new(0f, 1f, farPlane); + positionNDC[2] = new(1f, 1f, farPlane); + positionNDC[3] = new(1f, 0f, farPlane); + + // Project out to world. + for (var i = 0; i < positionWS.Length; i++) + { + // Eye parameter works for BIRP. With it we could skip setting matrices. + // In HDRP it doesn't work for XR MP. And completely breaks horizon in XR SPI. + positionWS[i] = camera.ViewportToWorldPoint(positionNDC[i]); + } + + var intersectionsScreen = new NativeArray(2, Allocator.Temp); + // This is only used to disambiguate the normal later. Could be removed if we were + // more careful with point order/indices below. + var intersectionsWorld = new NativeArray(2, Allocator.Temp); + try + { + var count = 0; + + // Iterate over each back point + for (var i = 0; i < 4; i++) + { + // Get next back point, to obtain line segment between them. + var next = (i + 1) % 4; + + // See if one point is above and one point is below sea level - then sign of the two differences + // will be different, and multiplying them will give a negative. + if ((positionWS[i].y - positionY) * (positionWS[next].y - positionY) < 0f) + { + // Proportion along line segment where intersection occurs. + var proportion = Mathf.Abs((positionY - positionWS[i].y) / (positionWS[next].y - positionWS[i].y)); + intersectionsScreen[count] = Vector2.Lerp(positionNDC[i], positionNDC[next], proportion); + intersectionsWorld[count] = Vector3.Lerp(positionWS[i], positionWS[next], proportion); + + count++; + } + } + + // Two distinct results - far plane intersects water. + if (count == 2) + { + position = intersectionsScreen[0]; + var tangent = intersectionsScreen[0] - intersectionsScreen[1]; + normal.x = -tangent.y; + normal.y = tangent.x; + + // Disambiguate the normal. The tangent normal might go from left to right or right + // to left since we do not handle ordering of intersection points. + if (Vector3.Dot(intersectionsWorld[0] - intersectionsWorld[1], camera.transform.right) > 0f) + { + normal = -normal; + } + + // Invert the normal if camera is upside down. + if (camera.transform.up.y <= 0f) + { + normal = -normal; + } + + // The above will sometimes produce a normal that is inverted around 90° along the + // Z axis. Here we are using world up to make sure that water is world down. + { + var cameraFacing = Vector3.Dot(camera.transform.right, Vector3.up); + var normalFacing = Vector2.Dot(normal, Vector2.right); + + if (cameraFacing > 0.75f && normalFacing > 0.9f) + { + normal = -normal; + } + else if (cameraFacing < -0.75f && normalFacing < -0.9f) + { + normal = -normal; + } + } + + // Minor offset helps. + position += normal.normalized * offset; + } + } + finally + { + intersectionsScreen.Dispose(); + intersectionsWorld.Dispose(); + } + } + finally + { + positionNDC.Dispose(); + positionWS.Dispose(); + } + + if (flipped) + { + normal = -normal; + } + + return new(position.x, position.y, normal.x, normal.y); + } + + void SetEnabled(bool previous, bool current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled) return; + if (_Enabled) OnEnable(); else OnDisable(); + } + +#if UNITY_EDITOR + [@OnChange] + void OnChange(string propertyPath, object previousValue) + { + switch (propertyPath) + { + case nameof(_Enabled): + SetEnabled((bool)previousValue, _Enabled); + break; + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterReflections.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterReflections.cs.meta new file mode 100644 index 0000000..8b3c7dc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Surface/WaterReflections.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8b8696e988b24f1e832400fdd148451 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 205 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time.meta new file mode 100644 index 0000000..3dea69b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9756ec4e98fa3457ba3c63c6707c12ca +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CustomTimeProvider.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CustomTimeProvider.cs new file mode 100644 index 0000000..9173879 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CustomTimeProvider.cs @@ -0,0 +1,129 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// This time provider fixes the water time at a custom value which is usable for testing/debugging. + /// + [AddComponentMenu(Constants.k_MenuPrefixTime + "Custom Time Provider")] + [@HelpURL("Manual/TimeProviders.html#supporting-pause")] + public sealed partial class CustomTimeProvider : TimeProvider + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Tooltip("Freeze progression of time. Only works properly in Play mode.")] + [@GenerateAPI] + [SerializeField] + bool _Paused = false; + + [Tooltip("Whether to override the water simulation time.")] + [@GenerateAPI] + [SerializeField] + bool _OverrideTime = false; + + [Tooltip("The time override value.")] + [@Predicated(nameof(_OverrideTime))] + [@GenerateAPI(name: "TimeOverride")] + [@DecoratedField, SerializeField] + float _Time = 0f; + + [Tooltip("Whether to override the water simulation time.\n\nThis in particular affects dynamic elements of the simulation like the foam simulation and the ripple simulation.")] + [@GenerateAPI] + [SerializeField] + bool _OverrideDeltaTime = false; + + [Tooltip("The delta time override value.")] + [@Predicated(nameof(_OverrideDeltaTime))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _DeltaTime = 0f; + + + readonly DefaultTimeProvider _DefaultTimeProvider = new(); + float _TimeInternal = 0f; + bool _FirstUpdate = true; + + private protected override void Initialize() + { + base.Initialize(); + _FirstUpdate = true; + } + + private protected override System.Action OnUpdateMethod => OnUpdate; + + void OnUpdate(WaterRenderer water) + { + // Use default TP delta time to update our time, because this dt works + // well in edit mode + if (_FirstUpdate) + { + _TimeInternal = _DefaultTimeProvider.Time; + +#if UNITY_EDITOR + if (!Application.isPlaying) + { + _TimeInternal += _DefaultTimeProvider.Delta; + } +#endif + + _FirstUpdate = false; + } + else if (!_Paused) + { + _TimeInternal += _DefaultTimeProvider.Delta; + } + } + + /// + public override float Time + { + get + { + if (!isActiveAndEnabled) + { + return _DefaultTimeProvider.Time; + } + + // Override means override + if (_OverrideTime) + { + return _Time; + } + + // Otherwise use our accumulated time + return _TimeInternal; + } + } + + // Either use override, or the default TP which works in edit mode + /// + public override float Delta + { + get + { + if (!isActiveAndEnabled) + { + return _DefaultTimeProvider.Delta; + } + + if (_Paused) + { + return 0f; + } + + if (_OverrideDeltaTime) + { + return _DeltaTime; + } + + return _DefaultTimeProvider.Delta; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CustomTimeProvider.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CustomTimeProvider.cs.meta new file mode 100644 index 0000000..e510f05 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CustomTimeProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc21fdc0db7e149fdb0391bc461bcd87 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CutsceneTimeProvider.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CutsceneTimeProvider.cs new file mode 100644 index 0000000..f0b28b7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CutsceneTimeProvider.cs @@ -0,0 +1,113 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Playables; + +namespace WaveHarmonic.Crest +{ + /// + /// This time provider feeds a Timeline time to the water system, using a Playable Director. + /// + [AddComponentMenu(Constants.k_MenuPrefixTime + "Cutscene Time Provider")] + [@HelpURL("Manual/TimeProviders.html#timelines-and-cutscenes")] + public sealed partial class CutsceneTimeProvider : TimeProvider + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if d_ModuleUnityDirector + [Tooltip("Playable Director to take time from.")] + [@GenerateAPI(symbol: "d_ModuleUnityDirector")] + [SerializeField] + internal PlayableDirector _PlayableDirector; +#endif + + [Tooltip("Time offset which will be added to the Timeline time.")] + [@GenerateAPI] + [SerializeField] + float _TimeOffset = 0f; + + [Tooltip("Assign this time provider to the water system when this component becomes active.")] + [@GenerateAPI] + [SerializeField] + bool _AssignToWaterComponentOnEnable = true; + + [Tooltip("Restore the time provider that was previously assigned to water system when this component disables.")] + [@GenerateAPI] + [SerializeField] + bool _RestorePreviousTimeProviderOnDisable = true; + + readonly DefaultTimeProvider _FallbackTimeProvider = new(); + bool _Attached = false; + + private protected override void OnDisable() + { + base.OnDisable(); + + var water = WaterRenderer.Instance; + if (_RestorePreviousTimeProviderOnDisable && _Attached && water != null) + { + water.TimeProviders.Pop(this); + } + + _Attached = false; + } + + private protected override System.Action OnEnableMethod => Attach; + void Attach(WaterRenderer water) + { + if (_Attached) return; + +#if d_ModuleUnityDirector + if (_PlayableDirector == null) return; +#endif + + if (_AssignToWaterComponentOnEnable && water) + { + water.TimeProviders.Push(this); + } + + _Attached = true; + } + + /// + /// If there is a PlayableDirector which is playing, return its time, otherwise use + /// the being used before this component initialised, + /// else fallback to a default . + /// + /// + public override float Time + { + get + { +#if d_ModuleUnityDirector + if (_PlayableDirector != null + && _PlayableDirector.isActiveAndEnabled + && (!Application.isPlaying || _PlayableDirector.state == PlayState.Playing)) + { + return (float)_PlayableDirector.time + _TimeOffset; + } +#endif + + // Use a fallback TP + return _FallbackTimeProvider.Time; + } + } + + /// + public override float Delta => UnityEngine.Time.deltaTime; + +#if UNITY_EDITOR + [@OnChange] + void OnChange(string propertyPath, object previousValue) + { + if (!isActiveAndEnabled) return; + // Try to attach on change. + Attach(WaterRenderer.Instance); + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CutsceneTimeProvider.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CutsceneTimeProvider.cs.meta new file mode 100644 index 0000000..c272cb6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/CutsceneTimeProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6d1a5ea192714d488d3edff0cdfc51f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/DefaultTimeProvider.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/DefaultTimeProvider.cs new file mode 100644 index 0000000..cac6bf3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/DefaultTimeProvider.cs @@ -0,0 +1,51 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +namespace WaveHarmonic.Crest +{ + /// + /// Default time provider - sets the water time to Unity's game time. + /// + sealed class DefaultTimeProvider : ITimeProvider + { + public float Time + { + get + { +#if UNITY_EDITOR + if (UnityEngine.Application.isPlaying) + { + return UnityEngine.Time.time; + } + else + { + return WaterRenderer.EditorTime; + } +#else + return UnityEngine.Time.time; +#endif + } + } + + public float Delta + { + get + { +#if UNITY_EDITOR + if (UnityEngine.Application.isPlaying) + { + return UnityEngine.Time.deltaTime; + } + else + { + return WaterRenderer.EditorDeltaTime; + } +#else + return UnityEngine.Time.deltaTime; +#endif + ; + } + + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/DefaultTimeProvider.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/DefaultTimeProvider.cs.meta new file mode 100644 index 0000000..aae9605 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/DefaultTimeProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8182878ea3609401dbda036c252b24da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/NetworkedTimeProvider.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/NetworkedTimeProvider.cs new file mode 100644 index 0000000..33a5b00 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/NetworkedTimeProvider.cs @@ -0,0 +1,39 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Gives a time to Crest with a custom time offset. + /// + /// + /// Assign this component to the component and set the + /// property of this component to the delta from + /// this client's time to the shared server time. + /// + [AddComponentMenu(Constants.k_MenuPrefixTime + "Networked Time Provider")] + [@HelpURL("Manual/TimeProviders.html#network-synchronisation")] + public sealed class NetworkedTimeProvider : TimeProvider + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + /// + /// If Time.time on this client is 1.5s ahead of the shared/server Time.time, set + /// this field to -1.5. + /// + public float TimeOffsetToServer { get; set; } + + readonly DefaultTimeProvider _DefaultTimeProvider = new(); + + /// + public override float Time => _DefaultTimeProvider.Time + TimeOffsetToServer; + + /// + public override float Delta => _DefaultTimeProvider.Delta; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/NetworkedTimeProvider.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/NetworkedTimeProvider.cs.meta new file mode 100644 index 0000000..003a7d9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/NetworkedTimeProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a678a2450d1c34c838e465cc0581d0f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/TimeProvider.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/TimeProvider.cs new file mode 100644 index 0000000..7f773ff --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/TimeProvider.cs @@ -0,0 +1,38 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// Base class for scripts that provide the time to the water system. + /// + /// + /// See derived classes for examples. + /// + public interface ITimeProvider + { + /// + /// Current time. + /// + float Time { get; } + + /// + /// Delta time. + /// + float Delta { get; } + } + + /// + [@ExecuteDuringEditMode] + [@HelpURL("Manual/TimeProviders.html")] + public abstract class TimeProvider : ManagedBehaviour, ITimeProvider + { + /// + public abstract float Time { get; } + + /// + public abstract float Delta { get; } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/TimeProvider.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/TimeProvider.cs.meta new file mode 100644 index 0000000..568ef22 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Time/TimeProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f4dfdc79ebe2543e1a48acb408acec16 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Uniforms.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Uniforms.cs new file mode 100644 index 0000000..710bb7f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Uniforms.cs @@ -0,0 +1,58 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + static class ShaderIDs + { + public static readonly int s_Blend = Shader.PropertyToID("_Crest_Blend"); + public static readonly int s_Texture = Shader.PropertyToID("_Crest_Texture"); + public static readonly int s_Source = Shader.PropertyToID("_Crest_Source"); + public static readonly int s_Target = Shader.PropertyToID("_Crest_Target"); + public static readonly int s_TargetSlice = Shader.PropertyToID("_Crest_TargetSlice"); + public static readonly int s_Resolution = Shader.PropertyToID("_Crest_Resolution"); + public static readonly int s_ClearMask = Shader.PropertyToID("_Crest_ClearMask"); + public static readonly int s_ClearColor = Shader.PropertyToID("_Crest_ClearColor"); + public static readonly int s_Matrix = Shader.PropertyToID("_Crest_Matrix"); + public static readonly int s_Position = Shader.PropertyToID("_Crest_Position"); + public static readonly int s_Diameter = Shader.PropertyToID("_Crest_Diameter"); + public static readonly int s_TextureSize = Shader.PropertyToID("_Crest_TextureSize"); + public static readonly int s_TexturePosition = Shader.PropertyToID("_Crest_TexturePosition"); + public static readonly int s_TextureRotation = Shader.PropertyToID("_Crest_TextureRotation"); + public static readonly int s_Multiplier = Shader.PropertyToID("_Crest_Multiplier"); + public static readonly int s_FeatherWidth = Shader.PropertyToID("_Crest_FeatherWidth"); + public static readonly int s_NegativeValues = Shader.PropertyToID("_Crest_NegativeValues"); + public static readonly int s_BoundaryXZ = Shader.PropertyToID("_Crest_BoundaryXZ"); + public static readonly int s_DrawBoundaryXZ = Shader.PropertyToID("_Crest_DrawBoundaryXZ"); + + public static class Unity + { + public static readonly int s_CameraDepthTexture = Shader.PropertyToID("_CameraDepthTexture"); + public static readonly int s_CameraOpaqueTexture = Shader.PropertyToID("_CameraOpaqueTexture"); + public static readonly int s_MatrixPreviousM = Shader.PropertyToID("unity_MatrixPreviousM"); + public static readonly int s_SpecCube0 = Shader.PropertyToID("unity_SpecCube0"); + public static readonly int s_Time = Shader.PropertyToID("_Time"); + public static readonly int s_CameraToWorld = Shader.PropertyToID("_CameraToWorld"); + + + // Shader Graph + public static readonly int s_Surface = Shader.PropertyToID("_Surface"); + public static readonly int s_SrcBlend = Shader.PropertyToID("_SrcBlend"); + public static readonly int s_DstBlend = Shader.PropertyToID("_DstBlend"); + + + // Built-In Renderer + public static readonly int s_LightColor0 = Shader.PropertyToID("_LightColor0"); + public static readonly int s_ShadowMapTexture = Shader.PropertyToID("_ShadowMapTexture"); + public static readonly int s_WorldSpaceLightPos0 = Shader.PropertyToID("_WorldSpaceLightPos0"); + + // High Definition Renderer + public static readonly int s_ShaderVariablesGlobal = Shader.PropertyToID("ShaderVariablesGlobal"); + + // Universal Renderer + public static readonly int s_GlossyEnvironmentCubeMap = Shader.PropertyToID("_GlossyEnvironmentCubeMap"); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Uniforms.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Uniforms.cs.meta new file mode 100644 index 0000000..bbe56a8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Uniforms.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b65f1bb757bdd47d987dee81752d8024 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility.meta new file mode 100644 index 0000000..40123a3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7ccb919066373432cafaa06d177818b0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges.meta new file mode 100644 index 0000000..e6ba583 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9705fd80c227847b1b2c21279a353316 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core.meta new file mode 100644 index 0000000..a0415bf --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea1d66a23f2124e3fb17b3757e01830f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime.meta new file mode 100644 index 0000000..4493221 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d764a27488d3b482484398a22b49f139 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/Assembly.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/Assembly.cs new file mode 100644 index 0000000..c9debe0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/Assembly.cs @@ -0,0 +1,7 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Shared")] diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/Assembly.cs.meta new file mode 100644 index 0000000..e4c8039 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9d248516e9d84702a7da49167649f40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/WaveHarmonic.Crest.Bridge.asmref b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/WaveHarmonic.Crest.Bridge.asmref new file mode 100644 index 0000000..0319582 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/WaveHarmonic.Crest.Bridge.asmref @@ -0,0 +1,3 @@ +{ + "reference": "GUID:df380645f10b7bc4b97d4f5eb6303d95" +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta new file mode 100644 index 0000000..630e0fc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Core/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9a761b4f3cc5b4e468121ec3c51dda5a +AssemblyDefinitionReferenceImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition.meta new file mode 100644 index 0000000..ef56107 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d75412fa9c7c743ddb0bc94b3a5c7622 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime.meta new file mode 100644 index 0000000..53a7415 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5be9f1155ece744ac9b4e52aa05d7ef9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/Assembly.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/Assembly.cs new file mode 100644 index 0000000..62ec800 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/Assembly.cs @@ -0,0 +1,6 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest")] diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/Assembly.cs.meta new file mode 100644 index 0000000..804544c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8af62055026f246e7a9d675f69b994d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/WaveHarmonic.Crest.Bridge.asmref b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/WaveHarmonic.Crest.Bridge.asmref new file mode 100644 index 0000000..c232c2f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/WaveHarmonic.Crest.Bridge.asmref @@ -0,0 +1,3 @@ +{ + "reference": "GUID:457756d89b35d2941b3e7b37b4ece6f1" +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta new file mode 100644 index 0000000..19548d7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.HighDefinition/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c358b569712814645b33be93fdc16c4d +AssemblyDefinitionReferenceImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal.meta new file mode 100644 index 0000000..81ae1bd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b91042832cea4543b4c617e5ee9501b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime.meta new file mode 100644 index 0000000..48929a4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f9a650914f9e44519ab747c4366060de +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/Assembly.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/Assembly.cs new file mode 100644 index 0000000..c9debe0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/Assembly.cs @@ -0,0 +1,7 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Shared")] diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/Assembly.cs.meta new file mode 100644 index 0000000..7670bf8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46afa615b9e4b409481f591af6c8d671 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/WaveHarmonic.Crest.Bridge.asmref b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/WaveHarmonic.Crest.Bridge.asmref new file mode 100644 index 0000000..cb3b0b0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/WaveHarmonic.Crest.Bridge.asmref @@ -0,0 +1,3 @@ +{ + "reference": "GUID:15fc0a57446b3144c949da3e2b9737a9" +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta new file mode 100644 index 0000000..96804be --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Bridges/Unity.RenderPipelines.Universal/Runtime/WaveHarmonic.Crest.Bridge.asmref.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6c91763ce81814a8cb7f57f7e18525bb +AssemblyDefinitionReferenceImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/QualitySettingsOverride.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/QualitySettingsOverride.cs new file mode 100644 index 0000000..cc1b1f4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/QualitySettingsOverride.cs @@ -0,0 +1,109 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// Overrides global quality settings. + /// + [System.Serializable] + public sealed partial class QualitySettingsOverride + { + [Tooltip("Whether to override the LOD bias.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _OverrideLodBias; + + [Tooltip("Overrides the LOD bias for meshes.\n\nHighest quality is infinity.")] + [@Predicated(nameof(_OverrideLodBias))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal float _LodBias; + + [Tooltip("Whether to override the maximum LOD level.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _OverrideMaximumLodLevel; + + [Tooltip("Overrides the maximum LOD level.\n\nHighest quality is zero.")] + [@Predicated(nameof(_OverrideMaximumLodLevel))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal int _MaximumLodLevel; + + + [Tooltip("Whether to override the terrain pixel error.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal bool _OverrideTerrainPixelError; + + [Tooltip("Overrides the pixel error value for terrains.\n\nHighest quality is zero.")] + [@Predicated(nameof(_OverrideTerrainPixelError))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + internal float _TerrainPixelError; + + float _OldLodBias; + int _OldMaximumLodLevelOverride; + float _OldTerrainPixelError; + TerrainQualityOverrides _OldTerrainOverrides; + + internal void Override() + { + if (_OverrideLodBias) + { + _OldLodBias = QualitySettings.lodBias; + QualitySettings.lodBias = _LodBias; + } + + if (_OverrideMaximumLodLevel) + { + _OldMaximumLodLevelOverride = QualitySettings.maximumLODLevel; + QualitySettings.maximumLODLevel = _MaximumLodLevel; + } + + if (_OverrideTerrainPixelError) + { + _OldTerrainOverrides = QualitySettings.terrainQualityOverrides; + _OldTerrainPixelError = QualitySettings.terrainPixelError; + QualitySettings.terrainQualityOverrides = TerrainQualityOverrides.PixelError; + QualitySettings.terrainPixelError = _TerrainPixelError; + } + } + + internal void Restore() + { + if (_OverrideLodBias) + { + QualitySettings.lodBias = _OldLodBias; + } + + if (_OverrideMaximumLodLevel) + { + QualitySettings.maximumLODLevel = _OldMaximumLodLevelOverride; + } + + if (_OverrideTerrainPixelError) + { + QualitySettings.terrainQualityOverrides = _OldTerrainOverrides; + QualitySettings.terrainPixelError = _OldTerrainPixelError; + } + } + + /// + public override int GetHashCode() + { + var hash = Hash.CreateHash(); + Hash.AddBool(_OverrideLodBias, ref hash); + Hash.AddFloat(_LodBias, ref hash); + Hash.AddBool(_OverrideMaximumLodLevel, ref hash); + Hash.AddInt(_MaximumLodLevel, ref hash); + Hash.AddBool(_OverrideTerrainPixelError, ref hash); + Hash.AddFloat(_TerrainPixelError, ref hash); + return hash; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/QualitySettingsOverride.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/QualitySettingsOverride.cs.meta new file mode 100644 index 0000000..5e60c67 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/QualitySettingsOverride.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c534680c2c3c4912bfabb90bfa03574 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared.meta new file mode 100644 index 0000000..96dd0c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 37d8168c36cf74fdea3eef047313d378 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Assembly.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Assembly.cs new file mode 100644 index 0000000..17f172b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Assembly.cs @@ -0,0 +1,32 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Shared.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Examples")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Ripples")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Submarine")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.CPUQueries")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.CPUQueries.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Paint")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Paint.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShallowWater")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShallowWater.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShiftingOrigin")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.ShiftingOrigin.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Splines")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Splines.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Watercraft")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Watercraft.Editor")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Whirlpool")] +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Whirlpool.Editor")] + +// Define empty namespaces for when assemblies are not present. +namespace UnityEditor.SceneManagement { } +namespace UnityEngine.Rendering.HighDefinition { } +namespace UnityEngine.Rendering.Universal { } diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Assembly.cs.meta new file mode 100644 index 0000000..7987a62 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e4f89cf7fe52246cb883953865c0ae55 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections.meta new file mode 100644 index 0000000..d7564a7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c01e8ab7829a9475d86ca9975ce640aa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/BufferedData.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/BufferedData.cs new file mode 100644 index 0000000..2e4a090 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/BufferedData.cs @@ -0,0 +1,49 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using UnityEngine; + +namespace WaveHarmonic.Crest.Utility +{ + /// + /// Circular buffer to store a multiple sets of data. + /// + sealed class BufferedData + { + readonly T[] _Buffers; + int _CurrentFrameIndex; + + public T Current { get => _Buffers[_CurrentFrameIndex]; set => _Buffers[_CurrentFrameIndex] = value; } + public int Size => _Buffers.Length; + + public BufferedData(int size, Func initialize) + { + _Buffers = new T[size]; + + for (var i = 0; i < size; i++) + { + _Buffers[i] = initialize(); + } + } + + public T Previous(int framesBack) + { + Debug.Assert(framesBack >= 0 && framesBack < _Buffers.Length); + return _Buffers[(_CurrentFrameIndex - framesBack + _Buffers.Length) % _Buffers.Length]; + } + + public void Flip() + { + _CurrentFrameIndex = (_CurrentFrameIndex + 1) % _Buffers.Length; + } + + public void RunLambda(Action lambda) + { + foreach (var buffer in _Buffers) + { + lambda(buffer); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/BufferedData.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/BufferedData.cs.meta new file mode 100644 index 0000000..0c090cc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/BufferedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c5666bcd450914e3e980a32dd866957e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/SortedList.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/SortedList.cs new file mode 100644 index 0000000..0bbd083 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/SortedList.cs @@ -0,0 +1,119 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections; +using System.Collections.Generic; + +namespace WaveHarmonic.Crest.Utility +{ + /// + /// This is a list this is meant to be similar in behaviour to the C# + /// SortedList, but without allocations when used directly in a foreach loop. + /// + /// It works by using a regular list as as backing and ensuring that it is + /// sorted when the enumerator is accessed and used. This is a simple approach + /// that means we avoid sorting each time an element is added, and helps us + /// avoid having to develop our own more complex data structure. + /// + sealed class SortedList : IEnumerable>, IEnumerable + { + public int Count => _BackingList.Count; + + readonly List> _BackingList = new(); + readonly System.Comparison _Comparison; + bool _NeedsSorting = false; + + int Comparison(KeyValuePair x, KeyValuePair y) + { + return _Comparison(x.Key, y.Key); + } + + public SortedList(System.Comparison comparison) + { + // We provide the only constructors that SortedList provides that + // we need. We wrap the input IComparer to ensure that our backing list + // is sorted in the same way a SortedList would be with the same one. + _Comparison = comparison; + } + + public void Add(TKey key, TValue value) + { + _BackingList.Add(new(key, value)); + _NeedsSorting = true; + } + + public bool Contains(TValue value) + { + foreach (var item in _BackingList) + { + if (item.Value.Equals(value)) return true; + } + + return false; + } + + public bool Remove(TValue value) + { + // This remove function has a fairly high complexity, as we need to search + // the list for a matching Key-Value pair, and then remove it. However, + // for the small lists we work with this is fine, as we don't use this + // function more often. But it's worth bearing in mind if we decide to + // expand where we use this list. At that point we might need to take a + // different approach. + + var removeIndex = -1; + var index = 0; + foreach (var item in _BackingList) + { + if (item.Value.Equals(value)) + { + removeIndex = index; + } + + index++; + } + + if (removeIndex > -1) + { + // Remove method produces garbage. + _BackingList.RemoveAt(removeIndex); + } + + return removeIndex > -1; + } + + public void Clear() + { + _BackingList.Clear(); + _NeedsSorting = false; + } + + #region GetEnumerator + public List>.Enumerator GetEnumerator() + { + ResortArrays(); + return _BackingList.GetEnumerator(); + } + + IEnumerator> IEnumerable>.GetEnumerator() + { + return GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + #endregion + + void ResortArrays() + { + if (_NeedsSorting) + { + // @GC: Allocates 112B. + _BackingList.Sort(Comparison); + } + _NeedsSorting = false; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/SortedList.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/SortedList.cs.meta new file mode 100644 index 0000000..7eb452a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/SortedList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f796ed8d9971b4795b28bcb1c4dc3a01 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/Stack.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/Stack.cs new file mode 100644 index 0000000..decdfcc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/Stack.cs @@ -0,0 +1,58 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEngine; + +namespace WaveHarmonic.Crest.Utility.Internal +{ + /// + /// A less rigid stack implementation which is easier to use. Prevents duplicates. + /// + /// Type to store. + public sealed class Stack + { + readonly List _Items = new(); + + internal Stack() { } + + /// + /// Add item to the end of the stack. + /// + /// Item to add. + public void Push(T item) + { + Debug.Assert(item != null, "Null item pushed"); + // Remove any instances of item already in the stack. + Pop(item); + // Add it to the top. + _Items.Add(item); + } + + /// + /// Removes all instances of item. + /// + /// The item to be removed. + public void Pop(T item) + { + Debug.Assert(item != null, "Null item popped"); + _Items.RemoveAll(candidate => candidate.Equals(item)); + } + + /// + /// Returns the object at the top of the Stack without removing it. + /// + /// Object at the top of the Stack. + public T Peek() => _Items[^1]; + + /// + /// Number of items. + /// + public int Count => _Items.Count; + + internal void Clear() + { + _Items.Clear(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/Stack.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/Stack.cs.meta new file mode 100644 index 0000000..60b5f25 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Collections/Stack.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0c68f77a1b8b43359f34cb46ce19801 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component.meta new file mode 100644 index 0000000..0d7ee12 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b9f06a06d4570449fbc0c55e262f5ea9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/Attributes.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/Attributes.cs new file mode 100644 index 0000000..ca555c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/Attributes.cs @@ -0,0 +1,257 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma warning disable IDE0005 // Using directive is unnecessary. + +using System; +using System.Diagnostics; +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + static class Symbols + { + public const string k_UnityEditor = "UNITY_EDITOR"; + } + + [Conditional(Symbols.k_UnityEditor)] + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] + sealed class ExecuteDuringEditMode : Attribute + { + [Flags] + public enum Include + { + None, + PrefabStage, + BuildPipeline, + All = PrefabStage | BuildPipeline, + } + + [Flags] + public enum Options + { + None, + Singleton, + } + + public Include _Including; + public Options _Options; + + public ExecuteDuringEditMode(Include including = Include.PrefabStage, Options options = Options.None) + { + _Including = including; + _Options = options; + } + } + + enum Getter + { + Default, + Custom, + } + + enum Setter + { + Default, + Custom, + Internal, + Dirty, + None, + } + + [Conditional(Symbols.k_UnityEditor)] + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)] + sealed class GenerateAPI : Attribute + { + public readonly Getter _Getter; + public readonly Setter _Setter; + public readonly string _Name; + public readonly string _ScriptingSymbol; + + public GenerateAPI(Getter getter = Getter.Default, Setter setter = Setter.Default, string name = null, string symbol = null) + { + _Getter = getter; + _Setter = setter; + _Name = name; + _ScriptingSymbol = symbol; + } + + public GenerateAPI(Setter setter, string name = null, string symbol = null) + { + _Setter = setter; + _Name = name; + _ScriptingSymbol = symbol; + } + } + + [Conditional(Symbols.k_UnityEditor)] + [AttributeUsage(AttributeTargets.Enum, AllowMultiple = false, Inherited = false)] + sealed class GenerateDoc : Attribute + { + public GenerateDoc() + { + + } + } + +#if !UNITY_EDITOR + + [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] + abstract class Decorator : PropertyAttribute { } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Layer : Decorator { } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Stripped : Decorator { } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Delayed : Decorator { } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Disabled : Decorator { } + + [Conditional(Symbols.k_UnityEditor)] + sealed class AttachMaterialEditor : Attribute + { + public AttachMaterialEditor(int order = 0) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class InlineToggle : Decorator + { + public InlineToggle(bool fix = false) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Embedded : Decorator + { + public Embedded(int margin = 0, string defaultPropertyName = null) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class DecoratedField : Decorator + { + public DecoratedField(bool isCustomFoldout = false) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Group : Decorator + { + public enum Style { None, Foldout, Accordian, } + public Group(string title = null, Style style = Style.Foldout, bool isCustomFoldout = false) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Stepped : Decorator + { + public Stepped(int minimum, int maximum, int step = 1, bool power = false) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Range : Decorator + { + [Flags] + public enum Clamp { None = 0, Minimum = 1, Maximum = 2, Both = Minimum | Maximum } + public Range(float minimum, float maximum, Clamp clamp = Clamp.Both, float scale = 1f, bool delayed = false, int step = 0, bool power = false) {} + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Minimum : Decorator + { + public Minimum(float minimum) {} + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Maximum : Decorator + { + public Maximum(float maximum) {} + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class WarnIfAbove : Decorator + { + public WarnIfAbove(float maximum) {} + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Filtered : Decorator + { + public enum Mode { Include, Exclude, } + public Filtered(int unset = 0) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class FilterEnum : Decorator + { + public FilterEnum(string property, Filtered.Mode mode, params int[] values) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Label : Decorator + { + public Label(string label) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Heading : Decorator + { + public enum Style { Normal, Settings, } + public Heading(string heading, Style style = Style.Normal, bool alwaysVisible = false, bool alwaysEnabled = false, string helpLink = null) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Space : Decorator + { + public Space(float height, bool isAlwaysVisible = false) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class Predicated : Decorator + { + public Predicated(Type type, string member, bool inverted = false, bool hide = false) { } + public Predicated(Type type, bool inverted = false, bool hide = false) { } + public Predicated(string property, bool inverted = false, object disableValue = null, bool hide = false) { } + public Predicated(RenderPipeline rp, bool inverted = false, bool hide = false) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class OnChange : Decorator + { + public OnChange(bool skipIfInactive = true) { } + public OnChange(Type type, bool skipIfInactive = true) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class HelpURL : Decorator + { + public HelpURL(string path = "") { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class HelpBox : Decorator + { + public enum MessageType { Info, Warning, Error, } + public enum Visibility { Always, PropertyEnabled, PropertyDisabled, } + public HelpBox(string message, MessageType messageType = MessageType.Info, Visibility visibility = Visibility.Always) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class MaterialField : Decorator + { + public MaterialField(string shader, string title = "", string name = "", string parent = null) { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class PrefabField : Decorator + { + public PrefabField(string title = "", string name = "") { } + } + + [Conditional(Symbols.k_UnityEditor)] + sealed class ShowComputedProperty : Decorator + { + public ShowComputedProperty(string name) { } + } +#endif +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/Attributes.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/Attributes.cs.meta new file mode 100644 index 0000000..74cfa5e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/Attributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10b67a4d95adf4592abe527745be027b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/CustomBehaviour.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/CustomBehaviour.cs new file mode 100644 index 0000000..d56fea9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/CustomBehaviour.cs @@ -0,0 +1,81 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if UNITY_EDITOR +using UnityEditor; +using UnityEngine; +using MonoBehaviour = WaveHarmonic.Crest.Internal.EditorBehaviour; +#else +using MonoBehaviour = UnityEngine.MonoBehaviour; +#endif + +namespace WaveHarmonic.Crest.Internal +{ + /// + /// Implements logic to smooth out Unity's wrinkles. + /// + public abstract class CustomBehaviour : MonoBehaviour + { + bool _AfterStart; + +#pragma warning disable 114 + private protected virtual void Awake() + { +#if UNITY_EDITOR + base.Awake(); +#endif + } + + /// + /// Unity's Start method. Make sure to call base if overriden. + /// + protected void Start() + { + _AfterStart = true; + +#if UNITY_EDITOR + base.Start(); + if (!enabled) return; +#endif + + OnStart(); + } +#pragma warning restore 114 + + /// + /// Called in OnEnable only after Start has ran. + /// + private protected virtual void Initialize() + { + + } + + /// + /// Replaces Start. Only called in the editor if passes validation. + /// + private protected virtual void OnStart() + { + Initialize(); + } + + /// + /// Unity's OnEnable method. Make sure to call base if overriden. + /// + private protected virtual void OnEnable() + { + if (!_AfterStart) return; + Initialize(); + } + +#if UNITY_EDITOR + [InitializeOnEnterPlayMode] + static void OnEnterPlayModeInEditor(EnterPlayModeOptions options) + { + foreach (var @object in FindObjectsByType(FindObjectsInactive.Include, FindObjectsSortMode.None)) + { + @object._AfterStart = false; + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/CustomBehaviour.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/CustomBehaviour.cs.meta new file mode 100644 index 0000000..a893b17 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/CustomBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 636b808a07ad9446c84091c05f393663 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/EditorBehaviour.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/EditorBehaviour.cs new file mode 100644 index 0000000..af1def4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/EditorBehaviour.cs @@ -0,0 +1,194 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +#if UNITY_EDITOR + +using System.Reflection; +using UnityEditor; +using UnityEditor.SceneManagement; + +namespace WaveHarmonic.Crest.Internal +{ + using Include = ExecuteDuringEditMode.Include; + + /// + /// Implements custom behaviours common to all components. + /// + public abstract partial class EditorBehaviour : MonoBehaviour + { + bool _IsFirstOnValidate = true; + internal bool _IsPrefabStageInstance; + + private protected virtual bool CanRunInEditMode => true; + + private protected virtual void Awake() + { + // Prevents allocations. + useGUILayout = false; + + // When copy and pasting from one scene to another, destroy instance objects as + // they will have bad state. + foreach (var generated in transform.GetComponentsInChildren(includeInactive: true)) + { + if (generated.Owner == this) + { + Helpers.Destroy(generated.gameObject); + } + } + } + + /// + /// Start method. Must be called if overriden. + /// + private protected virtual void Start() + { + if (Application.isPlaying && !(bool)s_ExecuteValidators.Invoke(null, new object[] { this })) + { + enabled = false; + } + } + + // Unity does not call OnDisable/OnEnable on Reset. + private protected virtual void Reset() + { + if (!enabled) return; + enabled = false; + enabled = true; + } + + /// + /// OnValidate method. Must be called if overriden. + /// + private protected virtual void OnValidate() + { + if (Application.isPlaying) + { + return; + } + + if (!CanRunInEditMode) + { + return; + } + + if (_IsFirstOnValidate) + { + var attribute = Helpers.GetCustomAttribute(GetType()); + + var enableInEditMode = attribute != null; + + if (enableInEditMode && !attribute._Including.HasFlag(Include.BuildPipeline)) + { + // Do not execute when building the player. + enableInEditMode = !BuildPipeline.isBuildingPlayer; + } + + // Components that use the singleton pattern are candidates for not executing in the prefab stage + // as a new instance will be created which could interfere with the scene stage instance. + if (enableInEditMode && !attribute._Including.HasFlag(Include.PrefabStage)) + { + var stage = PrefabStageUtility.GetCurrentPrefabStage(); + _IsPrefabStageInstance = stage != null && gameObject.scene == stage.scene; + + // Do not execute in prefab stage. + enableInEditMode = !_IsPrefabStageInstance; + } + + // When singleton, destroy instance objects. + if (enableInEditMode && attribute._Options.HasFlag(ExecuteDuringEditMode.Options.Singleton) && + FindObjectsByType(GetType(), FindObjectsSortMode.None).Length > 1) + { + enableInEditMode = false; + EditorApplication.update -= InternalDestroyNonSaveables; + EditorApplication.update += InternalDestroyNonSaveables; + } + + // runInEditMode will immediately call Awake and OnEnable so we must not do this in OnValidate as there + // are many restrictions which Unity will produce warnings for: + // https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnValidate.html + if (enableInEditMode) + { + if (BuildPipeline.isBuildingPlayer) + { + // EditorApplication.update and Invoke are not called when building. + InternalEnableEditMode(); + } + else + { + // Called between OnAwake/OnEnable and Start which makes it seamless. + EditorApplication.update -= InternalEnableEditMode; + EditorApplication.update += InternalEnableEditMode; + } + } + } + + _IsFirstOnValidate = false; + } + + void InternalDestroyNonSaveables() + { + EditorApplication.update -= InternalDestroyNonSaveables; + + // See comment below. + if (this == null) return; + + foreach (Transform transform in transform.GetComponentInChildren(includeInactive: true)) + { + if (transform.gameObject.hideFlags.HasFlag(HideFlags.DontSaveInEditor)) + { + Helpers.Destroy(transform.gameObject); + } + } + } + + void InternalEnableEditMode() + { + EditorApplication.update -= InternalEnableEditMode; + + // If the scene that is being built is already opened then, there can be a rogue instance which registers + // an event but is destroyed by the time it gets here. It has something to do with OnValidate being called + // after the object is destroyed with _isFirstOnValidate being true. + if (this == null) return; + // Workaround to ExecuteAlways also executing during building which is often not what we want. + runInEditMode = true; + } + + static MethodInfo s_ExecuteValidators; + [InitializeOnLoadMethod] + static void Load() + { + var type = System.Type.GetType("WaveHarmonic.Crest.Editor.ValidatedHelper, WaveHarmonic.Crest.Shared.Editor"); + s_ExecuteValidators = type.GetMethod + ( + "ExecuteValidators", + BindingFlags.Public | BindingFlags.Static, + null, + new[] { typeof(Object) }, + null + ); + } + } +} + +#endif + +namespace WaveHarmonic.Crest +{ + // Stores a reference to the owner so the GO can be deleted safely when duplicated/pasted. + sealed class ManagedGameObject : MonoBehaviour + { + [field: SerializeField] + public Component Owner { get; set; } + } + + static class Extentions + { + [System.Diagnostics.Conditional("UNITY_EDITOR")] + public static void Manage(this Component owner, GameObject @object) + { + @object.AddComponent().Owner = owner; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/EditorBehaviour.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/EditorBehaviour.cs.meta new file mode 100644 index 0000000..ecc0db0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/EditorBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f9b0b7f0a05449e4952db2c0e3a5516 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/ManagedBehaviour.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/ManagedBehaviour.cs new file mode 100644 index 0000000..d9f3957 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/ManagedBehaviour.cs @@ -0,0 +1,177 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using System.Collections.Generic; + +namespace WaveHarmonic.Crest.Internal +{ + /// + /// Manages ManagedBehaviours. Replaces Unity's event system. + /// + /// The manager type. + public abstract class ManagerBehaviour : CustomBehaviour where T : ManagerBehaviour + { + internal static readonly List> s_OnUpdate = new(); + internal static readonly List> s_OnLateUpdate = new(); + internal static readonly List> s_OnFixedUpdate = new(); + internal static readonly List> s_OnEnable = new(); + internal static readonly List> s_OnDisable = new(); + + /// + /// The singleton instance. + /// + public static T Instance { get; private set; } + + void Broadcast(List> listeners, T instance) + { + for (var i = listeners.Count - 1; i >= 0; --i) + { + listeners[i].Invoke(instance); + } + } + + void Broadcast(List> listeners) + { + Broadcast(listeners, Instance); + } + + private protected virtual void Enable() + { + // Setting up instance should be last. + Instance = (T)this; + Broadcast(s_OnEnable); + } + + private protected virtual void Disable() + { + Broadcast(s_OnDisable); + Instance = null; + } + + private protected virtual void FixedUpdate() => Broadcast(s_OnFixedUpdate); + private protected void BroadcastUpdate() => Broadcast(s_OnUpdate); + private protected virtual void LateUpdate() => Broadcast(s_OnLateUpdate); + + // OnLoad etc cannot be used on open generic types. + internal static void AfterRuntimeLoad() + { + Instance = null; + } + + internal static void AfterScriptReload() + { + Instance = FindFirstObjectByType(); + } + } + + /// + /// A behaviour which is driven by a ManagerBehaviour instead of Unity's event system. + /// + /// The manager type. + public abstract class ManagedBehaviour : CustomBehaviour where T : ManagerBehaviour + { + readonly Action _OnUpdate; + readonly Action _OnLateUpdate; + readonly Action _OnFixedUpdate; + readonly Action _OnEnable; + readonly Action _OnDisable; + + /// + /// The Update method called by the manager class. + /// + private protected virtual Action OnUpdateMethod => null; + + /// + /// The LateUpdate method called by the manager class. + /// + private protected virtual Action OnLateUpdateMethod => null; + + /// + /// The FixedUpdated method called by the manager class. + /// + private protected virtual Action OnFixedUpdateMethod => null; + + /// + /// The OnEnable method called by the manager class. + /// + private protected virtual Action OnEnableMethod => null; + + /// + /// The OnDisable method called by the manager class. + /// + private protected virtual Action OnDisableMethod => null; + + /// + /// Constructor which caches Actions to avoid allocations. + /// + public ManagedBehaviour() + { + if (OnUpdateMethod != null) _OnUpdate = new(OnUpdateMethod); + if (OnLateUpdateMethod != null) _OnLateUpdate = new(OnLateUpdateMethod); + if (OnFixedUpdateMethod != null) _OnFixedUpdate = new(OnFixedUpdateMethod); + if (OnEnableMethod != null) _OnEnable = new(OnEnableMethod); + if (OnDisableMethod != null) _OnDisable = new(OnDisableMethod); + } + + /// + private protected override void OnEnable() + { + base.OnEnable(); + + UpdateSubscription(listen: true); + + // Trigger OnEnable as it has already passed. + if (_OnEnable != null && ManagerBehaviour.Instance != null) + { + _OnEnable(ManagerBehaviour.Instance); + } + } + + /// + /// Unity's OnDisable method. Make sure to call base if overriden. + /// + private protected virtual void OnDisable() + { + UpdateSubscription(listen: false); + + if (_OnDisable != null && ManagerBehaviour.Instance != null) + { + _OnDisable(ManagerBehaviour.Instance); + } + } + + void UpdateSubscription(bool listen) + { + if (_OnUpdate != null) + { + ManagerBehaviour.s_OnUpdate.Remove(_OnUpdate); + if (listen) ManagerBehaviour.s_OnUpdate.Add(_OnUpdate); + } + + if (_OnLateUpdate != null) + { + ManagerBehaviour.s_OnLateUpdate.Remove(_OnLateUpdate); + if (listen) ManagerBehaviour.s_OnLateUpdate.Add(_OnLateUpdate); + } + + if (_OnFixedUpdate != null) + { + ManagerBehaviour.s_OnFixedUpdate.Remove(_OnFixedUpdate); + if (listen) ManagerBehaviour.s_OnFixedUpdate.Add(_OnFixedUpdate); + } + + if (_OnEnable != null) + { + ManagerBehaviour.s_OnEnable.Remove(_OnEnable); + if (listen) ManagerBehaviour.s_OnEnable.Add(_OnEnable); + } + + if (_OnDisable != null) + { + ManagerBehaviour.s_OnDisable.Remove(_OnDisable); + if (listen) ManagerBehaviour.s_OnDisable.Add(_OnDisable); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/ManagedBehaviour.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/ManagedBehaviour.cs.meta new file mode 100644 index 0000000..a478963 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Component/ManagedBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b697363737b2425180c036dc593512e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug.meta new file mode 100644 index 0000000..a6ac020 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee229ff5d6ee44527a180dda2e656ad8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug/Debug.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug/Debug.cs new file mode 100644 index 0000000..eb310c6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug/Debug.cs @@ -0,0 +1,29 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest.Utility +{ + static class DebugUtility + { + public delegate void DrawLine(Vector3 position, Vector3 up, Color color, float duration); + + public static void DrawCross(DrawLine draw, Vector3 position, float r, Color color, float duration = 0f) + { + draw(position - Vector3.up * r, position + Vector3.up * r, color, duration); + draw(position - Vector3.right * r, position + Vector3.right * r, color, duration); + draw(position - Vector3.forward * r, position + Vector3.forward * r, color, duration); + } + + public static void DrawCross(DrawLine draw, Vector3 position, Vector3 up, float r, Color color, float duration = 0f) + { + up.Normalize(); + var right = Vector3.Normalize(Vector3.Cross(up, Vector3.forward)); + var forward = Vector3.Cross(up, right); + draw(position - up * r, position + up * r, color, duration); + draw(position - right * r, position + right * r, color, duration); + draw(position - forward * r, position + forward * r, color, duration); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug/Debug.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug/Debug.cs.meta new file mode 100644 index 0000000..d09e581 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Debug/Debug.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afcafd3203e384a54aa71d2c40f2025c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Helpers.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Helpers.cs new file mode 100644 index 0000000..506268e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Helpers.cs @@ -0,0 +1,1176 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using System.Reflection; +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering.Universal; +using WaveHarmonic.Crest.Internal; + +#if !UNITY_2023_2_OR_NEWER +using GraphicsFormatUsage = UnityEngine.Experimental.Rendering.FormatUsage; +#endif + +namespace WaveHarmonic.Crest +{ + /// + /// General purpose helpers which, at the moment, do not warrant a seperate file. + /// + static partial class Helpers + { + // Adapted from: + // Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +#if UNITY_SWITCH || UNITY_ANDROID || UNITY_EMBEDDED_LINUX || UNITY_QNX + internal const GraphicsFormat k_DepthStencilFormat = GraphicsFormat.D24_UNorm_S8_UInt; + internal const int k_DepthBufferBits = 24; + internal const DepthBits k_DepthBits = DepthBits.Depth24; +#else + internal const GraphicsFormat k_DepthStencilFormat = GraphicsFormat.D32_SFloat_S8_UInt; + internal const int k_DepthBufferBits = 32; + internal const DepthBits k_DepthBits = DepthBits.Depth32; +#endif + + public static class ShaderIDs + { + public static readonly int s_MainTexture = Shader.PropertyToID("_Utility_MainTexture"); + } + + static Mesh s_Plane; + + /// + /// Plane geometry + /// + public static Mesh PlaneMesh + { + get + { + if (s_Plane) return s_Plane; + return s_Plane = Resources.GetBuiltinResource("New-Plane.fbx"); + } + } + + static Mesh s_Quad; + + /// + /// Quad geometry + /// + public static Mesh QuadMesh + { + get + { + if (s_Quad) return s_Quad; + return s_Quad = Resources.GetBuiltinResource("Quad.fbx"); + } + } + + static Mesh s_SphereMesh; + + /// + /// Sphere geometry + /// + public static Mesh SphereMesh + { + get + { + if (s_SphereMesh) return s_SphereMesh; + return s_SphereMesh = Resources.GetBuiltinResource("New-Sphere.fbx"); + } + } + + internal static int SiblingIndexComparison(int x, int y) => x.CompareTo(y); + + /// + /// Comparer that always returns less or greater, never equal, to get work around unique key constraint + /// + internal static int DuplicateComparison(int x, int y) + { + var result = x.CompareTo(y); + // If non-zero, use result, otherwise return greater (never equal) + return result != 0 ? result : 1; + } + + static Vector2Int CalculateResolution(Vector2 resolution, int maximum) + { + // Enforce maximum and scale to maintain aspect ratio. + var largest = Mathf.Max(resolution.x, resolution.y); + if (largest > maximum) + { + var scale = maximum / largest; + resolution *= scale; + } + + return new(Mathf.CeilToInt(resolution.x), Mathf.CeilToInt(resolution.y)); + } + + internal static Vector2Int CalculateResolutionFromTexelSize(Vector2 worldSize, float texelSize, int maximum) + { + return CalculateResolution(new(worldSize.x / texelSize, worldSize.y / texelSize), maximum); + } + + internal static Vector2Int CalculateResolutionFromTexelDensity(Vector2 worldSize, float texelDensity, int maximum) + { + return CalculateResolution(new(Mathf.RoundToInt(texelDensity * worldSize.x), Mathf.RoundToInt(texelDensity * worldSize.y)), maximum); + } + + /// + /// Rotates an XZ size and returns an XZ size which encapsulates it. + /// + public static Vector2 RotateAndEncapsulateXZ(Vector2 size, float angle) + { + angle = Mathf.PingPong(angle, 90f); + var c = Mathf.Cos(angle * Mathf.Deg2Rad); + var s = Mathf.Sin(angle * Mathf.Deg2Rad); + return new + ( + size.x * c + size.y * s, + size.y * c + size.x * s + ); + } + + public static BindingFlags s_AnyMethod = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | + BindingFlags.Static; + + public static T GetCustomAttribute(System.Type type) where T : System.Attribute + { + return (T)System.Attribute.GetCustomAttribute(type, typeof(T)); + } + + public static WaitForEndOfFrame WaitForEndOfFrame { get; } = new(); + + static Material s_UtilityMaterial; + public static Material UtilityMaterial + { + get + { + if (s_UtilityMaterial == null) + { + s_UtilityMaterial = new(Shader.Find("Hidden/Crest/Utility/Blit")); + } + + return s_UtilityMaterial; + } + } + + // Need to cast to int but no conversion cost. + // https://stackoverflow.com/a/69148528 + internal enum UtilityPass + { + CopyColor, + CopyDepth, + ClearDepth, + ClearStencil, + Copy, + MergeDepth, + } + + // Taken from: + // https://github.com/Unity-Technologies/Graphics/blob/871df5563d88e1ba778c82a43f39c9afc95368e6/Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl#L1149-L1152 + // Z buffer to linear 0..1 depth (0 at camera position, 1 at far plane). + // Does NOT work with orthographic projections. + // Does NOT correctly handle oblique view frustums. + public static float NonLinearToLinear01Depth(float depth, Vector4 zBufferParameters) + { + return 1.0f / (zBufferParameters.x * depth + zBufferParameters.y); + } + + // Taken from: + // https://github.com/Unity-Technologies/Graphics/blob/871df5563d88e1ba778c82a43f39c9afc95368e6/Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl#L1154-L1161 + // Z buffer to linear depth. + // Does NOT correctly handle oblique view frustums. + // Does NOT work with orthographic projection. + public static float NonLinearToLinearEyeDepth(float depth, Vector4 zBufferParameters) + { + return 1.0f / (zBufferParameters.z * depth + zBufferParameters.w); + } + + // Taken from: + // https://www.cyanilux.com/tutorials/depth/#depth-output + public static float LinearDepthToNonLinear(float depth, Vector4 zBufferParameters) + { + return (1.0f - depth * zBufferParameters.y) / (depth * zBufferParameters.x); + } + + // Taken from: + // https://www.cyanilux.com/tutorials/depth/#depth-output + public static float EyeDepthToNonLinear(float depth, Vector4 zBufferParameters) + { + return (1.0f - depth * zBufferParameters.w) / (depth * zBufferParameters.z); + } + + public static Vector4 GetZBufferParameters(Camera camera) + { + // Taken and modified from: + // https://github.com/Unity-Technologies/Graphics/blob/871df5563d88e1ba778c82a43f39c9afc95368e6/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs#L303-L327 + var near = camera.nearClipPlane; + var far = camera.farClipPlane; + var inverseNear = Mathf.Approximately(near, 0.0f) ? 0.0f : 1.0f / near; + var inverseFar = Mathf.Approximately(far, 0.0f) ? 0.0f : 1.0f / far; + + // From http://www.humus.name/temp/Linearize%20depth.txt + // But as depth component textures on OpenGL always return in 0..1 range (as in D3D), we have to use + // the same constants for both D3D and OpenGL here. + // OpenGL would be this: + // zc0 = (1.0 - far / near) / 2.0; + // zc1 = (1.0 + far / near) / 2.0; + // D3D is this: + var zc0 = 1.0f - far * inverseNear; + var zc1 = far * inverseNear; + + var zBufferParameters = new Vector4(zc0, zc1, zc0 * inverseFar, zc1 * inverseFar); + + if (SystemInfo.usesReversedZBuffer) + { + zBufferParameters.y += zBufferParameters.x; + zBufferParameters.x = -zBufferParameters.x; + zBufferParameters.w += zBufferParameters.z; + zBufferParameters.z = -zBufferParameters.z; + } + + return zBufferParameters; + } + + /// + /// Uses PrefabUtility.InstantiatePrefab in editor and GameObject.Instantiate in standalone. + /// + public static GameObject InstantiatePrefab(GameObject prefab) + { +#if UNITY_EDITOR + return (GameObject)UnityEditor.PrefabUtility.InstantiatePrefab(prefab); +#else + return GameObject.Instantiate(prefab); +#endif + } + + // Taken from Unity + // https://docs.unity3d.com/2022.2/Documentation/Manual/BestPracticeUnderstandingPerformanceInUnity5.html + public static bool StartsWithNoAlloc(this string a, string b) + { + var aLen = a.Length; + var bLen = b.Length; + + var ap = 0; var bp = 0; + + while (ap < aLen && bp < bLen && a[ap] == b[bp]) + { + ap++; + bp++; + } + + return bp == bLen; + } + + public static void ReadRenderTexturePixels(ref RenderTexture rt, ref Texture2D texture, int slice = -1) + { + var source = rt; + var copy = slice > -1 && rt.volumeDepth > 1; + + if (copy) + { + var descriptor = rt.descriptor; + descriptor.volumeDepth = 1; + source = RenderTexture.GetTemporary(descriptor); + Graphics.CopyTexture(rt, slice, 0, source, 0, 0); + } + + var previous = RenderTexture.active; + RenderTexture.active = source; + texture.ReadPixels(new(0, 0, texture.width, texture.height), 0, 0, false); + texture.Apply(); + RenderTexture.active = previous; + + if (copy) + { + RenderTexture.active = null; + RenderTexture.ReleaseTemporary(source); + } + } + + // Reads a single pixel. + public static void ReadRenderTexturePixel(ref RenderTexture rt, ref Texture2D texture, int x, int y, int slice = 0) + { + var descriptor = rt.descriptor; + descriptor.width = 1; + descriptor.height = 1; + descriptor.volumeDepth = 1; + var source = RenderTexture.GetTemporary(descriptor); + Graphics.CopyTexture(rt, slice, 0, x, y, 1, 1, source, 0, 0, 0, 0); + + var previous = RenderTexture.active; + RenderTexture.active = source; + texture.ReadPixels(new(0, 0, texture.width, texture.height), 0, 0, false); + texture.Apply(); + RenderTexture.active = previous; + + RenderTexture.ReleaseTemporary(source); + } + + public static void Blit(RenderTexture source, RenderTexture target) + { + var active = RenderTexture.active; + Graphics.Blit(source, target); + RenderTexture.active = active; + } + + public static float ConvertDepthBufferValueToDistance(Camera camera, float depth) + { + float zBufferParamsX; float zBufferParamsY; + if (SystemInfo.usesReversedZBuffer) + { + zBufferParamsY = 1f; + zBufferParamsX = camera.farClipPlane / camera.nearClipPlane - 1f; + } + else + { + zBufferParamsY = camera.farClipPlane / camera.nearClipPlane; + zBufferParamsX = 1f - zBufferParamsY; + } + + return 1.0f / (zBufferParamsX / camera.farClipPlane * depth + zBufferParamsY / camera.farClipPlane); + } + +#if UNITY_EDITOR + public static bool IsPreviewOfGameCamera(Camera camera) + { + // StartsWith has GC allocations. It is only used in the editor. + return camera.cameraType == CameraType.Preview && camera.name == "Preview Camera"; + } +#endif + + public static bool IsMSAAEnabled(Camera camera) + { +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + var hdCamera = HDCamera.GetOrCreate(camera); + // Scene view camera does appear to support MSAA unlike other RPs. + // Querying frame settings on the camera will give the correct results - overriden or not. + return hdCamera.msaaSamples != MSAASamples.None; + } +#endif + + var isMSAA = camera.allowMSAA; +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + // MSAA will be the same for every camera if XR rendering. + isMSAA = isMSAA || Rendering.EnabledXR; + } +#endif + +#if UNITY_EDITOR + // Game View Preview ignores allowMSAA. + isMSAA = isMSAA || IsPreviewOfGameCamera(camera); + // Scene view doesn't support MSAA. + isMSAA = isMSAA && camera.cameraType != CameraType.SceneView; +#endif + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + // Keep this check last so it overrides everything else. + isMSAA = isMSAA && camera.GetUniversalAdditionalCameraData().scriptableRenderer.supportedRenderingFeatures.msaa; + } +#endif + + // QualitySettings.antiAliasing can be zero. + return (isMSAA ? QualitySettings.antiAliasing : 1) > 1; + } + + public static bool IsIntelGPU() + { + // Works for Windows and MacOS. Grabbed from Unity Graphics repository: + // https://github.com/Unity-Technologies/Graphics/blob/68b0d42c/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs#L198-L199 + return SystemInfo.graphicsDeviceName.ToLowerInvariant().Contains("intel"); + } + + public static bool MaskIncludesLayer(int mask, int layer) + { + // Taken from: + // http://answers.unity.com/answers/1332280/view.html + return mask == (mask | (1 << layer)); + } + + // R16G16B16A16_SFloat appears to be the most compatible format. + // https://docs.unity3d.com/Manual/class-TextureImporterOverride.html#texture-compression-support-platforms + // https://learn.microsoft.com/en-us/windows/win32/direct3d12/typed-unordered-access-view-loads#supported-formats-and-api-calls + static readonly GraphicsFormat s_FallbackGraphicsFormat = GraphicsFormat.R16G16B16A16_SFloat; + + static bool SupportsRandomWriteOnRenderTextureFormat(GraphicsFormat format) + { + var rtFormat = GraphicsFormatUtility.GetRenderTextureFormat(format); + return System.Enum.IsDefined(typeof(RenderTextureFormat), rtFormat) + && SystemInfo.SupportsRandomWriteOnRenderTextureFormat(rtFormat); + } + + internal static GraphicsFormat GetCompatibleTextureFormat(GraphicsFormat format, GraphicsFormatUsage usage, string label, bool randomWrite = false) + { + var result = SystemInfo.GetCompatibleFormat(format, usage); + var useFallback = result == GraphicsFormat.None; + +#if CREST_DEBUG_LOG_FORMAT_CHANGES + if (useFallback) + { + Debug.Log($"Crest: The graphics device does not support the render texture format {format}. Will attempt to use fallback. ({label})"); + } + else if (result != format) + { + Debug.Log($"Crest: Using render texture format {result} instead of {format}. ({label})"); + } +#endif + + // NOTE: Disabling for now. RenderTextureFormat is a subset of GraphicsFormat and + // there is not always an equivalent. + // if (!useFallback && randomWrite && !SupportsRandomWriteOnRenderTextureFormat(result)) + // { + // Debug.Log($"Crest: The graphics device does not support the render texture format {result} with random read/write. Will attempt to use fallback."); + // useFallback = true; + // } + + // Check if fallback is compatible before using it. + if (useFallback && format == s_FallbackGraphicsFormat) + { + Debug.Log($"Crest: Fallback {s_FallbackGraphicsFormat} is not supported on this device. Please inform us. ({label})"); + useFallback = false; + } + + if (useFallback) + { + result = s_FallbackGraphicsFormat; + } + + return result; + } + + public static void SetGlobalKeyword(string keyword, bool enabled) + { + if (enabled) + { + Shader.EnableKeyword(keyword); + } + else + { + Shader.DisableKeyword(keyword); + } + } + + public static void RenderTargetIdentifierXR(ref RenderTexture texture, ref RenderTargetIdentifier target) + { + target = new + ( + texture, + mipLevel: 0, + CubemapFace.Unknown, + depthSlice: -1 // Bind all XR slices. + ); + } + + public static RenderTargetIdentifier RenderTargetIdentifierXR(int id) => new + ( + id, + mipLevel: 0, + CubemapFace.Unknown, + depthSlice: -1 // Bind all XR slices. + ); + + /// + /// Creates an RT reference and adds it to the RTI. Native object behind RT is not created so you can change its + /// properties before being used. + /// + public static void CreateRenderTargetTextureReference(ref RenderTexture texture, ref RenderTargetIdentifier target) + { + // Do not overwrite reference or it will create reference leak. + if (texture == null) + { + // Dummy values. We are only creating an RT reference, not an RT native object. RT should be configured + // properly before using or calling Create. + texture = new(0, 0, 0); + } + + // Always call this in case of recompilation as RTI will lose its reference to the RT. + RenderTargetIdentifierXR(ref texture, ref target); + } + + /// + /// Creates an RT with an RTD if it does not exist or assigns RTD to RT (RT should be released first). This + /// prevents reference leaks. + /// + /// + /// Afterwards call Create if + /// necessary or let Unity handle + /// it. + /// + public static void SafeCreateRenderTexture(ref RenderTexture texture, RenderTextureDescriptor descriptor) + { + // Do not overwrite reference or it will create reference leak. + if (texture == null) + { + texture = new(descriptor); + } + else + { + if (texture.IsCreated()) + { + texture.Release(); + } + + texture.descriptor = descriptor; + } + } + + public static void SafeCreateRenderTexture(string name, ref RenderTexture texture, RenderTextureDescriptor descriptor) + { + // Do not overwrite reference or it will create reference leak. + if (texture == null) + { + texture = new(descriptor); + texture.name = name; + } + else + { + if (texture.IsCreated()) + { + texture.Release(); + } + + texture.descriptor = descriptor; + } + + texture.Create(); + } + + public static void ClearRenderTexture(RenderTexture texture, Color clear, bool depth = true, bool color = true) + { + var active = RenderTexture.active; + + // Using RenderTexture.active will not write to all slices. + Graphics.SetRenderTarget(texture, 0, CubemapFace.Unknown, -1); + // TODO: Do we need to disable GL.sRGBWrite as it is linear to linear. + GL.Clear(depth, color, clear); + + // Graphics.SetRenderTarget can be equivalent to setting RenderTexture.active: + // https://docs.unity3d.com/ScriptReference/Graphics.SetRenderTarget.html + // Restore previous active texture or it can incur a warning when releasing: + // Releasing render texture that is set to be RenderTexture.active! + RenderTexture.active = active; + } + + public static void VerticallyFlipRenderTexture(RenderTexture target, bool force = false) + { + if (!force && !SystemInfo.graphicsUVStartsAtTop) return; + var temporary = RenderTexture.GetTemporary(target.descriptor); + Graphics.Blit(target, temporary, new Vector2(1, -1), new Vector2(0, 1)); + Graphics.Blit(temporary, target); + RenderTexture.ReleaseTemporary(temporary); + } + + public static bool RenderTargetTextureNeedsUpdating(RenderTexture texture, RenderTextureDescriptor descriptor) + { + return + descriptor.width != texture.width || + descriptor.height != texture.height || + descriptor.volumeDepth != texture.volumeDepth || + descriptor.useDynamicScale != texture.useDynamicScale; + } + + public static bool RenderTextureNeedsUpdating(RenderTexture t1, RenderTexture t2) + { + return + t1.width != t2.width || + t1.height != t2.height || + t1.volumeDepth != t2.volumeDepth || + t1.graphicsFormat != t2.graphicsFormat; + } + + public static bool RenderTextureNeedsUpdating(RenderTextureDescriptor t1, RenderTextureDescriptor t2) + { + return + t1.width != t2.width || + t1.height != t2.height || + t1.volumeDepth != t2.volumeDepth || + t1.graphicsFormat != t2.graphicsFormat; + } + + public static int CalculateMipMapCount(int maximumDimension) + { + return Mathf.FloorToInt(Mathf.Log(maximumDimension, 2f)); + } + + /// + /// Uses Destroy in play mode or DestroyImmediate in edit mode. + /// + public static void Destroy(Object @object, bool undo = false) + { +#if UNITY_EDITOR + // We must use DestroyImmediate in edit mode. As it apparently has an overhead, use recommended Destroy in + // play mode. DestroyImmediate is generally recommended in edit mode by Unity: + // https://docs.unity3d.com/ScriptReference/Object.DestroyImmediate.html + if (!Application.isPlaying) + { + if (undo) + { + UnityEditor.Undo.DestroyObjectImmediate(@object); + } + else + { + Object.DestroyImmediate(@object); + } + } + else +#endif + { + Object.Destroy(@object); + } + } + + static readonly Matrix4x4 s_ScaleMatrix = Matrix4x4.Scale(new(1f, 1f, -1f)); + + // Borrowed from SRP code: + // https://github.com/Unity-Technologies/Graphics/blob/7d292932bec3b4257a4defaf698fc7d77e2027f5/com.unity.render-pipelines.high-definition/Runtime/Core/Utilities/GeometryUtils.cs#L181-L184 + public static Matrix4x4 CalculateWorldToCameraMatrixRHS(Vector3 position, Quaternion rotation) + { + return s_ScaleMatrix * Matrix4x4.TRS(position, rotation, Vector3.one).inverse; + } + + /// + /// Blit using full screen triangle. Supports more features than CommandBuffer.Blit like the RenderPipeline tag + /// in sub-shaders. Never use for data. + /// + public static void Blit(CommandBuffer buffer, RenderTargetIdentifier target, Material material, int pass = -1, MaterialPropertyBlock properties = null) + { + CoreUtils.SetRenderTarget(buffer, target); + + buffer.DrawProcedural + ( + Matrix4x4.identity, + material, + pass, + MeshTopology.Triangles, + vertexCount: 3, + instanceCount: 1, + properties + ); + } + + /// + /// Blit using full screen triangle. Supports more features than CommandBuffer.Blit like the RenderPipeline tag + /// in sub-shaders. Never use for fullscreen effects. + /// + public static void Blit(CommandBuffer buffer, RenderTexture target, Material material, int pass = -1, int depthSlice = -1, MaterialPropertyBlock properties = null) + { + buffer.SetRenderTarget(target, mipLevel: 0, CubemapFace.Unknown, depthSlice); + buffer.DrawProcedural + ( + Matrix4x4.identity, + material, + pass, + MeshTopology.Triangles, + vertexCount: 3, + instanceCount: 1, + properties + ); + } + + // Fixes a bug with Unity, as we should not have to do this ourselves. + // Only required under the following conditions: + // Camera > URP Dynamic Resolution = checked + // URP Asset > Anti Aliasing (MSAA) = unchecked + // URP Asset > Upscale Filter = Spatial-Temporal Post-Processing + [System.Diagnostics.Conditional("d_UnityURP")] + public static void ScaleViewport(Camera camera, CommandBuffer buffer, RTHandle handle) + { + // Only applies to URP. + if (!RenderPipelineHelper.IsUniversal) return; + + // Causes problems if we continue when this is checked. + if (camera.allowDynamicResolution) return; + + var size = handle.GetScaledSize(handle.rtHandleProperties.currentViewportSize); + if (size == Vector2Int.zero) return; + buffer.SetViewport(new(0f, 0f, size.x, size.y)); + } + + public static void SetShaderVector(Material material, int nameID, Vector4 value, bool global = false) + { + if (global) + { + Shader.SetGlobalVector(nameID, value); + } + else + { + material.SetVector(nameID, value); + } + } + + public static void SetShaderInteger(Material material, int nameID, int value, bool global = false) + { + if (global) + { + Shader.SetGlobalInteger(nameID, value); + } + else + { + material.SetInteger(nameID, value); + } + } + + public static void SetShaderFloat(Material material, int nameID, float value, bool global = false) + { + if (global) + { + Shader.SetGlobalFloat(nameID, value); + } + else + { + material.SetFloat(nameID, value); + } + } + + public static bool GetGlobalBoolean(int id) + { + return Shader.GetGlobalInteger(id) == 1; + } + + public static void SetGlobalBoolean(int id, bool value) + { + Shader.SetGlobalInteger(id, value ? 1 : 0); + } + +#if d_UnityURP + static readonly List s_RenderFeatureActiveStates = new(); + static readonly FieldInfo s_RenderDataListField = typeof(UniversalRenderPipelineAsset) + .GetField("m_RendererDataList", BindingFlags.NonPublic | BindingFlags.Instance); + static readonly FieldInfo s_DefaultRendererIndex = typeof(UniversalRenderPipelineAsset) + .GetField("m_DefaultRendererIndex", BindingFlags.NonPublic | BindingFlags.Instance); + static readonly FieldInfo s_RendererIndex = typeof(UniversalAdditionalCameraData) + .GetField("m_RendererIndex", BindingFlags.NonPublic | BindingFlags.Instance); + + internal static ScriptableRendererData[] UniversalRendererData(UniversalRenderPipelineAsset asset) => + (ScriptableRendererData[])s_RenderDataListField.GetValue(asset); + + internal static int GetRendererIndex(Camera camera) + { + var rendererIndex = (int)s_RendererIndex.GetValue(camera.GetUniversalAdditionalCameraData()); + + if (rendererIndex < 0) + { + rendererIndex = (int)s_DefaultRendererIndex.GetValue(UniversalRenderPipeline.asset); + } + + return rendererIndex; + } + + internal static bool IsSSAOEnabled(Camera camera) + { + // Get this every time as it could change. + var renderers = (ScriptableRendererData[])s_RenderDataListField.GetValue(UniversalRenderPipeline.asset); + var rendererIndex = GetRendererIndex(camera); + + foreach (var feature in renderers[rendererIndex].rendererFeatures) + { + if (feature.GetType().Name == "ScreenSpaceAmbientOcclusion") + { + return feature.isActive; + } + } + + return false; + } + + internal static void RenderCameraWithoutCustomPasses(Camera camera) + { + // Get this every time as it could change. + var renderers = (ScriptableRendererData[])s_RenderDataListField.GetValue(UniversalRenderPipeline.asset); + var rendererIndex = GetRendererIndex(camera); + + foreach (var feature in renderers[rendererIndex].rendererFeatures) + { + // Null exception reported here. Might be null due to missing render features + if (feature == null) continue; + s_RenderFeatureActiveStates.Add(feature.isActive); + feature.SetActive(false); + } + + camera.Render(); + + var index = 0; + foreach (var feature in renderers[rendererIndex].rendererFeatures) + { + if (feature == null) continue; + feature.SetActive(s_RenderFeatureActiveStates[index++]); + } + + s_RenderFeatureActiveStates.Clear(); + } + + static readonly UniversalRenderPipeline.SingleCameraRequest s_RenderSingleCameraRequest = new(); +#endif + + static readonly UnityEngine.Rendering.RenderPipeline.StandardRequest s_RenderStandardRequest = new(); + + public static void RenderCamera(Camera camera, ScriptableRenderContext context, int slice) + { +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { +#if UNITY_6000_0_OR_NEWER + // SingleCameraRequest does not render the full camera stack, thus should exclude + // overlays which is likely desirable. Alternative approach worth investigating: + // https://docs.unity3d.com/6000.0/Documentation/Manual/urp/User-Render-Requests.html + // Setting destination silences a warning if Opaque Texture enabled. + s_RenderSingleCameraRequest.destination = camera.targetTexture; + s_RenderSingleCameraRequest.slice = slice; + UnityEngine.Rendering.RenderPipeline.SubmitRenderRequest(camera, s_RenderSingleCameraRequest); +#else +#pragma warning disable CS0618 // Type or member is obsolete + UniversalRenderPipeline.RenderSingleCamera(context, camera); +#pragma warning restore CS0618 // Type or member is obsolete +#endif + return; + } +#endif + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + camera.SubmitRenderRequest(s_RenderStandardRequest); + return; + } +#endif + + camera.Render(); + } + + } + + // Undo + static partial class Helpers + { + public static class Undo + { + static class Symbols + { + public const string k_UnityEditor = "UNITY_EDITOR"; + } + + [System.Diagnostics.Conditional(Symbols.k_UnityEditor)] + public static void RecordObject(Object @object, string label) + { +#if UNITY_EDITOR + UnityEditor.Undo.RecordObject(@object, label); +#endif + } + + [System.Diagnostics.Conditional(Symbols.k_UnityEditor)] + public static void SetSiblingIndex(Transform transform, int index, string label) + { +#if UNITY_EDITOR + UnityEditor.Undo.SetSiblingIndex(transform, index, label); +#endif + } + + [System.Diagnostics.Conditional(Symbols.k_UnityEditor)] + public static void RegisterCreatedObjectUndo(Object @object, string label) + { +#if UNITY_EDITOR + UnityEditor.Undo.RegisterCreatedObjectUndo(@object, label); +#endif + } + } + } + + // Terrain +#if d_Unity_Terrain + static partial class Helpers + { + static readonly List s_Terrains = new(); + internal static Terrain GetTerrainAtPosition(Vector2 position) + { + Terrain.GetActiveTerrains(s_Terrains); + + foreach (var terrain in s_Terrains) + { + if (terrain.terrainData == null) + { + continue; + } + + var rect = new Rect(terrain.transform.position.XZ(), terrain.terrainData.size.XZ()); + + // Return the first one. + if (rect.Contains(position)) + { + return terrain; + } + } + + return null; + } + } +#endif // d_Unity_Terrain + + namespace Internal + { + static class Extensions + { + // Swizzle + public static Vector2 XZ(this Vector3 v) => new(v.x, v.z); + public static Vector2 XY(this Vector4 v) => new(v.x, v.y); + public static Vector2 ZW(this Vector4 v) => new(v.z, v.w); + public static Vector3 XYZ(this Vector4 v) => new(v.x, v.y, v.z); + public static Vector3 XNZ(this Vector2 v, float n = 0f) => new(v.x, n, v.y); + public static Vector3 XNZ(this Vector3 v, float n = 0f) => new(v.x, n, v.z); + public static Vector3 XNN(this Vector3 v, float n = 0f) => new(v.x, n, n); + public static Vector3 NNZ(this Vector3 v, float n = 0f) => new(n, n, v.z); + public static Vector3 NYN(this Vector3 v, float n = 0f) => new(n, v.y, n); + public static Vector4 XYZN(this Vector3 v, float n = 0f) => new(v.x, v.y, v.z, n); + public static Vector4 XYNN(this Vector2 v, float n = 0f) => new(v.x, v.y, n, n); + public static Vector4 XYNN(this Vector2 v, Vector2 n) => new(v.x, v.y, n.x, n.y); + public static Vector4 NNZW(this Vector2 v, float n = 0f) => new(n, n, v.x, v.y); + public static Vector4 XNZW(this Vector4 v, float n) => new(v.x, n, v.z, v.w); + public static float Maximum(this Vector3 v) => Mathf.Max(Mathf.Max(v.x, v.y), v.z); + + public static Vector2 Absolute(this Vector2 v) => new + ( + Mathf.Abs(v.x), + Mathf.Abs(v.y) + ); + + public static Color Clamped01(this Color c) => new + ( + Mathf.Clamp01(c.r), + Mathf.Clamp01(c.g), + Mathf.Clamp01(c.b), + Mathf.Clamp01(c.a) + ); + + public static void SetKeyword(this Material material, string keyword, bool enabled) + { + if (enabled) + { + material.EnableKeyword(keyword); + } + else + { + material.DisableKeyword(keyword); + } + } + + public static void SetKeyword(this ComputeShader shader, string keyword, bool enabled) + { + if (enabled) + { + shader.EnableKeyword(keyword); + } + else + { + shader.DisableKeyword(keyword); + } + } + + public static void SetShaderKeyword(this CommandBuffer buffer, string keyword, bool enabled) + { + if (enabled) + { + buffer.EnableShaderKeyword(keyword); + } + else + { + buffer.DisableShaderKeyword(keyword); + } + } + + static readonly Vector3[] s_BoundsPoints = new Vector3[8]; + + public static Bounds Bounds(this Transform transform) + { + var bounds = new Bounds(); + bounds.center = transform.position; + var f = new Vector3(0.0f, 0.0f, 0.5f); + var u = new Vector3(0.0f, 0.5f, 0.0f); + var r = new Vector3(0.5f, 0.0f, 0.0f); + bounds.Encapsulate(transform.TransformPoint(f + u + r)); + bounds.Encapsulate(transform.TransformPoint(-f + u + r)); + bounds.Encapsulate(transform.TransformPoint(f + -u + r)); + bounds.Encapsulate(transform.TransformPoint(f + u + -r)); + bounds.Encapsulate(transform.TransformPoint(-f + -u + r)); + bounds.Encapsulate(transform.TransformPoint(f + -u + -r)); + bounds.Encapsulate(transform.TransformPoint(-f + u + -r)); + bounds.Encapsulate(transform.TransformPoint(-f + -u + -r)); + return bounds; + } + + /// + /// Applys the transform to local bounds similar to Renderer. + /// + /// The transform to apply to bounds. + /// Local bounds to transform. + /// Bounds with transform applied. + public static Bounds TransformBounds(this Transform transform, Bounds bounds) + { + s_BoundsPoints[0] = bounds.min; + s_BoundsPoints[1] = bounds.max; + s_BoundsPoints[2] = new(bounds.min.x, bounds.min.y, bounds.max.z); + s_BoundsPoints[3] = new(bounds.min.x, bounds.max.y, bounds.min.z); + s_BoundsPoints[4] = new(bounds.max.x, bounds.min.y, bounds.min.z); + s_BoundsPoints[5] = new(bounds.min.x, bounds.max.y, bounds.max.z); + s_BoundsPoints[6] = new(bounds.max.x, bounds.min.y, bounds.max.z); + s_BoundsPoints[7] = new(bounds.max.x, bounds.max.y, bounds.min.z); + + return GeometryUtility.CalculateBounds(s_BoundsPoints, transform.localToWorldMatrix); + } + + public static bool IntersectsXZ(this Bounds a, Bounds b) + { + return a.min.x <= b.max.x && a.max.x >= b.min.x && + a.min.z <= b.max.z && a.max.z >= b.min.z; + } + + public static Rect RectXZ(this Bounds bounds) + { + return Rect.MinMaxRect(bounds.min.x, bounds.min.z, bounds.max.x, bounds.max.z); + } + + public static Rect RectXZ(this Transform transform) + { + var scale = transform.lossyScale.XZ(); + scale = Helpers.RotateAndEncapsulateXZ(scale, transform.rotation.eulerAngles.y); + return new(transform.position.XZ() - scale * 0.5f, scale); + } + + public static Vector2 RotationXZ(this Transform transform) + { + return new Vector2(transform.localToWorldMatrix.m20, transform.localToWorldMatrix.m00).normalized; + } + + public static Color MaybeLinear(this Color color) + { + return QualitySettings.activeColorSpace == ColorSpace.Linear ? color.linear : color; + } + + public static Color MaybeGamma(this Color color) + { + return QualitySettings.activeColorSpace == ColorSpace.Linear ? color : color.gamma; + } + + public static Color FinalColor(this Light light) + { + var linear = GraphicsSettings.lightsUseLinearIntensity; + var color = linear ? light.color.linear : light.color; + color *= light.intensity; + if (linear && light.useColorTemperature) color *= Mathf.CorrelatedColorTemperatureToRGB(light.colorTemperature); + if (!linear) color = color.MaybeLinear(); + return linear ? color.MaybeGamma() : color; + } + + /// + /// Sets the msaaSamples property to the highest supported MSAA level in the settings. + /// + public static void SetMSAASamples(this ref RenderTextureDescriptor descriptor, Camera camera) + { + // QualitySettings.antiAliasing is zero when disabled which is invalid for msaaSamples. + // We need to set this first as GetRenderTextureSupportedMSAASampleCount uses it: + // https://docs.unity3d.com/ScriptReference/SystemInfo.GetRenderTextureSupportedMSAASampleCount.html + descriptor.msaaSamples = Helpers.IsMSAAEnabled(camera) ? Mathf.Max(QualitySettings.antiAliasing, 1) : 1; + descriptor.msaaSamples = SystemInfo.GetRenderTextureSupportedMSAASampleCount(descriptor); + } + + // RT descriptor from texture base class. + internal static RenderTextureDescriptor GetDescriptor(this Texture texture) + { + if (texture is RenderTexture rt) + { + return rt.descriptor; + } + + var descriptor = new RenderTextureDescriptor(0, 0) + { + width = texture.width, + height = texture.height, + graphicsFormat = texture.graphicsFormat, + dimension = texture.dimension, + volumeDepth = 1, + msaaSamples = 1, + useMipMap = false, + enableRandomWrite = true, + }; + + return descriptor; + } + + public static bool GetBoolean(this Material material, int id) + { + return (material.HasInteger(id) ? material.GetInteger(id) : material.GetInt(id)) != 0; + } + + public static void SetBoolean(this Material material, int id, bool value) + { + if (material.HasInteger(id)) + { + material.SetInteger(id, value ? 1 : 0); + } + else + { + material.SetInt(id, value ? 1 : 0); + } + } + + public static void SetGlobalBoolean(this CommandBuffer buffer, int id, bool value) + { + buffer.SetGlobalInteger(id, value ? 1 : 0); + } + + public static bool IsEmpty(this UnityEngine.Events.UnityEvent @event) + { + return @event.GetPersistentEventCount() == 0; + } + + public static bool IsEmpty(this UnityEngine.Events.UnityEvent @event) + { + return @event.GetPersistentEventCount() == 0; + } + } + } + + namespace Utility + { + /// + /// Puts together a hash from given data values. More deterministic than + /// System.HashCode across recompiles. + /// + static class Hash + { + public static int CreateHash() => 0x19384567; + + public static void AddFloat(float value, ref int hash) + { + // Appears to be deterministic across recompiles. + hash ^= value.GetHashCode(); + } + + public static void AddInt(int value, ref int hash) + { + hash ^= value; + } + + public static void AddBool(bool value, ref int hash) + { + hash ^= value ? 0x74659374 : 0x62649035; + } + + public static void AddObject(object value, ref int hash) + { + // Will be the index of this object instance + hash ^= value.GetHashCode(); + } + + public static void AddObject(T value, ref int hash) where T : struct + { + // Will be the index of this object instance + hash ^= value.GetHashCode(); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Helpers.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Helpers.cs.meta new file mode 100644 index 0000000..1d14c91 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Helpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2119ba437f41246979c9c6b448977c10 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering.meta new file mode 100644 index 0000000..01b5afd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8125db46507e461ea5334eddf20dc1d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CommandWrapper.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CommandWrapper.cs new file mode 100644 index 0000000..e1bbdbe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CommandWrapper.cs @@ -0,0 +1,111 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + interface ICommandWrapper : IPropertyWrapper + { + void SetInvertCulling(bool invert); + void DrawFullScreenTriangle(Material material, int pass, MaterialPropertyBlock block = null); + void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material, int pass = -1, MaterialPropertyBlock block = null); + } + + + readonly struct CommandWrapper : ICommandWrapper + { + public CommandBuffer Commands { get; } + public CommandWrapper(CommandBuffer commands) => Commands = commands; + public void SetFloat(int param, float value) => Commands.SetGlobalFloat(param, value); + public void SetFloatArray(int param, float[] value) => Commands.SetGlobalFloatArray(param, value); + public void SetTexture(int param, Texture value) => Commands.SetGlobalTexture(param, value); + public void SetVector(int param, Vector4 value) => Commands.SetGlobalVector(param, value); + public void SetVectorArray(int param, Vector4[] value) => Commands.SetGlobalVectorArray(param, value); + public void SetMatrix(int param, Matrix4x4 value) => Commands.SetGlobalMatrix(param, value); + public void SetInteger(int param, int value) => Commands.SetGlobalInteger(param, value); + public void SetBoolean(int param, bool value) => Commands.SetGlobalInteger(param, value ? 1 : 0); + + public void GetBlock() { } + public void SetBlock() { } + + public void SetInvertCulling(bool invert) => Commands.SetInvertCulling(invert); + + public void DrawFullScreenTriangle(Material material, int pass = -1, MaterialPropertyBlock block = null) + { + Commands.DrawProcedural + ( + Matrix4x4.identity, + material, + pass, + MeshTopology.Triangles, + vertexCount: 3, + instanceCount: 1, + block + ); + } + + public void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material, int pass = -1, MaterialPropertyBlock block = null) + { + Commands.DrawMesh + ( + mesh, + matrix, + material, + submeshIndex: 0, + pass, + block + ); + } + } + +#if UNITY_6000_0_OR_NEWER + readonly struct RasterCommandWrapper : ICommandWrapper + { + public RasterCommandBuffer Commands { get; } + public RasterCommandWrapper(RasterCommandBuffer commands) => Commands = commands; + public void SetFloat(int param, float value) => Commands.SetGlobalFloat(param, value); + public void SetFloatArray(int param, float[] value) => Commands.SetGlobalFloatArray(param, value); + // WARNING: bypasses RG checks. Only use for textures external to RG. + public void SetTexture(int param, Texture value) => Commands.m_WrappedCommandBuffer.SetGlobalTexture(param, value); + public void SetVector(int param, Vector4 value) => Commands.SetGlobalVector(param, value); + public void SetVectorArray(int param, Vector4[] value) => Commands.SetGlobalVectorArray(param, value); + public void SetMatrix(int param, Matrix4x4 value) => Commands.SetGlobalMatrix(param, value); + public void SetInteger(int param, int value) => Commands.SetGlobalInteger(param, value); + public void SetBoolean(int param, bool value) => Commands.SetGlobalInteger(param, value ? 1 : 0); + + public void GetBlock() { } + public void SetBlock() { } + + public void SetInvertCulling(bool invert) => Commands.SetInvertCulling(invert); + + public void DrawFullScreenTriangle(Material material, int pass, MaterialPropertyBlock block = null) + { + Commands.DrawProcedural + ( + Matrix4x4.identity, + material, + pass, + MeshTopology.Triangles, + vertexCount: 3, + instanceCount: 1, + block + ); + } + + public void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material, int pass = -1, MaterialPropertyBlock block = null) + { + Commands.DrawMesh + ( + mesh, + matrix, + material, + submeshIndex: 0, + pass, + block + ); + } + } +#endif // UNITY_6000_0_OR_NEWER +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CommandWrapper.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CommandWrapper.cs.meta new file mode 100644 index 0000000..7ffa291 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CommandWrapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a5766c3523cc4af586139878192e12d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CustomPassHelpers.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CustomPassHelpers.cs new file mode 100644 index 0000000..1eed39a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CustomPassHelpers.cs @@ -0,0 +1,136 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest +{ + class CustomPass : UnityEngine.Rendering.HighDefinition.CustomPass + { + internal GameObject _GameObject; + internal CustomPassVolume _Volume; + } + + static class CustomPassHelpers + { + internal static List s_Volumes = new(); + + // Create or update Game Object. + public static GameObject CreateOrUpdate + ( + Transform parent, + string name, + bool hide = true + ) + { + GameObject gameObject = null; + + // Find the existing custom pass volume. + // During recompiles, the reference will be lost so we need to find the game object. It could be limited to + // the editor if it is safe to do so, but there is a potential for leaking game objects. + if (gameObject == null) + { + var transform = parent.Find(name); + if (transform != null) + { + gameObject = transform.gameObject; + } + } + + // Create or update the custom pass volume. + if (gameObject == null) + { + gameObject = new() + { + name = name, + hideFlags = hide ? HideFlags.HideAndDontSave : HideFlags.DontSave, + }; + // Place the custom pass under the water renderer since it is easier to find later. Transform.Find can + // find inactive game objects unlike GameObject.Find. + gameObject.transform.parent = parent; + } + else + { + gameObject.hideFlags = hide ? HideFlags.HideAndDontSave : HideFlags.DontSave; + gameObject.SetActive(true); + } + + return gameObject; + } + + // Create or update Custom Pass Volume. + public static void CreateOrUpdate + ( + GameObject gameObject, + ref T pass, + string name, + CustomPassInjectionPoint injectionPoint, + int priority = 0 + ) + where T : CustomPass, new() + { + CustomPassVolume volume = null; + gameObject.GetComponents(s_Volumes); + + foreach (var v in s_Volumes) + { + if (v.injectionPoint == injectionPoint) + { + volume = v; + break; + } + } + + // Create the custom pass volume if it does not exist. + if (volume == null) + { + // It appears that this is currently the only way to add a custom pass. + volume = gameObject.AddComponent(); + volume.injectionPoint = injectionPoint; + volume.isGlobal = true; + volume.priority = priority; + } + + // Create custom pass. + pass ??= new() + { + name = name, + targetColorBuffer = UnityEngine.Rendering.HighDefinition.CustomPass.TargetBuffer.None, + targetDepthBuffer = UnityEngine.Rendering.HighDefinition.CustomPass.TargetBuffer.None, + }; + + // Add custom pass. + if (!volume.customPasses.Contains(pass)) + { + volume.customPasses.Add(pass); + } + + pass._GameObject = gameObject; + pass._Volume = volume; + } + + public static void Update(GameObject go, T pass, CustomPassInjectionPoint point, int priority = 0) where T : CustomPass + { + CustomPassVolume volume = null; + go.GetComponents(s_Volumes); + + foreach (var v in s_Volumes) + { + if (v.customPasses.Contains(pass)) + { + volume = v; + break; + } + } + + volume.injectionPoint = point; + volume.priority = priority; + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CustomPassHelpers.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CustomPassHelpers.cs.meta new file mode 100644 index 0000000..ddde75f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/CustomPassHelpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03b1e50fbb96a49f1ac7de50cc1f30db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/LightProbeUtility.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/LightProbeUtility.cs new file mode 100644 index 0000000..610eda7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/LightProbeUtility.cs @@ -0,0 +1,52 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Adapted from: +// https://github.com/keijiro/LightProbeUtility/blob/85c93577338e10a52dd53f263056de08d883337a/Assets/LightProbeUtility.cs + +// With fixes from: +// https://github.com/keijiro/LightProbeUtility/pull/2 + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + static class LightProbeUtility + { + static readonly int[] s_SHA = + { + Shader.PropertyToID("unity_SHAr"), + Shader.PropertyToID("unity_SHAg"), + Shader.PropertyToID("unity_SHAb") + }; + + static readonly int[] s_SHB = + { + Shader.PropertyToID("unity_SHBr"), + Shader.PropertyToID("unity_SHBg"), + Shader.PropertyToID("unity_SHBb") + }; + + static readonly int s_SHC = Shader.PropertyToID("unity_SHC"); + + public static void SetSHCoefficients(this T properties, Vector3 position) where T : IPropertyWrapper + { + LightProbes.GetInterpolatedProbe(position, null, out var sh); + + // Constant + Linear. + for (var i = 0; i < 3; i++) + { + properties.SetVector(s_SHA[i], new(sh[i, 3], sh[i, 1], sh[i, 2], sh[i, 0] - sh[i, 6])); + } + + // Quadratic polynomials. + for (var i = 0; i < 3; i++) + { + properties.SetVector(s_SHB[i], new(sh[i, 4], sh[i, 5], sh[i, 6] * 3, sh[i, 7])); + } + + // Final quadratic polynomial. + properties.SetVector(s_SHC, new(sh[0, 8], sh[1, 8], sh[2, 8], 1)); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/LightProbeUtility.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/LightProbeUtility.cs.meta new file mode 100644 index 0000000..ab1d6c2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/LightProbeUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf4aa5298ac5b4562a8c1f0466045eff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/PropertyWrapper.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/PropertyWrapper.cs new file mode 100644 index 0000000..6d6a83c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/PropertyWrapper.cs @@ -0,0 +1,189 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + /// + /// Unified interface for setting properties on both materials and material property blocks + /// + interface IPropertyWrapper + { + void SetFloat(int param, float value); + void SetFloatArray(int param, float[] value); + void SetVector(int param, Vector4 value); + void SetVectorArray(int param, Vector4[] value); + void SetTexture(int param, Texture value); + void SetMatrix(int param, Matrix4x4 matrix); + void SetInteger(int param, int value); + void SetBoolean(int param, bool value); + void GetBlock(); + void SetBlock(); + } + + static class PropertyWrapperConstants + { + internal const string k_NoShaderMessage = "Cannot create required material because shader {0} could not be found or loaded." + + " Try right clicking the Crest folder in the Project view and selecting Reimport, and checking for errors."; + } + + readonly struct PropertyWrapperBuffer : IPropertyWrapper + { + public CommandBuffer Buffer { get; } + public PropertyWrapperBuffer(CommandBuffer mpb) => Buffer = mpb; + public void SetFloat(int param, float value) => Buffer.SetGlobalFloat(param, value); + public void SetFloatArray(int param, float[] value) => Buffer.SetGlobalFloatArray(param, value); + public void SetTexture(int param, Texture value) => Buffer.SetGlobalTexture(param, value); + public void SetVector(int param, Vector4 value) => Buffer.SetGlobalVector(param, value); + public void SetVectorArray(int param, Vector4[] value) => Buffer.SetGlobalVectorArray(param, value); + public void SetMatrix(int param, Matrix4x4 value) => Buffer.SetGlobalMatrix(param, value); + public void SetInteger(int param, int value) => Buffer.SetGlobalInteger(param, value); + public void SetBoolean(int param, bool value) => Buffer.SetGlobalInteger(param, value ? 1 : 0); + + public void GetBlock() { } + public void SetBlock() { } + } + + readonly struct PropertyWrapperRenderer : IPropertyWrapper + { + public MaterialPropertyBlock PropertyBlock { get; } + public Renderer Renderer { get; } + + public PropertyWrapperRenderer(Renderer renderer, MaterialPropertyBlock block) + { + Renderer = renderer; + PropertyBlock = block; + } + + public void SetFloat(int param, float value) => PropertyBlock.SetFloat(param, value); + public void SetFloatArray(int param, float[] value) => PropertyBlock.SetFloatArray(param, value); + public void SetTexture(int param, Texture value) => PropertyBlock.SetTexture(param, value); + public void SetBuffer(int param, ComputeBuffer value) => PropertyBlock.SetBuffer(param, value); + public void SetVector(int param, Vector4 value) => PropertyBlock.SetVector(param, value); + public void SetVectorArray(int param, Vector4[] value) => PropertyBlock.SetVectorArray(param, value); + public void SetMatrix(int param, Matrix4x4 value) => PropertyBlock.SetMatrix(param, value); + public void SetInteger(int param, int value) => PropertyBlock.SetInteger(param, value); + public void SetBoolean(int param, bool value) => PropertyBlock.SetInteger(param, value ? 1 : 0); + + public void GetBlock() => Renderer.GetPropertyBlock(PropertyBlock); + public void SetBlock() => Renderer.SetPropertyBlock(PropertyBlock); + } + + [System.Serializable] + readonly struct PropertyWrapperMaterial : IPropertyWrapper + { + public Material Material { get; } + + public PropertyWrapperMaterial(Material material) => Material = material; + public PropertyWrapperMaterial(Shader shader) + { + Debug.Assert(shader != null, "Crest: PropertyWrapperMaterial: Cannot create required material because shader is null"); + Material = new(shader); + } + public PropertyWrapperMaterial(string shaderPath) + { + var shader = Shader.Find(shaderPath); + Debug.AssertFormat(shader != null, $"Crest.PropertyWrapperMaterial: {PropertyWrapperConstants.k_NoShaderMessage}", shaderPath); + Material = new(shader); + } + + public void SetFloat(int param, float value) => Material.SetFloat(param, value); + public void SetFloatArray(int param, float[] value) => Material.SetFloatArray(param, value); + public void SetTexture(int param, Texture value) => Material.SetTexture(param, value); + public void SetBuffer(int param, ComputeBuffer value) => Material.SetBuffer(param, value); + public void SetVector(int param, Vector4 value) => Material.SetVector(param, value); + public void SetVectorArray(int param, Vector4[] value) => Material.SetVectorArray(param, value); + public void SetMatrix(int param, Matrix4x4 value) => Material.SetMatrix(param, value); + public void SetInteger(int param, int value) => Material.SetInteger(param, value); + public void SetBoolean(int param, bool value) => Material.SetInteger(param, value ? 1 : 0); + + public void GetBlock() { } + public void SetBlock() { } + + // Non-Interface Methods + public void SetKeyword(in LocalKeyword keyword, bool value) => Material.SetKeyword(keyword, value); + } + + readonly struct PropertyWrapperMPB : IPropertyWrapper + { + public MaterialPropertyBlock MaterialPropertyBlock { get; } + public PropertyWrapperMPB(MaterialPropertyBlock mpb) => MaterialPropertyBlock = mpb; + public void SetFloat(int param, float value) => MaterialPropertyBlock.SetFloat(param, value); + public void SetFloatArray(int param, float[] value) => MaterialPropertyBlock.SetFloatArray(param, value); + public void SetTexture(int param, Texture value) => MaterialPropertyBlock.SetTexture(param, value); + public void SetVector(int param, Vector4 value) => MaterialPropertyBlock.SetVector(param, value); + public void SetVectorArray(int param, Vector4[] value) => MaterialPropertyBlock.SetVectorArray(param, value); + public void SetMatrix(int param, Matrix4x4 value) => MaterialPropertyBlock.SetMatrix(param, value); + public void SetInteger(int param, int value) => MaterialPropertyBlock.SetInteger(param, value); + public void SetBoolean(int param, bool value) => MaterialPropertyBlock.SetInteger(param, value ? 1 : 0); + + public void GetBlock() { } + public void SetBlock() { } + } + + [System.Serializable] + readonly struct PropertyWrapperCompute : IPropertyWrapper + { + readonly CommandBuffer _Buffer; + readonly ComputeShader _Shader; + readonly int _Kernel; + + public PropertyWrapperCompute(CommandBuffer buffer, ComputeShader shader, int kernel) + { + _Buffer = buffer; + _Shader = shader; + _Kernel = kernel; + } + + public void SetFloat(int param, float value) => _Buffer.SetComputeFloatParam(_Shader, param, value); + public void SetFloatArray(int param, float[] value) => _Buffer.SetGlobalFloatArray(param, value); + public void SetInteger(int param, int value) => _Buffer.SetComputeIntParam(_Shader, param, value); + public void SetBoolean(int param, bool value) => _Buffer.SetComputeIntParam(_Shader, param, value ? 1 : 0); + public void SetTexture(int param, Texture value) => _Buffer.SetComputeTextureParam(_Shader, _Kernel, param, value); + public void SetTexture(int param, RenderTargetIdentifier value) => _Buffer.SetComputeTextureParam(_Shader, _Kernel, param, value); + public void SetBuffer(int param, ComputeBuffer value) => _Buffer.SetComputeBufferParam(_Shader, _Kernel, param, value); + public void SetVector(int param, Vector4 value) => _Buffer.SetComputeVectorParam(_Shader, param, value); + public void SetVectorArray(int param, Vector4[] value) => _Buffer.SetComputeVectorArrayParam(_Shader, param, value); + public void SetMatrix(int param, Matrix4x4 value) => _Buffer.SetComputeMatrixParam(_Shader, param, value); + + public void GetBlock() { } + public void SetBlock() { } + + // Non-Interface Methods + public void SetKeyword(in LocalKeyword keyword, bool value) => _Buffer.SetKeyword(_Shader, keyword, value); + public void Dispatch(int x, int y, int z) => _Buffer.DispatchCompute(_Shader, _Kernel, x, y, z); + } + + [System.Serializable] + readonly struct PropertyWrapperComputeStandalone : IPropertyWrapper + { + readonly ComputeShader _Shader; + readonly int _Kernel; + + public PropertyWrapperComputeStandalone(ComputeShader shader, int kernel) + { + _Shader = shader; + _Kernel = kernel; + } + + public void SetFloat(int param, float value) => _Shader.SetFloat(param, value); + public void SetFloatArray(int param, float[] value) => _Shader.SetFloats(param, value); + public void SetInteger(int param, int value) => _Shader.SetInt(param, value); + public void SetBoolean(int param, bool value) => _Shader.SetBool(param, value); + public void SetTexture(int param, Texture value) => _Shader.SetTexture(_Kernel, param, value); + public void SetBuffer(int param, ComputeBuffer value) => _Shader.SetBuffer(_Kernel, param, value); + public void SetConstantBuffer(int param, ComputeBuffer value) => _Shader.SetConstantBuffer(param, value, 0, value.stride); + public void SetVector(int param, Vector4 value) => _Shader.SetVector(param, value); + public void SetVectorArray(int param, Vector4[] value) => _Shader.SetVectorArray(param, value); + public void SetMatrix(int param, Matrix4x4 value) => _Shader.SetMatrix(param, value); + + public void GetBlock() { } + public void SetBlock() { } + + // Non-Interface Methods + public void SetKeyword(in LocalKeyword keyword, bool value) => _Shader.SetKeyword(keyword, value); + public void Dispatch(int x, int y, int z) => _Shader.Dispatch(_Kernel, x, y, z); + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/PropertyWrapper.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/PropertyWrapper.cs.meta new file mode 100644 index 0000000..159cdea --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/PropertyWrapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b2659ec9b44b34272a21ea388cd354d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RTHandles.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RTHandles.cs new file mode 100644 index 0000000..30eed4a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RTHandles.cs @@ -0,0 +1,37 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// RTHandles for Built-In Render Pipeline. +// We cannot call dispose ourselves, but it does not seem to be a problem. + +using UnityEngine; + +namespace WaveHarmonic.Crest.Utility +{ + static class RTHandles + { + public static void Initialize() + { + if (!RenderPipelineHelper.IsLegacy) + { + return; + } + + // Check whether already initialized. + if (UnityEngine.Rendering.RTHandles.maxWidth > 1) + { + return; + } + + UnityEngine.Rendering.RTHandles.Initialize(Screen.width, Screen.height); + UnityEngine.Rendering.RTHandles.SetHardwareDynamicResolutionState(false); + } + + public static void OnBeginCameraRendering(Camera camera) + { + // Forget Dynamic Scaling, as is broken for Shader Graph and Post-Processing anyway. + // The only foreseeable problem is if a third party calls this with a different size. + UnityEngine.Rendering.RTHandles.SetReferenceSize(camera.pixelWidth, camera.pixelHeight); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RTHandles.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RTHandles.cs.meta new file mode 100644 index 0000000..9096bd4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RTHandles.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fed5f2fe3fcaa450f9c621080f7989ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderGraphUtility.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderGraphUtility.cs new file mode 100644 index 0000000..7c9309b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderGraphUtility.cs @@ -0,0 +1,84 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP +#if UNITY_6000_0_OR_NEWER + +using System.Reflection; +using System.Runtime.CompilerServices; +using UnityEngine.Rendering; +using UnityEngine.Rendering.RenderGraphModule; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + static class RenderGraphHelper + { + public struct Handle + { + RTHandle _RTHandle; + TextureHandle _TextureHandle; + + public readonly RTHandle Texture { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _RTHandle ?? _TextureHandle; } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator Handle(RTHandle handle) => new() { _RTHandle = handle }; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator Handle(TextureHandle handle) => new() { _TextureHandle = handle }; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator RTHandle(Handle texture) => texture.Texture; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator TextureHandle(Handle texture) => texture._TextureHandle; + } + + static readonly FieldInfo s_WrappedContext = typeof(UnsafeGraphContext).GetField("wrappedContext", BindingFlags.NonPublic | BindingFlags.Instance); + + public static ScriptableRenderContext GetRenderContext(this UnsafeGraphContext unsafeContext) + { + return ((InternalRenderGraphContext)s_WrappedContext.GetValue(unsafeContext)).renderContext; + } + + public static ContextContainer GetFrameData(this ref RenderingData renderingData) + { + return renderingData.frameData; + } + + internal class PassData + { +#pragma warning disable IDE1006 // Naming Styles + public UniversalCameraData cameraData; + public UniversalRenderingData renderingData; + public Handle colorTargetHandle; + public Handle depthTargetHandle; +#pragma warning restore IDE1006 // Naming Styles + + public void Init(ContextContainer frameData, IUnsafeRenderGraphBuilder builder = null) + { + var resources = frameData.Get(); + cameraData = frameData.Get(); + renderingData = frameData.Get(); + + if (builder == null) + { +#pragma warning disable CS0618 // Type or member is obsolete + colorTargetHandle = cameraData.renderer.cameraColorTargetHandle; + depthTargetHandle = cameraData.renderer.cameraDepthTargetHandle; +#pragma warning restore CS0618 // Type or member is obsolete + } + else + { + colorTargetHandle = resources.activeColorTexture; + depthTargetHandle = resources.activeDepthTexture; + builder.UseTexture(colorTargetHandle, AccessFlags.ReadWrite); + builder.UseTexture(depthTargetHandle, AccessFlags.ReadWrite); + } + } + } + } +} + +#endif // UNITY_6000_0_OR_NEWER +#endif // d_UnityURP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderGraphUtility.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderGraphUtility.cs.meta new file mode 100644 index 0000000..4e04156 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderGraphUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ed778baa1b8804c5ca0074af8b68f7e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineCompatibilityHelper.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineCompatibilityHelper.cs new file mode 100644 index 0000000..1607bb7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineCompatibilityHelper.cs @@ -0,0 +1,169 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + static class RenderPipelineCompatibilityHelper + { + // Taken from: + // https://github.com/Unity-Technologies/Graphics/blob/19ec161f3f752db865597374b3ad1b3eaf110097/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs#L588-L634 + + /// + /// Return true if handle does not match descriptor + /// + /// RTHandle to check (can be null) + /// Descriptor for the RTHandle to match + /// Filtering mode of the RTHandle. + /// Addressing mode of the RTHandle. + /// Set to true if the depth buffer should be used as a shadow map. + /// Anisotropic filtering level. + /// Bias applied to mipmaps during filtering. + /// Name of the RTHandle. + /// Check if the RTHandle has auto scaling enabled if not, check the widths and heights + /// + internal static bool RTHandleNeedsReAlloc( + RTHandle handle, + in RenderTextureDescriptor descriptor, + FilterMode filterMode, + TextureWrapMode wrapMode, + bool isShadowMap, + int anisoLevel, + float mipMapBias, + string name, + bool scaled) + { + if (handle == null || handle.rt == null) + return true; + if (handle.useScaling != scaled) + return true; + if (!scaled && (handle.rt.width != descriptor.width || handle.rt.height != descriptor.height)) + return true; + return + handle.rt.descriptor.depthBufferBits != descriptor.depthBufferBits || + (handle.rt.descriptor.depthBufferBits == (int)DepthBits.None && !isShadowMap && handle.rt.descriptor.graphicsFormat != descriptor.graphicsFormat) || + handle.rt.descriptor.dimension != descriptor.dimension || + handle.rt.descriptor.enableRandomWrite != descriptor.enableRandomWrite || + handle.rt.descriptor.useMipMap != descriptor.useMipMap || + handle.rt.descriptor.autoGenerateMips != descriptor.autoGenerateMips || + handle.rt.descriptor.msaaSamples != descriptor.msaaSamples || + handle.rt.descriptor.bindMS != descriptor.bindMS || + handle.rt.descriptor.useDynamicScale != descriptor.useDynamicScale || + handle.rt.descriptor.memoryless != descriptor.memoryless || + handle.rt.filterMode != filterMode || + handle.rt.wrapMode != wrapMode || + handle.rt.anisoLevel != anisoLevel || + handle.rt.mipMapBias != mipMapBias || + handle.name != name; + } + + + // https://github.com/Unity-Technologies/Graphics/blob/19ec161f3f752db865597374b3ad1b3eaf110097/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs#L666-L695 + + /// + /// Re-allocate fixed-size RTHandle if it is not allocated or doesn't match the descriptor + /// + /// RTHandle to check (can be null) + /// Descriptor for the RTHandle to match + /// Filtering mode of the RTHandle. + /// Addressing mode of the RTHandle. + /// Set to true if the depth buffer should be used as a shadow map. + /// Anisotropic filtering level. + /// Bias applied to mipmaps during filtering. + /// Name of the RTHandle. + /// + public static bool ReAllocateIfNeeded( + ref RTHandle handle, + in RenderTextureDescriptor descriptor, + FilterMode filterMode = FilterMode.Point, + TextureWrapMode wrapMode = TextureWrapMode.Repeat, + bool isShadowMap = false, + int anisoLevel = 1, + float mipMapBias = 0, + string name = "") + { + if (RTHandleNeedsReAlloc(handle, descriptor, filterMode, wrapMode, isShadowMap, anisoLevel, mipMapBias, name, false)) + { + handle?.Release(); + handle = RTHandles.Alloc(descriptor, filterMode, wrapMode, isShadowMap, anisoLevel, mipMapBias, name); + return true; + } + return false; + } + + // https://github.com/Unity-Technologies/Graphics/blob/19ec161f3f752db865597374b3ad1b3eaf110097/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs#L697-L729 + + /// + /// Re-allocate dynamically resized RTHandle if it is not allocated or doesn't match the descriptor + /// + /// RTHandle to check (can be null) + /// Constant scale for the RTHandle size computation. + /// Descriptor for the RTHandle to match + /// Filtering mode of the RTHandle. + /// Addressing mode of the RTHandle. + /// Set to true if the depth buffer should be used as a shadow map. + /// Anisotropic filtering level. + /// Bias applied to mipmaps during filtering. + /// Name of the RTHandle. + /// If the RTHandle should be re-allocated + public static bool ReAllocateIfNeeded( + ref RTHandle handle, + Vector2 scaleFactor, + in RenderTextureDescriptor descriptor, + FilterMode filterMode = FilterMode.Point, + TextureWrapMode wrapMode = TextureWrapMode.Repeat, + bool isShadowMap = false, + int anisoLevel = 1, + float mipMapBias = 0, + string name = "") + { + var usingConstantScale = handle != null && handle.useScaling && handle.scaleFactor == scaleFactor; + if (!usingConstantScale || RTHandleNeedsReAlloc(handle, descriptor, filterMode, wrapMode, isShadowMap, anisoLevel, mipMapBias, name, true)) + { + handle?.Release(); + handle = RTHandles.Alloc(scaleFactor, descriptor, filterMode, wrapMode, isShadowMap, anisoLevel, mipMapBias, name); + return true; + } + return false; + } + + // https://github.com/Unity-Technologies/Graphics/blob/19ec161f3f752db865597374b3ad1b3eaf110097/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs#L731-L764 + + /// + /// Re-allocate dynamically resized RTHandle if it is not allocated or doesn't match the descriptor + /// + /// RTHandle to check (can be null) + /// Function used for the RTHandle size computation. + /// Descriptor for the RTHandle to match + /// Filtering mode of the RTHandle. + /// Addressing mode of the RTHandle. + /// Set to true if the depth buffer should be used as a shadow map. + /// Anisotropic filtering level. + /// Bias applied to mipmaps during filtering. + /// Name of the RTHandle. + /// If an allocation was done + public static bool ReAllocateIfNeeded( + ref RTHandle handle, + ScaleFunc scaleFunc, + in RenderTextureDescriptor descriptor, + FilterMode filterMode = FilterMode.Point, + TextureWrapMode wrapMode = TextureWrapMode.Repeat, + bool isShadowMap = false, + int anisoLevel = 1, + float mipMapBias = 0, + string name = "") + { + var usingScaleFunction = handle != null && handle.useScaling && handle.scaleFactor == Vector2.zero; + if (!usingScaleFunction || RTHandleNeedsReAlloc(handle, descriptor, filterMode, wrapMode, isShadowMap, anisoLevel, mipMapBias, name, true)) + { + handle?.Release(); + handle = RTHandles.Alloc(scaleFunc, descriptor, filterMode, wrapMode, isShadowMap, anisoLevel, mipMapBias, name); + return true; + } + + return false; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineCompatibilityHelper.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineCompatibilityHelper.cs.meta new file mode 100644 index 0000000..c87ea2f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineCompatibilityHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39dff4a7749404569b14b7395adc361a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineHelper.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineHelper.cs new file mode 100644 index 0000000..4eeaecc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineHelper.cs @@ -0,0 +1,57 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + enum RenderPipeline + { + Legacy, + HighDefinition, + Universal, + } + + sealed class RenderPipelineHelper + { + public static RenderPipeline RenderPipeline => GraphicsSettings.currentRenderPipeline switch + { +#if d_UnityHDRP + HDRenderPipelineAsset => RenderPipeline.HighDefinition, +#endif +#if d_UnityURP + UniversalRenderPipelineAsset => RenderPipeline.Universal, +#endif + _ => RenderPipeline.Legacy, + }; + + // GraphicsSettings.currentRenderPipeline could be from the graphics setting or current quality level. + public static bool IsLegacy => GraphicsSettings.currentRenderPipeline == null; + + public static bool IsUniversal + { + get + { +#if d_UnityURP + return GraphicsSettings.currentRenderPipeline is UniversalRenderPipelineAsset; +#else + return false; +#endif + } + } + + public static bool IsHighDefinition + { + get + { +#if d_UnityHDRP + return GraphicsSettings.currentRenderPipeline is HDRenderPipelineAsset; +#else + return false; +#endif + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineHelper.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineHelper.cs.meta new file mode 100644 index 0000000..f76ce32 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/RenderPipelineHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00e1b88667d3544fd875d2f9184fdd78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.XR.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.XR.cs new file mode 100644 index 0000000..a6d55ec --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.XR.cs @@ -0,0 +1,261 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// ENABLE_VR is defined if the platform supports XR. +// d_UnityModuleVR is defined if the VR module is installed. +// VR module depends on XR module (which does nothing by itself) so we only need to check the VR module. +#if ENABLE_VR && d_UnityModuleVR +#define _XR_ENABLED +#endif + +using System.Collections.Generic; +using System.Diagnostics; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering.Universal; +using UnityEngine.XR; + +namespace WaveHarmonic.Crest +{ + static partial class Rendering + { + // Adaptor layer for XR module similar to Unity's XRGraphics/XRSRPSettings. + // We cannot use theirs as they keep on renaming it… + + public static bool EnabledXR + { + get + { +#if _XR_ENABLED + return XRSettings.enabled; +#else + return false; +#endif + } + } + + static bool SinglePassXR + { + get + { +#if _XR_ENABLED + return XRSettings.enabled && (XRSettings.stereoRenderingMode is XRSettings.StereoRenderingMode.SinglePassInstanced or XRSettings.StereoRenderingMode.SinglePassMultiview); +#else + return false; +#endif + } + } + + static bool MultiPassXR + { + get + { +#if _XR_ENABLED + return XRSettings.enabled && XRSettings.stereoRenderingMode is XRSettings.StereoRenderingMode.MultiPass; +#else + return false; +#endif + } + } + + public static partial class BIRP + { + [Conditional("_XR_ENABLED")] + public static void EnableXR(CommandBuffer commands, Camera camera) + { +#if _XR_ENABLED + if (!SinglePassXR || !camera.stereoEnabled) + { + return; + } + + commands.EnableShaderKeyword("STEREO_INSTANCING_ON"); +#endif + } + + [Conditional("_XR_ENABLED")] + public static void DisableXR(CommandBuffer commands, Camera camera) + { +#if _XR_ENABLED + if (!SinglePassXR || !camera.stereoEnabled) + { + return; + } + + commands.DisableShaderKeyword("STEREO_INSTANCING_ON"); +#endif + } + } + + + // + // Stereo Rendering + // + +#if _XR_ENABLED + public static partial class BIRP + { + // NOTE: This is the same value as Unity, but in the future it could be higher. + const int k_MaximumViewsXR = 2; + + static partial class ShaderIDs + { + public static readonly int s_StereoInverseViewProjection = Shader.PropertyToID("_Crest_StereoInverseViewProjection"); + } + + static readonly List s_DisplayListXR = new(); + + // Unity only supports one display right now. + static XRDisplaySubsystem DisplayXR => XRSettings.enabled ? s_DisplayListXR[0] : null; + + static Matrix4x4[] InverseViewProjectionMatrixXR { get; set; } = new Matrix4x4[2]; + + static Texture2DArray s_WhiteTextureXR = null; + public static Texture2DArray WhiteTextureXR + { + get + { + if (s_WhiteTextureXR == null) + { + s_WhiteTextureXR = TextureArrayHelpers.CreateTexture2DArray(Texture2D.whiteTexture, k_MaximumViewsXR); + s_WhiteTextureXR.name = "_Crest_WhiteTextureXR"; + } + + return s_WhiteTextureXR; + } + } + + public static void SetMatricesXR(Camera camera) + { + if (!camera.stereoEnabled || !SinglePassXR) + { + return; + } + + SubsystemManager.GetSubsystems(s_DisplayListXR); + // XR SPI only has one pass by definition. + DisplayXR.GetRenderPass(renderPassIndex: 0, out var xrPass); + xrPass.GetRenderParameter(camera, renderParameterIndex: 0, out var xrLeftEye); + xrPass.GetRenderParameter(camera, renderParameterIndex: 1, out var xrRightEye); + // We must opt for renderIntoTexture for Unity to handle Y flip. + InverseViewProjectionMatrixXR[0] = (GL.GetGPUProjectionMatrix(xrLeftEye.projection, true) * xrLeftEye.view).inverse; + InverseViewProjectionMatrixXR[1] = (GL.GetGPUProjectionMatrix(xrRightEye.projection, true) * xrRightEye.view).inverse; + Shader.SetGlobalMatrixArray(ShaderIDs.s_StereoInverseViewProjection, InverseViewProjectionMatrixXR); + } + } +#endif // _XR_ENABLED + +#if d_UnityURP + public static class URP + { + [Conditional("_XR_ENABLED")] + public static void EnableXR(CommandBuffer commands, CameraData camera) + { +#if _XR_ENABLED + // We need to check the mask or it will cause entire pipeline to output black. Appears to only affect URP. + if (!SinglePassXR || !camera.xrRendering || camera.camera.stereoTargetEye != StereoTargetEyeMask.Both) + { + return; + } + + commands.EnableShaderKeyword("STEREO_INSTANCING_ON"); +#endif + } + + [Conditional("_XR_ENABLED")] + public static void DisableXR(CommandBuffer commands, CameraData camera) + { +#if _XR_ENABLED + if (!SinglePassXR || !camera.xrRendering || camera.camera.stereoTargetEye != StereoTargetEyeMask.Both) + { + return; + } + + commands.DisableShaderKeyword("STEREO_INSTANCING_ON"); +#endif + } + +#if UNITY_6000_0_OR_NEWER + [Conditional("_XR_ENABLED")] + public static void EnableXR(CommandBuffer commands, UniversalCameraData camera) + { +#if _XR_ENABLED + // We need to check the mask or it will cause entire pipeline to output black. Appears to only affect URP. + if (!SinglePassXR || !camera.xrRendering || camera.camera.stereoTargetEye != StereoTargetEyeMask.Both) + { + return; + } + + commands.EnableShaderKeyword("STEREO_INSTANCING_ON"); +#endif + } + + [Conditional("_XR_ENABLED")] + public static void DisableXR(CommandBuffer commands, UniversalCameraData camera) + { +#if _XR_ENABLED + if (!SinglePassXR || !camera.xrRendering || camera.camera.stereoTargetEye != StereoTargetEyeMask.Both) + { + return; + } + + commands.DisableShaderKeyword("STEREO_INSTANCING_ON"); +#endif + } +#endif // UNITY_6000_0_OR_NEWER + } +#endif // d_UnityURP + +#if d_UnityHDRP + public static class HDRP + { + [Conditional("_XR_ENABLED")] + public static void EnableXR(CommandBuffer commands, HDAdditionalCameraData camera) + { +#if _XR_ENABLED + if (!SinglePassXR || camera == null || !camera.xrRendering) + { + return; + } + + commands.EnableShaderKeyword("STEREO_INSTANCING_ON"); +#endif + } + + [Conditional("_XR_ENABLED")] + public static void DisableXR(CommandBuffer commands, HDAdditionalCameraData camera) + { +#if _XR_ENABLED + if (!SinglePassXR || camera == null || !camera.xrRendering) + { + return; + } + + commands.DisableShaderKeyword("STEREO_INSTANCING_ON"); +#endif + } + + public static bool SkipPassXR(ref int index, HDAdditionalCameraData data) + { +#if _XR_ENABLED + if (MultiPassXR && data != null && data.xrRendering) + { + // Alternate between left and right eye. + index += 1; + index %= 2; + } + else +#endif + + { + index = -1; + } + + // Skip if rendering the right eye. + return index == 1; + } + } +#endif // d_UnityHDRP + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.XR.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.XR.cs.meta new file mode 100644 index 0000000..b2da901 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.XR.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: beeb15d60da12461bb224ab1b3a6a12a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.cs new file mode 100644 index 0000000..8ba7f11 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.cs @@ -0,0 +1,94 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if ENABLE_VR && d_UnityModuleVR +#define _XR_ENABLED +#endif + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.XR; + +namespace WaveHarmonic.Crest +{ + static partial class Rendering + { + public static partial class BIRP + { + static partial class ShaderIDs + { + public static readonly int s_InverseViewProjection = Shader.PropertyToID("_Crest_InverseViewProjection"); + } + + public static Texture GetWhiteTexture(Camera camera) + { +#if _XR_ENABLED + if (camera.stereoEnabled && SinglePassXR) + { + return WhiteTextureXR; + } +#endif + + return Texture2D.whiteTexture; + } + + public static void SetMatrices(Camera camera) + { + Shader.SetGlobalMatrix(ShaderIDs.s_InverseViewProjection, (GL.GetGPUProjectionMatrix(camera.projectionMatrix, true) * camera.worldToCameraMatrix).inverse); + +#if _XR_ENABLED + SetMatricesXR(camera); +#endif + } + + public enum FrameBufferFormatOverride + { + None, + LDR, + HDR, + } + + public static RenderTextureDescriptor GetCameraTargetDescriptor(Camera camera, FrameBufferFormatOverride hdrOverride = FrameBufferFormatOverride.None) + { + RenderTextureDescriptor descriptor; + +#if _XR_ENABLED + if (camera.stereoEnabled) + { + // Will not set the following correctly: + // - HDR format + descriptor = XRSettings.eyeTextureDesc; + } + else +#endif + { + // As recommended by Unity, in 2021.2 using SystemInfo.GetGraphicsFormat with DefaultFormat.LDR is + // necessary or gamma color space texture is returned: + // https://docs.unity3d.com/ScriptReference/Experimental.Rendering.DefaultFormat.html + descriptor = new(camera.pixelWidth, camera.pixelHeight, SystemInfo.GetGraphicsFormat(DefaultFormat.LDR), 0); + } + + // Set HDR format. + if (camera.allowHDR && QualitySettings.activeColorSpace == ColorSpace.Linear) + { + var format = DefaultFormat.HDR; + + if (hdrOverride is not FrameBufferFormatOverride.None) + { + format = hdrOverride is FrameBufferFormatOverride.HDR ? DefaultFormat.HDR : DefaultFormat.LDR; + } +#if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS + else + { + format = DefaultFormat.LDR; + } +#endif + + descriptor.graphicsFormat = SystemInfo.GetGraphicsFormat(format); + } + + return descriptor; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.cs.meta new file mode 100644 index 0000000..291243d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/Rendering.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 33d8472e9ea11461b8bf02d7c4a72ec4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/TextureArrayHelpers.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/TextureArrayHelpers.cs new file mode 100644 index 0000000..352cb7b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/TextureArrayHelpers.cs @@ -0,0 +1,45 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + static class TextureArrayHelpers + { + internal const int k_SmallTextureSize = 4; + + public static Texture2D CreateTexture2D(Color color, TextureFormat format) + { + var texture = new Texture2D(k_SmallTextureSize, k_SmallTextureSize, format, false, false); + var pixels = new Color[texture.height * texture.width]; + for (var i = 0; i < pixels.Length; i++) + { + pixels[i] = color; + } + texture.SetPixels(pixels); + texture.Apply(); + return texture; + } + + public static Texture2DArray CreateTexture2DArray(Texture2D texture, int depth) + { + var array = new Texture2DArray( + k_SmallTextureSize, k_SmallTextureSize, + depth, + texture.format, + false, + false + ); + + for (var textureArrayIndex = 0; textureArrayIndex < array.depth; textureArrayIndex++) + { + Graphics.CopyTexture(texture, 0, 0, array, textureArrayIndex, 0); + } + + array.Apply(); + + return array; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/TextureArrayHelpers.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/TextureArrayHelpers.cs.meta new file mode 100644 index 0000000..8378c9d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Rendering/TextureArrayHelpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 18d910d25ea794953b63417c1a72d587 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Singleton.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Singleton.cs new file mode 100644 index 0000000..c2271ea --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Singleton.cs @@ -0,0 +1,65 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Based on Unity's ScriptableSingleton but works with Assets and Packages +// directory. Works in builds except loading from file so it will need a +// reference in the scene for it to instantiate. + +using System; +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest.Utility +{ + [AttributeUsage(AttributeTargets.Class)] + sealed class FilePath : Attribute + { + public readonly string _Path; + + public FilePath(string path) + { + _Path = path; + } + } + + abstract class ScriptableSingleton : ScriptableObject where T : ScriptableObject + { + public static T Instance { get; private set; } + + public ScriptableSingleton() + { + // Constructor will be called during run-time if there is a asset reference saved + // in a scene or preloaded assets. + // BUG: There appears to be a Unity bug where this will not happen which required + // recreating the asset. Perhaps after renaming the script. + Instance = this as T; + } + +#if UNITY_EDITOR + static string GetFilePath() + { + foreach (var attribute in typeof(T).GetCustomAttributes(inherit: true)) + { + if (attribute is FilePath f) + { + return f._Path; + } + } + + return string.Empty; + } + + internal static void LoadFromAsset() + { + if (Instance != null) + { + return; + } + + // This will trigger the constructor and set Instance. But setting it here first + // prevents exceptions when data changes. + Instance = AssetDatabase.LoadAssetAtPath(GetFilePath()); + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Singleton.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Singleton.cs.meta new file mode 100644 index 0000000..4ac8d69 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/Singleton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b7f4d7de990a4a049d9aa9a442fa866 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.asmdef b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.asmdef new file mode 100644 index 0000000..25d16eb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.asmdef @@ -0,0 +1,41 @@ +{ + "name": "WaveHarmonic.Crest.Shared", + "rootNamespace": "", + "references": [ + "GUID:df380645f10b7bc4b97d4f5eb6303d95", + "GUID:457756d89b35d2941b3e7b37b4ece6f1", + "GUID:15fc0a57446b3144c949da3e2b9737a9" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER" + ], + "versionDefines": [ + { + "name": "com.unity.modules.terrain", + "expression": "", + "define": "d_Unity_Terrain" + }, + { + "name": "com.unity.modules.xr", + "expression": "", + "define": "d_UnityModuleVR" + }, + { + "name": "com.unity.render-pipelines.high-definition", + "expression": "", + "define": "d_UnityHDRP" + }, + { + "name": "com.unity.render-pipelines.universal", + "expression": "", + "define": "d_UnityURP" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.asmdef.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.asmdef.meta new file mode 100644 index 0000000..42b3504 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/WaveHarmonic.Crest.Shared.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 056ff2a5b2f124d468c6655552acdca5 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR.meta new file mode 100644 index 0000000..77cab1a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a1193a5fe7614861bf6312bb57afe80 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR/XRHelpers.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR/XRHelpers.cs new file mode 100644 index 0000000..0fc2a48 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR/XRHelpers.cs @@ -0,0 +1,4 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Empty. diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR/XRHelpers.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR/XRHelpers.cs.meta new file mode 100644 index 0000000..83171eb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Utility/Shared/XR/XRHelpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3893707ad62c4444985948429b69651 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume.meta new file mode 100644 index 0000000..5f73296 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30ac7884da0be4f7ab600bece6ba46d1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPass.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPass.cs new file mode 100644 index 0000000..409367f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPass.cs @@ -0,0 +1,109 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + sealed class UnderwaterEffectPass + { + readonly UnderwaterRenderer _Renderer; + + RTHandle _ColorTexture; + + RTHandle _ColorTarget; + RTHandle _DepthTarget; + + + readonly System.Action _CopyColorTexture; + readonly System.Action _SetRenderTargetToBackBuffers; + + public UnderwaterEffectPass(UnderwaterRenderer renderer) + { + _Renderer = renderer; + _CopyColorTexture = new(CopyColorTexture); + _SetRenderTargetToBackBuffers = new(SetRenderTargetToBackBuffers); + } + + void CopyColorTexture(CommandBuffer buffer) + { + Blitter.BlitCameraTexture(buffer, _ColorTarget, _ColorTexture); + CoreUtils.SetRenderTarget(buffer, _ColorTarget, _DepthTarget, ClearFlag.None); + } + + void SetRenderTargetToBackBuffers(CommandBuffer commands) + { + CoreUtils.SetRenderTarget(commands, _ColorTarget, _DepthTarget, ClearFlag.None); + } + + public void Allocate(GraphicsFormat format) + { + if (_Renderer.RenderBeforeTransparency && !_Renderer._NeedsColorTexture) + { + return; + } + + // TODO: There may other settings we want to set or bring in. Not MSAA since this is a resolved texture. + _ColorTexture = RTHandles.Alloc + ( + Vector2.one, + TextureXR.slices, + dimension: TextureXR.dimension, + colorFormat: format, + depthBufferBits: DepthBits.None, + useDynamicScale: true, + wrapMode: TextureWrapMode.Clamp, + name: "_Crest_UnderwaterCameraColorTexture" + ); + } + + public void ReAllocate(RenderTextureDescriptor descriptor) + { + if (_Renderer.RenderBeforeTransparency && !_Renderer._NeedsColorTexture) + { + return; + } + + // Descriptor will not have MSAA bound. + RenderPipelineCompatibilityHelper.ReAllocateIfNeeded(ref _ColorTexture, descriptor, name: "_Crest_UnderwaterCameraColorTexture"); + } + + public void Release() + { + _ColorTexture?.Release(); + _ColorTexture = null; + } + + public void Execute(Camera camera, CommandBuffer buffer, RTHandle color, RTHandle depth, MaterialPropertyBlock mpb = null) + { + _Renderer.UpdateEffectMaterial(camera); + + _ColorTarget = color; + _DepthTarget = depth; + + if (!_Renderer.RenderBeforeTransparency || _Renderer._NeedsColorTexture) + { + buffer.SetGlobalTexture(UnderwaterRenderer.ShaderIDs.s_CameraColorTexture, _ColorTexture); + } + + if (!_Renderer.RenderBeforeTransparency) + { + CopyColorTexture(buffer); + } + else + { + // TODO: needed for HDRP, but can set it on pass instead. + CoreUtils.SetRenderTarget(buffer, _ColorTarget, _DepthTarget, ClearFlag.None); + } + + _Renderer.ExecuteEffect(camera, buffer, _CopyColorTexture, _SetRenderTargetToBackBuffers, mpb); + + // The last pass (uber post) does not resolve the texture. + // Although, this is wasteful if the pass after this does a resolve. + // Possibly a bug with Unity? + buffer.ResolveAntiAliasedSurface(color); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPass.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPass.cs.meta new file mode 100644 index 0000000..e649fcd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPass.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c581581e08ff40e689d952358cea7a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassHDRP.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassHDRP.cs new file mode 100644 index 0000000..5d20719 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassHDRP.cs @@ -0,0 +1,154 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest +{ + sealed class UnderwaterEffectPassHDRP : CustomPass + { + const string k_Name = "Underwater Effect"; + + static UnderwaterRenderer s_Renderer; + static UnderwaterEffectPass s_UnderwaterEffectPass; + internal static UnderwaterEffectPassHDRP s_Instance; + static CopyDepthBufferPassHDRP s_CopyDepthBufferPassHDRP; + + static ShaderTagId[] s_ForwardShaderTags; + + public static void Enable(UnderwaterRenderer renderer) + { + var gameObject = CustomPassHelpers.CreateOrUpdate + ( + parent: renderer._Water.Container.transform, + k_Name, + hide: !renderer._Water._Debug._ShowHiddenObjects + ); + + CustomPassHelpers.CreateOrUpdate + ( + gameObject, + ref s_CopyDepthBufferPassHDRP, + UnderwaterRenderer.k_DrawVolume, + CustomPassInjectionPoint.AfterOpaqueDepthAndNormal + ); + + var isBeforeTransparentPass = renderer.RenderBeforeTransparency; + + CustomPassHelpers.CreateOrUpdate + ( + gameObject, + ref s_Instance, + UnderwaterRenderer.k_DrawVolume, + GetInjectionPoint(isBeforeTransparentPass), + // Higher number (priority) means execute earlier. Volume executes first. + priority: 1 + ); + + s_Renderer = renderer; + s_UnderwaterEffectPass = new(renderer); + } + + public static void Disable() + { + // It should be safe to rely on this reference for this reference to fail. + if (s_Instance != null && s_Instance._GameObject != null) + { + // Will also trigger Cleanup below. + s_Instance._GameObject.SetActive(false); + } + } + + static CustomPassInjectionPoint GetInjectionPoint(bool isBeforeTransparentPass) + { + return isBeforeTransparentPass + ? CustomPassInjectionPoint.BeforeTransparent + : CustomPassInjectionPoint.BeforePostProcess; + } + + internal void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + s_CopyDepthBufferPassHDRP.enabled = s_Renderer.UseStencilBuffer; + s_Instance._Volume.injectionPoint = GetInjectionPoint(s_Renderer.RenderBeforeTransparency); + } + + protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) + { + var asset = GraphicsSettings.currentRenderPipeline as HDRenderPipelineAsset; + + // Developers have a choice with the color buffer format. There is also a custom buffer buffer format but + // that is not relevant here. This will not cover the format change when scene filtering as Setup/Cleanup is + // not executed for this change. + s_UnderwaterEffectPass.Allocate((GraphicsFormat)asset.currentPlatformRenderPipelineSettings.colorBufferFormat); + + // Taken from: + // https://github.com/Unity-Technologies/Graphics/blob/778ddac6207ade1689999b95380cd835b0669f2d/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs#L136-L142 + s_ForwardShaderTags ??= new[] + { + HDShaderPassNames.s_ForwardName, // HD Lit shader + HDShaderPassNames.s_ForwardOnlyName, // HD Unlit shader + HDShaderPassNames.s_SRPDefaultUnlitName, // Cross SRP Unlit shader + }; + } + + protected override void Cleanup() + { + s_UnderwaterEffectPass?.Release(); + } + + protected override void Execute(CustomPassContext context) + { + var camera = context.hdCamera.camera; + + if (!s_Renderer.ShouldRender(camera, UnderwaterRenderer.Pass.Effect)) + { + return; + } + + // Create a separate stencil buffer context by using a depth buffer copy if needed. + var depthBuffer = s_Renderer.UseStencilBuffer + ? s_CopyDepthBufferPassHDRP._DepthBufferCopy + : context.cameraDepthBuffer; + + s_UnderwaterEffectPass.Execute(camera, context.cmd, context.cameraColorBuffer, depthBuffer, context.propertyBlock); + } + } + + sealed class CopyDepthBufferPassHDRP : CustomPass + { + public RTHandle _DepthBufferCopy; + + protected override void Execute(CustomPassContext context) + { + // Multiple cameras could have different settings. + RenderPipelineCompatibilityHelper.ReAllocateIfNeeded + ( + ref _DepthBufferCopy, + context.cameraDepthBuffer.rt.descriptor, + FilterMode.Point, + name: "_Crest_UnderwaterCopiedDepthBuffer" + ); + + var buffer = context.cmd; + + // NOTE: previously we cleared the target depth first due to artifacts. + buffer.CopyTexture(context.cameraDepthBuffer.rt, _DepthBufferCopy.rt); + + // Clear the stencil component just in case. + CoreUtils.SetRenderTarget(buffer, BuiltinRenderTextureType.None, _DepthBufferCopy, ClearFlag.Stencil); + } + + protected override void Cleanup() + { + _DepthBufferCopy?.Release(); + _DepthBufferCopy = null; + } + } +} + +#endif // d_UnityHDRP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassHDRP.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassHDRP.cs.meta new file mode 100644 index 0000000..888a568 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassHDRP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03d7c1db420e64f7c9894f9c2bdaae4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.RenderGraph.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.RenderGraph.cs new file mode 100644 index 0000000..209547f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.RenderGraph.cs @@ -0,0 +1,122 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP +#if UNITY_6000_0_OR_NEWER + +using UnityEngine.Rendering; +using UnityEngine.Rendering.RenderGraphModule; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + partial class UnderwaterEffectPassURP + { + readonly RenderGraphHelper.PassData _PassData = new(); + + public override void RecordRenderGraph(RenderGraph graph, ContextContainer frame) + { + using (var builder = graph.AddUnsafePass(k_Name, out var data)) + { + data.Init(frame, builder); + builder.AllowPassCulling(false); + + builder.SetRenderFunc((data, context) => + { + var buffer = CommandBufferHelpers.GetNativeCommandBuffer(context.cmd); + OnSetup(buffer, data); + Execute(context.GetRenderContext(), buffer, data); + }); + } + } + + [System.Obsolete] + public override void OnCameraSetup(CommandBuffer buffer, ref RenderingData data) + { + _PassData.Init(data.GetFrameData()); + } + + [System.Obsolete] + public override void Execute(ScriptableRenderContext context, ref RenderingData data) + { + _PassData.Init(data.GetFrameData()); + var buffer = CommandBufferPool.Get(k_Name); + OnSetup(buffer, _PassData); + Execute(context, buffer, _PassData); + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); + } + } + + partial class CopyDepthBufferPassURP + { + class PassData + { +#pragma warning disable IDE1006 // Naming Styles + public UniversalCameraData cameraData; + public RenderGraphHelper.Handle colorTargetHandle; + public RenderGraphHelper.Handle depthTargetHandle; +#pragma warning restore IDE1006 // Naming Styles + + public void Init(ContextContainer frameData, IUnsafeRenderGraphBuilder builder = null) + { + var resources = frameData.Get(); + cameraData = frameData.Get(); + + if (builder == null) + { +#pragma warning disable CS0618 // Type or member is obsolete + colorTargetHandle = cameraData.renderer.cameraColorTargetHandle; + depthTargetHandle = cameraData.renderer.cameraDepthTargetHandle; +#pragma warning restore CS0618 // Type or member is obsolete + } + else + { + // We need reset render targets to these before the next pass, but we do not read + // or write to the color target. + colorTargetHandle = resources.activeColorTexture; + depthTargetHandle = resources.activeDepthTexture; + builder.UseTexture(depthTargetHandle, AccessFlags.ReadWrite); + } + } + } + + readonly PassData _PassData = new(); + + public override void RecordRenderGraph(RenderGraph graph, ContextContainer frame) + { + using (var builder = graph.AddUnsafePass(k_Name, out var data)) + { + data.Init(frame, builder); + builder.AllowPassCulling(false); + + builder.SetRenderFunc((data, context) => + { + var buffer = CommandBufferHelpers.GetNativeCommandBuffer(context.cmd); + OnSetup(buffer, data); + Execute(context.GetRenderContext(), buffer, data); + }); + } + } + + [System.Obsolete] + public override void OnCameraSetup(CommandBuffer buffer, ref RenderingData data) + { + _PassData.Init(data.GetFrameData()); + } + + [System.Obsolete] + public override void Execute(ScriptableRenderContext context, ref RenderingData data) + { + _PassData.Init(data.GetFrameData()); + var buffer = CommandBufferPool.Get(k_Name); + OnSetup(buffer, _PassData); + Execute(context, buffer, _PassData); + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); + } + } +} + +#endif // UNITY_6000_0_OR_NEWER +#endif // d_UnityURP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.RenderGraph.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.RenderGraph.cs.meta new file mode 100644 index 0000000..02126ad --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.RenderGraph.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7fba7ac72b29f4b12a08eb07d80a2703 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.cs new file mode 100644 index 0000000..c15d6c4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.cs @@ -0,0 +1,220 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP + +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + sealed partial class UnderwaterEffectPassURP : ScriptableRenderPass + { + const string k_Name = "Crest.DrawWater/Volume"; + + UnderwaterRenderer _Renderer; + + internal static UnderwaterEffectPassURP s_Instance; + UnderwaterEffectPass _UnderwaterEffectPass; + CopyDepthBufferPassURP _CopyDepthBufferPass; + + RTHandle _ColorBuffer; + RTHandle _DepthBuffer; + + public UnderwaterEffectPassURP() + { + ConfigureInput(ScriptableRenderPassInput.Color | ScriptableRenderPassInput.Depth); + } + + public static void Enable(UnderwaterRenderer renderer) + { + if (s_Instance == null) + { + s_Instance = new(); + s_Instance._Renderer = renderer; + s_Instance._CopyDepthBufferPass = new(RenderPassEvent.AfterRenderingOpaques); + } + + RenderPipelineManager.activeRenderPipelineTypeChanged -= Disable; + RenderPipelineManager.activeRenderPipelineTypeChanged += Disable; + } + + public static void Disable() + { + RenderPipelineManager.activeRenderPipelineTypeChanged -= Disable; + + s_Instance?._UnderwaterEffectPass?.Release(); + s_Instance?._CopyDepthBufferPass?.Release(); + s_Instance = null; + } + + internal void EnqueuePass(ScriptableRenderContext context, Camera camera) + { + if (!_Renderer.ShouldRender(camera, UnderwaterRenderer.Pass.Effect)) + { + return; + } + + s_Instance.renderPassEvent = _Renderer.RenderBeforeTransparency ? WaterRenderer.k_WaterRenderPassEvent : RenderPassEvent.AfterRenderingTransparents; + + var renderer = camera.GetUniversalAdditionalCameraData().scriptableRenderer; + +#if UNITY_EDITOR + if (renderer == null) return; +#endif + + // Copy the depth buffer to create a new depth/stencil context. + if (_Renderer.UseStencilBuffer) + { + renderer.EnqueuePass(_CopyDepthBufferPass); + } + + // Set up internal pass which houses shared code for SRPs. + _UnderwaterEffectPass ??= new(_Renderer); + + renderer.EnqueuePass(s_Instance); + } + +#if UNITY_6000_0_OR_NEWER + bool _ErrorMissingColorTarget; + + void OnSetup(CommandBuffer buffer, RenderGraphHelper.PassData data) + { + _ColorBuffer = data.colorTargetHandle.Texture; + _DepthBuffer = data.depthTargetHandle.Texture; + + // Unity bug + if (_ColorBuffer?.rt == null) + { + if (!_ErrorMissingColorTarget) + { + Debug.LogError($"Crest: Your current URP setup has a Unity bug which prevents underwater from rendering on this camera ({data.cameraData.camera.name}). It is too complicated for us to advise which combination of settings are the issue (sorry), but they will be on either the URP asset or renderer file."); + _ErrorMissingColorTarget = true; + } + + return; + } + + // TODO: renderingData.cameraData.cameraTargetDescriptor? + _UnderwaterEffectPass.ReAllocate(_ColorBuffer.rt.descriptor); + } + + void Execute(ScriptableRenderContext context, CommandBuffer buffer, RenderGraphHelper.PassData data) + { + // Unity bug + if (_ColorBuffer?.rt == null) + { + return; + } + + if (_Renderer.UseStencilBuffer) + { + _DepthBuffer = _CopyDepthBufferPass._DepthBufferCopy; + } + + _UnderwaterEffectPass.Execute(data.cameraData.camera, buffer, _ColorBuffer, _DepthBuffer); + } +#else + public override void OnCameraSetup(CommandBuffer buffer, ref RenderingData data) + { + _ColorBuffer = data.cameraData.renderer.cameraColorTargetHandle; + _DepthBuffer = data.cameraData.renderer.cameraDepthTargetHandle; + + // TODO: renderingData.cameraData.cameraTargetDescriptor? + _UnderwaterEffectPass.ReAllocate(_ColorBuffer.rt.descriptor); + } + + public override void Execute(ScriptableRenderContext context, ref RenderingData data) + { + var buffer = CommandBufferPool.Get(k_Name); + + if (_Renderer.UseStencilBuffer) + { + _DepthBuffer = _CopyDepthBufferPass._DepthBufferCopy; + } + + _UnderwaterEffectPass.Execute(data.cameraData.camera, buffer, _ColorBuffer, _DepthBuffer); + + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); + } +#endif + } + + // Copies the depth buffer to avoid conflicts when using the stencil buffer. + sealed partial class CopyDepthBufferPassURP : ScriptableRenderPass + { + const string k_Name = "Crest Copy Depth Buffer"; + RTHandle _ColorBuffer; + RTHandle _DepthBuffer; + public RTHandle _DepthBufferCopy; + + public CopyDepthBufferPassURP(RenderPassEvent @event) + { + renderPassEvent = @event; + } + +#if UNITY_6000_0_OR_NEWER + void OnSetup(CommandBuffer buffer, PassData data) +#else + public override void OnCameraSetup(CommandBuffer buffer, ref RenderingData data) +#endif + { + var descriptor = data.cameraData.cameraTargetDescriptor; + descriptor.graphicsFormat = GraphicsFormat.None; + descriptor.bindMS = descriptor.msaaSamples > 1; +#if UNITY_6000_0_OR_NEWER + RenderingUtils.ReAllocateHandleIfNeeded(ref _DepthBufferCopy, descriptor, FilterMode.Point, name: "Crest Copied Depth Buffer"); + _ColorBuffer = data.colorTargetHandle; + _DepthBuffer = data.depthTargetHandle; +#else + RenderingUtils.ReAllocateIfNeeded(ref _DepthBufferCopy, descriptor, FilterMode.Point, name: "Crest Copied Depth Buffer"); + _ColorBuffer = data.cameraData.renderer.cameraColorTargetHandle; + _DepthBuffer = data.cameraData.renderer.cameraDepthTargetHandle; +#endif + } + +#if UNITY_6000_0_OR_NEWER + void Execute(ScriptableRenderContext context, CommandBuffer buffer, PassData data) +#else + public override void Execute(ScriptableRenderContext context, ref RenderingData data) +#endif + { + // Just in case. + if (_ColorBuffer == null || _DepthBuffer == null) + { + return; + } + +#if !UNITY_6000_0_OR_NEWER + var buffer = CommandBufferPool.Get(k_Name); +#endif + + // NOTE: previously we cleared the target depth first due to artifacts. + buffer.CopyTexture(_DepthBuffer.rt, _DepthBufferCopy.rt); + + // Clear the stencil component just in case. + // Previously we passed BuiltinRenderTextureType.None for color but this made the + // scene disappear in the scene view on DX11 only. + CoreUtils.SetRenderTarget(buffer, _ColorBuffer, _DepthBufferCopy, ClearFlag.Stencil); + + // Required for Unity 6+. + CoreUtils.SetRenderTarget(buffer, _ColorBuffer, _DepthBuffer); + +#if !UNITY_6000_0_OR_NEWER + context.ExecuteCommandBuffer(buffer); + CommandBufferPool.Release(buffer); +#endif + } + + public void Release() + { + _DepthBuffer = null; + _DepthBufferCopy?.Release(); + } + } +} + +#endif // d_UnityURP diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.cs.meta new file mode 100644 index 0000000..44c8582 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterEffectPassURP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ab3e34da699e48eaa28a35fba152510 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPass.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPass.cs new file mode 100644 index 0000000..aa7e00f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPass.cs @@ -0,0 +1,2 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPass.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPass.cs.meta new file mode 100644 index 0000000..6e7d834 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPass.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 034fbbb00c45d493294db385ff38a629 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassHDRP.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassHDRP.cs new file mode 100644 index 0000000..aa7e00f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassHDRP.cs @@ -0,0 +1,2 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassHDRP.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassHDRP.cs.meta new file mode 100644 index 0000000..80c0327 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassHDRP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fa78b61faddf4493ae6381f85fb2572 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassURP.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassURP.cs new file mode 100644 index 0000000..aa7e00f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassURP.cs @@ -0,0 +1,2 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassURP.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassURP.cs.meta new file mode 100644 index 0000000..dee4bf5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterMaskPassURP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ce8d0e0aca6a47a9b0b5a8a7544a064 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Editor.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Editor.cs new file mode 100644 index 0000000..441f991 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Editor.cs @@ -0,0 +1,32 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if UNITY_EDITOR + +using UnityEngine; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest +{ + // Edit Mode. + partial class UnderwaterRenderer + { + static bool IsFogEnabledForEditorCamera(Camera camera) + { + // Check if scene view has disabled fog rendering. + if (camera.cameraType == CameraType.SceneView) + { + var sceneView = EditorHelpers.GetSceneViewFromSceneCamera(camera); + // Skip rendering if fog is disabled or for some reason we could not find the scene view. + if (sceneView == null || !sceneView.sceneViewState.fogEnabled) + { + return false; + } + } + + return true; + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Editor.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Editor.cs.meta new file mode 100644 index 0000000..1bfd7d3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Editor.cs.meta @@ -0,0 +1,17 @@ +fileFormatVersion: 2 +guid: 9c58e49fb2a8646388cd64da7f35b182 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _volumeGeometry: {instanceID: 0} + - _EffectMaterial: {instanceID: 0} + - _MaskMaterial: {instanceID: 0} + - _VolumeMaterial: {instanceID: 0} + - _fixMaskComputeShader: {fileID: 7200000, guid: 08549c36146ad4899a07193754b21ea2, + type: 3} + executionOrder: 201 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Effect.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Effect.cs new file mode 100644 index 0000000..86081d7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Effect.cs @@ -0,0 +1,301 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + partial class UnderwaterRenderer + { + internal const string k_ShaderNameEffect = "Crest/Underwater"; + internal const string k_DrawVolume = "Crest.DrawWater/Volume"; + const string k_KeywordDebugVisualizeMask = "_DEBUG_VISUALIZE_MASK"; + const string k_KeywordDebugVisualizeStencil = "_DEBUG_VISUALIZE_STENCIL"; + internal const string k_SampleSphericalHarmonicsMarker = "Crest.UnderwaterRenderer.SampleSphericalHarmonics"; + + static readonly Unity.Profiling.ProfilerMarker s_SampleSphericalHarmonicsMarker = new(k_SampleSphericalHarmonicsMarker); + + static partial class ShaderIDs + { + // Global + public static readonly int s_CameraColorTexture = Shader.PropertyToID("_Crest_CameraColorTexture"); + public static readonly int s_WaterVolumeStencil = Shader.PropertyToID("_Crest_WaterVolumeStencil"); + public static readonly int s_AmbientLighting = Shader.PropertyToID("_Crest_AmbientLighting"); + public static readonly int s_ExtinctionMultiplier = Shader.PropertyToID("_Crest_ExtinctionMultiplier"); + public static readonly int s_UnderwaterEnvironmentalLightingWeight = Shader.PropertyToID("_Crest_UnderwaterEnvironmentalLightingWeight"); + + public static readonly int s_OutScatteringFactor = Shader.PropertyToID("_Crest_OutScatteringFactor"); + public static readonly int s_OutScatteringExtinctionFactor = Shader.PropertyToID("_Crest_OutScatteringExtinctionFactor"); + public static readonly int s_SunBoost = Shader.PropertyToID("_Crest_SunBoost"); + public static readonly int s_DataSliceOffset = Shader.PropertyToID("_Crest_DataSliceOffset"); + } + + + // These map to passes in the underwater shader. + internal enum EffectPass + { + FullScreen, + Reflections, + } + + CommandBuffer _EffectCommandBuffer; + Material _CurrentWaterMaterial; + readonly UnderwaterSphericalHarmonicsData _SphericalHarmonicsData = new(); + System.Action _CopyColor; + System.Action _SetRenderTargetToBackBuffers; + + RenderTargetIdentifier _ColorTarget = new + ( + BuiltinRenderTextureType.CameraTarget, + 0, + CubemapFace.Unknown, + -1 + ); + RenderTargetIdentifier _DepthStencilTarget = new + ( + ShaderIDs.s_WaterVolumeStencil, + 0, + CubemapFace.Unknown, + -1 + ); + RenderTargetIdentifier _ColorCopyTarget = new + ( + ShaderIDs.s_CameraColorTexture, + 0, + CubemapFace.Unknown, + -1 + ); + + // Requested the temporary color texture. + internal bool _NeedsColorTexture; + + sealed class UnderwaterSphericalHarmonicsData + { + internal Color[] _AmbientLighting = new Color[1]; + internal Vector3[] _DirectionsSH = { new(0.0f, 0.0f, 0.0f) }; + } + + void SetRenderTargetToBackBuffers(CommandBuffer commands) + { + commands.SetRenderTarget(_ColorTarget); + } + + void CopyColorTexture(CommandBuffer buffer) + { + // Use blit instead of CopyTexture as it will smooth out issues with format + // differences which is very hard to get right for BIRP. + buffer.Blit(BuiltinRenderTextureType.CameraTarget, _ColorCopyTarget); + + if (UseStencilBuffer) + { + _EffectCommandBuffer.SetRenderTarget(_ColorTarget, _DepthStencilTarget); + } + else + { + _EffectCommandBuffer.SetRenderTarget(_ColorTarget); + } + } + + void SetupUnderwaterEffect() + { + _EffectCommandBuffer ??= new() + { + name = k_DrawVolume, + }; + + _CopyColor ??= new(CopyColorTexture); + _SetRenderTargetToBackBuffers ??= new(SetRenderTargetToBackBuffers); + } + + void OnPreRenderUnderwaterEffect(Camera camera) + { + var descriptor = Rendering.BIRP.GetCameraTargetDescriptor(camera, _Water.FrameBufferFormatOverride); + descriptor.useDynamicScale = camera.allowDynamicResolution; + + UpdateEffectMaterial(camera); + + _EffectCommandBuffer.Clear(); + + if (!RenderBeforeTransparency || _NeedsColorTexture) + { + // No need to clear as Blit will overwrite everything. + _EffectCommandBuffer.GetTemporaryRT(ShaderIDs.s_CameraColorTexture, descriptor); + _EffectCommandBuffer.SetGlobalTexture(ShaderIDs.s_CameraColorTexture, _ColorCopyTarget); + } + + var sun = RenderSettings.sun; + if (sun != null) + { + // Unity does not set up lighting for us so we will get the last value which could incorrect. + // SetGlobalColor is just an alias for SetGlobalVector (no color space conversion like Material.SetColor): + // https://docs.unity3d.com/2017.4/Documentation/ScriptReference/Shader.SetGlobalColor.html + _EffectCommandBuffer.SetGlobalVector(Crest.ShaderIDs.Unity.s_LightColor0, sun.FinalColor()); + _EffectCommandBuffer.SetGlobalVector(Crest.ShaderIDs.Unity.s_WorldSpaceLightPos0, -sun.transform.forward); + _EffectCommandBuffer.SetShaderKeyword("DIRECTIONAL_COOKIE", sun.cookie != null); + } + + // Create a separate stencil buffer context by copying the depth texture. + if (UseStencilBuffer) + { + descriptor.colorFormat = RenderTextureFormat.Depth; + descriptor.depthBufferBits = (int)Helpers.k_DepthBits; + // bindMS is necessary in this case for depth. + descriptor.SetMSAASamples(camera); + descriptor.bindMS = descriptor.msaaSamples > 1; + + // No need to clear as Blit will overwrite everything. + _EffectCommandBuffer.GetTemporaryRT(ShaderIDs.s_WaterVolumeStencil, descriptor); + + // Use blit for MSAA. We should be able to use CopyTexture. Might be the following bug: + // https://issuetracker.unity3d.com/product/unity/issues/guid/1308132 + if (Helpers.IsMSAAEnabled(camera)) + { + // Blit with a depth write shader to populate the depth buffer. + Helpers.Blit(_EffectCommandBuffer, _DepthStencilTarget, Helpers.UtilityMaterial, (int)Helpers.UtilityPass.CopyDepth); + } + else + { + // Copy depth then clear stencil. + _EffectCommandBuffer.CopyTexture(BuiltinRenderTextureType.Depth, _DepthStencilTarget); + Helpers.Blit(_EffectCommandBuffer, _DepthStencilTarget, Helpers.UtilityMaterial, (int)Helpers.UtilityPass.ClearStencil); + } + + if (RenderBeforeTransparency) + { + _EffectCommandBuffer.SetRenderTarget(BuiltinRenderTextureType.CameraTarget, _DepthStencilTarget); + } + } + + if (!RenderBeforeTransparency) + { + CopyColorTexture(_EffectCommandBuffer); + } + + ExecuteEffect(camera, _EffectCommandBuffer, _CopyColor, _SetRenderTargetToBackBuffers); + + if (!RenderBeforeTransparency || _NeedsColorTexture) + { + _EffectCommandBuffer.ReleaseTemporaryRT(ShaderIDs.s_CameraColorTexture); + } + + if (UseStencilBuffer) + { + _EffectCommandBuffer.ReleaseTemporaryRT(ShaderIDs.s_WaterVolumeStencil); + } + } + + internal void ExecuteEffect(Camera camera, CommandBuffer buffer, System.Action copyColor, System.Action resetRenderTargets, MaterialPropertyBlock properties = null) + { + if (camera.cameraType == CameraType.Reflection) + { + buffer.DrawProcedural + ( + Matrix4x4.identity, + _VolumeMaterial, + shaderPass: (int)EffectPass.Reflections, + MeshTopology.Triangles, + vertexCount: 3, + instanceCount: 1, + properties + ); + } +#if d_CrestPortals + else if (_Portals.Active && _Portals.Mode != Portals.PortalMode.Tunnel) + { + _Portals.RenderEffect(camera, buffer, _VolumeMaterial, copyColor, resetRenderTargets, properties); + } +#endif + else + { + buffer.DrawProcedural + ( + Matrix4x4.identity, + _VolumeMaterial, + shaderPass: (int)EffectPass.FullScreen, + MeshTopology.Triangles, + vertexCount: 3, + instanceCount: 1, + properties + ); + } + } + + internal static void UpdateGlobals(Material source) + { + // We will have the wrong color values if we do not use linear: + // https://forum.unity.com/threads/fragment-shader-output-colour-has-incorrect-values-when-hardcoded.377657/ + + // _CrestAbsorption is already set as global in Water Renderer. + Shader.SetGlobalColor(WaterRenderer.ShaderIDs.s_Scattering, source.GetColor(WaterRenderer.ShaderIDs.s_Scattering).MaybeLinear()); + Shader.SetGlobalFloat(WaterRenderer.ShaderIDs.s_Anisotropy, source.GetFloat(WaterRenderer.ShaderIDs.s_Anisotropy)); + Shader.SetGlobalFloat(WaterRenderer.ShaderIDs.s_AmbientTerm, source.GetFloat(WaterRenderer.ShaderIDs.s_AmbientTerm)); + Shader.SetGlobalFloat(WaterRenderer.ShaderIDs.s_DirectTerm, source.GetFloat(WaterRenderer.ShaderIDs.s_DirectTerm)); + Shader.SetGlobalFloat(WaterRenderer.ShaderIDs.s_ShadowsAffectsAmbientFactor, source.GetFloat(WaterRenderer.ShaderIDs.s_ShadowsAffectsAmbientFactor)); + + Shader.SetGlobalFloat(ShaderIDs.s_ExtinctionMultiplier, source.GetFloat(ShaderIDs.s_ExtinctionMultiplier)); + Shader.SetGlobalFloat(ShaderIDs.s_OutScatteringFactor, source.GetFloat(ShaderIDs.s_OutScatteringFactor)); + Shader.SetGlobalFloat(ShaderIDs.s_OutScatteringExtinctionFactor, source.GetFloat(ShaderIDs.s_OutScatteringExtinctionFactor)); + Shader.SetGlobalFloat(ShaderIDs.s_SunBoost, source.GetFloat(ShaderIDs.s_SunBoost)); + Shader.SetGlobalInteger(ShaderIDs.s_DataSliceOffset, source.GetInteger(ShaderIDs.s_DataSliceOffset)); + } + + internal void UpdateEffectMaterial(Camera camera) + { + // Copy water material parameters to underwater material. + // WBs can change the material per camera, so disable optimization. + if (_MaterialLastUpdatedFrame < Time.frameCount || WaterBody.WaterBodies.Count > 0) + { + if (_CopyWaterMaterialParametersEachFrame || _SurfaceMaterial != _CurrentWaterMaterial) + { + _CurrentWaterMaterial = _SurfaceMaterial; + + if (_SurfaceMaterial != null) + { + _VolumeMaterial.CopyMatchingPropertiesFromMaterial(_SurfaceMaterial); + + AfterCopyMaterial?.Invoke(_Water, _VolumeMaterial); + + // Make volume properties available to surface and meniscus. + if (RenderBeforeTransparency) + { + UpdateGlobals(_VolumeMaterial); + } + } + } + + // Enabling/disabling keywords each frame don't seem to have large measurable overhead + _VolumeMaterial.SetKeyword(k_KeywordDebugVisualizeMask, _Debug._VisualizeMask); + _VolumeMaterial.SetKeyword(k_KeywordDebugVisualizeStencil, _Debug._VisualizeStencil); + + // We use this for caustics to get the displacement. + _VolumeMaterial.SetInteger(Lod.ShaderIDs.s_LodIndex, 0); + + _MaterialLastUpdatedFrame = Time.frameCount; + } + + // Not applicable to reflection pass. + if (camera.cameraType != CameraType.Reflection) + { + // Skip work if camera is far enough below the surface. + var forceFullShader = !_Water.Surface.Enabled || (_Water._ViewerHeightAboveWaterPerCamera < -8f && !Portaled); + _VolumeMaterial.SetKeyword("d_Crest_NoMaskColor", forceFullShader); + _VolumeMaterial.SetKeyword("d_Crest_NoMaskDepth", !_Water.Surface.Enabled || RenderBeforeTransparency); + } + + // Compute ambient lighting SH. + { + // We could pass in a renderer which would prime this lookup. However it doesnt make sense to use an existing render + // at different position, as this would then thrash it and negate the priming functionality. We could create a dummy invis GO + // with a dummy Renderer which might be enough, but this is hacky enough that we'll wait for it to become a problem + // rather than add a pre-emptive hack. + s_SampleSphericalHarmonicsMarker.Begin(_Water); + LightProbes.GetInterpolatedProbe(camera.transform.position, null, out var sphericalHarmonicsL2); + sphericalHarmonicsL2.Evaluate(_SphericalHarmonicsData._DirectionsSH, _SphericalHarmonicsData._AmbientLighting); + Helpers.SetShaderVector(_VolumeMaterial, ShaderIDs.s_AmbientLighting, _SphericalHarmonicsData._AmbientLighting[0], RenderBeforeTransparency); + s_SampleSphericalHarmonicsMarker.End(); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Effect.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Effect.cs.meta new file mode 100644 index 0000000..0ee8130 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Effect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 95fe330fa426a41c0b6379a1a2aae608 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.EnvironmentalLighting.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.EnvironmentalLighting.cs new file mode 100644 index 0000000..7795641 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.EnvironmentalLighting.cs @@ -0,0 +1,142 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + partial class UnderwaterRenderer + { + const float k_DepthOutScattering = 0.25f; + + Light _EnvironmentalLight; + float _EnvironmentalLightIntensity; + float _EnvironmentalAmbientIntensity; + float _EnvironmentalReflectionIntensity; + float _EnvironmentalFogDensity; + float _EnvironmentalAverageDensity = 0f; + bool _EnvironmentalInitialized = false; + bool _EnvironmentalNeedsRestoring; + + void EnableEnvironmentalLighting() + { + if (!_EnvironmentalLightingEnable) + { + return; + } + +#if d_UnitySRP + if (_EnvironmentalLightingVolume == null && !RenderPipelineHelper.IsLegacy) + { + // Create volume to weigh in underwater profile + var go = new GameObject(); + go.transform.parent = _Water.Container.transform; + go.hideFlags = HideFlags.HideAndDontSave; + go.name = "Underwater Lighting Volume"; + _EnvironmentalLightingVolume = go.AddComponent(); + _EnvironmentalLightingVolume.weight = 0; + _EnvironmentalLightingVolume.priority = 1000; + _EnvironmentalLightingVolume.profile = _EnvironmentalLightingVolumeProfile; + } +#endif + + _EnvironmentalInitialized = true; + } + + void DisableEnvironmentalLighting() + { + RestoreEnvironmentalLighting(); + + _EnvironmentalInitialized = false; + } + + void RestoreEnvironmentalLighting() + { + if (!_EnvironmentalInitialized || !_EnvironmentalNeedsRestoring) + { + return; + } + +#if UNITY_EDITOR + // Only repaint, otherwise changes might persist. + if (Event.current.type != EventType.Repaint) + { + return; + } +#endif + + // Restore lighting settings. + if (_EnvironmentalLight != null) _EnvironmentalLight.intensity = _EnvironmentalLightIntensity; + _EnvironmentalLight = null; + RenderSettings.ambientIntensity = _EnvironmentalAmbientIntensity; + RenderSettings.reflectionIntensity = _EnvironmentalReflectionIntensity; + RenderSettings.fogDensity = _EnvironmentalFogDensity; + Shader.SetGlobalFloat(ShaderIDs.s_UnderwaterEnvironmentalLightingWeight, 0f); + if (_EnvironmentalLightingVolume != null) _EnvironmentalLightingVolume.weight = 0; + + _EnvironmentalNeedsRestoring = false; + } + + void UpdateEnvironmentalLighting(Camera camera, Vector3 extinction, float height) + { + if (!_EnvironmentalInitialized) + { + return; + } + +#if UNITY_EDITOR + // Only repaint, otherwise changes might persist. + if (Event.current.type != EventType.Repaint) + { + return; + } +#endif + + if (!_Water.Surface.Material.HasColor(WaterRenderer.ShaderIDs.s_AbsorptionColor)) + { + return; + } + + // Store lighting settings. + { + _EnvironmentalLight = _Water.PrimaryLight; + if (_EnvironmentalLight) _EnvironmentalLightIntensity = _EnvironmentalLight.intensity; + _EnvironmentalAmbientIntensity = RenderSettings.ambientIntensity; + _EnvironmentalReflectionIntensity = RenderSettings.reflectionIntensity; + _EnvironmentalFogDensity = RenderSettings.fogDensity; + } + + var density = extinction; + _EnvironmentalAverageDensity = (density.x + density.y + density.z) / 3f; + + var outScatteringFactor = 1f; + if (_VolumeMaterial.HasFloat(ShaderIDs.s_OutScatteringFactor)) + { + outScatteringFactor = _VolumeMaterial.GetFloat(ShaderIDs.s_OutScatteringFactor); + } + + var multiplier = Mathf.Exp(_EnvironmentalAverageDensity * Mathf.Min(height * k_DepthOutScattering * outScatteringFactor, 0f) * _EnvironmentalLightingWeight); + + // Darken environmental lighting when viewer underwater. + if (_EnvironmentalLight != null) + { + _EnvironmentalLight.intensity = Mathf.Lerp(0, _EnvironmentalLightIntensity, multiplier); + } + + RenderSettings.ambientIntensity = Mathf.Lerp(0, _EnvironmentalAmbientIntensity, multiplier); + RenderSettings.reflectionIntensity = Mathf.Lerp(0, _EnvironmentalReflectionIntensity, multiplier); + RenderSettings.fogDensity = Mathf.Lerp(0, _EnvironmentalFogDensity, multiplier); + + Shader.SetGlobalFloat(ShaderIDs.s_UnderwaterEnvironmentalLightingWeight, 1f - multiplier); + +#if d_UnitySRP + if (_EnvironmentalLightingVolume != null) + { + _EnvironmentalLightingVolume.weight = 1f - multiplier; + } +#endif + _EnvironmentalNeedsRestoring = true; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.EnvironmentalLighting.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.EnvironmentalLighting.cs.meta new file mode 100644 index 0000000..95b14ba --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.EnvironmentalLighting.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42735f62770724c7488928b7e8185c9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Legacy.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Legacy.cs new file mode 100644 index 0000000..ab2ac04 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Legacy.cs @@ -0,0 +1,56 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + partial class UnderwaterRenderer + { + bool _HasEffectCommandBuffersBeenRegistered; + + void OnEnableLegacy() + { + SetupUnderwaterEffect(); + + RenderPipelineManager.activeRenderPipelineTypeChanged -= OnDisableLegacy; + RenderPipelineManager.activeRenderPipelineTypeChanged += OnDisableLegacy; + } + + void OnDisableLegacy() + { + RenderPipelineManager.activeRenderPipelineTypeChanged -= OnDisableLegacy; + } + + // Listening to OnPreCull. Camera must have underwater layer. + void OnBeforeLegacyRender(Camera camera) + { + if (ShouldRender(camera, Pass.Effect)) + { + _Water.UpdateMatrices(camera); + + _Water.OnBeginCameraOpaqueTexture(camera); + + var @event = RenderBeforeTransparency ? CameraEvent.BeforeForwardAlpha : CameraEvent.AfterForwardAlpha; + camera.AddCommandBuffer(@event, _EffectCommandBuffer); + OnPreRenderUnderwaterEffect(camera); + _HasEffectCommandBuffersBeenRegistered = true; + } + } + + void OnAfterLegacyRender(Camera camera) + { + if (_HasEffectCommandBuffersBeenRegistered) + { + var @event = RenderBeforeTransparency ? CameraEvent.BeforeForwardAlpha : CameraEvent.AfterForwardAlpha; + camera.RemoveCommandBuffer(@event, _EffectCommandBuffer); + _EffectCommandBuffer?.Clear(); + } + + _Water.OnEndCameraOpaqueTexture(camera); + + _HasEffectCommandBuffersBeenRegistered = false; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Legacy.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Legacy.cs.meta new file mode 100644 index 0000000..ac53e6b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Legacy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f72cef5b74e7e43c3bfceff42401fa82 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Mask.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Mask.cs new file mode 100644 index 0000000..bd8ce51 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Mask.cs @@ -0,0 +1,216 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + partial class UnderwaterRenderer : MaskRenderer.IMaskReceiver, MaskRenderer.IMaskProvider + { + internal const string k_DrawMask = "Crest.DrawMask"; + const string k_DrawMaskHorizon = "Horizon"; + const string k_DrawMaskSurface = "Surface"; + + internal const int k_VolumeMaskQueue = 1000; + + internal const int k_ShaderPassWaterSurfaceMask = 0; + internal const int k_ShaderPassWaterSurfaceDepth = 1; + internal const int k_ShaderPassWaterHorizonMask = 0; + + internal const string k_ComputeShaderKernelFillMaskArtefacts = "FillMaskArtefacts"; + + static partial class ShaderIDs + { + // Local + public static readonly int s_FarPlaneOffset = Shader.PropertyToID("_Crest_FarPlaneOffset"); + } + + internal Material _MaskMaterial; + internal Material _HorizonMaskMaterial; + + ComputeShader _ArtifactsShader; + bool _ArtifactsShaderInitialized; + int _ArtifactsKernel; + uint _ArtifactsThreadGroupSizeX; + uint _ArtifactsThreadGroupSizeY; + + internal void OnEnableMask() + { + _Water._Mask.Add(this); + _Water._Mask.Add(k_VolumeMaskQueue, this); + + SetUpArtifactsShader(); + } + + internal void OnDisableMask() + { + if (_Water == null) return; + _Water._Mask?.Remove(this as MaskRenderer.IMaskReceiver); + _Water._Mask?.Remove(this as MaskRenderer.IMaskProvider); + } + + internal void SetUpArtifactsShader() + { + if (_ArtifactsShaderInitialized) + { + return; + } + + _ArtifactsKernel = _ArtifactsShader.FindKernel(k_ComputeShaderKernelFillMaskArtefacts); + _ArtifactsShader.GetKernelThreadGroupSizes + ( + _ArtifactsKernel, + out _ArtifactsThreadGroupSizeX, + out _ArtifactsThreadGroupSizeY, + out _ + ); + + _ArtifactsShaderInitialized = true; + } + + void MaskRenderer.IMaskProvider.OnMaskPass(CommandBuffer commands, Camera camera, MaskRenderer mask) + { + var color = mask.ColorRTH; + var depth = mask.DepthRTH; + + var size = color.GetScaledSize(color.rtHandleProperties.currentViewportSize); + var descriptor = color.rt.descriptor; + descriptor.width = size.x; descriptor.height = size.y; + + if (UseLegacyMask) + { + // Portals changes the target. + // When using the stencil we are already clearing depth and do not want to clear the stencil too. Clear + // color only when using the stencil as the horizon effectively clears it when not using it. + CoreUtils.SetRenderTarget(commands, color, depth, UseStencilBuffer ? ClearFlag.Color : ClearFlag.DepthStencil); + Helpers.ScaleViewport(camera, commands, color); + + PopulateMask(commands, camera); + FixMaskArtefacts(commands, descriptor, mask._ColorRTI); + } + // Portals have their own fitted to the portal bounds. + else +#if d_CrestPortals + if (!Portaled || _Water.Portals.RequiresFullScreenMask) +#endif + { +#if d_CrestPortals + if (_Water.Portals.Mode != Portals.PortalMode.VolumeFlyThrough) +#endif + { + RenderLineMask(commands, camera, mask.ColorRT.descriptor, mask._ColorRTI); + } + } + } + + internal void RenderLineMask(CommandBuffer buffer, Camera camera, RenderTextureDescriptor descriptor, RenderTargetIdentifier target) + { + if (!_Water.Surface.Enabled) + { + return; + } + + var wrapper = new PropertyWrapperCompute(buffer, WaterResources.Instance.Compute._Mask, (int)RenderPipelineHelper.RenderPipeline); + + var parameters = _Water.Surface._SurfaceDataParameters; + + wrapper.SetTexture(SurfaceRenderer.ShaderIDs.s_WaterLine, _Water.Surface.HeightRT); + wrapper.SetVector(SurfaceRenderer.ShaderIDs.s_WaterLineSnappedPosition, parameters._SnappedPosition); + wrapper.SetVector(SurfaceRenderer.ShaderIDs.s_WaterLineResolution, parameters._Resolution); + wrapper.SetFloat(SurfaceRenderer.ShaderIDs.s_WaterLineTexel, parameters._Texel); + + // XR SPI will have a volume depth of two. If using RTHandles, then set manually as will be two for all cameras. + wrapper.SetKeyword(new(WaterResources.Instance.Compute._Mask, "STEREO_INSTANCING_ON"), descriptor.dimension == TextureDimension.Tex2DArray); + + // Setting this sets unity_CameraToWorld. + wrapper.SetMatrix(Crest.ShaderIDs.Unity.s_CameraToWorld, camera.cameraToWorldMatrix); + + // Viewport sizes are not perfect so round up to cover. + wrapper.Dispatch(Mathf.CeilToInt(descriptor.width / 8f), Mathf.CeilToInt(descriptor.height / 8f), descriptor.volumeDepth); + } + + internal void FixMaskArtefacts(CommandBuffer buffer, RenderTextureDescriptor descriptor, RenderTargetIdentifier target) + { + if (_Debug._DisableArtifactCorrection) + { + return; + } + + if (!_Water.Surface.Enabled && Portaled) + { + return; + } + + buffer.SetComputeTextureParam(_ArtifactsShader, _ArtifactsKernel, MaskRenderer.ShaderIDs.s_WaterMaskTexture, target); + // XR SPI will have a volume depth of two. If using RTHandles, then set manually as will be two for all cameras. + _ArtifactsShader.SetKeyword("STEREO_INSTANCING_ON", descriptor.dimension == TextureDimension.Tex2DArray); + + buffer.DispatchCompute + ( + _ArtifactsShader, + _ArtifactsKernel, + // Viewport sizes are not perfect so round up to cover. + Mathf.CeilToInt((float)descriptor.width / _ArtifactsThreadGroupSizeX), + Mathf.CeilToInt((float)descriptor.height / _ArtifactsThreadGroupSizeY), + descriptor.volumeDepth + ); + } + + // Populates a screen space mask which will inform the underwater postprocess. As a future optimisation we may + // be able to avoid this pass completely if we can reuse the camera depth after transparents are rendered. + internal void PopulateMask(CommandBuffer commandBuffer, Camera camera) + { + if (!_Water.Surface.Enabled && Portaled) + { + return; + } + + // Render horizon into mask using a fullscreen triangle at the far plane. Horizon must be rendered first or + // it will overwrite the mask with incorrect values. + { + var zBufferParameters = Helpers.GetZBufferParameters(camera); + // Take 0-1 linear depth and convert non-linear depth. + _HorizonMaskMaterial.SetFloat(ShaderIDs.s_FarPlaneOffset, Helpers.LinearDepthToNonLinear(_FarPlaneMultiplier, zBufferParameters)); + + // Render fullscreen triangle with horizon mask pass. + commandBuffer.BeginSample(k_DrawMaskHorizon); + commandBuffer.DrawProcedural(Matrix4x4.identity, _HorizonMaskMaterial, shaderPass: k_ShaderPassWaterHorizonMask, MeshTopology.Triangles, 3, 1); + commandBuffer.EndSample(k_DrawMaskHorizon); + } + + // Get all water chunks and render them using cmd buffer, but with mask shader. + if (!_Debug._DisableMask) + { + commandBuffer.BeginSample(k_DrawMaskSurface); + _Water.Surface.Render(camera, commandBuffer, _MaskMaterial, k_ShaderPassWaterSurfaceMask); + commandBuffer.EndSample(k_DrawMaskSurface); + } + } + + internal bool _MaskRead; + bool _DoneMaskRead; + + MaskRenderer.MaskInput MaskRenderer.IMaskProvider.Allocate() + { + return MaskRenderer.MaskInput.Both; + } + + MaskRenderer.MaskInput MaskRenderer.IMaskReceiver.Allocate() + { + return MaskRenderer.MaskInput.Both; + } + + MaskRenderer.MaskInput MaskRenderer.IMaskProvider.Write(Camera camera) + { + if (!_DoneMaskRead) + { + _MaskRead = ShouldRender(camera, Pass.Mask); + _DoneMaskRead = true; + } + + return _MaskRead ? _Water.Surface.Enabled ? MaskRenderer.MaskInput.Both : MaskRenderer.MaskInput.Color : MaskRenderer.MaskInput.None; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Mask.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Mask.cs.meta new file mode 100644 index 0000000..df045a6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.Mask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f64799bb3430e498a926913b81241f06 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.cs new file mode 100644 index 0000000..7a9aa96 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.cs @@ -0,0 +1,540 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + /// + /// Renders the underwater effect. + /// + [System.Serializable] + public sealed partial class UnderwaterRenderer + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + internal const float k_CullLimitMinimum = 0.000001f; + internal const float k_CullLimitMaximum = 0.01f; + + [@Space(10)] + + [Tooltip("Whether the underwater effect is enabled.\n\nAllocates/releases resources if state has changed.")] + [@GenerateAPI(Setter.Custom)] + [@DecoratedField, SerializeField] + internal bool _Enabled = true; + + // This is mainly for reflection probes (HDRP planar specifically). It gives + // developers the option to make a TIR probe which should not render the surface. + [Tooltip("Any camera or probe with this layer in its culling mask will render underwater.")] + [@Layer] + [@GenerateAPI] + [SerializeField] + int _Layer = 4; // Water + + [Tooltip("The underwater material. The water surface material is copied into this material.")] + [@AttachMaterialEditor(order: 2)] + [@MaterialField(k_ShaderNameEffect, name: "Underwater", title: "Create Underwater Material")] + [@GenerateAPI] + [SerializeField] + internal Material _Material; + + + [@Heading("Environmental Lighting")] + + [@Label("Enable")] + [Tooltip("Provides out-scattering based on the camera's underwater depth.\n\nIt scales down environmental lighting (sun, reflections, ambient etc) with the underwater depth. This works with vanilla lighting, but uncommon or custom lighting will require a custom solution (use this for reference)")] + [@GenerateAPI(Setter.Custom, name: "AffectsEnvironmentalLighting")] + [@DecoratedField, SerializeField] + internal bool _EnvironmentalLightingEnable; + + [@Label("Weight")] + [Tooltip("How much this effect applies.\n\nValues less than 1 attenuate light less underwater. Value of 1 is physically based.")] + [@Range(0, 3)] + [@GenerateAPI] + [SerializeField] + internal float _EnvironmentalLightingWeight = 1f; + +#if d_UnitySRP + [@Label("Volume")] + [Tooltip("This profile will be weighed in the deeper underwater the camera goes.")] + [@Predicated(RenderPipeline.HighDefinition, hide: true)] + [@DecoratedField, SerializeField] + VolumeProfile _EnvironmentalLightingVolumeProfile = null; + + Volume _EnvironmentalLightingVolume; +#endif + + + [@Heading("Advanced")] + + [Tooltip("Whether to execute for all cameras.\n\nIf disabled, then additionally ignore any camera that is not the view camera or our reflection camera. It will require managing culling masks of all cameras.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _AllCameras; + + [Tooltip("Copying parameters each frame ensures underwater appearance stays consistent with the water surface.\n\nHas a small overhead so should be disabled if not needed.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _CopyWaterMaterialParametersEachFrame = true; + + [Tooltip("Adjusts the far plane for horizon line calculation. Helps with horizon line issue.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + float _FarPlaneMultiplier = 0.68f; + + [Tooltip("Proportion of visibility below which the water surface will be culled when underwater.\n\nThe larger the number, the closer to the camera the water tiles will be culled.")] + [@Range(k_CullLimitMinimum, k_CullLimitMaximum)] + [@GenerateAPI] + [SerializeField] + internal float _CullLimit = 0.001f; + + [@Space(10)] + + [@DecoratedField, SerializeField] + DebugFields _Debug = new(); + + [System.Serializable] + sealed class DebugFields + { + [SerializeField] + internal bool _VisualizeMask; + + [SerializeField] + internal bool _DisableMask; + + [SerializeField] + internal bool _VisualizeStencil; + + [SerializeField] + internal bool _DisableHeightAboveWaterOptimization; + + [SerializeField] + internal bool _DisableArtifactCorrection; + + [SerializeField] + internal bool _OnlyReflectionCameras; + } + + /// + /// Raised after copying the water material properties to the underwater material. + /// + public static System.Action AfterCopyMaterial { get; set; } + + // Always render before surface, unless legacy mode which always renders after transparency. +#if d_Crest_LegacyUnderwater + internal bool UseLegacyMask => true; + internal bool RenderBeforeTransparency => false; +#else + // Legacy mask works except for negative volumes. Not officially supported. + internal bool UseLegacyMask => _AllCameras; + internal bool RenderBeforeTransparency => true; +#endif + + internal WaterRenderer _Water; + +#if d_CrestPortals + // BUG: NonSerialized as Unity shows a serialization depth warning even though field is internal. + [System.NonSerialized] + internal Portals.PortalRenderer _Portals; + internal bool Portaled => _Portals.Active; +#else + bool Portaled => false; +#endif + + int _MaterialLastUpdatedFrame = -1; + + internal bool UseStencilBuffer { get; set; } + + internal enum Pass + { + Culling, + Mask, + Effect, + } + + // These are the materials we actually use, overridable by Water Body. + Material _SurfaceMaterial; + Material _VolumeMaterial; + + readonly SampleCollisionHelper _SamplingHeightHelper = new(); + float _ViewerWaterHeight; + + internal static partial class ShaderIDs + { + // Empty. + } + + internal void OnEnable() + { + _VolumeMaterial = _Material; + + if (_MaskMaterial == null) + { + _MaskMaterial = new(WaterResources.Instance.Shaders._UnderwaterMask); + } + + if (_HorizonMaskMaterial == null) + { + _HorizonMaskMaterial = new(WaterResources.Instance.Shaders._HorizonMask); + } + + if (_ArtifactsShader == null) + { + _ArtifactsShader = WaterResources.Instance.Compute._UnderwaterArtifacts; + } + + OnEnableMask(); + + if (RenderPipelineHelper.IsUniversal) + { +#if d_UnityURP + UnderwaterEffectPassURP.Enable(this); +#endif + } + else if (RenderPipelineHelper.IsHighDefinition) + { +#if d_UnityHDRP + UnderwaterEffectPassHDRP.Enable(this); +#endif + } + else + { + OnEnableLegacy(); + } + + EnableEnvironmentalLighting(); + + RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged; + RenderPipelineManager.activeRenderPipelineTypeChanged += OnActiveRenderPipelineTypeChanged; + } + + void OnActiveRenderPipelineTypeChanged() + { + // Disable is handled by another handler so we need to run enabled. + if (_Water.isActiveAndEnabled) + { + OnEnable(); + } + } + + internal void OnDisable() + { + RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged; + + OnDisableMask(); + +#if d_UnityURP + UnderwaterEffectPassURP.Disable(); +#endif + +#if d_UnityHDRP + UnderwaterEffectPassHDRP.Disable(); +#endif + + OnDisableLegacy(); + + DisableEnvironmentalLighting(); + + _ArtifactsShader = null; + } + + internal void OnDestroy() + { + Helpers.Destroy(_MaskMaterial); + Helpers.Destroy(_HorizonMaskMaterial); + // Without will cause exception in editor in play mode if disable Write Motion Vectors. + _MaskMaterial = null; + _HorizonMaskMaterial = null; + } + + internal bool ShouldRender(Camera camera, Pass pass) + { + if (!_Enabled || _Material == null) + { + return false; + } + + if (_Water == null) + { + return false; + } + + if (!WaterRenderer.ShouldRender(camera, _Layer)) + { + return false; + } + + // Skip entire mask pass if possible. + if (pass == Pass.Mask && !_Water.Surface.Enabled) + { + return false; + } + +#if UNITY_EDITOR + if (GL.wireframe) + { + return false; + } + + // Skip camera if fog is disabled. Do not skip if mask pass and a portal or volume as we want it to still + // mask the water surface. + if ((pass != Pass.Mask || !Portaled) && !IsFogEnabledForEditorCamera(camera)) + { + return false; + } +#endif + + var isReflectionCamera = camera.cameraType == CameraType.Reflection; + + // Mask or culling is not needed for reflections. + if (isReflectionCamera && pass != Pass.Effect) + { + return false; + } + + if (_Debug._OnlyReflectionCameras && !isReflectionCamera) + { + return false; + } + + // Option to exclude cameras that is not the view camera or our reflection camera. + // Otherwise, filtering depends on the camera's culling mask which is not always + // accessible like with the global "Reflection Probes Camera". But whether those + // cameras triggering camera events is a bug is TBD as it is intermittent. + if (!_AllCameras && camera != _Water.GetViewer(includeSceneCamera: false) && camera.cameraType != CameraType.SceneView && camera != WaterReflections.CurrentCamera) + { + return false; + } + + if (!_Debug._DisableHeightAboveWaterOptimization && !Portaled) + { + _Water.UpdatePerCameraHeight(camera); + _ViewerWaterHeight = _Water._ViewerHeightAboveWaterPerCamera; + + if (_ViewerWaterHeight > 2f) + { + return false; + } + } + + return true; + } + + void RevertCulling() + { + foreach (var tile in _Water.Surface.Chunks) + { + if (tile.Rend == null || tile._Culled) + { + continue; + } + + tile.Rend.enabled = true; + } + } + + // Called by WaterRenderer. Camera must have water layer. + internal void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + OnBeginCameraRendering(camera); + +#if UNITY_EDITOR + // Populated by this point. + if (_VolumeMaterial.shader != WaterResources.Instance.Shaders._UnderwaterEffect) + { + return; + } +#endif + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + UnderwaterEffectPassURP.s_Instance.EnqueuePass(context, camera); + } + else +#endif + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + UnderwaterEffectPassHDRP.s_Instance?.OnBeginCameraRendering(context, camera); + } + else +#endif + + { + OnBeforeLegacyRender(camera); + } + } + + internal void OnBeginCameraRendering(Camera camera) + { + if (!ShouldRender(camera, Pass.Culling)) + { + return; + } + + // Only one camera supported due to LOD center dependency. + if (!UseLegacyMask && ShouldRender(camera, Pass.Mask) && camera == _Water.Viewer) + { + _Water.Surface.UpdateDisplacedSurfaceData(camera); + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + _Water.UpdateHighDefinitionLighting(camera); + } +#endif + + _SurfaceMaterial = _Water.Surface.AboveOrBelowSurfaceMaterial; + _VolumeMaterial = _Material; + + var viewpoint = camera.transform.position; + + // Grab material from a water body if camera is within its XZ bounds. + foreach (var body in WaterBody.WaterBodies) + { + if (body.AboveOrBelowSurfaceMaterial == null && body._VolumeMaterial == null) + { + continue; + } + + var bounds = body.AABB; + var contained = + viewpoint.x >= bounds.min.x && viewpoint.x <= bounds.max.x && + viewpoint.z >= bounds.min.z && viewpoint.z <= bounds.max.z; + + if (contained) + { + if (body.AboveOrBelowSurfaceMaterial != null) _SurfaceMaterial = body.AboveOrBelowSurfaceMaterial; + if (body.VolumeMaterial != null) _VolumeMaterial = body.VolumeMaterial; + // Water bodies should not overlap so grab the first one. + break; + } + } + +#if UNITY_EDITOR + if (_VolumeMaterial.shader != WaterResources.Instance.Shaders._UnderwaterEffect) + { + return; + } +#endif + + var extinction = Vector3.zero; + float minimumFogDensity = 0; + + // Calculate extinction. + if (_SurfaceMaterial != null) + { + var densityFactor = _VolumeMaterial.GetFloat(ShaderIDs.s_ExtinctionMultiplier); + + // Get absorption from current material. + if (_SurfaceMaterial.HasVector(WaterRenderer.ShaderIDs.s_Absorption)) + { + extinction = _SurfaceMaterial.GetVector(WaterRenderer.ShaderIDs.s_Absorption); + Shader.SetGlobalVector(WaterRenderer.ShaderIDs.s_Absorption, extinction); + } + + // Do not use for culling because: + // - Scattering is not uniform due to anisotropy + // - Also need to take sun light into account + if (_SurfaceMaterial.HasProperty(WaterRenderer.ShaderIDs.s_Scattering)) + { + var volumeExtinction = extinction + _SurfaceMaterial.GetVector(WaterRenderer.ShaderIDs.s_Scattering).XYZ(); + volumeExtinction *= densityFactor; + minimumFogDensity = Mathf.Min(Mathf.Min(volumeExtinction.x, volumeExtinction.y), volumeExtinction.z); + Shader.SetGlobalFloat(WaterRenderer.ShaderIDs.s_VolumeExtinctionLength, -Mathf.Log(k_CullLimitMinimum) / minimumFogDensity); + } + + extinction *= densityFactor; + minimumFogDensity = Mathf.Min(Mathf.Min(extinction.x, extinction.y), extinction.z); + // Prevent divide by zero. + minimumFogDensity = Mathf.Max(minimumFogDensity, 0.0001f); + } + + if (_EnvironmentalInitialized) + { + _Water.UpdatePerCameraHeight(camera); + _ViewerWaterHeight = _Water._ViewerHeightAboveWaterPerCamera; + UpdateEnvironmentalLighting(camera, extinction, _ViewerWaterHeight); + } + + if (Portaled || _ViewerWaterHeight > -5f) + { + RevertCulling(); + return; + } + + var extinctionLength = -Mathf.Log(_CullLimit) / minimumFogDensity; + + foreach (var tile in _Water.Surface.Chunks) + { + if (tile.Rend == null || tile._Culled) + { + continue; + } + + // Cull tiles the viewer cannot see through the underwater fog. + // Only run optimisation in play mode due to shared height above water. + if ((viewpoint - tile.Rend.bounds.ClosestPoint(viewpoint)).magnitude >= extinctionLength) + { + tile.Rend.enabled = false; + } + else + { + // Previous camera might have culled in underwater pass. + tile.Rend.enabled = true; + } + } + } + + internal void OnEndCameraRendering(Camera camera) + { + RestoreEnvironmentalLighting(); + RevertCulling(); + _DoneMaskRead = false; + + if (RenderPipelineHelper.IsLegacy) + { + OnAfterLegacyRender(camera); + } + } + + void SetEnabled(bool previous, bool current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled) return; + if (_Enabled) OnEnable(); else OnDisable(); + } + + void SetAffectsEnvironmentalLighting(bool previous, bool current) + { + if (previous == current) return; + if (_Water == null || !_Water.isActiveAndEnabled || !_Enabled) return; + if (_EnvironmentalLightingEnable) EnableEnvironmentalLighting(); else DisableEnvironmentalLighting(); + } + +#if UNITY_EDITOR + [@OnChange] + void OnChange(string propertyPath, object previousValue) + { + switch (propertyPath) + { + case nameof(_Enabled): + SetEnabled((bool)previousValue, _Enabled); + break; + case nameof(_EnvironmentalLightingEnable): + SetAffectsEnvironmentalLighting((bool)previousValue, _EnvironmentalLightingEnable); + break; + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.cs.meta new file mode 100644 index 0000000..297209c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Volume/UnderwaterRenderer.cs.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: f2a407448acc440bab3414c17e06e7ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _VolumeGeometry: {instanceID: 0} + - _EffectMaterial: {instanceID: 0} + - _MaskMaterial: {instanceID: 0} + - _VolumeMaterial: {instanceID: 0} + - _ArtifactsShader: {fileID: 7200000, guid: 08549c36146ad4899a07193754b21ea2, type: 3} + executionOrder: 201 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Editor.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Editor.cs new file mode 100644 index 0000000..60350b5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Editor.cs @@ -0,0 +1,163 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if UNITY_EDITOR + +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + [@ExecuteDuringEditMode(ExecuteDuringEditMode.Include.None, ExecuteDuringEditMode.Options.Singleton)] + [SelectionBase] + [AddComponentMenu(Constants.k_MenuPrefixScripts + "Water Renderer")] + [@HelpURL("About/Introduction.html")] + sealed partial class WaterRenderer + { + internal const string k_ProxyShader = "Hidden/Crest/Editor/WaterProxy"; + internal GameObject _ProxyPlane; + private protected override bool CanRunInEditMode => !_ShowWaterProxyPlane; + + + internal static float EditorTime { get; set; } + internal static float EditorDeltaTime { get; set; } + static int s_EditorFrames = 0; + + // Useful for rate limiting processes called outside of RunUpdate like camera events. + static int s_EditorFramesSinceUpdate = 0; + static int EditorFramesSinceUpdate => Application.isPlaying ? 0 : s_EditorFramesSinceUpdate; + internal static bool IsWithinEditorUpdate => EditorFramesSinceUpdate == 0; + + internal bool IsSceneViewActive { get; set; } + + int _LastFrameSceneCamera; + + private protected override void Reset() + { + _Underwater._Material = AssetDatabase.LoadAssetAtPath("Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat"); + + _Surface.Reset(); + Meniscus.Reset(); + + base.Reset(); + } + + // Tracks the scene view rendering to determine if a scene camera is active. + void UpdateLastActiveSceneCamera(Camera camera) + { + if (camera.cameraType == CameraType.SceneView) + { + IsSceneViewActive = true; + _LastFrameSceneCamera = Time.frameCount; + } + + if (_LastFrameSceneCamera < Time.frameCount - 1) + { + IsSceneViewActive = false; + } + } + + static void EditorUpdate() + { + // Do not execute when editor is not active to conserve power and prevent possible leaks. + if (!UnityEditorInternal.InternalEditorUtility.isApplicationActive) + { + return; + } + + s_EditorFramesSinceUpdate++; + + if (Instance == null) return; + + if (!Application.isPlaying) + { + if ((Time.time - EditorTime) >= (1f / Mathf.Clamp(Instance._EditModeFrameRate, 0.01f, 120f))) + { + s_EditorFrames++; + s_EditorFramesSinceUpdate = 0; + + EditorDeltaTime = Time.time - EditorTime; + EditorTime = Time.time; + + Instance.RunUpdate(); + } + } + } + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void OnDomainReload() + { + s_EditorFramesSinceUpdate = 0; + AfterRuntimeLoad(); + } + + [UnityEditor.Callbacks.DidReloadScripts] + static void OnReLoadScripts() + { + AfterScriptReload(); + } + + [@OnChange] + void OnChange(string path, object previous) + { + switch (path) + { + case nameof(_ExtentsSizeMultiplier): + case nameof(_GeometryDownSampleFactor): + Surface._Rebuild = true; + break; + case nameof(_ShowWaterProxyPlane): + SetShowProxyPlane((bool)previous, _ShowWaterProxyPlane); + break; + } + } + + void SetShowProxyPlane(bool previous, bool current) + { + if (previous == current) return; + if (!isActiveAndEnabled || Application.isPlaying) return; + if (!(runInEditMode = !_ShowWaterProxyPlane)) OnDisable(); + } + } + + partial class WaterRenderer + { + /// + private protected override void OnValidate() + { + base.OnValidate(); + + // Must be at least 0.25, and must be on a power of 2 + _ScaleRange.x = Mathf.Pow(2f, Mathf.Round(Mathf.Log(Mathf.Max(_ScaleRange.x, 0.25f), 2f))); + + if (_ScaleRange.y < Mathf.Infinity) + { + // otherwise must be at least 0.25, and must be on a power of 2 + _ScaleRange.y = Mathf.Pow(2f, Mathf.Round(Mathf.Log(Mathf.Max(_ScaleRange.y, _ScaleRange.x), 2f))); + } + + // Gravity 0 makes waves freeze which is weird but doesn't seem to break anything so allowing this for now + _GravityMultiplier = Mathf.Max(_GravityMultiplier, 0f); + + // LOD data resolution multiple of 2 for general GPU texture reasons (like pixel quads) + _Resolution -= _Resolution % 2; + + _GeometryDownSampleFactor = Mathf.ClosestPowerOfTwo(Mathf.Max(_GeometryDownSampleFactor, 1)); + + var remGeo = _Resolution % _GeometryDownSampleFactor; + if (remGeo > 0) + { + var newLDR = _Resolution - (_Resolution % _GeometryDownSampleFactor); + Debug.LogWarning + ( + $"Crest: Adjusted Lod Data Resolution from {_Resolution} to {newLDR} to ensure the Geometry Down Sample Factor is a factor ({_GeometryDownSampleFactor}).", + this + ); + + _Resolution = newLDR; + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Editor.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Editor.cs.meta new file mode 100644 index 0000000..12b76ca --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Editor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f361a0bff37be4412a136b8a846304c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.HighDefinition.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.HighDefinition.cs new file mode 100644 index 0000000..bfe9c4b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.HighDefinition.cs @@ -0,0 +1,306 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityHDRP + +using System.Reflection; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest +{ + // High Definition Render Pipeline + partial class WaterRenderer + { + internal static partial class ShaderIDs + { + // High Definition Render Pipeline + public static readonly int s_PrimaryLightDirection = Shader.PropertyToID("g_Crest_PrimaryLightDirection"); + public static readonly int s_PrimaryLightIntensity = Shader.PropertyToID("g_Crest_PrimaryLightIntensity"); + } + + internal static bool s_CameraMSAA; + + bool _DoneHighDefinitionLighting; + + void OnBeginContextRendering(ScriptableRenderContext context, System.Collections.Generic.List cameras) + { + s_CameraMSAA = false; + } + + // This use to be in OnBeginContextRendering with comment: "Most compatible with + // lighting options if computed here". Cannot remember what that meant. + internal void UpdateHighDefinitionLighting(Camera camera) + { + if (_DoneHighDefinitionLighting) + { + return; + } + + var lightDirection = Vector3.zero; + var lightIntensity = Color.black; + var sun = PrimaryLight; + + if (sun != null && sun.isActiveAndEnabled && sun.TryGetComponent(out var data)) + { + lightDirection = -sun.transform.forward; + lightIntensity = Color.clear; + + // It was reported that Light.intensity causes flickering when updated with + // HDAdditionalLightData.SetIntensity, unless we get intensity from there. + { + // Adapted from Helpers.FinalColor. + var light = data; + var linear = GraphicsSettings.lightsUseLinearIntensity; + var color = linear ? light.color.linear : light.color; +#if UNITY_6000_0_OR_NEWER + color *= sun.intensity; +#else + color *= light.intensity; +#endif + if (linear && light.useColorTemperature) color *= Mathf.CorrelatedColorTemperatureToRGB(sun.colorTemperature); + if (!linear) color = color.MaybeLinear(); + lightIntensity = linear ? color.MaybeGamma() : color; + } + + // Transmittance is for Physically Based Sky. + var hdCamera = HDCamera.GetOrCreate(camera); + var settings = SkyManager.GetSkySetting(hdCamera.volumeStack); + var transmittance = settings != null + ? settings.EvaluateAtmosphericAttenuation(lightDirection, hdCamera.camera.transform.position) + : Vector3.one; + + lightIntensity *= transmittance.x; + lightIntensity *= transmittance.y; + lightIntensity *= transmittance.z; + } + + Shader.SetGlobalVector(ShaderIDs.s_PrimaryLightDirection, lightDirection); + Shader.SetGlobalVector(ShaderIDs.s_PrimaryLightIntensity, lightIntensity); + + _DoneHighDefinitionLighting = true; + } + } + + sealed class CrestInternalCopyToTextureCustomPass : CustomPass + { + const string k_Name = "Update Pyramids"; + + static CrestInternalCopyToTextureCustomPass s_Instance; + + WaterRenderer _Water; + + // Wraps depth pyramid, so we can use Blitter. + RTHandle _DepthPyramid; + + RenderTexture _DepthTexture; + RenderTexture _DepthTextureDynamic; + + public static void Enable(WaterRenderer renderer) + { + var gameObject = CustomPassHelpers.CreateOrUpdate + ( + parent: renderer.Container.transform, + k_Name, + hide: !renderer._Debug._ShowHiddenObjects + ); + + CustomPassHelpers.CreateOrUpdate + ( + gameObject, + ref s_Instance, + WaterRenderer.k_DrawWater, + renderer.RenderBeforeTransparency + ? CustomPassInjectionPoint.BeforeTransparent + : CustomPassInjectionPoint.BeforePostProcess, + priority: -1 + ); + + s_Instance._Water = renderer; + + RenderPipelineManager.beginCameraRendering -= s_Instance.OnBeginCameraRendering; + RenderPipelineManager.beginCameraRendering += s_Instance.OnBeginCameraRendering; + RenderPipelineManager.endCameraRendering -= s_Instance.OnEndCameraRendering; + RenderPipelineManager.endCameraRendering += s_Instance.OnEndCameraRendering; + } + + public static void Disable() + { + if (s_Instance != null) + { + RenderPipelineManager.beginCameraRendering -= s_Instance.OnBeginCameraRendering; + RenderPipelineManager.endCameraRendering -= s_Instance.OnEndCameraRendering; + } + + // It should be safe to rely on this reference for this reference to fail. + if (s_Instance != null && s_Instance._GameObject != null) + { + // Will also trigger Cleanup below. + s_Instance._GameObject.SetActive(false); + } + } + + void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + s_Instance._Volume.injectionPoint = _Water.RenderBeforeTransparency + ? CustomPassInjectionPoint.BeforeTransparent + : CustomPassInjectionPoint.BeforePostProcess; + } + + void OnEndCameraRendering(ScriptableRenderContext context, Camera camera) + { + if (this == null) return; + + if (!WaterRenderer.ShouldRender(camera, _Water.Surface.Layer)) + { + return; + } + + // TODO: Work out conditions where depth copy is needed when rendering during transparency. + if (!_Water.RenderBeforeTransparency) + { + return; + } + + var rt = Shader.GetGlobalTexture(Shader.PropertyToID("_CameraDepthTexture")) as RenderTexture; + var hdCamera = HDCamera.GetOrCreate(camera); + + if (hdCamera.allowDynamicResolution && hdCamera.canDoDynamicResolution) + { + _DepthTextureDynamic = rt; + } + else + { + _DepthTexture = rt; + } + } + + protected override void Cleanup() + { + base.Cleanup(); + // Unset internal RT to avoid release it. + _DepthPyramid?.SetRenderTexture(null); + _DepthPyramid?.Release(); + } + + MipGenerator MipGenerator => +#if UNITY_6000_OR_NEWER + (RenderPipelineManager.currentPipeline as HDRenderPipeline).m_MipGenerator +#else + s_MipGenerator.GetValue(RenderPipelineManager.currentPipeline) as MipGenerator; + static readonly FieldInfo s_MipGenerator = typeof(HDRenderPipeline).GetField("m_MipGenerator", BindingFlags.NonPublic | BindingFlags.Instance); +#endif + + static readonly MethodInfo s_UseScaling = typeof(RTHandle).GetProperty("useScaling", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance).SetMethod; + static readonly object[] s_UseScalingParameters = { true }; + + static void UseScaling(RTHandle rt) + { + s_UseScaling.Invoke(rt, s_UseScalingParameters); + } + + protected override void Execute(CustomPassContext context) + { + // We cannot override _ColorPyramidTexture or _CameraDepthTexture with our own + // texture, so we write to these textures instead. Getting these textures has + // been tricky. Getting _ColorPyramidTexture with Shader.GetGlobalTexture does + // not always work, as it is replaced with the distortion color pyramid before + // we can grab it. + + var hdCamera = context.hdCamera; + var camera = hdCamera.camera; + var buffer = context.cmd; + + if (!WaterRenderer.ShouldRender(camera, _Water.Surface.Layer)) + { + return; + } + + if (_Water.Surface.Material == null) + { + return; + } + + if (!SurfaceRenderer.IsTransparent(_Water.Surface.Material)) + { + return; + } + + // Our reflections do not need them. + if (camera == WaterReflections.CurrentCamera) + { + return; + } + + if (context.hdCamera.msaaEnabled) + { + WaterRenderer.s_CameraMSAA = true; + return; + } + + if (!_Water.RenderBeforeTransparency && hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion)) + { + return; + } + + if (_Water.WriteToColorTexture) + { + var colorTexture = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ColorBufferMipChain); + + if (colorTexture != null) + { + buffer.BeginSample(WaterRenderer.k_DrawCopyColor); + + var pyramidSize = new Vector2Int(hdCamera.actualWidth, hdCamera.actualHeight); + Blitter.BlitCameraTexture(buffer, context.cameraColorBuffer, colorTexture); + MipGenerator.RenderColorGaussianPyramid(buffer, pyramidSize, context.cameraColorBuffer, colorTexture); + + buffer.EndSample(WaterRenderer.k_DrawCopyColor); + } + } + + // TODO: Work out conditions where depth copy is needed when rendering during transparency. + if (!_Water.RenderBeforeTransparency) + { + return; + } + + if (_Water.WriteToDepthTexture) + { + // Texture is not set yet, so we need to store it at the end of rendering. + // Textures may be different depending on configuration. + var depthTexture = hdCamera.allowDynamicResolution && hdCamera.canDoDynamicResolution ? _DepthTextureDynamic : _DepthTexture; + + if (depthTexture != null) + { + buffer.BeginSample(WaterRenderer.k_DrawCopyDepth); + + // Set up wrapper, so we can use Blitter. + _DepthPyramid ??= RTHandles.Alloc(depthTexture); + _DepthPyramid.SetRenderTexture(depthTexture); + UseScaling(_DepthPyramid); + + // Blit to the bottom of the depth atlas. + Blitter.BlitCameraTexture(buffer, context.cameraDepthBuffer, _DepthPyramid, new Rect(0, 0, hdCamera.actualWidth, hdCamera.actualHeight)); + + // Regenerate the depth pyramid. + MipGenerator.RenderMinDepthPyramid + ( + buffer, + depthTexture, + hdCamera.depthBufferMipChainInfo +#if !UNITY_6000_0_OR_NEWER + , mip1AlreadyComputed: false +#endif + ); + + buffer.EndSample(WaterRenderer.k_DrawCopyDepth); + } + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.HighDefinition.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.HighDefinition.cs.meta new file mode 100644 index 0000000..1e095ea --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.HighDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b5f4ec80b27f479aa559923ae6ca939 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Legacy.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Legacy.cs new file mode 100644 index 0000000..20ffa4e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Legacy.cs @@ -0,0 +1,250 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + // Built-in Render Pipeline + partial class WaterRenderer + { + internal const string k_DrawWater = "Crest.DrawWater"; + internal const string k_DrawCopyColor = "CopyColor"; + internal const string k_DrawCopyDepth = "CopyDepth"; + + partial class ShaderIDs + { + public static readonly int s_ScreenSpaceShadowTexture = Shader.PropertyToID("_Crest_ScreenSpaceShadowTexture"); + public static readonly int s_TemporaryDepthTexture = Shader.PropertyToID("_Crest_TemporaryDepthTexture"); + public static readonly int s_PrimaryLightHasCookie = Shader.PropertyToID("g_Crest_PrimaryLightHasCookie"); + + public static class Unity + { + public static readonly int s_CameraOpaqueTexture = Shader.PropertyToID("_CameraOpaqueTexture"); + } + } + + bool _DoneMatrices; + + CommandBuffer _ScreenSpaceShadowMapBuffer; + CommandBuffer _UpdateColorDepthTexturesBuffer; + + internal Rendering.BIRP.FrameBufferFormatOverride FrameBufferFormatOverride => + !_OverrideRenderHDR + ? Rendering.BIRP.FrameBufferFormatOverride.None + : _RenderHDR + ? Rendering.BIRP.FrameBufferFormatOverride.HDR + : Rendering.BIRP.FrameBufferFormatOverride.LDR; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void InitializeOnLoad() + { + // Fixes error on first frame. + Shader.SetGlobalTexture(Crest.ShaderIDs.Unity.s_ShadowMapTexture, Texture2D.whiteTexture); + } + + internal void UpdateMatrices(Camera camera) + { + if (_DoneMatrices) + { + return; + } + + Rendering.BIRP.SetMatrices(camera); + + _DoneMatrices = true; + } + + void OnBeginCameraRenderingLegacy(Camera camera) + { + if (PrimaryLight == null) + { + return; + } + + // Force shadow map to remain for transparent pass and beyond. + { + _ScreenSpaceShadowMapBuffer ??= new() { name = "Crest.CausticsOcclusion" }; + _ScreenSpaceShadowMapBuffer.Clear(); + + // Make the screen-space shadow texture available for the water shader for caustic occlusion. + _ScreenSpaceShadowMapBuffer.SetGlobalTexture(ShaderIDs.s_ScreenSpaceShadowTexture, BuiltinRenderTextureType.CurrentActive); + PrimaryLight.AddCommandBuffer(LightEvent.AfterScreenspaceMask, _ScreenSpaceShadowMapBuffer); + + // Always set these in case shadow maps are disabled in the graphics settings which + // we cannot check at runtime. + // Black for shadowed. White for unshadowed. + Shader.SetGlobalTexture(ShaderIDs.s_ScreenSpaceShadowTexture, Rendering.BIRP.GetWhiteTexture(camera)); + } + + Helpers.SetGlobalBoolean(ShaderIDs.s_PrimaryLightHasCookie, PrimaryLight.cookie != null); + } + + void OnEndCameraRenderingLegacy(Camera camera) + { + _DoneMatrices = false; + _DoneCameraOpaqueTexture = false; + + if (_UpdateColorDepthTexturesBuffer != null) + { + camera.RemoveCommandBuffer(RenderBeforeTransparency ? CameraEvent.BeforeForwardAlpha : CameraEvent.AfterForwardAlpha, _UpdateColorDepthTexturesBuffer); + } + + if (QualitySettings.shadows != ShadowQuality.Disable && PrimaryLight != null) + { + if (_ScreenSpaceShadowMapBuffer != null) + { + PrimaryLight.RemoveCommandBuffer(LightEvent.AfterScreenspaceMask, _ScreenSpaceShadowMapBuffer); + } + } + + Shader.SetGlobalTexture(ShaderIDs.Unity.s_CameraOpaqueTexture, Texture2D.grayTexture); + } + + // Needs to be separate, as it needs to run after the water volume pass. + void OnLegacyCopyPass(Camera camera) + { + if (!ShouldRender(camera, Surface.Layer)) + { + return; + } + + if (Surface.Material == null) + { + return; + } + + if (!SurfaceRenderer.IsTransparent(Surface.Material)) + { + return; + } + + // Our reflections do not need them. + if (camera == WaterReflections.CurrentCamera) + { + return; + } + + _UpdateColorDepthTexturesBuffer ??= new() { name = k_DrawWater }; + _UpdateColorDepthTexturesBuffer.Clear(); + + var buffer = _UpdateColorDepthTexturesBuffer; + + if (WriteToColorTexture) + { + UpdateCameraOpaqueTexture(camera, buffer); + } + + if (WriteToDepthTexture && Shader.GetGlobalTexture(Crest.ShaderIDs.Unity.s_CameraDepthTexture) is RenderTexture depthRT) + { + buffer.BeginSample(k_DrawCopyDepth); + + // There is no way to update the depth texture with the depth buffer, as we cannot + // get a reference to it. We have to render water depth separately and then merge + // the results. + + var target = new RenderTargetIdentifier(depthRT, 0, CubemapFace.Unknown, -1); + + var id = ShaderIDs.s_TemporaryDepthTexture; + + buffer.GetTemporaryRT(id, depthRT.descriptor); + CoreUtils.SetRenderTarget(buffer, id, ClearFlag.Depth); + + Surface.Render(camera, buffer, pass: Surface.Material.FindPass("DepthOnly"), culled: true); + + buffer.SetGlobalTexture(Helpers.ShaderIDs.s_MainTexture, id); + + Helpers.Blit(buffer, target, Helpers.UtilityMaterial, (int)Helpers.UtilityPass.MergeDepth); + + // TODO: add debug toggle + // buffer.Blit(target, BuiltinRenderTextureType.CameraTarget); + + buffer.ReleaseTemporaryRT(id); + + buffer.EndSample(k_DrawCopyDepth); + } + + if (WriteToColorTexture || WriteToDepthTexture) + { + camera.AddCommandBuffer(RenderBeforeTransparency ? CameraEvent.BeforeForwardAlpha : CameraEvent.AfterForwardAlpha, buffer); + } + } + } + + // Camera Opaque Texture. + partial class WaterRenderer + { + bool _DoneCameraOpaqueTexture; + RenderTexture _CameraOpaqueTexture; + CommandBuffer _CameraOpaqueTextureCommands; + + internal void UpdateCameraOpaqueTexture(Camera camera, CommandBuffer commands) + { + commands.BeginSample(k_DrawCopyColor); + + var target = new RenderTargetIdentifier(_CameraOpaqueTexture, 0, CubemapFace.Unknown, -1); + + // Use blit instead of CopyTexture as it will smooth out issues with format + // differences which is very hard to get right for BIRP. + commands.Blit(BuiltinRenderTextureType.CameraTarget, target); + + commands.EndSample(k_DrawCopyColor); + } + + internal void OnBeginCameraOpaqueTexture(Camera camera) + { + if (_DoneCameraOpaqueTexture) + { + return; + } + + var descriptor = Rendering.BIRP.GetCameraTargetDescriptor(camera, FrameBufferFormatOverride); + + // Occurred in a build and caused a black screen. + if (descriptor.width <= 0) + { + return; + } + + if (_CameraOpaqueTexture == null) + { + _CameraOpaqueTexture = new(descriptor) + { + name = "_CameraOpaqueTexture", + }; + } + else + { + _CameraOpaqueTexture.Release(); + _CameraOpaqueTexture.descriptor = descriptor; + } + + _CameraOpaqueTexture.Create(); + + _CameraOpaqueTextureCommands ??= new() + { + name = "Crest.DrawWater", + }; + + _CameraOpaqueTextureCommands.Clear(); + + // Do every frame as we set to default texture at end of rendering. + _CameraOpaqueTextureCommands.SetGlobalTexture(Crest.ShaderIDs.Unity.s_CameraOpaqueTexture, _CameraOpaqueTexture); + + UpdateCameraOpaqueTexture(camera, _CameraOpaqueTextureCommands); + + camera.AddCommandBuffer(CameraEvent.BeforeForwardAlpha, _CameraOpaqueTextureCommands); + + _DoneCameraOpaqueTexture = true; + } + + internal void OnEndCameraOpaqueTexture(Camera camera) + { + if (_CameraOpaqueTextureCommands != null) + { + camera.RemoveCommandBuffer(CameraEvent.BeforeForwardAlpha, _CameraOpaqueTextureCommands); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Legacy.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Legacy.cs.meta new file mode 100644 index 0000000..8311693 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Legacy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7fc11f7d8705f46bcbce1e516a7686ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Migration.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Migration.cs new file mode 100644 index 0000000..b011c44 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Migration.cs @@ -0,0 +1,44 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + partial class WaterRenderer : ISerializationCallbackReceiver + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 1; +#pragma warning restore 414 + + /// + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + if (_Version < 1) + { +#pragma warning disable CS0618 // Type or member is obsolete + Surface._Layer = _Layer; + Surface._Material = _Material; + Surface._VolumeMaterial = _VolumeMaterial; + Surface._ChunkTemplate = _ChunkTemplate; + Surface._CastShadows = _CastShadows; + Surface._WaterBodyCulling = _WaterBodyCulling; + Surface._TimeSliceBoundsUpdateFrameCount = _TimeSliceBoundsUpdateFrameCount; + Surface._AllowRenderQueueSorting = _AllowRenderQueueSorting; + Surface._SurfaceSelfIntersectionFixMode = _SurfaceSelfIntersectionFixMode; +#pragma warning restore CS0618 // Type or member is obsolete + + _DepthLod._IncludeTerrainHeight = false; + + _Version = 1; + } + } + + /// + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Migration.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Migration.cs.meta new file mode 100644 index 0000000..8417133 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Migration.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9bf05888fe7e048428e9c1fb978a0d85 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.SerializedFields.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.SerializedFields.cs new file mode 100644 index 0000000..88b93a1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.SerializedFields.cs @@ -0,0 +1,460 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ +#if !d_CrestPortals + namespace Portals + { + // Dummy script to keep serializer from complaining. + [System.Serializable] + public sealed class PortalRenderer { } + } +#endif + + /// + /// The render pass injection point. + /// + [@GenerateDoc] + public enum WaterInjectionPoint + { + /// + [Tooltip("Renders in the default pass.\n\nFor the water surface, this will be determined by the material (opaque or transparent). This pass is controlled by Unity, and is not compatible with certain features like soft particles.\n\nFor the water volume, this will be after transparency.")] + Default, + + /// + [Tooltip("Renders before the transparent pass.\n\nThis has advantages like being compatible with soft particles, refractive shaders, and possibly third-party fog.")] + BeforeTransparent, + } + + partial class WaterRenderer + { + internal const float k_MaximumWindSpeedKPH = 150f; + + [@Space(1, isAlwaysVisible: true)] + + [@Group("General", Group.Style.Accordian)] + + [Tooltip("The camera which drives the water data.\n\nSetting this is optional. Defaults to the main camera.")] + [@GenerateAPI(Getter.Custom, name: "Viewer")] + [@DecoratedField, SerializeField] + internal Camera _Camera; + + [Tooltip("Optional provider for time.\n\nCan be used to hard-code time for automation, or provide server time. Defaults to local Unity time.")] + [@DecoratedField, SerializeField] + internal TimeProvider _TimeProvider; + + + [@Group("Environment", Group.Style.Accordian)] + + [Tooltip("Uses a provided WindZone as the source of global wind.\n\nIt must be directional. Wind speed units are presumed to be in m/s.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + WindZone _WindZone; + + [Tooltip("Whether to override the given wind zone's wind speed.")] + [@Predicated(nameof(_WindZone), hide: true)] + [@InlineToggle, SerializeField] + bool _OverrideWindZoneWindSpeed; + + [Tooltip("Base wind speed in km/h.\n\nControls wave conditions. Can be overridden on Shape* components.")] + [@Predicated(typeof(WaterRenderer), nameof(WindSpeedOverriden), inverted: true, hide: true)] + [@ShowComputedProperty(nameof(WindSpeed))] + [@Range(0, k_MaximumWindSpeedKPH, scale: 2f)] + [@GenerateAPI(Getter.Custom)] + [SerializeField] + internal float _WindSpeed = 10f; + + [Tooltip("Whether to override the given wind zone's wind direction.")] + [@Predicated(nameof(_WindZone), hide: true)] + [@InlineToggle, SerializeField] + bool _OverrideWindZoneWindDirection; + + [Tooltip("Base wind direction in degrees.\n\nControls wave conditions. Can be overridden on Shape* components.")] + [@Predicated(typeof(WaterRenderer), nameof(WindDirectionOverriden), inverted: true, hide: true)] + [@ShowComputedProperty(nameof(WindDirection))] + [@Range(-180, 180)] + [@GenerateAPI(Getter.Custom)] + [SerializeField] + internal float _WindDirection; + + [Tooltip("Whether to override the given wind zone's wind turbulence.")] + [@Predicated(nameof(_WindZone), hide: true)] + [@InlineToggle, SerializeField] + bool _OverrideWindZoneWindTurbulence; + + [Tooltip("Base wind turbulence.\n\nControls wave conditions. Can be overridden on ShapeFFT components.")] + [@Predicated(typeof(WaterRenderer), nameof(WindTurbulenceOverriden), inverted: true, hide: true)] + [@ShowComputedProperty(nameof(WindTurbulence))] + [@Range(0, 1)] + [@GenerateAPI(Getter.Custom)] + [SerializeField] + internal float _WindTurbulence = 0.145f; + + [@Space(10)] + + [Tooltip("Provide your own gravity value instead of Physics.gravity.")] + [@GenerateAPI] + [@InlineToggle, SerializeField] + bool _OverrideGravity; + + [@Label("Gravity")] + [Tooltip("Gravity for all wave calculations.")] + [@Predicated(nameof(_OverrideGravity))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _GravityOverride = -9.8f; + + [Tooltip("Multiplier for physics gravity.")] + [@Range(0f, 10f)] + [@GenerateAPI] + [SerializeField] + float _GravityMultiplier = 1f; + + [@Space(10)] + + [Tooltip("The primary light that affects the water.\n\nSetting this is optional. This should be a directional light. Defaults to RenderSettings.sun.")] + [@GenerateAPI(Getter.Custom)] + [@DecoratedField, SerializeField] + Light _PrimaryLight; + + +#if !d_Crest_LegacyUnderwater + [@Group("Rendering", Group.Style.Accordian)] +#else + [HideInInspector] +#endif + + [Tooltip("When in the render pipeline the water is rendered.\n\nDefault is the old behaviour which is controlled by Unity.\n\nBefore Transparency has advantages like being compatible with soft particles, refractive shaders, and possibly third-party atmospheric fog.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + WaterInjectionPoint _InjectionPoint; + +#if !d_Crest_LegacyUnderwater + [@Space(10)] +#else + [@Group("Rendering", Group.Style.Accordian)] +#endif + + [@Label("Color Texture")] + [Tooltip("Whether to write the water surface color to the color/opaque texture.\n\nThis is likely only beneficial if the water injection point is before transparency, and there are shaders which need it (like refraction).")] + [@Predicated(nameof(_InjectionPoint), inverted: false, nameof(WaterInjectionPoint.Default))] + [@GenerateAPI(Getter.Custom)] + [@DecoratedField, SerializeField] + internal bool _WriteToColorTexture = true; + + [@Label("Depth Texture")] + [Tooltip("Whether to write the water surface depth to the depth texture.\n\nThe water surface writes to the depth buffer, but Unity does not copy it to the depth texture for post-processing effects like Depth of Field (or refraction). This will copy the depth buffer to the depth texture.\n\nIf the water injection point is in the transparent pass, be wary that it will include all transparent objects that write to depth. Furthermore, other third parties may already be doing this, and we do not check whether it is necessary to copy or not.\n\nThis feature has a considerable overhead if using the built-in render pipeline, as it requires rendering the surface depth another time.")] + [@Predicated(nameof(_Surface) + "." + nameof(SurfaceRenderer._Enabled))] + [@GenerateAPI(Getter.Custom)] + [@DecoratedField, SerializeField] + internal bool _WriteToDepthTexture = true; + + [@Label("Motion Vectors")] + [Tooltip("Whether to enable motion vector support.")] +#if !UNITY_6000_0_OR_NEWER + [@Predicated(RenderPipeline.Universal, inverted: true, hide: true)] +#endif + [@GenerateAPI(Getter.Custom)] + [@DecoratedField, SerializeField] + internal bool _WriteMotionVectors = true; + + [@Space(10)] + + [Tooltip("Whether to override the automatic detection of framebuffer HDR rendering (BIRP only).\n\nRendering using HDR formats is optional, but there is no way for us to determine if HDR rendering is enabled in the Graphics Settings. We make an educated based on which platform is the target. If you see rendering issues, try disabling this.\n\n This has nothing to do with having an HDR monitor.")] + [@Predicated(RenderPipeline.Legacy, hide: true)] + [@GenerateAPI] + [@InlineToggle, SerializeField] + bool _OverrideRenderHDR; + + [Tooltip("Force HDR format usage (BIRP only).\n\nIf enabled, we assume the framebuffer is an HDR format, otherwise an LDR format.")] + [@Predicated(RenderPipeline.Legacy, hide: true)] + [@Predicated(nameof(_OverrideRenderHDR))] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _RenderHDR = true; + + + [@Group(isCustomFoldout: true)] + + [Tooltip("The water surface renderer.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField(isCustomFoldout: true), SerializeReference] + SurfaceRenderer _Surface = new(); + + + [@Group("Level of Detail", Group.Style.Accordian)] + + [@Label("Scale")] + [Tooltip("The scale the water can be (infinity for no maximum).\n\nWater is scaled horizontally with viewer height, to keep the meshing suitable for elevated viewpoints. This sets the minimum and maximum the water will be scaled. Low minimum values give lots of detail, but will limit the horizontal extents of the water detail. Increasing the minimum value can be a great performance saving for mobile as it will reduce draw calls.")] + [@Range(0.25f, 256f, Range.Clamp.Minimum, delayed: false)] + [@GenerateAPI] + [SerializeField] + Vector2 _ScaleRange = new(4f, 256f); + + [Tooltip("Drops the height for maximum water detail based on waves.\n\nThis means if there are big waves, max detail level is reached at a lower height, which can help visual range when there are very large waves and camera is at sea level.")] + [@Range(0f, 1f)] + [@GenerateAPI] + [SerializeField] + float _DropDetailHeightBasedOnWaves = 0.2f; + + [@Label("Levels")] + [Tooltip("Number of levels of details (chunks, scales etc) to generate.\n\nThe horizontal range of the water surface doubles for each added LOD, while GPU processing time increases linearly. The higher the number, the further out detail will be. Furthermore, the higher the count, the more larger wavelengths can be filtering in queries.")] + [@Range(2, Lod.k_MaximumSlices)] + [@GenerateAPI(name: "LodLevels")] + [SerializeField] + int _Slices = 9; + + [@Label("Resolution")] + [Tooltip("The resolution of the various water LOD data.\n\nThis includes mesh density, displacement textures, foam data, dynamic wave simulation, etc. Sets the 'detail' present in the water - larger values give more detail at increased run-time expense. This value can be overriden per LOD in their respective settings except for Animated Waves which is tied to this value.")] + [@Range(80, 1024, Range.Clamp.Minimum, step: 16, delayed: true)] + [@Maximum(Constants.k_MaximumTextureResolution)] + [@WarnIfAbove(1024)] + [@GenerateAPI(name: "LodResolution")] + [SerializeField] + int _Resolution = 384; + + [Tooltip("How much of the water shape gets tessellated by geometry.\n\nFor example, if set to four, every geometry quad will span 4x4 LOD data texels. a value of 2 will generate one vert per 2x2 LOD data texels. A value of 1 means a vert is generated for every LOD data texel. Larger values give lower fidelity surface shape with higher performance.")] + [@Delayed] + [@GenerateAPI] + [SerializeField] + internal int _GeometryDownSampleFactor = 2; + + [Tooltip("Applied to the extents' far vertices to make them larger.\n\nIncrease if the extents do not reach the horizon or you see the underwater effect at the horizon.")] + [@Delayed] + [@GenerateAPI] + [SerializeField] + internal float _ExtentsSizeMultiplier = 100f; + + [@Heading("Center of Detail")] + + [Tooltip("The viewpoint which drives the water detail - the center of the LOD system.\n\nSetting this is optional. Defaults to the camera.")] + [@GenerateAPI(Getter.Custom)] + [@DecoratedField, SerializeField] + Transform _Viewpoint; + + [@Label("Displacement Correction")] + [Tooltip("Keep the center of detail from drifting from the viewpoint.\n\nLarge horizontal displacement can displace the center of detail. This uses queries to keep the center of detail aligned.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _CenterOfDetailDisplacementCorrection = true; + + [Tooltip("Also checks terrain height when determining the scale.\n\nThe scale is changed based on the viewer's height above the water surface. This can be a problem with varied water level, as the viewer may not be directly over the higher water level leading to a height difference, and thus incorrect scale.")] + [Predicated(nameof(_Viewpoint), inverted: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _SampleTerrainHeightForScale = true; + + [Tooltip("Forces smoothing for scale changes.\n\nWhen water level varies, smoothing scale change can prevent pops when the viewer's height above water sharply changes. Smoothing is disabled when terrain sampling is enabled or the water level simulation is disabled.")] + [Predicated(nameof(_Viewpoint), inverted: true)] + [@GenerateAPI] + [@DecoratedField, SerializeField] + bool _ForceScaleChangeSmoothing; + + [Tooltip("The distance threshold for when the viewer has considered to have teleported.\n\nThis is used to prevent popping, and for prewarming simulations. Threshold is in Unity units.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _TeleportThreshold = 100f; + + + [@Group("Simulations", Group.Style.Accordian)] + + [@Label("Animated Waves")] + [Tooltip("All waves (including Dynamic Waves) are written to this simulation.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal AnimatedWavesLod _AnimatedWavesLod = new(); + + [@Label("Water Depth")] + [Tooltip("Water depth information used for shallow water, shoreline foam, wave attenuation, among others.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal DepthLod _DepthLod = new(); + + [@Label("Water Level")] + [Tooltip("Varying water level to support water bodies at different heights and rivers to run down slopes.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal LevelLod _LevelLod = new(); + + [@Label("Foam")] + [Tooltip("Simulation of foam created in choppy water and dissipating over time.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal FoamLod _FoamLod = new(); + + [@Label("Dynamic Waves")] + [Tooltip("Dynamic waves generated from interactions with objects such as boats.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal DynamicWavesLod _DynamicWavesLod = new(); + + [@Label("Flow")] + [Tooltip("Horizontal motion of water body, akin to water currents.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal FlowLod _FlowLod = new(); + + [@Label("Shadows")] + [Tooltip("Shadow information used for lighting water.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal ShadowLod _ShadowLod = new(); + + [@Label("Absorption")] + [Tooltip("Absorption information - gives color to water.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal AbsorptionLod _AbsorptionLod = new(); + + [@Label("Scattering")] + [Tooltip("Scattering information - gives color to water.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal ScatteringLod _ScatteringLod = new(); + + [@Label("Surface Clipping")] + [Tooltip("Clip surface information for clipping the water surface.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal ClipLod _ClipLod = new(); + + [@Label("Albedo / Decals")] + [Tooltip("Albedo - a colour layer composited onto the water surface.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField, SerializeReference] + internal AlbedoLod _AlbedoLod = new(); + + + [@Group(isCustomFoldout: true)] + + [Tooltip("The reflection renderer.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField(isCustomFoldout: true), SerializeReference] + internal WaterReflections _Reflections = new(); + + + [@Group(isCustomFoldout: true)] + + [Tooltip("The underwater renderer.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField(isCustomFoldout: true), SerializeReference] + internal UnderwaterRenderer _Underwater = new(); + + + [@Group(isCustomFoldout: true)] + + [Tooltip("The meniscus module.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField(isCustomFoldout: true), SerializeReference] + internal Meniscus _Meniscus = new(); + + +#if !d_CrestPortals + // Hide if package is not present. Fallback to dummy script. + [HideInInspector] +#endif + + [@Group(isCustomFoldout: true)] + + [Tooltip("The portal renderer.")] + [@GenerateAPI(Setter.None)] + [@DecoratedField(isCustomFoldout: true), SerializeReference] + internal Portals.PortalRenderer _Portals = new(); + + + [@Group("Edit Mode", Group.Style.Accordian)] + +#pragma warning disable 414 + [@DecoratedField, SerializeField] + internal bool _ShowWaterProxyPlane; + + [Tooltip("Sets the update rate of the water system when in edit mode.\n\nCan be reduced to save power.")] + [@Range(0f, 120f, Range.Clamp.Minimum)] + [SerializeField] + float _EditModeFrameRate = 30f; + + [Tooltip("Move water with Scene view camera if Scene window is focused.")] + [@Predicated(nameof(_ShowWaterProxyPlane), true)] + [@DecoratedField, SerializeField] + internal bool _FollowSceneCamera = true; + + [Tooltip("Whether height queries are enabled in edit mode.")] + [@DecoratedField, SerializeField] + internal bool _HeightQueries = true; +#pragma warning restore 414 + + + [@Group("Debug", isCustomFoldout: true)] + + [@DecoratedField(isCustomFoldout: true), SerializeField] + internal DebugFields _Debug = new(); + + [System.Serializable] + internal sealed class DebugFields + { + [@Space(10)] + + [Tooltip("Attach debug GUI that adds some controls and allows to visualize the water data.")] + [@DecoratedField, SerializeField] + public bool _AttachDebugGUI; + + [Tooltip("Show hidden objects like water chunks in the hierarchy.")] + [@DecoratedField, SerializeField] + public bool _ShowHiddenObjects; + +#if !CREST_DEBUG + [HideInInspector] +#endif + [Tooltip("Water will not move with viewpoint.")] + [@DecoratedField, SerializeField] + public bool _DisableFollowViewpoint; + + [Tooltip("Resources are normally released in OnDestroy (except in edit mode) which avoids expensive rebuilds when toggling this component. This option moves it to OnDisable. If you need this active then please report to us.")] + [@DecoratedField, SerializeField] + public bool _DestroyResourcesInOnDisable; + +#if CREST_DEBUG + [@DecoratedField, SerializeField] + public bool _DrawLodOutline; + + [@DecoratedField, SerializeField] + public bool _ShowDebugInformation; +#endif + + [@Heading("Scale")] + +#if !CREST_DEBUG + [HideInInspector] +#endif + [Tooltip("Water will not move with viewpoint.")] + [@DecoratedField, SerializeField] + public bool _LogScaleChange; + +#if !CREST_DEBUG + [HideInInspector] +#endif + [Tooltip("Water will not move with viewpoint.")] + [@DecoratedField, SerializeField] + public bool _PauseOnScaleChange; + +#if !CREST_DEBUG + [HideInInspector] +#endif + [Tooltip("Water will not move with viewpoint.")] + [@DecoratedField, SerializeField] + public bool _IgnoreWavesForScaleChange; + + [@Heading("Server")] + + [Tooltip("Emulate running on a client without a GPU. Equivalent to running standalone with -nographics argument.")] + [@DecoratedField, SerializeField] + public bool _ForceNoGraphics; + } + + [SerializeField, HideInInspector] + internal WaterResources _Resources; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.SerializedFields.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.SerializedFields.cs.meta new file mode 100644 index 0000000..3eaa2c5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.SerializedFields.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d451a586ee4f40c7be034113ba04983 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Universal.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Universal.cs new file mode 100644 index 0000000..3280db9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Universal.cs @@ -0,0 +1,197 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityURP + +#if !UNITY_6000_3_OR_NEWER +#define URP_COMPATIBILITY_MODE +#endif + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace WaveHarmonic.Crest +{ + // Universal Render Pipeline + partial class WaterRenderer + { + internal const RenderPassEvent k_WaterRenderPassEvent = RenderPassEvent.BeforeRenderingTransparents; + + internal sealed class CopyTargetsRenderPass : ScriptableRenderPass + { + readonly WaterRenderer _Water; + public static CopyTargetsRenderPass Instance { get; set; } + + readonly UnityEngine.Rendering.Universal.Internal.CopyDepthPass _CopyDepthPass; + readonly Shader _CopyDepthShader; + readonly Material _CopyDepthMaterial; + + static readonly System.Reflection.FieldInfo s_OpaqueColor = typeof(UniversalRenderer).GetField("m_OpaqueColor", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + static readonly System.Reflection.FieldInfo s_ActiveRenderPassQueue = typeof(ScriptableRenderer).GetField("m_ActiveRenderPassQueue", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + readonly UnityEngine.Rendering.Universal.Internal.CopyColorPass _CopyColorPass; + readonly Material _CopyColorMaterial; + readonly Material _SampleColorMaterial; + + public CopyTargetsRenderPass(WaterRenderer water) + { + _Water = water; + + _CopyDepthShader = Shader.Find("Hidden/Universal Render Pipeline/CopyDepth"); +#if !UNITY_6000_0_OR_NEWER + _CopyDepthMaterial = new Material(_CopyDepthShader); +#endif + + _CopyDepthPass = new + ( + renderPassEvent, +#if UNITY_6000_0_OR_NEWER + _CopyDepthShader, +#else + _CopyDepthMaterial, +#endif + // Will not work in U6 without it. + copyToDepth: true, + copyResolvedDepth: RenderingUtils.MultisampleDepthResolveSupported(), + shouldClear: false +#if UNITY_6000_0_OR_NEWER + , customPassName: "Crest.DrawWater" +#endif + ); + + _CopyColorMaterial = new(Shader.Find("Hidden/Universal/CoreBlit")); + _SampleColorMaterial = new(Shader.Find("Hidden/Universal Render Pipeline/Sampling")); + + _CopyColorPass = new + ( + renderPassEvent, + _SampleColorMaterial, + _CopyColorMaterial +#if UNITY_6000_0_OR_NEWER + , customPassName: "Crest.DrawWater" +#endif + ); + } + + public static void Enable(WaterRenderer water) + { + Instance = new(water); + } + + internal void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + var water = _Water; + + if (!ShouldRender(camera, water.Surface.Layer)) + { + return; + } + + // Our reflections do not need them. + if (camera == WaterReflections.CurrentCamera) + { + return; + } + + + if (!water.WriteToColorTexture && !water.WriteToDepthTexture) + { + return; + } + + if (water.Surface.Material == null) + { + return; + } + + // TODO: Could also check RenderType. Which is better? + if (!SurfaceRenderer.IsTransparent(water.Surface.Material)) + { + return; + } + + renderPassEvent = water.RenderBeforeTransparency ? RenderPassEvent.BeforeRenderingTransparents : RenderPassEvent.AfterRenderingTransparents; + _CopyColorPass.renderPassEvent = renderPassEvent; + _CopyDepthPass.renderPassEvent = renderPassEvent; + + var renderer = camera.GetUniversalAdditionalCameraData().scriptableRenderer; + // Needed for OnCameraSetup. + renderer.EnqueuePass(this); + +#if UNITY_6000_0_OR_NEWER + // Copy depth pass does not support RG directly. + if (GraphicsSettings.GetRenderPipelineSettings().enableRenderCompatibilityMode) +#endif + { + if (water.WriteToColorTexture) renderer.EnqueuePass(_CopyColorPass); + if (water.WriteToDepthTexture) renderer.EnqueuePass(_CopyDepthPass); + } + } + +#if UNITY_6000_0_OR_NEWER + public override void RecordRenderGraph(UnityEngine.Rendering.RenderGraphModule.RenderGraph graph, ContextContainer frame) + { + var resources = frame.Get(); + var descriptor = resources.cameraDepthTexture.GetDescriptor(graph); + + if (_Water.WriteToColorTexture) + { + _CopyColorPass.RenderToExistingTexture(graph, frame, resources.cameraOpaqueTexture, resources.cameraColor, UniversalRenderPipeline.asset.opaqueDownsampling); + } + + if (_Water.WriteToDepthTexture) + { + // Whether we a writing to color or depth format. + _CopyDepthPass.CopyToDepth = descriptor.colorFormat == UnityEngine.Experimental.Rendering.GraphicsFormat.None; + _CopyDepthPass.Render(graph, frame, resources.cameraDepthTexture, resources.cameraDepth); + } + } + + [System.Obsolete] +#endif + public override void OnCameraSetup(CommandBuffer buffer, ref RenderingData data) + { + var renderer = (UniversalRenderer)data.cameraData.renderer; + var opaqueColorHandle = s_OpaqueColor.GetValue(renderer) as RTHandle; + + // Also check internal RT because it can be null on Vulkan for some reason. + if (renderer.cameraColorTargetHandle?.rt != null && opaqueColorHandle?.rt != null) + { + _CopyColorPass.Setup(renderer.cameraColorTargetHandle, opaqueColorHandle, UniversalRenderPipeline.asset.opaqueDownsampling); + } + else + { + var queue = s_ActiveRenderPassQueue.GetValue(renderer) as List; + queue.Remove(_CopyColorPass); + } + +#if URP_COMPATIBILITY_MODE + // Also check internal RT because it can be null on Vulkan for some reason. + if (renderer.cameraDepthTargetHandle?.rt != null && renderer.m_DepthTexture?.rt != null) + { + // Whether we a writing to color or depth format. + _CopyDepthPass.CopyToDepth = renderer.m_DepthTexture.rt.graphicsFormat == UnityEngine.Experimental.Rendering.GraphicsFormat.None; + _CopyDepthPass.m_CopyResolvedDepth = false; + _CopyDepthPass.Setup(renderer.cameraDepthTargetHandle, renderer.m_DepthTexture); + } + else +#endif + { + var queue = s_ActiveRenderPassQueue.GetValue(renderer) as List; + queue.Remove(_CopyDepthPass); + } + } + +#if UNITY_6000_0_OR_NEWER + [System.Obsolete] +#endif + public override void Execute(ScriptableRenderContext context, ref RenderingData data) + { + // Blank + } + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Universal.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Universal.cs.meta new file mode 100644 index 0000000..bdee803 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.Universal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fadddebc8ed94999856de21b2b9241e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.WaterLevelDepth.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.WaterLevelDepth.cs new file mode 100644 index 0000000..aa7e00f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.WaterLevelDepth.cs @@ -0,0 +1,2 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.WaterLevelDepth.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.WaterLevelDepth.cs.meta new file mode 100644 index 0000000..289bebe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.WaterLevelDepth.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb0a271a9c8434a75a94381cc48d2603 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.cs new file mode 100644 index 0000000..07ba5f0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.cs @@ -0,0 +1,1559 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using UnityEngine.Rendering; +using WaveHarmonic.Crest.Internal; +using WaveHarmonic.Crest.RelativeSpace; +using WaveHarmonic.Crest.Utility; + +namespace WaveHarmonic.Crest +{ + /// + /// The main script for the water system. + /// + /// + /// Attach this to an object to create water. This script initializes the various + /// data types and systems and moves/scales the water based on the viewpoint. It + /// also hosts a number of global settings that can be tweaked here. + /// + public sealed partial class WaterRenderer : ManagerBehaviour + { + internal const string k_RunUpdateMarker = "Crest.WaterRenderer.RunUpdate"; + + static readonly Unity.Profiling.ProfilerMarker s_RunUpdateMarker = new(k_RunUpdateMarker); + + internal static partial class ShaderIDs + { + public static readonly int s_Center = Shader.PropertyToID("g_Crest_WaterCenter"); + public static readonly int s_Scale = Shader.PropertyToID("g_Crest_WaterScale"); + public static readonly int s_Time = Shader.PropertyToID("g_Crest_Time"); + public static readonly int s_CascadeData = Shader.PropertyToID("g_Crest_CascadeData"); + public static readonly int s_CascadeDataSource = Shader.PropertyToID("g_Crest_CascadeDataSource"); + public static readonly int s_LodChange = Shader.PropertyToID("g_Crest_LodChange"); + public static readonly int s_MeshScaleLerp = Shader.PropertyToID("g_Crest_MeshScaleLerp"); + public static readonly int s_LodCount = Shader.PropertyToID("g_Crest_LodCount"); + + // Shader Properties + public static readonly int s_AbsorptionColor = Shader.PropertyToID("_Crest_AbsorptionColor"); + public static readonly int s_Absorption = Shader.PropertyToID("_Crest_Absorption"); + public static readonly int s_Scattering = Shader.PropertyToID("_Crest_Scattering"); + public static readonly int s_Anisotropy = Shader.PropertyToID("_Crest_Anisotropy"); + public static readonly int s_AmbientTerm = Shader.PropertyToID("_Crest_AmbientTerm"); + public static readonly int s_DirectTerm = Shader.PropertyToID("_Crest_DirectTerm"); + public static readonly int s_ShadowsAffectsAmbientFactor = Shader.PropertyToID("_Crest_ShadowsAffectsAmbientFactor"); + public static readonly int s_PlanarReflectionsEnabled = Shader.PropertyToID("_Crest_PlanarReflectionsEnabled"); + public static readonly int s_Occlusion = Shader.PropertyToID("_Crest_Occlusion"); + public static readonly int s_OcclusionUnderwater = Shader.PropertyToID("_Crest_OcclusionUnderwater"); + + // Motion Vectors + public static readonly int s_CenterDelta = Shader.PropertyToID("g_Crest_WaterCenterDelta"); + public static readonly int s_ScaleChange = Shader.PropertyToID("g_Crest_WaterScaleChange"); + + // Underwater + public static readonly int s_VolumeExtinctionLength = Shader.PropertyToID("_Crest_VolumeExtinctionLength"); + } + + + // + // Viewer + // + + Transform GetViewpoint() + { +#if UNITY_EDITOR + if (!Application.isPlaying && _FollowSceneCamera && SceneView.lastActiveSceneView != null && IsSceneViewActive) + { + return SceneView.lastActiveSceneView.camera.transform; + } +#endif + if (_Viewpoint != null) + { + return _Viewpoint; + } + + // Even with performance improvements, it is still good to cache whenever possible. + var camera = Viewer; + + if (camera != null) + { + return camera.transform; + } + + return null; + } + + internal Camera GetViewer(bool includeSceneCamera = true) + { +#if UNITY_EDITOR + if (includeSceneCamera && !Application.isPlaying && _FollowSceneCamera && SceneView.lastActiveSceneView != null && IsSceneViewActive) + { + return SceneView.lastActiveSceneView.camera; + } +#endif + + if (_Camera != null) + { + return _Camera; + } + + // Unity has greatly improved performance of this operation in 2019.4.9. + return Camera.main; + } + + // Cache the ViewCamera property for internal use. + Camera _ViewCameraCached; + + readonly SampleCollisionHelper _CenterOfDetailDisplacementCorrectionHelper = new(); + + + // + // Viewer Height + // + + /// + /// The water changes scale when viewer changes altitude, this gives the interpolation param between scales. + /// + internal float ViewerAltitudeLevelAlpha { get; private set; } + + /// + /// Vertical offset of camera vs water surface. + /// + public float ViewerHeightAboveWater { get; private set; } + + /// + /// Vertical offset of viewpoint vs water surface. + /// + public float ViewpointHeightAboveWater { get; private set; } + + /// + /// Distance of camera to shoreline. Positive if over water and negative if over land. + /// + public float ViewerDistanceToShoreline { get; private set; } + + /// + /// Smoothly varying version of viewpoint height to combat sudden changes in water level that are possible + /// when there are local bodies of water + /// + float _ViewpointHeightAboveWaterSmooth; + + readonly SampleCollisionHelper _SampleHeightHelper = new(); + readonly SampleDepthHelper _SampleDepthHelper = new(); + + internal float _ViewerHeightAboveWaterPerCamera; + readonly SampleCollisionHelper _SampleHeightHelperPerCamera = new(); + + + // + // Teleport Threshold + // + + float _TeleportTimerForHeightQueries; + bool _IsFirstFrameSinceEnabled = true; + internal bool _HasTeleportedThisFrame; + Vector3 _OldViewpointPosition; + +#if d_WaveHarmonic_Crest_ShiftingOrigin + Vector3 TeleportOriginThisFrame => ShiftingOrigin.ShiftThisFrame; +#else + Vector3 TeleportOriginThisFrame => Vector3.zero; +#endif + + // + // Wind + // + + internal float WindSpeedKPH => _WindSpeed; + bool WindSpeedOverriden => _WindZone == null || _OverrideWindZoneWindSpeed; + bool WindDirectionOverriden => _WindZone == null || _OverrideWindZoneWindDirection; + bool WindTurbulenceOverriden => _WindZone == null || _OverrideWindZoneWindTurbulence; + + float GetWindSpeed() + { + return _OverrideWindZoneWindSpeed || _WindZone == null ? _WindSpeed : _WindZone.windMain * 3.6f; + } + + float GetWindDirection() + { + var wind = _WindZone != null ? _WindZone.transform : null; + return _OverrideWindZoneWindDirection || wind == null + ? _WindDirection + : Mathf.Atan2(wind.forward.z, wind.forward.x) * Mathf.Rad2Deg; + } + + float GetWindTurbulence() + { + return _OverrideWindZoneWindTurbulence || _WindZone == null ? _WindTurbulence : _WindZone.windTurbulence; + } + + + // + // Transform + // + + internal Vector3 Position { get; private set; } + internal GameObject Container { get; private set; } + + /// + /// Sea level is given by y coordinate of GameObject with WaterRenderer script. + /// + public float SeaLevel => Position.y; + + // Anything higher (minus 1 for near plane) will be clipped. + const float k_RenderAboveSeaLevel = 10000f; + // Anything lower will be clipped. + const float k_RenderBelowSeaLevel = 10000f; + + Matrix4x4[] _ProjectionMatrix; + internal Matrix4x4 GetProjectionMatrix(int slice) => _ProjectionMatrix[slice]; + + internal static Matrix4x4 CalculateViewMatrixFromSnappedPositionRHS(Vector3 snapped) + { + return Helpers.CalculateWorldToCameraMatrixRHS(snapped + Vector3.up * k_RenderAboveSeaLevel, Quaternion.AngleAxis(90f, Vector3.right)); + } + + + // + // Time Provider + // + + /// + /// Loosely a stack for time providers. + /// + /// + /// The last in the list is the active one. When a + /// gets added to the stack, it is bumped to the top of + /// the list. When a is removed, all instances of it are + /// removed from the stack. This is less rigid than a real stack which would be + /// harder to use as users have to keep a close eye on the order that things are + /// pushed/popped. + /// + public Utility.Internal.Stack TimeProviders { get; private set; } = new(); + + /// + /// The current time provider. + /// + public ITimeProvider TimeProvider => TimeProviders.Peek(); + + internal float CurrentTime => TimeProvider.Time; + internal float DeltaTime => TimeProvider.Delta; + + + // + // Environment + // + + /// + /// The primary light that affects the water. This should be a directional light. + /// + Light GetPrimaryLight() => _PrimaryLight == null ? RenderSettings.sun : _PrimaryLight; + + /// + /// Physics gravity applied to water. + /// + public float Gravity => _GravityMultiplier * Mathf.Abs(_OverrideGravity ? _GravityOverride : Physics.gravity.y); + + + // + // Rendering + // + + // Used as an extra check to prevent null exceptions, as the events raised when an + // RP change happen too late for some things. + RenderPipeline _SetUpFor; + + internal bool RenderBeforeTransparency => +#if d_Crest_LegacyUnderwater + false; +#else + _InjectionPoint == WaterInjectionPoint.BeforeTransparent; +#endif + +#if d_CrestPortals + internal bool Portaled => _Portals.Active; +#else + internal bool Portaled => false; +#endif + + internal MaskRenderer _Mask; + + // Flags + bool _DonePerCameraHeight; + + bool GetWriteMotionVectors() => +#if !UNITY_6000_0_OR_NEWER + !RenderPipelineHelper.IsUniversal && +#endif + _WriteMotionVectors; + + bool GetWriteToColorTexture() + { + return (_WriteToColorTexture && RenderBeforeTransparency) || Meniscus.RequiresOpaqueTexture; + } + + bool GetWriteToDepthTexture() + { + return _WriteToDepthTexture && Surface.Enabled; + } + + internal static bool ShouldRender(Camera camera) + { +#if UNITY_EDITOR + // Preview camera are for preview game view, preview panes, material previews etc. + if (camera.cameraType == CameraType.Preview) + { + return false; + } +#endif + + return true; + } + + internal static bool ShouldRender(Camera camera, int layer) + { + if (!ShouldRender(camera)) + { + return false; + } + + if (!Helpers.MaskIncludesLayer(camera.cullingMask, layer)) + { + return false; + } + + return true; + } + + + // + // Material + // + + /// + /// Calculates the absorption value from the absorption color. + /// + /// The absorption color. + /// The absorption value (XYZ value). + public static Vector4 CalculateAbsorptionValueFromColor(Color color) + { + return UpdateAbsorptionFromColor(color); + } + + internal static Vector4 UpdateAbsorptionFromColor(Color color) + { + var alpha = Vector3.zero; + alpha.x = Mathf.Log(Mathf.Max(color.r, 0.0001f)); + alpha.y = Mathf.Log(Mathf.Max(color.g, 0.0001f)); + alpha.z = Mathf.Log(Mathf.Max(color.b, 0.0001f)); + // Magic numbers that make fog density easy to control using alpha channel + return (-color.a * 32f * alpha / 5f).XYZN(1f); + } + + internal static void UpdateAbsorptionFromColor(Material material) + { + var fogColour = material.GetColor(ShaderIDs.s_AbsorptionColor); + var alpha = Vector3.zero; + alpha.x = Mathf.Log(Mathf.Max(fogColour.r, 0.0001f)); + alpha.y = Mathf.Log(Mathf.Max(fogColour.g, 0.0001f)); + alpha.z = Mathf.Log(Mathf.Max(fogColour.b, 0.0001f)); + // Magic numbers that make fog density easy to control using alpha channel + material.SetVector(ShaderIDs.s_Absorption, UpdateAbsorptionFromColor(fogColour)); + } + + + // + // Simulations + // + + internal List Simulations { get; } = new(); + + + // + // Instance + // + + bool _Initialized; + internal bool Active => enabled && this == Instance; + + + // + // Hash + // + + // A hash of the settings used to generate the water, used to regenerate when necessary + int _GeneratedSettingsHash; + + + // + // Runtime Environment + // + + /// + /// Is runtime environment without graphics card + /// + public static bool RunningWithoutGraphics + { + get + { + var noGPU = SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null; + var emulateNoGPU = Instance != null && Instance._Debug._ForceNoGraphics; + return noGPU || emulateNoGPU; + } + } + + // No GPU or emulate no GPU. + internal bool IsRunningWithoutGraphics => SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null || _Debug._ForceNoGraphics; + + /// + /// Is runtime environment non-interactive (not displaying to user). + /// + [System.Obsolete("We no longer care whether Unity is running in non-interactive mode.")] + public static bool RunningHeadless => false; + + + // + // Frame Timing + // + + /// + /// The frame count for Crest. + /// + public static int FrameCount + { + get + { +#if UNITY_EDITOR + if (!Application.isPlaying) + { + return s_EditorFrames; + } + else +#endif + { + return Time.frameCount; + } + } + } + + + // + // Level of Detail + // + + internal const string k_DrawLodData = "Crest.LodData"; + internal CommandBuffer SimulationBuffer { get; private set; } + + // Scale, Weight, MaximumWaveLength, Unused + internal BufferedData _CascadeData; + + internal int BufferSize { get; private set; } + + internal float MaximumWavelength(int slice) + { + return MaximumWavelength(CalcLodScale(slice)); + } + + internal float MaximumWavelength(float scale) + { + var maximumDiameter = 4f * scale; + // TODO: Do we need to pass in resolution? Could resolution mismatch with animated + // and dynamic waves be an issue? + var maximumTexelSize = maximumDiameter / LodResolution; + var texelsPerWave = 2f; + return 2f * maximumTexelSize * texelsPerWave; + } + + + // + // Scale + // + + /// + /// Current water scale (changes with viewer altitude). + /// + public float Scale { get; private set; } + internal float CalcLodScale(float slice) => Scale * Mathf.Pow(2f, slice); + internal float CalcGridSize(int slice) => CalcLodScale(slice) / LodResolution; + + /// + /// Could the water horizontal scale increase (for e.g. if the viewpoint gains altitude). Will be false if water already at maximum scale. + /// + internal bool ScaleCouldIncrease => _ScaleRange.y == Mathf.Infinity || Scale < _ScaleRange.y * 0.99f; + /// + /// Could the water horizontal scale decrease (for e.g. if the viewpoint drops in altitude). Will be false if water already at minimum scale. + /// + internal bool ScaleCouldDecrease => Scale > _ScaleRange.x * 1.01f; + + internal int ScaleDifferencePower2 { get; private set; } + + + // + // Displacement Reporting + // + + /// + /// User shape inputs can report in how far they might displace the shape horizontally and vertically. The max value is + /// saved here. Later the bounding boxes for the water tiles will be expanded to account for this potential displacement. + /// + internal void ReportMaximumDisplacement(float horizontal, float vertical, float verticalFromWaves) + { + MaximumHorizontalDisplacement += horizontal; + MaximumVerticalDisplacement += vertical; + _MaximumVerticalDisplacementFromWaves += verticalFromWaves; + } + + float _MaximumVerticalDisplacementFromWaves = 0f; + /// + /// The maximum horizontal distance that the shape scripts are displacing the shape. + /// + internal float MaximumHorizontalDisplacement { get; private set; } + /// + /// The maximum height that the shape scripts are displacing the shape. + /// + internal float MaximumVerticalDisplacement { get; private set; } + + + // + // Query Providers + // + + /// + /// Provides water shape to CPU. + /// + public ICollisionProvider CollisionProvider => AnimatedWavesLod?.Provider; + + /// + /// Provides flow to the CPU. + /// + public IFlowProvider FlowProvider => FlowLod?.Provider; + + /// + /// Provides water depth and distance to water edge to the CPU. + /// + public IDepthProvider DepthProvider => DepthLod?.Provider; + + + // + // Component + // + + // Drive state from OnEnable and OnDisable? OnEnable on RegisterLodDataInput seems to get called on script reload + private protected override void Initialize() + { + base.Initialize(); + + _SetUpFor = RenderPipelineHelper.RenderPipeline; + + _IsFirstFrameSinceEnabled = true; + _ViewCameraCached = Viewer; + + if (_Initialized) + { + Enable(); + return; + } + + Utility.RTHandles.Initialize(); + + _Mask = MaskRenderer.Instantiate(this); + + Meniscus.Initialize(this); + + Surface._Water = this; + _Reflections._Water = this; + _Reflections._UnderWater = _Underwater; + _Underwater._Water = this; +#if d_CrestPortals + _Underwater._Portals = _Portals; + _Portals._Water = this; + _Portals._UnderWater = _Underwater; +#endif + + _DepthLod._Water = this; + _LevelLod._Water = this; + _FlowLod._Water = this; + _DynamicWavesLod._Water = this; + _AnimatedWavesLod._Water = this; + _FoamLod._Water = this; + _ClipLod._Water = this; + _AbsorptionLod._Water = this; + _ScatteringLod._Water = this; + _AlbedoLod._Water = this; + _ShadowLod._Water = this; + + // Add simulations to a list for common operations. Order is important. + Simulations.Clear(); + Simulations.Add(_DepthLod); + Simulations.Add(_LevelLod); + Simulations.Add(_FlowLod); + Simulations.Add(_DynamicWavesLod); + Simulations.Add(_AnimatedWavesLod); + Simulations.Add(_FoamLod); + Simulations.Add(_AbsorptionLod); + Simulations.Add(_ScatteringLod); + Simulations.Add(_ClipLod); + Simulations.Add(_AlbedoLod); + Simulations.Add(_ShadowLod); + + // Setup a default time provider, and add the override one (from the inspector) + TimeProviders.Clear(); + + // Put a base TP that should always be available as a fallback + TimeProviders.Push(new DefaultTimeProvider()); + + // Add the TP from the inspector + if (_TimeProvider != null) + { + TimeProviders.Push(_TimeProvider); + } + + if (!VerifyRequirements()) + { + enabled = false; + return; + } + + SimulationBuffer ??= new() + { + name = k_DrawLodData, + }; + + Container = new() + { + name = "Container", + hideFlags = _Debug._ShowHiddenObjects ? HideFlags.DontSave : HideFlags.HideAndDontSave + }; + Container.transform.SetParent(transform, worldPositionStays: false); + this.Manage(Container); + + Scale = Mathf.Clamp(Scale, _ScaleRange.x, _ScaleRange.y); + + foreach (var simulation in Simulations) + { + // Bypasses Enabled and has an internal check. + if (!simulation._Enabled) continue; + simulation.Initialize(); + } + + // TODO: Have a BufferCount which will be the run-time buffer size or prune data. + // NOTE: Hardcode minimum (2) to avoid breaking server builds and LodData* toggles. + // Gather the buffer size for shared data. + BufferSize = 2; + foreach (var simulation in Simulations) + { + if (!simulation.Enabled) continue; + BufferSize = Mathf.Max(BufferSize, simulation.BufferCount); + } + + // The extra LOD accounts for reading off the cascade (eg CurrentIndex + LodChange + 1). + _CascadeData = new(BufferSize, () => new Vector4[Lod.k_MaximumSlices + 1]); + + _ProjectionMatrix = new Matrix4x4[LodLevels]; + + if (Application.isPlaying && _Debug._AttachDebugGUI && !TryGetComponent(out _)) + { + gameObject.AddComponent().hideFlags = HideFlags.DontSave; + } + + _GeneratedSettingsHash = CalculateSettingsHash(); + + // Prevent MVs from popping on first frame. + if (!_Debug._DisableFollowViewpoint && _ViewCameraCached != null) + { + LateUpdatePosition(); + LateUpdateScale(); + } + + WritePerFrameMaterialParams(); + + if (Surface.Enabled) + { + Surface.Initialize(); + } + + foreach (var body in WaterBody.WaterBodies) + { + if (body._Material != null) + { + Surface.UpdateMaterial(body._Material, ref body._MotionVectorMaterial); + } + } + + Enable(); + _Initialized = true; + } + + void OnDisable() + { + Disable(); + + // Always clean up in OnDisable during edit mode as OnDestroy is not always called. + if (_Debug._DestroyResourcesInOnDisable || !Application.isPlaying) + { + Destroy(); + } + } + + void OnDestroy() + { + // Only clean up in OnDestroy when not in edit mode. + if (_Debug._DestroyResourcesInOnDisable || !Application.isPlaying) + { + return; + } + + Destroy(); + } + + private protected override void LateUpdate() + { +#if CREST_DEBUG +#if UNITY_EDITOR + if (_SkipForTesting) + { + return; + } +#endif +#endif + +#if UNITY_EDITOR + // Don't run immediately if in edit mode - need to count editor frames so this is run through EditorUpdate() + if (Application.isPlaying) +#endif + { + RunUpdate(); + } + } + + + // + // Methods + // + + private protected override void Enable() + { + base.Enable(); + +#if UNITY_EDITOR + EditorTime = Time.time; + EditorDeltaTime = 0; + + EditorApplication.update -= EditorUpdate; + EditorApplication.update += EditorUpdate; +#endif + + // Needs to be first or will get assertions etc. Unity bug likely. + RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged; + RenderPipelineManager.activeRenderPipelineTypeChanged += OnActiveRenderPipelineTypeChanged; + + // Needs to run even without graphics to initialize provider. + foreach (var simulation in Simulations) + { + simulation.SetGlobals(enable: true); + if (!simulation.Enabled) continue; + simulation.Enable(); + } + + if (IsRunningWithoutGraphics) + { + // We need nothing from here on. + return; + } + +#if d_WaveHarmonic_Crest_ShiftingOrigin + ShiftingOrigin.OnShift -= OnOriginShift; + ShiftingOrigin.OnShift += OnOriginShift; +#endif + + RenderPipelineManager.beginCameraRendering -= OnBeginCameraRendering; + RenderPipelineManager.beginCameraRendering += OnBeginCameraRendering; + RenderPipelineManager.endCameraRendering -= OnEndCameraRendering; + RenderPipelineManager.endCameraRendering += OnEndCameraRendering; + + // This event should not when not using the built-in renderer, but in some cases it can in the editor like + // when using scene filtering. + if (RenderPipelineHelper.IsLegacy) + { + Camera.onPreCull -= OnBeginCameraRendering; + Camera.onPreCull += OnBeginCameraRendering; + Camera.onPostRender -= OnEndCameraRendering; + Camera.onPostRender += OnEndCameraRendering; + } + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + // Always enable as it sets requirements. + SurfaceRenderer.WaterSurfaceRenderPass.Enable(this); + } +#endif + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + if (RenderBeforeTransparency) + { + SurfaceRenderer.WaterSurfaceCustomPass.Enable(this); + } + + CrestInternalCopyToTextureCustomPass.Enable(this); + } + +#if UNITY_EDITOR + if (RenderPipelineHelper.IsHighDefinition) + { + RenderPipelineManager.beginContextRendering -= OnBeginContextRendering; + RenderPipelineManager.beginContextRendering += OnBeginContextRendering; + } +#endif +#endif + + Container.SetActive(true); + + _Mask.Enable(); + + if (_Underwater._Enabled) + { + _Underwater.OnEnable(); + } + + if (Meniscus.Enabled) + { + Meniscus.Enable(); + } + +#if d_UnityURP + if (RenderPipelineHelper.IsUniversal) + { + if (WriteToColorTexture || WriteToDepthTexture) + { + CopyTargetsRenderPass.Enable(this); + } + } +#endif + +#if d_CrestPortals + if (_Portals._Enabled) + { + _Portals.OnEnable(); + } +#endif + + if (_Reflections._Enabled) + { + _Reflections.OnEnable(); + } + } + + // Because we cannot pass null when using built-in render pipeline. + // Being a struct there should not be any side effects. + internal ScriptableRenderContext _Context = new(); + + void OnBeginCameraRendering(Camera camera) + { + if (_SetUpFor != RenderPipelineHelper.RenderPipeline) + { + return; + } + + Utility.RTHandles.OnBeginCameraRendering(camera); + + OnBeginCameraRendering(_Context, camera); + } + + // OnBeginCameraRendering or OnPreCull + void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + // Guard against being called before the RP change events are raised. + if (_SetUpFor != RenderPipelineHelper.RenderPipeline) + { + return; + } + +#if UNITY_EDITOR + UpdateLastActiveSceneCamera(camera); +#endif + + if (!ShouldRender(camera)) + { + return; + } + + var noSurface = !Surface.Enabled || !Helpers.MaskIncludesLayer(camera.cullingMask, Surface.Layer); + var noVolume = !Underwater.Enabled || !Helpers.MaskIncludesLayer(camera.cullingMask, Underwater.Layer); + + // Nothing to render to this camera. + if (noSurface && noVolume) + { + return; + } + + // Must render first so that we do not overwrite work below for game camera. + // Reflections only make sense with an active surface. + if (_Reflections._Enabled && Surface.Enabled) + { + _Reflections.OnBeginCameraRendering(context, camera); + } + + if (_Mask.Enabled) + { + _Mask.OnBeginCameraRendering(camera); + } + + // Water lighting etc. +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + UpdateHighDefinitionLighting(camera); + } + else +#endif + + if (RenderPipelineHelper.IsLegacy) + { + OnBeginCameraRenderingLegacy(camera); + } + + // Always execute before surface, as order is only important when rendering volume + // before surface. + if (Underwater._Enabled) + { + Underwater.OnBeginCameraRendering(context, camera); + } + +#if d_CrestPortals + // Call between volume and surface. Sets water line uniforms. + if (Portals.Enabled) + { + Portals.OnBeginCameraRendering(camera); + } +#endif + + if (Surface.Enabled) + { + Surface.OnBeginCameraRendering(context, camera); + } + +#if d_UnityURP + // Always execute after surface. + if (RenderPipelineHelper.IsUniversal) + { + CopyTargetsRenderPass.Instance.OnBeginCameraRendering(context, camera); + } + else +#endif + + if (RenderPipelineHelper.IsLegacy) + { + OnLegacyCopyPass(camera); + } + + // Execute after copy pass in case refraction. + if (Meniscus.Enabled) + { + Meniscus.Renderer.OnBeginCameraRendering(camera); + } + + if (_ShadowLod.Enabled) + { + _ShadowLod.OnBeginCameraRendering(context, camera); + } + } + + void OnEndCameraRendering(Camera camera) + { + OnEndCameraRendering(_Context, camera); + } + + void OnEndCameraRendering(ScriptableRenderContext context, Camera camera) + { + _DonePerCameraHeight = false; + +#if d_UnityHDRP + _DoneHighDefinitionLighting = false; +#endif + + if (RenderPipelineHelper.IsLegacy) + { + OnEndCameraRenderingLegacy(camera); + } + + if (_Mask.Enabled) + { + _Mask.OnEndCameraRendering(camera); + } + + if (Meniscus.Enabled) + { + Meniscus.Renderer.OnEndCameraRendering(camera); + } + + if (Underwater._Enabled) + { + Underwater.OnEndCameraRendering(camera); + } + + if (Surface.Enabled) + { + Surface.OnEndCameraRendering(camera); + } + + if (_Reflections._Enabled) + { + _Reflections.OnEndCameraRendering(camera); + } + + if (_ShadowLod.Enabled) + { + _ShadowLod.OnEndCameraRendering(camera); + } + +#if d_CrestPortals + if (_Portals.Enabled) + { + _Portals.OnEndCameraRendering(camera); + } +#endif + } + + internal void UpdatePerCameraHeight(Camera camera) + { + if (_DonePerCameraHeight) + { + return; + } + + // This will be 1-frame behind. + var viewpoint = camera.transform.position; + _SampleHeightHelperPerCamera.SampleHeight(System.HashCode.Combine(GetHashCode(), camera.GetHashCode()), viewpoint, out var height, allowMultipleCallsPerFrame: true); + _ViewerHeightAboveWaterPerCamera = viewpoint.y - height; + + _DonePerCameraHeight = true; + } + + void OnActiveRenderPipelineTypeChanged() + { + _Mask?.Destroy(); + _Mask = MaskRenderer.Instantiate(this); + + Meniscus.OnActiveRenderPipelineTypeChanged(); + + if (isActiveAndEnabled) + { + // Must destroy as there is still some state left like buffer count. + Disable(); + Destroy(); + Initialize(); + } + } + + internal void Rebuild() + { + Disable(); + Destroy(); + OnEnable(); + } + + bool VerifyRequirements() + { + if (!RunningWithoutGraphics) + { + if (Application.platform == RuntimePlatform.WebGLPlayer) + { + Debug.LogError("Crest: Crest does not support WebGL backends.", this); + return false; + } +#if UNITY_EDITOR + if (SystemInfo.graphicsDeviceType is GraphicsDeviceType.OpenGLES3 or GraphicsDeviceType.OpenGLCore) + { + Debug.LogError("Crest: Crest does not support OpenGL backends.", this); + return false; + } +#endif + if (SystemInfo.graphicsShaderLevel < 45) + { + Debug.LogError("Crest: Crest requires graphics devices that support shader level 4.5 or above.", this); + return false; + } + if (!SystemInfo.supportsComputeShaders) + { + Debug.LogError("Crest: Crest requires graphics devices that support compute shaders.", this); + return false; + } + if (!SystemInfo.supports2DArrayTextures) + { + Debug.LogError("Crest: Crest requires graphics devices that support 2D array textures.", this); + return false; + } + } + + return true; + } + + int CalculateSettingsHash() + { + var settingsHash = Hash.CreateHash(); + + // Add all the settings that require rebuilding.. + Hash.AddInt(_Resolution, ref settingsHash); + Hash.AddInt(_Slices, ref settingsHash); + Hash.AddBool(WriteMotionVectors, ref settingsHash); + Hash.AddBool(_Debug._ForceNoGraphics, ref settingsHash); + Hash.AddBool(_Debug._ShowHiddenObjects, ref settingsHash); + + return settingsHash; + } + + void RunUpdate() + { + s_RunUpdateMarker.Begin(this); + + // Rebuild if needed. Needs to run in builds (for MVs at the very least). + if (CalculateSettingsHash() != _GeneratedSettingsHash) + { + Rebuild(); + } + + if (RunningWithoutGraphics) + { + // All we need for servers. + BroadcastUpdate(); + Position = new(0f, transform.position.y, 0f); + base.LateUpdate(); + } + else + { + _ViewCameraCached = Viewer; + + // Reset displacement reporting values. + // This is written to in Update, and read in LateUpdate (chunk) and LateUpdateScale. + MaximumHorizontalDisplacement = MaximumVerticalDisplacement = _MaximumVerticalDisplacementFromWaves = 0f; + + BroadcastUpdate(); + + if (!_Debug._DisableFollowViewpoint && _ViewCameraCached != null) + { + LateUpdatePosition(); + LateUpdateViewerHeight(); + LateUpdateScale(); + } + else + { + Position = new(0f, transform.position.y, 0f); + } + + // Set global shader params + Shader.SetGlobalFloat(ShaderIDs.s_Time, CurrentTime); + Shader.SetGlobalFloat(ShaderIDs.s_LodCount, LodLevels); + + // Needs updated transform values like scale. + WritePerFrameMaterialParams(); + + // Construct the command buffer and attach it to the camera so that it will be executed in the render. + { + SimulationBuffer.Clear(); + + foreach (var simulation in Simulations) + { + if (!simulation.Enabled) continue; + simulation.BuildCommandBuffer(this, SimulationBuffer); + } + + // This will execute at the beginning of the frame before the graphics queue. + Graphics.ExecuteCommandBuffer(SimulationBuffer); + + foreach (var simulation in Simulations) + { + if (!simulation.Enabled) continue; + simulation.AfterExecute(); + } + } + + base.LateUpdate(); + + // Call after LateUpdate so chunk bounds are updated. + if (Surface.Enabled) + { + Surface.LateUpdate(); + } + + if (_Reflections._Enabled && !_Reflections.SupportsRecursiveRendering) + { + _Reflections.LateUpdate(_Context); + } + } + + // Run queries at end of update. For CollProviderBakedFFT calling this kicks off + // collision processing job, and the next call to Query() will force a complete, and + // we don't want that to happen until they've had a chance to run, so schedule them + // late. + if (AnimatedWavesLod.CollisionSource == CollisionSource.CPU) + { + AnimatedWavesLod.Provider?.UpdateQueries(this); + } + + _IsFirstFrameSinceEnabled = false; + + s_RunUpdateMarker.End(); + } + + void WritePerFrameMaterialParams() + { + _CascadeData.Flip(); + + var current = _CascadeData.Current; + + // Update rendering parameters. + { + var levels = LodLevels; + + for (var slice = 0; slice < levels; slice++) + { + var scale = CalcLodScale(slice); + current[slice] = new Vector4(scale, 1f, MaximumWavelength(scale), 0f); + + _ProjectionMatrix[slice] = Matrix4x4.Ortho(-2f * scale, 2f * scale, -2f * scale, 2f * scale, 1f, k_RenderAboveSeaLevel + k_RenderBelowSeaLevel); + if (slice == 0) Shader.SetGlobalFloat(ShaderIDs.s_Scale, scale); + } + + // Duplicate last element so that things can safely read off the end of the cascades + current[levels] = current[levels - 1].XNZW(0f); + } + + Shader.SetGlobalVectorArray(ShaderIDs.s_CascadeData, current); + Shader.SetGlobalVectorArray(ShaderIDs.s_CascadeDataSource, _CascadeData.Previous(1)); + } + + void LateUpdatePosition() + { + var position = Viewpoint.position; + + // This will cause artifacts in motion vectors debug view, but are likely negligible. + if (_CenterOfDetailDisplacementCorrection && _CenterOfDetailDisplacementCorrectionHelper.SampleDisplacement(position, out var displacement)) + { + position = new(position.x - displacement.x, position.y, position.z - displacement.z); + } + + // maintain y coordinate - sea level + position.y = transform.position.y; + + // Don't land very close to regular positions where things are likely to snap to, because different tiles might + // land on either side of a snap boundary due to numerical error and snap to the wrong positions. Nudge away from + // common by using increments of 1/60 which have lots of factors. + // :WaterGridPrecisionErrors + if (Mathf.Abs(position.x * 60f - Mathf.Round(position.x * 60f)) < 0.001f) + { + position.x += 0.002f; + } + if (Mathf.Abs(position.z * 60f - Mathf.Round(position.z * 60f)) < 0.001f) + { + position.z += 0.002f; + } + + Shader.SetGlobalVector(ShaderIDs.s_CenterDelta, (position - Position).XZ()); + + Position = position; + Shader.SetGlobalVector(ShaderIDs.s_Center, Position); + } + + void LateUpdateScale() + { + var viewerHeight = _ViewpointHeightAboveWaterSmooth; + + // Reach maximum detail at slightly below sea level. this should combat cases where visual range can be lost + // when water height is low and camera is suspended in air. i tried a scheme where it was based on difference + // to water height but this does help with the problem of horizontal range getting limited at bad times. + viewerHeight += _MaximumVerticalDisplacementFromWaves * _DropDetailHeightBasedOnWaves; + + var camDistance = Mathf.Abs(viewerHeight); + + // offset level of detail to keep max detail in a band near the surface + camDistance = Mathf.Max(camDistance - 4f, 0f); + + // scale water mesh based on camera distance to sea level, to keep uniform detail. + var level = camDistance; + level = Mathf.Max(level, _ScaleRange.x); + if (_ScaleRange.y < Mathf.Infinity) level = Mathf.Min(level, 1.99f * _ScaleRange.y); + + var l2 = Mathf.Log(level) / Mathf.Log(2f); + var l2f = Mathf.Floor(l2); + + ViewerAltitudeLevelAlpha = l2 - l2f; + + var newScale = Mathf.Pow(2f, l2f); + + if (Scale > 0f) + { + var ratio = newScale / Scale; + var ratioL2 = Mathf.Log(ratio) / Mathf.Log(2f); + ScaleDifferencePower2 = Mathf.RoundToInt(ratioL2); + Shader.SetGlobalFloat(ShaderIDs.s_LodChange, ScaleDifferencePower2); + Shader.SetGlobalFloat(ShaderIDs.s_ScaleChange, ratio); + +#if UNITY_EDITOR +#if CREST_DEBUG + if (ratio != 1f) + { + EditorApplication.isPaused = EditorApplication.isPaused || _Debug._PauseOnScaleChange; + if (_Debug._LogScaleChange) Debug.Log($"Scale Change: {newScale} / {Scale} = {ratio}. LOD Change: {ScaleDifferencePower2}"); + } +#endif +#endif + } + + Scale = newScale; + + // LOD 0 is blended in/out when scale changes, to eliminate pops. Here we set it as + // a global, whereas in WaterChunkRenderer it is applied to LOD0 tiles only through + // instance data. This global can be used in compute, where we only apply this + // factor for slice 0. + Shader.SetGlobalFloat(ShaderIDs.s_MeshScaleLerp, ScaleCouldIncrease ? ViewerAltitudeLevelAlpha : 0f); + } + + void LateUpdateViewerHeight() + { + var viewpoint = Viewpoint; + + _SampleHeightHelper.SampleHeight(viewpoint.position, out var waterHeight); + ViewerHeightAboveWater = ViewpointHeightAboveWater = viewpoint.position.y - waterHeight; + + var viewerHeightAboveWaterOrTerrain = ViewpointHeightAboveWater; + + if (viewpoint != _ViewCameraCached.transform) + { + var viewer = _ViewCameraCached.transform; + // Reuse sampler. Combine hash codes to avoid pontential conflict. + _SampleHeightHelper.SampleHeight(System.HashCode.Combine(GetHashCode(), viewer.GetHashCode()), viewpoint.position, out waterHeight, allowMultipleCallsPerFrame: true); + ViewerHeightAboveWater = viewer.position.y - waterHeight; + } + +#if d_Unity_Terrain + // Also use terrain height for scale. Viewpoint is absolute if set. + if (_SampleTerrainHeightForScale && LevelLod.Enabled && _Viewpoint == null) + { + var viewerPosition = viewpoint.position; + var viewerHeight = viewerPosition.y; + + var viewerHeightAboveTerrain = Mathf.Infinity; + var terrain = Helpers.GetTerrainAtPosition(viewerPosition.XZ()); + if (terrain != null) + { + var terrainHeight = terrain.GetPosition().y + terrain.SampleHeight(viewerPosition); + var heightAbove = viewerHeight - terrainHeight; + + // Ignore if viewer is under terrain. + if (heightAbove >= 0f) + { + viewerHeightAboveTerrain = heightAbove; + } + } + + if (viewerHeightAboveTerrain < Mathf.Abs(viewerHeightAboveWaterOrTerrain)) + { + viewerHeightAboveWaterOrTerrain = viewerHeightAboveTerrain; + } + } +#endif // d_Unity_Terrain + + // Calculate teleport distance and create window for height queries to return a height change. + { + if (_TeleportTimerForHeightQueries > 0f) + { + _TeleportTimerForHeightQueries -= Time.deltaTime; + } + + var hasTeleported = _IsFirstFrameSinceEnabled; + if (!_IsFirstFrameSinceEnabled) + { + // Find the distance. Adding the FO offset will exclude FO shifts so we can determine a normal teleport. + // FO shifts are visually the same position and it is incorrect to treat it as a normal teleport. + var teleportDistanceSqr = (_OldViewpointPosition - viewpoint.position - TeleportOriginThisFrame).sqrMagnitude; + // Threshold as sqrMagnitude. + var thresholdSqr = _TeleportThreshold * _TeleportThreshold; + hasTeleported = teleportDistanceSqr > thresholdSqr; + } + + if (hasTeleported) + { + // Height queries can take a few frames so a one second window should be plenty. + _TeleportTimerForHeightQueries = 1f; + } + + _HasTeleportedThisFrame = hasTeleported; + + _OldViewpointPosition = viewpoint.position; + } + + // Smoothly varying version of viewer height to combat sudden changes in water level that are possible + // when there are local bodies of water + _ViewpointHeightAboveWaterSmooth = Mathf.Lerp + ( + _ViewpointHeightAboveWaterSmooth, + viewerHeightAboveWaterOrTerrain, + _TeleportTimerForHeightQueries > 0f || !(_ForceScaleChangeSmoothing || (LevelLod.Enabled && !_SampleTerrainHeightForScale)) ? 1f : 0.05f + ); + +#if CREST_DEBUG + if (_Debug._IgnoreWavesForScaleChange) + { + _ViewpointHeightAboveWaterSmooth = Viewpoint.transform.position.y - SeaLevel; + } +#endif + + _SampleDepthHelper.SampleDistanceToWaterEdge(_ViewCameraCached.transform.position, out var distance); + ViewerDistanceToShoreline = distance; + } + + void Destroy() + { + foreach (var simulation in Simulations) + { + if (!simulation.Enabled) continue; + simulation.Destroy(); + } + Simulations.Clear(); + + _Mask?.Destroy(); + + Meniscus.Destroy(); + + // Clean up modules. +#if d_CrestPortals + _Portals.OnDestroy(); +#endif + _Underwater.OnDestroy(); + _Reflections.OnDestroy(); + Surface.OnDestroy(); + + if (Container) + { + Helpers.Destroy(Container); + Container = null; + } + + _Initialized = false; + } + + private protected override void Disable() + { + foreach (var simulation in Simulations) + { + simulation.SetGlobals(enable: false); + if (!simulation.Enabled) continue; + simulation.Disable(); + } + + if (RenderPipelineHelper.IsLegacy && Viewer != null) + { + // Need to call to prevent crash. + OnEndCameraRenderingLegacy(Viewer); + } + +#if UNITY_EDITOR + EditorApplication.update -= EditorUpdate; +#endif + + Camera.onPreCull -= OnBeginCameraRendering; + Camera.onPostRender -= OnEndCameraRendering; + +#if d_UnityHDRP + SurfaceRenderer.WaterSurfaceCustomPass.Disable(); + CrestInternalCopyToTextureCustomPass.Disable(); +#if UNITY_EDITOR + RenderPipelineManager.beginContextRendering -= OnBeginContextRendering; +#endif +#endif + +#if d_WaveHarmonic_Crest_ShiftingOrigin + ShiftingOrigin.OnShift -= OnOriginShift; +#endif + + RenderPipelineManager.beginCameraRendering -= OnBeginCameraRendering; + RenderPipelineManager.endCameraRendering -= OnEndCameraRendering; + RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged; + + _Mask?.Disable(); + +#if d_CrestPortals + if (_Portals._Enabled) _Portals.OnDisable(); +#endif + if (_Underwater._Enabled) _Underwater.OnDisable(); + if (_Reflections._Enabled) _Reflections.OnDisable(); + + if (Meniscus.Enabled) + { + Meniscus.Disable(); + } + + if (Container != null) + { + Container.SetActive(false); + } + + base.Disable(); + } + +#if d_WaveHarmonic_Crest_ShiftingOrigin + /// + /// Notify water of origin shift + /// + void OnOriginShift(Vector3 newOrigin) + { + foreach (var simulation in Simulations) + { + if (!simulation.Enabled) continue; + simulation.SetOrigin(newOrigin); + } + } +#endif + + /// + /// Clears persistent LOD data. Some simulations have persistent data which can linger for a little while after + /// being disabled. This will manually clear that data. + /// + void ClearLodData() + { + foreach (var simulation in Simulations) + { + if (!simulation.Enabled) continue; + simulation.ClearLodData(); + } + } + } + +#if CREST_DEBUG +#if UNITY_EDITOR + // Tests. + partial class WaterRenderer + { + internal bool _SkipForTesting; + + private protected override void FixedUpdate() + { + if (_SkipForTesting) + { + return; + } + + base.FixedUpdate(); + } + + internal void TestFixedUpdate() + { + _SkipForTesting = false; + FixedUpdate(); + _SkipForTesting = true; + } + + internal void TestLateUpdate() + { + _SkipForTesting = false; + LateUpdate(); + _SkipForTesting = true; + } + } +#endif +#endif +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.cs.meta new file mode 100644 index 0000000..e913a64 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterRenderer.cs.meta @@ -0,0 +1,19 @@ +fileFormatVersion: 2 +guid: e64c239f69eea46778ded6dcc3427a34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _Camera: {instanceID: 0} + - _TimeProvider: {instanceID: 0} + - _PrimaryLight: {instanceID: 0} + - _Material: {fileID: 2100000, guid: 8ab064b6606504a55b489af2787350c2, type: 2} + - _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + - _Viewpoint: {instanceID: 0} + - _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + executionOrder: 200 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterResources.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterResources.cs new file mode 100644 index 0000000..d033c85 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterResources.cs @@ -0,0 +1,208 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ +#if CREST_DEBUG + [CreateAssetMenu(menuName = "Crest/Resources")] +#endif + + [ExecuteAlways, Utility.FilePath("Packages/com.waveharmonic.crest/Runtime/Settings/Resources.asset")] + [@HelpURL("Manual/Scripting.html#resources")] + sealed class WaterResources : Utility.ScriptableSingleton + { + [Serializable] + public sealed class ShaderResources + { + // Caches camera depth as water depth. + public Shader _CopyDepthIntoCache; + + public Shader _ColorSpline; + public Shader _FlowSpline; + public Shader _FoamSpline; + public Shader _WaveSpline; + + public Shader _DepthGeometry; + public Shader _LevelGeometry; + + public Shader _UpdateShadow; + + public Shader _UnderwaterEffect; + public Shader _UnderwaterMask; + public Shader _HorizonMask; + public Shader _Portals; + + public Shader _ClipConvexHull; + + public Shader _ShallowWaterSimulationVisualizer; + + public Shader _DebugTextureArray; + public Shader _Blit; + + public Shader _ForceShadows; + public Shader _CaptureShadowMatrices; + } + + [Serializable] + public sealed class ComputeResources + { + public ComputeShader _Mask; + public ComputeShader _UnderwaterArtifacts; + public ComputeShader _ShapeWavesTransfer; + + public ComputeShader _Query; + + public ComputeShader _Gerstner; + public ComputeShader _FFT; + public ComputeShader _FFTBake; + public ComputeShader _FFTSpectrum; + + public ComputeShader _ShapeCombine; + public ComputeShader _ShorelineColor; + public ComputeShader _UpdateDynamicWaves; + public ComputeShader _UpdateFoam; + public ComputeShader _UpdateShadow; + public ComputeShader _PackLevel; + + public ComputeShader _AbsorptionTexture; + public ComputeShader _ClipTexture; + public ComputeShader _FlowTexture; + public ComputeShader _FoamTexture; + public ComputeShader _LevelTexture; + public ComputeShader _DepthTexture; + public ComputeShader _ScatteringTexture; + + public ComputeShader _ClipPrimitive; + public ComputeShader _SphereWaterInteraction; + + public ComputeShader _RenderDepthProbe; + public ComputeShader _JumpFloodSDF; + + public ComputeShader _UpdateSWS; + + public ComputeShader _Whirlpool; + + public ComputeShader _Clear; + } + +#pragma warning disable IDE0032 // Use auto property + + [SerializeField] + ShaderResources _Shaders = new(); + public ShaderResources Shaders => _Shaders; + + [SerializeField] + ComputeResources _Compute = new(); + +#pragma warning restore IDE0032 // Use auto property + + public ComputeResources Compute => _Compute; + + public KeywordResources Keywords { get; } = new(); + + public sealed class KeywordResources + { + public LocalKeyword AnimatedWavesTransferWavesTexture { get; private set; } + public LocalKeyword AnimatedWavesTransferWavesTextureBlend { get; private set; } + public LocalKeyword ClipPrimitiveInverted { get; private set; } + public LocalKeyword ClipPrimitiveSphere { get; private set; } + public LocalKeyword ClipPrimitiveCube { get; private set; } + public LocalKeyword ClipPrimitiveRectangle { get; private set; } + public LocalKeyword DepthTextureSDF { get; private set; } + public LocalKeyword ShorelineColorSourceDistance { get; private set; } + public LocalKeyword ShorelineColorScattering { get; private set; } + public LocalKeyword LevelTextureCatmullRom { get; private set; } + public LocalKeyword DepthProbeBackFaceInclusion { get; private set; } + public LocalKeyword JumpFloodInverted { get; private set; } + public LocalKeyword JumpFloodStandalone { get; private set; } + + internal void Initialize(WaterResources resources) + { + var compute = resources.Compute; + + { + var keywords = compute._ShapeWavesTransfer.keywordSpace; + AnimatedWavesTransferWavesTexture = keywords.FindKeyword("d_Texture"); + AnimatedWavesTransferWavesTextureBlend = keywords.FindKeyword("d_TextureBlend"); + } + + { + var keywords = compute._ClipPrimitive.keywordSpace; + ClipPrimitiveInverted = keywords.FindKeyword("d_Inverted"); + ClipPrimitiveSphere = keywords.FindKeyword("d_Sphere"); + ClipPrimitiveCube = keywords.FindKeyword("d_Cube"); + ClipPrimitiveRectangle = keywords.FindKeyword("d_Rectangle"); + } + + { + var keywords = compute._DepthTexture.keywordSpace; + DepthTextureSDF = keywords.FindKeyword("d_CrestSDF"); + } + + { + var keywords = compute._LevelTexture.keywordSpace; + LevelTextureCatmullRom = keywords.FindKeyword("d_CatmullRom"); + } + + { + var keywords = compute._RenderDepthProbe.keywordSpace; + DepthProbeBackFaceInclusion = keywords.FindKeyword("d_Crest_BackFaceInclusion"); + } + + { + var keywords = compute._JumpFloodSDF.keywordSpace; + JumpFloodInverted = keywords.FindKeyword("d_Crest_Inverted"); + JumpFloodStandalone = keywords.FindKeyword("d_Crest_Standalone"); + } + + { + var keywords = compute._ShorelineColor.keywordSpace; + ShorelineColorSourceDistance = keywords.FindKeyword("d_Crest_ShorelineColorSource_ShorelineDistance"); + ShorelineColorScattering = keywords.FindKeyword("d_Crest_ShorelineScattering"); + } + } + } + + public event Action AfterEnabled; + + void OnEnable() + { +#if !CREST_DEBUG + hideFlags = HideFlags.NotEditable; +#endif + Keywords.Initialize(this); + + AfterEnabled?.Invoke(); + } + +#if UNITY_EDITOR + // AssetPostprocessor cannot be nested in a generic type so this cannot be moved to abstraction. + sealed class AssetPostprocessor : UnityEditor.AssetPostprocessor + { + static void OnPostprocessAllAssets(string[] imported, string[] deleted, string[] movedTo, string[] movedFrom, bool domainReload) + { + // Unused. + _ = imported; _ = deleted; _ = movedTo; _ = movedFrom; + + if (domainReload) + { + LoadFromAsset(); + } + + foreach (var path in imported) + { + if (path.StartsWith("Packages/com.waveharmonic.crest") && path.EndsWith(".compute")) + { + // Unity loses these if the compute shader is recompiled. + Instance.Keywords.Initialize(Instance); + } + } + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterResources.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterResources.cs.meta new file mode 100644 index 0000000..db8ff83 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaterResources.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba9588a2660f342409c82a6ff9e95a88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft.meta new file mode 100644 index 0000000..549d756 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2c0bbe6ad1be44d16b7936354667cd99 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Assembly.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Assembly.cs new file mode 100644 index 0000000..78266a0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Assembly.cs @@ -0,0 +1,9 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Watercraft.Editor")] + +// Define empty namespaces for when assemblies are not present. +namespace UnityEngine.InputSystem { } diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Assembly.cs.meta new file mode 100644 index 0000000..8f5cca1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1bffa516b4213411d9773d8f0213b3fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controller.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controller.cs new file mode 100644 index 0000000..1d79d38 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controller.cs @@ -0,0 +1,108 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Watercraft +{ + /// + /// A simple watercraft controlller. + /// + [@HelpURL("Manual/FloatingObjects.html#movement-controller")] + [AddComponentMenu(Constants.k_MenuPrefixPhysics + "Watercraft Controller")] + public sealed partial class Controller : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Tooltip("The accompanied buoyancy script.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + FloatingObject _FloatingObject; + + [Tooltip("The accompanied control script to take input from.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + Control _Control; + + [Tooltip("Vertical offset from the center of mass for where move force should be applied.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _ForceHeightOffset; + + [Tooltip("How quickly the watercraft moves from thrust.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _ThrustPower = 10f; + + [Tooltip("How quickly the watercraft turns from steering.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + float _SteerPower = 1f; + + [Tooltip("Rolls the watercraft when turning.")] + [@Range(0, 1)] + [@GenerateAPI] + [SerializeField] + float _TurningHeel = 0.35f; + + [Tooltip("Applies a curve to buoyancy changes.")] + [@GenerateAPI] + [@DecoratedField, SerializeField] + AnimationCurve _BuoyancyCurveFactor = new(new Keyframe[] { new(0, 0, 0.01267637f, 0.01267637f), + new(0.6626424f, 0.1791001f, 0.8680198f, 0.8680198f), new(1, 1, 3.38758f, 3.38758f) }); + + float _BuoyancyFactor = 1f; + + private protected override void OnStart() + { + base.OnStart(); + + if (_Control == null) _Control = GetComponent(); + if (_FloatingObject == null) _FloatingObject = GetComponent(); + } + + private protected override System.Action OnFixedUpdateMethod => OnFixedUpdate; + void OnFixedUpdate(WaterRenderer water) + { + if (!_FloatingObject.InWater) return; + + UnityEngine.Profiling.Profiler.BeginSample("Crest.Watercraft.Controller.FixedUpdate"); + + var input = _Control.Input; + var rb = _FloatingObject.RigidBody; + + // Thrust + var forcePosition = rb.worldCenterOfMass + _ForceHeightOffset * Vector3.up; + rb.AddForceAtPosition(_ThrustPower * input.z * transform.forward, forcePosition, ForceMode.Acceleration); + + // Steer + var rotation = transform.up + _TurningHeel * transform.forward; + rb.AddTorque(_SteerPower * input.x * rotation, ForceMode.Acceleration); + + if (input.y > 0f) + { + if (_BuoyancyFactor < 1f) + { + _BuoyancyFactor += Time.deltaTime * 0.1f; + _BuoyancyFactor = Mathf.Clamp(_BuoyancyFactor, 0f, 1f); + _FloatingObject.BuoyancyForceStrength = _BuoyancyCurveFactor.Evaluate(_BuoyancyFactor); + } + } + else if (input.y < 0f) + { + if (_BuoyancyFactor > 0f) + { + _BuoyancyFactor -= Time.deltaTime * 0.1f; + _BuoyancyFactor = Mathf.Clamp(_BuoyancyFactor, 0f, 1f); + _FloatingObject.BuoyancyForceStrength = _BuoyancyCurveFactor.Evaluate(_BuoyancyFactor); + } + } + + UnityEngine.Profiling.Profiler.EndSample(); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controller.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controller.cs.meta new file mode 100644 index 0000000..0fc39da --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controller.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9310a3e8fdd024e06bb9d6970db822d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls.meta new file mode 100644 index 0000000..22090a8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 71af4d3eb2cd144ac8e2485d50a7a191 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/Control.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/Control.cs new file mode 100644 index 0000000..8494d67 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/Control.cs @@ -0,0 +1,19 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest.Watercraft +{ + /// + /// Controls provide input whether from the player or otherwise. Extend to + /// implement a control. See derived classes for examples. + /// + public abstract class Control : MonoBehaviour + { + /// + /// Provides input for controllers. XYZ is steer, float and drive respectively. + /// + public abstract Vector3 Input { get; } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/Control.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/Control.cs.meta new file mode 100644 index 0000000..4650b57 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/Control.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5fd02b3521bc4486ea93e5a060580a53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/FixedControl.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/FixedControl.cs new file mode 100644 index 0000000..d90ebee --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/FixedControl.cs @@ -0,0 +1,35 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest.Watercraft +{ + /// + /// Constantly moves/turns. + /// + [AddComponentMenu(Constants.k_MenuPrefixPhysics + "Watercraft Control (Constant)")] + public sealed partial class FixedControl : Control + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [@GenerateAPI] + [Tooltip("Constantly move."), SerializeField] + float _Move = 0; + + [@GenerateAPI] + [Tooltip("Constantly turn."), SerializeField] + float _Turn = 0; + +#pragma warning disable UNT0001 + // Here to force the checkbox to show. + void Start() { } +#pragma warning restore UNT0001 + + /// + public override Vector3 Input => isActiveAndEnabled ? new(_Turn, 0f, _Move) : Vector3.zero; + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/FixedControl.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/FixedControl.cs.meta new file mode 100644 index 0000000..6b79660 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Watercraft/Controls/FixedControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a0773b7cb9424ddb87749b40d94c1ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaveHarmonic.Crest.asmdef b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaveHarmonic.Crest.asmdef new file mode 100644 index 0000000..1ac2045 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaveHarmonic.Crest.asmdef @@ -0,0 +1,86 @@ +{ + "name": "WaveHarmonic.Crest", + "rootNamespace": "", + "references": [ + "GUID:75469ad4d38634e559750d17036d5f7c", + "GUID:df380645f10b7bc4b97d4f5eb6303d95", + "GUID:457756d89b35d2941b3e7b37b4ece6f1", + "GUID:15fc0a57446b3144c949da3e2b9737a9", + "GUID:27619889b8ba8c24980f49ee34dbb44a", + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:1ab2a6c2a51cd4b43867788dbaee1a55", + "GUID:2342e6f66b7fd461bb1346f13f99f4a7" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER" + ], + "versionDefines": [ + { + "name": "com.unity.modules.director", + "expression": "", + "define": "d_ModuleUnityDirector" + }, + { + "name": "com.unity.modules.terrain", + "expression": "", + "define": "d_Unity_Terrain" + }, + { + "name": "com.unity.modules.vr", + "expression": "", + "define": "d_UnityModuleVR" + }, + { + "name": "com.unity.inputsystem", + "expression": "", + "define": "d_UnityInputSystem" + }, + { + "name": "com.unity.render-pipelines.core", + "expression": "", + "define": "d_UnitySRP" + }, + { + "name": "com.unity.render-pipelines.high-definition", + "expression": "", + "define": "d_UnityHDRP" + }, + { + "name": "com.unity.render-pipelines.universal", + "expression": "", + "define": "d_UnityURP" + }, + { + "name": "com.waveharmonic.crest.paint", + "expression": "", + "define": "d_CrestPaint" + }, + { + "name": "com.waveharmonic.crest.cpu-queries", + "expression": "", + "define": "d_WaveHarmonic_Crest_CPUQueries" + }, + { + "name": "com.waveharmonic.crest.splines", + "expression": "", + "define": "d_CrestSpline" + }, + { + "name": "com.waveharmonic.crest.portals", + "expression": "", + "define": "d_CrestPortals" + }, + { + "name": "com.waveharmonic.crest.shifting-origin", + "expression": "", + "define": "d_WaveHarmonic_Crest_ShiftingOrigin" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/WaveHarmonic.Crest.asmdef.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaveHarmonic.Crest.asmdef.meta new file mode 100644 index 0000000..d12a2ad --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/WaveHarmonic.Crest.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7c347618730f5467f86a58f333ce21df +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves.meta new file mode 100644 index 0000000..63365e8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97c17ec5330f147f6bcad489f8e90a97 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/FFTCompute.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/FFTCompute.cs new file mode 100644 index 0000000..10ce196 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/FFTCompute.cs @@ -0,0 +1,428 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Inspired by https://github.com/speps/GX-EncinoWaves + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest +{ + /// + /// Runs FFT to generate water surface displacements + /// + sealed class FFTCompute + { + // Must match 'SIZE' param of first kernel in FFTCompute.compute + const int k_Kernel0Resolution = 8; + + // Must match CASCADE_COUNT in FFTCompute.compute + const int k_CascadeCount = 16; + + bool _Initialized = false; + + RenderTexture _SpectrumInitial; + + /// + /// Generated 'raw', uncombined, wave data. Input for putting into AnimWaves data before combine pass. + /// + public RenderTexture WaveBuffers { get; private set; } + + bool _SpectrumInitialized = false; + + ComputeShader _ShaderSpectrum; + ComputeShader _ShaderFFT; + + int _KernelSpectrumInitial; + int _KernelSpectrumUpdate; + + Parameters _Parameters; + + float _GenerationTime = -1f; + + static readonly bool s_SupportsRandomWriteRGFloat = + SystemInfo.SupportsRandomWriteOnRenderTextureFormat(RenderTextureFormat.RGFloat); + + public static class ShaderIDs + { + public static readonly int s_Size = Shader.PropertyToID("_Crest_Size"); + public static readonly int s_WindSpeed = Shader.PropertyToID("_Crest_WindSpeed"); + public static readonly int s_Turbulence = Shader.PropertyToID("_Crest_Turbulence"); + public static readonly int s_Alignment = Shader.PropertyToID("_Crest_Alignment"); + public static readonly int s_Gravity = Shader.PropertyToID("_Crest_Gravity"); + public static readonly int s_Period = Shader.PropertyToID("_Crest_Period"); + public static readonly int s_WindDir = Shader.PropertyToID("_Crest_WindDir"); + public static readonly int s_SpectrumControls = Shader.PropertyToID("_Crest_SpectrumControls"); + public static readonly int s_ResultInit = Shader.PropertyToID("_Crest_ResultInit"); + public static readonly int s_Time = Shader.PropertyToID("_Crest_Time"); + public static readonly int s_Chop = Shader.PropertyToID("_Crest_Chop"); + public static readonly int s_Init0 = Shader.PropertyToID("_Crest_Init0"); + public static readonly int s_ResultHeight = Shader.PropertyToID("_Crest_ResultHeight"); + public static readonly int s_ResultDisplaceX = Shader.PropertyToID("_Crest_ResultDisplaceX"); + public static readonly int s_ResultDisplaceZ = Shader.PropertyToID("_Crest_ResultDisplaceZ"); + public static readonly int s_InputH = Shader.PropertyToID("_Crest_InputH"); + public static readonly int s_InputX = Shader.PropertyToID("_Crest_InputX"); + public static readonly int s_InputZ = Shader.PropertyToID("_Crest_InputZ"); + public static readonly int s_InputButterfly = Shader.PropertyToID("_Crest_InputButterfly"); + public static readonly int s_Output1 = Shader.PropertyToID("_Crest_Output1"); + public static readonly int s_Output2 = Shader.PropertyToID("_Crest_Output2"); + public static readonly int s_Output3 = Shader.PropertyToID("_Crest_Output3"); + public static readonly int s_Output = Shader.PropertyToID("_Crest_Output"); + + public static readonly int s_TemporaryFFT1 = Shader.PropertyToID("_Crest_TemporaryFFT1"); + public static readonly int s_TemporaryFFT2 = Shader.PropertyToID("_Crest_TemporaryFFT2"); + public static readonly int s_TemporaryFFT3 = Shader.PropertyToID("_Crest_TemporaryFFT3"); + } + + internal readonly struct Parameters + { + public readonly WaveSpectrum _Spectrum; + public readonly int _Resolution; + public readonly float _LoopPeriod; + public readonly float _WindSpeed; + public readonly float _WindDirectionRadians; + public readonly float _WindTurbulence; + public readonly float _WindAlignment; + public readonly float _Gravity; + + public Parameters(WaveSpectrum spectrum, int resolution, float period, float speed, float direction, float turbulence, float alignment, float gravity) + { + _Spectrum = spectrum; + _Resolution = resolution; + _LoopPeriod = period; + _WindSpeed = speed; + _WindDirectionRadians = direction; + _WindTurbulence = turbulence; + _WindAlignment = alignment; + _Gravity = gravity; + } + + // Implement custom or incur allocations. + public override int GetHashCode() + { + return System.HashCode.Combine(_Spectrum, _LoopPeriod, _WindSpeed, _WindDirectionRadians, _WindTurbulence, _WindAlignment, _Gravity, _Resolution); + } + + public int GetHashCode(int resolution) + { + return System.HashCode.Combine(_Spectrum, _LoopPeriod, _WindSpeed, _WindDirectionRadians, _WindTurbulence, _WindAlignment, _Gravity, resolution); + } + } + + public FFTCompute(Parameters parameters) + { + Debug.Assert(Mathf.NextPowerOfTwo(parameters._Resolution) == parameters._Resolution, "Crest: FFTCompute resolution must be power of 2"); + _Parameters = parameters; + } + + public void Release() + { + if (_SpectrumInitial != null) + { + _SpectrumInitial.Release(); + } + + if (WaveBuffers != null) + { + WaveBuffers.Release(); + } + + Helpers.Destroy(_SpectrumInitial); + Helpers.Destroy(WaveBuffers); + + _SpectrumInitialized = false; + _Initialized = false; + } + + internal static void CleanUpAll() + { + foreach (var generator in s_Generators) + { + generator.Value.Release(); + } + + s_Generators?.Clear(); + + foreach (var texture in s_ButterflyTextures?.Values) + { + Helpers.Destroy(texture); + } + + s_ButterflyTextures?.Clear(); + } + + static readonly Dictionary s_Generators = new(); + static readonly Dictionary s_ButterflyTextures = new(); + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void InitStatics() + { + CleanUpAll(); + } + + /// + /// Computes water surface displacement, with wave components split across slices of the output texture array + /// + public static RenderTexture GenerateDisplacements(CommandBuffer buf, float time, Parameters parameters, bool updateSpectrum) + { + var conditionsHash = parameters.GetHashCode(); + // All static data arguments should be hashed here and passed to the generator constructor + if (!s_Generators.TryGetValue(conditionsHash, out var generator)) + { + // No generator for these params - create one + generator = new(parameters); + s_Generators.Add(conditionsHash, generator); + } + + // The remaining dynamic data arguments should be passed in to the generation here + return generator.GenerateDisplacementsInternal(buf, time, updateSpectrum); + } + + RenderTexture GenerateDisplacementsInternal(CommandBuffer buffer, float time, bool updateSpectrum) + { + // Check if already generated, and we're not being asked to re-update the spectrum + if (_GenerationTime == time && !updateSpectrum) + { + return WaveBuffers; + } + + var resolution = _Parameters._Resolution; + var period = _Parameters._LoopPeriod; + + // Initialize. + if (!_Initialized || _SpectrumInitial == null) + { + Release(); + + _ShaderSpectrum = WaterResources.Instance.Compute._FFTSpectrum; + _KernelSpectrumInitial = _ShaderSpectrum.FindKernel("SpectrumInitalize"); + _KernelSpectrumUpdate = _ShaderSpectrum.FindKernel("SpectrumUpdate"); + _ShaderFFT = WaterResources.Instance.Compute._FFT; + + var rtd = new RenderTextureDescriptor(0, 0); + rtd.width = rtd.height = resolution; + rtd.dimension = TextureDimension.Tex2DArray; + rtd.enableRandomWrite = true; + rtd.depthBufferBits = 0; + rtd.volumeDepth = k_CascadeCount; + rtd.colorFormat = RenderTextureFormat.ARGBFloat; + rtd.msaaSamples = 1; + + Helpers.SafeCreateRenderTexture(ref _SpectrumInitial, rtd); + _SpectrumInitial.name = "_Crest_FFTSpectrumInit"; + _SpectrumInitial.Create(); + + // Raw wave data buffer + WaveBuffers = new(resolution, resolution, 0, GraphicsFormat.R16G16B16A16_SFloat) + { + wrapMode = TextureWrapMode.Repeat, + antiAliasing = 1, + filterMode = FilterMode.Bilinear, + anisoLevel = 0, + useMipMap = false, + name = "_Crest_FFTCascades", + dimension = TextureDimension.Tex2DArray, + volumeDepth = k_CascadeCount, + enableRandomWrite = true, + }; + WaveBuffers.Create(); + + // Initialize bufferfly. Cached per resolution. + if (!s_ButterflyTextures.ContainsKey(resolution)) + { + // Computes the offsets used for the FFT calculation. + var size = Mathf.RoundToInt(Mathf.Log(resolution, 2)); + var colors = new Color[resolution * size]; + + int offset = 1, iterations = resolution >> 1; + for (var index = 0; index < size; index++) + { + var rowOffset = index * resolution; + { + int start = 0, end = 2 * offset; + for (var iteration = 0; iteration < iterations; iteration++) + { + var bigK = 0f; + for (var k = start; k < end; k += 2) + { + var phase = 2.0f * Mathf.PI * bigK * iterations / resolution; + var cos = Mathf.Cos(phase); + var sin = Mathf.Sin(phase); + colors[rowOffset + k / 2] = new(cos, -sin, 0, 1); + colors[rowOffset + k / 2 + offset] = new(-cos, sin, 0, 1); + + bigK += 1f; + } + start += 4 * offset; + end = start + 2 * offset; + } + } + iterations >>= 1; + offset <<= 1; + } + + var texture = new Texture2D(resolution, Mathf.RoundToInt(Mathf.Log(resolution, 2)), TextureFormat.RGBAFloat, false, true); + texture.SetPixels(colors); + texture.Apply(); + s_ButterflyTextures.Add(resolution, texture); + } + + _Initialized = true; + } + + // Initialize spectrum. + // Computes base spectrum values based on wind speed and turbulence and spectrum controls. + if (!_SpectrumInitialized || updateSpectrum) + { + var wrapper = new PropertyWrapperCompute(buffer, _ShaderSpectrum, _KernelSpectrumInitial); + wrapper.SetInteger(ShaderIDs.s_Size, resolution); + wrapper.SetFloat(ShaderIDs.s_WindSpeed, _Parameters._WindSpeed); + wrapper.SetFloat(ShaderIDs.s_Turbulence, _Parameters._WindTurbulence); + wrapper.SetFloat(ShaderIDs.s_Alignment, _Parameters._WindAlignment); + wrapper.SetFloat(ShaderIDs.s_Gravity, _Parameters._Gravity); + wrapper.SetFloat(ShaderIDs.s_Period, period < Mathf.Infinity ? period : -1); + wrapper.SetVector(ShaderIDs.s_WindDir, new(Mathf.Cos(_Parameters._WindDirectionRadians), Mathf.Sin(_Parameters._WindDirectionRadians))); + wrapper.SetTexture(ShaderIDs.s_SpectrumControls, _Parameters._Spectrum.ControlsTexture); + wrapper.SetTexture(ShaderIDs.s_ResultInit, _SpectrumInitial); + wrapper.Dispatch(resolution / 8, resolution / 8, k_CascadeCount); + + _SpectrumInitialized = true; + } + + // Update Spectrum. + // Computes a spectrum for the current time which can be FFT'd into the final surface. + { + var wrapper = new PropertyWrapperCompute(buffer, _ShaderSpectrum, _KernelSpectrumUpdate); + + var descriptor = _SpectrumInitial.descriptor; + + if (s_SupportsRandomWriteRGFloat) + { + descriptor.colorFormat = RenderTextureFormat.RGFloat; + } + + // No need to clear as overwritten. + buffer.GetTemporaryRT(ShaderIDs.s_TemporaryFFT1, descriptor); + buffer.GetTemporaryRT(ShaderIDs.s_TemporaryFFT2, descriptor); + buffer.GetTemporaryRT(ShaderIDs.s_TemporaryFFT3, descriptor); + + wrapper.SetInteger(ShaderIDs.s_Size, resolution); + wrapper.SetFloat(ShaderIDs.s_Time, time * _Parameters._Spectrum._GravityScale); + wrapper.SetFloat(ShaderIDs.s_Chop, _Parameters._Spectrum._Chop); + wrapper.SetFloat(ShaderIDs.s_Period, period < Mathf.Infinity ? period : -1); + wrapper.SetTexture(ShaderIDs.s_Init0, _SpectrumInitial); + wrapper.SetTexture(ShaderIDs.s_ResultHeight, ShaderIDs.s_TemporaryFFT1); + wrapper.SetTexture(ShaderIDs.s_ResultDisplaceX, ShaderIDs.s_TemporaryFFT2); + wrapper.SetTexture(ShaderIDs.s_ResultDisplaceZ, ShaderIDs.s_TemporaryFFT3); + wrapper.Dispatch(resolution / 8, resolution / 8, k_CascadeCount); + } + + // Dispatch FFT. + // FFT the spectrum into surface displacements. + { + var kernel = 2 * Mathf.RoundToInt(Mathf.Log(resolution / k_Kernel0Resolution, 2f)); + var wrapper = new PropertyWrapperCompute(buffer, _ShaderFFT, kernel); + + var butterfly = s_ButterflyTextures[resolution]; + + wrapper.SetTexture(ShaderIDs.s_InputButterfly, butterfly); + wrapper.SetTexture(ShaderIDs.s_Output1, ShaderIDs.s_TemporaryFFT1); + wrapper.SetTexture(ShaderIDs.s_Output2, ShaderIDs.s_TemporaryFFT2); + wrapper.SetTexture(ShaderIDs.s_Output3, ShaderIDs.s_TemporaryFFT3); + wrapper.Dispatch(1, resolution, k_CascadeCount); + + wrapper = new PropertyWrapperCompute(buffer, _ShaderFFT, kernel + 1); + wrapper.SetTexture(ShaderIDs.s_InputH, ShaderIDs.s_TemporaryFFT1); + wrapper.SetTexture(ShaderIDs.s_InputX, ShaderIDs.s_TemporaryFFT2); + wrapper.SetTexture(ShaderIDs.s_InputZ, ShaderIDs.s_TemporaryFFT3); + wrapper.SetTexture(ShaderIDs.s_InputButterfly, butterfly); + wrapper.SetTexture(ShaderIDs.s_Output, WaveBuffers); + wrapper.Dispatch(resolution, 1, k_CascadeCount); + + buffer.ReleaseTemporaryRT(ShaderIDs.s_TemporaryFFT1); + buffer.ReleaseTemporaryRT(ShaderIDs.s_TemporaryFFT2); + buffer.ReleaseTemporaryRT(ShaderIDs.s_TemporaryFFT3); + } + + _GenerationTime = time; + + return WaveBuffers; + } + + /// + /// Changing wave gen data can result in creating lots of new generators. This gives a way to notify + /// that a parameter has changed. If there is no existing generator for the new param values, but there + /// is one for the old param values, this old generator is repurposed. + /// + public static void OnGenerationDataUpdated(Parameters oldParameters, Parameters newParameters) + { + // If multiple wave components share one FFT, then one of them changes its settings, it will + // actually steal the generator from the rest. Then the first from the rest which request the + // old settings will trigger creation of a new generator, and the remaining ones will use this + // new generator. In the end one new generator is created, but it's created for the old settings. + // Generators are requested single threaded so there should not be a race condition. Odd pattern + // but I don't think any other way works without ugly checks to see if old generators are still + // used, or other complicated things. + + // Check if no generator exists for new values + var newHash = newParameters.GetHashCode(); + if (!s_Generators.TryGetValue(newHash, out var oldGenerator)) + { + // Try to adapt an existing generator rather than default to creating a new one + // Adapting requires the resolution to the same. + var oldHash = oldParameters.GetHashCode(newParameters._Resolution); + if (s_Generators.TryGetValue(oldHash, out var generator)) + { + // Hash will change for this generator, so remove the current one + s_Generators.Remove(oldHash); + + // Update params + generator._Parameters = newParameters; + + // Trigger generator to re-init the spectrum + generator._SpectrumInitialized = false; + + // Re-add with new hash + s_Generators.Add(newHash, generator); + } + } + else + { + // There is already a new generator which will be used. Remove the previous one - if it really is needed + // then it will be created later. + oldGenerator.Release(); + s_Generators.Remove(oldParameters.GetHashCode()); + } + } + + /// + /// Number of FFT generators + /// + public static int GeneratorCount => s_Generators != null ? s_Generators.Count : 0; + + public static FFTCompute GetInstance(Parameters parameters) + { + return s_Generators.GetValueOrDefault(parameters.GetHashCode(), null); + } + + public bool HasData() + { + return WaveBuffers != null && WaveBuffers.IsCreated(); + } + + internal void OnGUI() + { + if (WaveBuffers != null && WaveBuffers.IsCreated()) + { + DebugGUI.DrawTextureArray(WaveBuffers, 8, 0.5f, 20f); + } + + if (_Parameters._Spectrum != null) + { + _Parameters._Spectrum.OnGUI(); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/FFTCompute.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/FFTCompute.cs.meta new file mode 100644 index 0000000..16c40b4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/FFTCompute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7d810630b3004f91923306f6f064752 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/WaveSpectrum.cs b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/WaveSpectrum.cs new file mode 100644 index 0000000..8943cc5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/WaveSpectrum.cs @@ -0,0 +1,303 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest +{ + /// + /// Water shape representation - power values for each octave of wave components. + /// + [CreateAssetMenu(fileName = "Waves", menuName = "Crest/Wave Spectrum", order = 10000)] + [@HelpURL("Manual/Waves.html#wave-conditions")] + public sealed partial class WaveSpectrum : ScriptableObject + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + // These must match corresponding constants in FFTSpectrum.compute + internal const int k_NumberOfOctaves = 14; + internal const float k_SmallestWavelengthPower2 = -4f; + + internal static readonly float s_MinimumPowerLog = -8f; + internal static readonly float s_MaximumPowerLog = 5f; + + [Tooltip("Variance of wave directions, in degrees.")] + [@Range(0f, 180f)] + [SerializeField, HideInInspector] + internal float _WaveDirectionVariance = 90f; + + [Tooltip("More gravity means faster waves.")] + [@Range(0f, 25f)] + [SerializeField, HideInInspector] + internal float _GravityScale = 1f; + + [Tooltip("Multiplier which scales waves")] + [@Range(0f, 10f)] + [SerializeField] + internal float _Multiplier = 1f; + + [SerializeField, HideInInspector] + internal float[] _PowerLogarithmicScales = new float[k_NumberOfOctaves] { -7.10794f, -6.42794f, -5.93794f, -5.27794f, -4.67794f, -3.71794f, -3.17794f, -2.60794f, -1.93794f, -1.11794f, -0.85794f, -0.36794f, 0.04206f, -8f }; + + [SerializeField, HideInInspector] + internal bool[] _PowerDisabled = new bool[k_NumberOfOctaves]; + + [SerializeField, HideInInspector] + internal float[] _ChopScales = new float[k_NumberOfOctaves] { 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f }; + + [SerializeField, HideInInspector] + internal float[] _GravityScales = new float[k_NumberOfOctaves] { 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f }; + + [Tooltip("Scales horizontal displacement")] + [@Range(0f, 2f)] + [SerializeField] + internal float _Chop = 1.6f; + +#pragma warning disable 414 + [SerializeField, HideInInspector] + internal bool _ShowAdvancedControls = false; +#pragma warning restore 414 + +#pragma warning disable 414 + // We need to serialize if we want undo/redo. + [SerializeField, HideInInspector] + internal SpectrumModel _Model; +#pragma warning restore 414 + + internal enum SpectrumModel + { + None, + PiersonMoskowitz, + } + + internal static float SmallWavelength(float octaveIndex) => Mathf.Pow(2f, k_SmallestWavelengthPower2 + octaveIndex); + + static int GetOctaveIndex(float wavelength) + { + Debug.AssertFormat(wavelength > 0f, "Crest: {0} wavelength must be > 0.", nameof(WaveSpectrum)); + var wl_pow2 = Mathf.Log(wavelength) / Mathf.Log(2f); + return (int)(wl_pow2 - k_SmallestWavelengthPower2); + } + + /// + /// Returns the amplitude of a wave described by wavelength. + /// + /// Wavelength in m + /// How many waves we're sampling, used to conserve energy for different sampling rates + /// Wind speed in m/s + /// Gravity + /// The energy of the wave in J + /// The amplitude of the wave in m + internal float GetAmplitude(float wavelength, float componentsPerOctave, float windSpeed, float gravity, out float power) + { + Debug.AssertFormat(wavelength > 0f, this, "Crest: {0} wavelength must be > 0.", nameof(WaveSpectrum)); + + var wl_pow2 = Mathf.Log(wavelength) / Mathf.Log(2f); + wl_pow2 = Mathf.Clamp(wl_pow2, k_SmallestWavelengthPower2, k_SmallestWavelengthPower2 + k_NumberOfOctaves - 1f); + + var lower = Mathf.Pow(2f, Mathf.Floor(wl_pow2)); + + var index = (int)(wl_pow2 - k_SmallestWavelengthPower2); + + if (_PowerLogarithmicScales.Length < k_NumberOfOctaves || _PowerDisabled.Length < k_NumberOfOctaves) + { + Debug.LogWarning($"Crest: Wave spectrum {name} is out of date, please open this asset and resave in editor.", this); + } + + if (index >= _PowerLogarithmicScales.Length || index >= _PowerDisabled.Length) + { + Debug.AssertFormat(index < _PowerLogarithmicScales.Length && index < _PowerDisabled.Length, this, $"Crest: {0} index {index} is out of range.", nameof(WaveSpectrum)); + power = 0f; + return 0f; + } + + // Get the first power for interpolation if available + var thisPower = !_PowerDisabled[index] ? _PowerLogarithmicScales[index] : s_MinimumPowerLog; + + // Get the next power for interpolation if available + var nextIndex = index + 1; + var hasNextIndex = nextIndex < _PowerLogarithmicScales.Length; + var nextPower = hasNextIndex && !_PowerDisabled[nextIndex] ? _PowerLogarithmicScales[nextIndex] : s_MinimumPowerLog; + + // Empirical wind influence based on alpha-beta spectrum that underlies empirical spectra + gravity *= _GravityScale; + + // The amplitude calculation follows this nice paper from Frechot: + // https://hal.archives-ouvertes.fr/file/index/docid/307938/filename/frechot_realistic_simulation_of_ocean_surface_using_wave_spectra.pdf + var wl_lo = Mathf.Pow(2f, Mathf.Floor(wl_pow2)); + var k_lo = 2f * Mathf.PI / wl_lo; + var c_lo = ComputeWaveSpeed(wl_lo, gravity); + var omega_lo = k_lo * c_lo; + var wl_hi = 2f * wl_lo; + var k_hi = 2f * Mathf.PI / wl_hi; + var c_hi = ComputeWaveSpeed(wl_hi, gravity); + var omega_hi = k_hi * c_hi; + + var domega = (omega_lo - omega_hi) / componentsPerOctave; + + // Alpha used to interpolate between power values + var alpha = (wavelength - lower) / lower; + + // Power + power = hasNextIndex ? Mathf.Lerp(thisPower, nextPower, alpha) : thisPower; + power = Mathf.Pow(10f, power); + + // Zero gravity will cause NaNs, and they have always been flat. + if (gravity <= 0f) return 0f; + + var b = 1.291f; + var wm = 0.87f * gravity / windSpeed; + DeepDispersion(2f * Mathf.PI / wavelength, gravity, out var w); + power *= Mathf.Exp(-b * Mathf.Pow(wm / w, 4.0f)); + + var a2 = 2f * power * domega; + + // Amplitude + var a = Mathf.Sqrt(a2); + + // Gerstner fudge - one hack to get Gerstners looking on par with FFT + a *= 5f; + + return a * _Multiplier; + } + + static float ComputeWaveSpeed(float wavelength, float gravity, float gravityMultiplier = 1f) + { + // wave speed of deep sea water waves: https://en.wikipedia.org/wiki/Wind_wave + // https://en.wikipedia.org/wiki/Dispersion_(water_waves)#Wave_propagation_and_dispersion + var g = gravity * gravityMultiplier; + var k = 2f * Mathf.PI / wavelength; + //float h = max(depth, 0.01); + //float cp = sqrt(abs(tanh_clamped(h * k)) * g / k); + var cp = Mathf.Sqrt(g / k); + return cp; + } + + /// + /// Samples spectrum to generate wave data. Wavelengths will be in ascending order. + /// + internal void GenerateWaveData(int componentsPerOctave, ref float[] wavelengths, ref float[] anglesDeg) + { + var totalComponents = k_NumberOfOctaves * componentsPerOctave; + + if (wavelengths == null || wavelengths.Length != totalComponents) wavelengths = new float[totalComponents]; + if (anglesDeg == null || anglesDeg.Length != totalComponents) anglesDeg = new float[totalComponents]; + + var minWavelength = Mathf.Pow(2f, k_SmallestWavelengthPower2); + var invComponentsPerOctave = 1f / componentsPerOctave; + + for (var octave = 0; octave < k_NumberOfOctaves; octave++) + { + for (var i = 0; i < componentsPerOctave; i++) + { + var index = octave * componentsPerOctave + i; + + // Stratified random sampling - should give a better distribution of wavelengths, and also means i can generate + // the wavelengths in ascending order! + var minWavelengthi = minWavelength + invComponentsPerOctave * minWavelength * i; + var maxWavelengthi = Mathf.Min(minWavelengthi + invComponentsPerOctave * minWavelength, 2f * minWavelength); + wavelengths[index] = Mathf.Lerp(minWavelengthi, maxWavelengthi, Random.value); + + var rnd = (i + Random.value) * invComponentsPerOctave; + anglesDeg[index] = (2f * rnd - 1f) * _WaveDirectionVariance; + } + + minWavelength *= 2f; + } + } + + // This applies the correct PM spectrum powers, validated against a separate implementation + internal void ApplyPiersonMoskowitzSpectrum(float gravity) + { + for (var octave = 0; octave < k_NumberOfOctaves; octave++) + { + var wl = SmallWavelength(octave); + + var pow = PiersonMoskowitzSpectrum(gravity, wl); + + // we store power on logarithmic scale. this does not include 0, we represent 0 as min value + pow = Mathf.Max(pow, Mathf.Pow(10f, s_MinimumPowerLog)); + + _PowerLogarithmicScales[octave] = Mathf.Log10(pow); + } + } + + // Alpha-beta spectrum without the beta. Beta represents wind influence and is evaluated at runtime + // for 'current' wind conditions + static float AlphaSpectrum(float a, float g, float w) + { + return a * g * g / Mathf.Pow(w, 5.0f); + } + + static void DeepDispersion(float k, float gravity, out float w) + { + w = Mathf.Sqrt(gravity * k); + } + + static float PiersonMoskowitzSpectrum(float gravity, float wavelength) + { + var k = 2f * Mathf.PI / wavelength; + DeepDispersion(k, gravity, out var w); + var phillipsConstant = 8.1e-3f; + return AlphaSpectrum(phillipsConstant, gravity, w); + } + } + + sealed partial class WaveSpectrum + { + [System.NonSerialized] + internal Texture2D _ControlsTexture; + + [System.NonSerialized] + readonly Color[] _ScratchData = new Color[k_NumberOfOctaves]; + + internal Texture2D ControlsTexture + { + get + { + if (_ControlsTexture == null) + { + _ControlsTexture = new(k_NumberOfOctaves, 1, TextureFormat.RFloat, mipChain: false, linear: true); + InitializeHandControls(); + } + + return _ControlsTexture; + } + } + + void OnDestroy() + { + Helpers.Destroy(_ControlsTexture); + } + + internal void InitializeHandControls() + { + for (var i = 0; i < k_NumberOfOctaves; i++) + { + var power = _PowerDisabled[i] ? 0f : Mathf.Pow(10f, _PowerLogarithmicScales[i]); + power *= _Multiplier * _Multiplier; + _ScratchData[i] = power * Color.white; + } + + ControlsTexture.SetPixels(_ScratchData); + ControlsTexture.Apply(); + } + + [@OnChange(skipIfInactive: false)] + internal void OnChange(string path, object previous) + { + InitializeHandControls(); + } + + internal void OnGUI() + { + if (ControlsTexture != null) + { + GUI.DrawTexture(new(0f, 0f, 100f, 10f), ControlsTexture); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/WaveSpectrum.cs.meta b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/WaveSpectrum.cs.meta new file mode 100644 index 0000000..2193ef6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Scripts/Waves/WaveSpectrum.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 382a5d8b1147b4e78a31353c022b8e15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 72a325a76c6624c768822a08fe625d55, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Settings.meta b/Packages/com.waveharmonic.crest/Runtime/Settings.meta new file mode 100644 index 0000000..db15c2b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8513e0264bf8548f5b6ee70e099e7e32 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Settings/Resources.asset b/Packages/com.waveharmonic.crest/Runtime/Settings/Resources.asset new file mode 100644 index 0000000..62a94c4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Settings/Resources.asset @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: ba9588a2660f342409c82a6ff9e95a88, type: 3} + m_Name: Resources + m_EditorClassIdentifier: + _Shaders: + _CopyDepthIntoCache: {fileID: 4800000, guid: cdf2728920d024e9fb0e708e1dc364bb, + type: 3} + _ColorSpline: {fileID: 4800000, guid: 1e6f7ac69c647420eb778b9c9462c5bb, type: 3} + _FlowSpline: {fileID: 4800000, guid: 230c6e038aecf4f4caccc0051e688389, type: 3} + _FoamSpline: {fileID: 4800000, guid: 640fd8883ed1b4a549626ac524af06ee, type: 3} + _WaveSpline: {fileID: 4800000, guid: 02f1964f0f6a84b73880c00be24ce3f9, type: 3} + _DepthGeometry: {fileID: 4800000, guid: a8aeab41790ee4cb1b72e19aa4a7a1ad, type: 3} + _LevelGeometry: {fileID: 4800000, guid: 06402bee7075b4b9fafef2b1ddf3b5cc, type: 3} + _UpdateShadow: {fileID: 4800000, guid: 6195b173b90b246ac9f5300b7e2aa482, type: 3} + _UnderwaterEffect: {fileID: 4800000, guid: 034b985bd9c344992af148e26d2cdb24, type: 3} + _UnderwaterMask: {fileID: 4800000, guid: edb653e62cc924b99b0a1086ffb39be7, type: 3} + _HorizonMask: {fileID: 4800000, guid: 80a81e5410296461d827cd6eed939b81, type: 3} + _Portals: {fileID: 4800000, guid: 370ffa403718b4982a8a3e0101263093, type: 3} + _ClipConvexHull: {fileID: 4800000, guid: 1f5d1e029c7564da8855bf97e3b9247a, type: 3} + _ShallowWaterSimulationVisualizer: {fileID: 4800000, guid: 613caf76dccc3ea45b0501b731a55ec2, + type: 3} + _DebugTextureArray: {fileID: 4800000, guid: 9984e3507dd424fd49ce01182989250a, + type: 3} + _Blit: {fileID: 4800000, guid: b9836aaab4b1f45e4bd4fc4e6bcc7e74, type: 3} + _ForceShadows: {fileID: 4800000, guid: c9f384b6b84e943ed83161cb82d95b2e, type: 3} + _CaptureShadowMatrices: {fileID: 4800000, guid: 17feb724c7e004b4e8e418931db7eff3, + type: 3} + _Compute: + _Mask: {fileID: 7200000, guid: 51ffca485396f4d8dbf07883c9303f3c, type: 3} + _UnderwaterArtifacts: {fileID: 7200000, guid: 08549c36146ad4899a07193754b21ea2, + type: 3} + _ShapeWavesTransfer: {fileID: 7200000, guid: 3a487d04e47a14907809657d5ccf1917, + type: 3} + _Query: {fileID: 7200000, guid: 7089d2ff99e0e4c9a94ef7c4711d5524, type: 3} + _Gerstner: {fileID: 7200000, guid: c7470afd2715c48b89d1e4a2a557d6d7, type: 3} + _FFT: {fileID: 7200000, guid: a5caa5dfb6d2c4632b41493dc2ba74d0, type: 3} + _FFTBake: {fileID: 7200000, guid: 2571926f132e74744ac8563e209947dd, type: 3} + _FFTSpectrum: {fileID: 7200000, guid: d493ec731bb6e43dfac22cc5921d31e3, type: 3} + _ShapeCombine: {fileID: 7200000, guid: 02a2fc6716dfd4730a8c689ce364f132, type: 3} + _ShorelineColor: {fileID: 7200000, guid: 690b406e28d9a4abb842f6e39c9dc582, type: 3} + _UpdateDynamicWaves: {fileID: 7200000, guid: 0ba116507793f45b5ba3f016f0837660, + type: 3} + _UpdateFoam: {fileID: 7200000, guid: 1149a28b1712c464fbc3d96bea0bc34d, type: 3} + _UpdateShadow: {fileID: 7200000, guid: c47c6200534474da18e1134965c102f3, type: 3} + _PackLevel: {fileID: 7200000, guid: 62854cc297743429aa087d7708d221c0, type: 3} + _AbsorptionTexture: {fileID: 7200000, guid: 82d4c3f5aac084c2bad20d0a31f1168a, + type: 3} + _ClipTexture: {fileID: 7200000, guid: fb559b0e067b5464792b8e434189347c, type: 3} + _FlowTexture: {fileID: 7200000, guid: 67ee915fe51504dd894c5cbf6f1a7868, type: 3} + _FoamTexture: {fileID: 7200000, guid: 69307e5986e134adc90ee257e7dba1ea, type: 3} + _LevelTexture: {fileID: 7200000, guid: 6bccbd92220dc418cacd3f17096c6b97, type: 3} + _DepthTexture: {fileID: 7200000, guid: 025c29236eb8341f0a2078d93379be6a, type: 3} + _ScatteringTexture: {fileID: 7200000, guid: 78d6b75ecfb664f0cbb70001b1446627, + type: 3} + _ClipPrimitive: {fileID: 7200000, guid: ad943abdbda794e98b8decce3329fcd8, type: 3} + _SphereWaterInteraction: {fileID: 7200000, guid: 98fb0af5d79724a2c945809b974524eb, + type: 3} + _RenderDepthProbe: {fileID: 7200000, guid: 6bb3e13f5a77e489584dd6fe9dd28a4f, type: 3} + _JumpFloodSDF: {fileID: 7200000, guid: 55a9b76c48b7343b2b66ed91a0619c29, type: 3} + _UpdateSWS: {fileID: 7200000, guid: 0af900407c415484e8b1482da8ec3881, type: 3} + _Whirlpool: {fileID: 7200000, guid: db903c2d7a8274434aa5eef6aa5218f2, type: 3} + _Clear: {fileID: 7200000, guid: 2641e78378c244c2e8ac89563a8ec9af, type: 3} diff --git a/Packages/com.waveharmonic.crest/Runtime/Settings/Resources.asset.meta b/Packages/com.waveharmonic.crest/Runtime/Settings/Resources.asset.meta new file mode 100644 index 0000000..015f84f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Settings/Resources.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0817af17dea584e5382e6216db162d4a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders.meta new file mode 100644 index 0000000..a9f8a63 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e01bda653e7f54c5c8ac6acd7eb1220d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data.meta new file mode 100644 index 0000000..e435ec0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a90a2ba6d95f94186a1f7b4b227a60a7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input.meta new file mode 100644 index 0000000..c8c648e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f9c719886e7504196818710a8c627eb3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AbsorptionColor.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AbsorptionColor.shader new file mode 100644 index 0000000..24a4c24 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AbsorptionColor.shader @@ -0,0 +1,87 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Absorption/Color" +{ + Properties + { + _Crest_AbsorptionColor("Absorption", Color) = (0.3416268229484558, 0.6954545974731445, 0.8500000238418579, 0.10196078568696976) + + [HideInInspector] + _Crest_Absorption("Absorption", Vector) = (0.0, 0.09803921729326248, 0.20000000298023225, 0.0) + + [Toggle(d_Feather)] + _Crest_Feather("Feather At UV Extents", Float) = 0 + _Crest_FeatherWidth("Feather Width", Range(0.001, 0.5)) = 0.1 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend SrcAlpha OneMinusSrcAlpha + ColorMask RGB + + CGPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #pragma shader_feature_local d_Feather + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + + struct Attributes + { + float3 vertex : POSITION; +#if d_Feather + float2 uv : TEXCOORD0; +#endif + }; + + struct Varyings + { + float4 vertex : SV_POSITION; +#if d_Feather + float2 uv : TEXCOORD0; +#endif + }; + + CBUFFER_START(CrestPerWaterInput) + half4 _Crest_Absorption; + half _Crest_FeatherWidth; + CBUFFER_END + + Varyings Vertex(Attributes input) + { + Varyings output; + float3 positionWS = mul(unity_ObjectToWorld, float4(input.vertex, 1.0)).xyz; + output.vertex = mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); +#if d_Feather + output.uv = input.uv; +#endif + return output; + } + + float4 Fragment(Varyings input) : SV_Target + { + half4 color = _Crest_Absorption; + color.a = 1.0; +#if d_Feather + color.a *= WaveHarmonic::Crest::FeatherWeightFromUV(input.uv, _Crest_FeatherWidth); +#endif + + return color; + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AbsorptionColor.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AbsorptionColor.shader.meta new file mode 100644 index 0000000..bc3d184 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AbsorptionColor.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9a866ef153cd246c58ef554043275848 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AlbedoColor.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AlbedoColor.shader new file mode 100644 index 0000000..f3dec03 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AlbedoColor.shader @@ -0,0 +1,81 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Albedo/Color" +{ + Properties + { + [MainTexture] _Crest_Texture("Albedo", 2D) = "white" {} + _Crest_Color("Color", Color) = (1.0, 1.0, 1.0, 1.0) + _Crest_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 + + [Enum(UnityEngine.Rendering.BlendMode)] + _Crest_BlendModeSource("Source Blend Mode", Int) = 5 + [Enum(UnityEngine.Rendering.BlendMode)] + _Crest_BlendModeTarget("Target Blend Mode", Int) = 10 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend [_Crest_BlendModeSource] [_Crest_BlendModeTarget] + + CGPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "UnityCG.cginc" + + struct Attributes + { + float3 vertex : POSITION; + fixed4 color : COLOR; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 uv : TEXCOORD0; + }; + + CBUFFER_START(CrestPerWaterInput) + float3 _Crest_DisplacementAtInputPosition; + CBUFFER_END + + Texture2D _Crest_Texture; + SamplerState sampler_Crest_Texture; + float4 _Crest_Texture_ST; + + half4 _Crest_Color; + half _Crest_Cutoff; + + Varyings Vertex(Attributes input) + { + Varyings output; + float3 positionWS = mul(unity_ObjectToWorld, float4(input.vertex, 1.0)).xyz; + positionWS.xz -= _Crest_DisplacementAtInputPosition.xz; + output.vertex = mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); + output.uv = input.uv; + output.color = input.color; + return output; + } + + fixed4 Fragment(Varyings i) : SV_Target + { + fixed4 color = _Crest_Texture.Sample(sampler_Crest_Texture, i.uv) * _Crest_Color; + clip(color.a - _Crest_Cutoff + 0.0001); + return color * i.color; + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AlbedoColor.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AlbedoColor.shader.meta new file mode 100644 index 0000000..b9d6426 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AlbedoColor.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: aa7b1bc481cf34f229ffd793be4a01c3 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesAddFromTexture.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesAddFromTexture.shader new file mode 100644 index 0000000..d82dd96 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesAddFromTexture.shader @@ -0,0 +1,87 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Animated Waves/Add From Texture" +{ + Properties + { + [MainTexture] _Crest_Texture("Texture", 2D) = "black" {} + _Crest_Strength( "Strength", float ) = 1 + + [Toggle(d_HeightsOnly)] + _Crest_HeightsOnly("Heights Only", Float) = 1 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + Blend One One + ZTest Always + ZWrite Off + + Pass + { + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #pragma shader_feature_local_fragment d_HeightsOnly + + #include "UnityCG.cginc" + + Texture2D _Crest_Texture; + SamplerState sampler_Crest_Texture; + + CBUFFER_START(CrestPerWaterInput) + float4 _Crest_Texture_ST; + float _Crest_Strength; + float _Crest_Weight; + float3 _Crest_DisplacementAtInputPosition; + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + }; + + Varyings Vert(Attributes input) + { + Varyings o; + + float3 worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement + worldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + o.positionCS = mul(UNITY_MATRIX_VP, float4(worldPos, 1.0)); + + o.uv = TRANSFORM_TEX(input.uv, _Crest_Texture); + return o; + } + + half4 Frag(Varyings input) : SV_Target + { + half3 texSample = _Crest_Texture.Sample(sampler_Crest_Texture, input.uv).xyz; + + half3 displacement = (half3)0.0; +#if d_HeightsOnly + displacement.y = texSample.x * _Crest_Strength; +#else + displacement.xyz = texSample * _Crest_Strength; +#endif + + return _Crest_Weight * half4(displacement, 0.0); + } + + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesAddFromTexture.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesAddFromTexture.shader.meta new file mode 100644 index 0000000..d55a1f4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesAddFromTexture.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 62ff65b047d684524b06152100f725bb +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesRemoveGeometry.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesRemoveGeometry.shader new file mode 100644 index 0000000..93f42d0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesRemoveGeometry.shader @@ -0,0 +1,83 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Push water under the geometry. Needs to be rendered into all LODs - set Octave Wave length to 0. + +Shader "Crest/Inputs/Animated Waves/Push Water Under Convex Hull" +{ + Properties + { + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + BlendOp Min + Cull Front + ColorMask G + + CGPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + + CBUFFER_START(CrestPerWaterInput) + float _Crest_Weight; + float3 _Crest_DisplacementAtInputPosition; + CBUFFER_END + + m_CrestNameSpace + + struct Attributes + { + float3 positionOS : POSITION; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float3 worldPos : TEXCOORD0; + }; + + Varyings Vertex(Attributes input) + { + Varyings o; + + o.worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement + o.worldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + + o.positionCS = mul(UNITY_MATRIX_VP, float4(o.worldPos, 1.0)); + + return o; + } + + half4 Fragment(Varyings input) + { + // Write displacement to get from sea level of water to the y value of this geometry. + half seaLevelOffset = Cascade::MakeLevel(_Crest_LodIndex).SampleLevel(input.worldPos.xz); + return half4(0.0, _Crest_Weight * (input.worldPos.y - g_Crest_WaterCenter.y - seaLevelOffset), 0.0, 0.0); + } + + m_CrestNameSpaceEnd + + m_CrestVertex + m_CrestFragment(half4) + + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesRemoveGeometry.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesRemoveGeometry.shader.meta new file mode 100644 index 0000000..26b202b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesRemoveGeometry.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 170672f06b4574545ba8305cb7d11091 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesSetHeightToGeometry.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesSetHeightToGeometry.shader new file mode 100644 index 0000000..b7631f6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesSetHeightToGeometry.shader @@ -0,0 +1,87 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// This writes straight into the displacement texture and sets the water height to the y value of the geometry. + +Shader "Crest/Inputs/Animated Waves/Set Water Height Using Geometry" +{ + Properties + { + [Enum(ColorWriteMask)] + _Crest_ColorMask("Color Mask", Int) = 15 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend Off + ColorMask [_Crest_ColorMask] + + CGPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + + CBUFFER_START(CrestPerWaterInput) + float _Crest_Weight; + float3 _Crest_DisplacementAtInputPosition; + CBUFFER_END + + m_CrestNameSpace + + struct Attributes + { + float3 positionOS : POSITION; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float3 worldPos : TEXCOORD0; + }; + + Varyings Vertex(Attributes input) + { + Varyings o; + + o.worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement + o.worldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + + o.positionCS = mul(UNITY_MATRIX_VP, float4(o.worldPos, 1.0)); + + return o; + } + + half4 Fragment(Varyings input) + { + half seaLevelOffset = Cascade::MakeLevel(_Crest_LodIndex).SampleLevel(input.worldPos.xz); + + // Write displacement to get from sea level of water to the y value of this geometry + float height = input.worldPos.y - g_Crest_WaterCenter.y - seaLevelOffset; + return half4(0.0, _Crest_Weight * height, 0.0, 0.0); + } + + m_CrestNameSpaceEnd + + m_CrestVertex + m_CrestFragment(half4) + + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesSetHeightToGeometry.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesSetHeightToGeometry.shader.meta new file mode 100644 index 0000000..a091001 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesSetHeightToGeometry.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3acaa68c12f5e435290dbeebd2684241 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesWaveParticle.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesWaveParticle.shader new file mode 100644 index 0000000..d63ae2f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesWaveParticle.shader @@ -0,0 +1,90 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Animated Waves/Wave Particle" +{ + Properties + { + _Crest_Amplitude( "Amplitude", float ) = 1 + _Crest_Radius( "Radius", float) = 3 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + Tags { "DisableBatching" = "True" } + + ZTest Always + ZWrite Off + + Pass + { + Blend One One + + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #include "UnityCG.cginc" + + CBUFFER_START(CrestPerWaterInput) + float _Crest_Radius; + float _Crest_Amplitude; + float _Crest_Weight; + float3 _Crest_DisplacementAtInputPosition; + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 worldOffsetScaledXZ : TEXCOORD0; + }; + + Varyings Vert(Attributes input) + { + Varyings o; + + float3 worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + float3 centerPos = unity_ObjectToWorld._m03_m13_m23; + o.worldOffsetScaledXZ = worldPos.xz - centerPos.xz; + + // shape is symmetric around center with known radius - fix the vert positions to perfectly wrap the shape. + o.worldOffsetScaledXZ = sign(o.worldOffsetScaledXZ); + float4 newWorldPos = float4(centerPos, 1.0); + newWorldPos.xz += o.worldOffsetScaledXZ * _Crest_Radius; + + // Correct for displacement + newWorldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + + o.positionCS = mul(UNITY_MATRIX_VP, newWorldPos); + + return o; + } + + float4 Frag(Varyings input) : SV_Target + { + // power 4 smoothstep - no normalize needed + // credit goes to stubbe's shadertoy: https://www.shadertoy.com/view/4ldSD2 + float r2 = dot( input.worldOffsetScaledXZ, input.worldOffsetScaledXZ); + if( r2 > 1.0 ) + return (float4)0.0; + + r2 = 1.0 - r2; + + float y = r2 * r2 * _Crest_Amplitude; + + return float4(0.0, y * _Crest_Weight, 0.0, 0.0); + } + + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesWaveParticle.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesWaveParticle.shader.meta new file mode 100644 index 0000000..a718840 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/AnimatedWavesWaveParticle.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c1519a4fd6d8a4a62b59870be79b3857 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesAddBump.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesAddBump.shader new file mode 100644 index 0000000..41382e7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesAddBump.shader @@ -0,0 +1,110 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Dynamic Waves/Add Bump" +{ + Properties + { + _Crest_Amplitude( "Amplitude", float ) = 1 + _Crest_Radius( "Radius", float) = 3 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend One One + + CGPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + + CBUFFER_START(CrestPerWaterInput) + float _Crest_Radius; + float _Crest_SimDeltaTime; + float _Crest_Amplitude; + float3 _Crest_DisplacementAtInputPosition; + CBUFFER_END + + m_CrestNameSpace + + struct Attributes + { + float3 positionOS : POSITION; + float2 texcoord : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 worldOffsetScaled : TEXCOORD0; + float2 uv : TEXCOORD1; + }; + + Varyings Vertex(Attributes input) + { + Varyings o; + o.positionCS = UnityObjectToClipPos(input.positionOS); + + float3 worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)); + float3 centerPos = unity_ObjectToWorld._m03_m13_m23; + o.worldOffsetScaled.xy = worldPos.xz - centerPos.xz; + + // shape is symmetric around center with known radius - fix the vert positions to perfectly wrap the shape. + o.worldOffsetScaled.xy = sign(o.worldOffsetScaled.xy); + float4 newWorldPos = float4(centerPos, 1.0); + newWorldPos.xz += o.worldOffsetScaled.xy * _Crest_Radius; + + // Correct for displacement + newWorldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + + o.positionCS = mul(UNITY_MATRIX_VP, newWorldPos); + o.uv = Cascade::MakeDynamicWaves(_Crest_LodIndex).WorldToUV(newWorldPos.xz); + + return o; + } + + float4 Fragment(Varyings input) + { + // power 4 smoothstep - no normalize needed + // credit goes to stubbe's shadertoy: https://www.shadertoy.com/view/4ldSD2 + float r2 = dot(input.worldOffsetScaled.xy, input.worldOffsetScaled.xy); + if (r2 > 1.0) + return (float4)0.0; + + r2 = 1.0 - r2; + + float y = r2 * r2; + y = pow(y, 0.05); + y *= _Crest_Amplitude; + + y /= g_Crest_LodCount; + + // Feather edges to reduce streaking without introducing reflections. + y *= FeatherWeightFromUV(input.uv, 0.1); + + // accelerate velocities + return float4(0.0, _Crest_SimDeltaTime * y, 0.0, 0.0); + } + + m_CrestNameSpaceEnd + + m_CrestVertex + m_CrestFragment(float4) + + ENDCG + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesAddBump.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesAddBump.shader.meta new file mode 100644 index 0000000..694df77 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesAddBump.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7e8ca175bc339b74880584aa1544100e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesDampenCircle.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesDampenCircle.shader new file mode 100644 index 0000000..4825549 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesDampenCircle.shader @@ -0,0 +1,87 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Dynamic Waves/Dampen Circle" +{ + Properties + { + _Crest_Radius("Radius", float) = 3 + _Crest_Strength("Strength", Range(0, 100)) = 10 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend SrcAlpha OneMinusSrcAlpha + + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #include "UnityCG.cginc" + + CBUFFER_START(CrestPerWaterInput) + float _Crest_SimDeltaTime; + float _Crest_Radius; + float _Crest_Strength; + float _Crest_Weight; + float3 _Crest_DisplacementAtInputPosition; + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 worldOffsetScaled : TEXCOORD0; + }; + + Varyings Vert(Attributes input) + { + Varyings o; + o.positionCS = UnityObjectToClipPos(input.positionOS); + + float3 worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + float3 centerPos = unity_ObjectToWorld._m03_m13_m23; + o.worldOffsetScaled.xy = worldPos.xz - centerPos.xz; + + // shape is symmetric around center with known radius - fix the vert positions to perfectly wrap the shape. + o.worldOffsetScaled.xy = sign(o.worldOffsetScaled.xy); + float4 newWorldPos = float4(centerPos, 1.0); + newWorldPos.xz += o.worldOffsetScaled.xy * _Crest_Radius; + + // Correct for displacement + newWorldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + + o.positionCS = mul(UNITY_MATRIX_VP, newWorldPos); + + return o; + } + + float4 Frag(Varyings input) : SV_Target + { + // power 4 smoothstep - no normalize needed + // credit goes to stubbe's shadertoy: https://www.shadertoy.com/view/4ldSD2 + float r2 = dot(input.worldOffsetScaled.xy, input.worldOffsetScaled.xy); + if (r2 > 1.0) return (float4)0.0; + r2 = 1.0 - r2; + float val = r2 * r2; + + float weight = val * _Crest_Strength * _Crest_SimDeltaTime * _Crest_Weight; + return float4(0.0, 0.0, 0.0, weight); + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesDampenCircle.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesDampenCircle.shader.meta new file mode 100644 index 0000000..4d48228 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/DynamicWavesDampenCircle.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f7ab71b44865e403cb0a074713fb3ff7 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowAddFromTexture.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowAddFromTexture.shader new file mode 100644 index 0000000..6976c20 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowAddFromTexture.shader @@ -0,0 +1,112 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Flow/Add From Texture" +{ + Properties + { + [MainTexture] _Crest_Texture("Flow Map", 2D) = "white" {} + _Crest_Strength( "Strength", float ) = 1 + + [Toggle(d_FlipX)] + _Crest_FlipX("Flip X", Float) = 0 + [Toggle(d_FlipZ)] + _Crest_FlipZ("Flip Z", Float) = 0 + [Toggle(d_NegativeValues)] + _Crest_NegativeValues("Has Negative Values", Float) = 0 + + [Toggle(d_Feather)] + _Crest_Feather("Feather At UV Extents", Float) = 0 + _Crest_FeatherWidth("Feather Width", Range(0.001, 0.5)) = 0.1 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + Blend One One + ZTest Always + ZWrite Off + + Pass + { + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #pragma shader_feature_local_fragment d_FlipX + #pragma shader_feature_local_fragment d_FlipZ + #pragma shader_feature_local_fragment d_Feather + #pragma shader_feature_local_fragment d_NegativeValues + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + + Texture2D _Crest_Texture; + SamplerState sampler_Crest_Texture; + + CBUFFER_START(CrestPerWaterInput) + float4 _Crest_Texture_ST; + float _Crest_Strength; + float _Crest_Weight; + float3 _Crest_DisplacementAtInputPosition; + half _Crest_FeatherWidth; + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + }; + + Varyings Vert(Attributes input) + { + Varyings o; + + float3 worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement + worldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + o.positionCS = mul(UNITY_MATRIX_VP, float4(worldPos, 1.0)); + + o.uv = TRANSFORM_TEX(input.uv, _Crest_Texture); + return o; + } + + float4 Frag(Varyings input) : SV_Target + { + float2 flow = _Crest_Texture.Sample(sampler_Crest_Texture, input.uv).xy; + +#if !d_NegativeValues + // From 0..1 to -1..1. + flow = flow * 2.0 - 1.0; +#endif + +#if d_Feather + flow *= WaveHarmonic::Crest::FeatherWeightFromUV(input.uv, _Crest_FeatherWidth); +#endif + +#if d_FlipX + flow.x *= -1.0; +#endif +#if d_FlipZ + flow.y *= -1.0; +#endif + + return float4(flow * _Crest_Strength * _Crest_Weight, 0.0, 0.0); + } + + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowAddFromTexture.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowAddFromTexture.shader.meta new file mode 100644 index 0000000..cdd9bfc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowAddFromTexture.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8958e526a8d9b403e878e13b80405796 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowFixedDirection.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowFixedDirection.shader new file mode 100644 index 0000000..55988ab --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowFixedDirection.shader @@ -0,0 +1,104 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Flow/Fixed Direction" +{ + Properties + { + _Crest_Speed("Speed", Range(0.0, 30.0)) = 1.0 + _Crest_Direction("Direction", Range(0.0, 1.0)) = 0.0 + + [Toggle(d_Feather)] + _Crest_Feather("Feather At UV Extents", Float) = 0 + _Crest_FeatherWidth("Feather Width", Range(0.001, 0.5)) = 0.1 + + [Toggle(d_ApplyRotation)] + _Crest_ApplyRotation("Apply Transform XZ Rotation", Float) = 0 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #pragma shader_feature_local d_Feather + #pragma shader_feature_local_fragment d_ApplyRotation + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + + CBUFFER_START(CrestPerWaterInput) + float _Crest_Speed; + float _Crest_Direction; + float3 _Crest_DisplacementAtInputPosition; + half _Crest_FeatherWidth; + half _Crest_Weight; + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; +#if d_Feather + float2 uv : TEXCOORD0; +#endif + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 vel : TEXCOORD0; +#if d_Feather + float2 uv : TEXCOORD1; +#endif + }; + + Varyings Vert(Attributes input) + { + Varyings o; + + float3 worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement + worldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + o.positionCS = mul(UNITY_MATRIX_VP, float4(worldPos, 1.0)); + + o.vel = _Crest_Speed * float2(cos(_Crest_Direction * 6.283185), sin(_Crest_Direction * 6.283185)); + +#if d_Feather + o.uv = input.uv; +#endif + + return o; + } + + float4 Frag(Varyings input) : SV_Target + { + float2 flow = input.vel; + +#if d_Feather + flow *= WaveHarmonic::Crest::FeatherWeightFromUV(input.uv, _Crest_FeatherWidth); +#endif + +#if d_ApplyRotation + const float2 rotation = normalize(unity_ObjectToWorld._m00_m20.xy); + flow = flow.x * rotation + flow.y * float2(-rotation.y, rotation.x); +#endif + + return float4(flow * _Crest_Weight, 0.0, 0.0); + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowFixedDirection.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowFixedDirection.shader.meta new file mode 100644 index 0000000..a615219 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FlowFixedDirection.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5198aecab500144dbb5ee73bad91640a +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromTexture.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromTexture.shader new file mode 100644 index 0000000..69e9edc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromTexture.shader @@ -0,0 +1,74 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Foam/Add From Texture" +{ + Properties + { + [MainTexture] _Crest_Texture("Texture", 2D) = "white" {} + _Crest_Strength( "Strength", float ) = 1 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + Blend One One + ZTest Always + ZWrite Off + + Pass + { + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #include "UnityCG.cginc" + + Texture2D _Crest_Texture; + SamplerState sampler_Crest_Texture; + float _Crest_Strength; + + CBUFFER_START(CrestPerWaterInput) + float _Crest_SimDeltaTime; + float4 _Crest_Texture_ST; + float3 _Crest_DisplacementAtInputPosition; + half _Crest_Weight; + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + }; + + Varyings Vert(Attributes input) + { + Varyings o; + + float3 worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement + worldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + o.positionCS = mul(UNITY_MATRIX_VP, float4(worldPos, 1.0)); + + o.uv = TRANSFORM_TEX(input.uv, _Crest_Texture); + return o; + } + + float4 Frag(Varyings input) : SV_Target + { + return _Crest_Texture.Sample(sampler_Crest_Texture, input.uv) * _Crest_Weight * _Crest_Strength * _Crest_SimDeltaTime; + } + + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromTexture.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromTexture.shader.meta new file mode 100644 index 0000000..cca0212 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromTexture.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 955fe6ade516e42e0ab0b0bbb116170a +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromVertexColor.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromVertexColor.shader new file mode 100644 index 0000000..602cd3d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromVertexColor.shader @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Foam/Add From Vertex Colors" +{ + Properties + { + _Crest_Strength("Strength", float) = 1 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + Blend One One + ZTest Always + ZWrite Off + + Pass + { + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #include "UnityCG.cginc" + + CBUFFER_START(CrestPerWaterInput) + float _Crest_SimDeltaTime; + float _Crest_Strength; + float _Crest_Weight; + float3 _Crest_DisplacementAtInputPosition; + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; + float4 col : COLOR0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float4 col : COLOR0; + }; + + Varyings Vert(Attributes input) + { + Varyings o; + + float3 worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement + worldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + o.positionCS = mul(UNITY_MATRIX_VP, float4(worldPos, 1.0)); + + o.col = input.col; + + return o; + } + + half4 Frag(Varyings input) : SV_Target + { + return _Crest_Strength * input.col.x * _Crest_SimDeltaTime * _Crest_Weight; + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromVertexColor.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromVertexColor.shader.meta new file mode 100644 index 0000000..428de2f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/FoamAddFromVertexColor.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f51a8e7d464dd4fb0a51d0c61b8ca417 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden.meta new file mode 100644 index 0000000..86eddcb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a69be96a1d36c4f8b9f29717e0a95d94 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AbsorptionTexture.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AbsorptionTexture.compute new file mode 100644 index 0000000..875c9c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AbsorptionTexture.compute @@ -0,0 +1,55 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestExecute + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +Texture2D _Crest_Texture; +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +int _Crest_Blend; +float _Crest_Weight; +float4 _Crest_Multiplier; +float2 _Crest_TextureSize; +float2 _Crest_TexturePosition; +float2 _Crest_TextureRotation; +float _Crest_FeatherWidth; +CBUFFER_END + +m_CrestNameSpace + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeAbsorption(id.z); + const float2 uv = DataIDToInputUV(id.xy, cascade, _Crest_TexturePosition, _Crest_TextureRotation, _Crest_TextureSize); + + half weight = _Crest_Weight; + + // Feather boundaries. + weight *= FeatherWeightFromUV(uv, _Crest_FeatherWidth); + + // Check we are within bounds. + if (weight <= 0.0) + { + return; + } + + const half4 source = _Crest_Texture.SampleLevel(LODData_linear_clamp_sampler, uv, 0) * _Crest_Multiplier; + const half3 target = _Crest_Target[id]; + weight *= source.a; + + _Crest_Target[id] = Blend(_Crest_Blend, weight, 1.0, source.xyz, target); +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AbsorptionTexture.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AbsorptionTexture.compute.meta new file mode 100644 index 0000000..a459a54 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AbsorptionTexture.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 82d4c3f5aac084c2bad20d0a31f1168a +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AnimatedWavesGenerate.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AnimatedWavesGenerate.compute new file mode 100644 index 0000000..d966891 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AnimatedWavesGenerate.compute @@ -0,0 +1,248 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestTransferWaves + +#pragma multi_compile_local __ d_Texture d_TextureBlend + +#if defined(d_TextureBlend) +#define d_Texture 1 +#endif + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +Texture2D _Crest_Texture; +Texture2DArray _Crest_WaveBuffer; +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +float4 _Crest_WaveBufferParameters[MAX_LOD_COUNT]; +float2 _Crest_AxisX; +float _Crest_Weight; +float _Crest_FeatherWidth; +float _Crest_AttenuationInShallows; +float _Crest_RespectShallowWaterAttenuation; +float _Crest_MaximumAttenuationDepth; +float _Crest_WaveResolutionMultiplier; +float _Crest_TransitionalWavelengthThreshold; + +// Texture +#if d_Texture +float2 _Crest_TextureSize; +float2 _Crest_TexturePosition; +float2 _Crest_TextureRotation; +bool _Crest_NegativeValues; +int _Crest_Blend; +#endif +CBUFFER_END + +#if d_Texture +#define m_None 0 +#define m_FromZero 4 +#define m_FromZeroNormalized 5 +#endif // d_Texture + +m_CrestNameSpace + +void TransferWaves(uint3 id) +{ + const uint slice0 = id.z; + + const float4 parameters = _Crest_WaveBufferParameters[slice0]; + const uint first = parameters.x; + const uint last = parameters.y; + const half transition = parameters.w; + +#if !d_TextureBlend + // Additive only. All wavelengths filtered out for this LOD so nothing to do. + if (parameters.x < 0 || parameters.y < 0) + { + return; + } +#endif + + const Cascade cascade = Cascade::MakeAnimatedWaves(slice0); + const float2 positionWS = cascade.IDToWorld(id.xy); + + half _weight = _Crest_Weight; + half alpha = 0.0; + +#if d_Texture + float2 uvPainted = (positionWS - _Crest_TexturePosition) / _Crest_TextureSize; + // Clockwise transform rotation. + uvPainted = uvPainted.x * float2(_Crest_TextureRotation.y, -_Crest_TextureRotation.x) + uvPainted.y * _Crest_TextureRotation; + uvPainted += 0.5; + + // Feather boundaries. + _weight *= FeatherWeightFromUV(uvPainted, _Crest_FeatherWidth); + + // Check we are within bounds. + if (_weight <= 0.0) + { + return; + } + + alpha = _weight; + + // Initialize or "use of potentially uninitialized variable" due to early return. + float2 axis; float axisLength = 0.0; float t = 0.0; + float2 axisX0 = 0.0; float2 axisX1 = 0.0; float2 axisZ0 = 0.0; float2 axisZ1 = 0.0; + { + axis = _Crest_Texture.SampleLevel(LODData_linear_clamp_sampler, uvPainted, 0).xy; + + if (!_Crest_NegativeValues) + { + // -1.0 to 1.0 + axis = axis * 2.0 - 1.0; + } + + float axisLength2 = dot(axis, axis); + + // Zero data so exit early and apply blending if needed. + if (!(axisLength2 > 0.00001)) + { +#if d_TextureBlend + if (_Crest_Blend > m_None) + { + // If zero affects blend weight, then reduce alpha by axis length so that it + // accounts for zero data. + alpha = 0.0; + } + + _Crest_Target[id] *= 1.0 - alpha; +#endif + return; + } + + axisLength = sqrt(axisLength2); + + // Alpha blending based on data. + if (_Crest_Blend == m_FromZeroNormalized) + { + // Normalize so even small amounts fully removes existing waves. + alpha *= length(normalize(axis)); + } + else if (_Crest_Blend == m_FromZero) + { + alpha *= axisLength; + } + + // Rotate axis with transform rotation to keep axis in local space. + axis = axis.x * _Crest_TextureRotation.yx + axis.y * float2(-_Crest_TextureRotation.x, _Crest_TextureRotation.y); + + // Add wind (counterclockwise). + axis = axis.x * _Crest_AxisX + axis.y * float2(-_Crest_AxisX.y, _Crest_AxisX.x); + + // Quantize wave direction. + const float axisHeading = atan2(axis.y, axis.x) + 2.0 * 3.141592654; + const float dTheta = 0.5 * 0.314159265; + const float rem = fmod(axisHeading, dTheta); + const float angle0 = axisHeading - rem; + const float angle1 = angle0 + dTheta; + t = rem / dTheta; + + sincos(angle0, axisX0.y, axisX0.x); + sincos(angle1, axisX1.y, axisX1.x); + axisZ0.x = -axisX0.y; axisZ0.y = axisX0.x; + axisZ1.x = -axisX1.y; axisZ1.y = axisX1.x; + } +#else + const float2 positionWaves = float2(dot(positionWS, _Crest_AxisX), dot(positionWS, float2(-_Crest_AxisX.y, _Crest_AxisX.x))); +#endif // d_Texture + + const half depth = Cascade::MakeDepth(slice0).SampleSignedDepthFromSeaLevel(positionWS) + + Cascade::MakeLevel(slice0).SampleLevel(positionWS); + + half3 _displacement = 0.0; + + // Loop through wave buffer slices. + for (uint i = first; i <= last; i++) + { + const uint waveBufferIndex = i; + const float waveBufferSize = 0.5f * (1 << waveBufferIndex); + + half weight = _weight; + + uint WAVE_SAMPLE_FACTOR = 8; + half minimumWL = waveBufferSize / WAVE_SAMPLE_FACTOR / _Crest_WaveResolutionMultiplier; + half averageWL = minimumWL * 1.5f * _Crest_WaveResolutionMultiplier; + + // If approaching end of lod chain, start smoothly transitioning any large + // wavelengths across last two LODs. + if (minimumWL >= _Crest_TransitionalWavelengthThreshold) + { + // The transition weight must not be applied to the alpha otherwise popping. + weight *= transition; + } + + // Attenuation. + float attenuation; + { + // Attenuate waves based on water depth. If depth is greater than half the + // wavelength, water is considered deep and wave is unaffected. If depth is less + // than this, wave velocity decreases. Waves will then bunch up and grow in + // amplitude and eventually break. Deep water model is approximated by simply + // ramping down waves in non-deep water with a linear multiplier. + // http://hyperphysics.phy-astr.gsu.edu/hbase/Waves/watwav2.html + // http://hyperphysics.phy-astr.gsu.edu/hbase/watwav.html#c1 + half weight = saturate(2.0 * depth / averageWL); + if (_Crest_MaximumAttenuationDepth < k_Crest_MaximumWaveAttenuationDepth) + { + weight = lerp(weight, 1.0, saturate(depth / _Crest_MaximumAttenuationDepth)); + } + + + const float attenuationAmount = _Crest_AttenuationInShallows * _Crest_RespectShallowWaterAttenuation; + attenuation = attenuationAmount * weight + (1.0 - attenuationAmount); + } + + // NOTE: Could not get attenuation applied to alpha to work. Incurred popping. + weight *= attenuation; + + // Sample Wave Buffers. + if (weight > 0.0) + { +#if d_Texture + // Interpolate waves. + float2 positionScaledWS = positionWS / waveBufferSize; + + const float2 uv0 = float2(dot(positionScaledWS, axisX0), dot(positionScaledWS, axisZ0)); + const float2 uv1 = float2(dot(positionScaledWS, axisX1), dot(positionScaledWS, axisZ1)); + + // Sample displacement, rotate into frame. + float3 displacement0 = _Crest_WaveBuffer.SampleLevel(sampler_Crest_linear_repeat, float3(uv0, waveBufferIndex), 0).xyz; + float3 displacement1 = _Crest_WaveBuffer.SampleLevel(sampler_Crest_linear_repeat, float3(uv1, waveBufferIndex), 0).xyz; + + float3 displacement = lerp(displacement0, displacement1, t); + displacement.xz = displacement.x * axis + displacement.z * float2(-axis.y, axis.x); + displacement.y *= axisLength; + _displacement += displacement * weight; + +#else // !d_Texture + // Sample displacement, rotate into frame defined by global wind direction. + half3 displacement = _Crest_WaveBuffer.SampleLevel(sampler_Crest_linear_repeat, float3(positionWaves / waveBufferSize, waveBufferIndex), 0).xyz; + displacement.xz = displacement.x * _Crest_AxisX + displacement.z * float2(-_Crest_AxisX.y, _Crest_AxisX.x); + _displacement += displacement * weight; +#endif // d_Texture + } + } + +#if d_TextureBlend + // Global waves are always additive. + _Crest_Target[id] *= 1.0 - saturate(alpha); +#endif + + // Always write full alpha so textures show up in previews. + _Crest_Target[id] += float4(_displacement, 1.0); +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(TransferWaves) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AnimatedWavesGenerate.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AnimatedWavesGenerate.compute.meta new file mode 100644 index 0000000..a9a95f0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/AnimatedWavesGenerate.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3a487d04e47a14907809657d5ccf1917 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipConvexHull.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipConvexHull.shader new file mode 100644 index 0000000..ef5a18b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipConvexHull.shader @@ -0,0 +1,93 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Renders convex hull to the clip surface texture. + +Shader "Hidden/Crest/Inputs/Clip/Convex Hull" +{ + CGINCLUDE + #pragma vertex Vertex + #pragma fragment Fragment + + // For SV_IsFrontFace. + #pragma target 3.0 + + #include "UnityCG.cginc" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl" + + CBUFFER_START(CrestPerWaterInput) + bool _Crest_Inverted; + CBUFFER_END + + m_CrestNameSpace + + struct Attributes + { + float3 positionOS : POSITION; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float3 positionWS : TEXCOORD0; + }; + + Varyings Vertex(Attributes input) + { + Varyings o; + o.positionCS = UnityObjectToClipPos(input.positionOS); + o.positionWS = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)); + return o; + } + + float4 Fragment(Varyings input, const bool isFrontFace) + { + float3 surfacePositionWS = Cascade::MakeAnimatedWaves(_Crest_LodIndex) + .SampleDisplacementFromUndisplaced(input.positionWS.xz); + + // Move to sea level. + surfacePositionWS.y += g_Crest_WaterCenter.y; + + // Clip if above water. + if (input.positionWS.y > surfacePositionWS.y) + { + clip(-1.0); + } + + // To add clipping, back face must write one and front face must write zero. + return float4(isFrontFace == _Crest_Inverted ? 1.0 : 0.0, 0.0, 0.0, 1.0); + } + + m_CrestNameSpaceEnd + + m_CrestVertex + m_CrestFragmentWithFrontFace(float4) + + ENDCG + + SubShader + { + ColorMask R + ZTest Always + ZWrite Off + + Pass + { + Cull Front + // Here so CGINCLUDE works. + CGPROGRAM + ENDCG + } + + Pass + { + Cull Back + // Here so CGINCLUDE works. + CGPROGRAM + ENDCG + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipConvexHull.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipConvexHull.shader.meta new file mode 100644 index 0000000..d30ef6c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipConvexHull.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1f5d1e029c7564da8855bf97e3b9247a +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipPrimitive.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipPrimitive.compute new file mode 100644 index 0000000..a6bb0a4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipPrimitive.compute @@ -0,0 +1,97 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestExecute + +#pragma multi_compile_local d_Sphere d_Cube d_Rectangle +#pragma multi_compile_local __ d_Inverted + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +float3 _Crest_Position; +float _Crest_Diameter; +float4x4 _Crest_Matrix; +CBUFFER_END + +m_CrestNameSpace + +// Also covers elipsoids etc. +float SphereSDF(float3 position) +{ + // Distance from center. + return length(position); +} + +// Also covers rectangular prisms etc. +float CubeSDF(float3 position) +{ + // Restrict to one quadrant of a box. + position = abs(position); + // Get furthest distance from center. + return max(position.x, max(position.y, position.z)); +} + +float RectangleSDF(float2 position) +{ + // Restrict to one quadrant of a box. + position = abs(position); + // Get furthest distance from center. + return max(position.x, position.y); +} + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeClip(id.z); + const float2 positionXZ = cascade.IDToWorld(id.xy); + + // TODO: Optimize with something better than spherical culling. + // Spherical culling. Check diameter for buffered area. + if (length(positionXZ - _Crest_Position.xz) > _Crest_Diameter) + { + return; + } + + float3 position = 0.0; + position.xz = positionXZ; + +#if !d_Rectangle + // Only need height as clip surface is sampled at the displaced position. + const float3 surface = Cascade::MakeAnimatedWaves(id.z).SampleDisplacementFromUndisplaced(positionXZ); + position.y = g_Crest_WaterCenter.y + surface.y; +#endif + + // SDF operate in local space. + position = mul(_Crest_Matrix, float4(position, 1.0)).xyz; + + float sdf = 0; + +#if d_Sphere + sdf = SphereSDF(position); +#endif + +#if d_Cube + sdf = CubeSDF(position); +#endif + +#if d_Rectangle + sdf = RectangleSDF(position.xz); +#endif + +#if d_Inverted + _Crest_Target[id.xyz] = min(_Crest_Target[id.xyz], sdf); +#else + sdf = 1.0 - sdf; + _Crest_Target[id.xyz] = max(_Crest_Target[id.xyz], sdf); +#endif +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipPrimitive.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipPrimitive.compute.meta new file mode 100644 index 0000000..12f0b88 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipPrimitive.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ad943abdbda794e98b8decce3329fcd8 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipTexture.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipTexture.compute new file mode 100644 index 0000000..3a25bfe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipTexture.compute @@ -0,0 +1,48 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Adds clipping from a provided texture. Used by Painted and Texture input modes. + +#pragma kernel CrestExecute + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +Texture2D _Crest_Texture; +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +float _Crest_Multiplier; +float2 _Crest_TextureSize; +float2 _Crest_TexturePosition; +float2 _Crest_TextureRotation; +CBUFFER_END + +m_CrestNameSpace + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeClip(id.z); + const float2 uv = DataIDToInputUV(id.xy, cascade, _Crest_TexturePosition, _Crest_TextureRotation, _Crest_TextureSize); + + // Check we are within bounds. + if (!WithinUV(uv)) + { + return; + } + + const float result = _Crest_Texture.SampleLevel(LODData_linear_clamp_sampler, uv, 0).x * _Crest_Multiplier; + + // Painted clip defines a minimum value of the clip. + _Crest_Target[id] = max(_Crest_Target[id], result); +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipTexture.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipTexture.compute.meta new file mode 100644 index 0000000..bea19e4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ClipTexture.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fb559b0e067b5464792b8e434189347c +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/CopyDepthIntoCache.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/CopyDepthIntoCache.shader new file mode 100644 index 0000000..c1a7f34 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/CopyDepthIntoCache.shader @@ -0,0 +1,4 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest" { } diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/CopyDepthIntoCache.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/CopyDepthIntoCache.shader.meta new file mode 100644 index 0000000..f0cc44c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/CopyDepthIntoCache.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cdf2728920d024e9fb0e708e1dc364bb +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthProbe.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthProbe.compute new file mode 100644 index 0000000..041882b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthProbe.compute @@ -0,0 +1,128 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Copies the depth buffer into the cache as object-space height. Object-space is +// used instead of world-space to allow relative movement of baked depth caches +// afterwards. It is converted to world-space in another shader before writing into +// the LOD data. + +#pragma kernel CrestCopy +#pragma kernel CrestFill + +#pragma multi_compile_local __ d_Crest_BackFaceInclusion + +#include "HLSLSupport.cginc" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + +Texture2D _CamDepthBuffer; +RWTexture2D _Crest_Target; + +#if d_Crest_BackFaceInclusion +Texture2D _Crest_CameraDepthBufferBackfaces; +#endif + +CBUFFER_START(CrestPerMaterial) +float4 _HeightNearHeightFar; +float4 _CustomZBufferParams; +float _HeightOffset; +float _Crest_PreviousPlane; +CBUFFER_END + +m_CrestNameSpace + +float CustomLinear01Depth(const float z) +{ + return (1.0 - z * _CustomZBufferParams.x) / _CustomZBufferParams.y; +} + +void Copy(const uint3 id) +{ + const float deviceDepth = _CamDepthBuffer[id.xy].x; + + // If geometry has been clipped by far plane, set the maximum depth. + if (deviceDepth <= 0.0) + { + _Crest_Target[id.xy] = -CREST_WATER_DEPTH_BASELINE; + return; + } + + const float linear01Z = CustomLinear01Depth(deviceDepth); + + const float altitude = +#if UNITY_REVERSED_Z + lerp(_HeightNearHeightFar.y, _HeightNearHeightFar.x, linear01Z); +#else + lerp(_HeightNearHeightFar.x, _HeightNearHeightFar.y, linear01Z); +#endif + + _Crest_Target[id.xy] = altitude - _HeightOffset; +} + +void Fill(const uint3 id) +{ + const float deviceDepth = _CamDepthBuffer[id.xy].x; + +#if d_Crest_BackFaceInclusion + const float deviceBackFaceDepth = _Crest_CameraDepthBufferBackfaces[id.xy].x; +#endif + + // If geometry has been clipped by far plane, set the maximum depth. + if (deviceDepth <= 0.0) + { +#if d_Crest_BackFaceInclusion + if (deviceBackFaceDepth <= 0.0) +#endif + { + return; + } + } + + // If not a hole, do not proceed. + // We must be limiteed by precision on trying to represent depth baseline + if (_Crest_Target[id.xy].x > -CREST_WATER_DEPTH_BASELINE) + { +#if d_Crest_BackFaceInclusion + if (deviceBackFaceDepth <= 0.0) +#endif + { + return; + } + } + + const float linear01Z = CustomLinear01Depth(deviceDepth); + + const float altitude = +#if UNITY_REVERSED_Z + lerp(_HeightNearHeightFar.y, _HeightNearHeightFar.x, linear01Z); +#else + lerp(_HeightNearHeightFar.x, _HeightNearHeightFar.y, linear01Z); +#endif + + +#if d_Crest_BackFaceInclusion + { + const float linear01Z = CustomLinear01Depth(deviceBackFaceDepth); + const float altitude = +#if UNITY_REVERSED_Z + lerp(_HeightNearHeightFar.y, _HeightNearHeightFar.x, linear01Z); +#else + lerp(_HeightNearHeightFar.x, _HeightNearHeightFar.y, linear01Z); +#endif + + // Check backfaces. + if (altitude > (_Crest_PreviousPlane + 0.00001)) + { + return; + } + } +#endif + + _Crest_Target[id.xy] = altitude - _HeightOffset; +} + +m_CrestNameSpaceEnd + +m_CrestKernelDefault(Copy) +m_CrestKernelDefault(Fill) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthProbe.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthProbe.compute.meta new file mode 100644 index 0000000..430d553 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthProbe.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6bb3e13f5a77e489584dd6fe9dd28a4f +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthTexture.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthTexture.compute new file mode 100644 index 0000000..e1076e0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthTexture.compute @@ -0,0 +1,70 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Draw cached world-space heights into current frame data. If heights are coming +// from an ODC, then they are in object-space and are converted to world-space as +// the LOD data stores world-space height. + +#pragma kernel CrestExecute + +#pragma multi_compile_local __ d_CrestSDF + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +#define m_CrestType float + +#if d_CrestSDF +#undef m_CrestType +#define m_CrestType float2 +#endif + +Texture2D _Crest_Texture; +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestInputTexture) +float2 _Crest_Multiplier; +float2 _Crest_TextureSize; +float2 _Crest_TexturePosition; +float2 _Crest_TextureRotation; +float _Crest_HeightOffset; +bool _Crest_SDF; +CBUFFER_END + +m_CrestNameSpace + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeDepth(id.z); + const float2 uv = DataIDToInputUV(id.xy, cascade, _Crest_TexturePosition, _Crest_TextureRotation, _Crest_TextureSize); + + // Check we are within bounds. + if (!WithinUV(uv)) + { + return; + } + + m_CrestType current = _Crest_Target[id]; + m_CrestType result = _Crest_Texture.SampleLevel(LODData_linear_clamp_sampler, uv, 0) * _Crest_Multiplier; + result.x += _Crest_HeightOffset; + + // Take highest terrain height. + result.x = max(current.x, result.x); + +#if d_CrestSDF + // Take shortest distance. + result.y = _Crest_SDF ? min(current.y, result.y) : current.y; +#endif + + _Crest_Target[id] = result; +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthTexture.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthTexture.compute.meta new file mode 100644 index 0000000..1ee3639 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/DepthTexture.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 025c29236eb8341f0a2078d93379be6a +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FlowTexture.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FlowTexture.compute new file mode 100644 index 0000000..72fe8af --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FlowTexture.compute @@ -0,0 +1,70 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Adds flow from a provided texture. Used by Painted and Texture input modes. + +#pragma kernel CrestExecute + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +Texture2D _Crest_Texture; +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +int _Crest_Blend; +float _Crest_Weight; +float2 _Crest_Multiplier; +float2 _Crest_TextureSize; +float2 _Crest_TexturePosition; +float2 _Crest_TextureRotation; +float _Crest_FeatherWidth; +bool _Crest_NegativeValues; +CBUFFER_END + +m_CrestNameSpace + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeFlow(id.z); + const float2 uv = DataIDToInputUV(id.xy, cascade, _Crest_TexturePosition, _Crest_TextureRotation, _Crest_TextureSize); + + half weight = _Crest_Weight; + + // Feather boundaries. + weight *= FeatherWeightFromUV(uv, _Crest_FeatherWidth); + + // Check we are within bounds. + if (weight <= 0.0) + { + return; + } + + float2 source = _Crest_Texture.SampleLevel(LODData_linear_clamp_sampler, uv, 0).xy; + + if (!_Crest_NegativeValues) + { + // From 0..1 to -1..1. + source = source * 2.0 - 1.0; + } + + source *= _Crest_Multiplier; + + if (_Crest_Blend == m_CrestBlendAlpha) + { + weight *= saturate(length(source)); + } + + const float2 target = _Crest_Target[id]; + _Crest_Target[id] = Blend(_Crest_Blend, weight, 1.0, source, target); +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FlowTexture.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FlowTexture.compute.meta new file mode 100644 index 0000000..3079478 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FlowTexture.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 67ee915fe51504dd894c5cbf6f1a7868 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FoamTexture.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FoamTexture.compute new file mode 100644 index 0000000..e92268b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FoamTexture.compute @@ -0,0 +1,57 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Adds foam from a provided texture. Used by Painted and Texture input modes. + +#pragma kernel CrestExecute + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +Texture2D _Crest_Texture; +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +int _Crest_Blend; +float _Crest_Weight; +float _Crest_Multiplier; +float2 _Crest_TextureSize; +float2 _Crest_TexturePosition; +float2 _Crest_TextureRotation; +float _Crest_FeatherWidth; +float _Crest_SimDeltaTime; +CBUFFER_END + +m_CrestNameSpace + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeFoam(id.z); + const float2 uv = DataIDToInputUV(id.xy, cascade, _Crest_TexturePosition, _Crest_TextureRotation, _Crest_TextureSize); + + half weight = _Crest_Weight; + + // Boundary check with feathering. + weight *= FeatherWeightFromUV(uv, _Crest_FeatherWidth); + + // Check we are within bounds. + if (weight <= 0.0) + { + return; + } + + const float source = _Crest_Texture.SampleLevel(LODData_linear_clamp_sampler, uv, 0).x * _Crest_Multiplier; + const float target = _Crest_Target[id]; + + _Crest_Target[id] = Blend(_Crest_Blend, weight, _Crest_SimDeltaTime, source, target); +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FoamTexture.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FoamTexture.compute.meta new file mode 100644 index 0000000..23a7b01 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/FoamTexture.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 69307e5986e134adc90ee257e7dba1ea +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/JumpFloodSDF.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/JumpFloodSDF.compute new file mode 100644 index 0000000..679d2fa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/JumpFloodSDF.compute @@ -0,0 +1,154 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// An implementation of the Jump Flood algorithm by Rong and Tan +// Source: https://www.comp.nus.edu.sg/~tants/jfa.html + +#pragma kernel CrestInitialize +#pragma kernel CrestExecute +#pragma kernel CrestApply + +#pragma multi_compile_local __ d_Crest_Inverted +#pragma multi_compile_local __ d_Crest_Standalone + +#include "HLSLSupport.cginc" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +CBUFFER_START(CrestPerMaterial) +uint _Crest_JumpSize; +uint _Crest_TextureSize; +float4x4 _Crest_ProjectionToWorld; +float _Crest_HeightOffset; +float _Crest_WaterLevel; +CBUFFER_END + +// Holds scene depth for initialization. +Texture2D _Crest_Source; +RWTexture2D _Crest_Target; + +// Setting this to zero means that geometry at exactly the origin won't be handled +// gracefully - but it would only affect a single-pixel in the worst-case and would +// doubtfully be noticable anyway. Use infinity instead. +#define m_CrestUninitializedPosition float2(m_Crest_PositiveInfinity, m_Crest_PositiveInfinity) + +#if d_Crest_Inverted +#define m_DepthCheck depth > 0.0 +#else +#define m_DepthCheck depth <= 0.0 +#endif + +m_CrestNameSpace + +bool IsUninitializedPosition(const float2 position) +{ + return isinf(position.x); +} + +float2 IDtoWorld(const uint2 id, const float resolution, const float4x4 projectionToWorld) +{ + float2 uv = (((id + 0.5) / resolution) - 0.5) * 2.0; + return mul(projectionToWorld, float4(uv, 0.0, 1.0)).xz; +} + +void Initialize(const uint3 id) +{ + float2 position = IDtoWorld(id.xy, _Crest_TextureSize, _Crest_ProjectionToWorld); + float depth = _Crest_WaterLevel - (_Crest_Source[id.xy].x + _Crest_HeightOffset); + +#ifndef d_Crest_Standalone + // Add height offset. + uint slice0; uint slice1; float alpha; + PosToSliceIndices(position, 0, g_Crest_LodCount - 1, g_Crest_WaterScale, slice0, slice1, alpha); + depth += lerp(Cascade::MakeLevel(slice0).SampleLevel(position), Cascade::MakeLevel(slice1).SampleLevel(position), alpha); +#endif + + _Crest_Target[id.xy] = m_DepthCheck ? position : m_CrestUninitializedPosition; +} + +void Execute(const uint3 id) +{ + float2 nearest = _Crest_Source[id.xy]; + + const uint3 jump = uint3(_Crest_JumpSize, -(int)_Crest_JumpSize, 0); + const bool xBounds = _Crest_TextureSize - _Crest_JumpSize > id.x; + const bool yBounds = _Crest_TextureSize - _Crest_JumpSize > id.y; + const bool zBounds = id.x >= _Crest_JumpSize; + const bool wBounds = id.y >= _Crest_JumpSize; + + float2 candidates[8]; + candidates[0] = yBounds ? _Crest_Source[id.xy + jump.zx] : nearest; + candidates[1] = yBounds && xBounds ? _Crest_Source[id.xy + jump.xx] : nearest; + candidates[2] = xBounds ? _Crest_Source[id.xy + jump.xz] : nearest; + candidates[3] = xBounds && wBounds ? _Crest_Source[id.xy + jump.xy] : nearest; + candidates[4] = wBounds ? _Crest_Source[id.xy + jump.zy] : nearest; + candidates[5] = wBounds && zBounds ? _Crest_Source[id.xy + jump.yy] : nearest; + candidates[6] = zBounds ? _Crest_Source[id.xy + jump.yz] : nearest; + candidates[7] = zBounds && yBounds ? _Crest_Source[id.xy + jump.yx] : nearest; + + const float2 position = IDtoWorld(id.xy, _Crest_TextureSize, _Crest_ProjectionToWorld); + const float2 displacement = nearest - position; + float distance2 = dot(displacement, displacement); + + for (uint i = 0; i < 8; i++) + { + if (IsUninitializedPosition(nearest)) + { + nearest = candidates[i]; + continue; + } + + const float2 candidateDisplacement = candidates[i] - position; + const float candidateDistance2 = dot(candidateDisplacement, candidateDisplacement); + + if (candidateDistance2 < distance2) + { + nearest = candidates[i]; + distance2 = candidateDistance2; + } + } + + _Crest_Target[id.xy] = nearest; +} + +void Apply(const uint3 id) +{ + float2 result = _Crest_Target[id.xy]; + float2 position = IDtoWorld(id.xy, _Crest_TextureSize, _Crest_ProjectionToWorld); + +#if d_Crest_Inverted + float depth = _Crest_WaterLevel - (result.x + _Crest_HeightOffset); + +#ifndef d_Crest_Standalone + // Get depth including height offset. + uint slice0; uint slice1; float alpha; + PosToSliceIndices(position, 0, g_Crest_LodCount - 1, g_Crest_WaterScale, slice0, slice1, alpha); + depth += lerp(Cascade::MakeLevel(slice0).SampleLevel(position), Cascade::MakeLevel(slice1).SampleLevel(position), alpha); +#endif + + // Do not overwrite positive SDF. + if (depth > 0) return; +#endif + + float2 nearest = _Crest_Source[id.xy]; + float2 displacement = nearest - position; + + float distance = length(displacement); + +#if d_Crest_Inverted + distance = -distance; +#endif + + result.y = distance; + + _Crest_Target[id.xy] = result; +} + +m_CrestNameSpaceEnd + +m_CrestKernelDefault(Initialize) +m_CrestKernelDefault(Execute) +m_CrestKernelDefault(Apply) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/JumpFloodSDF.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/JumpFloodSDF.compute.meta new file mode 100644 index 0000000..da0c4e6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/JumpFloodSDF.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 55a9b76c48b7343b2b66ed91a0619c29 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/LevelTexture.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/LevelTexture.compute new file mode 100644 index 0000000..be546e6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/LevelTexture.compute @@ -0,0 +1,65 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Adds height from a provided texture. Used by Painted and Texture input modes. + +#pragma kernel CrestExecute + +#pragma multi_compile_local __ d_CatmullRom + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Filtering.hlsl" + +m_DisplacementTexture(Texture2D, 4) _Crest_Texture; +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +int _Crest_Blend; +float _Crest_Weight; +float _Crest_Multiplier; +float2 _Crest_TextureSize; +float2 _Crest_TexturePosition; +float2 _Crest_TextureRotation; +float2 _Crest_Resolution; +CBUFFER_END + +m_CrestNameSpace + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeLevel(id.z); + const float2 uv = DataIDToInputUV(id.xy, cascade, _Crest_TexturePosition, _Crest_TextureRotation, _Crest_TextureSize); + + half weight = _Crest_Weight; + + // Feather boundaries. + weight *= FeatherWeightFromUV(uv, 0.0); + + // Check we are within bounds. + if (weight <= 0.0) + { + return; + } + +#if d_CatmullRom + const float source = Utility::SampleTextureCatmullRom(_Crest_Texture, LODData_linear_clamp_sampler, uv, _Crest_Resolution) +#else + const float source = _Crest_Texture.SampleLevel(LODData_linear_clamp_sampler, uv, 0.0) +#endif + .x * _Crest_Multiplier; + + const float target = _Crest_Target[id]; + + _Crest_Target[id] = Blend(_Crest_Blend, weight, 1.0, source, target); +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/LevelTexture.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/LevelTexture.compute.meta new file mode 100644 index 0000000..16e5c95 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/LevelTexture.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6bccbd92220dc418cacd3f17096c6b97 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ScatteringTexture.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ScatteringTexture.compute new file mode 100644 index 0000000..e44e43f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ScatteringTexture.compute @@ -0,0 +1,55 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestExecute + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +Texture2D _Crest_Texture; +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +int _Crest_Blend; +float _Crest_Weight; +float4 _Crest_Multiplier; +float2 _Crest_TextureSize; +float2 _Crest_TexturePosition; +float2 _Crest_TextureRotation; +float _Crest_FeatherWidth; +CBUFFER_END + +m_CrestNameSpace + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeScattering(id.z); + const float2 uv = DataIDToInputUV(id.xy, cascade, _Crest_TexturePosition, _Crest_TextureRotation, _Crest_TextureSize); + + half weight = _Crest_Weight; + + // Feather boundaries. + weight *= FeatherWeightFromUV(uv, _Crest_FeatherWidth); + + // Check we are within bounds. + if (weight <= 0.0) + { + return; + } + + const half4 source = _Crest_Texture.SampleLevel(LODData_linear_clamp_sampler, uv, 0) * _Crest_Multiplier; + const half3 target = _Crest_Target[id]; + weight *= source.a; + + _Crest_Target[id] = Blend(_Crest_Blend, weight, 1.0, source.xyz, target); +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ScatteringTexture.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ScatteringTexture.compute.meta new file mode 100644 index 0000000..d354c8d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/ScatteringTexture.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 78d6b75ecfb664f0cbb70001b1446627 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/SphereWaterInteraction.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/SphereWaterInteraction.compute new file mode 100644 index 0000000..29c37c6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/SphereWaterInteraction.compute @@ -0,0 +1,124 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestExecute + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerWaterInput) +float3 _Crest_Position; +float3 _Crest_Velocity; +float _Crest_SimDeltaTime; +float _Crest_Weight; +float _Crest_Radius; +float _Crest_InnerSphereOffset; +float _Crest_InnerSphereMultiplier; +float _Crest_LargeWaveMultiplier; +CBUFFER_END + +m_CrestNameSpace + +// Resolution-aware interaction falloff function, inspired by "bandfiltered step" +// from Ottosson. Basically adding together this falloff function at different +// scales generates a consistent result that doesn't grow into an ugly uintended +// shape. Shadertoy with more details: https://www.shadertoy.com/view/WltBWM +float InteractionFalloff(float a, float x) +{ + float ax = a * x; + float ax2 = ax * ax; + float ax4 = ax2 * ax2; + + return ax / (1.0 + ax2 * ax4); +} + +void SphereSDF(float2 offsetXZ, out float sdf, out float2 normal) +{ + float distance = length(offsetXZ); + sdf = distance - _Crest_Radius; + normal = distance > 0.0001 ? offsetXZ / distance : float2(1.0, 0.0); +} + +void Execute(uint3 id) +{ + const Cascade cascade = Cascade::MakeDynamicWaves(id.z); + + if (_Crest_LargeWaveMultiplier * _Crest_Radius < cascade._Texel) + { + return; + } + + float2 positionXZ = cascade.IDToWorld(id.xy); + float2 offsetXZ = positionXZ - _Crest_Position.xz; + + // Spherical culling. Check diameter for buffered area. + if (length(offsetXZ) > _Crest_Radius * 4.0) + { + return; + } + + // Feather at edges of LOD to reduce streaking without reflections. + half weight = _Crest_Weight * FeatherWeightFromUV(cascade.WorldToUV(positionXZ).xy, 0.1); + + // Check we are within bounds. + if (weight <= 0.0) + { + return; + } + + float minimumWavelength = Cascade::Make(id.z)._MaximumWavelength * 0.5; + + float sdf; + float2 sdfNormal; + SphereSDF(offsetXZ, sdf, sdfNormal); + + // Push in same direction as velocity inside sphere, and opposite direction outside. + float verticalForce = 0.0; + { + verticalForce = -_Crest_Velocity.y; + + // Range / radius of interaction force + const float a = 1.67 / minimumWavelength; + verticalForce *= InteractionFalloff( a, sdf ); + } + + // Push water up in direction of motion, pull down behind. + float horizontalForce = 0.0; + if (sdf > 0.0 || sdf < -_Crest_Radius * _Crest_InnerSphereOffset) + { + // Range / radius of interaction force. + const float a = 1.43 / minimumWavelength; + + // Invert within sphere, to balance / negate forces applied outside of sphere. + float forceSign = sign(sdf); + + horizontalForce = forceSign * dot(sdfNormal, _Crest_Velocity.xz) * InteractionFalloff(a, abs(sdf)); + + // If inside sphere, add an additional weight. + if (sdf < 0.0) + { + horizontalForce *= _Crest_InnerSphereMultiplier; + } + } + + // Add to velocity (y-channel) to accelerate water. Magic number was the default + // value for _Strength which has been removed. + float acceleration = weight * (verticalForce + horizontalForce) * 0.2; + + // Helps interaction to work at different scales + acceleration /= minimumWavelength; + + _Crest_Target[id] = float2(_Crest_Target[id].x, _Crest_Target[id].y + acceleration * _Crest_SimDeltaTime); +} + +m_CrestNameSpaceEnd + +m_CrestInputKernelDefault(Execute) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/SphereWaterInteraction.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/SphereWaterInteraction.compute.meta new file mode 100644 index 0000000..3d7d9a0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Hidden/SphereWaterInteraction.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 98fb0af5d79724a2c945809b974524eb +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Override.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Override.shader new file mode 100644 index 0000000..c8def22 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Override.shader @@ -0,0 +1,54 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/All/Override" +{ + Properties + { + [Enum(ColorWriteMask)] + _Crest_ColorMask("Color Mask", Int) = 15 + _Crest_Value("Value", Vector) = (1, 1, 1, 1) + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend Off + ColorMask [_Crest_ColorMask] + + CGPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "UnityCG.cginc" + + CBUFFER_START(CrestPerWaterInput) + float3 _Crest_DisplacementAtInputPosition; + half4 _Crest_Value; + half _Crest_Weight; + CBUFFER_END + + float4 Vertex(float3 positionOS : POSITION) : SV_POSITION + { + float3 positionWS = mul(unity_ObjectToWorld, float4(positionOS, 1.0)).xyz; + // Correct for displacement. + positionWS.xz -= _Crest_DisplacementAtInputPosition.xz; + return mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); + } + + half4 Fragment() : SV_Target + { + return _Crest_Value * _Crest_Weight; + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Override.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Override.shader.meta new file mode 100644 index 0000000..57bf132 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Override.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 288a089f90e714983b8a760dd49e5a5c +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Scale.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Scale.shader new file mode 100644 index 0000000..6887094 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Scale.shader @@ -0,0 +1,132 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// 0-1 scaling of existing water data using multiplicative blending. + +Shader "Crest/Inputs/All/Scale" +{ + Properties + { + // Scale the water data. Zero is no data and one leaves data untouched. + _Crest_Scale("Scale", Range(0, 1)) = 0.35 + + // Use the texture instead of the scale value. + [Toggle(d_Texture)] + _Crest_ApplyTexture("Apply Texture", Float) = 0 + [MainTexture] _Crest_Texture("Texture", 2D) = "black" {} + + // Inverts the scale value. + [Toggle(d_Invert)] + _Crest_Invert("Invert", Float) = 0 + + [Header(Feather)] + // Feather the edges of the mesh using the texture coordinates. Easiest to understand with a plane. + [Toggle(d_Feather)] + _Crest_Feather("Feather At UV Extents", Float) = 0 + // How far from edge to feather. + _Crest_FeatherWidth("Feather Width", Range(0.001, 0.5)) = 0.1 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + // Multiply + Blend Zero SrcColor + + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #pragma shader_feature_local d_Texture + #pragma shader_feature_local d_Feather + #pragma shader_feature_local_fragment d_Invert + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + +#if defined(d_Texture) || defined(d_Feather) +#define _NEED_UVS +#endif + +#if d_Texture + Texture2D _Crest_Texture; + SamplerState sampler_Crest_Texture; +#endif + + CBUFFER_START(CrestPerWaterInput) + float _Crest_Weight; + float3 _Crest_DisplacementAtInputPosition; + float _Crest_Scale; +#if d_Feather + half _Crest_FeatherWidth; +#endif +#if d_Texture + float4 _Crest_Texture_ST; +#endif + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; +#ifdef _NEED_UVS + float2 uv : TEXCOORD0; +#endif + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; +#ifdef _NEED_UVS + float2 uv : TEXCOORD0; +#endif + }; + + Varyings Vert(Attributes input) + { + Varyings o; + + float3 positionWS = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement. + positionWS.xz -= _Crest_DisplacementAtInputPosition.xz; + o.positionCS = mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); + +#ifdef _NEED_UVS + o.uv = input.uv; +#endif + + return o; + } + + half4 Frag(Varyings input) : SV_Target + { +#if d_Texture + float scale = _Crest_Texture.Sample(sampler_Crest_Texture, input.uv).r; +#else + float scale = _Crest_Scale; +#endif + +#if d_Invert + scale = 1.0 - scale; +#endif + +#if d_Feather + scale = lerp(1.0, scale, WaveHarmonic::Crest::FeatherWeightFromUV(input.uv, _Crest_FeatherWidth)); +#endif + + return scale * _Crest_Weight; + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Scale.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Scale.shader.meta new file mode 100644 index 0000000..bc167f6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Scale.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cbf67e7cbdc0a4cc09a539707e0007b9 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ScatteringColor.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ScatteringColor.shader new file mode 100644 index 0000000..a26d043 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ScatteringColor.shader @@ -0,0 +1,84 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/Scattering/Color" +{ + Properties + { + _Crest_Scattering("Scattering", Color) = (0.0, 0.09803921729326248, 0.20000000298023225, 0.0) + + [Toggle(d_Feather)] + _Crest_Feather("Feather At UV Extents", Float) = 0 + _Crest_FeatherWidth("Feather Width", Range(0.001, 0.5)) = 0.1 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend SrcAlpha OneMinusSrcAlpha + ColorMask RGB + + CGPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #pragma shader_feature_local d_Feather + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + + struct Attributes + { + float3 vertex : POSITION; +#if d_Feather + float2 uv : TEXCOORD0; +#endif + }; + + struct Varyings + { + float4 vertex : SV_POSITION; +#if d_Feather + float2 uv : TEXCOORD0; +#endif + }; + + CBUFFER_START(CrestPerWaterInput) + half4 _Crest_Scattering; + half _Crest_FeatherWidth; + CBUFFER_END + + Varyings Vertex(Attributes input) + { + Varyings output; + float3 positionWS = mul(unity_ObjectToWorld, float4(input.vertex, 1.0)).xyz; + output.vertex = mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); +#if d_Feather + output.uv = input.uv; +#endif + return output; + } + + float4 Fragment(Varyings input) : SV_Target + { + half4 color = _Crest_Scattering; + color.a = 1.0; +#if d_Feather + color.a *= WaveHarmonic::Crest::FeatherWeightFromUV(input.uv, _Crest_FeatherWidth); +#endif + + return color; + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ScatteringColor.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ScatteringColor.shader.meta new file mode 100644 index 0000000..a1ce0a5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ScatteringColor.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ea69fc35da7574631aea97812ee8652b +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ShapeWavesFromGeometry.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ShapeWavesFromGeometry.shader new file mode 100644 index 0000000..270a413 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ShapeWavesFromGeometry.shader @@ -0,0 +1,192 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Generates waves from geometry that is rendered into the water simulation from a top down camera. Expects +// following data on verts: +// - POSITION: Vert positions as normal. +// - TEXCOORD0: Axis - direction for waves to travel. "Forward vector" for waves. +// - TEXCOORD1: X - 0 at start of waves, 1 at end of waves +// +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ uv1.x = 0 | +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | uv0 - wave direction vector +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | \|/ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ uv1.x = 1 +// ------------------- shoreline -------------------- +// + +Shader "Crest/Inputs/Shape Waves/Add From Geometry" +{ + Properties + { + [Enum(UnityEngine.Rendering.BlendMode)] + _Crest_BlendModeSource("Source Blend Mode", Int) = 1 + [Enum(UnityEngine.Rendering.BlendMode)] + _Crest_BlendModeTarget("Target Blend Mode", Int) = 1 + + // Controls ramp distance over which waves grow/fade as they move forwards + _Crest_FeatherWaveStart( "Feather wave start (0-1)", Range( 0.0, 10 ) ) = 0.1 + + [Toggle(d_Feather)] + _Crest_Feather("Feather At UV Extents", Float) = 0 + _Crest_FeatherWidth("Feather Width", Range(0.001, 1)) = 0.1 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + CGINCLUDE + #pragma vertex Vertex + #pragma fragment Fragment + // #pragma enable_d3d11_debug_symbols + + #pragma shader_feature_local_fragment d_Feather + + #include "UnityCG.cginc" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + + Texture2DArray _Crest_WaveBuffer; + + CBUFFER_START(CrestPerWaterInput) + float _Crest_RespectShallowWaterAttenuation; + int _Crest_WaveBufferSliceIndex; + float _Crest_AverageWavelength; + float _Crest_AttenuationInShallows; + float _Crest_Weight; + float2 _Crest_AxisX; + half _Crest_MaximumAttenuationDepth; + half _Crest_FeatherWidth; + half _Crest_FeatherWaveStart; + CBUFFER_END + + m_CrestNameSpace + + struct Attributes + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 vertex : SV_POSITION; + float2 uv : TEXCOORD0; + float3 uv_slice : TEXCOORD1; + float2 axis : TEXCOORD2; + float3 worldPosScaled : TEXCOORD3; + float2 worldPosXZ : TEXCOORD5; + }; + + Varyings Vertex(Attributes v) + { + Varyings o; + + const float3 positionOS = v.vertex.xyz; + o.vertex = UnityObjectToClipPos(positionOS); + const float3 worldPos = mul( unity_ObjectToWorld, float4(positionOS, 1.0) ).xyz; + + // UV coordinate into the cascade we are rendering into + o.uv_slice = Cascade::MakeAnimatedWaves(_Crest_LodIndex).WorldToUV(worldPos.xz); + + o.worldPosXZ = worldPos.xz; + + o.uv = v.uv; + + // World pos prescaled by wave buffer size, suitable for using as UVs in fragment shader + const float waveBufferSize = 0.5f * (1 << _Crest_WaveBufferSliceIndex); + o.worldPosScaled = worldPos / waveBufferSize; + + // Rotate forward axis around y-axis into world space + o.axis = unity_ObjectToWorld._m00_m20.xy; + o.axis = _Crest_AxisX.x * o.axis + _Crest_AxisX.y * float2(-o.axis.y, o.axis.x); + + return o; + } + + float4 Fragment(Varyings input) + { + float wt = _Crest_Weight; + + // Feature at away from shore. + wt *= saturate(input.uv.x / _Crest_FeatherWaveStart); + +#if d_Feather + wt *= FeatherWeightFromUV(input.uv, _Crest_FeatherWidth); +#endif + + float alpha = wt; + + // Attenuate if depth is less than half of the average wavelength + const half depth = Cascade::MakeDepth(_Crest_LodIndex).SampleSignedDepthFromSeaLevel(input.worldPosXZ) + + Cascade::MakeLevel(_Crest_LodIndex).SampleLevel(input.worldPosXZ); + half depth_wt = saturate(2.0 * depth / _Crest_AverageWavelength); + if (_Crest_MaximumAttenuationDepth < k_Crest_MaximumWaveAttenuationDepth) + { + depth_wt = lerp(depth_wt, 1.0, saturate(depth / _Crest_MaximumAttenuationDepth)); + } + const float attenuationAmount = _Crest_AttenuationInShallows * _Crest_RespectShallowWaterAttenuation; + wt *= attenuationAmount * depth_wt + (1.0 - attenuationAmount); + + // Quantize wave direction and interpolate waves + float axisHeading = atan2( input.axis.y, input.axis.x ) + 2.0 * 3.141592654; + const float dTheta = 0.5*0.314159265; + float angle0 = axisHeading; + const float rem = fmod( angle0, dTheta ); + angle0 -= rem; + const float angle1 = angle0 + dTheta; + + float2 axisX0; sincos( angle0, axisX0.y, axisX0.x ); + float2 axisX1; sincos( angle1, axisX1.y, axisX1.x ); + float2 axisZ0; axisZ0.x = -axisX0.y; axisZ0.y = axisX0.x; + float2 axisZ1; axisZ1.x = -axisX1.y; axisZ1.y = axisX1.x; + + const float2 uv0 = float2(dot( input.worldPosScaled.xz, axisX0 ), dot( input.worldPosScaled.xz, axisZ0 )); + const float2 uv1 = float2(dot( input.worldPosScaled.xz, axisX1 ), dot( input.worldPosScaled.xz, axisZ1 )); + + // Sample displacement, rotate into frame + float3 disp0 = _Crest_WaveBuffer.SampleLevel( sampler_Crest_linear_repeat, float3(uv0, _Crest_WaveBufferSliceIndex), 0 ).xyz; + float3 disp1 = _Crest_WaveBuffer.SampleLevel( sampler_Crest_linear_repeat, float3(uv1, _Crest_WaveBufferSliceIndex), 0 ).xyz; + disp0.xz = disp0.x * axisX0 + disp0.z * axisZ0; + disp1.xz = disp1.x * axisX1 + disp1.z * axisZ1; + float3 disp = lerp( disp0, disp1, rem / dTheta ); + + disp *= wt; + + return float4(disp, alpha); + } + + m_CrestNameSpaceEnd + + m_CrestVertex + m_CrestFragment(float4) + ENDCG + + SubShader + { + ZWrite Off + ZTest Always + Cull Off + + Pass + { + // Either additive or alpha blend for geometry waves. + Blend [_Crest_BlendModeSource] [_Crest_BlendModeTarget] + CGPROGRAM + ENDCG + } + + Pass + { + // Subsequent draws need to be additive. We cannot change render state with command + // buffer and changing on material is not aligned with command buffer usage. + Blend One One + CGPROGRAM + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ShapeWavesFromGeometry.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ShapeWavesFromGeometry.shader.meta new file mode 100644 index 0000000..2498f32 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/ShapeWavesFromGeometry.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 95ec6475fc33247d4b80d07df23f2748 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Utility.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Utility.shader new file mode 100644 index 0000000..d250ac2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Utility.shader @@ -0,0 +1,57 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Inputs/All/Utility" +{ + Properties + { + [Enum(UnityEngine.Rendering.BlendMode)] _Crest_BlendModeSource("Source Blend Mode", Int) = 1 + [Enum(UnityEngine.Rendering.BlendMode)] _Crest_BlendModeTarget("Target Blend Mode", Int) = 1 + [Enum(UnityEngine.Rendering.BlendOp)] _Crest_BlendOperation("Blend Operation", Int) = 0 + [Enum(UnityEngine.Rendering.ColorWriteMask)] _Crest_ColorMask("Color Mask", Int) = 15 + _Crest_Value("Value", Vector) = (1, 1, 1, 1) + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend [_Crest_BlendModeSource] [_Crest_BlendModeTarget] + BlendOp [_Crest_BlendOperation] + ColorMask [_Crest_ColorMask] + + CGPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "UnityCG.cginc" + + CBUFFER_START(CrestPerWaterInput) + float3 _Crest_DisplacementAtInputPosition; + half4 _Crest_Value; + half _Crest_Weight; + CBUFFER_END + + float4 Vertex(float3 positionOS : POSITION) : SV_POSITION + { + float3 positionWS = mul(unity_ObjectToWorld, float4(positionOS, 1.0)).xyz; + // Correct for displacement. + positionWS.xz -= _Crest_DisplacementAtInputPosition.xz; + return mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); + } + + half4 Fragment() : SV_Target + { + return _Crest_Value * _Crest_Weight; + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Utility.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Utility.shader.meta new file mode 100644 index 0000000..7e24444 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/Utility.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 27b6f889dcd1b4d20919255e69078a08 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterDepthFromGeometry.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterDepthFromGeometry.shader new file mode 100644 index 0000000..cc8279c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterDepthFromGeometry.shader @@ -0,0 +1,57 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Renders water depth - signed distance from sea level to sea floor +Shader "Crest/Inputs/Depth/Water Depth From Geometry" +{ + Properties + { + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + BlendOp Max + ColorMask R + + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #include "UnityCG.cginc" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" + + struct Attributes + { + float3 positionOS : POSITION; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float terrainHeight : TEXCOORD0; + }; + + Varyings Vert(Attributes input) + { + Varyings o; + o.positionCS = UnityObjectToClipPos(input.positionOS); + o.terrainHeight = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).y; + return o; + } + + float4 Frag(Varyings input) : SV_Target + { + return float4(input.terrainHeight, 0.0, 0.0, 0.0); + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterDepthFromGeometry.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterDepthFromGeometry.shader.meta new file mode 100644 index 0000000..500abbc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterDepthFromGeometry.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a8aeab41790ee4cb1b72e19aa4a7a1ad +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterLevelFromGeometry.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterLevelFromGeometry.shader new file mode 100644 index 0000000..d21749a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterLevelFromGeometry.shader @@ -0,0 +1,74 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// This sets base water height to Y value of geometry. + +Shader "Crest/Inputs/Level/Water Level From Geometry" +{ + Properties + { + [Enum(UnityEngine.Rendering.BlendMode)] _Crest_BlendSource("Source Blend Mode", Int) = 1 + [Enum(UnityEngine.Rendering.BlendMode)] _Crest_BlendTarget("Target Blend Mode", Int) = 0 + [Enum(UnityEngine.Rendering.BlendOp)] _Crest_BlendOperation("Blend Operation", Int) = 0 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + } + + SubShader + { + ZTest Always + ZWrite Off + + Pass + { + Blend [_Crest_BlendSource] [_Crest_BlendTarget] + BlendOp [_Crest_BlendOperation] + + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + + #include "UnityCG.cginc" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + + CBUFFER_START(CrestPerWaterInput) + float3 _Crest_DisplacementAtInputPosition; + half _Crest_Weight; + CBUFFER_END + + struct Attributes + { + float3 positionOS : POSITION; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float3 worldPos : TEXCOORD0; + }; + + Varyings Vert(Attributes input) + { + Varyings o; + + o.worldPos = mul(unity_ObjectToWorld, float4(input.positionOS, 1.0)).xyz; + // Correct for displacement + o.worldPos.xz -= _Crest_DisplacementAtInputPosition.xz; + + o.positionCS = mul(UNITY_MATRIX_VP, float4(o.worldPos, 1.0)); + + return o; + } + + half4 Frag(Varyings input) : SV_Target + { + // Write displacement to get from sea level of water to the y value of this geometry + const float heightOffset = input.worldPos.y - g_Crest_WaterCenter.y; + return heightOffset * _Crest_Weight; + } + ENDCG + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterLevelFromGeometry.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterLevelFromGeometry.shader.meta new file mode 100644 index 0000000..1ff8c47 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Input/WaterLevelFromGeometry.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 06402bee7075b4b9fafef2b1ddf3b5cc +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/PackLevel.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/PackLevel.compute new file mode 100644 index 0000000..51a96d4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/PackLevel.compute @@ -0,0 +1,32 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestPackLevel + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +RWTexture2DArray _Crest_Target; + +m_CrestNameSpace + +void PackLevel(uint3 id) +{ + float4 displacement = _Crest_Target[id]; + + // Previously, in the water shader, we would sample the offset at the displaced + // position so we need to do the same here to simulate that. + const float2 position = Cascade::MakeAnimatedWaves(id.z).IDToWorld(id.xy); + displacement.a = Cascade::MakeLevel(id.z).SampleLevel(position + displacement.xz); + + _Crest_Target[id] = displacement; +} + +m_CrestNameSpaceEnd + +m_CrestKernelDefault(PackLevel) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/PackLevel.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/PackLevel.compute.meta new file mode 100644 index 0000000..efa6fda --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/PackLevel.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 62854cc297743429aa087d7708d221c0 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query.meta new file mode 100644 index 0000000..c4c0843 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3649a5e721fa420f9b546578f3987a1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/Query.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/Query.compute new file mode 100644 index 0000000..f327e7f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/Query.compute @@ -0,0 +1,102 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestQueryDisplacement d_CrestDisplacement +#pragma kernel CrestQueryFlow d_CrestFlow +#pragma kernel CrestQueryDepth d_CrestDepth + +// Must match value in script. +#define GROUP_SIZE 64 + +StructuredBuffer _Crest_QueryPositions_MinimumGridSizes; +RWStructuredBuffer _Crest_Target; + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +#if d_CrestDisplacement +#define d_CrestSample SampleDisplacement +#define d_CrestMake MakeAnimatedWaves +#define d_CrestComponents float3 +#define d_CrestReturn result +#elif d_CrestDepth +#define d_CrestSample SampleSignedDepthFromSeaLevelAndDistance +#define d_CrestMake MakeDepth +#define d_CrestComponents float2 +#define d_CrestReturn float3(result.x, result.y, 0.0) +#else +#define d_CrestSample SampleFlow +#define d_CrestMake MakeFlow +#define d_CrestComponents float2 +// Unfortunately we don't support float2 vs float3s yet, on the C# side +#define d_CrestReturn float3(result.x, 0.0, result.y) +#endif + +m_CrestNameSpace + + +float3 Compute(const float2 i_Position, const float i_MinimumSlice, const float i_BaseScale) +{ + // Do not use last slice - this is a 'transition' slice used to cross-fade waves + // between LOD resolutions to avoid pops. That being said, this will have clamped + // samples leading to objects floating on waves that do not exist. + uint slice0, slice1; float alpha; + PosToSliceIndices(i_Position, i_MinimumSlice, g_Crest_LodCount - 2.0, i_BaseScale, slice0, slice1, alpha); + + const Cascade cascade0 = Cascade::d_CrestMake(slice0); + const Cascade cascade1 = Cascade::d_CrestMake(slice1); + + const float weight0 = (1.0 - alpha) * Cascade::Make(slice0)._Weight; + const float weight1 = (1.0 - weight0) * Cascade::Make(slice1)._Weight; + + d_CrestComponents result = + weight0 * cascade0.d_CrestSample(i_Position) + + weight1 * cascade1.d_CrestSample(i_Position); + + return d_CrestReturn; +} + +void Query(const uint3 id) +{ + const float3 data = _Crest_QueryPositions_MinimumGridSizes[id.x]; + const float minimumGridSize = data.z; + float2 position = data.xy; + + const float gridSizeSlice0 = Cascade::d_CrestMake(0)._Texel; + // Displacements should not utilize the last slice which is used for transitioning + // waves between sampling resolutions. While it might be ok to use the last slice + // for other targets, we avoid using it to be consistent with displacements. + const float minimumSlice = clamp(floor(log2(max(minimumGridSize / gridSizeSlice0, 1.0))), 0.0, g_Crest_LodCount - 2.0); + +#if d_CrestDisplacement + // Perform iteration to invert the displacement vector field - find position that displaces to query position, + // and return displacement at that point. + float2 undisplaced = position; + for (int i = 0; i < 4; i++) + { + const float3 displacement = Compute(undisplaced, minimumSlice, g_Crest_WaterScale); + const float2 error = (undisplaced + displacement.xz) - position; + undisplaced -= error; + } + + position = undisplaced; +#endif + + _Crest_Target[id.x] = Compute(position, minimumSlice, g_Crest_WaterScale); +} + +m_CrestNameSpaceEnd + +[numthreads(GROUP_SIZE, 1, 1)] +m_CrestKernelVariant(Query, Displacement) + +[numthreads(GROUP_SIZE, 1, 1)] +m_CrestKernelVariant(Query, Flow) + +[numthreads(GROUP_SIZE, 1, 1)] +m_CrestKernelVariant(Query, Depth) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/Query.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/Query.compute.meta new file mode 100644 index 0000000..3ca3dba --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/Query.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7089d2ff99e0e4c9a94ef7c4711d5524 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryDisplacements.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryDisplacements.compute new file mode 100644 index 0000000..8991294 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryDisplacements.compute @@ -0,0 +1,8 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Merged into Query.compute. + +#pragma kernel CrestExecute +[numthreads(1, 1, 1)] +void CrestExecute(uint3 id : SV_DispatchThreadID) { } diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryDisplacements.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryDisplacements.compute.meta new file mode 100644 index 0000000..4869983 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryDisplacements.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 10bebb70ef1ea46d0b8babd5dda216bb +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryFlow.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryFlow.compute new file mode 100644 index 0000000..8991294 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryFlow.compute @@ -0,0 +1,8 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Merged into Query.compute. + +#pragma kernel CrestExecute +[numthreads(1, 1, 1)] +void CrestExecute(uint3 id : SV_DispatchThreadID) { } diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryFlow.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryFlow.compute.meta new file mode 100644 index 0000000..9b049e7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/Query/QueryFlow.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d20424c840cb64d6e93f9b46e9c2353d +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShapeCombine.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShapeCombine.compute new file mode 100644 index 0000000..30efd0f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShapeCombine.compute @@ -0,0 +1,179 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Compute shader to perform combine of displacements. Reads and writes to texture array which saves +// needing to do ping pong of render targets. Unfortunately reading/writing float4s is not supported +// on pre-DX11.3 hardware (aka typed UAV loads), so this path is not the default, for now.. + +#pragma kernel ShapeCombine +#pragma kernel ShapeCombine_DISABLE_COMBINE _DISABLE_COMBINE +#pragma kernel ShapeCombine_FLOW_ON _FLOW_ON +#pragma kernel ShapeCombine_FLOW_ON_DISABLE_COMBINE _FLOW_ON _DISABLE_COMBINE +#pragma kernel ShapeCombine_DYNAMIC_WAVE_SIM_ON _DYNAMIC_WAVE_SIM_ON +#pragma kernel ShapeCombine_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE _DYNAMIC_WAVE_SIM_ON _DISABLE_COMBINE +#pragma kernel ShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON _FLOW_ON _DYNAMIC_WAVE_SIM_ON +#pragma kernel ShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE _FLOW_ON _DYNAMIC_WAVE_SIM_ON _DISABLE_COMBINE +#pragma kernel ShapeCombineDynamicWaves +#pragma kernel ShapeCombineDynamicWaves_DISABLE_COMBINE _DISABLE_COMBINE +#pragma kernel ShapeCombineCopyDynamicWaves + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +float _Crest_HorizontalDisplace; +float _Crest_DisplaceClamp; + +Texture2DArray _Crest_WaveBuffer; +RWTexture2DArray _Crest_Target; +RWTexture2DArray _Crest_DynamicWavesTarget; +RWTexture2DArray _Crest_AnimatedWavesTarget; + +m_CrestNameSpace + +void Flow(const float texel, out float2 offsets, out float2 weights) +{ + const float period = max(3.0 * texel, 1.0); + const float half_period = period / 2.0; + offsets = fmod(float2(g_Crest_Time, g_Crest_Time + half_period), period); + weights.x = offsets.x / half_period; + if (weights.x > 1.0) weights.x = 2.0 - weights.x; + weights.y = 1.0 - weights.x; +} + +void SampleDisplacementsCompute( + in RWTexture2DArray i_dispSampler, + in float i_resolution, in float3 i_uv_slice, + in float i_wt, inout float3 io_worldPos +) { + // NOTE: We have to roll our own bilinear filter in Compute shaders when + // reading from a RWTexture. The documentation below explains how SRV + // and UAV mappings of the same texture cannot exist at the same time. + // https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/sm5-object-rwtexture2d + + // Convert from UV to coordinates + const float2 pixelCoord = i_uv_slice.xy * i_resolution; + + // Make relative to pixel centers + float2 pixelCoordCenters = pixelCoord - 0.5; + + // Clamp from below and above (desired?) + pixelCoordCenters = clamp(pixelCoordCenters, 0.0, i_resolution - 1.0); + + // Compute integral and fractional parts + const uint2 pixelCoordCentersBotLeft = floor(pixelCoordCenters); + const uint sliceIndex = i_uv_slice.z; + const float2 pixelCoordCentersFrac = frac(pixelCoordCenters); + + const half4 dataBotLeft = i_dispSampler[uint3(pixelCoordCentersBotLeft, sliceIndex)]; + const half4 dataBotRight = i_dispSampler[uint3(pixelCoordCentersBotLeft + uint2(1, 0), sliceIndex)]; + const half4 dataTopLeft = i_dispSampler[uint3(pixelCoordCentersBotLeft + uint2(0, 1), sliceIndex)]; + const half4 dataTopRight = i_dispSampler[uint3(pixelCoordCentersBotLeft + uint2(1, 1), sliceIndex)]; + + const float4 dataLerped = lerp( + lerp(dataBotLeft, dataBotRight, pixelCoordCentersFrac.x), + lerp(dataTopLeft, dataTopRight, pixelCoordCentersFrac.x), + pixelCoordCentersFrac.y + ); + + io_worldPos += i_wt * dataLerped.xyz; +} + +void ShapeCombineBase(uint3 id) +{ + const uint slice0 = _Crest_LodIndex; + const Cascade cascade = Cascade::MakeAnimatedWaves(slice0); + + const float3 uv = cascade.IDToUV(id.xy); + const float2 positionWSXZ = cascade.UVToWorld(uv); + + float3 result = 0.0; + + // Sample in waves for this cascade. + { +#if _FLOW_ON + const half2 flow = Cascade::MakeFlow(slice0).SampleFlow(positionWSXZ); + + float2 offsets, weights; + Flow(cascade._Texel, offsets, weights); + + result += cascade.Sample(_Crest_WaveBuffer, positionWSXZ - offsets[0] * flow).xyz * weights[0]; + result += cascade.Sample(_Crest_WaveBuffer, positionWSXZ - offsets[1] * flow).xyz * weights[1]; +#else + result += cascade.Sample(_Crest_WaveBuffer, uv).xyz; +#endif // _FLOW_ON + } + + // Disabled for last LOD. +#if !_DISABLE_COMBINE + { + const Cascade cascade = Cascade::MakeAnimatedWaves(slice0 + 1); + // Sample the shape 1 texture at this world position. + const float3 uv = cascade.WorldToUV(positionWSXZ); + // Waves to combine down from the next lod up the chain. + SampleDisplacementsCompute(_Crest_Target, cascade._Resolution, uv, 1.0, result); + } +#endif + +#if _DYNAMIC_WAVE_SIM_ON + { + // Convert dynamic wave sim to displacements. + result += Cascade::MakeDynamicWaves(slice0) + .SampleDynamicWavesDisplacement(positionWSXZ, _Crest_HorizontalDisplace, _Crest_DisplaceClamp); + } +#endif // _DYNAMIC_WAVE_SIM_ON + + _Crest_Target[uint3(id.xy, slice0)] = float4(result, 0.0); +} + +void ShapeCombineDynamicWaves(uint3 id) +{ + const uint slice0 = _Crest_LodIndex; + const Cascade cascade = Cascade::MakeAnimatedWaves(slice0); + const float3 uv = cascade.IDToUV(id.xy); + const float2 positionWSXZ = cascade.UVToWorld(uv); + float3 result = 0.0; + + // Disabled for last LOD. +#if !_DISABLE_COMBINE + { + // We are sampling from the target which matches Animated Waves descriptor. + const Cascade cascade = Cascade::MakeAnimatedWaves(slice0 + 1); + const float3 uv = cascade.WorldToUV(positionWSXZ); + // Waves to combine down from the next lod up the chain. + SampleDisplacementsCompute(_Crest_DynamicWavesTarget, cascade._Resolution, uv, 1.0, result); + } +#endif + + { + // We are sampling from Dynamic Waves. + const Cascade cascade = Cascade::MakeDynamicWaves(slice0); + const float3 uv = cascade.WorldToUV(positionWSXZ); + result += cascade.SampleDynamicWavesDisplacement(uv, _Crest_HorizontalDisplace, _Crest_DisplaceClamp); + } + + _Crest_DynamicWavesTarget[uint3(id.xy, slice0)] = float4(result, 0.0); +} + +void ShapeCombineCopyDynamicWaves(uint3 id) +{ + _Crest_AnimatedWavesTarget[id] += _Crest_DynamicWavesTarget[id]; +} + +m_CrestNameSpaceEnd + +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombine(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineBase(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombine_DISABLE_COMBINE(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineBase(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombine_FLOW_ON(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineBase(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombine_FLOW_ON_DISABLE_COMBINE(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineBase(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombine_DYNAMIC_WAVE_SIM_ON(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineBase(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombine_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineBase(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineBase(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombine_FLOW_ON_DYNAMIC_WAVE_SIM_ON_DISABLE_COMBINE(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineBase(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombineDynamicWaves(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineDynamicWaves(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombineDynamicWaves_DISABLE_COMBINE(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineDynamicWaves(id); } +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void ShapeCombineCopyDynamicWaves(uint3 id : SV_DispatchThreadID) { m_Crest::ShapeCombineCopyDynamicWaves(id); } diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShapeCombine.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShapeCombine.compute.meta new file mode 100644 index 0000000..ff7ea5a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShapeCombine.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 02a2fc6716dfd4730a8c689ce364f132 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShorelineColor.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShorelineColor.compute new file mode 100644 index 0000000..46dff08 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShorelineColor.compute @@ -0,0 +1,51 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestShorelineColor + +#pragma multi_compile_local __ d_Crest_ShorelineColorSource_ShorelineDistance +#pragma multi_compile_local __ d_Crest_ShorelineScattering + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +float _Crest_ShorelineColorMaximumDistance; +float _Crest_ShorelineColorFalloff; +half3 _Crest_ShorelineColor; +CBUFFER_END + +m_CrestNameSpace + +void ShorelineColor(uint3 id) +{ + const uint slice0 = id.z; + const Cascade cascade = +#if d_Crest_ShorelineScattering + Cascade::MakeScattering(slice0); +#else + Cascade::MakeAbsorption(slice0); +#endif + const float2 worldXZ = cascade.IDToWorld(id.xy); + + const half depth = Cascade::MakeDepth(slice0) +#if d_Crest_ShorelineColorSource_ShorelineDistance + .SampleShorelineDistance(worldXZ); +#else + .SampleSignedDepthFromSeaLevel(worldXZ); +#endif + + const float shallowness = pow(1.0 - saturate(depth / _Crest_ShorelineColorMaximumDistance), _Crest_ShorelineColorFalloff); + _Crest_Target[id] = lerp(_Crest_Target[id], _Crest_ShorelineColor, shallowness); +} + +m_CrestNameSpaceEnd + +m_CrestKernelDefault(ShorelineColor) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShorelineColor.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShorelineColor.compute.meta new file mode 100644 index 0000000..0c45bc7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/ShorelineColor.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 690b406e28d9a4abb842f6e39c9dc582 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateDynamicWaves.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateDynamicWaves.compute new file mode 100644 index 0000000..466ac35 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateDynamicWaves.compute @@ -0,0 +1,150 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Solves 2D wave equation + +#pragma kernel CrestUpdateDynamicWaves + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +float _Crest_Damping; +float _Crest_Gravity; +float _Crest_SimDeltaTime; +float _Crest_LodChange; +float _Crest_CourantNumber; +float _Crest_AttenuationInShallows; +CBUFFER_END + +m_CrestNameSpace + +float ComputeWaveSpeed(float wavelength, float g) +{ + // wave speed of deep sea water waves: https://en.wikipedia.org/wiki/Wind_wave + // https://en.wikipedia.org/wiki/Dispersion_(water_waves)#Wave_propagation_and_dispersion + //float g = 9.81; float k = 2. * 3.141593 / wavelength; float cp = sqrt(g / k); return cp; + const float one_over_2pi = 0.15915494; + return sqrt(wavelength*g*one_over_2pi); +} + +void UpdateDynamicWaves(uint3 id) +{ + // Slice to sample previous frames data from. LOD change takes into account shifting of the cascades in scale. + const float sliceIndexSource = id.z + _Crest_LodChange; + const Cascade cascadeSource = Cascade::MakeDynamicWavesSource(sliceIndexSource); + + // Off either end of the cascade. Not useful to sample anything from previous + // frame, as we do not produce any new data from sources of waves. + if (sliceIndexSource < 0.0 || sliceIndexSource >= cascadeSource._Count) + { + // Always initialise with 0 values. + _Crest_Target[id] = (float2)0; + return; + } + + const float sliceIndex = id.z; + const Cascade cascade = Cascade::MakeDynamicWaves(sliceIndex); + + const float2 worldPosXZ = cascade.IDToWorld(id.xy); + const float gridSize = cascade._Texel; + + // Min wavelength for this scale + const float wavelength = 2.0 * gridSize; + // could make velocity depend on waves + //float h = max(waterSignedDepth + ft, 0.); + float c = ComputeWaveSpeed(wavelength, _Crest_Gravity); + + const float dt = _Crest_SimDeltaTime; + + // Clamp based on my main man Courant + c = min( c, _Crest_CourantNumber * gridSize / dt ); + + const half waterDepth = Cascade::MakeDepth(sliceIndex).SampleSignedDepthFromSeaLevel(worldPosXZ) + + Cascade::MakeLevel(sliceIndex).SampleLevel(worldPosXZ); + + // Wave reflections off geometry. + if (waterDepth <= 0.0) + { + _Crest_Target[id] = float2(0.0, 0.0); + return; + } + + const half2 velocity = Cascade::MakeFlow(sliceIndex).SampleFlow(worldPosXZ); + const float2 worldPosXZFlowed = worldPosXZ - dt * velocity; + const float3 uv_source = cascadeSource.WorldToUV(worldPosXZFlowed); + + // weighting for source position - weight 0 for off texture accesses to stop streaky artifacts + float2 distToEdge = min(uv_source.xy, 1.0 - uv_source.xy); + // soft, wide feather at boundary to balance reflections vs streaking under motion + const float edgeFeather = 0.1; + float weightEdge = saturate(min(distToEdge.x, distToEdge.y) / edgeFeather); + weightEdge = lerp(0.95, 1.0, weightEdge); + + // compute axes of laplacian kernel - rotated every frame + const float e = cascadeSource._OneOverResolution; + const float3 X = float3(1.0, 0.0, 0.0); + const float3 Y = float3(-X.y, X.x, 0.0); + + float fxm, fym, fxp, fyp; float2 ft_v; + ft_v = fxm = fym = fxp = fyp = 0.0; + + fxm = cascadeSource.SampleDynamicWaves(uv_source - e * X).x; // x minus + fym = cascadeSource.SampleDynamicWaves(uv_source - e * Y).x; // y minus + fxp = cascadeSource.SampleDynamicWaves(uv_source + e * X).x; // x plus + fyp = cascadeSource.SampleDynamicWaves(uv_source + e * Y).x; // y plus + ft_v = cascadeSource.SampleDynamicWaves(uv_source); + + // wave propagation + + // t - current value before update + const float ft = ft_v.x; + const float vt = ft_v.y; + + // wave equation + float coeff = dt * c * c / (gridSize * gridSize); + float vtp = vt + coeff * (fxm + fxp + fym + fyp - 4.0 * ft); + + // damping. works ok at low dts, doesnt damp well at high dts which counter intuitively leads to instabilities, i think. + vtp *= 1.0 - min(1.0, _Crest_Damping * dt); + + // dampen towards boundaries smoothly to eliminate reflections and streaking + vtp *= weightEdge; + + // integrate velocity onto position + float ftp = ft + dt * vtp; + ftp *= weightEdge; + + if (_Crest_AttenuationInShallows > 0.0) + { + // attenuate waves based on water depth. if depth is greater than 0.5*wavelength, water is considered Deep and wave is + // unaffected. if depth is less than this, wave velocity decreases. waves will then bunch up and grow in amplitude and + // eventually break. i model "Deep" water, but then simply ramp down waves in non-deep water with a linear multiplier. + // http://hyperphysics.phy-astr.gsu.edu/hbase/Waves/watwav2.html + // http://hyperphysics.phy-astr.gsu.edu/hbase/watwav.html#c1 + const float depthMul = 1.0 - (1.0 - saturate(2.0 * waterDepth / wavelength)) * dt * 2.0; + ftp *= _Crest_AttenuationInShallows * depthMul + (1.0 - _Crest_AttenuationInShallows); + } + + // Clear for safety as there is a potential for bad values which will propagate throughout the entire simulation. + // Zero is not ideal but better than bad values. Cases: + // - bad values randomly being sampled from the source texture, but ostensibly not injected by an input + // - bad values sometimes appearing after an hour or so runtime + if (!isfinite(ftp) || !isfinite(vtp)) + { + ftp = 0.0; + vtp = 0.0; + } + + _Crest_Target[id] = float2(ftp, vtp); +} + +m_CrestNameSpaceEnd + +m_CrestKernelDefault(UpdateDynamicWaves) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateDynamicWaves.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateDynamicWaves.compute.meta new file mode 100644 index 0000000..d880d72 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateDynamicWaves.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0ba116507793f45b5ba3f016f0837660 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateFoam.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateFoam.compute new file mode 100644 index 0000000..3adf437 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateFoam.compute @@ -0,0 +1,80 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestUpdateFoam + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +float _Crest_FoamFadeRate; +float _Crest_FoamMaximum; +float _Crest_WaveFoamStrength; +float _Crest_WaveFoamCoverage; +float _Crest_ShorelineFoamMaxDepth; +float _Crest_ShorelineFoamStrength; +float _Crest_SimDeltaTime; +float _Crest_SimDeltaTimePrev; +float _Crest_LodChange; +bool _Crest_NeedsPrewarming; +uint _Crest_MinimumWavesSlice; +float _Crest_FoamNegativeDepthPriming; +CBUFFER_END + +m_CrestNameSpace + +void UpdateFoam(uint3 id) +{ + const uint slice0 = id.z; + const Cascade cascade = Cascade::MakeFoam(slice0); + const float2 worldPosXZ = cascade.IDToWorld(id.xy); + half foam = 0.0; + + // Sample from previous frame. + { + const half2 velocity = Cascade::MakeFlow(slice0).SampleFlow(worldPosXZ); + const float2 positionXZ = worldPosXZ - _Crest_SimDeltaTime * velocity; + // Slice to sample previous frames data from. LOD change takes into account shifting of the cascades in scale. + const float sliceIndexSource = clamp(id.z + _Crest_LodChange, 0.0, cascade._Count - 1.0); + foam = Cascade::MakeFoamSource(sliceIndexSource).SampleFoamOverflow(positionXZ, 1.0); + } + + // fade + foam *= max(0.0, 1.0 - _Crest_FoamFadeRate * _Crest_SimDeltaTime); + + // Prewarm wave foam. 1.0 / _Crest_FoamFadeRate perfectly matches a paused water in edit mode, but this is an unnatural + // accumulation of foam and causes overshoots when _Crest_WaveFoamStrength is less than 1.0. + float simDeltaTime = _Crest_NeedsPrewarming ? max(_Crest_SimDeltaTime, min(1.0, _Crest_WaveFoamStrength - 1.0) / _Crest_FoamFadeRate) : _Crest_SimDeltaTime; + + // The determinant of the displacement Jacobian is a good measure for turbulence. + float det; + const half3 displacement = Cascade::MakeAnimatedWaves(max(_Crest_MinimumWavesSlice, slice0)).SampleDisplacement(worldPosXZ, det); + foam += 5.0 * simDeltaTime * _Crest_WaveFoamStrength * saturate( _Crest_WaveFoamCoverage - det ); + + // Prewarm shoreline foam. 1.0 / _Crest_FoamFadeRate perfectly matches a paused water in edit mode which is fine for + // shoreline foam. + simDeltaTime = _Crest_NeedsPrewarming ? (1.0 / _Crest_FoamFadeRate) : _Crest_SimDeltaTime; + + // Add foam in shallow water. use the displaced position to ensure we add foam where world objects are. + const half depth = Cascade::MakeDepth(slice0).SampleSignedDepthFromSeaLevel(worldPosXZ + displacement.xz) + displacement.y; + foam += _Crest_ShorelineFoamStrength * simDeltaTime * saturate(1.0 - depth / _Crest_ShorelineFoamMaxDepth); + + // Priming foam when under terrain helps with SWS leading-edge foam. + if (depth <= _Crest_FoamNegativeDepthPriming) + { + foam += simDeltaTime; + } + + _Crest_Target[id] = min(foam, _Crest_FoamMaximum); +} + +m_CrestNameSpaceEnd + +m_CrestKernelDefault(UpdateFoam) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateFoam.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateFoam.compute.meta new file mode 100644 index 0000000..3f78434 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateFoam.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1149a28b1712c464fbc3d96bea0bc34d +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.compute new file mode 100644 index 0000000..4388987 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.compute @@ -0,0 +1,154 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Soft shadow term is red, hard shadow term is green. + +#pragma kernel CrestUpdateShadowsBRP _BRP +#pragma kernel CrestUpdateShadowsHRP _HRP +#pragma kernel CrestUpdateShadowsURP _URP + +// Both BIRP. +#pragma multi_compile __ SHADOWS_SPLIT_SPHERES +#pragma multi_compile __ SHADOWS_SINGLE_CASCADE + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Shadows.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +// Noise functions used for jitter. +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Noise.hlsl" + + +// JitterDiameterSoft, JitterDiameterHard, CurrentFrameWeightSoft, CurrentFrameWeightHard +float4 _Crest_JitterDiameters_CurrentFrameWeights; +float _Crest_SimDeltaTime; +float4x4 _Crest_MainCameraProjectionMatrix; + +bool _Crest_SampleColorMap; +float3 _Crest_Absorption; +float3 _Crest_Scattering; + +RWTexture2DArray _Crest_Target; + + +m_CrestNameSpace + +half ComputeShadow(const float4 i_positionWS, const float i_jitterDiameter, const half i_terrainHeight, const uint i_LodIndex) +{ + float4 positionWS = i_positionWS; + bool noShadows = false; + + if (i_jitterDiameter > 0.0) + { + // Add jitter. + positionWS.xz += i_jitterDiameter * (hash33(uint3(abs(positionWS.xz * 10.0), _Time.y * 120.0)) - 0.5).xy; + + // Shadow Bleeding. + // If we are not within a terrain, then check for shadow bleeding. + if (i_positionWS.y > i_terrainHeight) + { + // WorldToSafeUV + half terrainHeight = Cascade::MakeDepth(i_LodIndex).SampleSceneHeight(positionWS.xz); + + // If our current position is below the jittered terrain height, then we have landed within a terrain and + // we do not want to sample those shadows. + if (i_positionWS.y < terrainHeight) + { + // Return no shadows. + noShadows = true; + } + } + } + + return noShadows ? 1.0 : Utility::SampleShadows(positionWS); +} + +void UpdateShadows(const uint3 id) +{ + const uint slice0 = id.z; + const Cascade cascade = Cascade::MakeShadow(slice0); + const float2 worldPosXZ = cascade.IDToWorld(id.xy); + + float4 positionWS = 1.0; + positionWS.xz = worldPosXZ; + positionWS.y = g_Crest_WaterCenter.y; + + // Shadow from last frame. Manually implement black border. + const float sliceIndexSource = clamp((int)slice0 + g_Crest_LodChange, 0.0, g_Crest_LodCount - 1.0); + half2 shadow = Cascade::MakeShadowSource(sliceIndexSource).SampleShadowOverflow(positionWS.xz, 1.0); + + // Add displacement so shorelines do not receive shadows incorrectly. + positionWS.xyz += Cascade::MakeAnimatedWaves(slice0).SampleDisplacement(positionWS.xz); + + // This was calculated in vertex but we have to sample sea level offset in fragment. + float4 mainCameraCoordinates = mul(_Crest_MainCameraProjectionMatrix, positionWS); + + // Check if the current sample is visible in the main camera (and therefore the shadow map can be sampled). This is + // required as the shadow buffer is world aligned and surrounds viewer. + float3 projected = mainCameraCoordinates.xyz / mainCameraCoordinates.w; + if (projected.z < 1.0 && projected.z > 0.0 && abs(projected.x) < 1.0 && abs(projected.y) < 1.0) + { + half2 shadowThisFrame = 1.0; + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xyz -= _WorldSpaceCameraPos.xyz; +#endif + + half terrainHeight = Cascade::MakeDepth(slice0).SampleSceneHeight(positionWS.xz); + + half softJitter = _Crest_JitterDiameters_CurrentFrameWeights[CREST_SHADOW_INDEX_SOFT]; + + if (_Crest_SampleColorMap) + { + half3 absorption = _Crest_Absorption; + half3 scattering = _Crest_Scattering; + + if (g_Crest_SampleAbsorptionSimulation) + { + absorption = Cascade::MakeAbsorption(slice0).SampleAbsorption(positionWS.xz); + } + + if (g_Crest_SampleScatteringSimulation) + { + scattering = Cascade::MakeScattering(slice0).SampleScattering(positionWS.xz); + } + + half3 extinction = absorption + scattering; + half factor = saturate(min(min(extinction.x, extinction.y), extinction.z) * g_Crest_DynamicSoftShadowsFactor); + softJitter = (1.0 - factor) * k_Crest_MaximumShadowJitter; + } + + // Add soft shadowing data. + shadowThisFrame[CREST_SHADOW_INDEX_SOFT] = ComputeShadow + ( + positionWS, + softJitter, + terrainHeight, + slice0 + ); + + // Add hard shadowing data. + shadowThisFrame[CREST_SHADOW_INDEX_HARD] = ComputeShadow + ( + positionWS, + _Crest_JitterDiameters_CurrentFrameWeights[CREST_SHADOW_INDEX_HARD], + terrainHeight, + slice0 + ); + + shadowThisFrame = (half2)1.0 - saturate(shadowThisFrame + Utility::ComputeShadowFade(positionWS)); + + shadow = lerp(shadow, shadowThisFrame, _Crest_JitterDiameters_CurrentFrameWeights.zw * _Crest_SimDeltaTime * 60.0); + } + + _Crest_Target[id] = shadow; +} + +m_CrestNameSpaceEnd + +m_CrestKernelXRP(UpdateShadows) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.compute.meta new file mode 100644 index 0000000..9c7b485 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c47c6200534474da18e1134965c102f3 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.hlsl new file mode 100644 index 0000000..d58bb60 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.hlsl @@ -0,0 +1,176 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Soft shadow term is red, hard shadow term is green. In HDRP, hard shadows are not computed and y channel will be 0. + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +// Noise functions used for jitter. +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Noise.hlsl" + +CBUFFER_START(CrestPerMaterial) +// Settings._jitterDiameterSoft, Settings._jitterDiameterHard, Settings._currentFrameWeightSoft, Settings._currentFrameWeightHard +float4 _Crest_JitterDiameters_CurrentFrameWeights; +float _Crest_SimDeltaTime; + +bool _Crest_ClearShadows; + +float3 _Crest_CenterPos; +float3 _Crest_Scale; +float4x4 _Crest_MainCameraProjectionMatrix; + +bool _Crest_SampleColorMap; +float3 _Crest_Absorption; +float3 _Crest_Scattering; +CBUFFER_END + +m_CrestNameSpace + +struct Attributes +{ + uint id : SV_VertexID; + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; + float3 positionWS : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO +}; + +Varyings Vertex(Attributes input) +{ + // This will work for all pipelines. + Varyings output = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + output.positionCS = GetFullScreenTriangleVertexPosition(input.id); + float2 uv = GetFullScreenTriangleTexCoord(input.id); + + // World position from UV. + output.positionWS.xyz = float3(uv.x - 0.5, 0.0, uv.y - 0.5) * _Crest_Scale * 4.0 + _Crest_CenterPos; + output.positionWS.y = g_Crest_WaterCenter.y; + + return output; +} + +half SampleShadows(const float4 i_positionWS); +half ComputeShadowFade(const float4 i_positionWS); + +// Compiler shows warning when using intermediate returns, disable this. +#pragma warning(push) +#pragma warning(disable: 4000) +half ComputeShadow(const float4 i_positionWS, const float i_jitterDiameter, const half i_terrainHeight) +{ + float4 positionWS = i_positionWS; + + if (i_jitterDiameter > 0.0) + { + // Add jitter. + positionWS.xz += i_jitterDiameter * (hash33(uint3(abs(positionWS.xz * 10.0), _Time.y * 120.0)) - 0.5).xy; + + // Shadow Bleeding. + // If we are not within a terrain, then check for shadow bleeding. + if (i_positionWS.y > i_terrainHeight) + { + // WorldToSafeUV + half terrainHeight = Cascade::MakeDepth(_Crest_LodIndex).SampleSceneHeight(positionWS.xz); + + // If our current position is below the jittered terrain height, then we have landed within a terrain and + // we do not want to sample those shadows. + if (i_positionWS.y < terrainHeight) + { + // Return no shadows. + return 1.0; + } + } + } + + return SampleShadows(positionWS); +} +#pragma warning(pop) + +half2 Fragment(Varyings input) +{ + float4 positionWS = float4(input.positionWS.xyz, 1.0); + + // Shadow from last frame. Manually implement black border. + const float sliceIndexSource = clamp((int)_Crest_LodIndex + g_Crest_LodChange, 0.0, g_Crest_LodCount - 1.0); + half2 shadow = Cascade::MakeShadowSource(sliceIndexSource).SampleShadowOverflow(positionWS.xz, 1.0); + + // Add displacement so shorelines do not receive shadows incorrectly. + positionWS.xyz += Cascade::MakeAnimatedWaves(_Crest_LodIndex).SampleDisplacement(positionWS.xz); + + // This was calculated in vertex but we have to sample sea level offset in fragment. + float4 mainCameraCoordinates = mul(_Crest_MainCameraProjectionMatrix, positionWS); + + // Check if the current sample is visible in the main camera (and therefore the shadow map can be sampled). This is + // required as the shadow buffer is world aligned and surrounds viewer. + float3 projected = mainCameraCoordinates.xyz / mainCameraCoordinates.w; + if (projected.z < 1.0 && projected.z > 0.0 && abs(projected.x) < 1.0 && abs(projected.y) < 1.0) + { + half2 shadowThisFrame = 1.0; + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xyz -= _WorldSpaceCameraPos.xyz; +#endif + + half terrainHeight = Cascade::MakeDepth(_Crest_LodIndex).SampleSceneHeight(positionWS.xz); + + half softJitter = _Crest_JitterDiameters_CurrentFrameWeights[CREST_SHADOW_INDEX_SOFT]; + + if (_Crest_SampleColorMap) + { + half3 absorption = _Crest_Absorption; + half3 scattering = _Crest_Scattering; + + if (g_Crest_SampleAbsorptionSimulation) + { + absorption = Cascade::MakeAbsorption(_Crest_LodIndex).SampleAbsorption(positionWS.xz); + } + + if (g_Crest_SampleScatteringSimulation) + { + scattering = Cascade::MakeScattering(_Crest_LodIndex).SampleScattering(positionWS.xz); + } + + half3 extinction = absorption + scattering; + half factor = saturate(min(min(extinction.x, extinction.y), extinction.z) * g_Crest_DynamicSoftShadowsFactor); + softJitter = (1.0 - factor) * k_Crest_MaximumShadowJitter; + } + + // Add soft shadowing data. + shadowThisFrame[CREST_SHADOW_INDEX_SOFT] = ComputeShadow + ( + positionWS, + softJitter, + terrainHeight + ); + +#ifdef CREST_SAMPLE_SHADOW_HARD + // Add hard shadowing data. + shadowThisFrame[CREST_SHADOW_INDEX_HARD] = ComputeShadow + ( + positionWS, + _Crest_JitterDiameters_CurrentFrameWeights[CREST_SHADOW_INDEX_HARD], + terrainHeight + ); +#endif + + shadowThisFrame = (half2)1.0 - saturate(shadowThisFrame + ComputeShadowFade(positionWS)); + + shadow = lerp(shadow, shadowThisFrame, _Crest_JitterDiameters_CurrentFrameWeights.zw * _Crest_SimDeltaTime * 60.0); + } + + return shadow; +} + +m_CrestNameSpaceEnd + +m_CrestVertex +m_CrestFragment(half2) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.hlsl.meta new file mode 100644 index 0000000..fb88c16 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d67c7804ecde845f19a01df7b5097557 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.shader new file mode 100644 index 0000000..ed611f9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.shader @@ -0,0 +1,7 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest/Obsolete/Simulation/Update Shadow" +{ + // Replaced with UpdateShadow.compute. +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.shader.meta new file mode 100644 index 0000000..e114ffa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Data/UpdateShadow.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6195b173b90b246ac9f5300b7e2aa482 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library.meta new file mode 100644 index 0000000..ce43452 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 125a3abfbf29c41c8a9e84377488461c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl new file mode 100644 index 0000000..fbdb227 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl @@ -0,0 +1,545 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_CASCADE_INCLUDED +#define CREST_CASCADE_INCLUDED + +// Fix Unity macro leaks. +#undef _Weight + +#ifdef SHADER_API_PSSL +#define m_ConstantReturn const +#else +#define m_ConstantReturn +#endif + +#define m_SanitizeAbsorption(x) x +#define m_SanitizeAlbedo(x) x +#define m_SanitizeAnimatedWaves(x) x +#define m_SanitizeClip(x) x +// Infinity is unsafe, as it causes NaNs if multiplied by zero. +#define m_SanitizeDepth(x) max(x, -m_FloatMaximum) +#define m_SanitizeDynamicWaves(x) x +#define m_SanitizeFlow(x) x +#define m_SanitizeFoam(x) x +#define m_SanitizeLevel(x) x +#define m_SanitizeScattering(x) x +#define m_SanitizeShadow(x) x + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + +#define m__MakeCascade(name, source) \ + static Cascade Make##name##source(uint i_Index) \ + { \ + float4 perType = g_Crest_SamplingParameters##name; \ + float4 perSlice = g_Crest_SamplingParametersCascade##name##source[i_Index]; \ + Cascade result; \ + result._Texture = g_Crest_Cascade##name##source; \ + result._SamplingParameters = g_Crest_SamplingParametersCascade##name##source; \ + result._Index = i_Index; \ + result._PositionSnapped = perSlice.xy; \ + result._Texel = perSlice.z; \ + result._Resolution = perType.y; \ + result._OneOverResolution = perType.z; \ + result._Count = perType.x; \ + return result; \ + } \ + +#define m_MakeCascadeCopy(name) \ + static Cascade Make##name(uint i_Index, Cascade i_Cascade) \ + { \ + float4 perType = g_Crest_SamplingParameters##name; \ + float4 perSlice = i_Cascade._SamplingParameters[i_Index]; \ + Cascade result; \ + result._Texture = i_Cascade._Texture; \ + result._SamplingParameters = i_Cascade._SamplingParameters; \ + result._Index = i_Index; \ + result._PositionSnapped = perSlice.xy; \ + result._Texel = perSlice.z; \ + result._Resolution = perType.y; \ + result._OneOverResolution = perType.z; \ + result._Count = perType.x; \ + return result; \ + } + +#define m__MakeCascadeShared(source) \ + static Cascade Make##source(uint i_Index) \ + { \ + const float4 perAll = g_Crest_CascadeData##source[i_Index]; \ + Cascade result; \ + result._Index = i_Index; \ + result._Scale = perAll.x; \ + result._Weight = perAll.y; \ + result._MaximumWavelength = perAll.z; \ + return result; \ + } + +#define m_MakeCascade(name) m__MakeCascade(name,) +#define m_MakeCascadePrevious(name) m__MakeCascade(name, Source) +#define m_MakeCascadeShared m__MakeCascadeShared() +#define m_MakeCascadeSharedPrevious m__MakeCascadeShared(Source) + +#define m_Sample(name, type, swizzle) \ + type Sample##name(const float2 i_Position) m_ConstantReturn \ + { \ + type result = Sample(i_Position)swizzle; \ + result = m_Sanitize##name(result); \ + return result; \ + } \ + type Sample##name(const float3 i_UV) m_ConstantReturn \ + { \ + return Sample(i_UV)swizzle; \ + } \ + type Sample##name(const uint2 i_ID) m_ConstantReturn \ + { \ + return Sample(i_ID)swizzle; \ + } \ + type Sample##name##Overflow(const float2 i_Position, const float i_Border) m_ConstantReturn \ + { \ + type result = 0.0; \ + const float3 uv = WorldToUV(i_Position); \ + const half2 r = abs(uv.xy - 0.5); \ + const half rMax = 0.5 - _OneOverResolution * i_Border; \ + if (max(r.x, r.y) <= rMax) \ + { \ + result = Sample##name(uv); \ + } \ + else if ((_Index + 1) < _Count) \ + { \ + const Cascade cascade = Cascade::Make##name(_Index + 1, this); \ + const float3 uv = cascade.WorldToUV(i_Position); \ + const half2 r = abs(uv.xy - 0.5); \ + const half rMax = 0.5 - cascade._OneOverResolution * i_Border; \ + if (max(r.x, r.y) <= rMax) \ + { \ + result = Sample##name(uv); \ + } \ + } \ + return result; \ + } \ + type Sample##name##Overflow(const float3 i_UV, const float i_Border) m_ConstantReturn \ + { \ + type result = 0.0; \ + const half2 r = abs(i_UV.xy - 0.5); \ + const half rMax = 0.5 - _OneOverResolution * i_Border; \ + if (max(r.x, r.y) <= rMax) \ + { \ + result = Sample##name(i_UV); \ + } \ + else if ((_Index + 1) < _Count) \ + { \ + const Cascade cascade = Cascade::Make##name(_Index + 1, this); \ + const float3 uv = cascade.WorldToUV(UVToWorld(i_UV)); \ + const half2 r = abs(uv.xy - 0.5); \ + const half rMax = 0.5 - cascade._OneOverResolution * i_Border; \ + if (max(r.x, r.y) <= rMax) \ + { \ + result = Sample##name(uv); \ + } \ + } \ + return result; \ + } + +#define m_SampleWeighted(name, type) \ + void Sample##name(const float2 i_Position, const float i_Weight, inout type io_##name) m_ConstantReturn \ + { \ + io_##name += Sample##name(i_Position) * i_Weight; \ + } \ + void Sample##name(const float3 i_UV, const float i_Weight, inout type io_##name) m_ConstantReturn \ + { \ + io_##name += Sample##name(i_UV) * i_Weight; \ + } \ + void Sample##name##Overflow(const float2 i_Position, const float i_Border, const float i_Weight, inout type io_##name) m_ConstantReturn \ + { \ + io_##name += Sample##name##Overflow(i_Position, i_Border) * i_Weight; \ + } + +m_CrestNameSpace + +struct Cascade +{ + Texture2DArray _Texture; + float _Index; + float2 _PositionSnapped; + float _Resolution; + float _Count; + float _OneOverResolution; + float _Texel; + float _MaximumWavelength; + + float _Scale; + float _Weight; + + // For copy constructor. + float4 _SamplingParameters[MAX_LOD_COUNT]; + + m_MakeCascadeShared + m_MakeCascadeSharedPrevious + + static Cascade Make(const uint i_Index, bool i_Previous) + { + const float4 perAll = i_Previous ? g_Crest_CascadeDataSource[i_Index] : g_Crest_CascadeData[i_Index]; + Cascade result; + result._Index = i_Index; + result._Scale = perAll.x; + result._Weight = perAll.y; + result._MaximumWavelength = perAll.z; + return result; + } + + m_MakeCascade(Absorption) + m_MakeCascadeCopy(Absorption) + m_MakeCascade(Albedo) + m_MakeCascadeCopy(Albedo) + m_MakeCascade(AnimatedWaves) + m_MakeCascadeCopy(AnimatedWaves) + m_MakeCascadePrevious(AnimatedWaves) + m_MakeCascade(Clip) + m_MakeCascadeCopy(Clip) + m_MakeCascade(Depth) + m_MakeCascadeCopy(Depth) + m_MakeCascade(DynamicWaves) + m_MakeCascadeCopy(DynamicWaves) + m_MakeCascadePrevious(DynamicWaves) + m_MakeCascade(Flow) + m_MakeCascadeCopy(Flow) + m_MakeCascade(Foam) + m_MakeCascadeCopy(Foam) + m_MakeCascadePrevious(Foam) + m_MakeCascade(Level) + m_MakeCascadeCopy(Level) + m_MakeCascade(Scattering) + m_MakeCascadeCopy(Scattering) + m_MakeCascade(Shadow) + m_MakeCascadeCopy(Shadow) + m_MakeCascadePrevious(Shadow) + + // Convert compute shader id to uv texture coordinates + float3 IDToUV(const uint2 i_ID) m_ConstantReturn + { + return float3((i_ID + 0.5) / _Resolution, _Index); + } + + float2 UVToWorld(const float3 i_UV) m_ConstantReturn + { + return _Texel * _Resolution * (i_UV.xy - 0.5) + _PositionSnapped; + } + + float3 WorldToUV(const float2 i_Position) m_ConstantReturn + { + return float3((i_Position - _PositionSnapped) / (_Texel * _Resolution) + 0.5, _Index); + } + + float2 IDToWorld(const uint2 i_ID) m_ConstantReturn + { + return UVToWorld(IDToUV(i_ID)); + } + + bool IsOutOfBounds(float2 uv, float offset) m_ConstantReturn + { + const half2 r = abs(uv - 0.5); + const half rMax = 0.5 - _OneOverResolution * offset; + return max(r.x, r.y) > rMax; + } + + half4 Sample(const float3 i_UV) m_ConstantReturn + { + return _Texture.SampleLevel(LODData_linear_clamp_sampler, i_UV, 0.0); + } + + half4 Sample(const Texture2DArray i_Texture, const float3 i_UV) m_ConstantReturn + { + return i_Texture.SampleLevel(LODData_linear_clamp_sampler, i_UV, 0.0); + } + + half4 Sample(const float2 i_Position) m_ConstantReturn + { + return Sample(WorldToUV(i_Position)); + } + + half4 Sample(const Texture2DArray i_Texture, const float2 i_Position) m_ConstantReturn + { + return Sample(i_Texture, WorldToUV(i_Position)); + } + + half4 Sample(const uint2 i_ID) m_ConstantReturn + { + return Sample(IDToUV(i_ID)); + } + + half4 Sample(const Texture2DArray i_Texture, const uint2 i_ID) m_ConstantReturn + { + return Sample(i_Texture, IDToUV(i_ID)); + } + + float3 Internal_WrapToNextSlice(float3 i_uv, float i_overflowed) m_ConstantReturn + { + // Next slice is twice the size so half the coordinates to match position. + float overflow = 0.5 * i_overflowed; + i_uv = float3((i_uv.xy - overflow) * (1.0 - overflow) + overflow, i_uv.z + i_overflowed); + return i_uv; + } + + // Wraps to next slice if coordinates outside of range. + float3 WrapToNextSlice(float3 i_uv) m_ConstantReturn + { + return Internal_WrapToNextSlice(i_uv, any(i_uv.xy > 1.0) || any(i_uv.xy < 0.0)); + } + + // Wraps to next slice if coordinates outside of range. + float3 WrapToNextSlice(float3 i_uv, float i_depth) m_ConstantReturn + { + return Internal_WrapToNextSlice(i_uv, any(i_uv.xy > 1.0) || any(i_uv.xy < 0.0) && i_uv.z + 1.0 < i_depth); + } + + m_Sample(Absorption, half3, .xyz) + m_SampleWeighted(Absorption, half3) + m_Sample(Albedo, half4, ) + m_SampleWeighted(Albedo, half4) + m_Sample(AnimatedWaves, half4, ) + m_SampleWeighted(AnimatedWaves, float4) // Use float because parameter is position + m_Sample(Clip, half, .x) + m_SampleWeighted(Clip, half) + m_Sample(Depth, half2, .xy) + m_SampleWeighted(Depth, half2) + m_Sample(DynamicWaves, half2, .xy) + m_Sample(Flow, half2, .xy) + m_SampleWeighted(Flow, half2) + m_Sample(Foam, half, .x) + m_SampleWeighted(Foam, half) + m_Sample(Level, half, .x) + m_SampleWeighted(Level, half) + m_Sample(Scattering, half3, .xyz) + m_SampleWeighted(Scattering, half3) + m_Sample(Shadow, half2, .xy) + m_SampleWeighted(Shadow, half2) + + float3 SampleDisplacement(const float2 i_Position) m_ConstantReturn + { + float4 position = SampleAnimatedWaves(i_Position); + position.y += position.w; + return position.xyz; + } + + void SampleDisplacement(const float2 i_Position, const float i_Weight, inout float3 io_Position) m_ConstantReturn + { + io_Position += SampleDisplacement(i_Position).xyz * i_Weight; + } + + half3 SampleWaveDisplacement(const float2 i_Position) m_ConstantReturn + { + return SampleAnimatedWaves(i_Position).xyz; + } + + half3 SampleWaveDisplacement(const float3 i_UV) m_ConstantReturn + { + return SampleAnimatedWaves(i_UV).xyz; + } + + half4 __SampleDisplacements(const float2 i_Position, out float3 o_DisplacementX, out float3 o_DisplacementZ) m_ConstantReturn + { + const float3 uv = WorldToUV(i_Position); + const half4 displacement = SampleAnimatedWaves(uv); + const float3 dd = float3(_OneOverResolution, 0.0, _Texel); + o_DisplacementX = dd.zyy + SampleWaveDisplacement(uv + dd.xyy); + o_DisplacementZ = dd.yyz + SampleWaveDisplacement(uv + dd.yxy); + return displacement; + } + + void SampleDisplacement(const float2 i_Position, const float i_Weight, inout float3 io_Position, inout half2 io_Derivatives, inout half io_LevelOffset) m_ConstantReturn + { + float3 uv = WorldToUV(i_Position); + float4 position = SampleAnimatedWaves(uv); + io_LevelOffset += position.w * i_Weight; + io_Position += position.xyz * i_Weight; + + // Derivatives + { + // Compute derivative of water level - needed to get base normal of water. Water + // normal, normal map etc is then added to base normal. + const float2 dd = float2(_OneOverResolution, 0.0); + const float xOffset = SampleAnimatedWaves(uv + dd.xyy).w; + const float zOffset = SampleAnimatedWaves(uv + dd.yxy).w; + + // TODO: Is weight in correct position? + io_Derivatives.x += i_Weight * (xOffset - position.w) / _Texel; + io_Derivatives.y += i_Weight * (zOffset - position.w) / _Texel; + } + } + + void SampleDisplacement(const float2 i_Position, const float i_Weight, inout float3 io_Position, inout half2 io_Derivatives) m_ConstantReturn + { + half offset = 0.0; + SampleDisplacement(i_Position, i_Weight, io_Position, io_Derivatives, offset); + io_Position.y += offset; + } + + half3 SampleDisplacement(const float2 i_Position, out half o_Determinent) m_ConstantReturn + { + float3 xDisplacement; float3 zDisplacement; + half4 displacement = __SampleDisplacements(i_Position, xDisplacement, zDisplacement); + o_Determinent = __ComputeDisplacementDeterminant(displacement.xyz, xDisplacement, zDisplacement); + displacement.y += displacement.w; + return displacement.xyz; + } + + half __ComputeDisplacementDeterminant(half3 i_Displacement, float3 i_DisplacementX, float3 i_DisplacementZ) m_ConstantReturn + { + const float2x2 jacobian = (float4(i_DisplacementX.xz, i_DisplacementZ.xz) - i_Displacement.xzxz) / _Texel; + // Determinant is < 1 for pinched, < 0 for overlap/inversion and > 1 for stretched. + return determinant(jacobian); + } + + half2 __ComputeDisplacementNormals(half3 i_Displacement, float3 i_DisplacementX, float3 i_DisplacementZ) m_ConstantReturn + { + float3 xProduct = cross(i_DisplacementZ - i_Displacement, i_DisplacementX - i_Displacement); + + // Situation could arise where cross returns 0, prob when arguments are two aligned vectors. This + // resulted in NaNs and flashing screen in HDRP. Force normal to point upwards as the only time + // it should point downwards is for underwater (handled elsewhere) or in surface inversions which + // should not happen for well tweaked waves, and look broken anyway. + xProduct.y = max(xProduct.y, 0.0001); + + return normalize(xProduct).xz; + } + + // TODO: Rename + void SampleNormals(const float2 i_Position, const float i_Weight, inout half2 io_Normal, inout half io_Determinant) m_ConstantReturn + { + float3 xDisplacement; float3 zDisplacement; + half3 displacement = __SampleDisplacements(i_Position, xDisplacement, zDisplacement).xyz; + io_Normal += __ComputeDisplacementNormals(displacement, xDisplacement, zDisplacement) * i_Weight; + io_Determinant += __ComputeDisplacementDeterminant(displacement, xDisplacement, zDisplacement) * i_Weight; + } + + half SampleSceneHeight(const float2 i_Position) m_ConstantReturn + { + return SampleDepth(i_Position).x; + } + + void SampleSceneHeight(const float2 i_Position, const float i_Weight, inout half io_Height) m_ConstantReturn + { + io_Height += SampleSceneHeight(i_Position) * i_Weight; + } + + half SampleShorelineDistance(const float2 i_Position) m_ConstantReturn + { + return Sample(i_Position).y; + } + + half SampleShorelineDistance(const float3 i_UV) m_ConstantReturn + { + return Sample(i_UV).y; + } + + half SampleShorelineDistance(const uint2 i_ID) m_ConstantReturn + { + return Sample(i_ID).y; + } + + void SampleShorelineDistance(const float2 i_Position, const float i_Weight, inout half io_Distance) m_ConstantReturn + { + io_Distance += SampleShorelineDistance(i_Position) * i_Weight; + } + + half SampleSignedDepthFromSeaLevel(const float2 i_Position) m_ConstantReturn + { + return g_Crest_WaterCenter.y - SampleSceneHeight(i_Position); + } + + half2 SampleSignedDepthFromSeaLevelAndDistance(const float2 i_Position) m_ConstantReturn + { + half2 value = SampleDepth(i_Position); + value.x = g_Crest_WaterCenter.y - value.x; + return value; + } + + void SampleSignedDepthFromSeaLevel(const float2 i_Position, const float i_Weight, inout half io_Depth) m_ConstantReturn + { + io_Depth += (g_Crest_WaterCenter.y - SampleSceneHeight(i_Position)) * i_Weight; + } + + // Perform iteration to invert the displacement vector field - find position that displaces to query position. + float2 SampleInvertedDisplacement(const float2 i_Position) m_ConstantReturn + { + float2 inverted = i_Position; + for (uint i = 0; i < 4; i++) + { + const float2 displacement = SampleAnimatedWaves(inverted).xz; + const float2 error = (inverted + displacement) - i_Position; + inverted -= error; + } + + return inverted; + } + + half3 SampleDisplacementFromUndisplaced(const float2 i_Position) m_ConstantReturn + { + return SampleDisplacement(SampleInvertedDisplacement(i_Position)); + } + + half3 SampleDynamicWavesDisplacement(const float2 i_Position, const float i_HorizontalDisplace, const float i_DisplaceClamp) m_ConstantReturn + { + const float3 uv = WorldToUV(i_Position); + return SampleDynamicWavesDisplacement(uv, i_HorizontalDisplace, i_DisplaceClamp); + } + + half3 SampleDynamicWavesDisplacement(const float3 i_UV, const float i_HorizontalDisplace, const float i_DisplaceClamp) m_ConstantReturn + { + const float3 uv = i_UV; + + half3 displacement = 0.0; + displacement.y = Sample(uv).x; + + const float2 invRes = float2(_OneOverResolution, 0.0); + const half waveSimY_px = Sample(uv + invRes.xyy).x; + const half waveSimY_nx = Sample(uv - invRes.xyy).x; + const half waveSimY_pz = Sample(uv + invRes.yxy).x; + const half waveSimY_nz = Sample(uv - invRes.yxy).x; + // Compute displacement from gradient of water surface - discussed in issue #18 and then in issue #47. + + // For gerstner waves, horizontal displacement is proportional to derivative of + // vertical displacement multiplied by the wavelength. + const float wavelength_mid = 2.0 * _Texel * 1.5; + const float wavevector = 2.0 * 3.14159 / wavelength_mid; + const float2 dydx = (float2(waveSimY_px, waveSimY_pz) - float2(waveSimY_nx, waveSimY_nz)) / (2.0 * _Texel); + displacement.xz = i_HorizontalDisplace * dydx / wavevector; + + const float maxDisp = _Texel * i_DisplaceClamp; + displacement.xz = clamp(displacement.xz, -maxDisp, maxDisp); + + return displacement; + } +}; + +float2 DataIDToInputUV +( + const float2 i_ID, + const Cascade i_Cascade, + const float2 i_Position, + const float2 i_Rotation, + const float2 i_Size +) +{ + const float2 position = i_Cascade.IDToWorld(i_ID); + float2 uv = (position - i_Position) / i_Size; + + // Clockwise transform rotation. + uv = uv.x * float2(i_Rotation.y, -i_Rotation.x) + uv.y * i_Rotation; + uv += 0.5; + + return uv; +} + +m_CrestNameSpaceEnd + +#undef m__MakeCascade +#undef m_MakeCascade +#undef m_MakeCascadePrevious +#undef m_Sample +#undef m_SampleWeighted +#undef m_ComputeDepth + +#endif // CREST_CASCADE_INCLUDED diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl.meta new file mode 100644 index 0000000..d1a2d0a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a2766c94869154bff829f45f26f23f7b +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl new file mode 100644 index 0000000..14d769c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_CONSTANTS_H +#define CREST_CONSTANTS_H + +#define m_CrestBlendNone 0 +#define m_CrestBlendAdditive 1 +#define m_CrestBlendMinimum 2 +#define m_CrestBlendMaximum 3 +#define m_CrestBlendAlpha 4 + +#define m_Crest_PositiveInfinity asfloat(0x7F800000) +#define m_Crest_NegativeInfinity asfloat(0xFF800000) + +// Was 0.001, but caused prominent seams for sensitive data like water level. +// 0.00001 worked, but not worth the miniscule saving (in theory). It would require +// testing across various LOD quality settings. +#define m_CrestSampleLodThreshold 0.0 + +// NOTE: these MUST match the values in PropertyWrapper.cs +#define THREAD_GROUP_SIZE_X 8 +#define THREAD_GROUP_SIZE_Y 8 + +// NOTE: This must match the value in LodDataMgr.cs, as it is used to allow the +// C# code to check if any parameters are within the MAX_LOD_COUNT limits +#define MAX_LOD_COUNT 15 + +// How light is attenuated deep in water +#define DEPTH_OUTSCATTER_CONSTANT 0.25 + +// NOTE: Must match k_DepthBaseline in LodDataMgrSeaFloorDepth.cs. +// Bias water floor depth so that default (0) values in texture are not interpreted as shallow and generating foam everywhere +#define CREST_WATER_DEPTH_BASELINE m_Crest_PositiveInfinity +#define k_Crest_MaximumWaveAttenuationDepth 1000.0 + +// Soft shadows is red, hard shadows is green. +#define CREST_SHADOW_INDEX_SOFT 0 +#define CREST_SHADOW_INDEX_HARD 1 +#define k_Crest_MaximumShadowJitter 32.0 + +#define CREST_SSS_MAXIMUM 0.6 +#define CREST_SSS_RANGE 0.12 + +// Note: Must match k_MaskBelowSurface in UnderwaterRenderer.Mask.cs. +// Fog rendered from below. +#define CREST_MASK_BELOW_SURFACE -1.0 +// Fog rendered from above. +#define CREST_MASK_ABOVE_SURFACE 1.0 +// Normally discard, but keep. Used by negative volumes. +#define CREST_MASK_ABOVE_SURFACE_KEPT 2.0 +#define CREST_MASK_BELOW_SURFACE_KEPT -2.0 +// No mask. Used by meniscus when using volumes. +#define CREST_MASK_NONE 0.0 +// No fog. Nicer wording for comparisons. +#define CREST_MASK_NO_FOG 0.0 + +// The maximum distance the meniscus will be rendered. Only valid when rendering underwater from geometry. The value is +// used to scale the meniscus as it is calculate using a pixel offset which can make the meniscus large at a distance. +#define MENISCUS_MAXIMUM_DISTANCE 15.0 + + +#if defined(STEREO_INSTANCING_ON) || defined(STEREO_MULTIVIEW_ON) +#define CREST_HANDLE_XR 1 +#else +#define CREST_HANDLE_XR 0 +#endif + +#endif // CREST_CONSTANTS_H diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl.meta new file mode 100644 index 0000000..02c79e2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9553b06787bdd4dfb99d0563f6027d3f +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl new file mode 100644 index 0000000..1e91511 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl @@ -0,0 +1,48 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_FLOW_INCLUDED +#define CREST_FLOW_INCLUDED + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" + +m_CrestNameSpace + +struct Flow +{ + float _Offset0; + float _Weight0; + float _Offset1; + float _Weight1; + float _Period; + half2 _Flow; + + static Flow Make + ( + const half2 i_Flow, + const float i_Time, + const float i_Period = 1.0 + ) + { + const float Period = i_Period; + const float HalfPeriod = Period * 0.5; + const float Offset0 = fmod(i_Time, Period); + float Weight0 = Offset0 / HalfPeriod; + if (Weight0 > 1.0) Weight0 = 2.0 - Weight0; + const float Offset1 = fmod(i_Time + HalfPeriod, Period); + const float Weight1 = 1.0 - Weight0; + + Flow flow; + flow._Offset0 = Offset0; + flow._Weight0 = Weight0; + flow._Offset1 = Offset1; + flow._Weight1 = Weight1; + flow._Period = Period; + flow._Flow = i_Flow; + return flow; + } +}; + +m_CrestNameSpaceEnd + +#endif // CREST_FLOW_INCLUDED diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl.meta new file mode 100644 index 0000000..9933217 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ed3b576b7fe3c45b89366844bacbe976 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl new file mode 100644 index 0000000..c2e1b0a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl @@ -0,0 +1,58 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// GLOBALs - we're allowed to use these anywhere. + +#ifndef CREST_WATER_GLOBALS_H +#define CREST_WATER_GLOBALS_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" + +SamplerState LODData_linear_clamp_sampler; +SamplerState LODData_point_clamp_sampler; +SamplerState sampler_Crest_linear_repeat; + +SamplerState _Crest_linear_clamp_sampler; + +CBUFFER_START(CrestPerFrame) +float3 g_Crest_WaterCenter; +float g_Crest_WaterScale; +float g_Crest_Time; +float g_Crest_LodCount; +int g_Crest_LodChange; +float g_Crest_MeshScaleLerp; +float g_Crest_ClipByDefault; +float g_Crest_LodAlphaBlackPointFade; +float g_Crest_LodAlphaBlackPointWhitePointFade; + +// Hack - due to SV_IsFrontFace occasionally coming through as true for +// backfaces, add a param here that forces water to be in undrwater state. I +// think the root cause here might be imprecision or numerical issues at water +// tile boundaries, although I'm not sure why cracks are not visible in this case. +int g_Crest_ForceUnderwater; + +float3 g_Crest_PrimaryLightDirection; +float3 g_Crest_PrimaryLightIntensity; +bool g_Crest_PrimaryLightHasCookie; + +float g_Crest_DynamicSoftShadowsFactor; + +bool g_Crest_SampleAbsorptionSimulation; +bool g_Crest_SampleScatteringSimulation; + +// Motion Vector Parameters +float g_Crest_WaterScaleChange; +float2 g_Crest_WaterCenterDelta; + +// Shifting Origin +#if (CREST_SHIFTING_ORIGIN != 0) +float3 g_Crest_ShiftingOriginOffset; +#endif + +// Portals +#if (CREST_PORTALS != 0) +int _Crest_Portal; +#endif +CBUFFER_END + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl.meta new file mode 100644 index 0000000..f6e130d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 219ccb266236f4738917065843609901 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl new file mode 100644 index 0000000..3bc7b27 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl @@ -0,0 +1,133 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// LOD data - data, samplers and functions associated with LODs + +#ifndef CREST_WATER_HELPERS_H +#define CREST_WATER_HELPERS_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + +m_CrestNameSpace + +#define m_Blend(type) \ + type Blend(const int i_Blend, const float i_Alpha, const float i_DeltaTime, const type i_Source, const type i_Target) \ + { \ + switch (i_Blend) \ + { \ + case m_CrestBlendMinimum: \ + return min(i_Target, i_Source * i_Alpha); \ + case m_CrestBlendMaximum: \ + return max(i_Target, i_Source * i_Alpha); \ + case m_CrestBlendAdditive: \ + return i_Target + i_Source * i_Alpha * i_DeltaTime; \ + case m_CrestBlendAlpha: \ + return lerp(i_Target, i_Source, i_Alpha); \ + case m_CrestBlendNone: \ + default: \ + return i_Source * i_Alpha; \ + } \ + } \ + +m_Blend(float) +m_Blend(float2) +m_Blend(float3) +m_Blend(float4) + +uint PositionToSliceIndex +( + const float2 i_PositionXZ, + const float i_MinimumSlice, + const float i_WaterScale0 +) +{ + const float2 offsetFromCenter = abs(i_PositionXZ - g_Crest_WaterCenter.xz); + const float taxicab = max(offsetFromCenter.x, offsetFromCenter.y); + const float radius0 = i_WaterScale0; + float sliceNumber = log2(max(taxicab / radius0, 1.0)); + // Don't use last slice - this is a "transition" slice used to cross fade waves + // between LOD resolutions to avoid pops. + sliceNumber = clamp(sliceNumber, i_MinimumSlice, g_Crest_LodCount - 2.0); + return floor(sliceNumber); +} + +void PosToSliceIndices +( + const float2 worldXZ, + const float minSlice, + const float maxSlice, + const float waterScale0, + out uint slice0, + out uint slice1, + out float lodAlpha +) +{ + const float2 offsetFromCenter = abs(worldXZ - g_Crest_WaterCenter.xz); + const float taxicab = max(offsetFromCenter.x, offsetFromCenter.y); + const float radius0 = waterScale0; + float sliceNumber = log2( max( taxicab / radius0, 1.0 ) ); + sliceNumber = clamp( sliceNumber, minSlice, maxSlice ); + + lodAlpha = frac(sliceNumber); + + // Fixes artefact with DX12 & Vulkan. Likely a compiler bug. + // Sampling result appears to be all over the place. + slice0 = floor(sliceNumber) + 0.01; + slice1 = slice0 + 1; + + // lod alpha is remapped to ensure patches weld together properly. patches can vary significantly in shape (with + // strips added and removed), and this variance depends on the base density of the mesh, as this defines the strip width. + // using .15 as black and .85 as white should work for base mesh density as low as 16. + const float BLACK_POINT = 0.15, WHITE_POINT = 0.85; + lodAlpha = saturate((lodAlpha - BLACK_POINT) / (WHITE_POINT - BLACK_POINT)); + + if (slice0 == 0) + { + // blend out lod0 when viewpoint gains altitude. we're using the global g_Crest_MeshScaleLerp so check for LOD0 is necessary + lodAlpha = min(lodAlpha + g_Crest_MeshScaleLerp, 1.0); + } +} + +bool IsUnderWater(const bool i_FrontFace, const int i_ForceUnderwater) +{ + bool underwater = false; + + // We are well below water. + if (i_ForceUnderwater == 1) + { + underwater = true; + } + // We are well above water. + else if (i_ForceUnderwater == 2) + { + underwater = false; + } + // Use facing. + else + { + underwater = !i_FrontFace; + } + + return underwater; +} + +float FeatherWeightFromUV(const float2 i_uv, const half i_featherWidth) +{ + float2 offset = abs(i_uv - 0.5); + float r_l1 = max(offset.x, offset.y) - (0.5 - i_featherWidth); + if (i_featherWidth > 0.0) r_l1 /= i_featherWidth; + float weight = saturate(1.0 - r_l1); + return weight; +} + +bool WithinUV(const float2 i_UV) +{ + const float2 d = abs(i_UV - 0.5); + return max(d.x, d.y) <= 0.5; +} + +m_CrestNameSpaceEnd + +#endif // CREST_WATER_HELPERS_H diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl.meta new file mode 100644 index 0000000..68f22a6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5dd9b4a212760411496bde4d1b7a6b7c +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl new file mode 100644 index 0000000..99be486 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Anything marked as "Source" is from the previous frame. + +#ifndef CREST_INPUTS_DRIVEN_H +#define CREST_INPUTS_DRIVEN_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" + +// NOTE: Unity does not recognize uint in FrameDebugger. It will be under Floats +// with incorrect values. Change to int for debugging. +uint _Crest_LodIndex; + + +Texture2DArray g_Crest_CascadeAbsorption; +m_DisplacementTexture(Texture2DArray, 4) g_Crest_CascadeAnimatedWaves; +m_DisplacementTexture(Texture2DArray, 4) g_Crest_CascadeAnimatedWavesSource; +Texture2DArray g_Crest_CascadeDepth; +m_DisplacementTexture(Texture2DArray, 4) g_Crest_CascadeLevel; +Texture2DArray g_Crest_CascadeClip; +Texture2DArray g_Crest_CascadeFoam; +Texture2DArray g_Crest_CascadeFoamSource; +Texture2DArray g_Crest_CascadeFlow; +Texture2DArray g_Crest_CascadeDynamicWaves; +Texture2DArray g_Crest_CascadeDynamicWavesSource; +Texture2DArray g_Crest_CascadeScattering; +Texture2DArray g_Crest_CascadeShadow; +Texture2DArray g_Crest_CascadeShadowSource; +Texture2DArray g_Crest_CascadeAlbedo; + + +CBUFFER_START(CrestLodData) +// Cascade Data: Scale, Weight, MaximumWavelength, 0 +float4 g_Crest_CascadeData[MAX_LOD_COUNT]; +float4 g_Crest_CascadeDataSource[MAX_LOD_COUNT]; + +// Sampling Parameters: LodCount, Resolution, OneOverResolution, 0 +// Sampling Parameters (Cascade): SnappedPositionX, SnappedPositionZ, TexelWidth, 0 +float4 g_Crest_SamplingParametersAbsorption; +float4 g_Crest_SamplingParametersCascadeAbsorption[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersAlbedo; +float4 g_Crest_SamplingParametersCascadeAlbedo[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersAnimatedWaves; +float4 g_Crest_SamplingParametersCascadeAnimatedWaves[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersCascadeAnimatedWavesSource[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersClip; +float4 g_Crest_SamplingParametersCascadeClip[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersDepth; +float4 g_Crest_SamplingParametersCascadeDepth[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersDynamicWaves; +float4 g_Crest_SamplingParametersCascadeDynamicWaves[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersCascadeDynamicWavesSource[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersFlow; +float4 g_Crest_SamplingParametersCascadeFlow[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersFoam; +float4 g_Crest_SamplingParametersCascadeFoam[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersCascadeFoamSource[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersLevel; +float4 g_Crest_SamplingParametersCascadeLevel[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersScattering; +float4 g_Crest_SamplingParametersCascadeScattering[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersShadow; +float4 g_Crest_SamplingParametersCascadeShadow[MAX_LOD_COUNT]; +float4 g_Crest_SamplingParametersCascadeShadowSource[MAX_LOD_COUNT]; +CBUFFER_END + +#endif // CREST_INPUTS_DRIVEN_H diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl.meta new file mode 100644 index 0000000..303d8d8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c6fd0850e77df417eaf4485a17669d04 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl new file mode 100644 index 0000000..48bb0e5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl @@ -0,0 +1,84 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_MACROS_H +#define CREST_MACROS_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" + +#define m_CrestNameSpace namespace WaveHarmonic { namespace Crest { +#define m_CrestNameSpaceEnd } } + +#define m_Crest WaveHarmonic::Crest + +#define m_FloatMaximum 3.402823466e+38 + +#if (CREST_FULL_PRECISION_DISPLACEMENT != 0) +#define m_DisplacementTexture(texture, components) texture +#else +#define m_DisplacementTexture(texture, components) texture +#endif + +#define m_CrestVertex \ +m_Crest::Varyings Vertex(m_Crest::Attributes i_Input) \ +{ \ + return m_Crest::Vertex(i_Input); \ +} + +#define m_CrestFragment(type) \ +type Fragment(m_Crest::Varyings i_Input) : SV_Target \ +{ \ + return m_Crest::Fragment(i_Input); \ +} + +#define m_CrestFragmentVariant(type, name) \ +type Fragment(m_Crest::Varyings i_Input) : SV_Target \ +{ \ + return m_Crest::name(i_Input); \ +} + +#define m_CrestFragmentWithFrontFace(type) \ +type Fragment(m_Crest::Varyings i_Input, const bool i_IsFrontFace : SV_IsFrontFace) : SV_Target \ +{ \ + return m_Crest::Fragment(i_Input, i_IsFrontFace); \ +} + +#define m_CrestKernel(name) \ +void Crest##name(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Crest::name(id); \ +} + +#define m_CrestKernelVariant(name, variant) \ +void Crest##name##variant(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Crest::name(id); \ +} + +#define m_CrestKernelDefault(name) \ +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] \ +void Crest##name(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Crest::name(id); \ +} + +#define m_CrestInputKernel(name) \ +void Crest##name(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Crest::name(uint3(id.xy, g_Crest_LodCount - 1 - id.z)); \ +} + +#define m_CrestInputKernelDefault(name) \ +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] \ +void Crest##name(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Crest::name(uint3(id.xy, g_Crest_LodCount - 1 - id.z)); \ +} + +// Cross render pipeline kernels. +#define m_CrestKernelXRP(name) \ +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void Crest##name##BRP(uint3 id : SV_DispatchThreadID) { m_Crest::name(id); } \ +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void Crest##name##HRP(uint3 id : SV_DispatchThreadID) { m_Crest::name(id); } \ +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] void Crest##name##URP(uint3 id : SV_DispatchThreadID) { m_Crest::name(id); } \ + +#endif // CREST_MACROS_H diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl.meta new file mode 100644 index 0000000..da2d24b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: caa2db9eeee624124b0731445b09e163 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl new file mode 100644 index 0000000..b37a0a4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl @@ -0,0 +1,19 @@ +// +// This file was automatically generated. Please don't edit by hand. Execute Editor command [ Edit > Rendering > Generate Shader Includes ] instead +// + +#ifndef SETTINGS_CREST_HLSL +#define SETTINGS_CREST_HLSL +// +// WaveHarmonic.Crest.Editor.ShaderSettings: static fields +// +#define CREST_PACKAGE_HDRP (0) +#define CREST_PACKAGE_URP (1) +#define CREST_PORTALS (0) +#define CREST_SHIFTING_ORIGIN (0) +#define CREST_FULL_PRECISION_DISPLACEMENT (1) +#define CREST_DISCARD_ATMOSPHERIC_SCATTERING (1) +#define CREST_LEGACY_UNDERWATER (0) + + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl.meta new file mode 100644 index 0000000..fef3414 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 38f675942a9ca46a58afd1191b304f11 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl new file mode 100644 index 0000000..c7c8fb5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// The const keyword for PSSL solves the following: +// > Shader error in '': Program '', member function '' not viable: 'this' argument has +// > type ' const', but function is not marked const +// This appears to be PSSL only feature as the fix throws a compiler error elsewhere (comprehensive test not done). I +// tried putting const at the beginning of the function signature which compiles but did not solve the problem on PSSL +// so must be different. + +#ifndef CREST_TEXTURE_INCLUDED +#define CREST_TEXTURE_INCLUDED + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + +#ifdef SHADER_API_PSSL +#define m_ConstantReturn const +#else +#define m_ConstantReturn +#endif + +m_CrestNameSpace + +struct TiledTexture +{ + Texture2D _texture; + SamplerState _sampler; + half _size; + half _scale; + half _speed; + float _texel; + + static TiledTexture Make + ( + in const Texture2D i_texture, + in const SamplerState i_sampler, + in const float4 i_size, + in const half i_scale, + in const half i_speed + ) + { + TiledTexture tiledTexture; + tiledTexture._texture = i_texture; + tiledTexture._sampler = i_sampler; + tiledTexture._scale = i_scale; + tiledTexture._speed = i_speed; + // Safely assume a square texture. + tiledTexture._size = i_size.z; + tiledTexture._texel = i_size.x; + return tiledTexture; + } + + half4 Sample(float2 uv) m_ConstantReturn + { + return SAMPLE_TEXTURE2D(_texture, _sampler, uv); + } + + half4 SampleLevel(float2 uv, float lod) m_ConstantReturn + { + return SAMPLE_TEXTURE2D_LOD(_texture, _sampler, uv, lod); + } +}; + +m_CrestNameSpaceEnd + +#endif // CREST_TEXTURE_INCLUDED diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl.meta new file mode 100644 index 0000000..3fc481f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4fc5f278802cd484a8ee3e944ec8f858 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility.meta new file mode 100644 index 0000000..a563d8d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 298ae417217804dd48e3925a84f28b28 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl new file mode 100644 index 0000000..e52da02 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl @@ -0,0 +1,74 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Helpers that will only be used for shaders (eg depth, lighting etc). + +#ifndef d_WaveHarmonic_Utility_Depth +#define d_WaveHarmonic_Utility_Depth + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl" + +// Silence Unity errors in SG editor. +#ifdef SHADERGRAPH_PREVIEW +#define LOAD_DEPTH_TEXTURE_X(a, b) 0 +#define TEXTURE2D_X(t) Texture2D t +#else +#define LOAD_DEPTH_TEXTURE_X(textureName, coord2) LOAD_TEXTURE2D_X(textureName, coord2).r +#endif + +m_UtilityNameSpace + +// Taken from: +// https://www.cyanilux.com/tutorials/depth/#depth-output +float LinearDepthToNonLinear(float depth, float4 zBufferParameters) +{ + return (1.0 - depth * zBufferParameters.y) / (depth * zBufferParameters.x); +} + +// Taken from: +// https://www.cyanilux.com/tutorials/depth/#depth-output +float EyeDepthToNonLinear(float depth, float4 zBufferParameters) +{ + return (1.0 - depth * zBufferParameters.w) / (depth * zBufferParameters.z); +} + +// Same as LinearEyeDepth except supports orthographic projection. Use projection keywords to restrict support to either +// of these modes as an optimisation. +float CrestLinearEyeDepth(const float i_rawDepth) +{ +#if !defined(_PROJECTION_ORTHOGRAPHIC) + // Handles UNITY_REVERSED_Z for us. +#if defined(UNITY_CG_INCLUDED) + float perspective = LinearEyeDepth(i_rawDepth); +#elif defined(UNITY_COMMON_INCLUDED) + float perspective = LinearEyeDepth(i_rawDepth, _ZBufferParams); +#endif +#endif // _PROJECTION + +#if !defined(_PROJECTION_PERSPECTIVE) + // Orthographic Depth taken and modified from: + // https://github.com/keijiro/DepthInverseProjection/blob/master/Assets/InverseProjection/Resources/InverseProjection.shader + float near = _ProjectionParams.y; + float far = _ProjectionParams.z; + float isOrthographic = unity_OrthoParams.w; + +#if defined(UNITY_REVERSED_Z) + float orthographic = lerp(far, near, i_rawDepth); +#else + float orthographic = lerp(near, far, i_rawDepth); +#endif // UNITY_REVERSED_Z +#endif // _PROJECTION + +#if defined(_PROJECTION_ORTHOGRAPHIC) + return orthographic; +#elif defined(_PROJECTION_PERSPECTIVE) + return perspective; +#else + // If a shader does not have the projection enumeration, then assume they want to support both projection modes. + return lerp(perspective, orthographic, isOrthographic); +#endif // _PROJECTION +} + +m_UtilityNameSpaceEnd + +#endif // d_WaveHarmonic_Utility_Depth diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl.meta new file mode 100644 index 0000000..c92d4c4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 941ad013a0cbf4dec8d525ee790f5c6e +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Filtering.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Filtering.hlsl new file mode 100644 index 0000000..f34ade8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Filtering.hlsl @@ -0,0 +1,71 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Utility_Filtering +#define d_WaveHarmonic_Utility_Filtering + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl" + +m_UtilityNameSpace + +// Taken from: +// https://gist.github.com/TheRealMJP/c83b8c0f46b63f3a88a5986f4fa982b1 +// +// The following code is licensed under the MIT license: +// https://gist.github.com/TheRealMJP/bc503b0b87b643d3505d41eab8b332ae +// +// Samples a texture with Catmull-Rom filtering, using 9 texture fetches instead of 16. +// See http://vec3.ca/bicubic-filtering-in-fewer-taps/ for more details +float4 SampleTextureCatmullRom(in Texture2D tex, in SamplerState linearSampler, in float2 uv, in float2 texSize) +{ + // We're going to sample a a 4x4 grid of texels surrounding the target UV coordinate. We'll do this by rounding + // down the sample location to get the exact center of our "starting" texel. The starting texel will be at + // location [1, 1] in the grid, where [0, 0] is the top left corner. + float2 samplePos = uv * texSize; + float2 texPos1 = floor(samplePos - 0.5f) + 0.5f; + + // Compute the fractional offset from our starting texel to our original sample location, which we'll + // feed into the Catmull-Rom spline function to get our filter weights. + float2 f = samplePos - texPos1; + + // Compute the Catmull-Rom weights using the fractional offset that we calculated earlier. + // These equations are pre-expanded based on our knowledge of where the texels will be located, + // which lets us avoid having to evaluate a piece-wise function. + float2 w0 = f * (-0.5f + f * (1.0f - 0.5f * f)); + float2 w1 = 1.0f + f * f * (-2.5f + 1.5f * f); + float2 w2 = f * (0.5f + f * (2.0f - 1.5f * f)); + float2 w3 = f * f * (-0.5f + 0.5f * f); + + // Work out weighting factors and sampling offsets that will let us use bilinear filtering to + // simultaneously evaluate the middle 2 samples from the 4x4 grid. + float2 w12 = w1 + w2; + float2 offset12 = w2 / (w1 + w2); + + // Compute the final UV coordinates we'll use for sampling the texture + float2 texPos0 = texPos1 - 1; + float2 texPos3 = texPos1 + 2; + float2 texPos12 = texPos1 + offset12; + + texPos0 /= texSize; + texPos3 /= texSize; + texPos12 /= texSize; + + float4 result = 0.0f; + result += tex.SampleLevel(linearSampler, float2(texPos0.x, texPos0.y), 0.0f) * w0.x * w0.y; + result += tex.SampleLevel(linearSampler, float2(texPos12.x, texPos0.y), 0.0f) * w12.x * w0.y; + result += tex.SampleLevel(linearSampler, float2(texPos3.x, texPos0.y), 0.0f) * w3.x * w0.y; + + result += tex.SampleLevel(linearSampler, float2(texPos0.x, texPos12.y), 0.0f) * w0.x * w12.y; + result += tex.SampleLevel(linearSampler, float2(texPos12.x, texPos12.y), 0.0f) * w12.x * w12.y; + result += tex.SampleLevel(linearSampler, float2(texPos3.x, texPos12.y), 0.0f) * w3.x * w12.y; + + result += tex.SampleLevel(linearSampler, float2(texPos0.x, texPos3.y), 0.0f) * w0.x * w3.y; + result += tex.SampleLevel(linearSampler, float2(texPos12.x, texPos3.y), 0.0f) * w12.x * w3.y; + result += tex.SampleLevel(linearSampler, float2(texPos3.x, texPos3.y), 0.0f) * w3.x * w3.y; + + return result; +} + +m_UtilityNameSpaceEnd + +#endif // d_WaveHarmonic_Utility_Filtering diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Filtering.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Filtering.hlsl.meta new file mode 100644 index 0000000..f6d9a2c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Filtering.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 65a9a0cfb233a4a418d51cbf55265c55 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl new file mode 100644 index 0000000..e94a647 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl @@ -0,0 +1,48 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Utility_Helpers +#define d_WaveHarmonic_Utility_Helpers + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl" + +m_UtilityNameSpace + +void Swap(inout float a, inout float b) +{ + float t = a; a = b; b = t; +} + +// Adapted from: +// https://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf +float3 ScreenSpaceDither(const float2 i_ScreenPosition) +{ + // Iestyn's RGB dither (7 asm instructions) from Portal 2 X360, slightly modified for VR. + float3 dither = dot(float2(171.0, 231.0), i_ScreenPosition.xy); + dither.rgb = frac(dither.rgb / float3(103.0, 71.0, 97.0)) - float3(0.5, 0.5, 0.5); + return (dither.rgb / 255.0); +} + +float2 WorldNormalToScreenDirection(const float3 i_PositionWS, const float3 i_NormalWS, const float4x4 i_MatrixVP, const float i_Offset) +{ + const float3 p0 = i_PositionWS; + const float3 p1 = p0 + i_NormalWS * i_Offset; + + const float4 clip0 = mul(i_MatrixVP, float4(p0, 1)); + const float4 clip1 = mul(i_MatrixVP, float4(p1, 1)); + + const float2 uv0 = (clip0.xy / clip0.w) * 0.5 + 0.5; + const float2 uv1 = (clip1.xy / clip1.w) * 0.5 + 0.5; + + float2 direction = normalize(uv1 - uv0); + +#if UNITY_UV_STARTS_AT_TOP + direction.y = -direction.y; +#endif + + return direction; +} + +m_UtilityNameSpaceEnd + +#endif // d_WaveHarmonic_Utility_Helpers diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl.meta new file mode 100644 index 0000000..5057f0e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 90443daddb561477ca109fbfe1d80fdd +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy.meta new file mode 100644 index 0000000..1e77282 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 31c666ce642464bd1901041e360703ef +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Common.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Common.hlsl new file mode 100644 index 0000000..0fc2a48 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Common.hlsl @@ -0,0 +1,4 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Empty. diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Common.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Common.hlsl.meta new file mode 100644 index 0000000..37fe44b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Common.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4ff429977add540198b8820ff8f0cd7a +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl new file mode 100644 index 0000000..8d2de12 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl @@ -0,0 +1,35 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Builds on Unity's shim for Shader Graph. + +#define BUILTIN_TARGET_API 1 + +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/ShaderPass.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Defines.hlsl" +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/Shims.hlsl" +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Core.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/InputsDriven.hlsl" + +#ifndef d_WaveHarmonic_Utility_LegacyCore +#define d_WaveHarmonic_Utility_LegacyCore + + +// +// Inputs +// + +#undef UNITY_MATRIX_I_VP + +#if defined(STEREO_INSTANCING_ON) || defined(STEREO_MULTIVIEW_ON) +float4x4 _Crest_StereoInverseViewProjection[2]; +#define UNITY_MATRIX_I_VP _Crest_StereoInverseViewProjection[unity_StereoEyeIndex] +#else +float4x4 _Crest_InverseViewProjection; +#define UNITY_MATRIX_I_VP _Crest_InverseViewProjection +#endif + +// Not set and _ScreenParams.zw is "1.0 + 1.0 / _ScreenParams.xy" +#define _ScreenSize float4(_ScreenParams.xy, float2(1.0, 1.0) / _ScreenParams.xy) + +#endif // d_WaveHarmonic_Utility_LegacyCore diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl.meta new file mode 100644 index 0000000..ce3a63e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8501e8dffc440417cb78449e6079d3fa +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Defines.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Defines.hlsl new file mode 100644 index 0000000..f7c590f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Defines.hlsl @@ -0,0 +1,111 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Utility_ShaderGraphDefines +#define d_WaveHarmonic_Utility_ShaderGraphDefines + +// +// Defines +// + +#ifdef _BUILTIN_SPECULAR_SETUP +#define _SPECULAR_SETUP _BUILTIN_SPECULAR_SETUP +#endif + +#ifdef _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS +#define _TRANSPARENT_RECEIVES_SHADOWS _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS +#endif + + +// +// Passes +// + +#define SHADERPASS_FORWARD_ADD (20) +#define SHADERPASS_DEFERRED (21) +#define SHADERPASS_MOTION_VECTORS (22) + + +// +// Deferred Fix +// + +#if (defined(SHADER_API_GLES3) && !defined(SHADER_API_DESKTOP)) || defined(SHADER_API_GLES) || defined(SHADER_API_N3DS) + #define UNITY_ALLOWED_MRT_COUNT 4 +#else + #define UNITY_ALLOWED_MRT_COUNT 8 +#endif + +// Required on Windows (and possibly others) to prevent tiling. +#undef UNITY_SAMPLE_FULL_SH_PER_PIXEL +#define UNITY_SAMPLE_FULL_SH_PER_PIXEL 1 + + +// +// Stereo Instancing Fix +// + +#if defined(STEREO_INSTANCING_ON) && (defined(SHADER_API_D3D11) || defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE) || defined(SHADER_API_PSSL) || defined(SHADER_API_VULKAN) || (defined(SHADER_API_METAL) && !defined(UNITY_COMPILER_DXC))) +#define UNITY_STEREO_INSTANCING_ENABLED +#endif + +#if defined(STEREO_MULTIVIEW_ON) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE) || defined(SHADER_API_VULKAN)) && !(defined(SHADER_API_SWITCH)) +#define UNITY_STEREO_MULTIVIEW_ENABLED +#endif + +// Redeclared their includes to insert shadow declarations at the right spot. +// Adapted from: +// Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/Shims.hlsl + +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + +// Duplicate define in Macros.hlsl +#if defined (TRANSFORM_TEX) +#undef TRANSFORM_TEX +#endif + +#if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) +#undef GLOBAL_CBUFFER_START +#if defined(UNITY_STEREO_MULTIVIEW_ENABLED) || ((defined(UNITY_SINGLE_PASS_STEREO) || defined(UNITY_STEREO_INSTANCING_ENABLED)) && (defined(SHADER_API_GLCORE) || defined(SHADER_API_GLES3) || defined(SHADER_API_METAL))) + #define GLOBAL_CBUFFER_START(name) cbuffer name { + #define GLOBAL_CBUFFER_END } +#else + #define GLOBAL_CBUFFER_START(name) CBUFFER_START(name) + #define GLOBAL_CBUFFER_END CBUFFER_END +#endif +#endif + +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/HLSLSupportShim.hlsl" + +// Fix wrong definitions. +#undef UNITY_SAMPLE_TEX2DARRAY +#define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + + +// +// Transparent Objects Receives Shadows +// + +#if _SURFACE_TYPE_TRANSPARENT +#if _TRANSPARENT_RECEIVES_SHADOWS +#if SHADERPASS == SHADERPASS_FORWARD || SHADERPASS == SHADERPASS_FORWARD_ADD +#if DIRECTIONAL || DIRECTIONAL_COOKIE +#if !SHADOWS_SCREEN + +StructuredBuffer _Crest_WorldToShadow; + +// Declarations for shadow collector. +UNITY_DECLARE_SHADOWMAP(_ShadowMapTexture); +float4 _ShadowMapTexture_TexelSize; +#define SHADOWMAPSAMPLER_DEFINED 1 +#define SHADOWMAPSAMPLER_AND_TEXELSIZE_DEFINED 1 + +#define d_Crest_ShadowsOverriden 1 + +#endif +#endif +#endif +#endif +#endif + +#endif // d_WaveHarmonic_Utility_ShaderGraphDefines diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Defines.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Defines.hlsl.meta new file mode 100644 index 0000000..a33dbe0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Defines.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1d26727ac31d94682896ffbfdc685804 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/InputsDriven.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/InputsDriven.hlsl new file mode 100644 index 0000000..0fc2a48 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/InputsDriven.hlsl @@ -0,0 +1,4 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Empty. diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/InputsDriven.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/InputsDriven.hlsl.meta new file mode 100644 index 0000000..5db4b8d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/InputsDriven.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8e956ca85fd1846899d2a3b106267dcd +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/LegacyBuilding.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/LegacyBuilding.hlsl new file mode 100644 index 0000000..ff20499 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/LegacyBuilding.hlsl @@ -0,0 +1,109 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/LegacyBuilding.hlsl" + +// +// Transparent Objects Receives Shadows +// + +#if d_Crest_ShadowsOverriden + +#define unity_WorldToShadow _Crest_WorldToShadow + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Shadows.hlsl" + +#if defined(SHADER_API_MOBILE) +#define m_UnitySampleShadowmap_PCF UnitySampleShadowmap_PCF5x5 +#else +#define m_UnitySampleShadowmap_PCF UnitySampleShadowmap_PCF7x7 +#endif + +// Same as UnityComputeShadowFadeDistance, except it uses keywords. +float ComputeShadowFadeDistance(float3 positionWS, float viewZ) +{ + // Use keyword instead of unity_ShadowFadeCenterAndType.w, as we are already + // dependent on keywords anyway. + return +#if SHADOWS_SPLIT_SPHERES + distance(positionWS, unity_ShadowFadeCenterAndType.xyz); +#else + viewZ; +#endif +} + +float GetShadows(float3 positionWS, float4 uvLightMap) +{ + float viewZ = -UnityWorldToViewPos(positionWS).z; + float4 weights = GET_CASCADE_WEIGHTS(positionWS, viewZ); + float4 coordinates = GET_SHADOW_COORDINATES(float4(positionWS, 1.0), weights); +#if SHADOWS_SOFT + half shadow = m_UnitySampleShadowmap_PCF(coordinates, 0); +#else + half shadow = UNITY_SAMPLE_SHADOW(_ShadowMapTexture, coordinates); +#endif + shadow = lerp(_LightShadowData.r, 1.0, shadow); + + // Shadow Mask + mixed sun + static +#if LIGHTMAP_ON && SHADOWS_SHADOWMASK && LIGHTMAP_SHADOW_MIXING + float fade = UnityComputeShadowFade(ComputeShadowFadeDistance(positionWS, viewZ)); + half mask = UnitySampleBakedOcclusion(uvLightMap.xy, positionWS); + shadow = UnityMixRealtimeAndBakedShadows(shadow, mask, fade); +#endif + + return shadow; +} + +#ifdef DIRECTIONAL +#undef UNITY_LIGHT_ATTENUATION +#define UNITY_LIGHT_ATTENUATION(destName, input, worldPos) \ + fixed destName = GetShadows(worldPos, input.lmap); +#endif + +#ifdef DIRECTIONAL_COOKIE +#undef UNITY_LIGHT_ATTENUATION +#define UNITY_LIGHT_ATTENUATION(destName, input, worldPos) \ + DECLARE_LIGHT_COORD(input, worldPos); \ + fixed destName = tex2D(_LightTexture0, lightCoord).w * GetShadows(worldPos, input.lmap); +#endif + +#endif // d_Crest_ShadowsOverriden + + +// +// Specular +// + +#ifdef _SPECULAR_SETUP +#define SurfaceOutputStandard SurfaceOutputStandardSpecular +#define BuildStandardSurfaceOutput BuildStandardSpecularSurfaceOutput +#define LightingStandard LightingStandardSpecular +#define LightingStandard_GI LightingStandardSpecular_GI +#define LightingStandard_Deferred LightingStandardSpecular_Deferred + +#if SHADERPASS == SHADERPASS_FORWARD_ADD +#undef LightingStandard +#define LightingStandard(x, y, z) LightingStandardSpecular(x, y, z); c.rgb += o.Emission; +#endif +#endif + +#ifndef _SPECULAR_SETUP +#if SHADERPASS == SHADERPASS_FORWARD_ADD +#define LightingStandard(x, y, z) LightingStandard(x, y, z); c.rgb += o.Emission; +#endif // SHADERPASS_FORWARD_ADD +#endif // _SPECULAR_SETUP + +SurfaceOutputStandardSpecular BuildStandardSpecularSurfaceOutput(SurfaceDescription surfaceDescription, InputData inputData) +{ + SurfaceData surface = SurfaceDescriptionToSurfaceData(surfaceDescription); + + SurfaceOutputStandardSpecular o = (SurfaceOutputStandardSpecular)0; + o.Albedo = surface.albedo; + o.Normal = inputData.normalWS; + o.Specular = surface.specular; + o.Smoothness = surface.smoothness; + o.Occlusion = surface.occlusion; + o.Emission = surface.emission; + o.Alpha = surface.alpha; + return o; +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/LegacyBuilding.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/LegacyBuilding.hlsl.meta new file mode 100644 index 0000000..8ca1507 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/LegacyBuilding.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5eab24690c4a74ceca26a143da611306 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorCommon.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorCommon.hlsl new file mode 100644 index 0000000..6c7b065 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorCommon.hlsl @@ -0,0 +1,51 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// TODO: +// #if defined(USING_STEREO_MATRICES) +// float4x4 _StereoNonJitteredVP[2]; +// float4x4 _StereoPreviousVP[2]; +// #else +// float4x4 _NonJitteredVP; +// float4x4 _PreviousVP; +// #endif + +float4x4 _PreviousM; +float4x4 _PreviousVP; +float4x4 _NonJitteredVP; + +bool _HasLastPositionData; +bool _ForceNoMotion; +float _MotionVectorDepthBias; + +#undef UNITY_PREV_MATRIX_M +#define UNITY_PREV_MATRIX_M _PreviousM +#define _PrevViewProjMatrix _PreviousVP +#define _NonJitteredViewProjMatrix _NonJitteredVP + +// X : Use last frame positions (right now skinned meshes are the only objects that use this +// Y : Force No Motion +// Z : Z bias value +const static float4 unity_MotionVectorsParams = float4(_HasLastPositionData, !_ForceNoMotion, _MotionVectorDepthBias, 0); + +// Unity will populate this, but could not see when in source. +float4 _LastTime; + +// We want to gather some internal data from the BuildVaryings call to +// avoid rereading and recalculating these values again in the ShaderGraph motion vector pass +struct MotionVectorPassOutput +{ + float3 positionOS; + float3 positionWS; +}; + +SurfaceDescription BuildSurfaceDescription(Varyings varyings) +{ + SurfaceDescriptionInputs surfaceDescriptionInputs = BuildSurfaceDescriptionInputs(varyings); + SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs); + return surfaceDescription; +} + +// Very hacky, but works! +#define BuildVaryings(content) BuildVaryings(content, inout MotionVectorPassOutput motionVectorOutput) +#define TransformObjectToWorld(content) TransformObjectToWorld(content); motionVectorOutput.positionOS = input.positionOS; motionVectorOutput.positionWS = positionWS; diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorCommon.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorCommon.hlsl.meta new file mode 100644 index 0000000..b1712a8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorCommon.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1eacca53c60984c4a8cadb624777e644 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorPass.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorPass.hlsl new file mode 100644 index 0000000..1db22e6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorPass.hlsl @@ -0,0 +1,159 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Adapted from: +// Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/MotionVectorPass.hlsl + +// This file is subject to the Unity Companion License: +// https://github.com/Unity-Technologies/Graphics/blob/61584ec20cf305929dae85cec7b94ff2ed3942f3/LICENSE.md + +#ifndef SG_MOTION_VECTORS_PASS_INCLUDED +#define SG_MOTION_VECTORS_PASS_INCLUDED + +#undef BuildVaryings +#undef TransformObjectToWorld + +float2 CalcNdcMotionVectorFromCsPositions(float4 posCS, float4 prevPosCS) +{ + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + return float2(0.0, 0.0); + + // Non-uniform raster needs to keep the posNDC values in float to avoid additional conversions + // since uv remap functions use floats + float2 posNDC = posCS.xy * rcp(posCS.w); + float2 prevPosNDC = prevPosCS.xy * rcp(prevPosCS.w); + + float2 velocity; + { + // Calculate forward velocity + velocity = (posNDC.xy - prevPosNDC.xy); + #if UNITY_UV_STARTS_AT_TOP + velocity.y = -velocity.y; + #endif + + // Convert velocity from NDC space (-1..1) to UV 0..1 space + // Note: It doesn't mean we don't have negative values, we store negative or positive offset in UV space. + // Note: ((posNDC * 0.5 + 0.5) - (prevPosNDC * 0.5 + 0.5)) = (velocity * 0.5) + velocity.xy *= 0.5; + } + + return velocity; +} + +struct MotionVectorPassAttributes +{ + float3 previousPositionOS : TEXCOORD4; // Contains previous frame local vertex position (for skinned meshes) +}; + +// Note: these will have z == 0.0f in the pixel shader to save on bandwidth +struct MotionVectorPassVaryings +{ + float4 positionCSNoJitter; + float4 previousPositionCSNoJitter; +}; + +struct PackedMotionVectorPassVaryings +{ + float3 positionCSNoJitter : CLIP_POSITION_NO_JITTER; + float3 previousPositionCSNoJitter : PREVIOUS_CLIP_POSITION_NO_JITTER; +}; + +PackedMotionVectorPassVaryings PackMotionVectorVaryings(MotionVectorPassVaryings regularVaryings) +{ + PackedMotionVectorPassVaryings packedVaryings; + packedVaryings.positionCSNoJitter = regularVaryings.positionCSNoJitter.xyw; + packedVaryings.previousPositionCSNoJitter = regularVaryings.previousPositionCSNoJitter.xyw; + return packedVaryings; +} + +MotionVectorPassVaryings UnpackMotionVectorVaryings(PackedMotionVectorPassVaryings packedVaryings) +{ + MotionVectorPassVaryings regularVaryings; + regularVaryings.positionCSNoJitter = float4(packedVaryings.positionCSNoJitter.xy, 0, packedVaryings.positionCSNoJitter.z); + regularVaryings.previousPositionCSNoJitter = float4(packedVaryings.previousPositionCSNoJitter.xy, 0, packedVaryings.previousPositionCSNoJitter.z); + return regularVaryings; +} + +float3 GetLastFrameDeformedPosition(Attributes input, MotionVectorPassOutput currentFrameMvData, float3 previousPositionOS) +{ + Attributes lastFrameInputAttributes = input; + lastFrameInputAttributes.positionOS = previousPositionOS; + + VertexDescriptionInputs lastFrameVertexDescriptionInputs = BuildVertexDescriptionInputs(lastFrameInputAttributes); +#if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + lastFrameVertexDescriptionInputs.TimeParameters = _LastTime.yxz; +#endif + + VertexDescription lastFrameVertexDescription = VertexDescriptionFunction(lastFrameVertexDescriptionInputs); + previousPositionOS = lastFrameVertexDescription.Position.xyz; + + return previousPositionOS; +} + +// ------------------------------------- +// Vertex +void vert( + Attributes input, + MotionVectorPassAttributes passInput, + out PackedMotionVectorPassVaryings packedMvOutput, + out PackedVaryings packedOutput) +{ + Varyings output = (Varyings)0; + MotionVectorPassVaryings mvOutput = (MotionVectorPassVaryings)0; + MotionVectorPassOutput currentFrameMvData = (MotionVectorPassOutput)0; + output = BuildVaryings(input, currentFrameMvData); + packedOutput = PackVaryings(output); + + const bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? passInput.previousPositionOS : input.positionOS; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + +#if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(input, currentFrameMvData, previousPositionOS); + else + previousPositionOS = currentFrameMvData.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= currentFrameMvData.motionVector; + #endif +#endif + + mvOutput.positionCSNoJitter = mul(_NonJitteredViewProjMatrix, float4(currentFrameMvData.positionWS, 1.0f)); + mvOutput.previousPositionCSNoJitter = mul(_PrevViewProjMatrix, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f))); + } + + packedMvOutput = PackMotionVectorVaryings(mvOutput); +} + +// ------------------------------------- +// Fragment +float4 frag( + // Note: packedMvInput needs to be before packedInput as otherwise we get the following error in the speed tree 8 SG: + // "Non system-generated input signature parameter () cannot appear after a system generated value" + PackedMotionVectorPassVaryings packedMvInput, + PackedVaryings packedInput) : SV_Target +{ + Varyings input = UnpackVaryings(packedInput); + MotionVectorPassVaryings mvInput = UnpackMotionVectorVaryings(packedMvInput); + UNITY_SETUP_INSTANCE_ID(input); + SurfaceDescription surfaceDescription = BuildSurfaceDescription(input); + +#if defined(_ALPHATEST_ON) + clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold); +#endif + + return float4(CalcNdcMotionVectorFromCsPositions(mvInput.positionCSNoJitter, mvInput.previousPositionCSNoJitter), 0, 0); +} +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorPass.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorPass.hlsl.meta new file mode 100644 index 0000000..10831ff --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/MotionVectorPass.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ae5323918c4b24b5c87c6f941810e225 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Shadows.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Shadows.hlsl new file mode 100644 index 0000000..7fd90a7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Shadows.hlsl @@ -0,0 +1,105 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Copyright (c) 2016 Unity Technologies +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Taken from: +// 2020.3.12f1/DefaultResourcesExtra/Internal-ScreenSpaceShadows.shader + +#include "UnityShadowLibrary.cginc" + +#ifndef SHADOWMAPSAMPLER_DEFINED +UNITY_DECLARE_SHADOWMAP(_ShadowMapTexture); +#define SHADOWMAPSAMPLER_DEFINED + +#ifndef SHADOWMAPSAMPLER_AND_TEXELSIZE_DEFINED +float4 _ShadowMapTexture_TexelSize; +#define SHADOWMAPSAMPLER_AND_TEXELSIZE_DEFINED +#endif +#endif + +// +// Keywords based defines +// +#if defined (SHADOWS_SPLIT_SPHERES) + #define GET_CASCADE_WEIGHTS(wpos, z) getCascadeWeights_splitSpheres(wpos) +#else + #define GET_CASCADE_WEIGHTS(wpos, z) getCascadeWeights( wpos, z ) +#endif + +#if defined (SHADOWS_SINGLE_CASCADE) + #define GET_SHADOW_COORDINATES(wpos,cascadeWeights) getShadowCoord_SingleCascade(wpos) +#else + #define GET_SHADOW_COORDINATES(wpos,cascadeWeights) getShadowCoord(wpos,cascadeWeights) +#endif + +/** + * Gets the cascade weights based on the world position of the fragment. + * Returns a float4 with only one component set that corresponds to the appropriate cascade. + */ +inline fixed4 getCascadeWeights(float3 wpos, float z) +{ + fixed4 zNear = float4( z >= _LightSplitsNear ); + fixed4 zFar = float4( z < _LightSplitsFar ); + fixed4 weights = zNear * zFar; + return weights; +} + +/** + * Gets the cascade weights based on the world position of the fragment and the poisitions of the split spheres for each cascade. + * Returns a float4 with only one component set that corresponds to the appropriate cascade. + */ +inline fixed4 getCascadeWeights_splitSpheres(float3 wpos) +{ + float3 fromCenter0 = wpos.xyz - unity_ShadowSplitSpheres[0].xyz; + float3 fromCenter1 = wpos.xyz - unity_ShadowSplitSpheres[1].xyz; + float3 fromCenter2 = wpos.xyz - unity_ShadowSplitSpheres[2].xyz; + float3 fromCenter3 = wpos.xyz - unity_ShadowSplitSpheres[3].xyz; + float4 distances2 = float4(dot(fromCenter0,fromCenter0), dot(fromCenter1,fromCenter1), dot(fromCenter2,fromCenter2), dot(fromCenter3,fromCenter3)); + fixed4 weights = float4(distances2 < unity_ShadowSplitSqRadii); + weights.yzw = saturate(weights.yzw - weights.xyz); + return weights; +} + +/** + * Returns the shadowmap coordinates for the given fragment based on the world position and z-depth. + * These coordinates belong to the shadowmap atlas that contains the maps for all cascades. + */ +inline float4 getShadowCoord( float4 wpos, fixed4 cascadeWeights ) +{ + float3 sc0 = mul (unity_WorldToShadow[0], wpos).xyz; + float3 sc1 = mul (unity_WorldToShadow[1], wpos).xyz; + float3 sc2 = mul (unity_WorldToShadow[2], wpos).xyz; + float3 sc3 = mul (unity_WorldToShadow[3], wpos).xyz; + float4 shadowMapCoordinate = float4(sc0 * cascadeWeights[0] + sc1 * cascadeWeights[1] + sc2 * cascadeWeights[2] + sc3 * cascadeWeights[3], 1); +#if defined(UNITY_REVERSED_Z) + float noCascadeWeights = 1 - dot(cascadeWeights, float4(1, 1, 1, 1)); + shadowMapCoordinate.z += noCascadeWeights; +#endif + return shadowMapCoordinate; +} + +/** + * Same as the getShadowCoord; but optimized for single cascade + */ +inline float4 getShadowCoord_SingleCascade( float4 wpos ) +{ + return float4( mul (unity_WorldToShadow[0], wpos).xyz, 0); +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Shadows.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Shadows.hlsl.meta new file mode 100644 index 0000000..c16fdd5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Shadows.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 14d63b54d73024767903a5caa23e8e53 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl new file mode 100644 index 0000000..d6d36d7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl @@ -0,0 +1,153 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Based on tutorial: https://connect.unity.com/p/adding-your-own-hlsl-code-to-shader-graph-the-custom-function-node + +#ifndef CREST_LIGHTING_H +#define CREST_LIGHTING_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + +#if CREST_URP +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" + +// Unity renamed keyword. +#ifdef USE_FORWARD_PLUS +#define USE_CLUSTER_LIGHT_LOOP USE_FORWARD_PLUS +#endif // USE_FORWARD_PLUS +#endif // CREST_URP + +#if CREST_HDRP +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + +#if UNITY_VERSION < 202310 +#define GetMeshRenderingLayerMask GetMeshRenderingLightLayer +#endif // UNITY_VERSION + +#if UNITY_VERSION < 60000000 +#if PROBE_VOLUMES_L1 +#define AMBIENT_PROBE_BUFFER 1 +#endif // PROBE_VOLUMES_L1 +#endif // UNITY_VERSION +#endif // CREST_HDRP + +m_CrestNameSpace + +void PrimaryLight +( + const float3 i_PositionWS, + out half3 o_Color, + out half3 o_Direction +) +{ +#if CREST_HDRP + // We could get the main light the same way we get the main light shadows, + // but most of the data would be missing (including below horizon + // attenuation) which would require re-running the light loop which is expensive. + o_Direction = g_Crest_PrimaryLightDirection; + o_Color = g_Crest_PrimaryLightIntensity; +#elif CREST_URP + // Actual light data from the pipeline. + Light light = GetMainLight(); + o_Direction = light.direction; + o_Color = light.color; +#elif CREST_BIRP +#ifndef USING_DIRECTIONAL_LIGHT + // Yes. This function wants the world position of the surface. + o_Direction = normalize(UnityWorldSpaceLightDir(i_PositionWS)); +#else + o_Direction = _WorldSpaceLightPos0.xyz; + // Prevents divide by zero. + if (all(o_Direction == 0)) o_Direction = half3(0.0, 1.0, 0.0); +#endif + o_Color = _LightColor0.rgb; +#if SHADERPASS == SHADERPASS_FORWARD_ADD +#if !SHADOWS_SCREEN + // FIXME: undeclared identifier 'IN' in Pass: BuiltIn ForwardAdd, Vertex program with DIRECTIONAL SHADOWS_SCREEN + UNITY_LIGHT_ATTENUATION(attenuation, IN, i_PositionWS) + o_Color *= attenuation; +#endif +#endif +#endif +} + +half3 AmbientLight(const half3 i_AmbientLight) +{ + half3 ambient = i_AmbientLight; + +#ifndef SHADERGRAPH_PREVIEW +#if CREST_HDRP + // Allows control of baked lighting through volume framework. + // We could create a BuiltinData struct which would have rendering layers on it, but it seems more complicated. + ambient *= GetIndirectDiffuseMultiplier(GetMeshRenderingLayerMask()); +#endif // CREST_HDRP +#endif // SHADERGRAPH_PREVIEW + + return ambient; +} + +half3 AmbientLight() +{ + // Use the constant term (0th order) of SH stuff - this is the average. + const half3 ambient = +#if AMBIENT_PROBE_BUFFER + half3(_AmbientProbeData[0].w, _AmbientProbeData[1].w, _AmbientProbeData[2].w); +#else + half3(unity_SHAr.w, unity_SHAg.w, unity_SHAb.w); +#endif + + return AmbientLight(ambient); +} + +half3 AdditionalLighting(const float3 i_PositionWS, const float4 i_ScreenPosition, const float2 i_StaticLightMapUV) +{ + half3 color = 0.0; + +#if CREST_URP +#if defined(_ADDITIONAL_LIGHTS) + + // Shadowmask. +#if defined(SHADOWS_SHADOWMASK) && defined(LIGHTMAP_ON) + half4 shadowMask = SAMPLE_SHADOWMASK(i_StaticLightMapUV); +#elif !defined(LIGHTMAP_ON) + half4 shadowMask = unity_ProbesOcclusion; +#else + half4 shadowMask = half4(1, 1, 1, 1); +#endif + + uint pixelLightCount = GetAdditionalLightsCount(); + +#ifdef _LIGHT_LAYERS + uint meshRenderingLayers = GetMeshRenderingLayer(); +#endif + +#if USE_CLUSTER_LIGHT_LOOP + InputData inputData = (InputData)0; + // For Foward+ LIGHT_LOOP_BEGIN macro uses inputData.normalizedScreenSpaceUV and inputData.positionWS. + inputData.normalizedScreenSpaceUV = i_ScreenPosition.xy / i_ScreenPosition.w; + inputData.positionWS = i_PositionWS; +#endif + +LIGHT_LOOP_BEGIN(pixelLightCount) + // Includes shadows and cookies. + Light light = GetAdditionalLight(lightIndex, i_PositionWS, shadowMask); +#ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) +#endif + { + color += light.color * (light.distanceAttenuation * light.shadowAttenuation); + } +LIGHT_LOOP_END +#endif // _ADDITIONAL_LIGHTS +#endif // CREST_URP + + // HDRP todo. + // BIRP has additional lights as additional passes. Handled elsewhere. + + return color; +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl.meta new file mode 100644 index 0000000..35a379f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 986eee3bc5a7a49f7a6a1f94c96d22e8 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl new file mode 100644 index 0000000..d2a7d38 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl @@ -0,0 +1,50 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Utility_Macros +#define d_WaveHarmonic_Utility_Macros + +#define m_UtilityNameSpace namespace WaveHarmonic { namespace Utility { +#define m_UtilityNameSpaceEnd } } + +#define m_Utility WaveHarmonic::Utility + +#define m_UtilityVertex \ +m_Utility::Varyings Vertex(m_Utility::Attributes i_Input) \ +{ \ + return m_Utility::Vertex(i_Input); \ +} + +#define m_UtilityFragment(type) \ +type Fragment(m_Utility::Varyings i_Input) : SV_Target \ +{ \ + return m_Utility::Fragment(i_Input); \ +} + +#define m_UtilityKernel(name) \ +void Crest##name(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Utility::name(id); \ +} + +#define m_UtilityKernelVariant(name, variant) \ +void Crest##name##variant(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Utility::name(id); \ +} + +#define m_UtilityKernelDefault(name) \ +[numthreads(8, 8, 1)] \ +void Crest##name(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Utility::name(id); \ +} + +#define m_UtilityKernelDefaultVariant(name, variant) \ +[numthreads(8, 8, 1)] \ +void Crest##name##variant(uint3 id : SV_DispatchThreadID) \ +{ \ + m_Utility::name(id); \ +} + +#endif // d_WaveHarmonic_Utility_Macros diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl.meta new file mode 100644 index 0000000..f390288 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ac63edd7bcb3b4b35a5ea50c7deb4202 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise.meta new file mode 100644 index 0000000..70ea5c8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 85562641776fc423e829bb13477e80f3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Noise.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Noise.hlsl new file mode 100644 index 0000000..c9ac441 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Noise.hlsl @@ -0,0 +1,35 @@ +// See header/license in SOURCE.txt file accompanying this shader. + +// Trivial modifications made to the code to translate it to HLSL by Huw Bowles + +#ifndef CREST_GPU_NOISE_INCLUDED +#define CREST_GPU_NOISE_INCLUDED + +uint baseHash(uint3 p) +{ + p = 1103515245U * ((p.xyz >> 1U) ^ (p.yzx)); + uint h32 = 1103515245U * ((p.x^p.z) ^ (p.y >> 3U)); + return h32 ^ (h32 >> 16); +} + +float hash13(uint3 x) +{ + uint n = baseHash(x); + return float(n)*(1.0 / float(0xffffffffU)); +} + +float2 hash23(float3 x) +{ + uint n = baseHash(x); + uint2 rz = uint2(n, n * 48271U); //see: http://random.mat.sbg.ac.at/results/karl/server/node4.html + return float2(rz.xy & (uint2)0x7fffffffU) / float(0x7fffffff); +} + +float3 hash33(uint3 x) +{ + uint n = baseHash(x); + uint3 rz = uint3(n, n * 16807U, n * 48271U); //see: http://random.mat.sbg.ac.at/results/karl/server/node4.html + return float3(rz & (uint3)0x7fffffffU) / float(0x7fffffff); +} + +#endif // CREST_GPU_NOISE_INCLUDED diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Noise.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Noise.hlsl.meta new file mode 100644 index 0000000..d7438df --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Noise.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f79fd5a427da4de09803ded352ecfb1 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Source.txt b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Source.txt new file mode 100644 index 0000000..9120406 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Source.txt @@ -0,0 +1,10 @@ +Source: https://www.shadertoy.com/view/Xt3cDn +Modifications: Trivial modifications made to the code to translate it to HLSL. + +Copyright Notice: + +Quality hashes collection +by nimitz 2018 (twitter: @stormoid) + +The MIT License +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Source.txt.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Source.txt.meta new file mode 100644 index 0000000..de78c58 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Noise/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1ae623fc941b44349a1836e6ab666922 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP.meta new file mode 100644 index 0000000..0fffe08 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 389b0f071dd5843c394f5255cd6ec73c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl new file mode 100644 index 0000000..587d65f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl @@ -0,0 +1,71 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Utility_RenderPipeline_Compute +#define d_WaveHarmonic_Utility_RenderPipeline_Compute + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" + +// Compute does not have an equivalent of PackageRequirements. +// We must handle it ourselves. + +// Fallback to BIRP if HDRP package missing. +#if _HRP +#if (CREST_PACKAGE_HDRP != 1) +#undef _HRP +#define _BRP 1 +#endif +#endif + +// Fallback to BIRP if URP package missing. +#if _URP +#if (CREST_PACKAGE_URP != 1) +#undef _URP +#define _BRP 1 +#endif +#endif + +#if _BRP +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" +#endif + +#if _HRP +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" +#endif + +#if _URP +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" +#endif + + +// +// Stereo Rendering +// + +// Unity 6 only, but had compilation errors for non HDRP anyway: +// #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureXR.hlsl" + +#ifndef RW_TEXTURE2D_X +#if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) + #define COORD_TEXTURE2D_X(pixelCoord) uint3(pixelCoord, SLICE_ARRAY_INDEX) + #define RW_TEXTURE2D_X(type, textureName) RW_TEXTURE2D_ARRAY(type, textureName) +#else // UNITY_STEREO + #define COORD_TEXTURE2D_X(pixelCoord) pixelCoord + #define RW_TEXTURE2D_X RW_TEXTURE2D +#endif // UNITY_STEREO +#endif // RW_TEXTURE2D_X + +#ifndef UNITY_XR_ASSIGN_VIEW_INDEX +// Helper macro to assign view index during compute/ray pass (usually from SV_DispatchThreadID or DispatchRaysIndex()) +#if defined(SHADER_STAGE_COMPUTE) || defined(SHADER_STAGE_RAY_TRACING) + #if defined(UNITY_STEREO_INSTANCING_ENABLED) + #define UNITY_XR_ASSIGN_VIEW_INDEX(viewIndex) unity_StereoEyeIndex = viewIndex; + #else + #define UNITY_XR_ASSIGN_VIEW_INDEX(viewIndex) + #endif +#endif +#endif // UNITY_XR_ASSIGN_VIEW_INDEX + +#endif // d_WaveHarmonic_Utility_RenderPipeline_Compute diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl.meta new file mode 100644 index 0000000..3c17dd1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 68cb1a44e787e45bd9de666d527b10f2 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP.meta new file mode 100644 index 0000000..b4dac60 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ff5a7cc0943db46db9eac87f50e38097 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl new file mode 100644 index 0000000..d67b0eb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl @@ -0,0 +1,12 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Utility_RenderPipeline_HDRP_Common +#define d_WaveHarmonic_Utility_RenderPipeline_HDRP_Common + +#define LoadSceneColor LoadCameraColor +#define LoadSceneDepth LoadCameraDepth +#define SampleSceneColor SampleCameraColor +#define SampleSceneDepth SampleCameraDepth + +#endif // d_WaveHarmonic_Utility_RenderPipeline_HDRP_Common diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl.meta new file mode 100644 index 0000000..1e5e646 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 327c164f365e1468789c5950ac945e17 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Shadows.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Shadows.hlsl new file mode 100644 index 0000000..df79001 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Shadows.hlsl @@ -0,0 +1,107 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Utility_RenderPipeline_Shadows +#define d_WaveHarmonic_Utility_RenderPipeline_Shadows + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl" + +#if _BRP +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Shadows.hlsl" + +bool _Crest_ClearShadows; +#endif + +#if _HRP +// TODO: We might be able to expose this to give developers the option. +// #pragma multi_compile SHADOW_ULTRA_LOW SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH + +// Ultra low uses Gather to filter which should be same cost as not filtering. See algorithms per keyword: +// Runtime/Lighting/Shadow/HDShadowAlgorithms.hlsl +#define SHADOW_ULTRA_LOW +#define AREA_SHADOW_LOW +#define PUNCTUAL_SHADOW_ULTRA_LOW +#define DIRECTIONAL_SHADOW_ULTRA_LOW + +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/HDShadow.hlsl" +#endif + +#if _URP +// Maybe this is the equivalent of the SHADOW_COLLECTOR_PASS define? +// Inspired from com.unity.render-pipelines.universal/Shaders/Utils/ScreenSpaceShadows.shader +#define _MAIN_LIGHT_SHADOWS_CASCADE +#define MAIN_LIGHT_CALCULATE_SHADOWS + +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" +#endif + +m_UtilityNameSpace + +#if _BRP +half SampleShadows(const float4 i_positionWS) +{ + // NOTE: "Shadow Projection > Close Fit" can still produce artefacts when away from caster, but this + // appears to be an improvement over the compute shader. + + // Calculate depth. Normally this would be depth from the depth buffer. + float z = dot(i_positionWS.xyz - _WorldSpaceCameraPos.xyz, unity_CameraToWorld._m02_m12_m22); + + float4 weights = GET_CASCADE_WEIGHTS(i_positionWS.xyz, z); + float4 shadowCoord = GET_SHADOW_COORDINATES(i_positionWS, weights); + half shadows = UNITY_SAMPLE_SHADOW(_ShadowMapTexture, shadowCoord); + if (_Crest_ClearShadows) shadows = 1.0; + shadows = lerp(_LightShadowData.r, 1.0, shadows); + + return shadows; +} + +half ComputeShadowFade(const float4 i_positionWS) +{ + float z = dot(i_positionWS.xyz - _WorldSpaceCameraPos.xyz, unity_CameraToWorld._m02_m12_m22); + float fadeDistance = UnityComputeShadowFadeDistance(i_positionWS.xyz, z); + float fade = UnityComputeShadowFade(fadeDistance); + return fade; +} +#endif + +#if _HRP +half SampleShadows(const float4 i_positionWS) +{ + // Get directional light data. By definition we only have one directional light casting shadow. + DirectionalLightData light = _DirectionalLightDatas[_DirectionalShadowIndex]; + HDShadowContext context = InitShadowContext(); + + // Zeros are for screen space position and world space normal which are for filtering and normal bias + // respectively. They did not appear to have an impact. + half shadows = GetDirectionalShadowAttenuation(context, 0, i_positionWS.xyz, 0, _DirectionalShadowIndex, -light.forward); + // Apply shadow strength from main light. + shadows = LerpWhiteTo(shadows, light.shadowDimmer); + + return shadows; +} + +half ComputeShadowFade(const float4 i_positionWS) +{ + // TODO: Work out shadow fade. + return 0.0; +} +#endif + +#if _URP +half SampleShadows(const float4 i_positionWS) +{ + // Includes soft shadows if _SHADOWS_SOFT is defined (requires multi-compile pragma). + return MainLightRealtimeShadow(TransformWorldToShadowCoord(i_positionWS.xyz)); +} + +half ComputeShadowFade(const float4 i_positionWS) +{ + return GetShadowFade(i_positionWS.xyz); +} +#endif + +m_UtilityNameSpaceEnd + +#endif // d_WaveHarmonic_Utility_RenderPipeline_Shadows diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Shadows.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Shadows.hlsl.meta new file mode 100644 index 0000000..db96a6b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Shadows.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 07d6b2cd79ac04fa5b56cffd5fb1bb31 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Shadows.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Shadows.hlsl new file mode 100644 index 0000000..c5e7193 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Shadows.hlsl @@ -0,0 +1,85 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_SHADOWS_H +#define CREST_SHADOWS_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + +#if CREST_BIRP +TEXTURE2D_X(_Crest_ScreenSpaceShadowTexture); +float4 _Crest_ScreenSpaceShadowTexture_TexelSize; +#endif // CREST_BIRP + +#if CREST_URP +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" +#endif // CREST_URP + +#if CREST_HDRP +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + +#ifndef SHADERGRAPH_PREVIEW +#if CREST_HDRP_FORWARD_PASS +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/HDShadow.hlsl" +#endif // CREST_HDRP_FORWARD_PASS +#endif // SHADERGRAPH_PREVIEW +#endif // CREST_HDRP + +m_CrestNameSpace + +// Position: SRP = WS / BIRP = SS (z ignored) +half PrimaryLightShadows(const float3 i_Position, const float2 i_ScreenPosition) +{ + // Unshadowed. + half shadow = 1; + +#if CREST_URP + // We could skip GetMainLight but this is recommended approach which is likely more robust to API changes. + float4 shadowCoord = TransformWorldToShadowCoord(i_Position); + Light light = GetMainLight(TransformWorldToShadowCoord(i_Position)); + shadow = light.shadowAttenuation; +#endif + +#ifndef SHADERGRAPH_PREVIEW +#if CREST_HDRP_FORWARD_PASS + DirectionalLightData light = _DirectionalLightDatas[_DirectionalShadowIndex]; + HDShadowContext context = InitShadowContext(); + context.directionalShadowData = _HDDirectionalShadowData[_DirectionalShadowIndex]; + + float3 positionWS = GetCameraRelativePositionWS(i_Position); + // From Unity: + // > With XR single-pass and camera-relative: offset position to do lighting computations from the combined center view (original camera matrix). + // > This is required because there is only one list of lights generated on the CPU. Shadows are also generated once and shared between the instanced views. + ApplyCameraRelativeXR(positionWS); + + // TODO: Pass in screen space position and scene normal. + shadow = GetDirectionalShadowAttenuation + ( + context, + 0, // positionSS + positionWS, + 0, // normalWS + light.shadowIndex, + -light.forward + ); + + // Apply shadow strength from main light. + shadow = LerpWhiteTo(shadow, light.shadowDimmer); +#endif // CREST_HDRP_FORWARD_PASS +#endif // SHADERGRAPH_PREVIEW + +#if CREST_BIRP + shadow = LOAD_TEXTURE2D_X(_Crest_ScreenSpaceShadowTexture, min(i_ScreenPosition, _Crest_ScreenSpaceShadowTexture_TexelSize.zw - 1.0)).r; +#if DIRECTIONAL_COOKIE + const half attenuation = tex2D(_LightTexture0, mul(unity_WorldToLight, float4(i_Position, 1.0)).xy).w; + shadow = min(attenuation, shadow); +#endif +#endif + + return shadow; +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Shadows.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Shadows.hlsl.meta new file mode 100644 index 0000000..974f25f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Shadows.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b4623a51d04ef4e9c82e9196bf28e48d +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus.meta new file mode 100644 index 0000000..f71bc2d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82c6020b68d9a4708a39b711f87490f8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl new file mode 100644 index 0000000..3eaf237 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl @@ -0,0 +1,69 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Crest_Meniscus +#define d_WaveHarmonic_Crest_Meniscus + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + +float2 _Crest_HorizonNormal; + +TEXTURE2D_X(_Crest_WaterMaskTexture); + +m_CrestNameSpace + +struct Attributes +{ + uint id : SV_VertexID; + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; + UNITY_VERTEX_OUTPUT_STEREO +}; + +Varyings Vertex(Attributes input) +{ + Varyings output; + ZERO_INITIALIZE(Varyings, output); + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + output.positionCS = GetFullScreenTriangleVertexPosition(input.id, UNITY_RAW_FAR_CLIP_VALUE); + return output; +} + +half4 Fragment(Varyings input) +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + const uint2 positionSS = input.positionCS.xy; + const float mask = LOAD_TEXTURE2D_X(_Crest_WaterMaskTexture, positionSS).x; + const float2 offset = -((float2)mask) * _Crest_HorizonNormal; + float weight = 1.0; + + // Sample three pixels along the normal. If the sample is different than the + // current mask, apply meniscus. Offset must be added to positionSS as floats. + [unroll] + for (int i = 1; i <= 3; i++) + { + const float2 uv = positionSS + offset * (float)i; + const float newMask = LOAD_TEXTURE2D_X(_Crest_WaterMaskTexture, uv).r; + weight *= newMask != mask && newMask != 0.0 ? 0.9 : 1.0; + } + + return weight; +} + +m_CrestNameSpaceEnd + +m_CrestVertex +m_CrestFragment(half4) + +#endif // d_WaveHarmonic_Crest_Meniscus diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl.meta new file mode 100644 index 0000000..048c390 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0d256485a6a0c40f291276367afcede2 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl new file mode 100644 index 0000000..00912b3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl @@ -0,0 +1,263 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Crest_Meniscus +#define d_WaveHarmonic_Crest_Meniscus + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl" + +#if d_Portal +TEXTURE2D_X(_Crest_WaterMaskTexture); +TEXTURE2D_X(_Crest_PortalFogAfterTexture); +TEXTURE2D_X(_Crest_PortalFogBeforeTexture); +#endif + +#if d_Crest_Lighting +// Surface/Volume parameters. +half4 _Crest_Absorption; +half4 _Crest_Scattering; +half _Crest_Anisotropy; +half _Crest_DirectTerm; +half _Crest_AmbientTerm; +half _Crest_ShadowsAffectsAmbientFactor; + +// Volume parameters. +half _Crest_SunBoost; +half3 _Crest_AmbientLighting; +int _Crest_DataSliceOffset; +#endif + +half _Crest_Radius; +half _Crest_RefractionStrength; + +m_CrestNameSpace + +struct Attributes +{ +#if d_Crest_Geometry + float3 positionOS : POSITION; +#else + uint id : SV_VertexID; +#endif + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; +#if d_Crest_Geometry + float3 positionWS : TEXCOORD; +#else + float2 uv : TEXCOORD; +#endif + UNITY_VERTEX_OUTPUT_STEREO +}; + +Varyings Vertex(Attributes input) +{ + Varyings output; + ZERO_INITIALIZE(Varyings, output); + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + +#if d_Crest_Geometry + output.positionCS = TransformObjectToHClip(input.positionOS); + output.positionWS = TransformObjectToWorld(input.positionOS); +#else + output.positionCS = GetFullScreenTriangleVertexPosition(input.id); + output.uv = GetFullScreenTriangleTexCoord(input.id); +#endif + + return output; +} + +half4 Fragment(Varyings input) +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float3 positionWS; + float3 directionWS; + float2 uv; + +#if d_Crest_Geometry + { + positionWS = input.positionWS; +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xyz += _WorldSpaceCameraPos.xyz; +#endif + directionWS = GetWorldSpaceNormalizeViewDir(positionWS); + uv = input.positionCS.xy / _ScreenSize.xy; + } +#else + { +#if d_Portal + if (_Crest_Portal > 3) + { + // Only render if outside the portal. + if (LOAD_TEXTURE2D_X(_Crest_PortalFogBeforeTexture, input.positionCS.xy).r == 0.0 && LOAD_TEXTURE2D_X(_Crest_PortalFogAfterTexture, input.positionCS.xy).r > 0.0) + { + discard; + } + } + else + { + // Only render if inside the portal. + if (LOAD_TEXTURE2D_X(_Crest_WaterMaskTexture, input.positionCS.xy).r == 0.0) + { + discard; + } + + if (LOAD_TEXTURE2D_X(_Crest_PortalFogAfterTexture, input.positionCS.xy).r > 0.0) + { + discard; + } + } +#endif + + positionWS = ComputeWorldSpacePosition(input.uv, UNITY_NEAR_CLIP_VALUE, UNITY_MATRIX_I_VP); + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xyz += _WorldSpaceCameraPos.xyz; +#endif + + directionWS = GetWorldSpaceNormalizeViewDir(positionWS); + + uv = input.uv; + } +#endif + + const float height = SampleWaterLineHeight(positionWS.xz).r; + + // Double as we half it if below. + float radius = _Crest_Radius * 2.0; + +#if d_Crest_Refraction + // Double the radius as aggressive falloff makes it much smaller. + radius *= 2.0; +#endif + + float signedDistance = positionWS.y - height; + + float3 viewDirWS = normalize(_WorldSpaceCameraPos - positionWS); + + const float distance = abs(signedDistance); + + if (signedDistance < 0) + { + radius = max(0.002, radius * 0.25); + } + + if (distance > radius) + { + discard; + } + + half3 color = 0.0; + +#if d_Crest_Lighting + { + half3 absorption = _Crest_Absorption.xyz; + half3 scattering = _Crest_Scattering.xyz; + + // Keep the same as the volume. + const int sliceIndex = clamp(_Crest_DataSliceOffset, 0, g_Crest_LodCount - 2); + + if (g_Crest_SampleAbsorptionSimulation) absorption = Cascade::MakeAbsorption(sliceIndex).Sample(_WorldSpaceCameraPos.xz).xyz; + if (g_Crest_SampleScatteringSimulation) scattering = Cascade::MakeScattering(sliceIndex).Sample(_WorldSpaceCameraPos.xz).xyz; + + float3 lightDirection; float3 lightColor; + PrimaryLight(positionWS, lightColor, lightDirection); + + const half3 extinction = VolumeExtinction(absorption, scattering); + + half opacity = 1.0; +#if !d_Crest_Refraction + // Meniscus can look too dark in shallow water. + { + const float depth = Cascade::MakeDepth(sliceIndex).SampleSignedDepthFromSeaLevel(_WorldSpaceCameraPos.xz); + opacity = VolumeOpacity(extinction, depth * 0.25); + } +#endif + + half shadow = 1.0; + { + // Soft in red, hard in green. But hard not computed in HDRP. + shadow = 1.0 - Cascade::MakeShadow(sliceIndex).SampleShadow(_WorldSpaceCameraPos.xz).x; + } + + half3 lighting = VolumeLighting + ( + extinction, + scattering, + _Crest_Anisotropy, + shadow, + lerp(half3(0, 1, 0), directionWS, opacity), + AmbientLight(_Crest_AmbientLighting), + lerp(half3(0, -1, 0), lightDirection, opacity), + lightColor, + half3(0.0, 0.0, 0.0), // Additional lights + _Crest_AmbientTerm, + _Crest_DirectTerm, + _Crest_SunBoost, + _Crest_ShadowsAffectsAmbientFactor + ); + +#if CREST_HDRP + lighting *= GetCurrentExposureMultiplier(); +#endif + + color = lighting; + } +#endif + + const float falloff = 1.0 - smoothstep(0.0, radius, distance); + +#if d_Crest_Refraction + { + const half3 normal = SampleWaterLineNormal(positionWS.xz, height); + float2 dir = Utility::WorldNormalToScreenDirection(positionWS, normal, UNITY_MATRIX_VP, 0.01); + + const float aspect = _ScreenParams.x / _ScreenParams.y; + dir.x /= aspect; + + const float2 uvRefracted = uv - dir * falloff * _Crest_RefractionStrength; + + half3 scene = SampleSceneColor(uvRefracted); + + if (signedDistance >= 0) + { + // Blend back in with original. Cannot seem to do this with alpha without losing + // some lighting. + scene = lerp + ( + scene, + SampleSceneColor(uv), + saturate((distance / radius) * 5.0) + ); + } + + color = lerp(color, scene, 0.5); + } +#endif + + return float4(color, falloff); +} + +m_CrestNameSpaceEnd + +m_CrestVertex +m_CrestFragment(half4) + +#endif // d_WaveHarmonic_Crest_Meniscus diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl.meta new file mode 100644 index 0000000..533fe59 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f9eca4b9660d6423d89353a4148e9191 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.shader new file mode 100644 index 0000000..49a44c2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.shader @@ -0,0 +1,584 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Meniscus" +{ + Properties + { + _Crest_Radius("Radius", Range(0.001, 0.1)) = 0.01 + + [Space(10)] + + [Toggle(d_Crest_Refraction)] + _Crest_RefractionEnabled("Refraction", Integer) = 1 + _Crest_RefractionStrength("Refraction Strength", Range(0, 1)) = 0.2 + + [Space(10)] + + [Toggle(d_Crest_Lighting)] + _Crest_LightingEnabled("Lighting", Integer) = 1 + } + + HLSLINCLUDE + #pragma vertex Vertex + #pragma fragment Fragment + + // #pragma enable_d3d11_debug_symbols + ENDHLSL + + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.high-definition" + } + + Tags { "RenderPipeline"="HDRenderPipeline" } + + Blend SrcAlpha OneMinusSrcAlpha + ColorMask RGB + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Meniscus" + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus" + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl" + + #define d_Portal 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Front Face)" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl" + + #define d_Crest_Geometry 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Back Face)" + + Cull Front + ZTest LEqual + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl" + + #define d_Crest_Geometry 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + + // + // Obsolete. Depends on the raster mask. + // + + Pass + { + Name "Meniscus" + + Blend DstColor Zero + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Portal)" + + Blend DstColor Zero + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + // Full-screen only applicable portals with back-faces. + #define d_Crest_HasBackFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Front Face)" + + Blend DstColor Zero + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + #define d_Crest_Geometry 1 + #define d_Crest_FrontFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Back Face)" + + Blend DstColor Zero + Cull Front + ZTest LEqual + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + #define d_Crest_Geometry 1 + #define d_Crest_BackFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + } + + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.universal" + } + + Tags { "RenderPipeline"="UniversalPipeline" } + + Blend SrcAlpha OneMinusSrcAlpha + ColorMask RGB + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Meniscus" + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareOpaqueTexture.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus" + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareOpaqueTexture.hlsl" + + #define d_Portal 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Front Face)" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareOpaqueTexture.hlsl" + + #define d_Crest_Geometry 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Back Face)" + + Cull Front + ZTest LEqual + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareOpaqueTexture.hlsl" + + #define d_Crest_Geometry 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + + // + // Obsolete. Depends on the raster mask. + // + + Pass + { + Name "Meniscus" + + Blend DstColor Zero + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Portal)" + + Blend DstColor Zero + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + // Full-screen only applicable portals with back-faces. + #define d_Crest_HasBackFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Front Face)" + + Blend DstColor Zero + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #define d_Crest_Geometry 1 + #define d_Crest_FrontFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Back Face)" + + Blend DstColor Zero + Cull Front + ZTest LEqual + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #define d_Crest_Geometry 1 + #define d_Crest_BackFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + } + + SubShader + { + Blend SrcAlpha OneMinusSrcAlpha + ColorMask RGB + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Meniscus" + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + #include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/DeclareOpaqueTexture.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Portal)" + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + + #define d_Portal 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + #include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/DeclareOpaqueTexture.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + Name "Meniscus (Front)" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + #define d_Crest_Geometry 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + #include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/DeclareOpaqueTexture.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + Name "Meniscus (Back)" + + Cull Front + ZTest LEqual + + HLSLPROGRAM + #pragma shader_feature_local_fragment _ d_Crest_Refraction + #pragma shader_feature_local_fragment _ d_Crest_Lighting + #define d_Crest_Geometry 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + #include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/DeclareOpaqueTexture.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.hlsl" + ENDHLSL + } + + + // + // Obsolete. Depends on the raster mask. + // + + Pass + { + Name "Meniscus" + + Blend DstColor Zero + + HLSLPROGRAM + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.Obsolete.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Portal)" + + Blend DstColor Zero + + HLSLPROGRAM + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + + // Full-screen only applicable portals with back-faces. + #define d_Crest_HasBackFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Front Face)" + + Blend DstColor Zero + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + + #define d_Crest_Geometry 1 + #define d_Crest_FrontFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Meniscus (Back Face)" + + Blend DstColor Zero + Cull Front + ZTest LEqual + + HLSLPROGRAM + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + + #define d_Crest_Geometry 1 + #define d_Crest_BackFace 1 + + #include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Meniscus.hlsl" + ENDHLSL + } + } + + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.shader.meta new file mode 100644 index 0000000..7660dcd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Meniscus/Meniscus.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ec7c774912c6f4b3cb6d73444cdedeca +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface.meta new file mode 100644 index 0000000..7a86daa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e10a7ee554ae549eda8d60d1e17fc8bd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Alpha.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Alpha.hlsl new file mode 100644 index 0000000..39eb08a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Alpha.hlsl @@ -0,0 +1,42 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_ALPHA_H +#define CREST_WATER_ALPHA_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +m_CrestNameSpace + +float ClipSurface(const float2 i_PositionWSXZ) +{ + // Do not include transition slice to avoid blending as we do a black border instead. + uint slice0; uint slice1; float alpha; + PosToSliceIndices(i_PositionWSXZ, 0.0, g_Crest_LodCount - 1.0, g_Crest_WaterScale, slice0, slice1, alpha); + + const Cascade cascade0 = Cascade::Make(slice0); + const Cascade cascade1 = Cascade::Make(slice1); + const float weight0 = (1.0 - alpha) * cascade0._Weight; + const float weight1 = (1.0 - weight0) * cascade1._Weight; + + float value = 0.0; + + if (weight0 > m_CrestSampleLodThreshold) + { + Cascade::MakeClip(slice0).SampleClip(i_PositionWSXZ, weight0, value); + } + if (weight1 > m_CrestSampleLodThreshold) + { + Cascade::MakeClip(slice1).SampleClip(i_PositionWSXZ, weight1, value); + } + + return lerp(g_Crest_ClipByDefault, value, weight0 + weight1); +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Alpha.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Alpha.hlsl.meta new file mode 100644 index 0000000..19f2eae --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Alpha.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c1e69a8c6920249c1ad0b50907793046 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl new file mode 100644 index 0000000..0b0dd44 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl @@ -0,0 +1,181 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_CAUSTICS_H +#define CREST_WATER_CAUSTICS_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl" + +#if (CREST_SHIFTING_ORIGIN != 0) +#include "Packages/com.waveharmonic.crest.shifting-origin/Runtime/Shaders/ShiftingOrigin.hlsl" +#endif + +m_CrestNameSpace + +half3 Caustics +( + const float3 i_ScenePositionWS, + const float i_SurfacePositionY, + const half3 i_LightIntensity, + const half3 i_LightDirection, + const half i_LightShadow, + const float i_SceneDepth, + const TiledTexture i_CausticsTexture, + const half i_TextureAverage, + const half i_Strength, + const half i_FocalDepth, + const half i_DepthOfField, + const TiledTexture i_DistortionTexture, + const half i_DistortionStrength, + const half i_Blur, + const bool i_Underwater +) +{ + half sceneDepth = i_SurfacePositionY - i_ScenePositionWS.y; + + // Compute mip index manually, with bias based on sea floor depth. We compute it manually because if it is computed automatically it produces ugly patches + // where samples are stretched/dilated. The bias is to give a focusing effect to caustics - they are sharpest at a particular depth. This doesn't work amazingly + // well and could be replaced. + float mipLod = log2(i_SceneDepth) + abs(sceneDepth - i_FocalDepth) / i_DepthOfField + i_Blur; + + // Project along light dir, but multiply by a fudge factor reduce the angle bit - compensates for fact that in real life + // caustics come from many directions and don't exhibit such a strong directonality + // Removing the fudge factor (4.0) will cause the caustics to move around more with the waves. But this will also + // result in stretched/dilated caustics in certain areas. This is especially noticeable on angled surfaces. + float2 lightProjection = i_LightDirection.xz * sceneDepth / (4.0 * i_LightDirection.y); + + float3 cuv1 = 0.0; float3 cuv2 = 0.0; + { + float2 surfacePosXZ = i_ScenePositionWS.xz; + float surfacePosScale = 1.37; + +#if (CREST_SHIFTING_ORIGIN != 0) + // Apply tiled floating origin offset. Always needed. + surfacePosXZ -= ShiftingOriginOffset(i_CausticsTexture); + // Scale was causing popping. + surfacePosScale = 1.0; +#endif + + surfacePosXZ += lightProjection; + + float scale = i_CausticsTexture._scale / 10.0; + const float speed = g_Crest_Time * i_CausticsTexture._speed; + + cuv1 = float3 + ( + surfacePosXZ / scale + float2(0.044 * speed + 17.16, -0.169 * speed), + mipLod + ); + cuv2 = float3 + ( + surfacePosScale * surfacePosXZ / scale + float2(0.248 * speed, 0.117 * speed), + mipLod + ); + } + + if (i_Underwater) + { + float2 surfacePosXZ = i_ScenePositionWS.xz; + +#if (CREST_SHIFTING_ORIGIN != 0) + // Apply tiled floating origin offset. Always needed. + surfacePosXZ -= ShiftingOriginOffset(i_DistortionTexture); +#endif + + surfacePosXZ += lightProjection; + + float scale = i_DistortionTexture._scale / 10.0; + half2 causticN = i_DistortionStrength * UnpackNormal(i_DistortionTexture.Sample(surfacePosXZ / scale)).xy; + cuv1.xy += 1.30 * causticN; + cuv2.xy += 1.77 * causticN; + } + + half causticsStrength = i_Strength; + + // Occlusion. + { + causticsStrength *= i_LightShadow; + } + + return 1.0 + causticsStrength * + ( + 0.5 * i_CausticsTexture.SampleLevel(cuv1.xy, cuv1.z).xyz + + 0.5 * i_CausticsTexture.SampleLevel(cuv2.xy, cuv2.z).xyz + - i_TextureAverage + ); +} + +half3 Caustics +( + const Flow i_Flow, + const float3 i_ScenePositionWS, + const float i_SurfacePositionY, + const half3 i_LightIntensity, + const half3 i_LightDirection, + const half i_LightShadow, + const float i_SceneDepth, + const TiledTexture i_CausticsTexture, + const half i_TextureAverage, + const half i_Strength, + const half i_FocalDepth, + const half i_DepthOfField, + const TiledTexture i_DistortionTexture, + const half i_DistortionStrength, + const half i_Blur, + const bool i_Underwater +) +{ + half blur = 0.0; + half3 flow = half3(i_Flow._Flow.x, 0, i_Flow._Flow.y); + + if (i_Blur > 0.0) + { + // Calculate blur in flowing water as will likely be more disturbed, resulting in + // caustics being less defined. + blur = length(i_Flow._Flow) * i_Blur; + } + + return Caustics + ( + i_ScenePositionWS - flow * i_Flow._Offset0, + i_SurfacePositionY, + i_LightIntensity, + i_LightDirection, + i_LightShadow, + i_SceneDepth, + i_CausticsTexture, + i_TextureAverage, + i_Strength, + i_FocalDepth, + i_DepthOfField, + i_DistortionTexture, + i_DistortionStrength, + blur, + i_Underwater + ) * i_Flow._Weight0 + Caustics + ( + i_ScenePositionWS - flow * i_Flow._Offset1, + i_SurfacePositionY, + i_LightIntensity, + i_LightDirection, + i_LightShadow, + i_SceneDepth, + i_CausticsTexture, + i_TextureAverage, + i_Strength, + i_FocalDepth, + i_DepthOfField, + i_DistortionTexture, + i_DistortionStrength, + blur, + i_Underwater + ) * i_Flow._Weight1; +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl.meta new file mode 100644 index 0000000..18de7a2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b2ee0978718e447e3ab93a881f3d5dcf +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl new file mode 100644 index 0000000..42a6da3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl @@ -0,0 +1,41 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Crest_SurfaceData +#define d_WaveHarmonic_Crest_SurfaceData + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl" + +TEXTURE2D_FLOAT(_Crest_WaterLine); +float _Crest_WaterLineTexel; +float2 _Crest_WaterLineResolution; +float2 _Crest_WaterLineSnappedPosition; + +m_CrestNameSpace + +float SampleWaterLineHeight(const float2 i_PositionWS) +{ + const float2 uv = (i_PositionWS - _Crest_WaterLineSnappedPosition) / (_Crest_WaterLineTexel * _Crest_WaterLineResolution) + 0.5; + return _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv, 0).r + g_Crest_WaterCenter.y; +} + +half3 SampleWaterLineNormal(const float2 i_PositionWS, const float i_Height) +{ + const float2 uv = (i_PositionWS - _Crest_WaterLineSnappedPosition) / (_Crest_WaterLineTexel * _Crest_WaterLineResolution) + 0.5; + const float3 dd = float3(1.0 / _Crest_WaterLineResolution.xy, 0.0); + const float xOffset = _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv + dd.xz, 0).r; + const float zOffset = _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv + dd.zy, 0).r; + + return normalize(half3 + ( + (xOffset - i_Height) / _Crest_WaterLineTexel, + 1.0, + (zOffset - i_Height) / _Crest_WaterLineTexel + )); +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl.meta new file mode 100644 index 0000000..3673397 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 23b1ac5d9553947b69f3b3cfa0e3551d +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Facing.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Facing.hlsl new file mode 100644 index 0000000..4148dc6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Facing.hlsl @@ -0,0 +1,35 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Crest_SurfaceFacing +#define d_WaveHarmonic_Crest_SurfaceFacing + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + +TEXTURE2D_X(_Crest_WaterMaskTexture); + +m_CrestNameSpace + +bool IsUnderWater(const bool i_FrontFace, const int i_ForceUnderwater, const uint2 i_PositionSS) +{ + bool underwater = false; + + // Use mask. + if (i_ForceUnderwater == 0) + { + underwater = LOAD_TEXTURE2D_X(_Crest_WaterMaskTexture, i_PositionSS).r <= CREST_MASK_BELOW_SURFACE; + } + else + { + underwater = IsUnderWater(i_FrontFace, i_ForceUnderwater); + } + + return underwater; +} + +m_CrestNameSpaceEnd + +#endif // d_WaveHarmonic_Crest_SurfaceFacing diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Facing.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Facing.hlsl.meta new file mode 100644 index 0000000..9837f09 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Facing.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e6b28bd595bf6434facba01c0b5d41b9 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Foam.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Foam.hlsl new file mode 100644 index 0000000..1e012ce --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Foam.hlsl @@ -0,0 +1,224 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_FOAM_H +#define CREST_WATER_FOAM_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl" + +#if (CREST_SHIFTING_ORIGIN != 0) +#include "Packages/com.waveharmonic.crest.shifting-origin/Runtime/Shaders/ShiftingOrigin.hlsl" +#endif + +m_CrestNameSpace + +half WhiteFoamTexture +( + const TiledTexture i_Texture, + const half i_Foam, + const half i_Feather, + const float2 i_WorldXZ0, + const float2 i_WorldXZ1, + const float2 i_TexelOffset, + const half i_LodAlpha, + const Cascade i_CascadeData0 +) +{ + const float2 uvOffset = i_TexelOffset + g_Crest_Time * i_Texture._speed / 32.0; + // Scale with lods to get multiscale detail. 10 is magic number that gets the + // material 'scale' slider into an intuitive range. + const float scale = i_Texture._scale * i_CascadeData0._Scale / 10.0; + + half ft = lerp + ( + i_Texture.Sample((i_WorldXZ0 + uvOffset) / scale).r, + i_Texture.Sample((i_WorldXZ1 + uvOffset) / (2.0 * scale)).r, + i_LodAlpha + ); + + // Black point fade. + half result = saturate(1.0 - i_Foam); + return smoothstep(result, result + i_Feather, ft); +} + +half MultiScaleFoamAlbedo +( + const TiledTexture i_Texture, + const half i_Feather, + const half i_FoamData, + const Cascade i_CascadeData0, + const Cascade i_CascadeData1, + const half i_LodAlpha, + const float2 i_UndisplacedXZ +) +{ + float2 worldXZ0 = i_UndisplacedXZ; + float2 worldXZ1 = i_UndisplacedXZ; + +#if (CREST_SHIFTING_ORIGIN != 0) + // Apply tiled floating origin offset. Only needed if: + // - _FoamScale is a non integer value + // - _FoamScale is over 48 + worldXZ0 -= ShiftingOriginOffset(i_Texture, i_CascadeData0); + worldXZ1 -= ShiftingOriginOffset(i_Texture, i_CascadeData1); +#endif // CREST_SHIFTING_ORIGIN + + return WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, (float2)0.0, i_LodAlpha, i_CascadeData0); +} + +half2 MultiScaleFoamNormal +( + const TiledTexture i_Texture, + const half i_Feather, + const half i_NormalStrength, + const half i_FoamData, + const half i_FoamAlbedo, + const Cascade i_CascadeData0, + const Cascade i_CascadeData1, + const half i_LodAlpha, + const float2 i_UndisplacedXZ, + const float i_PixelZ +) +{ + float2 worldXZ0 = i_UndisplacedXZ; + float2 worldXZ1 = i_UndisplacedXZ; + +#if (CREST_SHIFTING_ORIGIN != 0) + // Apply tiled floating origin offset. Only needed if: + // - _FoamScale is a non integer value + // - _FoamScale is over 48 + worldXZ0 -= ShiftingOriginOffset(i_Texture, i_CascadeData0); + worldXZ1 -= ShiftingOriginOffset(i_Texture, i_CascadeData1); +#endif // CREST_SHIFTING_ORIGIN + + // 0.25 is magic number found through tweaking. + const float2 dd = float2(0.25 * i_PixelZ * i_Texture._texel, 0.0); + const half whiteFoam_x = WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, dd.xy, i_LodAlpha, i_CascadeData0); + const half whiteFoam_z = WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, dd.yx, i_LodAlpha, i_CascadeData0); + + // Compute a foam normal - manually push in derivatives. If I used blend + // smooths all the normals towards straight up when there is no foam. + // Gets material slider into friendly range. + const float magicStrengthFactor = 0.01; + return magicStrengthFactor * i_NormalStrength * half2(whiteFoam_x - i_FoamAlbedo, whiteFoam_z - i_FoamAlbedo) / dd.x; +} + +half MultiScaleFoamAlbedo +( + const Flow i_Flow, + const TiledTexture i_Texture, + const half i_Feather, + const half i_Foam, + const Cascade i_CascadeData0, + const Cascade i_CascadeData1, + const half i_LodAlpha, + const float2 i_UndisplacedXZ +) +{ + return MultiScaleFoamAlbedo + ( + i_Texture, + i_Feather, + i_Foam, + i_CascadeData0, + i_CascadeData1, + i_LodAlpha, + i_UndisplacedXZ - i_Flow._Flow * i_Flow._Offset0 + ) * i_Flow._Weight0 + MultiScaleFoamAlbedo + ( + i_Texture, + i_Feather, + i_Foam, + i_CascadeData0, + i_CascadeData1, + i_LodAlpha, + i_UndisplacedXZ - i_Flow._Flow * i_Flow._Offset1 + ) * i_Flow._Weight1; +} + +half2 MultiScaleFoamNormal +( + const Flow i_Flow, + const TiledTexture i_Texture, + const half i_Feather, + const half i_NormalStrength, + const half i_FoamData, + const half i_FoamAlbedo, + const Cascade i_CascadeData0, + const Cascade i_CascadeData1, + const half i_LodAlpha, + const float2 i_UndisplacedXZ, + const float i_PixelZ +) +{ + return MultiScaleFoamNormal + ( + i_Texture, + i_Feather, + i_NormalStrength, + i_FoamData, + i_FoamAlbedo, + i_CascadeData0, + i_CascadeData1, + i_LodAlpha, + i_UndisplacedXZ - i_Flow._Flow * i_Flow._Offset0, + i_PixelZ + ) * i_Flow._Weight0 + MultiScaleFoamNormal + ( + i_Texture, + i_Feather, + i_NormalStrength, + i_FoamData, + i_FoamAlbedo, + i_CascadeData0, + i_CascadeData1, + i_LodAlpha, + i_UndisplacedXZ - i_Flow._Flow * i_Flow._Offset1, + i_PixelZ + ) * i_Flow._Weight1; +} + +void ApplyFoamToSurface +( + half i_Foam, + const half2 i_Normal, + const half3 i_Albedo, + const half i_Occlusion, + const half i_Smoothness, + const half i_Specular, + const bool i_Underwater, + inout half3 io_Albedo, + inout half3 io_NormalWS, + inout half3 io_Emission, + inout half io_Occlusion, + inout float io_Smoothness, + inout half3 io_Specular +) +{ + // Apply foam to surface. + io_Albedo = lerp(io_Albedo, i_Albedo, i_Foam); + io_Emission *= 1.0 - i_Foam; + io_Occlusion = lerp(io_Occlusion, i_Occlusion, i_Foam); + io_Smoothness = lerp(io_Smoothness, i_Smoothness, i_Foam); + io_NormalWS.xz -= i_Normal; + io_NormalWS = normalize(io_NormalWS); + + // Foam Transmission + if (i_Underwater) + { + // Foam will be black when not facing the sun. This is a hacky way to have foam lit + // as if it had transmission. + // There is still ugliness around the edges. There will either be black or + // incorrect reflections depending on the magic value. + io_NormalWS.y *= i_Foam > 0.15 ? -1.0 : 1.0; + io_Specular = lerp(io_Specular, i_Specular, i_Foam); + } +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Foam.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Foam.hlsl.meta new file mode 100644 index 0000000..98cdc89 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Foam.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 58f878eb932e14fb0b1d13173caa2857 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fog.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fog.hlsl new file mode 100644 index 0000000..fec0aeb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fog.hlsl @@ -0,0 +1,67 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Crest_SurfaceFog +#define d_WaveHarmonic_Crest_SurfaceFog + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" + +#define d_Crest_WaterSurface 1 + +#if (CREST_LEGACY_UNDERWATER != 1) +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/IntegrateWaterVolume.hlsl" +#endif + +m_CrestNameSpace + +#if (CREST_LEGACY_UNDERWATER != 0) +static bool s_IsUnderWater; +#endif + +void SetUpFog(bool i_Underwater, float3 i_PositionWS, float i_Multiplier, float i_FogDistance, half3 i_ViewWS, float2 i_PositionSS) +{ + s_IsUnderWater = i_Underwater; + +#if (CREST_LEGACY_UNDERWATER != 1) + s_PositionSS = i_PositionSS; + s_PositionWS = i_PositionWS; + s_ViewWS = i_ViewWS; + s_FogDistance = i_FogDistance; + s_DepthRaw = 0; + s_FogMultiplier = i_Multiplier; +#endif +} + +m_CrestNameSpaceEnd + +#if (CREST_LEGACY_UNDERWATER != 0) +#if (CREST_DISCARD_ATMOSPHERIC_SCATTERING != 0) + +#if CREST_BIRP +#ifdef UNITY_PASS_FORWARDADD +#define m_Unity_FogColor fixed4(0, 0, 0, 0) +#else +#define m_Unity_FogColor unity_FogColor +#endif // UNITY_PASS_FORWARDADD + +#undef UNITY_APPLY_FOG +#define UNITY_APPLY_FOG(coord, color) \ +if (!m_Crest::s_IsUnderWater) \ +{ \ + UNITY_APPLY_FOG_COLOR(coord, color, m_Unity_FogColor); \ +} +#endif // CREST_BIRP + +#if CREST_HDRP +#define EvaluateAtmosphericScattering(i, V, color) m_Crest::s_IsUnderWater ? color : EvaluateAtmosphericScattering(i, V, color) +#endif + +#if CREST_URP +#define MixFog(color, coord) m_Crest::s_IsUnderWater ? color : MixFog(color, coord) +#endif + +#endif // CREST_DISCARD_ATMOSPHERIC_SCATTERING +#endif // CREST_LEGACY_UNDERWATER + +#endif // d_WaveHarmonic_Crest_SurfaceFog diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fog.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fog.hlsl.meta new file mode 100644 index 0000000..9742b21 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fog.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 944710ebd91d247cca9b0a31307f6b87 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fragment.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fragment.hlsl new file mode 100644 index 0000000..0360294 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fragment.hlsl @@ -0,0 +1,639 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Guard against missing uniforms. +#ifdef SHADERPASS + +#define m_Properties \ + const float2 i_UndisplacedXZ, \ + const float i_LodAlpha, \ + const half i_WaterLevelOffset, \ + const float2 i_WaterLevelDerivatives, \ + const half2 i_Flow, \ + const half3 i_ViewDirectionWS, \ + const bool i_Facing, \ + const half3 i_SceneColor, \ + const float i_SceneDepthRaw, \ + const float4 i_ScreenPosition, \ + const float4 i_ScreenPositionRaw, \ + const float3 i_PositionWS, \ + const float3 i_PositionVS, \ + const float2 i_StaticLightMapUV, \ + out half3 o_Albedo, \ + out half3 o_NormalWS, \ + out half3 o_Specular, \ + out half3 o_Emission, \ + out half o_Smoothness, \ + out half o_Occlusion, \ + out half o_Alpha + +// Guard against Shader Graph preview. +#ifndef SHADERGRAPH_PREVIEW + +#define d_Crest_WaterSurface 1 + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Shadows.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Facing.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Normal.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Reflection.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Refraction.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fresnel.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Foam.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Alpha.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fog.hlsl" + +#if (CREST_PORTALS != 0) +#include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Library/Portals.hlsl" +#endif + +bool _Crest_DrawBoundaryXZ; +float4 _Crest_BoundaryXZ; + +m_CrestNameSpace + +static const TiledTexture _Crest_NormalMapTiledTexture = + TiledTexture::Make(_Crest_NormalMapTexture, sampler_Crest_NormalMapTexture, _Crest_NormalMapTexture_TexelSize, _Crest_NormalMapScale, _Crest_NormalMapScrollSpeed); + +static const TiledTexture _Crest_FoamTiledTexture = + TiledTexture::Make(_Crest_FoamTexture, sampler_Crest_FoamTexture, _Crest_FoamTexture_TexelSize, _Crest_FoamScale, _Crest_FoamScrollSpeed); + +static const TiledTexture _Crest_CausticsTiledTexture = + TiledTexture::Make(_Crest_CausticsTexture, sampler_Crest_CausticsTexture, _Crest_CausticsTexture_TexelSize, _Crest_CausticsTextureScale, _Crest_CausticsScrollSpeed); +static const TiledTexture _Crest_CausticsDistortionTiledTexture = + TiledTexture::Make(_Crest_CausticsDistortionTexture, sampler_Crest_CausticsDistortionTexture, _Crest_CausticsDistortionTexture_TexelSize, _Crest_CausticsDistortionScale, 1.0); + +void Fragment(m_Properties) +{ + o_Albedo = 0.0; + o_NormalWS = half3(0.0, 1.0, 0.0); + o_Specular = 0.0; + o_Emission = 0.0; + o_Smoothness = 0.7; + o_Occlusion = 1.0; + o_Alpha = 1.0; + + const float2 positionSS = i_ScreenPosition.xy * _ScreenSize.xy; + + // Editor only. There is no defined editor symbol. + if (_Crest_DrawBoundaryXZ) + { + const float2 p = abs(i_PositionWS.xz - _Crest_BoundaryXZ.xy); + const float2 s = _Crest_BoundaryXZ.zw * 0.5; + if ((p.x > s.x && p.x < s.x + 1.0 && p.y < s.y + 1.0) || (p.y > s.y && p.y < s.y + 1.0 && p.x < s.x + 1.0)) + { + o_Emission = half3(1.0, 0.0, 1.0); +#if CREST_HDRP + o_Emission /= GetCurrentExposureMultiplier(); +#endif + } + } + + bool underwater = IsUnderWater(i_Facing, g_Crest_ForceUnderwater, positionSS); + + // TODO: Should we use PosToSIs or check for overflow? + float slice0 = _Crest_LodIndex; + float slice1 = _Crest_LodIndex + 1; + +#ifdef CREST_FLOW_ON + const Flow flow = Flow::Make(i_Flow, g_Crest_Time); +#endif + + const Cascade cascade0 = Cascade::Make(slice0); + const Cascade cascade1 = Cascade::Make(slice1); + + float sceneRawZ = i_SceneDepthRaw; + float negativeFog = _ProjectionParams.y; + +#if (CREST_PORTALS != 0) +#ifndef CREST_SHADOWPASS +#if _ALPHATEST_ON + if (m_CrestPortal) + { + const float pixelRawZ = i_ScreenPositionRaw.z / i_ScreenPositionRaw.w; + if (Portal::EvaluateSurface(i_ScreenPosition.xy, pixelRawZ, i_PositionWS, underwater, sceneRawZ, negativeFog)) + { + o_Alpha = 0.0; + return; + } + } +#endif +#endif +#endif + + float sceneZ = Utility::CrestLinearEyeDepth(sceneRawZ); + float pixelZ = -i_PositionVS.z; + + const bool isLastLod = _Crest_LodIndex == (uint)g_Crest_LodCount - 1; + const float weight0 = (1.0 - i_LodAlpha) * cascade0._Weight; + const float weight1 = (1.0 - weight0) * cascade1._Weight; + + // Data that fades towards the edge. + half foam = 0.0; half _determinant = 0.0; half4 albedo = 0.0; half2 shadow = 0.0; + if (weight0 > m_CrestSampleLodThreshold) + { + Cascade::MakeAnimatedWaves(slice0).SampleNormals(i_UndisplacedXZ, weight0, o_NormalWS.xz, _determinant); + + if (_Crest_FoamEnabled) + { + Cascade::MakeFoam(slice0).SampleFoam(i_UndisplacedXZ, weight0, foam); + } + + if (_Crest_AlbedoEnabled) + { + Cascade::MakeAlbedo(slice0).SampleAlbedo(i_UndisplacedXZ, weight0, albedo); + } + + if (_Crest_ShadowsEnabled) + { + Cascade::MakeShadow(slice0).SampleShadow(i_PositionWS.xz, weight0, shadow); + } + } + + if (weight1 > m_CrestSampleLodThreshold) + { + Cascade::MakeAnimatedWaves(slice1).SampleNormals(i_UndisplacedXZ, weight1, o_NormalWS.xz, _determinant); + + if (_Crest_FoamEnabled) + { + Cascade::MakeFoam(slice1).SampleFoam(i_UndisplacedXZ, weight1, foam); + } + + if (_Crest_AlbedoEnabled) + { + Cascade::MakeAlbedo(slice1).SampleAlbedo(i_UndisplacedXZ, weight1, albedo); + } + + if (_Crest_ShadowsEnabled) + { + Cascade::MakeShadow(slice1).SampleShadow(i_PositionWS.xz, weight1, shadow); + } + } + + // Invert so shadows are black as we normally multiply this by lighting. + shadow = 1.0 - shadow; + + // Data that displays to the edge. + // The default simulation value has been written to the border of the last slice. + half3 absorption = 0.0; half3 scattering = 0.0; + { + const float weight0 = (1.0 - (isLastLod ? 0.0 : i_LodAlpha)) * cascade0._Weight; + const float weight1 = (1.0 - weight0) * cascade1._Weight; + + if (weight0 > m_CrestSampleLodThreshold) + { + if (g_Crest_SampleScatteringSimulation) + { + Cascade::MakeScattering(slice0).SampleScattering(i_UndisplacedXZ, weight0, scattering); + } + + if (g_Crest_SampleAbsorptionSimulation) + { + Cascade::MakeAbsorption(slice0).SampleAbsorption(i_UndisplacedXZ, weight0, absorption); + } + } + + if (weight1 > m_CrestSampleLodThreshold) + { + if (g_Crest_SampleScatteringSimulation) + { + Cascade::MakeScattering(slice1).SampleScattering(i_UndisplacedXZ, weight1, scattering); + } + + if (g_Crest_SampleAbsorptionSimulation) + { + Cascade::MakeAbsorption(slice1).SampleAbsorption(i_UndisplacedXZ, weight1, absorption); + } + } + } + + if (!g_Crest_SampleScatteringSimulation) + { + scattering = _Crest_Scattering.xyz; + } + + if (!g_Crest_SampleAbsorptionSimulation) + { + absorption = _Crest_Absorption.xyz; + } + + // Determinant needs to be one when no waves. + if (isLastLod) + { + _determinant += 1.0 - weight0; + } + + // Normal. + { + if (_Crest_NormalMapEnabled) + { + o_NormalWS.xz += SampleNormalMaps + ( +#ifdef CREST_FLOW_ON + flow, +#endif + _Crest_NormalMapTiledTexture, + _Crest_NormalMapStrength, + i_UndisplacedXZ, + i_LodAlpha, + cascade0 + ); + } + + o_NormalWS = normalize(o_NormalWS); + + WaterNormal + ( + i_WaterLevelDerivatives, + i_ViewDirectionWS, + _Crest_MinimumReflectionDirectionY, + underwater, + o_NormalWS + ); + + o_NormalWS = normalize(o_NormalWS); + + o_NormalWS.xz *= _Crest_NormalsStrengthOverall; + o_NormalWS.y = lerp(1.0, o_NormalWS.y, _Crest_NormalsStrengthOverall); + + if (underwater) + { + // Flip when underwater. + o_NormalWS.xyz *= -1.0; + } + } + + // Default for opaque render type. + float sceneDistance = 1000.0; + float3 scenePositionWS = 0.0; + + const half3 ambientLight = AmbientLight(); + + float3 lightIntensity = 0.0; + half3 lightDirection = 0.0; + + PrimaryLight + ( + i_PositionWS, + lightIntensity, + lightDirection + ); + + half3 additionalLight = AdditionalLighting(i_PositionWS, i_ScreenPositionRaw, i_StaticLightMapUV); + +#if d_Transparent +#ifndef d_SkipRefraction + bool caustics; + RefractedScene + ( + _Crest_RefractionStrength, + o_NormalWS, + i_ScreenPosition.xy, + pixelZ, + i_SceneColor, + sceneZ, + sceneRawZ, + underwater, + o_Emission, + sceneDistance, + scenePositionWS, + caustics + ); + +#if CREST_BIRP +#if SHADERPASS == SHADERPASS_FORWARD_BASE + if (g_Crest_PrimaryLightHasCookie) + { + // If light has a cookie, it is zero for the ForwardBase pass. We need to split + // emission over ForwardBase and ForwardAdd. Ambient is done in the former, while + // direct (eg caustics) is done in ForwardAdd. + o_Emission = 0; + } +#endif +#endif +#endif // d_SkipRefraction +#endif // d_Transparent + + float refractedSeaLevel = g_Crest_WaterCenter.y; + float3 refractedSurfacePosition = float3(0, refractedSeaLevel, 0); + if (!underwater && slice1 < g_Crest_LodCount) + { + // Sample larger slice to avoid the first slice. + float4 displacement = Cascade::MakeAnimatedWaves(slice1).Sample(scenePositionWS.xz); + refractedSeaLevel = g_Crest_WaterCenter.y + displacement.w; + refractedSurfacePosition = displacement.xyz; + refractedSurfacePosition.y += refractedSeaLevel; + } + + // Out-scattering. + if (!underwater) + { + // Account for average extinction of light as it travels down through volume. Assume flat water as anything else would be expensive. + half3 extinction = absorption.xyz + scattering.xyz; + o_Emission *= exp(-extinction * max(0.0, refractedSeaLevel - scenePositionWS.y)); + } + +#if d_Transparent +#ifndef d_SkipRefraction + // Caustics + if (_Crest_CausticsEnabled && !underwater && caustics) + { + half lightOcclusion = PrimaryLightShadows(scenePositionWS, positionSS); + + half blur = 0.0; +#ifdef CREST_FLOW_ON + blur = _Crest_CausticsMotionBlur; +#endif + + o_Emission *= Caustics + ( +#ifdef CREST_FLOW_ON + flow, +#endif + scenePositionWS, + refractedSurfacePosition.y, + lightIntensity, + lightDirection, + lightOcclusion, + sceneDistance, + _Crest_CausticsTiledTexture, + _Crest_CausticsTextureAverage, + _Crest_CausticsStrength, + _Crest_CausticsFocalDepth, + _Crest_CausticsDepthOfField, + _Crest_CausticsDistortionTiledTexture, + _Crest_CausticsDistortionStrength, + blur, + underwater + ); + } +#endif // d_SkipRefraction +#endif // d_Transparent + + half3 sss = 0.0; + + if (_Crest_SSSEnabled) + { + sss = PinchSSS + ( + _determinant, + _Crest_SSSPinchMinimum, + _Crest_SSSPinchMaximum, + _Crest_SSSPinchFalloff, + _Crest_SSSIntensity, + lightDirection, + _Crest_SSSDirectionalFalloff, + i_ViewDirectionWS + ); + } + + // Volume Lighting + const half3 extinction = VolumeExtinction(absorption, scattering); + const half3 volumeOpacity = VolumeOpacity(extinction, sceneDistance); + const half3 volumeLight = VolumeLighting + ( + extinction, + scattering, + _Crest_Anisotropy, + shadow.x, + i_ViewDirectionWS, + ambientLight, + lightDirection, + lightIntensity, + additionalLight, + _Crest_AmbientTerm, + _Crest_DirectTerm, + sss, + _Crest_ShadowsAffectsAmbientFactor + ); + + // Fresnel + float reflected = 0.0; + float transmitted = 0.0; + { + ApplyFresnel + ( + i_ViewDirectionWS, + o_NormalWS, + underwater, + 1.0, // air + _Crest_RefractiveIndexOfWater, + _Crest_TotalInternalReflectionIntensity, + transmitted, + reflected + ); + + if (underwater) + { + o_Emission *= transmitted; + o_Emission += volumeLight * reflected; + } + else + { + o_Emission *= 1.0 - volumeOpacity; + o_Emission += volumeLight * volumeOpacity; + o_Emission *= transmitted; + } + } + + // Specular + { + o_Specular = _Crest_Specular * reflected * shadow.y; + } + + // Smoothness + { + // Vary smoothness by distance. + o_Smoothness = lerp(_Crest_Smoothness, _Crest_SmoothnessFar, pow(saturate(pixelZ / _Crest_SmoothnessFarDistance), _Crest_SmoothnessFalloff)); + } + + // Occlusion + { + o_Occlusion = underwater ? _Crest_OcclusionUnderwater : _Crest_Occlusion; + } + + // Planar Reflections + if (_Crest_PlanarReflectionsEnabled) + { + half4 reflection = PlanarReflection + ( + _Crest_ReflectionTexture, + sampler_Crest_ReflectionTexture, + _Crest_PlanarReflectionsIntensity, + o_Smoothness, + _Crest_PlanarReflectionsRoughness, + o_NormalWS, + _Crest_PlanarReflectionsDistortion, + i_ViewDirectionWS, + i_ScreenPosition.xy, + underwater + ); + + half alpha = reflection.a; + o_Emission = lerp(o_Emission, reflection.rgb, alpha * reflected * o_Occlusion); + // Override reflections with planar reflections. + // Results are darker than Unity's. + o_Occlusion *= 1.0 - alpha; + } + + // Foam + if (_Crest_FoamEnabled) + { + half albedo = MultiScaleFoamAlbedo + ( +#ifdef CREST_FLOW_ON + flow, +#endif + _Crest_FoamTiledTexture, + _Crest_FoamFeather, + foam, + cascade0, + cascade1, + i_LodAlpha, + i_UndisplacedXZ + ); + + half2 normal = MultiScaleFoamNormal + ( +#ifdef CREST_FLOW_ON + flow, +#endif + _Crest_FoamTiledTexture, + _Crest_FoamFeather, + _Crest_FoamNormalStrength, + foam, + albedo, + cascade0, + cascade1, + i_LodAlpha, + i_UndisplacedXZ, + pixelZ + ); + + half3 intensity = _Crest_FoamIntensityAlbedo; + + ApplyFoamToSurface + ( + albedo, + normal, + intensity, + _Crest_Occlusion, + _Crest_FoamSmoothness, + _Crest_Specular, + underwater, + o_Albedo, + o_NormalWS, + o_Emission, + o_Occlusion, + o_Smoothness, + o_Specular + ); + + // We will use this for shadow casting. + foam = albedo; + } + + // Albedo + if (_Crest_AlbedoEnabled) + { + const float foamMask = _Crest_AlbedoIgnoreFoam ? (1.0 - saturate(foam)) : 1.0; + o_Albedo = lerp(o_Albedo, albedo.rgb, albedo.a * foamMask); + o_Emission *= 1.0 - albedo.a * foamMask; + } + + // Alpha + { +#ifndef CREST_SHADOWPASS +#if d_Transparent + // Feather at intersection. Cannot be used for shadows since depth is not available. + o_Alpha = saturate((sceneZ - pixelZ) / 0.2); +#endif +#endif + + // This keyword works for all RPs despite BIRP having prefixes in serialised data. +#if _ALPHATEST_ON +#if CREST_SHADOWPASS + o_Alpha = max(foam, albedo.a) - _Crest_ShadowCasterThreshold; +#endif + + // Add 0.5 bias for LOD blending and texel resolution correction. This will help to + // tighten and smooth clipped edges. + o_Alpha -= ClipSurface(i_PositionWS.xz) > 0.5 ? 2.0 : 0.0; +#endif // _ALPHATEST_ON + + // Specular in HDRP is still affected outside the 0-1 alpha range. + o_Alpha = min(o_Alpha, 1.0); + } + + SetUpFog + ( + underwater, + i_PositionWS, + 1.0, // N/A: multiplier for fog nodes + sceneDistance - negativeFog, + i_ViewDirectionWS, + positionSS + ); +} + +m_CrestNameSpaceEnd + +#endif // SHADERGRAPH_PREVIEW + +void Fragment_float(m_Properties) +{ +#if SHADERGRAPH_PREVIEW + o_Albedo = 0.0; + o_NormalWS = half3(0.0, 1.0, 0.0); + o_Specular = 0.0; + o_Emission = 0.0; + o_Smoothness = 0.7; + o_Occlusion = 1.0; + o_Alpha = 1.0; +#else // SHADERGRAPH_PREVIEW + m_Crest::Fragment + ( + i_UndisplacedXZ, + i_LodAlpha, + i_WaterLevelOffset, + i_WaterLevelDerivatives, + i_Flow, + i_ViewDirectionWS, + i_Facing, + i_SceneColor, + i_SceneDepthRaw, + i_ScreenPosition, + i_ScreenPositionRaw, + i_PositionWS, + i_PositionVS, + i_StaticLightMapUV, + o_Albedo, + o_NormalWS, + o_Specular, + o_Emission, + o_Smoothness, + o_Occlusion, + o_Alpha + ); +#endif // SHADERGRAPH_PREVIEW +} + +#undef m_Properties + +#endif // SHADERPASS diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fragment.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fragment.hlsl.meta new file mode 100644 index 0000000..1166a1b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fragment.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fdafd40ae20374db88e293739fad1854 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fresnel.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fresnel.hlsl new file mode 100644 index 0000000..b5e09e2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fresnel.hlsl @@ -0,0 +1,83 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_FRESNEL_H +#define CREST_WATER_FRESNEL_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" + +m_CrestNameSpace + +float CalculateFresnelReflectionCoefficient(const float i_CosineTheta, const float i_RefractiveIndexOfAir, const float i_RefractiveIndexOfWater) +{ + // Fresnel calculated using Schlick's approximation. + // See: http://www.cs.virginia.edu/~jdl/bib/appearance/analytic%20models/schlick94b.pdf + // Reflectance at facing angle. + float R_0 = (i_RefractiveIndexOfAir - i_RefractiveIndexOfWater) / (i_RefractiveIndexOfAir + i_RefractiveIndexOfWater); + R_0 *= R_0; + const float R_theta = R_0 + (1.0 - R_0) * pow(max(0., 1.0 - i_CosineTheta), 5.0); + return R_theta; +} + +void ApplyReflectionUnderwater( + const half3 i_ViewDirectionWS, + const half3 i_NormalWS, + const float i_RefractiveIndexOfAir, + const float i_RefractiveIndexOfWater, + out float o_LightTransmitted, + out float o_LightReflected +) { + // The the angle of outgoing light from water's surface (whether refracted form outside or internally reflected). + const float cosOutgoingAngle = max(dot(i_NormalWS, i_ViewDirectionWS), 0.); + + // Calculate the amount of light transmitted from the sky (o_LightTransmitted). + { + // Have to calculate the incident angle of incoming light to water. + // Surface based on how it would be refracted so as to hit the camera. + const float cosIncomingAngle = cos(asin(clamp((i_RefractiveIndexOfWater * sin(acos(cosOutgoingAngle))) / i_RefractiveIndexOfAir, -1.0, 1.0))); + const float reflectionCoefficient = CalculateFresnelReflectionCoefficient(cosIncomingAngle, i_RefractiveIndexOfAir, i_RefractiveIndexOfWater); + o_LightTransmitted = (1.0 - reflectionCoefficient); + o_LightTransmitted = max(o_LightTransmitted, 0.0); + } + + // Calculate the amount of light reflected from below the water. + { + // Angle of incident is angle of reflection. + const float cosIncomingAngle = cosOutgoingAngle; + const float reflectionCoefficient = CalculateFresnelReflectionCoefficient(cosIncomingAngle, i_RefractiveIndexOfAir, i_RefractiveIndexOfWater); + o_LightReflected = reflectionCoefficient; + } +} + +void ApplyFresnel +( + const half3 i_ViewDirectionWS, + const half3 i_NormalWS, + const bool i_IsUnderwater, + const float i_RefractiveIndexOfAir, + const float i_RefractiveIndexOfWater, + const float i_TirIntensity, + out float o_LightTransmitted, + out float o_LightReflected +) +{ + o_LightTransmitted = 1.0; + + if (i_IsUnderwater) + { + ApplyReflectionUnderwater(i_ViewDirectionWS, i_NormalWS, i_RefractiveIndexOfAir, i_RefractiveIndexOfWater, o_LightTransmitted, o_LightReflected); + // Limit how strong TIR is. Not sure if this is the best way but it seems to work gracefully. + o_LightTransmitted = max(o_LightTransmitted, 1.0 - i_TirIntensity); + o_LightReflected = min(o_LightReflected, i_TirIntensity); + } + else + { + const float cosAngle = max(dot(i_NormalWS, i_ViewDirectionWS), 0.0); + // Hardcode water IOR for above surface. + o_LightReflected = CalculateFresnelReflectionCoefficient(cosAngle, i_RefractiveIndexOfAir, 1.33); + } +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fresnel.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fresnel.hlsl.meta new file mode 100644 index 0000000..0df2487 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fresnel.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7e2e3d8f8fe32492583d087ad2add952 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl new file mode 100644 index 0000000..8cd0366 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl @@ -0,0 +1,98 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_VERT_HELPERS_H +#define CREST_WATER_VERT_HELPERS_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +// These are per cascade, set per chunk instance. +CBUFFER_START(CrestChunkGeometryData) +float _Crest_ChunkMeshScaleAlpha; +float _Crest_ChunkMeshScaleAlphaSource; +float _Crest_ChunkGeometryGridWidth; +float _Crest_ChunkGeometryGridWidthSource; +CBUFFER_END + +m_CrestNameSpace + +// i_meshScaleAlpha is passed in as it is provided per tile and is set only for LOD0 +float ComputeLodAlpha(float3 i_worldPos, float i_meshScaleAlpha, in const Cascade i_cascadeData0) +{ + // taxicab distance from water center drives LOD transitions + float2 offsetFromCenter = abs(float2(i_worldPos.x - g_Crest_WaterCenter.x, i_worldPos.z - g_Crest_WaterCenter.z)); + float taxicab_norm = max(offsetFromCenter.x, offsetFromCenter.y); + + // interpolation factor to next lod (lower density / higher sampling period) + // TODO - pass this in, and then make a node to provide it automatically + float lodAlpha = taxicab_norm / i_cascadeData0._Scale - 1.0; + + // LOD alpha is remapped to ensure patches weld together properly. Patches can vary significantly in shape (with + // strips added and removed), and this variance depends on the base vertex density of the mesh, as this defines the + // strip width. + lodAlpha = max((lodAlpha - g_Crest_LodAlphaBlackPointFade) / g_Crest_LodAlphaBlackPointWhitePointFade, 0.); + + // blend out lod0 when viewpoint gains altitude + lodAlpha = min(lodAlpha + i_meshScaleAlpha, 1.); + +#if _DEBUGDISABLESMOOTHLOD_ON + lodAlpha = 0.; +#endif + + return lodAlpha; +} + +void SnapAndTransitionVertLayout(in const float4x4 i_objectMatrix, in const float i_meshScaleAlpha, in const Cascade i_cascadeData0, in const float i_geometryGridSize, inout float3 io_worldPos, out float o_lodAlpha) +{ + const float GRID_SIZE_2 = 2.0 * i_geometryGridSize, GRID_SIZE_4 = 4.0 * i_geometryGridSize; + + // snap the verts to the grid + // The snap size should be twice the original size to keep the shape of the eight triangles (otherwise the edge layout changes). + float2 objectPosXZWS = i_objectMatrix._m03_m23; + + // Relative world space - add camera pos to get back out to world. Would be nice if we could operate in RWS.. +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + objectPosXZWS += _WorldSpaceCameraPos.xz; +#endif + + const float2 gridOffset = frac(objectPosXZWS / GRID_SIZE_2) * GRID_SIZE_2; + io_worldPos.xz -= gridOffset; // caution - sign of frac might change in non-hlsl shaders + + // compute lod transition alpha + o_lodAlpha = ComputeLodAlpha(io_worldPos, i_meshScaleAlpha, i_cascadeData0); + + // now smoothly transition vert layouts between lod levels - move interior verts inwards towards center + float2 m = frac(io_worldPos.xz / GRID_SIZE_4); // this always returns positive + float2 offset = m - 0.5; + // Check if vert is within one square from the center point which the verts move towards. the verts that need moving + // inwards should have a radius of 0.25, whereas the outer ring of verts will have radius 0.5. Pick half way between + // to give max leeway for numerical robustness. + const float minRadius = 0.375; + if (abs(offset.x) < minRadius) io_worldPos.x += offset.x * o_lodAlpha * GRID_SIZE_4; + if (abs(offset.y) < minRadius) io_worldPos.z += offset.y * o_lodAlpha * GRID_SIZE_4; + +#if SHADER_API_VULKAN +#if CREST_HDRP +#if _TRANSPARENT_WRITES_MOTION_VEC + // Fixes artifacts where parts of the surface appear to be clipped. It appears to + // be a precision issue (LOD resolution not power of 2), but only when the MV code + // path is active - even though it writes to a separate target. + if (any(isinf(gridOffset))) + { + o_lodAlpha = 0.0; + } +#endif +#endif +#endif +} + +void SnapAndTransitionVertLayout(in const float i_meshScaleAlpha, in const Cascade i_cascadeData0, in const float i_geometryGridSize, inout float3 io_worldPos, out float o_lodAlpha) +{ + SnapAndTransitionVertLayout(UNITY_MATRIX_M, i_meshScaleAlpha, i_cascadeData0, i_geometryGridSize, io_worldPos, o_lodAlpha); +} + +m_CrestNameSpaceEnd + +#endif // CREST_WATER_VERT_HELPERS_H diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl.meta new file mode 100644 index 0000000..bca2d34 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1917cef0dc0904e92aeeb267b5543b49 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Normal.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Normal.hlsl new file mode 100644 index 0000000..416bdae --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Normal.hlsl @@ -0,0 +1,127 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_NORMAL_H +#define CREST_WATER_NORMAL_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl" + +#if (CREST_SHIFTING_ORIGIN != 0) +#include "Packages/com.waveharmonic.crest.shifting-origin/Runtime/Shaders/ShiftingOrigin.hlsl" +#endif + +// These are per cascade, set per chunk instance. +float _Crest_ChunkFarNormalsWeight; +float2 _Crest_ChunkNormalScrollSpeed; + +m_CrestNameSpace + +half2 SampleNormalMaps +( + const TiledTexture i_NormalMap, + const half i_Strength, + const float2 i_UndisplacedXZ, + const float i_LodAlpha, + const Cascade i_CascadeData +) +{ + float2 worldXZUndisplaced = i_UndisplacedXZ; + +#if (CREST_SHIFTING_ORIGIN != 0) + // Apply tiled floating origin offset. Always needed. + worldXZUndisplaced -= ShiftingOriginOffset(i_NormalMap, i_CascadeData); +#endif + + const float2 v0 = float2(0.94, 0.34), v1 = float2(-0.85, -0.53); + float scale = i_NormalMap._scale * i_CascadeData._Scale / 10.0; + const float spdmulL = _Crest_ChunkNormalScrollSpeed.x * i_NormalMap._speed; + half2 norm = + UnpackNormal(i_NormalMap.Sample((worldXZUndisplaced + v0 * g_Crest_Time * spdmulL) / scale)).xy + + UnpackNormal(i_NormalMap.Sample((worldXZUndisplaced + v1 * g_Crest_Time * spdmulL) / scale)).xy; + + // blend in next higher scale of normals to obtain continuity + const half nblend = i_LodAlpha * _Crest_ChunkFarNormalsWeight; + if (nblend > 0.001) + { + // next lod level + scale *= 2.0; + const float spdmulH = _Crest_ChunkNormalScrollSpeed.y * i_NormalMap._speed; + norm = lerp(norm, + UnpackNormal(i_NormalMap.Sample((worldXZUndisplaced + v0 * g_Crest_Time * spdmulH) / scale)).xy + + UnpackNormal(i_NormalMap.Sample((worldXZUndisplaced + v1 * g_Crest_Time * spdmulH) / scale)).xy, + nblend); + } + + // approximate combine of normals. would be better if normals applied in local frame. + return i_Strength * norm; +} + +half2 SampleNormalMaps +( + const Flow i_Flow, + const TiledTexture i_NormalMap, + const half i_Strength, + const float2 i_UndisplacedXZ, + const float i_LodAlpha, + const Cascade i_CascadeData +) +{ + return SampleNormalMaps + ( + i_NormalMap, + i_Strength, + i_UndisplacedXZ - i_Flow._Flow * (i_Flow._Offset0 - i_Flow._Period * 0.5), + i_LodAlpha, + i_CascadeData + ) * i_Flow._Weight0 + SampleNormalMaps + ( + i_NormalMap, + i_Strength, + i_UndisplacedXZ - i_Flow._Flow * (i_Flow._Offset1 - i_Flow._Period * 0.5), + i_LodAlpha, + i_CascadeData + ) * i_Flow._Weight1; +} + +void WaterNormal +( + const float2 i_WaterLevelDerivatives, + const half3 i_ViewDirectionWS, + const half i_MinimumReflectionDirectionY, + const bool i_Underwater, + inout half3 io_NormalWS +) +{ + // Account for water level changes which change angle of water surface, impacting normal. + io_NormalWS.xz += -i_WaterLevelDerivatives; + + // Finalise normal + io_NormalWS = normalize(io_NormalWS); + + if (i_Underwater) + { + return; + } + + // Limit how close to horizontal reflection ray can get, useful to avoid unsightly below-horizon reflections. + { + float3 refl = reflect(-i_ViewDirectionWS, io_NormalWS); + if (refl.y < i_MinimumReflectionDirectionY) + { + // Find the normal that keeps the reflection direction above the horizon. Compute + // the reflection dir that does work, normalize it, and then normal is half vector + // between this good reflection direction and view direction. + float3 FL = refl; + FL.y = i_MinimumReflectionDirectionY; + FL = normalize(FL); + io_NormalWS = normalize(FL + i_ViewDirectionWS); + } + } +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Normal.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Normal.hlsl.meta new file mode 100644 index 0000000..d0c0093 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Normal.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5e48e10254d2e49b8b040871986b6605 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Reflection.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Reflection.hlsl new file mode 100644 index 0000000..bbccbb5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Reflection.hlsl @@ -0,0 +1,66 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_REFLECTION_H +#define CREST_WATER_REFLECTION_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl" + +float4 _Crest_ReflectionPositionNormal[2]; +Texture2DArray _Crest_ReflectionTexture; +SamplerState sampler_Crest_ReflectionTexture; + +m_CrestNameSpace + +half4 PlanarReflection +( + const Texture2DArray i_ReflectionsTexture, + const SamplerState i_ReflectionsSampler, + const half i_Intensity, + const half i_Smoothness, + const half i_Roughness, + const half3 i_NormalWS, + const half i_NormalStrength, + const half3 i_ViewDirectionWS, + const float2 i_PositionNDC, + const bool i_Underwater +) +{ + half3 planeNormal = half3(0.0, i_Underwater ? -1.0 : 1.0, 0.0); + half3 reflected = reflect(-i_ViewDirectionWS, lerp(planeNormal, i_NormalWS, i_NormalStrength)); + reflected.y = -reflected.y; + + float4 positionCS = mul(UNITY_MATRIX_VP, half4(reflected, 0.0)); +#if UNITY_UV_STARTS_AT_TOP + positionCS.y = -positionCS.y; +#endif + + float2 positionNDC = positionCS.xy * rcp(positionCS.w) * 0.5 + 0.5; + + // Cancel out distortion if out of bounds. We could make this nicer by doing an edge fade but the improvement is + // barely noticeable. Edge fade requires recalculating the above a second time. + { + float4 positionAndNormal = _Crest_ReflectionPositionNormal[i_Underwater]; + if (dot(positionNDC - positionAndNormal.xy, positionAndNormal.zw) < 0.0) + { + positionNDC = lerp(i_PositionNDC, positionNDC, 0.25); + } + } + + const half roughness = PerceptualSmoothnessToPerceptualRoughness(i_Smoothness); + const half level = PerceptualRoughnessToMipmapLevel(roughness, i_Roughness); + half4 reflection = i_ReflectionsTexture.SampleLevel(sampler_Crest_ReflectionTexture, float3(positionNDC, i_Underwater), level); + + // If more than four layers are used on the terrain, they will appear black if HDR + // is enabled on the planar reflection camera. Alpha is probably a negative value. + reflection.a = saturate(reflection.a); + + reflection.a *= i_Intensity; + + return reflection; +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Reflection.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Reflection.hlsl.meta new file mode 100644 index 0000000..b9e83aa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Reflection.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 59ed70386a75c40a594ac82af7bd817b +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Refraction.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Refraction.hlsl new file mode 100644 index 0000000..06962c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Refraction.hlsl @@ -0,0 +1,113 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_REFRACTION_H +#define CREST_WATER_REFRACTION_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" + +#if (CREST_PORTALS != 0) +#include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Library/Portals.hlsl" +#endif + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl" + +#ifndef SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER +#define FoveatedRemapLinearToNonUniform(uv) uv +#endif + +m_CrestNameSpace + +// We take the unrefracted scene colour as input because having a Scene Colour node in the graph +// appears to be necessary to ensure the scene colours are bound? +void RefractedScene +( + const half i_RefractionStrength, + const half3 i_NormalWS, + const float2 i_PositionNDC, + const float i_PixelZ, + const half3 i_SceneColorUnrefracted, + const float i_SceneZ, + const float i_SceneZRaw, + const bool i_Underwater, + out half3 o_SceneColor, + out float o_SceneDistance, + out float3 o_ScenePositionWS, + out bool o_Caustics +) +{ + float2 positionNDC = i_PositionNDC; + float sceneDepthRaw = i_SceneZRaw; + + o_Caustics = true; + + // View ray intersects geometry surface either above or below water surface. + float2 refractOffset = i_RefractionStrength * i_NormalWS.xz; + if (!i_Underwater) + { + // We're above the water, so behind interface is depth fog. + refractOffset *= min(1.0, 0.5 * (i_SceneZ - i_PixelZ)) / i_SceneZ; + } + else + { + // When looking up through water, full strength ends up being quite intense so reduce it a bunch. + refractOffset *= 0.3; + } + + // Blend at the edge of the screen to avoid artifacts. + refractOffset *= 1.0 - EdgeBlendingFactor(positionNDC, i_PixelZ); + + const float2 positionNDCRefracted = FoveatedRemapLinearToNonUniform(positionNDC + refractOffset); + float sceneDepthRawRefracted = SHADERGRAPH_SAMPLE_SCENE_DEPTH(positionNDCRefracted); + +#if (CREST_PORTALS != 0) +#if _ALPHATEST_ON + // Portals + Portal::EvaluateRefraction(positionNDCRefracted, i_SceneZRaw, i_Underwater, sceneDepthRawRefracted, o_Caustics); +#endif +#endif + + + const float sceneZRefract = Utility::CrestLinearEyeDepth(sceneDepthRawRefracted); + + // Depth fog & caustics - only if view ray starts from above water. + // Compute depth fog alpha based on refracted position if it landed on an + // underwater surface, or on unrefracted depth otherwise. + if (sceneZRefract > i_PixelZ) + { + // Refracted. + o_SceneDistance = sceneZRefract - i_PixelZ; + o_SceneColor = SHADERGRAPH_SAMPLE_SCENE_COLOR(positionNDCRefracted); + + positionNDC = positionNDCRefracted; + sceneDepthRaw = sceneDepthRawRefracted; + } + else + { + // Unrefracted. + // It seems that when MSAA is enabled this can sometimes be negative. + o_SceneDistance = max(i_SceneZ - i_PixelZ, 0.0); + o_SceneColor = i_SceneColorUnrefracted; + + // NOTE: Causes refraction artifact with caustics. Cannot remember exactly why this was added. + // o_Caustics = false; + positionNDC = FoveatedRemapLinearToNonUniform(positionNDC); + } + + if (i_Underwater) + { + // Depth fog is handled by underwater shader. + o_SceneDistance = i_PixelZ; + } + + o_ScenePositionWS = ComputeWorldSpacePosition(positionNDC, sceneDepthRaw, UNITY_MATRIX_I_VP); +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + o_ScenePositionWS += _WorldSpaceCameraPos; +#endif +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Refraction.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Refraction.hlsl.meta new file mode 100644 index 0000000..54d54a6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Refraction.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bede8020b874c4bc389767163dc07528 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl new file mode 100644 index 0000000..2626b6c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl @@ -0,0 +1,61 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Constants for shader graph. For example, we can force shader features when we have yet to make a keyword for it in +// shader graph. + +// This file must be included before all other includes. And it must be done for every node. This is due to #ifndef +// limiting includes from being evaluated once, and we cannot specify the order because shader graph does this. + +#ifndef CREST_SHADERGRAPH_CONSTANTS_H +#define CREST_SHADERGRAPH_CONSTANTS_H + +// "pow(f,e) will not work for negative f" +#pragma warning (disable : 3571) + +#ifdef UNIVERSAL_PIPELINE_CORE_INCLUDED + #define CREST_URP 1 + +#if _SURFACE_TYPE_TRANSPARENT + #define d_Transparent 1 +#endif + +#elif BUILTIN_TARGET_API + #define CREST_BIRP 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + +#if _BUILTIN_SURFACE_TYPE_TRANSPARENT + #define d_Transparent 1 +#endif +#else + // HDRP does not appear to have a reliable keyword to target. + #define CREST_HDRP 1 + +#if _SURFACE_TYPE_TRANSPARENT + #define d_Transparent 1 +#endif + + #if (SHADERPASS == SHADERPASS_SHADOWS) + #define CREST_SHADOWPASS 1 + #endif +#endif + +#if defined(CREST_BIRP) || defined(CREST_URP) +#if (SHADERPASS == SHADERPASS_SHADOWCASTER) +#define CREST_SHADOWPASS 1 +#endif +#endif + +#if defined(CREST_HDRP) && (SHADERPASS == SHADERPASS_FORWARD) +#define CREST_HDRP_FORWARD_PASS 1 +#endif + +#if defined(CREST_BIRP) && (SHADERPASS == SHADERPASS_FORWARD_ADD) +#ifndef DIRECTIONAL_COOKIE +#define d_SkipRefraction 1 +#define d_IsAdditionalLight 1 +#endif +#endif + +#endif // CREST_SHADERGRAPH_CONSTANTS_H diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl.meta new file mode 100644 index 0000000..409e2e5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a641876bd41254d07831fd1b0b92f99b +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl new file mode 100644 index 0000000..52d72eb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl @@ -0,0 +1,38 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_UTILITY_H +#define CREST_UTILITY_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" + +m_CrestNameSpace + +half InverseLerp(half a, half b, half t) +{ + return (t - a) / (b - a); +} + +// Taken from: +// https://github.com/Unity-Technologies/Graphics/blob/f56d2b265eb9e01b0376623e909f98c88bc60662/Packages/com.unity.render-pipelines.high-definition/Runtime/Surface/Shaders/WaterUtilities.hlsl#L781-L797 +float EdgeBlendingFactor(float2 screenPosition, float distanceToWaterSurface) +{ + // Convert the screen position to NDC + float2 screenPosNDC = screenPosition * 2 - 1; + + // We want the value to be 0 at the center and go to 1 at the edges + float distanceToEdge = 1.0 - min((1.0 - abs(screenPosNDC.x)), (1.0 - abs(screenPosNDC.y))); + + // What we want here is: + // - +inf -> 0.5 value is 0 + // - 0.5-> 0.25 value is going from 0 to 1 + // - 0.25 -> 0 value is 1 + float distAttenuation = 1.0 - saturate((distanceToWaterSurface - 0.75) / 0.25); + + // Based on if the water surface is close, we want to make the blending region even bigger + return lerp(saturate((distanceToEdge - 0.8) / (0.2)), saturate(distanceToEdge + 0.25), distAttenuation); +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl.meta new file mode 100644 index 0000000..e21d93b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8a725a22984064d758e158a964ac1255 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Vertex.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Vertex.hlsl new file mode 100644 index 0000000..098a6bd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Vertex.hlsl @@ -0,0 +1,186 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Guard against missing uniforms. +#ifdef SHADERPASS + +#define m_Properties \ + const float3 i_PositionWS, \ + const float3 i_ObjectPosition, \ + const float3 i_CameraPosition, \ + const float i_Time, \ + out float3 o_PositionWS, \ + out float2 o_UndisplacedXZ, \ + out float o_LodAlpha, \ + out half o_WaterLevelOffset, \ + out float2 o_WaterLevelDerivatives, \ + out half2 o_Flow + +// Guard against Shader Graph preview. +#ifndef SHADERGRAPH_PREVIEW + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" + +#ifndef CREST_HDRP +#if (SHADERPASS == SHADERPASS_MOTION_VECTORS) +#define _TRANSPARENT_WRITES_MOTION_VEC 1 +#endif +#endif + +#if _TRANSPARENT_WRITES_MOTION_VEC +#define m_Slice clamp((int)_Crest_LodIndex + (isMotionVectors ? g_Crest_LodChange : 0), 0, g_Crest_LodCount) +#define m_Make(slice) Make(slice, isMotionVectors) +#else +#define m_Slice _Crest_LodIndex +#define m_Make(slice) Make(slice) +#endif + +m_CrestNameSpace + +void Vertex(m_Properties) +{ + // This will get called twice. + // With current and previous time respectively. + + o_UndisplacedXZ = 0.0; + o_LodAlpha = 0.0; + o_WaterLevelOffset = 0.0; + o_WaterLevelDerivatives = 0.0; + o_Flow = 0.0; + + const bool isMotionVectors = i_Time < _Time.y; + + const float slice0 = m_Slice; + const float slice1 = slice0 + 1; + const Cascade cascade0 = Cascade::m_Make(slice0); + const Cascade cascade1 = Cascade::m_Make(slice1); + + o_PositionWS = i_PositionWS; + + // Vertex snapping and LOD transition. + SnapAndTransitionVertLayout + ( + _Crest_ChunkMeshScaleAlpha, + Cascade::Make(_Crest_LodIndex), + _Crest_ChunkGeometryGridWidth, + o_PositionWS, + o_LodAlpha + ); + + // Fix precision errors at edges. + { + // Scale up by small "epsilon" to solve numerical issues. Expand slightly about tile center. + // :WaterGridPrecisionErrors + const float2 tileCenterXZ = i_ObjectPosition.xz; + const float2 cameraPositionXZ = abs(i_CameraPosition.xz); + // Scale "epsilon" by distance from zero. There is an issue where overlaps can cause SV_IsFrontFace + // to be flipped (needs to be investigated). Gaps look bad from above surface, and overlaps look bad + // from below surface. We want to close gaps without introducing overlaps. A fixed "epsilon" will + // either not solve gaps at large distances or introduce too many overlaps at small distances. Even + // with scaling, there are still unsolvable overlaps underwater (especially at large distances). + // 100,000 (0.00001) is the maximum position before Unity warns the user of precision issues. + o_PositionWS.xz = lerp(tileCenterXZ, o_PositionWS.xz, lerp(1.0, 1.01, max(cameraPositionXZ.x, cameraPositionXZ.y) * 0.00001)); + } + + o_UndisplacedXZ = o_PositionWS.xz; + + // Calculate sample weights. params.z allows shape to be faded out (used on last lod to support pop-less scale transitions). + const float weight0 = (1.0 - o_LodAlpha) * cascade0._Weight; + const float weight1 = (1.0 - weight0) * cascade1._Weight; + + // Data that needs to be sampled at the undisplaced position. + if (weight0 > m_CrestSampleLodThreshold) + { +#if _TRANSPARENT_WRITES_MOTION_VEC + if (isMotionVectors) + { + Cascade::MakeAnimatedWavesSource(slice0).SampleDisplacement(o_UndisplacedXZ, weight0, o_PositionWS, o_WaterLevelDerivatives); + } + else +#endif + { + Cascade::MakeAnimatedWaves(slice0).SampleDisplacement(o_UndisplacedXZ, weight0, o_PositionWS, o_WaterLevelDerivatives); + } + } + + if (weight1 > m_CrestSampleLodThreshold) + { +#if _TRANSPARENT_WRITES_MOTION_VEC + if (isMotionVectors) + { + Cascade::MakeAnimatedWavesSource(slice1).SampleDisplacement(o_UndisplacedXZ, weight1, o_PositionWS, o_WaterLevelDerivatives); + } + else +#endif + { + Cascade::MakeAnimatedWaves(slice1).SampleDisplacement(o_UndisplacedXZ, weight1, o_PositionWS, o_WaterLevelDerivatives); + } + } + + // Data that needs to be sampled at the displaced position. + if (weight0 > m_CrestSampleLodThreshold) + { +#if CREST_FLOW_ON + Cascade::MakeFlow(slice0).SampleFlow(o_UndisplacedXZ, weight0, o_Flow); +#endif + } + + if (weight1 > m_CrestSampleLodThreshold) + { +#if CREST_FLOW_ON + Cascade::MakeFlow(slice1).SampleFlow(o_UndisplacedXZ, weight1, o_Flow); +#endif + } + +#if _TRANSPARENT_WRITES_MOTION_VEC + if (isMotionVectors) + { + o_PositionWS.xz -= g_Crest_WaterCenter.xz; + o_PositionWS.xz *= g_Crest_WaterScaleChange; + o_PositionWS.xz += g_Crest_WaterCenter.xz; + o_PositionWS.xz += g_Crest_WaterCenterDelta; + } +#endif +} + +m_CrestNameSpaceEnd + +#endif // SHADERGRAPH_PREVIEW + +void Vertex_float(m_Properties) +{ +#if SHADERGRAPH_PREVIEW + o_PositionWS = 0.0; + o_UndisplacedXZ = 0.0; + o_LodAlpha = 0.0; + o_WaterLevelOffset = 0.0; + o_WaterLevelDerivatives = 0.0; + o_Flow = 0.0; +#else // SHADERGRAPH_PREVIEW + m_Crest::Vertex + ( + i_PositionWS, + i_ObjectPosition, + i_CameraPosition, + i_Time, + o_PositionWS, + o_UndisplacedXZ, + o_LodAlpha, + o_WaterLevelOffset, + o_WaterLevelDerivatives, + o_Flow + ); +#endif // SHADERGRAPH_PREVIEW +} + +#undef m_Properties + +#endif // SHADERPASS diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Vertex.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Vertex.hlsl.meta new file mode 100644 index 0000000..e11b9dc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Vertex.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2c406004ec98d40d292b359364c27961 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl new file mode 100644 index 0000000..c2616af --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl @@ -0,0 +1,96 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_WATER_VOLUME_LIGHTING_H +#define CREST_WATER_VOLUME_LIGHTING_H + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl" + +m_CrestNameSpace + +// Schlick phase function. +float SchlickPhase(float phaseG, float cosTheta) +{ + const float schlickK = 1.5 * phaseG - 0.5 * phaseG * phaseG * phaseG; + const float phaseFactor = 1.0 + schlickK * cosTheta; + return (1.0 - schlickK * schlickK) / (4.0 * PI * phaseFactor * phaseFactor); +} + +half3 VolumeExtinction(const half3 i_Absorption, const half3 i_Scattering) +{ + // Extinction is light absorbed plus light scattered out. + return i_Absorption + i_Scattering; +} + +half3 VolumeOpacity(const half3 i_Extinction, const half i_WaterRayLength) +{ + // Like 'alpha' value or obscurance. Volume light needs multiplying by this value + // to be correct in shallows. + return 1.0 - exp(-i_Extinction * max(0.0, i_WaterRayLength)); +} + +half3 VolumeLighting +( + const half3 i_Extinction, + const half3 i_Scattering, + const half i_PhaseG, + const half i_DirectionalLightShadow, + const half3 i_ViewDirectionWS, + const half3 i_AmbientLighting, + const half3 i_PrimaryLightDirection, + const half3 i_PrimaryLightIntensity, + const half3 i_AdditionalLight, + const half i_AmbientLightingTerm, + const half i_PrimaryLightingTerm, + const half3 i_SunBoost, + const half i_ShadowsAffectAmbientLightingFactor +) +{ + const half3 extinction = i_Extinction; + + const float ambientLightShadow = lerp + ( + 1.0, + i_DirectionalLightShadow, + saturate(min(min(extinction.x, extinction.y), extinction.z) * i_ShadowsAffectAmbientLightingFactor * g_Crest_DynamicSoftShadowsFactor) + ); + +#ifdef d_IsAdditionalLight + const float3 inscattered = i_PrimaryLightIntensity; +#else + // Sun + const float sunPhase = SchlickPhase(i_PhaseG, dot(i_PrimaryLightDirection, i_ViewDirectionWS)); + const float3 inScatteredSun = (1.0 + i_SunBoost) * sunPhase * i_PrimaryLightIntensity * i_PrimaryLightingTerm; + const float3 inScatteredAmbient = i_AmbientLighting * i_AmbientLightingTerm * ambientLightShadow; + + // Total inscattered + const float3 inscattered = (inScatteredAmbient + i_AdditionalLight + inScatteredSun * i_DirectionalLightShadow); +#endif + + const float3 scatteringAmount = saturate(i_Scattering / max(extinction, 0.00001)); + + return inscattered * scatteringAmount; +} + +half PinchSSS +( + const half i_Pinch, + const half i_Minimum, + const half i_Maximum, + const half i_Falloff, + const half i_Intensity, + const half3 i_SunDirection, + const half i_SunDirectionFalloff, + const half3 i_ViewDirectionWS +) +{ + half pinch = pow(saturate(InverseLerp(i_Minimum, i_Maximum, max(2.0 - i_Pinch, 0.0))), i_Falloff); + half sun = pow(saturate(dot(i_ViewDirectionWS, -i_SunDirection)), i_SunDirectionFalloff); + return pinch * sun * i_Intensity; +} + +m_CrestNameSpaceEnd + +#endif diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl.meta new file mode 100644 index 0000000..5ef016f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bf1d64d62eeee4f058f304a0c2f36590 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Water.shadergraph b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Water.shadergraph new file mode 100644 index 0000000..8a2f258 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Water.shadergraph @@ -0,0 +1,6375 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "e686651ddd104539a96befa9488a7220", + "m_Properties": [ + { + "m_Id": "4f69e9e4f638098994f0c45329a5d585" + }, + { + "m_Id": "5cd3653818bf0483aba63838ff94db1e" + }, + { + "m_Id": "ff8bcce5ee09228abb73bf677fa20052" + }, + { + "m_Id": "0e5f52aeae1e218abfab5efa5841098c" + }, + { + "m_Id": "994e8f13c14f6c80985a81bc860d6550" + }, + { + "m_Id": "6f4f3ecc7e7d4d83ab0176010684a61e" + }, + { + "m_Id": "c700bce5ef10cf8e9e5b69ba043d383b" + }, + { + "m_Id": "7b2f0f23d232ab88bcacd3e88392015a" + }, + { + "m_Id": "7bd38e1a9e3f978aa6c1746701bf789b" + }, + { + "m_Id": "8741edca0fbbee8a8999dd01e18125ee" + }, + { + "m_Id": "9c1e3b7101c8d18eafc43983c69eb3d0" + }, + { + "m_Id": "bbd2579dfd7f38879fab18706b09b5fb" + }, + { + "m_Id": "71f6994de656018baa684da1128e623c" + }, + { + "m_Id": "a11232afc69f728f9691066ce697feee" + }, + { + "m_Id": "d03d9fc3ce7b4a8f939cf6a6a147257e" + }, + { + "m_Id": "bfe5cf33a577b383b757f8332383b77d" + }, + { + "m_Id": "061da12cae33a388819d087995f680bf" + }, + { + "m_Id": "4a3c770430d2578aaf28126d16b17016" + }, + { + "m_Id": "a141f53b584cb28fb6292eb41f81614b" + }, + { + "m_Id": "14f5135a4bf8f5868cb55001b6472657" + }, + { + "m_Id": "aa75e7087fa330809fdc753edcd8995b" + }, + { + "m_Id": "a1b2f9dc07dc18858f11fd5ff20187d8" + }, + { + "m_Id": "fba39aeafd5aed838e2205e938a89b91" + }, + { + "m_Id": "87bec886e74d0b818024ab60ee3f8d88" + }, + { + "m_Id": "2b7848993646568dbe1e87b356d4e19b" + }, + { + "m_Id": "f75baf34d9f28a80a10af59ed35841c5" + }, + { + "m_Id": "91e9a577d315a3848dfb1f48a6743f9c" + }, + { + "m_Id": "4b09daebd022cf89bc77ad473c95586c" + }, + { + "m_Id": "0b19ab8baeda8584a55a0631c4f4decc" + }, + { + "m_Id": "3096e39a5605958497b1d3d3fac8ded2" + }, + { + "m_Id": "a591f22444f34efc876bf557bb9ebd1f" + }, + { + "m_Id": "27c63605cb7d41ceb669eccab82f3416" + }, + { + "m_Id": "b46c0ecc382d4777a4364feb0e0f8b70" + }, + { + "m_Id": "aa43a0a61bb9443ea398c342f79765a9" + }, + { + "m_Id": "d3e20a560cd246c5966f967e53903833" + }, + { + "m_Id": "86d9bc7bf9c2470ebe124428be6585d1" + }, + { + "m_Id": "d33c23a144f9400888ebc0b17741ceea" + }, + { + "m_Id": "d347a12dc40b4875b10257a32f31301c" + }, + { + "m_Id": "21db17a76f094b19ba523148b6f7aa41" + }, + { + "m_Id": "bd96da68193149a4a37e60284d87b160" + }, + { + "m_Id": "f00a6ef3872645488e79e89c6ac1845e" + }, + { + "m_Id": "723dc6aba75e40dcbe7ee413e905c51a" + }, + { + "m_Id": "5c5b9e2a267d466ea6353121d9e12662" + }, + { + "m_Id": "2d31998b356d41179aa5291dcedc7850" + }, + { + "m_Id": "0d81099c729342968bf4ee002d378dcf" + }, + { + "m_Id": "d6af4ca8280b4d56b6f2bf1c8b7a0bbd" + }, + { + "m_Id": "c9e151d906b14205b3c0d9b6d5561067" + }, + { + "m_Id": "855a78e097d54640b5bbc53c3f227524" + }, + { + "m_Id": "bb642d517f6040f9b3810d5c14873f37" + }, + { + "m_Id": "524d5e06f6474217aa1f93ce3139d36b" + }, + { + "m_Id": "a64036ce5dde44bf8d55a5caf75668f5" + }, + { + "m_Id": "973fda11195c4260a5bee711dca38ccf" + }, + { + "m_Id": "3b6b9f9fc3614e43a2cd513af66b9fc5" + }, + { + "m_Id": "e632a014145542d8a0f6bad7aac6cb63" + }, + { + "m_Id": "ac20e42c0c5f4e60872782a3b5cb4aac" + }, + { + "m_Id": "b83ed6e75a6f47b785c0fc9a5ee0c00a" + }, + { + "m_Id": "e608dd8f43794f5d8b3995446b21467f" + }, + { + "m_Id": "5af4fab89c55486e8ec4914978d76006" + }, + { + "m_Id": "e4a54526c6204b5badd66e158dcf0b1d" + } + ], + "m_Keywords": [ + { + "m_Id": "b91141f3e4cf4131ab732e6ae5828231" + } + ], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "ab5c287be1ea4492ab82972b1124492c" + }, + { + "m_Id": "39bdc7581dce44f5a9d59072bb141cb1" + }, + { + "m_Id": "1acefc13e64f4bbfbf2ffbb48d713165" + }, + { + "m_Id": "7c52172b64174c238d63df6a6ea01f69" + }, + { + "m_Id": "9475b0c108bc456eb09f35111542022b" + }, + { + "m_Id": "330cb63ecb704ddebac4935cb0b85ab7" + }, + { + "m_Id": "1920b69a79204a50b7ca9f87f80ef449" + }, + { + "m_Id": "76dfbf9d02da4e2b9a7cffa11a17b81d" + }, + { + "m_Id": "76a4c02b522d4e1d84eca095e84b1f30" + }, + { + "m_Id": "1d88e2d02e6f45ddbf89f1131a617042" + }, + { + "m_Id": "d65753c4eac547c5a73c35da6956d9e2" + } + ], + "m_Nodes": [ + { + "m_Id": "d22d7fde479b42818d46226e4fdf8fd2" + }, + { + "m_Id": "3f561c9e6dff4963bd333d65a10e76bc" + }, + { + "m_Id": "2410a929cea74c53b00a0f819f5be0f9" + }, + { + "m_Id": "4bb923e45f9f48bab142707a3af6e4bd" + }, + { + "m_Id": "b7891fe7e5a34f03adebd8a45505c5fc" + }, + { + "m_Id": "e207931e020242bba83058a59f3fb07d" + }, + { + "m_Id": "01717f91918a4191a16ca9eb0a394f85" + }, + { + "m_Id": "641a42645cc2483bb33d553093357479" + }, + { + "m_Id": "088237a0a2ea4680b3ef33263034c583" + }, + { + "m_Id": "0ce731b4d64244f499c8f8f3adac65db" + }, + { + "m_Id": "d6507a957f404764aa2670d0dc950578" + }, + { + "m_Id": "8f7d3c6acd8c40a993fe189ad3b6e808" + }, + { + "m_Id": "8e8aee51883445f1b08bfbec696cb18d" + }, + { + "m_Id": "f16010780e29425caac8bbcfaae9bde4" + }, + { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + { + "m_Id": "4c57f9182e154397bf38efa2af2224ef" + }, + { + "m_Id": "406c1f6f5af140b99dc01fff3651340e" + }, + { + "m_Id": "840981f260e04e378944867968a40230" + }, + { + "m_Id": "170e2545cc944659aa55e7eeb33298b1" + }, + { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + { + "m_Id": "d056d4d282b14a5b9a336e5561143c6a" + }, + { + "m_Id": "70391ba97bb44b55a04506b2aef83ade" + }, + { + "m_Id": "94663a98bbc145dba013a7c0d9301c85" + }, + { + "m_Id": "7b9e8caf91bb4d56b28c9420be41aa60" + }, + { + "m_Id": "d3778e9c7b9a4c8098a0fba6b826b854" + }, + { + "m_Id": "a6aefd808acc4136b14b84d9277addbd" + }, + { + "m_Id": "4fa7283733c64318a6c32176ce80a2bc" + }, + { + "m_Id": "cc4998fd8e074695a09b766078550f62" + }, + { + "m_Id": "2006e2e92edf4a748fc6cd3cc1a8bca5" + }, + { + "m_Id": "f1091500a8a244058957bd706b5fd6e7" + }, + { + "m_Id": "606b9292242c4a2a9b060ca6caa06628" + }, + { + "m_Id": "046853f212c34016b4d79091399be33a" + }, + { + "m_Id": "f8a8f45aa5dd42febd6bf935dae62d1c" + }, + { + "m_Id": "4678beb45340481b97ab1e7d20b2f83a" + }, + { + "m_Id": "2275b40e4a324efeace08a27b84ee3bf" + }, + { + "m_Id": "7802a5d4a56f4ec5aa4102c84c789b65" + }, + { + "m_Id": "647d1bffe5584ed1871477047f5ae889" + }, + { + "m_Id": "852bbc9178fe4d819f976ab80a0d4a3c" + }, + { + "m_Id": "429cf994a61b4915b0a34fd547f23370" + }, + { + "m_Id": "c3f4381605564b8bb0cc3445ae03c7b1" + }, + { + "m_Id": "5fbd8abb8cfb49fc8d944eb233fcdd37" + } + ], + "m_GroupDatas": [ + { + "m_Id": "0b12e9fc0b164611b7fa17e0c6955043" + } + ], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "046853f212c34016b4d79091399be33a" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 18 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "170e2545cc944659aa55e7eeb33298b1" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 12 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "2006e2e92edf4a748fc6cd3cc1a8bca5" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 15 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "406c1f6f5af140b99dc01fff3651340e" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4678beb45340481b97ab1e7d20b2f83a" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 19 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4c57f9182e154397bf38efa2af2224ef" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d22d7fde479b42818d46226e4fdf8fd2" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4fa7283733c64318a6c32176ce80a2bc" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 14 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5fbd8abb8cfb49fc8d944eb233fcdd37" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 23 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "606b9292242c4a2a9b060ca6caa06628" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 17 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3f561c9e6dff4963bd333d65a10e76bc" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "2275b40e4a324efeace08a27b84ee3bf" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "2410a929cea74c53b00a0f819f5be0f9" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4bb923e45f9f48bab142707a3af6e4bd" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b7891fe7e5a34f03adebd8a45505c5fc" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 5 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e207931e020242bba83058a59f3fb07d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 6 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "01717f91918a4191a16ca9eb0a394f85" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "70391ba97bb44b55a04506b2aef83ade" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 8 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7b9e8caf91bb4d56b28c9420be41aa60" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 10 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "840981f260e04e378944867968a40230" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 13 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "94663a98bbc145dba013a7c0d9301c85" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 9 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4c57f9182e154397bf38efa2af2224ef" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 6 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "088237a0a2ea4680b3ef33263034c583" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 7 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0ce731b4d64244f499c8f8f3adac65db" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 8 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f16010780e29425caac8bbcfaae9bde4" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 9 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d6507a957f404764aa2670d0dc950578" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 11 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f7d3c6acd8c40a993fe189ad3b6e808" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a6aefd808acc4136b14b84d9277addbd" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 13 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cc4998fd8e074695a09b766078550f62" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a22b846424134313814bef43e40c5cb3" + }, + "m_SlotId": 14 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d056d4d282b14a5b9a336e5561143c6a" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 7 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d3778e9c7b9a4c8098a0fba6b826b854" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 12 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f1091500a8a244058957bd706b5fd6e7" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 16 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f8a8f45aa5dd42febd6bf935dae62d1c" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6fb510b9ca124cf881fe849664df5924" + }, + "m_SlotId": 22 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 2642.999755859375, + "y": -179.99996948242188 + }, + "m_Blocks": [ + { + "m_Id": "d22d7fde479b42818d46226e4fdf8fd2" + }, + { + "m_Id": "088237a0a2ea4680b3ef33263034c583" + }, + { + "m_Id": "0ce731b4d64244f499c8f8f3adac65db" + }, + { + "m_Id": "f16010780e29425caac8bbcfaae9bde4" + }, + { + "m_Id": "d6507a957f404764aa2670d0dc950578" + }, + { + "m_Id": "8f7d3c6acd8c40a993fe189ad3b6e808" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 2642.6669921875, + "y": 727.3333740234375 + }, + "m_Blocks": [ + { + "m_Id": "3f561c9e6dff4963bd333d65a10e76bc" + }, + { + "m_Id": "2275b40e4a324efeace08a27b84ee3bf" + }, + { + "m_Id": "2410a929cea74c53b00a0f819f5be0f9" + }, + { + "m_Id": "4bb923e45f9f48bab142707a3af6e4bd" + }, + { + "m_Id": "b7891fe7e5a34f03adebd8a45505c5fc" + }, + { + "m_Id": "8e8aee51883445f1b08bfbec696cb18d" + }, + { + "m_Id": "e207931e020242bba83058a59f3fb07d" + }, + { + "m_Id": "01717f91918a4191a16ca9eb0a394f85" + }, + { + "m_Id": "641a42645cc2483bb33d553093357479" + }, + { + "m_Id": "7802a5d4a56f4ec5aa4102c84c789b65" + }, + { + "m_Id": "647d1bffe5584ed1871477047f5ae889" + }, + { + "m_Id": "852bbc9178fe4d819f976ab80a0d4a3c" + }, + { + "m_Id": "429cf994a61b4915b0a34fd547f23370" + }, + { + "m_Id": "c3f4381605564b8bb0cc3445ae03c7b1" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Crest", + "m_GraphPrecision": 0, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_SubDatas": [], + "m_ActiveTargets": [ + { + "m_Id": "b08214e872de4a3b82e77ece5ecb284d" + }, + { + "m_Id": "0f86b478c7b0468e8f20138835946bc9" + }, + { + "m_Id": "09d96e4ff0454961851197be0627117e" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "014708395fd3480aad2b5de738cb4d20", + "m_Id": 2, + "m_DisplayName": "World Bounds Min", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "World Bounds Min", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "01717f91918a4191a16ca9eb0a394f85", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "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": "778d032f795249ef90f902e1feff0a56" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "023e0d861a9247689a2f5c3db679f5e3", + "m_Id": 6, + "m_DisplayName": "Width", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Width", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "030e617918184625a9f533d1786f82cf", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Smoothness", + "m_StageCapability": 2, + "m_Value": 0.800000011920929, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "0462d8e66f824b829a9cb6ba741ed13e", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode", + "m_ObjectId": "046853f212c34016b4d79091399be33a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Screen Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1213.0001220703125, + "y": 1398.0001220703125, + "width": 144.9998779296875, + "height": 128.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "c145f00f4fe840b49f120c0890188e8f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ScreenSpaceType": 1 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "061da12cae33a388819d087995f680bf", + "m_Guid": { + "m_GuidSerialized": "b9f4d2ae-39c8-4f5c-9ded-da3cfa50a371" + }, + "m_Name": "Foam Albedo Intensity", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_CB513E94", + "m_OverrideReferenceName": "_Crest_FoamIntensityAlbedo", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 3.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "07e7cb6fc0a64d58a86ea20335ce4ef5", + "m_Id": 4, + "m_DisplayName": "Bounds Size", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Bounds Size", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "088237a0a2ea4680b3ef33263034c583", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.CustomInterpolator", + "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": "9007c591a2e44c06bf6301a6752b966b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Undisplaced_XZ#2" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "09d96e4ff0454961851197be0627117e", + "m_Datas": [], + "m_ActiveSubTarget": { + "m_Id": "a52dd0dd7c42405cabd2b96b877532a3" + }, + "m_AllowMaterialOverride": true, + "m_SurfaceType": 1, + "m_ZTestMode": 4, + "m_ZWriteControl": 1, + "m_AlphaMode": 0, + "m_RenderFace": 0, + "m_AlphaClip": true, + "m_CastShadows": false, + "m_ReceiveShadows": true, + "m_AdditionalMotionVectorMode": 1, + "m_SupportsLODCrossFade": false, + "m_CustomEditorGUI": "WaveHarmonic.Crest.Editor.UniversalWaterShaderGUI", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "0b12e9fc0b164611b7fa17e0c6955043", + "m_Title": "Interpolators", + "m_Position": { + "x": 591.0, + "y": 208.5 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "0b19ab8baeda8584a55a0631c4f4decc", + "m_Guid": { + "m_GuidSerialized": "9f82d9b0-2c02-4ed1-95a8-e8bac42aae51" + }, + "m_Name": "Caustics Distortion Strength", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_E24A4BDF", + "m_OverrideReferenceName": "_Crest_CausticsDistortionStrength", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.1599999964237213, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 0.25 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "0baa9d94a6294f619b49aa7151c9229a", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "0ce731b4d64244f499c8f8f3adac65db", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.CustomInterpolator", + "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": "4c6ac361550b49018d0cf20e95971e8f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Lod_Alpha#1" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "0d81099c729342968bf4ee002d378dcf", + "m_Guid": { + "m_GuidSerialized": "801d447a-fb21-40c1-8216-2b513df4d53e" + }, + "m_Name": "Planar Reflections Distortion", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Planar Reflections Distortion", + "m_DefaultReferenceName": "_Planar_Reflections_Distortion", + "m_OverrideReferenceName": "_Crest_PlanarReflectionsDistortion", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "0e5f52aeae1e218abfab5efa5841098c", + "m_Guid": { + "m_GuidSerialized": "8a177494-998a-440a-9748-db9944da8883" + }, + "m_Name": "Normal Map Strength", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_1AEB3981", + "m_OverrideReferenceName": "_Crest_NormalMapStrength", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.15000000596046449, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDTarget", + "m_ObjectId": "0f86b478c7b0468e8f20138835946bc9", + "m_ActiveSubTarget": { + "m_Id": "eea8298ecc6944318bd614020316fbf9" + }, + "m_Datas": [ + { + "m_Id": "cee72db709954dd38e8039e087fe5744" + }, + { + "m_Id": "276bf2c327c04ffcae08012d175d3554" + }, + { + "m_Id": "81a3aef8387044d2a3fbf24877b4f380" + }, + { + "m_Id": "4d02d98ad13c416c989fa4a1c65d2550" + } + ], + "m_CustomEditorGUI": "WaveHarmonic.Crest.Editor.HighDefinitionWaterShaderGUI", + "m_SupportVFX": false, + "m_SupportComputeForVertexSetup": false +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "14f5135a4bf8f5868cb55001b6472657", + "m_Guid": { + "m_GuidSerialized": "7b5348be-75e8-4aab-be4a-26da719c745e" + }, + "m_Name": "Refraction Strength", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_9F4B8948", + "m_OverrideReferenceName": "_Crest_RefractionStrength", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 2.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TimeNode", + "m_ObjectId": "170e2545cc944659aa55e7eeb33298b1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Time", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": 1373.0, + "y": 204.00001525878907, + "width": 79.0, + "height": 76.00004577636719 + } + }, + "m_Slots": [ + { + "m_Id": "4f34b324cb0c498fb1677432e5e6206e" + }, + { + "m_Id": "d184a57774014d1b93bf49daab22b439" + }, + { + "m_Id": "93c5051a05a94644b9bbf2bf2e90e741" + }, + { + "m_Id": "67fde13c8cfe41bb85c0697389bc1ac6" + }, + { + "m_Id": "7146dc6dffb44d189b52337223b743ab" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "19028599facd4389b224b68d388b6d73", + "m_Id": 19, + "m_DisplayName": "Position_VS", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position_VS", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "1920b69a79204a50b7ca9f87f80ef449", + "m_Name": "Shadows", + "m_ChildObjectList": [ + { + "m_Id": "524d5e06f6474217aa1f93ce3139d36b" + }, + { + "m_Id": "d347a12dc40b4875b10257a32f31301c" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "1acefc13e64f4bbfbf2ffbb48d713165", + "m_Name": "Volume Lighting", + "m_ChildObjectList": [ + { + "m_Id": "a591f22444f34efc876bf557bb9ebd1f" + }, + { + "m_Id": "994e8f13c14f6c80985a81bc860d6550" + }, + { + "m_Id": "27c63605cb7d41ceb669eccab82f3416" + }, + { + "m_Id": "973fda11195c4260a5bee711dca38ccf" + }, + { + "m_Id": "a64036ce5dde44bf8d55a5caf75668f5" + }, + { + "m_Id": "ac20e42c0c5f4e60872782a3b5cb4aac" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "1b1405f06e5d4657961e7a0cb5dbc6da", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "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_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "1bbc9f63da2843b9b22e44979b6c248d", + "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": 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.CategoryData", + "m_ObjectId": "1d88e2d02e6f45ddbf89f1131a617042", + "m_Name": "Flow", + "m_ChildObjectList": [ + { + "m_Id": "b91141f3e4cf4131ab732e6ae5828231" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SceneColorNode", + "m_ObjectId": "2006e2e92edf4a748fc6cd3cc1a8bca5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Scene Color", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1220.0, + "y": 1080.0001220703125, + "width": 138.0, + "height": 76.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "d89ecf302f85402382c31ff6408de83a" + }, + { + "m_Id": "595de3422e1244f6b19243da3fa1b077" + } + ], + "synonyms": [ + "screen buffer" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "21db17a76f094b19ba523148b6f7aa41", + "m_Guid": { + "m_GuidSerialized": "6802dca7-07d1-43da-94d8-846799a04fdb" + }, + "m_Name": "Occlusion (U)", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Occlusion (U)", + "m_DefaultReferenceName": "_Occlusion_U", + "m_OverrideReferenceName": "_Crest_OcclusionUnderwater", + "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": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "2275b40e4a324efeace08a27b84ee3bf", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.NormalWS", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2640.0, + "y": 785.0000610351563, + "width": 200.0, + "height": 41.0 + } + }, + "m_Slots": [ + { + "m_Id": "e9abf5f3e2204dec98991b9ac5698855" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.NormalWS" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "2410a929cea74c53b00a0f819f5be0f9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Specular", + "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": "91363cf6c6b44054997f3e0b5549ed73" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Specular" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "2578b8f9b3fa4b19ac471501136576e4", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "25f5ad60e93046fdaaf419e16de106ee", + "m_Id": 3, + "m_DisplayName": "World Bounds Max", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "World Bounds Max", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData", + "m_ObjectId": "276bf2c327c04ffcae08012d175d3554", + "m_Distortion": false, + "m_DistortionMode": 0, + "m_DistortionDepthTest": true, + "m_AddPrecomputedVelocity": false, + "m_TransparentWritesMotionVec": true, + "m_DepthOffset": false, + "m_ConservativeDepthOffset": false, + "m_TransparencyFog": true, + "m_AlphaTestShadow": false, + "m_BackThenFrontRendering": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "27c63605cb7d41ceb669eccab82f3416", + "m_Guid": { + "m_GuidSerialized": "fc4e5947-f45f-401e-8dd2-672680452439" + }, + "m_Name": "Anisotropy", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Anisotropy", + "m_DefaultReferenceName": "_Anisotropy", + "m_OverrideReferenceName": "_Crest_Anisotropy", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.5, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "2b33bfcf12bd4deca2a09ca1fa4a583c", + "m_Id": 0, + "m_DisplayName": "Water_Level_Derivatives", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Water_Level_Derivatives", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "2b7848993646568dbe1e87b356d4e19b", + "m_Guid": { + "m_GuidSerialized": "6098ab6c-ff2b-42a1-a952-aa9ee9921591" + }, + "m_Name": "Caustics Strength", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_2F84D846", + "m_OverrideReferenceName": "_Crest_CausticsStrength", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 3.200000047683716, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 10.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "2bc9e62b42574b07847aba9250b1660a", + "m_Id": 0, + "m_DisplayName": "Flow", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Flow", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "2d31998b356d41179aa5291dcedc7850", + "m_Guid": { + "m_GuidSerialized": "b9c23c72-2bc3-44f3-a9d3-0264a1957f4f" + }, + "m_Name": "Planar Reflections Intensity", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Planar Reflections Intensity", + "m_DefaultReferenceName": "_Planar_Reflections_Intensity", + "m_OverrideReferenceName": "_Crest_PlanarReflectionsIntensity", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "3096e39a5605958497b1d3d3fac8ded2", + "m_Guid": { + "m_GuidSerialized": "964dc714-8be0-4804-8e56-c6541274d728" + }, + "m_Name": "Caustics Distortion Scale", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_F6A28245", + "m_OverrideReferenceName": "_Crest_CausticsDistortionScale", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 250.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.009999999776482582, + "y": 1000.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "330cb63ecb704ddebac4935cb0b85ab7", + "m_Name": "Refraction", + "m_ChildObjectList": [ + { + "m_Id": "14f5135a4bf8f5868cb55001b6472657" + }, + { + "m_Id": "bbd2579dfd7f38879fab18706b09b5fb" + }, + { + "m_Id": "d33c23a144f9400888ebc0b17741ceea" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "3682a58d283c445db8c7cb725e7e7812", + "m_Id": 7, + "m_DisplayName": "Undisplaced_XZ", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Undisplaced_XZ", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "39a98ff13e9649f997d7d1532c218637", + "m_Id": 0, + "m_DisplayName": "Alpha Clip Threshold", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "AlphaClipThreshold", + "m_StageCapability": 2, + "m_Value": 0.00009999999747378752, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "39bdc7581dce44f5a9d59072bb141cb1", + "m_Name": "Normals", + "m_ChildObjectList": [ + { + "m_Id": "4f69e9e4f638098994f0c45329a5d585" + }, + { + "m_Id": "f00a6ef3872645488e79e89c6ac1845e" + }, + { + "m_Id": "5cd3653818bf0483aba63838ff94db1e" + }, + { + "m_Id": "0e5f52aeae1e218abfab5efa5841098c" + }, + { + "m_Id": "ff8bcce5ee09228abb73bf677fa20052" + }, + { + "m_Id": "e608dd8f43794f5d8b3995446b21467f" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "3b4e99d0926f487682f11375ff6a57bd", + "m_Id": 3, + "m_DisplayName": "o_Position", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "o_Position", + "m_StageCapability": 3, + "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_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "3b6b9f9fc3614e43a2cd513af66b9fc5", + "m_Guid": { + "m_GuidSerialized": "9abe19ba-2b9e-4d71-aec8-518850d0bd5d" + }, + "m_Name": "Version", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Version", + "m_DefaultReferenceName": "_Version", + "m_OverrideReferenceName": "_Crest_Version", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 1, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.0, + "m_FloatType": 2, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "3efd227739f54e0e8ad0e727e8fff52e", + "m_Id": 9, + "m_DisplayName": "Water_Level_Derivatives", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Water_Level_Derivatives", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "3f4e0cb256fa4debab17315679346334", + "m_Id": 15, + "m_DisplayName": "Scene_Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Scene_Color", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "3f561c9e6dff4963bd333d65a10e76bc", + "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": "1b1405f06e5d4657961e7a0cb5dbc6da" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.PositionNode", + "m_ObjectId": "406c1f6f5af140b99dc01fff3651340e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1246.0, + "y": -80.99993133544922, + "width": 206.0, + "height": 131.00001525878907 + } + }, + "m_Slots": [ + { + "m_Id": "d741ef18d57845e59b9e6d6ebeb72dec" + } + ], + "synonyms": [ + "location" + ], + "m_Precision": 1, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 4, + "m_PositionSource": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "429cf994a61b4915b0a34fd547f23370", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.RefractionDistance", + "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": "d32e3256b70746c094ee8fa4f441ad01" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.RefractionDistance" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "42af552c56814415adaf3f442e76a8f3", + "m_Id": 2, + "m_DisplayName": "Orthographic", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Orthographic", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "45e01376beba4378949c16fb68aeda17", + "m_Id": 11, + "m_DisplayName": "Flow", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Flow", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.PositionNode", + "m_ObjectId": "4678beb45340481b97ab1e7d20b2f83a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1152.0001220703125, + "y": 1658.0001220703125, + "width": 205.9998779296875, + "height": 130.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "882dadfb4b104b03ab629981e3b4528d" + } + ], + "synonyms": [ + "location" + ], + "m_Precision": 1, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 1, + "m_PositionSource": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "486351168fc04951b80963ed0d2e51df", + "m_Id": 17, + "m_DisplayName": "Screen_Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Screen_Position", + "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.Vector2MaterialSlot", + "m_ObjectId": "48a91eeecdab4809acc394137a57a47a", + "m_Id": 12, + "m_DisplayName": "Flow", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Flow", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "4a3c770430d2578aaf28126d16b17016", + "m_Guid": { + "m_GuidSerialized": "ffa8bff1-966c-46dc-935f-12e73a44429b" + }, + "m_Name": "Foam Smoothness", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_66FBE93", + "m_OverrideReferenceName": "_Crest_FoamSmoothness", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.699999988079071, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "4b09daebd022cf89bc77ad473c95586c", + "m_Guid": { + "m_GuidSerialized": "a6a965c5-9ecc-4726-95e5-33dd6a052922" + }, + "m_Name": "Caustics Distortion Texture", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Texture2D_880763AD", + "m_OverrideReferenceName": "_Crest_CausticsDistortionTexture", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"7aa3f69cfb40b429a865c45a7271c5f5\",\"type\":3}}", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": false, + "m_Modifiable": true, + "m_DefaultType": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "4bb923e45f9f48bab142707a3af6e4bd", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Emission", + "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": "eba256bd9199402fb1791e8f894b5e8f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Emission" +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "4c57f9182e154397bf38efa2af2224ef", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2088.0, + "y": -237.99993896484376, + "width": 211.0, + "height": 157.0 + } + }, + "m_Slots": [ + { + "m_Id": "bb078b3adb574ec18c0f7d0a0a94a72b" + }, + { + "m_Id": "fc68a5e215ec419dab8e51a54c9f195c" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 4, + "to": 0 + }, + "m_ConversionType": 0, + "m_Normalize": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "4c6ac361550b49018d0cf20e95971e8f", + "m_Id": 0, + "m_DisplayName": "Lod_Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Lod_Alpha", + "m_StageCapability": 1, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData", + "m_ObjectId": "4d02d98ad13c416c989fa4a1c65d2550", + "m_MaterialNeedsUpdateHash": 279880, + "m_SurfaceType": 1, + "m_RenderingPass": 4, + "m_BlendMode": 0, + "m_ZTest": 4, + "m_ZWrite": true, + "m_TransparentCullMode": 2, + "m_OpaqueCullMode": 2, + "m_SortPriority": -1, + "m_AlphaTest": true, + "m_ExcludeFromTUAndAA": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false, + "m_DoubleSidedMode": 1, + "m_DOTSInstancing": false, + "m_CustomVelocity": false, + "m_Tessellation": false, + "m_TessellationMode": 0, + "m_TessellationFactorMinDistance": 20.0, + "m_TessellationFactorMaxDistance": 50.0, + "m_TessellationFactorTriangleSize": 100.0, + "m_TessellationShapeFactor": 0.75, + "m_TessellationBackFaceCullEpsilon": -0.25, + "m_TessellationMaxDisplacement": 0.009999999776482582, + "m_Version": 2, + "inspectorFoldoutMask": 11 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "4e2ff019a3b64772a3ae2b1e6ab7a900", + "m_Id": 0, + "m_DisplayName": "Transmittance Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "RefractionColor", + "m_StageCapability": 2, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 1.0, + "g": 1.0, + "b": 1.0, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "4f34b324cb0c498fb1677432e5e6206e", + "m_Id": 0, + "m_DisplayName": "Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "4f69e9e4f638098994f0c45329a5d585", + "m_Guid": { + "m_GuidSerialized": "26cd766e-f6cc-472e-b906-074f02cb58ad" + }, + "m_Name": "Normal Strength", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_D531AD17", + "m_OverrideReferenceName": "_Crest_NormalsStrengthOverall", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "4f9c60ee0f3e4c42ac334922e9640127", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "4f9dca6e8a1d46028cb365c95a259fc2", + "m_Id": 2, + "m_DisplayName": "o_Specular", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "o_Specular", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.IsFrontFaceNode", + "m_ObjectId": "4fa7283733c64318a6c32176ce80a2bc", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Is Front Face", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1238.0, + "y": 1003.0, + "width": 120.0, + "height": 77.0001220703125 + } + }, + "m_Slots": [ + { + "m_Id": "dd2364c2819e440281a8d86cde9bcba5" + } + ], + "synonyms": [ + "face", + "side" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "503219cfdffc43b38928577e580c684b", + "m_Id": 8, + "m_DisplayName": "Water_Level_Offset", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Water_Level_Offset", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "524d5e06f6474217aa1f93ce3139d36b", + "m_Guid": { + "m_GuidSerialized": "52c7d757-c039-4dc9-b7a3-26eaf8b7f7f6" + }, + "m_Name": "Shadows Enabled", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Shadows Enabled", + "m_DefaultReferenceName": "_Shadows_Enabled", + "m_OverrideReferenceName": "_Crest_ShadowsEnabled", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "538cf5cf053d448e9eda5626daa46d9d", + "m_Id": 1, + "m_DisplayName": "Scale", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Scale", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "55d3ff7ea5e4413391fbe56ff4b9fd79", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "5816484918bf42bdbd9a73f0cbaebaf3", + "m_Id": 13, + "m_DisplayName": "View_Direction", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "View_Direction", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "595de3422e1244f6b19243da3fa1b077", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "5a4a6e350ff4411097da39c02f42957c", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 3, + "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_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "5af4fab89c55486e8ec4914978d76006", + "m_Guid": { + "m_GuidSerialized": "f4540086-b571-4748-b063-2f62067e587d" + }, + "m_Name": "Caustics Scroll Speed", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Caustics Scroll Speed", + "m_DefaultReferenceName": "_Caustics_Scroll_Speed", + "m_OverrideReferenceName": "_Crest_CausticsScrollSpeed", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 2, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 10.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5babb0a0d0f040b6a2999f218d03511c", + "m_Id": 4, + "m_DisplayName": "o_Smoothness", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "o_Smoothness", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "5be08bf11b86490289f2507512b15874", + "m_Id": 0, + "m_DisplayName": "o_Color", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "o_Color", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "5c5b9e2a267d466ea6353121d9e12662", + "m_Guid": { + "m_GuidSerialized": "a59f9e2c-d4b7-44f2-8c23-5c131982bfcc" + }, + "m_Name": "Foam Enabled", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Foam Enabled", + "m_DefaultReferenceName": "_Foam_Enabled", + "m_OverrideReferenceName": "_Crest_FoamEnabled", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "5cd3653818bf0483aba63838ff94db1e", + "m_Guid": { + "m_GuidSerialized": "f6647a86-8695-4c4f-9eeb-d55166d20a99" + }, + "m_Name": "Normal Map", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Texture2D_406152FF", + "m_OverrideReferenceName": "_Crest_NormalMapTexture", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"7aa3f69cfb40b429a865c45a7271c5f5\",\"type\":3}}", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": false, + "m_Modifiable": true, + "m_DefaultType": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5e12f24b0f7c4d378cea72abc720df26", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "5fbd8abb8cfb49fc8d944eb233fcdd37", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1213.0001220703125, + "y": 1789.0, + "width": 144.9998779296875, + "height": 129.000244140625 + } + }, + "m_Slots": [ + { + "m_Id": "1bbc9f63da2843b9b22e44979b6c248d" + } + ], + "synonyms": [ + "texcoords", + "coords", + "coordinates" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode", + "m_ObjectId": "606b9292242c4a2a9b060ca6caa06628", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Screen Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1213.0001220703125, + "y": 1269.0, + "width": 144.9998779296875, + "height": 129.0001220703125 + } + }, + "m_Slots": [ + { + "m_Id": "6a02b66230f84bfca4d0b33460b2f338" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ScreenSpaceType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionMaterialSlot", + "m_ObjectId": "62352145719941a3ab393292aab906fd", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "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_ScreenSpaceType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "63a4841ac2f94a8185e95772cfe193c8", + "m_Id": 10, + "m_DisplayName": "Water_Level_Derivatives", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Water_Level_Derivatives", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "641a42645cc2483bb33d553093357479", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.AlphaClipThreshold", + "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": "39a98ff13e9649f997d7d1532c218637" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "647d1bffe5584ed1871477047f5ae889", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.RefractionIndex", + "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": "ac72e84550f64ff7bba0fdec760e9ac8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.RefractionIndex" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "67f656c3174f49288d9d8b8af7c19143", + "m_Id": 0, + "m_DisplayName": "Water_Level_Offset", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Water_Level_Offset", + "m_StageCapability": 1, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "67fde13c8cfe41bb85c0697389bc1ac6", + "m_Id": 3, + "m_DisplayName": "Delta Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Delta Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "6944d0d08aa242f38d21b3ff8a19d7a0", + "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": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "6a02b66230f84bfca4d0b33460b2f338", + "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": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "6f4f3ecc7e7d4d83ab0176010684a61e", + "m_Guid": { + "m_GuidSerialized": "303e4d1f-363e-40a4-bb34-a728bab71d22" + }, + "m_Name": "Specular", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_19186AF2", + "m_OverrideReferenceName": "_Crest_Specular", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.25, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "6fb510b9ca124cf881fe849664df5924", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Fragment (Custom Function)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1689.0, + "y": 727.0000610351563, + "width": 305.0001220703125, + "height": 429.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "3682a58d283c445db8c7cb725e7e7812" + }, + { + "m_Id": "b674b64ba77748a1a1ab3cf388aa1232" + }, + { + "m_Id": "de2797e54cc7464ea2e88533681e7485" + }, + { + "m_Id": "63a4841ac2f94a8185e95772cfe193c8" + }, + { + "m_Id": "48a91eeecdab4809acc394137a57a47a" + }, + { + "m_Id": "5816484918bf42bdbd9a73f0cbaebaf3" + }, + { + "m_Id": "d78925eabe5948b98e661f7eeba64a4e" + }, + { + "m_Id": "3f4e0cb256fa4debab17315679346334" + }, + { + "m_Id": "82e9b6c3d9dc4782957d60c8d09119cd" + }, + { + "m_Id": "486351168fc04951b80963ed0d2e51df" + }, + { + "m_Id": "eda23d92596c4c3e93952a590edf7bfc" + }, + { + "m_Id": "ad86ac4b1c7d4f998c9e2b44c9950af2" + }, + { + "m_Id": "19028599facd4389b224b68d388b6d73" + }, + { + "m_Id": "aa6aadfb2101446cabb0da2a6c68ead3" + }, + { + "m_Id": "5be08bf11b86490289f2507512b15874" + }, + { + "m_Id": "813ea711c89d4b43803d90b274b12e8f" + }, + { + "m_Id": "4f9dca6e8a1d46028cb365c95a259fc2" + }, + { + "m_Id": "8cd7130e53ca418f98027d1a6ec5db0d" + }, + { + "m_Id": "5babb0a0d0f040b6a2999f218d03511c" + }, + { + "m_Id": "8208cb1830d44c9abea8e785ec4187da" + }, + { + "m_Id": "e1cad9f1cf9b489c9cac9fa804c1b5aa" + } + ], + "synonyms": [ + "code", + "HLSL" + ], + "m_Precision": 1, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 0, + "m_FunctionName": "Fragment", + "m_FunctionSource": "fdafd40ae20374db88e293739fad1854", + "m_FunctionBody": "Enter function body here..." +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CustomInterpolatorNode", + "m_ObjectId": "70391ba97bb44b55a04506b2aef83ade", + "m_Group": { + "m_Id": "0b12e9fc0b164611b7fa17e0c6955043" + }, + "m_Name": "Lod_Alpha (Custom Interpolator)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 696.0000610351563, + "y": 361.0000305175781, + "width": 231.0, + "height": 94.00003051757813 + } + }, + "m_Slots": [ + { + "m_Id": "55d3ff7ea5e4413391fbe56ff4b9fd79" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "customBlockNodeName": "Lod_Alpha", + "serializedType": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7146dc6dffb44d189b52337223b743ab", + "m_Id": 4, + "m_DisplayName": "Smooth Delta", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Smooth Delta", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "71f6994de656018baa684da1128e623c", + "m_Guid": { + "m_GuidSerialized": "28b5222c-b528-494b-848d-baa890376b5b" + }, + "m_Name": "Minimum Reflection Direction Y", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_5221D8E5", + "m_OverrideReferenceName": "_Crest_MinimumReflectionDirectionY", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.03, + "m_FloatType": 1, + "m_RangeValues": { + "x": -1.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "723dc6aba75e40dcbe7ee413e905c51a", + "m_Guid": { + "m_GuidSerialized": "db915810-9e09-4bd6-958c-6b0debb701a7" + }, + "m_Name": "SSS Enabled", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "SSS Enabled", + "m_DefaultReferenceName": "_SSS_Enabled", + "m_OverrideReferenceName": "_Crest_SSSEnabled", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "75e4730fc7a040cfa3b993329bc76d87", + "m_Id": 3, + "m_DisplayName": "Near Plane", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Near Plane", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "76a4c02b522d4e1d84eca095e84b1f30", + "m_Name": "Caustics", + "m_ChildObjectList": [ + { + "m_Id": "bd96da68193149a4a37e60284d87b160" + }, + { + "m_Id": "a1b2f9dc07dc18858f11fd5ff20187d8" + }, + { + "m_Id": "2b7848993646568dbe1e87b356d4e19b" + }, + { + "m_Id": "fba39aeafd5aed838e2205e938a89b91" + }, + { + "m_Id": "5af4fab89c55486e8ec4914978d76006" + }, + { + "m_Id": "87bec886e74d0b818024ab60ee3f8d88" + }, + { + "m_Id": "f75baf34d9f28a80a10af59ed35841c5" + }, + { + "m_Id": "91e9a577d315a3848dfb1f48a6743f9c" + }, + { + "m_Id": "4b09daebd022cf89bc77ad473c95586c" + }, + { + "m_Id": "0b19ab8baeda8584a55a0631c4f4decc" + }, + { + "m_Id": "3096e39a5605958497b1d3d3fac8ded2" + }, + { + "m_Id": "855a78e097d54640b5bbc53c3f227524" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "76dfbf9d02da4e2b9a7cffa11a17b81d", + "m_Name": "Foam", + "m_ChildObjectList": [ + { + "m_Id": "5c5b9e2a267d466ea6353121d9e12662" + }, + { + "m_Id": "a11232afc69f728f9691066ce697feee" + }, + { + "m_Id": "d03d9fc3ce7b4a8f939cf6a6a147257e" + }, + { + "m_Id": "e4a54526c6204b5badd66e158dcf0b1d" + }, + { + "m_Id": "bfe5cf33a577b383b757f8332383b77d" + }, + { + "m_Id": "061da12cae33a388819d087995f680bf" + }, + { + "m_Id": "4a3c770430d2578aaf28126d16b17016" + }, + { + "m_Id": "a141f53b584cb28fb6292eb41f81614b" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "778d032f795249ef90f902e1feff0a56", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "77f30e5b61ae46c19146e7c270fa7aa8", + "m_Id": 5, + "m_DisplayName": "Z Buffer Sign", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Z Buffer Sign", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "7802a5d4a56f4ec5aa4102c84c789b65", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BentNormal", + "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": "7831a4522284465a9c1d357307054c91" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BentNormal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "7831a4522284465a9c1d357307054c91", + "m_Id": 0, + "m_DisplayName": "Bent Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BentNormal", + "m_StageCapability": 2, + "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": 3 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "7b2f0f23d232ab88bcacd3e88392015a", + "m_Guid": { + "m_GuidSerialized": "ba44782a-44ff-4282-b3a8-11d566d69e7b" + }, + "m_Name": "Smoothness", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_CCA62AB", + "m_OverrideReferenceName": "_Crest_Smoothness", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.8999999761581421, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CustomInterpolatorNode", + "m_ObjectId": "7b9e8caf91bb4d56b28c9420be41aa60", + "m_Group": { + "m_Id": "0b12e9fc0b164611b7fa17e0c6955043" + }, + "m_Name": "Water_Level_Derivatives (Custom Interpolator)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 616.0, + "y": 549.0000610351563, + "width": 311.00006103515627, + "height": 93.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "b0622d58143646b4bd6c849858bac981" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "customBlockNodeName": "Water_Level_Derivatives", + "serializedType": 2 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "7bd38e1a9e3f978aa6c1746701bf789b", + "m_Guid": { + "m_GuidSerialized": "c08ba69e-bc65-44d5-baf2-4731fb94240f" + }, + "m_Name": "Smoothness Far", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_BB3F00BF", + "m_OverrideReferenceName": "_Crest_SmoothnessFar", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.8, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "7c52172b64174c238d63df6a6ea01f69", + "m_Name": "Subsurface Scatttering", + "m_ChildObjectList": [ + { + "m_Id": "723dc6aba75e40dcbe7ee413e905c51a" + }, + { + "m_Id": "c9e151d906b14205b3c0d9b6d5561067" + }, + { + "m_Id": "aa43a0a61bb9443ea398c342f79765a9" + }, + { + "m_Id": "d3e20a560cd246c5966f967e53903833" + }, + { + "m_Id": "b46c0ecc382d4777a4364feb0e0f8b70" + }, + { + "m_Id": "86d9bc7bf9c2470ebe124428be6585d1" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "813ea711c89d4b43803d90b274b12e8f", + "m_Id": 1, + "m_DisplayName": "o_Normal", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "o_Normal", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData", + "m_ObjectId": "81a3aef8387044d2a3fbf24877b4f380", + "m_NormalDropOffSpace": 2, + "m_BlendPreserveSpecular": false, + "m_ReceiveDecals": true, + "m_ReceiveSSR": true, + "m_ReceiveSSRTransparent": true, + "m_SpecularAA": false, + "m_SpecularOcclusionMode": 1, + "m_OverrideBakedGI": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "8208cb1830d44c9abea8e785ec4187da", + "m_Id": 5, + "m_DisplayName": "o_Occlusion", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "o_Occlusion", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "82e9b6c3d9dc4782957d60c8d09119cd", + "m_Id": 16, + "m_DisplayName": "Scene_Depth", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Scene_Depth", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CameraNode", + "m_ObjectId": "840981f260e04e378944867968a40230", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Camera", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": 1355.0001220703125, + "y": 127.0000991821289, + "width": 96.9998779296875, + "height": 75.99993133544922 + } + }, + "m_Slots": [ + { + "m_Id": "9a2c0b6a5c604924b1d37e4fa221e032" + }, + { + "m_Id": "e5d7d621e53a44598747bb25ccf0dca5" + }, + { + "m_Id": "42af552c56814415adaf3f442e76a8f3" + }, + { + "m_Id": "75e4730fc7a040cfa3b993329bc76d87" + }, + { + "m_Id": "da377bcf5895426f889bf7f43fea086c" + }, + { + "m_Id": "77f30e5b61ae46c19146e7c270fa7aa8" + }, + { + "m_Id": "023e0d861a9247689a2f5c3db679f5e3" + }, + { + "m_Id": "c8d4b557497248afaf7f293a36ade324" + } + ], + "synonyms": [ + "position", + "direction", + "orthographic", + "near plane", + "far plane", + "width", + "height" + ], + "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": "852bbc9178fe4d819f976ab80a0d4a3c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.RefractionColor", + "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": "4e2ff019a3b64772a3ae2b1e6ab7a900" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.RefractionColor" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "855a78e097d54640b5bbc53c3f227524", + "m_Guid": { + "m_GuidSerialized": "30aadd1a-9dd7-4eab-a347-266b840f67b4" + }, + "m_Name": "Caustics Motion Blur", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Caustics Motion Blur", + "m_DefaultReferenceName": "_Caustics_Motion_Blur", + "m_OverrideReferenceName": "_Crest_CausticsMotionBlur", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 10.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "86d9bc7bf9c2470ebe124428be6585d1", + "m_Guid": { + "m_GuidSerialized": "d79f410d-74ce-42a7-96be-831f91f5aa72" + }, + "m_Name": "SSS Directional Falloff", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "SSS Directional Falloff", + "m_DefaultReferenceName": "_SSS_Directional_Falloff", + "m_OverrideReferenceName": "_Crest_SSSDirectionalFalloff", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 2.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.5, + "y": 8.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "8741edca0fbbee8a8999dd01e18125ee", + "m_Guid": { + "m_GuidSerialized": "440cd98b-3e75-4638-8fbe-256c224bbdac" + }, + "m_Name": "Smoothness Far Distance", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_668538DC", + "m_OverrideReferenceName": "_Crest_SmoothnessFarDistance", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 4000.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 1.0, + "y": 8000.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "87bec886e74d0b818024ab60ee3f8d88", + "m_Guid": { + "m_GuidSerialized": "e6bc08dc-640b-44f8-8250-ef8357a9c3bb" + }, + "m_Name": "Caustics Grey Point", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_D144C4E1", + "m_OverrideReferenceName": "_Crest_CausticsTextureAverage", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.07000000029802323, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "882dadfb4b104b03ab629981e3b4528d", + "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": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "8cd7130e53ca418f98027d1a6ec5db0d", + "m_Id": 3, + "m_DisplayName": "o_Emission", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "o_Emission", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "8e8aee51883445f1b08bfbec696cb18d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Metallic", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2691.999755859375, + "y": 871.9999389648438, + "width": 200.000244140625, + "height": 41.0 + } + }, + "m_Slots": [ + { + "m_Id": "a82fc9659a8640bf860e2051118ded81" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Metallic" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "8f7d3c6acd8c40a993fe189ad3b6e808", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.CustomInterpolator", + "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": "2bc9e62b42574b07847aba9250b1660a" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Flow#2" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "9007c591a2e44c06bf6301a6752b966b", + "m_Id": 0, + "m_DisplayName": "Undisplaced_XZ", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Undisplaced_XZ", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "91363cf6c6b44054997f3e0b5549ed73", + "m_Id": 0, + "m_DisplayName": "Specular Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Specular", + "m_StageCapability": 2, + "m_Value": { + "x": 0.7452830076217651, + "y": 0.7452830076217651, + "z": 0.7452830076217651 + }, + "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": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "91e9a577d315a3848dfb1f48a6743f9c", + "m_Guid": { + "m_GuidSerialized": "9226adec-1697-473d-bfc8-32ef2f802434" + }, + "m_Name": "Caustics Depth of Field", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_D55D4FBF", + "m_OverrideReferenceName": "_Crest_CausticsDepthOfField", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 6.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.009999999776482582, + "y": 10.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "91f70aef4b7344fa9bd8a019b1deb03e", + "m_Id": 0, + "m_DisplayName": "Ambient Occlusion", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Occlusion", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "93c5051a05a94644b9bbf2bf2e90e741", + "m_Id": 2, + "m_DisplayName": "Cosine Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Cosine Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CustomInterpolatorNode", + "m_ObjectId": "94663a98bbc145dba013a7c0d9301c85", + "m_Group": { + "m_Id": "0b12e9fc0b164611b7fa17e0c6955043" + }, + "m_Name": "Water_Level_Offset (Custom Interpolator)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 645.0000610351563, + "y": 455.00006103515627, + "width": 282.0, + "height": 94.0 + } + }, + "m_Slots": [ + { + "m_Id": "5e12f24b0f7c4d378cea72abc720df26" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "customBlockNodeName": "Water_Level_Offset", + "serializedType": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "9475b0c108bc456eb09f35111542022b", + "m_Name": "Reflections", + "m_ChildObjectList": [ + { + "m_Id": "6f4f3ecc7e7d4d83ab0176010684a61e" + }, + { + "m_Id": "c700bce5ef10cf8e9e5b69ba043d383b" + }, + { + "m_Id": "21db17a76f094b19ba523148b6f7aa41" + }, + { + "m_Id": "7b2f0f23d232ab88bcacd3e88392015a" + }, + { + "m_Id": "7bd38e1a9e3f978aa6c1746701bf789b" + }, + { + "m_Id": "8741edca0fbbee8a8999dd01e18125ee" + }, + { + "m_Id": "9c1e3b7101c8d18eafc43983c69eb3d0" + }, + { + "m_Id": "71f6994de656018baa684da1128e623c" + }, + { + "m_Id": "d6af4ca8280b4d56b6f2bf1c8b7a0bbd" + }, + { + "m_Id": "2d31998b356d41179aa5291dcedc7850" + }, + { + "m_Id": "0d81099c729342968bf4ee002d378dcf" + }, + { + "m_Id": "e632a014145542d8a0f6bad7aac6cb63" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "953d810767954375930bc2e13cb46a51", + "m_Id": 13, + "m_DisplayName": "Camera_Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Camera_Position", + "m_StageCapability": 3, + "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_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "973fda11195c4260a5bee711dca38ccf", + "m_Guid": { + "m_GuidSerialized": "8f109505-58b6-4876-b26e-c07f5751496e" + }, + "m_Name": "Direct Term", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Direct Term", + "m_DefaultReferenceName": "_Direct_Term", + "m_OverrideReferenceName": "_Crest_DirectTerm", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "9872f3ce676b446e97fd8eea59a121e5", + "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": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "994e8f13c14f6c80985a81bc860d6550", + "m_Guid": { + "m_GuidSerialized": "d1dc886e-c446-4768-8588-b16b79d9651b" + }, + "m_Name": "Scattering", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Color_33D97985", + "m_OverrideReferenceName": "_Crest_Scattering", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "r": 0.0, + "g": 0.09803921729326248, + "b": 0.20000000298023225, + "a": 1.0 + }, + "isMainColor": false, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "9a2c0b6a5c604924b1d37e4fa221e032", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 3, + "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_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "9c1e3b7101c8d18eafc43983c69eb3d0", + "m_Guid": { + "m_GuidSerialized": "30a35dd7-a9df-4b1b-8439-ce6b5458df42" + }, + "m_Name": "Smoothness Falloff", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_6D4913AE", + "m_OverrideReferenceName": "_Crest_SmoothnessFalloff", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.5, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 5.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9d5b95e11d8c472c884a6c0295b1cd4e", + "m_Id": 0, + "m_DisplayName": "Thickness", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Thickness", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "a11232afc69f728f9691066ce697feee", + "m_Guid": { + "m_GuidSerialized": "87092513-30db-4f86-84a6-fcae5d7f5c09" + }, + "m_Name": "Foam Texture", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Texture2D_686B83E5", + "m_OverrideReferenceName": "_Crest_FoamTexture", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"959dd0505e2c54585865f51257daa0e3\",\"type\":3}}", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": false, + "m_Modifiable": true, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "a141f53b584cb28fb6292eb41f81614b", + "m_Guid": { + "m_GuidSerialized": "796372d3-af2f-49e4-a1b8-afd3516df24c" + }, + "m_Name": "Foam Normal Strength", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_AB752019", + "m_OverrideReferenceName": "_Crest_FoamNormalStrength", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 3.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "a1b2f9dc07dc18858f11fd5ff20187d8", + "m_Guid": { + "m_GuidSerialized": "28bd3197-1e77-4feb-9870-07c167c99596" + }, + "m_Name": "Caustics Texture", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Texture2D_3BE9AD61", + "m_OverrideReferenceName": "_Crest_CausticsTexture", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"1407209016967410da2ae6fdd4d97fc6\",\"type\":3}}", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": false, + "m_Modifiable": true, + "m_DefaultType": 1 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "a22b846424134313814bef43e40c5cb3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Vertex (Custom Function)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1647.0, + "y": -80.99993133544922, + "width": 317.0, + "height": 238.0 + } + }, + "m_Slots": [ + { + "m_Id": "3b4e99d0926f487682f11375ff6a57bd" + }, + { + "m_Id": "ce9362a1c92e483fa82bf400f6c55967" + }, + { + "m_Id": "b90775c28ccb48139273b5f2b4071b81" + }, + { + "m_Id": "503219cfdffc43b38928577e580c684b" + }, + { + "m_Id": "3efd227739f54e0e8ad0e727e8fff52e" + }, + { + "m_Id": "45e01376beba4378949c16fb68aeda17" + }, + { + "m_Id": "5a4a6e350ff4411097da39c02f42957c" + }, + { + "m_Id": "c3972c4f68b848a9a4a4ab335d0ffd94" + }, + { + "m_Id": "953d810767954375930bc2e13cb46a51" + }, + { + "m_Id": "fb1302edc1fa4af5b8c45996545e0902" + } + ], + "synonyms": [ + "code", + "HLSL" + ], + "m_Precision": 1, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 0, + "m_FunctionName": "Vertex", + "m_FunctionSource": "2c406004ec98d40d292b359364c27961", + "m_FunctionBody": "Enter function body here..." +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget", + "m_ObjectId": "a52dd0dd7c42405cabd2b96b877532a3", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 2, + "m_ClearCoat": false, + "m_BlendModePreserveSpecular": false +} + +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "a591f22444f34efc876bf557bb9ebd1f", + "m_Guid": { + "m_GuidSerialized": "d3a0040e-a78c-44fd-bb5f-94d821fb431c" + }, + "m_Name": "Absorption Color", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Absorption Color", + "m_DefaultReferenceName": "_Absorption_Color", + "m_OverrideReferenceName": "_Crest_AbsorptionColor", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "r": 0.3416268229484558, + "g": 0.6954545974731445, + "b": 0.8500000238418579, + "a": 0.10196078568696976 + }, + "isMainColor": false, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "a64036ce5dde44bf8d55a5caf75668f5", + "m_Guid": { + "m_GuidSerialized": "f48287db-5185-4719-99df-02fc69d0d9c3" + }, + "m_Name": "Ambient Term", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Ambient Term", + "m_DefaultReferenceName": "_Ambient_Term", + "m_OverrideReferenceName": "_Crest_AmbientTerm", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ViewDirectionNode", + "m_ObjectId": "a6aefd808acc4136b14b84d9277addbd", + "m_Group": { + "m_Id": "" + }, + "m_Name": "View Direction", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1149.0, + "y": 872.0001220703125, + "width": 206.0001220703125, + "height": 130.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "6944d0d08aa242f38d21b3ff8a19d7a0" + } + ], + "synonyms": [ + "eye direction" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a82fc9659a8640bf860e2051118ded81", + "m_Id": 0, + "m_DisplayName": "Metallic", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Metallic", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "aa43a0a61bb9443ea398c342f79765a9", + "m_Guid": { + "m_GuidSerialized": "b9950af2-aed4-414d-b178-aaf1174e2e3b" + }, + "m_Name": "SSS Pinch Minimum", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "SSS Pinch Minimum", + "m_DefaultReferenceName": "_SSS_Pinch_Minimum", + "m_OverrideReferenceName": "_Crest_SSSPinchMinimum", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.5699999928474426, + "m_FloatType": 1, + "m_RangeValues": { + "x": -1.0, + "y": 3.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "aa6aadfb2101446cabb0da2a6c68ead3", + "m_Id": 23, + "m_DisplayName": "Static_Lightmap_UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Static_Lightmap_UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector3ShaderProperty", + "m_ObjectId": "aa75e7087fa330809fdc753edcd8995b", + "m_Guid": { + "m_GuidSerialized": "a2bdf012-457e-4935-b7b5-e2078b0d8cee" + }, + "m_Name": "Absorption", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector3_2B491163", + "m_OverrideReferenceName": "_Crest_Absorption", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 1, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "x": 0.7008615732192993, + "y": 0.2369990050792694, + "z": 0.10605160146951676, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "ab5c287be1ea4492ab82972b1124492c", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "3b6b9f9fc3614e43a2cd513af66b9fc5" + }, + { + "m_Id": "aa75e7087fa330809fdc753edcd8995b" + } + ] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "ac20e42c0c5f4e60872782a3b5cb4aac", + "m_Guid": { + "m_GuidSerialized": "6dbefb58-73e0-4c93-9e20-7736a46c599c" + }, + "m_Name": "Shadows Affects Ambient Factor", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Shadows Affects Ambient Factor", + "m_DefaultReferenceName": "_Shadows_Affects_Ambient_Factor", + "m_OverrideReferenceName": "_Crest_ShadowsAffectsAmbientFactor", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.5, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "ac72e84550f64ff7bba0fdec760e9ac8", + "m_Id": 0, + "m_DisplayName": "Index Of Refraction", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "RefractionIndex", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "ad86ac4b1c7d4f998c9e2b44c9950af2", + "m_Id": 22, + "m_DisplayName": "Position_WS", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position_WS", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "b0622d58143646b4bd6c849858bac981", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInTarget", + "m_ObjectId": "b08214e872de4a3b82e77ece5ecb284d", + "m_ActiveSubTarget": { + "m_Id": "bb3b0e5f6ef041aebb81194f38a5d07c" + }, + "m_AllowMaterialOverride": true, + "m_SurfaceType": 1, + "m_ZWriteControl": 1, + "m_ZTestMode": 4, + "m_AlphaMode": 0, + "m_RenderFace": 0, + "m_AlphaClip": true, + "m_CustomEditorGUI": "WaveHarmonic.Crest.Editor.LegacyWaterShaderGUI" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "b46c0ecc382d4777a4364feb0e0f8b70", + "m_Guid": { + "m_GuidSerialized": "90d60f39-3e5f-42b2-96bb-03923a1dcc30" + }, + "m_Name": "SSS Pinch Falloff", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "SSS Pinch Falloff", + "m_DefaultReferenceName": "_SSS_Pinch_Falloff", + "m_OverrideReferenceName": "_Crest_SSSPinchFalloff", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.5, + "m_FloatType": 1, + "m_RangeValues": { + "x": 1.0, + "y": 8.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b674b64ba77748a1a1ab3cf388aa1232", + "m_Id": 8, + "m_DisplayName": "LOD_Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "LOD_Alpha", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "b7891fe7e5a34f03adebd8a45505c5fc", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Smoothness", + "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": "030e617918184625a9f533d1786f82cf" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Smoothness" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "b83ed6e75a6f47b785c0fc9a5ee0c00a", + "m_Guid": { + "m_GuidSerialized": "511967ee-cd16-49f3-b4bc-f1108dbebe3e" + }, + "m_Name": "Albedo Ignore Foam", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Albedo Ignore Foam", + "m_DefaultReferenceName": "_Albedo_Ignore_Foam", + "m_OverrideReferenceName": "_Crest_AlbedoIgnoreFoam", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b90775c28ccb48139273b5f2b4071b81", + "m_Id": 7, + "m_DisplayName": "LOD_Alpha", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "LOD_Alpha", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "b91141f3e4cf4131ab732e6ae5828231", + "m_Guid": { + "m_GuidSerialized": "cbd2da98-b96c-40d7-951d-8646cf855506" + }, + "m_Name": "Flow Enabled", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "BOOLEAN_547DED44_ON", + "m_OverrideReferenceName": "CREST_FLOW_ON", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_KeywordType": 0, + "m_KeywordDefinition": 0, + "m_KeywordScope": 0, + "m_KeywordStages": 63, + "m_Entries": [], + "m_Value": 0, + "m_IsEditable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "bb078b3adb574ec18c0f7d0a0a94a72b", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "WaveHarmonic.Crest.Editor.ShaderGraph.BuiltInLitSubTarget", + "m_ObjectId": "bb3b0e5f6ef041aebb81194f38a5d07c", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 2, + "m_TransparentReceiveShadows": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "bb642d517f6040f9b3810d5c14873f37", + "m_Guid": { + "m_GuidSerialized": "579db0d6-50ab-4e1b-9d48-3dea19ec1186" + }, + "m_Name": "Albedo Enabled", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Albedo Enabled", + "m_DefaultReferenceName": "_Albedo_Enabled", + "m_OverrideReferenceName": "_Crest_AlbedoEnabled", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": false +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "bbd2579dfd7f38879fab18706b09b5fb", + "m_Guid": { + "m_GuidSerialized": "016cb2c5-f364-4008-a0c6-7048633752a2" + }, + "m_Name": "Refractive Index of Water (U)", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_C5277D42", + "m_OverrideReferenceName": "_Crest_RefractiveIndexOfWater", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.3300000429153443, + "m_FloatType": 1, + "m_RangeValues": { + "x": 1.0, + "y": 2.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "bd96da68193149a4a37e60284d87b160", + "m_Guid": { + "m_GuidSerialized": "c3691388-802d-4ae2-afd0-75b19f4ff190" + }, + "m_Name": "Caustics Enabled", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Caustics Enabled", + "m_DefaultReferenceName": "_Caustics_Enabled", + "m_OverrideReferenceName": "_Crest_CausticsEnabled", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": true +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "bfe5cf33a577b383b757f8332383b77d", + "m_Guid": { + "m_GuidSerialized": "f345b0a9-2d46-4f55-81f2-4d97087d379e" + }, + "m_Name": "Foam Feather", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_1E5C55C0", + "m_OverrideReferenceName": "_Crest_FoamFeather", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.75, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0010000000474974514, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "c145f00f4fe840b49f120c0890188e8f", + "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": 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.Vector3MaterialSlot", + "m_ObjectId": "c3972c4f68b848a9a4a4ab335d0ffd94", + "m_Id": 14, + "m_DisplayName": "Object_Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Object_Position", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "c3f4381605564b8bb0cc3445ae03c7b1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Thickness", + "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": "9d5b95e11d8c472c884a6c0295b1cd4e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Thickness" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "c700bce5ef10cf8e9e5b69ba043d383b", + "m_Guid": { + "m_GuidSerialized": "6f667c2d-be20-48d7-b430-5d16e288e854" + }, + "m_Name": "Occlusion", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_5F4D880B", + "m_OverrideReferenceName": "_Crest_Occlusion", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c8d4b557497248afaf7f293a36ade324", + "m_Id": 7, + "m_DisplayName": "Height", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Height", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "c9e151d906b14205b3c0d9b6d5561067", + "m_Guid": { + "m_GuidSerialized": "4d8207fb-5fbb-4173-b3aa-c4157a1dbe38" + }, + "m_Name": "SSS Intensity", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "SSS Intensity", + "m_DefaultReferenceName": "_SSS_Intensity", + "m_OverrideReferenceName": "_Crest_SSSIntensity", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 3.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ObjectNode", + "m_ObjectId": "cc4998fd8e074695a09b766078550f62", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Object", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": 1355.0001220703125, + "y": 50.00008010864258, + "width": 96.9998779296875, + "height": 75.99992370605469 + } + }, + "m_Slots": [ + { + "m_Id": "2578b8f9b3fa4b19ac471501136576e4" + }, + { + "m_Id": "538cf5cf053d448e9eda5626daa46d9d" + }, + { + "m_Id": "014708395fd3480aad2b5de738cb4d20" + }, + { + "m_Id": "25f5ad60e93046fdaaf419e16de106ee" + }, + { + "m_Id": "07e7cb6fc0a64d58a86ea20335ce4ef5" + } + ], + "synonyms": [ + "position", + "scale", + "bounds", + "size" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "ce9362a1c92e483fa82bf400f6c55967", + "m_Id": 6, + "m_DisplayName": "Undisplaced_XZ", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Undisplaced_XZ", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDLitData", + "m_ObjectId": "cee72db709954dd38e8039e087fe5744", + "m_RayTracing": false, + "m_MaterialType": 0, + "m_MaterialTypeMask": 18, + "m_RefractionModel": 1, + "m_SSSTransmission": true, + "m_EnergyConservingSpecular": false, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "d03d9fc3ce7b4a8f939cf6a6a147257e", + "m_Guid": { + "m_GuidSerialized": "0d9af4eb-098c-4bef-b63d-6e6ff46404f4" + }, + "m_Name": "Foam Scale", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_89268251", + "m_OverrideReferenceName": "_Crest_FoamScale", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 5.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.009999999776482582, + "y": 100.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CustomInterpolatorNode", + "m_ObjectId": "d056d4d282b14a5b9a336e5561143c6a", + "m_Group": { + "m_Id": "0b12e9fc0b164611b7fa17e0c6955043" + }, + "m_Name": "Undisplaced_XZ (Custom Interpolator)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 664.0000610351563, + "y": 267.0000915527344, + "width": 263.0, + "height": 93.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "0baa9d94a6294f619b49aa7151c9229a" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "customBlockNodeName": "Undisplaced_XZ", + "serializedType": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d184a57774014d1b93bf49daab22b439", + "m_Id": 1, + "m_DisplayName": "Sine Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Sine Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "d22d7fde479b42818d46226e4fdf8fd2", + "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": "9872f3ce676b446e97fd8eea59a121e5" + } + ], + "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.Vector1MaterialSlot", + "m_ObjectId": "d32e3256b70746c094ee8fa4f441ad01", + "m_Id": 0, + "m_DisplayName": "Absorption Distance", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "RefractionDistance", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "d33c23a144f9400888ebc0b17741ceea", + "m_Guid": { + "m_GuidSerialized": "e1a75ef8-fade-46ee-8a16-04fd2500751a" + }, + "m_Name": "Total Internal Reflection Intensity (U)", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Total Internal Reflection Intensity (U)", + "m_DefaultReferenceName": "_Total_Internal_Reflection_Intensity_U", + "m_OverrideReferenceName": "_Crest_TotalInternalReflectionIntensity", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.800000011920929, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "d347a12dc40b4875b10257a32f31301c", + "m_Guid": { + "m_GuidSerialized": "5cc04501-f8c3-4b03-9742-5dd6592a9ff9" + }, + "m_Name": "Shadow Caster Threshold", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Shadow Caster Threshold", + "m_DefaultReferenceName": "_Shadow_Caster_Threshold", + "m_OverrideReferenceName": "_Crest_ShadowCasterThreshold", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.5, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CustomInterpolatorNode", + "m_ObjectId": "d3778e9c7b9a4c8098a0fba6b826b854", + "m_Group": { + "m_Id": "0b12e9fc0b164611b7fa17e0c6955043" + }, + "m_Name": "Flow (Custom Interpolator)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 728.0, + "y": 643.0, + "width": 198.5, + "height": 94.0 + } + }, + "m_Slots": [ + { + "m_Id": "4f9c60ee0f3e4c42ac334922e9640127" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "customBlockNodeName": "Flow", + "serializedType": 2 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "d3e20a560cd246c5966f967e53903833", + "m_Guid": { + "m_GuidSerialized": "398acfbb-f135-4a63-9a46-e8845cf96ebb" + }, + "m_Name": "SSS Pinch Maximum", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "SSS Pinch Maximum", + "m_DefaultReferenceName": "_SSS_Pinch_Maximum", + "m_OverrideReferenceName": "_Crest_SSSPinchMaximum", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.6699999570846558, + "m_FloatType": 1, + "m_RangeValues": { + "x": -1.0, + "y": 5.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "d6507a957f404764aa2670d0dc950578", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.CustomInterpolator", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2662.666748046875, + "y": 498.00006103515627, + "width": 200.0, + "height": 42.66656494140625 + } + }, + "m_Slots": [ + { + "m_Id": "2b33bfcf12bd4deca2a09ca1fa4a583c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Water_Level_Derivatives#2" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "d65753c4eac547c5a73c35da6956d9e2", + "m_Name": "Albedo", + "m_ChildObjectList": [ + { + "m_Id": "bb642d517f6040f9b3810d5c14873f37" + }, + { + "m_Id": "b83ed6e75a6f47b785c0fc9a5ee0c00a" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "d6af4ca8280b4d56b6f2bf1c8b7a0bbd", + "m_Guid": { + "m_GuidSerialized": "0b5b9cdf-4a2b-4bfb-837f-3d4359797443" + }, + "m_Name": "Planar Reflections Enabled", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Planar Reflections Enabled", + "m_DefaultReferenceName": "_Planar_Reflections_Enabled", + "m_OverrideReferenceName": "_Crest_PlanarReflectionsEnabled", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "d741ef18d57845e59b9e6d6ebeb72dec", + "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": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "d78925eabe5948b98e661f7eeba64a4e", + "m_Id": 14, + "m_DisplayName": "Facing", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Facing", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionMaterialSlot", + "m_ObjectId": "d89ecf302f85402382c31ff6408de83a", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "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_ScreenSpaceType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "da377bcf5895426f889bf7f43fea086c", + "m_Id": 4, + "m_DisplayName": "Far Plane", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Far Plane", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "dd2364c2819e440281a8d86cde9bcba5", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": true, + "m_DefaultValue": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "de2797e54cc7464ea2e88533681e7485", + "m_Id": 9, + "m_DisplayName": "Water_Level_Offset", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Water_Level_Offset", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e1cad9f1cf9b489c9cac9fa804c1b5aa", + "m_Id": 6, + "m_DisplayName": "o_Alpha", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "o_Alpha", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "e207931e020242bba83058a59f3fb07d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Occlusion", + "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": "91f70aef4b7344fa9bd8a019b1deb03e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Occlusion" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "e4a54526c6204b5badd66e158dcf0b1d", + "m_Guid": { + "m_GuidSerialized": "92ccb9e9-19a2-4948-ac31-1ab0371cd06c" + }, + "m_Name": "Foam Scroll Speed", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Foam Scroll Speed", + "m_DefaultReferenceName": "_Foam_Scroll_Speed", + "m_OverrideReferenceName": "_Crest_FoamScrollSpeed", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 10.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "e5d7d621e53a44598747bb25ccf0dca5", + "m_Id": 1, + "m_DisplayName": "Direction", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Direction", + "m_StageCapability": 3, + "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_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "e608dd8f43794f5d8b3995446b21467f", + "m_Guid": { + "m_GuidSerialized": "d83718f9-1ca4-4085-943f-b0ed817ce4ff" + }, + "m_Name": "Normal Map Scroll Speed", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Normal Map Scroll Speed", + "m_DefaultReferenceName": "_Normal_Map_Scroll_Speed", + "m_OverrideReferenceName": "_Crest_NormalMapScrollSpeed", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 10.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "e632a014145542d8a0f6bad7aac6cb63", + "m_Guid": { + "m_GuidSerialized": "ca2a2ba7-796c-406c-b697-e71a0d46dc01" + }, + "m_Name": "Planar Reflections Roughness", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Planar Reflections Roughness", + "m_DefaultReferenceName": "_Planar_Reflections_Roughness", + "m_OverrideReferenceName": "_Crest_PlanarReflectionsRoughness", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "e9abf5f3e2204dec98991b9ac5698855", + "m_Id": 0, + "m_DisplayName": "Normal (World Space)", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "NormalWS", + "m_StageCapability": 2, + "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": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "eba256bd9199402fb1791e8f894b5e8f", + "m_Id": 0, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "m_StageCapability": 2, + "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_ColorMode": 1, + "m_DefaultColor": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "eda23d92596c4c3e93952a590edf7bfc", + "m_Id": 18, + "m_DisplayName": "Screen_Position_Raw", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Screen_Position_Raw", + "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.Rendering.HighDefinition.ShaderGraph.HDLitSubTarget", + "m_ObjectId": "eea8298ecc6944318bd614020316fbf9" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "f00a6ef3872645488e79e89c6ac1845e", + "m_Guid": { + "m_GuidSerialized": "922f470c-a338-42a7-b4bf-88e3dee67c04" + }, + "m_Name": "Normal Map Enabled", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Normal Map Enabled", + "m_DefaultReferenceName": "_Normal_Map_Enabled", + "m_OverrideReferenceName": "_Crest_NormalMapEnabled", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SceneDepthNode", + "m_ObjectId": "f1091500a8a244058957bd706b5fd6e7", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Scene Depth", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1213.0001220703125, + "y": 1157.0, + "width": 144.9998779296875, + "height": 112.0 + } + }, + "m_Slots": [ + { + "m_Id": "62352145719941a3ab393292aab906fd" + }, + { + "m_Id": "0462d8e66f824b829a9cb6ba741ed13e" + } + ], + "synonyms": [ + "zbuffer", + "zdepth" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_DepthSamplingMode": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f16010780e29425caac8bbcfaae9bde4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.CustomInterpolator", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2649.33349609375, + "y": 452.0, + "width": 200.0, + "height": 42.666656494140628 + } + }, + "m_Slots": [ + { + "m_Id": "67f656c3174f49288d9d8b8af7c19143" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Water_Level_Offset#1" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "f75baf34d9f28a80a10af59ed35841c5", + "m_Guid": { + "m_GuidSerialized": "569ad017-c9ab-4564-96d8-3d3a02906460" + }, + "m_Name": "Caustics Focal Depth", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_F5243F4D", + "m_OverrideReferenceName": "_Crest_CausticsFocalDepth", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 2.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 25.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.PositionNode", + "m_ObjectId": "f8a8f45aa5dd42febd6bf935dae62d1c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1152.0001220703125, + "y": 1527.0, + "width": 205.9998779296875, + "height": 131.0001220703125 + } + }, + "m_Slots": [ + { + "m_Id": "fb9b94a343fb4c1e9e370da501e0abba" + } + ], + "synonyms": [ + "location" + ], + "m_Precision": 1, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 4, + "m_PositionSource": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "fb1302edc1fa4af5b8c45996545e0902", + "m_Id": 12, + "m_DisplayName": "Time", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "fb9b94a343fb4c1e9e370da501e0abba", + "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": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "fba39aeafd5aed838e2205e938a89b91", + "m_Guid": { + "m_GuidSerialized": "9d7cf72b-e9b8-4542-b782-117a50047aaf" + }, + "m_Name": "Caustics Scale", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_80D2C448", + "m_OverrideReferenceName": "_Crest_CausticsTextureScale", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 50.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.009999999776482582, + "y": 100.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "fc68a5e215ec419dab8e51a54c9f195c", + "m_Id": 1, + "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 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "ff8bcce5ee09228abb73bf677fa20052", + "m_Guid": { + "m_GuidSerialized": "dc3a022f-46de-44c7-83fd-d2443a2eb0e5" + }, + "m_Name": "Normal Map Scale", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_DD234E2B", + "m_OverrideReferenceName": "_Crest_NormalMapScale", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 2, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 3.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.009999999776482582, + "y": 100.0 + } +} + diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Water.shadergraph.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Water.shadergraph.meta new file mode 100644 index 0000000..80258f7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Water.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 00ffe7d0b7161420897069dc6e12822c +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility.meta new file mode 100644 index 0000000..0de3459 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b707759b729ba4f7fb35c96ddf8a8912 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Blit.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Blit.shader new file mode 100644 index 0000000..a1d409d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Blit.shader @@ -0,0 +1,159 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Provides utility passes for rendering like clearing the stencil buffer. + +Shader "Hidden/Crest/Utility/Blit" +{ + HLSLINCLUDE + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" + + struct Attributes + { + uint id : SV_VertexID; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO + }; + + Varyings Vertex(Attributes input) + { + // This will work for all pipelines. + Varyings output = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + output.positionCS = GetFullScreenTriangleVertexPosition(input.id); + output.uv = GetFullScreenTriangleTexCoord(input.id); + return output; + } + ENDHLSL + + SubShader + { + Blend Off + Cull Off + ZTest Always + ZWrite Off + + Pass + { + // Copies the color texture. + Name "Copy Color" + + HLSLPROGRAM + TEXTURE2D_X(_CameraColorTexture); + + float4 Fragment(Varyings input) : SV_Target + { + // We need this when sampling a screenspace texture. + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + return LOAD_TEXTURE2D_X(_CameraColorTexture, input.positionCS.xy); + } + ENDHLSL + } + + Pass + { + // Copies the depth from the camera depth texture. Clears the stencil for convenience. + Name "Copy Depth / Clear Stencil" + + ZWrite On + + Stencil + { + Ref 0 + Comp Always + Pass Replace + } + + HLSLPROGRAM + TEXTURE2D_X(_CameraDepthTexture); + float Fragment(Varyings input) : SV_Depth + { + // We need this when sampling a screenspace texture. + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + return LOAD_DEPTH_TEXTURE_X(_CameraDepthTexture, input.positionCS.xy); + } + ENDHLSL + } + + Pass + { + // Clears the depth buffer without clearing the stencil. + Name "Clear Depth" + + ZWrite On + + HLSLPROGRAM + float Fragment(Varyings input) : SV_Depth + { + return 0.0; + } + ENDHLSL + } + + Pass + { + // Clears the stencil buffer without clearing depth + Name "Clear Stencil" + + ColorMask 0 + + Stencil + { + Ref 0 + Comp Always + Pass Replace + } + + HLSLPROGRAM + float Fragment(Varyings input) : SV_Target + { + return 0.0; + } + ENDHLSL + } + + Pass + { + Name "Copy" + + HLSLPROGRAM + TEXTURE2D(_Utility_MainTexture); + SAMPLER(sampler_Utility_MainTexture); + float4 Fragment(Varyings input) : SV_Target + { + return SAMPLE_TEXTURE2D(_Utility_MainTexture, sampler_Utility_MainTexture, input.uv); + } + ENDHLSL + } + + Pass + { + Name "Merge Depth" + + // All is required to merge depth. + ZTest Less + ZWrite On + + HLSLPROGRAM + TEXTURE2D_X(_Utility_MainTexture); + float Fragment(Varyings input) : SV_Depth + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + return LOAD_DEPTH_TEXTURE_X(_Utility_MainTexture, input.positionCS.xy); + } + ENDHLSL + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Blit.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Blit.shader.meta new file mode 100644 index 0000000..5e96bd0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Blit.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b9836aaab4b1f45e4bd4fc4e6bcc7e74 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Clear.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Clear.compute new file mode 100644 index 0000000..4103fa5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Clear.compute @@ -0,0 +1,55 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Clear specific components using a mask. + +#pragma kernel CrestClearTarget +#pragma kernel CrestClearTargetBoundaryX d_BoundaryX +#pragma kernel CrestClearTargetBoundaryY d_BoundaryY + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl" + +RWTexture2DArray _Crest_Target; + +CBUFFER_START(CrestPerMaterial) +float4 _Crest_ClearMask; +float4 _Crest_ClearColor; +uint _Crest_Resolution; +uint _Crest_TargetSlice; +CBUFFER_END + +#if d_BoundaryX +#define d_Axis y +#else +#define d_Axis x +#endif + +m_UtilityNameSpace + +void ClearTarget(uint3 id) +{ + _Crest_Target[id] *= 1.0 - _Crest_ClearMask; + _Crest_Target[id] += _Crest_ClearColor; +} + +void ClearTargetBoundary(uint3 id) +{ + id.z = _Crest_TargetSlice; + _Crest_Target[id] = _Crest_ClearColor; + + // Opposite row/column. + id.d_Axis = _Crest_Resolution - 1; + _Crest_Target[id] = _Crest_ClearColor; +} + +m_UtilityNameSpaceEnd + +m_UtilityKernelDefault(ClearTarget) + +[numthreads(8, 1, 1)] +m_UtilityKernelVariant(ClearTargetBoundary, X) + +[numthreads(1, 8, 1)] +m_UtilityKernelVariant(ClearTargetBoundary, Y) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Clear.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Clear.compute.meta new file mode 100644 index 0000000..93f475e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Clear.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2641e78378c244c2e8ac89563a8ec9af +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy.meta new file mode 100644 index 0000000..ac049d5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5801035604cb84ff5a9557a2173630cd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/CaptureShadowMatrices.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/CaptureShadowMatrices.shader new file mode 100644 index 0000000..f8a2081 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/CaptureShadowMatrices.shader @@ -0,0 +1,42 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest/Legacy/CaptureShadowMatrices" +{ + SubShader + { + Blend Off + ColorMask 0 + Cull Off + ZTest Always + ZWrite Off + + Pass + { + HLSLPROGRAM + #pragma target 4.5 + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + + RWStructuredBuffer _Crest_WorldToShadow; + float4x4 unity_WorldToShadow[4]; + + float4 Vertex(uint id : SV_VertexID) : SV_POSITION + { + return GetFullScreenTriangleVertexPosition(id); + } + + float4 Fragment(float4 pos : SV_POSITION) : SV_Target + { + _Crest_WorldToShadow[0] = unity_WorldToShadow[0]; + _Crest_WorldToShadow[1] = unity_WorldToShadow[1]; + _Crest_WorldToShadow[2] = unity_WorldToShadow[2]; + _Crest_WorldToShadow[3] = unity_WorldToShadow[3]; + return 0; + } + ENDHLSL + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/CaptureShadowMatrices.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/CaptureShadowMatrices.shader.meta new file mode 100644 index 0000000..41896e7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/CaptureShadowMatrices.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 17feb724c7e004b4e8e418931db7eff3 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/ForceShadows.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/ForceShadows.shader new file mode 100644 index 0000000..8ecec73 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/ForceShadows.shader @@ -0,0 +1,51 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest/Legacy/ForceShadows" +{ + CGINCLUDE + #pragma vertex Vertex + #pragma fragment Fragment + + fixed4 Vertex(fixed4 v : POSITION) : SV_POSITION + { + return 0; + } + + fixed4 Fragment(fixed4 i : SV_POSITION) : SV_Target + { + return 0; + } + ENDCG + + SubShader + { + ZTest Always + ZWrite Off + ColorMask 0 + + Pass + { + Tags + { + "LightMode" = "ForwardBase" + } + + CGPROGRAM + #pragma multi_compile_fwdbase + ENDCG + } + + Pass + { + Tags + { + "LightMode" = "ForwardAdd" + } + + CGPROGRAM + #pragma multi_compile_fwdadd_fullshadows + ENDCG + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/ForceShadows.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/ForceShadows.shader.meta new file mode 100644 index 0000000..3bc8c34 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/Legacy/ForceShadows.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c9f384b6b84e943ed83161cb82d95b2e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/TextureArray.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/TextureArray.shader new file mode 100644 index 0000000..444996a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/TextureArray.shader @@ -0,0 +1,55 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Renders a specific slice of a 2D Texture Array +// https://docs.unity3d.com/Manual/SL-TextureArrays.html +Shader "Hidden/Crest/Debug/TextureArray" +{ + SubShader + { + Tags { "RenderType"="Opaque" } + Cull Off + ZWrite Off + + Pass + { + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + #pragma require 2darray + + #include "UnityCG.cginc" + + struct Attributes + { + float4 positionOS : POSITION; + float2 uv : TEXCOORD0; + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float3 uv : TEXCOORD0; + }; + + UNITY_DECLARE_TEX2DARRAY(_MainTex); + uint _Depth; + float _Scale; + float _Bias; + + Varyings Vert(Attributes input) + { + Varyings o; + o.positionCS = UnityObjectToClipPos(input.positionOS); + o.uv = float3(input.uv.xy, _Depth); + return o; + } + + half4 Frag(Varyings input) : SV_TARGET + { + return _Scale * UNITY_SAMPLE_TEX2DARRAY(_MainTex, input.uv) + _Bias; + } + ENDCG + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/TextureArray.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/TextureArray.shader.meta new file mode 100644 index 0000000..2aac99e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Utility/TextureArray.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9984e3507dd424fd49ce01182989250a +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume.meta new file mode 100644 index 0000000..85869ac --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ae196c20022b4f5bbf2863280ee85a6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Debug.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Debug.hlsl new file mode 100644 index 0000000..5257b04 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Debug.hlsl @@ -0,0 +1,44 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Crest_VolumeDebug +#define d_WaveHarmonic_Crest_VolumeDebug + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl" + +m_CrestNameSpace + +float4 DebugRenderWaterMask(const bool isWaterSurface, const bool isUnderwater, const float mask, const float3 sceneColour) +{ + // Red: surface front face when above water + // Green: surface back face when below water + // Cyan: background when above water + // Magenta: background when below water + if (isWaterSurface) + { + return float4(sceneColour * float3(mask >= CREST_MASK_ABOVE_SURFACE, mask <= CREST_MASK_BELOW_SURFACE, 0.0), 1.0); + } + else + { + return float4(sceneColour * float3(isUnderwater * 0.5, (1.0 - isUnderwater) * 0.5, 1.0), 1.0); + } +} + +float4 DebugRenderStencil(float3 sceneColour) +{ + float3 stencil = 1.0; +#if d_Crest_Portal +#if d_Crest_FogAfter + stencil = float3(1.0, 0.0, 0.0); +#elif d_Crest_FogBefore + stencil = float3(0.0, 1.0, 0.0); +#else + stencil = float3(0.0, 0.0, 1.0); +#endif +#endif + return float4(sceneColour * stencil, 1.0); +} + +m_CrestNameSpaceEnd + +#endif // d_WaveHarmonic_Crest_VolumeDebug diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Debug.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Debug.hlsl.meta new file mode 100644 index 0000000..d228a29 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Debug.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f174da407e60e4ed1b24dd11f44c9cdc +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph.meta new file mode 100644 index 0000000..12ad237 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 94b454ee025f04f81b984c298e5ff145 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/Integrate Water Volume.shadersubgraph b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/Integrate Water Volume.shadersubgraph new file mode 100644 index 0000000..2db46d1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/Integrate Water Volume.shadersubgraph @@ -0,0 +1,1262 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "fa6863a20fe5453f84da2aefdcd78727", + "m_Properties": [ + { + "m_Id": "5d923c2657794970996af7cb7159276f" + }, + { + "m_Id": "0640f7e405ca4ded9cced0944e419139" + }, + { + "m_Id": "a0af5588d47b44b5b24f875b67acf31a" + } + ], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "943e9ca00d7248afba41cc8024d2542a" + } + ], + "m_Nodes": [ + { + "m_Id": "dd5931412c824c66b095fb7819859502" + }, + { + "m_Id": "c0989029cf9b440b8d920d94483be2d4" + }, + { + "m_Id": "9ab1f5c4a6894323899049b311181b3f" + }, + { + "m_Id": "1e6912026741481fb3338b2e9c85a203" + }, + { + "m_Id": "3a66a62e50224c799de45b25a67a41c8" + }, + { + "m_Id": "bb35f5be46ba4350a77ad73886c2d67a" + }, + { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + { + "m_Id": "73c08bc2c7be45559da717ae630500f6" + }, + { + "m_Id": "6893ffaca70848d693feacf5b9a166ec" + }, + { + "m_Id": "b5b57b89f263474f8d5d5ffa3f3b30ec" + } + ], + "m_GroupDatas": [ + { + "m_Id": "1100f19ecd45464ca732f01d9e3a3cc4" + } + ], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1e6912026741481fb3338b2e9c85a203" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3a66a62e50224c799de45b25a67a41c8" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3a66a62e50224c799de45b25a67a41c8" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "bb35f5be46ba4350a77ad73886c2d67a" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3a66a62e50224c799de45b25a67a41c8" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "bb35f5be46ba4350a77ad73886c2d67a" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "dd5931412c824c66b095fb7819859502" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + "m_SlotId": 8 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "dd5931412c824c66b095fb7819859502" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6893ffaca70848d693feacf5b9a166ec" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "73c08bc2c7be45559da717ae630500f6" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + "m_SlotId": 6 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9ab1f5c4a6894323899049b311181b3f" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b5b57b89f263474f8d5d5ffa3f3b30ec" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + "m_SlotId": 7 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "bb35f5be46ba4350a77ad73886c2d67a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c0989029cf9b440b8d920d94483be2d4" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "480703a4ce624a52bc7256f8e37a06d0" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Crest", + "m_GraphPrecision": 0, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "dd5931412c824c66b095fb7819859502" + }, + "m_SubDatas": [], + "m_ActiveTargets": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "0640f7e405ca4ded9cced0944e419139", + "m_Guid": { + "m_GuidSerialized": "33f7abbf-d481-4327-84fd-12645ebd2beb" + }, + "m_Name": "Multiplier", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Vector1_0640f7e405ca4ded9cced0944e419139", + "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": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "100759169f234f728c4532414590b1a0", + "m_Id": 7, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "1100f19ecd45464ca732f01d9e3a3cc4", + "m_Title": "Device Depth", + "m_Position": { + "x": -590.5, + "y": -78.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode", + "m_ObjectId": "1e6912026741481fb3338b2e9c85a203", + "m_Group": { + "m_Id": "1100f19ecd45464ca732f01d9e3a3cc4" + }, + "m_Name": "Screen Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -565.4999389648438, + "y": -19.999958038330079, + "width": 145.0, + "height": 128.5 + } + }, + "m_Slots": [ + { + "m_Id": "997795b49fd142219f3c653b993006cb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ScreenSpaceType": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "26ad05e7cf2e4a4ea25b5c24de47805b", + "m_Id": 0, + "m_DisplayName": "Multiplier", + "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.Vector3MaterialSlot", + "m_ObjectId": "33b7e1b838534e1eb917b8dddc09da10", + "m_Id": 1, + "m_DisplayName": "World_Space_Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "World_Space_Position", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "3869cf8b70444512bb57c08b049d8040", + "m_Id": 6, + "m_DisplayName": "Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Color", + "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.SplitNode", + "m_ObjectId": "3a66a62e50224c799de45b25a67a41c8", + "m_Group": { + "m_Id": "1100f19ecd45464ca732f01d9e3a3cc4" + }, + "m_Name": "Split", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -421.0, + "y": -20.0, + "width": 118.49996948242188, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "4b4a7611530e497b9aaf382ee1cb46e9" + }, + { + "m_Id": "d34c200c1e724ad58b511315e02a7adf" + }, + { + "m_Id": "aa670f1389b24b7a96377c5aa3ff2940" + }, + { + "m_Id": "6e8de798030b4e1a8c098766d08a075f" + }, + { + "m_Id": "807219348c604b578c843be8e94a292c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "3be2aeeddcce4175abdff791fdd9f5a5", + "m_Id": 3, + "m_DisplayName": "Multiplier", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Multiplier", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3d98351741854538b14ba5d65b699de0", + "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_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "480703a4ce624a52bc7256f8e37a06d0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "CrestNodeIntegrateWaterVolume (Custom Function)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 289.0000305175781, + "y": -64.49995422363281, + "width": 331.5, + "height": 190.0 + } + }, + "m_Slots": [ + { + "m_Id": "fc76576996d147a6a18fa6e16a54409e" + }, + { + "m_Id": "33b7e1b838534e1eb917b8dddc09da10" + }, + { + "m_Id": "d82e7faaa0814772ac2d904701df5add" + }, + { + "m_Id": "3be2aeeddcce4175abdff791fdd9f5a5" + }, + { + "m_Id": "3869cf8b70444512bb57c08b049d8040" + }, + { + "m_Id": "100759169f234f728c4532414590b1a0" + }, + { + "m_Id": "be7a86b7ce45469dbaa830426ed7bf5c" + }, + { + "m_Id": "53b91b3c1d284b088db3b0ddd55fe57a" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 0, + "m_FunctionName": "CrestNodeIntegrateWaterVolume", + "m_FunctionSource": "d71d6be33f63546ff8a3e48fa55faa5f", + "m_FunctionBody": "Enter function body here..." +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "4b4a7611530e497b9aaf382ee1cb46e9", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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.Vector3MaterialSlot", + "m_ObjectId": "53b91b3c1d284b088db3b0ddd55fe57a", + "m_Id": 8, + "m_DisplayName": "Out_Emission", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out_Emission", + "m_StageCapability": 3, + "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_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "5d923c2657794970996af7cb7159276f", + "m_Guid": { + "m_GuidSerialized": "4e700f9f-71e1-44ca-82f1-a15c46d60057" + }, + "m_Name": "Color", + "m_DefaultRefNameVersion": 0, + "m_RefNameGeneratedByDisplayName": "", + "m_DefaultReferenceName": "Color_5d923c2657794970996af7cb7159276f", + "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": { + "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": "613443e60dfe4a6c8242f655a5c0ebe1", + "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": 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.PropertyNode", + "m_ObjectId": "6893ffaca70848d693feacf5b9a166ec", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -39.0, + "y": 57.5, + "width": 123.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "26ad05e7cf2e4a4ea25b5c24de47805b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "0640f7e405ca4ded9cced0944e419139" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "6e8de798030b4e1a8c098766d08a075f", + "m_Id": 3, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "6e9dfffa8dd44af49ecd03bc70b53e3b", + "m_Id": 1, + "m_DisplayName": "Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Color", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "70cc196430a942c28a78823efac0213b", + "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.PropertyNode", + "m_ObjectId": "73c08bc2c7be45559da717ae630500f6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -21.0, + "y": 91.5, + "width": 105.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "e2f3904697a242ec8f265071d93e8591" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "5d923c2657794970996af7cb7159276f" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "807219348c604b578c843be8e94a292c", + "m_Id": 4, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "8f9a320d616344e09bcb1f5e368c99c9", + "m_Id": 2, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "914b3ad544bc4c57b1b5d9b955d533c0", + "m_Id": 0, + "m_DisplayName": "Emission", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "943e9ca00d7248afba41cc8024d2542a", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "5d923c2657794970996af7cb7159276f" + }, + { + "m_Id": "a0af5588d47b44b5b24f875b67acf31a" + }, + { + "m_Id": "0640f7e405ca4ded9cced0944e419139" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "997795b49fd142219f3c653b993006cb", + "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": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.PositionNode", + "m_ObjectId": "9ab1f5c4a6894323899049b311181b3f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Position", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -122.0, + "y": -96.5, + "width": 206.0, + "height": 129.5 + } + }, + "m_Slots": [ + { + "m_Id": "dd9559ce5f2644919ef9122d4f557df6" + } + ], + "synonyms": [], + "m_Precision": 1, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 2, + "m_PositionSource": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector3ShaderProperty", + "m_ObjectId": "a0af5588d47b44b5b24f875b67acf31a", + "m_Guid": { + "m_GuidSerialized": "bebcb4b2-70d3-4426-b192-1c54922e3a4a" + }, + "m_Name": "Emission", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Emission", + "m_DefaultReferenceName": "_Emission", + "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": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "aa670f1389b24b7a96377c5aa3ff2940", + "m_Id": 2, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "aec8c45ce53547629ca39ff1eae3bc15", + "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.PropertyNode", + "m_ObjectId": "b5b57b89f263474f8d5d5ffa3f3b30ec", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -39.0, + "y": 125.5, + "width": 123.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "914b3ad544bc4c57b1b5d9b955d533c0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "a0af5588d47b44b5b24f875b67acf31a" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DivideNode", + "m_ObjectId": "bb35f5be46ba4350a77ad73886c2d67a", + "m_Group": { + "m_Id": "1100f19ecd45464ca732f01d9e3a3cc4" + }, + "m_Name": "Divide", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -302.5, + "y": -20.0, + "width": 126.0, + "height": 118.0 + } + }, + "m_Slots": [ + { + "m_Id": "70cc196430a942c28a78823efac0213b" + }, + { + "m_Id": "3d98351741854538b14ba5d65b699de0" + }, + { + "m_Id": "aec8c45ce53547629ca39ff1eae3bc15" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "be7a86b7ce45469dbaa830426ed7bf5c", + "m_Id": 4, + "m_DisplayName": "Out_Color", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out_Color", + "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.ScreenPositionNode", + "m_ObjectId": "c0989029cf9b440b8d920d94483be2d4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Screen Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -61.000003814697269, + "y": -224.99993896484376, + "width": 145.0, + "height": 128.5 + } + }, + "m_Slots": [ + { + "m_Id": "613443e60dfe4a6c8242f655a5c0ebe1" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ScreenSpaceType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d34c200c1e724ad58b511315e02a7adf", + "m_Id": 1, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d82e7faaa0814772ac2d904701df5add", + "m_Id": 2, + "m_DisplayName": "Device_Depth", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Device_Depth", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode", + "m_ObjectId": "dd5931412c824c66b095fb7819859502", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Output", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 720.5, + "y": -64.5, + "width": 101.0, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "6e9dfffa8dd44af49ecd03bc70b53e3b" + }, + { + "m_Id": "8f9a320d616344e09bcb1f5e368c99c9" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "IsFirstSlotValid": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "dd9559ce5f2644919ef9122d4f557df6", + "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": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "e2f3904697a242ec8f265071d93e8591", + "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.Vector2MaterialSlot", + "m_ObjectId": "fc76576996d147a6a18fa6e16a54409e", + "m_Id": 0, + "m_DisplayName": "Screen_Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Screen_Position", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/Integrate Water Volume.shadersubgraph.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/Integrate Water Volume.shadersubgraph.meta new file mode 100644 index 0000000..e6ee048 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/Integrate Water Volume.shadersubgraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: df63a8d198812478985b6d0a5d68a59a +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/IntegrateWaterVolume.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/IntegrateWaterVolume.hlsl new file mode 100644 index 0000000..561f33e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/IntegrateWaterVolume.hlsl @@ -0,0 +1,224 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// NOTE: It is important that everything has a Crest prefix to avoid possible conflicts. +// NOTE: No keywords so no mask color/depth variants not available. + +#ifndef d_WaveHarmonic_Crest_ApplyWaterVolumeFog +#define d_WaveHarmonic_Crest_ApplyWaterVolumeFog + +#ifndef SHADERGRAPH_PREVIEW + +// TODO: enable dithering? +#define k_DisableCaustics +#define k_DisableDithering + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" + +#if (CREST_PORTALS != 0) +#define d_Crest_Portal 1 +#endif + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl" + +// Uses SHADERPASS which is broken for everyone else. +#undef d_IsAdditionalLight + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterShared.hlsl" + +m_CrestNameSpace + +static bool s_IsUnderWater; +static float s_FogDistance; +static half s_FogMultiplier; + +static float2 s_PositionSS; +static float3 s_PositionWS; +static half3 s_ViewWS; +static float s_DepthRaw; + +float3 ApplyFog(float3 color) +{ +#if (CREST_DISCARD_ATMOSPHERIC_SCATTERING == 0) + if (!s_IsUnderWater) + { + return color; + } +#endif + + return ApplyUnderwaterEffect + ( + color, + s_DepthRaw, + 0, // Caustics only + s_FogDistance, + s_ViewWS, + s_PositionSS, + s_PositionWS, + false, // No caustics + true, // TODO: implement + true, // TODO: implement + s_FogMultiplier + ); +} + +float3 NoFog(float3 color) +{ + return color; +} + +void SetUpFog(const float2 i_PositionNDC, const float3 i_PositionWS, const float i_DepthRaw, const half i_Multiplier) +{ +#if !CREST_BIRP +// Uses SHADERPASS which is broken for everyone else. +#if CREST_SHADOWPASS + return; +#endif +#endif + + const float2 positionSS = i_PositionNDC.xy * _ScreenSize.xy; + + const half mask = LOAD_TEXTURE2D_X(_Crest_WaterMaskTexture, positionSS).r; + + // Skip if not underwater. We could also "&& rawSurfaceDepth < i_DepthRaw" to + // exclude objects behind the front-faces from receiving atmospheric fog, but we + // are using transparent blending which leaves a bright outline due to the edges + // receiving insufficient fog. Excluding these objects from atmospheric fog gives + // little benefit. + if (mask >= CREST_MASK_NO_FOG && mask < CREST_MASK_ABOVE_SURFACE_KEPT) + { + return; + } + +#if (CREST_DISCARD_ATMOSPHERIC_SCATTERING != 0) +#if !d_Transparent + // FIXME: Find alternative solution for new mask. + const float rawSurfaceDepth = LOAD_DEPTH_TEXTURE_X(_Crest_WaterMaskDepthTexture, positionSS).r; + + // Skip discarding fog if opaque object is behind back-faces. + if (mask < CREST_MASK_NO_FOG && mask > CREST_MASK_BELOW_SURFACE_KEPT && i_DepthRaw < rawSurfaceDepth) + { + return; + } +#endif +#endif + + // Get the largest distance. + float rawFogDistance = i_DepthRaw; + float fogDistanceOffset = _ProjectionParams.y; + float fogDistance = 0.0; + +#if (CREST_PORTALS != 0) + if (!Portal::EvaluateFog(i_PositionNDC, mask, rawFogDistance, fogDistanceOffset)) + { + return; + } + else +#endif + { + fogDistance = Utility::CrestLinearEyeDepth(rawFogDistance) - fogDistanceOffset; + } + + s_IsUnderWater = true; + s_PositionSS = positionSS; + s_PositionWS = i_PositionWS; + s_ViewWS = GetWorldSpaceNormalizeViewDir(i_PositionWS); + s_FogDistance = fogDistance; + s_DepthRaw = i_DepthRaw; + s_FogMultiplier = i_Multiplier; +} + +m_CrestNameSpaceEnd + +#if d_Transparent +#define ApplyFog(x) ApplyFog(x) +#else +#define ApplyFog(x) NoFog(x) +#endif + +#if CREST_BIRP +#ifdef UNITY_PASS_FORWARDADD +#define m_Unity_FogColor fixed4(0, 0, 0, 0) +#else +#define m_Unity_FogColor unity_FogColor +#endif // UNITY_PASS_FORWARDADD + +#undef UNITY_APPLY_FOG +#if (CREST_DISCARD_ATMOSPHERIC_SCATTERING != 0) +#define UNITY_APPLY_FOG(coord, color) \ +if (m_Crest::s_IsUnderWater) \ +{ \ + color.rgb = m_Crest::ApplyFog(color.rgb); \ +} \ +else \ +{ \ + UNITY_APPLY_FOG_COLOR(coord, color, m_Unity_FogColor); \ +} +#else +#define UNITY_APPLY_FOG(coord, color) \ +UNITY_APPLY_FOG_COLOR(coord, color, m_Unity_FogColor); \ +color.rgb = m_Crest::ApplyFog(color.rgb); +#endif // CREST_DISCARD_ATMOSPHERIC_SCATTERING +#endif // CREST_BIRP + +#if CREST_HDRP +#if (CREST_DISCARD_ATMOSPHERIC_SCATTERING != 0) +#define EvaluateAtmosphericScattering(i, V, color) m_Crest::s_IsUnderWater ? float4(m_Crest::ApplyFog(color.rgb), color.a) : EvaluateAtmosphericScattering(i, V, color) +#else +#define EvaluateAtmosphericScattering(i, V, color) EvaluateAtmosphericScattering(i, V, color); color.rgb = m_Crest::ApplyFog(color.rgb) +#endif +#endif + +#if CREST_URP +#if (CREST_DISCARD_ATMOSPHERIC_SCATTERING != 0) +#define MixFog(color, coord) m_Crest::s_IsUnderWater ? m_Crest::ApplyFog(color) : MixFog(color, coord) +#else +#define MixFog(color, coord) MixFog(color, coord); color.rgb = m_Crest::ApplyFog(color.rgb) +#endif +#endif + +#endif // SHADERGRAPH_PREVIEW + +void CrestNodeIntegrateWaterVolume_half +( + const float2 i_PositionNDC, + const float3 i_PositionWS, + const float i_DepthRaw, + const half i_Multiplier, + const half4 i_Color, + const half3 i_Emission, + out half4 o_Color, + out half3 o_Emission +) +{ + o_Color = i_Color; + o_Emission = i_Emission; + +#ifndef SHADERGRAPH_PREVIEW + m_Crest::SetUpFog(i_PositionNDC, i_PositionWS, i_DepthRaw, i_Multiplier); +#endif +} + +void CrestNodeIntegrateWaterVolume_float +( + const float2 i_PositionNDC, + const float3 i_PositionWS, + const float i_DepthRaw, + const half i_Multiplier, + const float4 i_Color, + const float3 i_Emission, + out float4 o_Color, + out float3 o_Emission +) +{ + o_Color = i_Color; + o_Emission = i_Emission; + +#ifndef SHADERGRAPH_PREVIEW + m_Crest::SetUpFog(i_PositionNDC, i_PositionWS, i_DepthRaw, i_Multiplier); +#endif +} + +#endif // d_WaveHarmonic_Crest_ApplyWaterVolumeFog diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/IntegrateWaterVolume.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/IntegrateWaterVolume.hlsl.meta new file mode 100644 index 0000000..0316ff2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Graph/IntegrateWaterVolume.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d71d6be33f63546ff8a3e48fa55faa5f +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Horizon.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Horizon.shader new file mode 100644 index 0000000..6631876 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Horizon.shader @@ -0,0 +1,104 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest/Volume/Horizon Mask" +{ + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.high-definition" + } + + Tags { "RenderPipeline"="HDRenderPipeline" } + + Blend Off + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Water Horizon Mask" + + Stencil + { + Ref [_Crest_StencilReference] + Comp [_Crest_StencilComparison] + } + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl" + ENDHLSL + } + } + + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.universal" + } + + Tags { "RenderPipeline"="UniversalPipeline" } + + Blend Off + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Water Horizon Mask" + + Stencil + { + Ref [_Crest_StencilReference] + Comp [_Crest_StencilComparison] + } + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl" + ENDHLSL + } + } + + SubShader + { + Blend Off + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Water Horizon Mask" + + Stencil + { + Ref [_Crest_StencilReference] + Comp [_Crest_StencilComparison] + } + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl" + ENDHLSL + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Horizon.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Horizon.shader.meta new file mode 100644 index 0000000..67a7f17 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Horizon.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 80a81e5410296461d827cd6eed939b81 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.compute new file mode 100644 index 0000000..9aaeae1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.compute @@ -0,0 +1,41 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma kernel CrestWaterLineBRP _BRP +#pragma kernel CrestWaterLineHRP _HRP +#pragma kernel CrestWaterLineURP _URP + +// Not every RP handles this. HDRP seems to. +#pragma multi_compile __ STEREO_INSTANCING_ON + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl" + +RW_TEXTURE2D_X(float, _Crest_WaterMaskTexture); + +m_CrestNameSpace + +void WaterLine(const uint3 id) +{ + UNITY_XR_ASSIGN_VIEW_INDEX(id.z); + + float3 position = ComputeWorldSpacePosition(id.xy / _ScreenSize.xy, UNITY_NEAR_CLIP_VALUE, UNITY_MATRIX_I_VP); + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + position.xyz += _WorldSpaceCameraPos.xyz; +#endif + + const float height = SampleWaterLineHeight(position.xz).x; + + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy)] = position.y <= height ? -1 : 1; +} + +m_CrestNameSpaceEnd + +m_CrestKernelXRP(WaterLine) diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.compute.meta new file mode 100644 index 0000000..f30c048 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 51ffca485396f4d8dbf07883c9303f3c +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl new file mode 100644 index 0000000..a8369cd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl @@ -0,0 +1,152 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef d_WaveHarmonic_Crest_Mask +#define d_WaveHarmonic_Crest_Mask + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Geometry.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" + +#if (CREST_PORTALS != 0) +#include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Library/Portals.hlsl" +#endif + +m_CrestNameSpace + +struct Attributes +{ + // The old unity macros require this name and type. + float4 positionCS : POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; +#if d_LodInput + float3 positionWS : TEXCOORD; +#endif + UNITY_VERTEX_OUTPUT_STEREO +}; + +Varyings Vertex(const Attributes i_Input) +{ + // This will work for all pipelines. + Varyings output = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(i_Input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + const uint slice0 = _Crest_LodIndex; + const uint slice1 = _Crest_LodIndex + 1; + + const Cascade cascade0 = Cascade::Make(slice0); + const Cascade cascade1 = Cascade::Make(slice1); + + float3 positionWS = mul(UNITY_MATRIX_M, float4(i_Input.positionCS.xyz, 1.0)).xyz; + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xz += _WorldSpaceCameraPos.xz; +#endif + + float alpha; + SnapAndTransitionVertLayout(_Crest_ChunkMeshScaleAlpha, cascade0, _Crest_ChunkGeometryGridWidth, positionWS, alpha); + + { + // Scale up by small "epsilon" to solve numerical issues. Expand slightly about tile center. + // :WaterGridPrecisionErrors + float2 tileCenterXZ = UNITY_MATRIX_M._m03_m23; +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + tileCenterXZ += _WorldSpaceCameraPos.xz; +#endif + const float2 cameraPositionXZ = abs(_WorldSpaceCameraPos.xz); + positionWS.xz = lerp(tileCenterXZ, positionWS.xz, lerp(1.0, 1.01, max(cameraPositionXZ.x, cameraPositionXZ.y) * 0.00001)); + } + + const float weight0 = (1.0 - alpha) * cascade0._Weight; + const float weight1 = (1.0 - weight0) * cascade1._Weight; + + const float2 positionXZ = positionWS.xz; + + // Data that needs to be sampled at the undisplaced position. + if (weight0 > m_CrestSampleLodThreshold) + { + Cascade::MakeAnimatedWaves(slice0).SampleDisplacement(positionXZ, weight0, positionWS); + } + if (weight1 > m_CrestSampleLodThreshold) + { + Cascade::MakeAnimatedWaves(slice1).SampleDisplacement(positionXZ, weight1, positionWS); + } + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xz -= _WorldSpaceCameraPos.xz; +#endif + + output.positionCS = mul(UNITY_MATRIX_VP, float4(positionWS, 1.0)); + +#if d_LodInput + output.positionWS = positionWS; +#endif + + return output; +} + +half4 Fragment(const Varyings i_Input, const bool i_FrontFace) +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i_Input); + +#if d_LodInput + return half4(i_Input.positionWS.y - g_Crest_WaterCenter.y, 0, 0, 1); +#endif + + half result = 0.0; + +#if (CREST_PORTALS != 0) +#if !d_Tunnel + if (m_CrestPortal) + { + Portal::EvaluateMask(i_Input.positionCS); + } +#endif +#endif + + if (IsUnderWater(i_FrontFace, g_Crest_ForceUnderwater)) + { + result = CREST_MASK_BELOW_SURFACE; + } + else + { + result = CREST_MASK_ABOVE_SURFACE; + } + +#if (CREST_PORTALS != 0) +#if d_Crest_NegativeVolumePass + result = Portal::FixMaskForNegativeVolume(result, i_Input.positionCS.xy); +#endif + +#if d_Tunnel + const float2 positionSS = i_Input.positionCS.xy; + const float ffz = LOAD_DEPTH_TEXTURE_X(_Crest_PortalFogBeforeTexture, positionSS); + const float bfz = LOAD_DEPTH_TEXTURE_X(_Crest_PortalFogAfterTexture, positionSS); + if (ffz <= 0.0 && bfz > 0.0) + { + result = CREST_MASK_ABOVE_SURFACE; + } +#endif +#endif + + return (half4)result; +} + +m_CrestNameSpaceEnd + +m_CrestVertex +m_CrestFragmentWithFrontFace(half4) + +#endif // d_WaveHarmonic_Crest_Mask diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl.meta new file mode 100644 index 0000000..a053062 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b891a37e4cd634b03888a64e8965920b +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.shader new file mode 100644 index 0000000..c853ffa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.shader @@ -0,0 +1,232 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Hidden/Crest/Underwater/Water Surface Mask" +{ + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.high-definition" + } + + Tags { "RenderPipeline"="HDRenderPipeline" } + + Pass + { + Name "Water Surface Mask" + // We always disable culling when rendering water mask, as we only + // use it for underwater rendering features. + Cull Off + + Stencil + { + Ref [_Crest_StencilReference] + Comp [_Crest_StencilComparison] + } + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + // for VFACE + #pragma target 3.0 + + #pragma multi_compile_local_fragment __ d_Tunnel + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + + Pass + { + Name "Water Surface Mask (Negative Volume)" + Cull Off + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + // for VFACE + #pragma target 3.0 + + #define m_Return discard + + #define d_Crest_NegativeVolumePass 1 + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + + Pass + { + Name "Water Surface Data" + Cull Back + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #pragma target 3.0 + + #define d_LodInput 1 + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + } + + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.universal" + } + + Tags { "RenderPipeline"="UniversalPipeline" } + + Pass + { + Name "Water Surface Mask" + // We always disable culling when rendering water mask, as we only + // use it for underwater rendering features. + Cull Off + + Stencil + { + Ref [_Crest_StencilReference] + Comp [_Crest_StencilComparison] + } + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + // for VFACE + #pragma target 3.0 + + #pragma multi_compile_local_fragment __ d_Tunnel + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + + Pass + { + Name "Water Surface Mask (Negative Volume)" + Cull Off + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + // for VFACE + #pragma target 3.0 + + #define m_Return discard + + #define d_Crest_NegativeVolumePass 1 + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + + Pass + { + Name "Water Surface Data" + Cull Back + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #pragma target 3.0 + + #define d_LodInput 1 + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + } + + SubShader + { + Pass + { + Name "Water Surface Mask" + // We always disable culling when rendering water mask, as we only + // use it for underwater rendering features. + Cull Off + + Stencil + { + Ref [_Crest_StencilReference] + Comp [_Crest_StencilComparison] + } + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + // for VFACE + #pragma target 3.0 + + #pragma multi_compile_local_fragment __ d_Tunnel + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + + Pass + { + Name "Water Surface Mask (Negative Volume)" + Cull Off + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + // for VFACE + #pragma target 3.0 + + #define m_Return discard + + #define d_Crest_NegativeVolumePass 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + + Pass + { + Name "Water Surface Data" + Cull Back + + HLSLPROGRAM + #pragma vertex Vertex + #pragma fragment Fragment + + #pragma target 3.0 + + #define d_LodInput 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.hlsl" + ENDHLSL + } + } +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.shader.meta new file mode 100644 index 0000000..12bec02 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Mask.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: edb653e62cc924b99b0a1086ffb39be7 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskArtifacts.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskArtifacts.compute new file mode 100644 index 0000000..559daf2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskArtifacts.compute @@ -0,0 +1,60 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Checks both orthogonal and diagonal pixels to fill artefacts in the mask. If checked pixels are all the same then it +// assumes that the current pixel should also be the same and fixes it. + +#pragma kernel FillMaskArtefacts _BRP + +// Built-in will not handle this for us unlike other RPs. +#pragma multi_compile __ STEREO_INSTANCING_ON + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/Compute.hlsl" + +RW_TEXTURE2D_X(float, _Crest_WaterMaskTexture); + +[numthreads(8, 8, 1)] +void FillMaskArtefacts(const uint3 id : SV_DispatchThreadID) +{ + UNITY_XR_ASSIGN_VIEW_INDEX(id.z); + + const uint3 offset = uint3(1, -1, 0); + + // Check orthogonal pixels. + { + const float4 pixels = float4 + ( + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy + offset.xz)], + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy + offset.yz)], + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy + offset.zy)], + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy + offset.zx)] + ); + + // If these pixels are all the same, then it is valid that this pixel also equals them. + if (pixels.x == pixels.y && pixels.y == pixels.z && pixels.z == pixels.w) + { + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy)] = pixels.x; + return; + } + } + + // Check diagonal pixels. + { + const float4 pixels = float4 + ( + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy + offset.xx)], + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy + offset.yy)], + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy + offset.xy)], + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy + offset.yx)] + ); + + // If these pixels are all the same, then it is valid that this pixel also equals them. + if (pixels.x == pixels.y && pixels.y == pixels.z && pixels.z == pixels.w) + { + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy)] = pixels.x; + return; + } + } + + _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy)] = _Crest_WaterMaskTexture[COORD_TEXTURE2D_X(id.xy)]; +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskArtifacts.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskArtifacts.compute.meta new file mode 100644 index 0000000..3b67a7b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskArtifacts.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 08549c36146ad4899a07193754b21ea2 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl new file mode 100644 index 0000000..6dd5d5e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl @@ -0,0 +1,56 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Renders the water horizon line into the mask. + +#ifndef CREST_UNDERWATER_MASK_HORIZON_SHARED_INCLUDED +#define CREST_UNDERWATER_MASK_HORIZON_SHARED_INCLUDED + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" + +// Driven by scripting. It is a non-linear converted from a linear 0-1 value. +float _Crest_FarPlaneOffset; + +struct Attributes +{ + uint id : SV_VertexID; + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO +}; + +Varyings Vertex(Attributes input) +{ + // This will work for all pipelines. + Varyings output = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + output.positionCS = GetFullScreenTriangleVertexPosition(input.id, _Crest_FarPlaneOffset); + output.uv = GetFullScreenTriangleTexCoord(input.id); + + return output; +} + +half4 Fragment(Varyings input) : SV_Target +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float3 positionWS = ComputeWorldSpacePosition(input.uv, _Crest_FarPlaneOffset, UNITY_MATRIX_I_VP); + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.y += _WorldSpaceCameraPos.y; +#endif + + return (half4) positionWS.y > g_Crest_WaterCenter.y + ? CREST_MASK_ABOVE_SURFACE + : CREST_MASK_BELOW_SURFACE; +} + +#endif // CREST_UNDERWATER_MASK_HORIZON_SHARED_INCLUDED diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl.meta new file mode 100644 index 0000000..0a66f37 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/MaskHorizon.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f5a4cb92ecd4468e84893f8257be090 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl new file mode 100644 index 0000000..dcac03c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl @@ -0,0 +1,203 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterShared.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Debug.hlsl" + +#ifndef SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER +#define FoveatedRemapLinearToNonUniform(uv) uv +#endif + +#if (CREST_LEGACY_UNDERWATER != 0) || d_Crest_CustomColorTexture +TEXTURE2D_X(_Crest_CameraColorTexture); +#endif + +#if d_Crest_ComputeMask +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Data.hlsl" +#endif + +m_CrestNameSpace + +#if (CREST_LEGACY_UNDERWATER != 0) +float3 SampleSceneColor(float2 i_UV) +{ + return LOAD_TEXTURE2D_X(_Crest_CameraColorTexture, i_UV * _ScreenSize.xy).rgb; +} +#endif + +struct Attributes +{ +#if d_Crest_Geometry + float3 positionOS : POSITION; +#else + uint id : SV_VertexID; +#endif + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; +#if d_Crest_ComputeMask + float3 positionWS : TEXCOORD; +#endif + UNITY_VERTEX_OUTPUT_STEREO +}; + +Varyings Vertex(Attributes input) +{ + Varyings output; + ZERO_INITIALIZE(Varyings, output); + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + +#if d_Crest_Geometry + // Use actual geometry instead of full screen triangle. + output.positionCS = TransformObjectToHClip(input.positionOS); +#if d_Crest_ComputeMask + output.positionWS = TransformObjectToWorld(input.positionOS); +#endif +#else + output.positionCS = GetFullScreenTriangleVertexPosition(input.id, UNITY_RAW_FAR_CLIP_VALUE); +#endif + + return output; +} + +half4 Fragment(Varyings input) +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + uint2 positionSS = input.positionCS.xy; + const float2 positionNDC = (positionSS + 0.5) / _ScreenSize.xy; + float mask = -1.0; + +#if !d_Crest_NoMaskColor +#if d_Crest_ComputeMask + { + float3 positionWS = input.positionWS; +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS.xyz += _WorldSpaceCameraPos.xyz; +#endif + mask = positionWS.y <= SampleWaterLineHeight(positionWS.xz) ? -1 : 1; + } +#else + mask = LOAD_TEXTURE2D_X(_Crest_WaterMaskTexture, positionSS).x; +#endif + +#if !_DEBUG_VISUALIZE_MASK + // Preserve alpha channel. + if (mask > CREST_MASK_BELOW_SURFACE) + { + discard; + } +#endif +#endif // !d_Crest_NoMaskColor + + float rawDepth = LoadSceneDepth(positionSS); + + half3 sceneColour; + +#if d_Crest_CustomColorTexture + if (m_CrestPortalNegativeVolume) + { + sceneColour = LOAD_TEXTURE2D_X(_Crest_CameraColorTexture, positionSS).rgb; + } + else +#endif + { + // Use sample in case texture is downsampled. + sceneColour = SampleSceneColor(positionNDC).rgb; + } + +#if d_Crest_NoMaskDepth + const float rawMaskDepth = 0.0; +#else + const float rawMaskDepth = LOAD_TEXTURE2D_X(_Crest_WaterMaskDepthTexture, positionSS).x; +#endif + +#if _DEBUG_VISUALIZE_STENCIL + return DebugRenderStencil(sceneColour); +#endif + + bool isWaterSurface; bool isUnderwater; bool hasCaustics; float sceneZ; bool outScatterScene; bool applyLighting; + GetWaterSurfaceAndUnderwaterData(input.positionCS, positionSS, rawMaskDepth, mask, rawDepth, isWaterSurface, isUnderwater, hasCaustics, outScatterScene, applyLighting, sceneZ); + +#if !_DEBUG_VISUALIZE_MASK + // Preserve alpha channel. + if (!isUnderwater) + { + discard; + } +#endif + + float fogDistance = sceneZ; + ApplyWaterVolumeToUnderwaterFog(input.positionCS, fogDistance); + +#if _DEBUG_VISUALIZE_MASK + return DebugRenderWaterMask(isWaterSurface, isUnderwater, mask, sceneColour); +#endif + + if (isUnderwater) + { + const float2 uv = FoveatedRemapLinearToNonUniform(positionNDC); + float3 positionWS = ComputeWorldSpacePosition(uv, rawDepth, UNITY_MATRIX_I_VP); + const half3 view = GetWorldSpaceNormalizeViewDir(positionWS); +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS += _WorldSpaceCameraPos; +#endif + sceneColour = ApplyUnderwaterEffect(sceneColour, rawDepth, sceneZ, fogDistance, view, positionSS, positionWS, hasCaustics, outScatterScene, applyLighting, 1.0); + } + + return half4(sceneColour, 1.0); +} + +half4 FragmentPlanarReflections(Varyings input) +{ + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + const uint2 positionSS = input.positionCS.xy; + const float2 positionNDC = (positionSS + 0.5) / _ScreenSize.xy; + float depth = LoadSceneDepth(positionSS); + + // TODO: Do something nicer. Could zero alpha if scene depth is above threshold. + if (depth == 0.0) + { + return half4(_Crest_Scattering.xyz, 1.0); + } + + half3 color = SampleSceneColor(positionNDC).rgb; + + // Calculate position and account for possible NaNs discovered during testing. + float3 positionWS; + { + float4 positionCS = ComputeClipSpacePosition(positionNDC, depth); + float4 hpositionWS = mul(UNITY_MATRIX_I_VP, positionCS); + + // w is sometimes zero when using oblique projection. + // Zero is better than NaN. + positionWS = hpositionWS.w > 0.0 ? hpositionWS.xyz / hpositionWS.w : 0.0; + } + +#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0) + positionWS += _WorldSpaceCameraPos; +#endif + + const half3 view = GetWorldSpaceNormalizeViewDir(positionWS); + const bool hasCaustics = depth > 0.0; + + color = ApplyUnderwaterEffect(color, depth, 0.0, 0.0, view, positionSS, positionWS, hasCaustics, true, true, 1.0); + + return half4(color, 1.0); +} + +m_CrestNameSpaceEnd + +m_CrestVertex +m_CrestFragment(half4) + +half4 FragmentPlanarReflections(m_Crest::Varyings input) : SV_Target +{ + return m_Crest::FragmentPlanarReflections(input); +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl.meta new file mode 100644 index 0000000..8df1629 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2636ae353ea154204861c022e68003df +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.shader b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.shader new file mode 100644 index 0000000..ac09834 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.shader @@ -0,0 +1,760 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +Shader "Crest/Underwater" +{ + Properties + { + _Crest_ExtinctionMultiplier("Density Factor", Range(0, 1)) = 1 + _Crest_SunBoost("Sun Boost", Range(0, 100)) = 2 + + _Crest_OutScatteringFactor("Out-Scattering Factor", Range(0, 1)) = 0.2 + _Crest_OutScatteringExtinctionFactor("Out-Scattering Extinction Factor", Range(0, 1)) = 0.2 + + [Space(10)] + + [Toggle(d_Dithering)] + _Crest_DitheringEnabled("Dithering", Integer) = 1 + _Crest_DitheringIntensity("Dithering Intensity", Range(0, 10)) = 1 + + [Header(Advanced)] + [Space(6)] + + // This adds an offset to the cascade index when sampling water data, in effect smoothing/blurring it. Default + // to shifting the maximum amount (shift from lod 0 to penultimate lod - dont use last lod as it cross-fades + // data in/out), as more filtering was better in testing. + [CrestIntegerRange] + _Crest_DataSliceOffset("Filter Water Data", Integer) = 13 + + [HideInInspector] + _Crest_Version("Version", Integer) = 0 + + [Header(Copied From Water Surface)] + [Space(6)] + + [PerRendererData] _Crest_AbsorptionColor("Absorption Color", Color) = (0.3416268, 0.6954546, 0.85, 0.1019608) + [PerRendererData] _Crest_Scattering("Scattering", Color) = (0, 0.09803922, 0.2, 1) + [PerRendererData] _Crest_Anisotropy("Anisotropy", Range(0, 1)) = 0.5 + [PerRendererData] _Crest_DirectTerm("Direct Term", Float) = 1 + [PerRendererData] _Crest_AmbientTerm("Ambient Term", Float) = 1 + [PerRendererData] _Crest_ShadowsAffectsAmbientFactor("Shadows Affects Ambient Factor", Float) = 0.5 + + // Caustics + [PerRendererData] [ToggleUI] _Crest_CausticsEnabled("Caustics Enabled", Float) = 1 + [PerRendererData] [NoScaleOffset] _Crest_CausticsTexture("Caustics Texture", 2D) = "black" {} + [PerRendererData] _Crest_CausticsStrength("Caustics Strength", Range(0, 10)) = 3.2 + [PerRendererData] _Crest_CausticsTextureScale("Caustics Scale", Range(0.01, 100)) = 50 + [PerRendererData] _Crest_CausticsScrollSpeed("Caustics Scroll Speed", Range(0, 10)) = 1 + [PerRendererData] _Crest_CausticsTextureAverage("Caustics Grey Point", Range(0, 1)) = 0.07 + [PerRendererData] _Crest_CausticsFocalDepth("Caustics Focal Depth", Range(0, 25)) = 2 + [PerRendererData] _Crest_CausticsDepthOfField("Caustics Depth of Field", Range(0.01, 10)) = 6 + [PerRendererData] [NoScaleOffset] _Crest_CausticsDistortionTexture("Caustics Distortion Texture", 2D) = "grey" {} + [PerRendererData] _Crest_CausticsDistortionStrength("Caustics Distortion Strength", Range(0, 0.25)) = 0.16 + [PerRendererData] _Crest_CausticsDistortionScale("Caustics Distortion Scale", Range(0.01, 1000)) = 250 + [PerRendererData] _Crest_CausticsMotionBlur("Caustics Motion Blur", Range(0, 10)) = 1 + [PerRendererData] [Toggle] CREST_FLOW("Flow Enabled", Float) = 0 + } + + HLSLINCLUDE + #pragma vertex Vertex + + // #pragma enable_d3d11_debug_symbols + + // Also on the water shader. + #pragma multi_compile_local_fragment __ CREST_FLOW_ON + + #pragma shader_feature_local_fragment __ d_Dithering + + // NOTE: FragmentPlanarReflections do not need these. + // Whether to skip mask and/or depth sampling. + #pragma multi_compile_local_fragment __ d_Crest_NoMaskColor + #pragma multi_compile_local_fragment __ d_Crest_NoMaskDepth + + #pragma multi_compile_local_fragment __ _DEBUG_VISUALIZE_MASK + #pragma multi_compile_local_fragment __ _DEBUG_VISUALIZE_STENCIL + ENDHLSL + + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.high-definition" + } + + Tags { "RenderPipeline"="HDRenderPipeline" } + + Blend Off + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Full Screen" + + HLSLPROGRAM + #include_with_pragmas "UnderwaterHDRP.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + Name "Reflection" + + HLSLPROGRAM + #define CREST_REFLECTION 1 + #include_with_pragmas "UnderwaterHDRP.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment FragmentPlanarReflections + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include_with_pragmas "UnderwaterHDRP.hlsl" + + #pragma multi_compile_local _ d_Crest_ComputeMask + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_FogAfter 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After To Back-Face" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include_with_pragmas "UnderwaterHDRP.hlsl" + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_PortalWithBackFace 1 + #define d_Crest_FogAfter 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After To Back-Face (Fly-Through)" + + Cull Back + ZTest LEqual + + Stencil + { + // Must match k_StencilValueVolume in: + // Portals.cs + Ref 5 + Comp Always + Pass Replace + ZFail IncrSat + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterHDRP.hlsl" + + #pragma multi_compile_local _ d_Crest_ComputeMask + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_PortalWithBackFace 1 + #define d_Crest_FogAfter 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + // Back face will only render if view is within the volume and there is no scene in front. It will only add + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // fog to the back face (and in effect anything behind it). No caustics. + Name "Fog Before (Fly-Through)" + + Cull Front + ZTest LEqual + + Stencil + { + // Must match k_StencilValueVolume in: + // Portals.cs + Ref 5 + Comp NotEqual + Pass Replace + ZFail IncrSat + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterHDRP.hlsl" + + #define d_Crest_CustomColorTexture 1 + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_FogBefore 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // When inside a volume, this pass will render to the scene within the volume. + Name "Full Screen (Fly-Through)" + + Stencil + { + // We want to render over the scene that's inside the volume, but not over already fogged areas. It will + // handle all of the scene within the geometry once the camera is within the volume. + // 0 = Outside of geometry as neither face passes have touched it. + // 1 = Only back face z failed which means scene is in front of back face but not front face. + // 2 = Both front and back face z failed which means outside geometry. + Ref 1 + Comp Equal + Pass Replace + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterHDRP.hlsl" + + #define d_Crest_Portal 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Full Screen (Negative)" + + HLSLPROGRAM + #include_with_pragmas "UnderwaterHDRP.hlsl" + + #define d_Crest_CustomColorTexture 1 + + #define d_Crest_Portal 1 + #define d_Crest_PortalNegativeVolume 1 + #define d_Crest_PortalWithBackFace 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + } + + SubShader + { + PackageRequirements + { + "com.unity.render-pipelines.universal" + } + + Tags { "RenderPipeline"="UniversalPipeline" } + + Blend Off + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Full Screen" + + HLSLPROGRAM + #include_with_pragmas "UnderwaterURP.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + Name "Reflection" + + HLSLPROGRAM + #define CREST_REFLECTION 1 + #include_with_pragmas "UnderwaterURP.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment FragmentPlanarReflections + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include_with_pragmas "UnderwaterURP.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" + + #pragma multi_compile_local _ d_Crest_ComputeMask + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_FogAfter 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After To Back-Face" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include_with_pragmas "UnderwaterURP.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_PortalWithBackFace 1 + #define d_Crest_FogAfter 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After To Back-Face (Fly-Through)" + + Cull Back + ZTest LEqual + + Stencil + { + // Must match k_StencilValueVolume in: + // Portals.cs + Ref 5 + Comp Always + Pass Replace + ZFail IncrSat + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterURP.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" + + #pragma multi_compile_local _ d_Crest_ComputeMask + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_PortalWithBackFace 1 + #define d_Crest_FogAfter 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + // Back face will only render if view is within the volume and there is no scene in front. It will only add + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // fog to the back face (and in effect anything behind it). No caustics. + Name "Fog Before (Fly-Through)" + + Cull Front + ZTest LEqual + + Stencil + { + // Must match k_StencilValueVolume in: + // Portals.cs + Ref 5 + Comp NotEqual + Pass Replace + ZFail IncrSat + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterURP.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" + + #define d_Crest_CustomColorTexture 1 + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_FogBefore 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // When inside a volume, this pass will render to the scene within the volume. + Name "Full Screen (Fly-Through)" + + Stencil + { + // We want to render over the scene that's inside the volume, but not over already fogged areas. It will + // handle all of the scene within the geometry once the camera is within the volume. + // 0 = Outside of geometry as neither face passes have touched it. + // 1 = Only back face z failed which means scene is in front of back face but not front face. + // 2 = Both front and back face z failed which means outside geometry. + Ref 1 + Comp Equal + Pass Replace + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterURP.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" + + #define d_Crest_Portal 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Full Screen (Negative)" + + HLSLPROGRAM + #include_with_pragmas "UnderwaterURP.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" + + #define d_Crest_CustomColorTexture 1 + + #define d_Crest_Portal 1 + #define d_Crest_PortalNegativeVolume 1 + #define d_Crest_PortalWithBackFace 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + } + + SubShader + { + Blend Off + Cull Off + ZTest Always + ZWrite Off + + Pass + { + Name "Full Screen" + + HLSLPROGRAM + #include_with_pragmas "UnderwaterBIRP.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + Name "Reflection" + + HLSLPROGRAM + #define CREST_REFLECTION 1 + #include_with_pragmas "UnderwaterBIRP.hlsl" + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment FragmentPlanarReflections + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include_with_pragmas "UnderwaterBIRP.hlsl" + + #pragma multi_compile_local _ d_Crest_ComputeMask + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_FogAfter 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After To Back-Face" + + Cull Back + ZTest LEqual + + HLSLPROGRAM + #include_with_pragmas "UnderwaterBIRP.hlsl" + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_PortalWithBackFace 1 + #define d_Crest_FogAfter 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // Only adds fog to the front face and in effect anything behind it. + Name "Fog After To Back-Face (Fly-Through)" + + Cull Back + ZTest LEqual + + Stencil + { + // Must match k_StencilValueVolume in: + // Portals.cs + Ref 5 + Comp Always + Pass Replace + ZFail IncrSat + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterBIRP.hlsl" + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_PortalWithBackFace 1 + #define d_Crest_FogAfter 1 + + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + // Back face will only render if view is within the volume and there is no scene in front. It will only add + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // fog to the back face (and in effect anything behind it). No caustics. + Name "Fog Before (Fly-Through)" + + Cull Front + ZTest LEqual + + Stencil + { + // Must match k_StencilValueVolume in: + // Portals.cs + Ref 5 + Comp NotEqual + Pass Replace + ZFail IncrSat + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterBIRP.hlsl" + + #pragma multi_compile_local _ d_Crest_ComputeMask + + // For negative volumes. + #define d_Crest_CustomColorTexture 1 + + #define d_Crest_Portal 1 + #define d_Crest_Geometry 1 + #define d_Crest_FogBefore 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + // When inside a volume, this pass will render to the scene within the volume. + Name "Full Screen (Fly-Through)" + + Stencil + { + // We want to render over the scene that's inside the volume, but not over already fogged areas. It will + // handle all of the scene within the geometry once the camera is within the volume. + // 0 = Outside of geometry as neither face passes have touched it. + // 1 = Only back face z failed which means scene is in front of back face but not front face. + // 2 = Both front and back face z failed which means outside geometry. + Ref 1 + Comp Equal + Pass Replace + } + + HLSLPROGRAM + #include_with_pragmas "UnderwaterBIRP.hlsl" + + #define d_Crest_Portal 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + + Pass + { + PackageRequirements + { + "com.waveharmonic.crest.portals" + } + + Name "Full Screen (Negative)" + + HLSLPROGRAM + #include_with_pragmas "UnderwaterBIRP.hlsl" + + #define d_Crest_CustomColorTexture 1 + + #define d_Crest_Portal 1 + #define d_Crest_PortalNegativeVolume 1 + #define d_Crest_PortalWithBackFace 1 + #include "Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.hlsl" + + #pragma fragment Fragment + ENDHLSL + } + } + CustomEditor "WaveHarmonic.Crest.Editor.CustomShaderGUI" +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.shader.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.shader.meta new file mode 100644 index 0000000..1bb6e8c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/Underwater.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 034b985bd9c344992af148e26d2cdb24 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterBIRP.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterBIRP.hlsl new file mode 100644 index 0000000..4a1951e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterBIRP.hlsl @@ -0,0 +1,21 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#define BUILTIN_TARGET_API 1 + +#define CREST_BIRP 1 +#define CREST_SHADERGRAPH_CONSTANTS_H + +#pragma multi_compile_fragment _ DIRECTIONAL_COOKIE + +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/ShaderPass.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Defines.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl" + +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Lighting.hlsl" +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/LegacySurfaceVertex.hlsl" +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/ShaderGraphFunctions.hlsl" + +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/DeclareOpaqueTexture.hlsl" +#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/DeclareDepthTexture.hlsl" diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterBIRP.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterBIRP.hlsl.meta new file mode 100644 index 0000000..f5f71a1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterBIRP.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 765d2ceee80af4bd5a637f79488a3433 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterHDRP.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterHDRP.hlsl new file mode 100644 index 0000000..ba84092 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterHDRP.hlsl @@ -0,0 +1,19 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma target 4.5 + +// Low appears good enough as it has filtering which is necessary when close to a shadow. +#define SHADOW_LOW +#define AREA_SHADOW_LOW + +// In shared SG code we target the forward pass to avoid shader compilation errors. +#define CREST_HDRP 1 +#define SHADERPASS SHADERPASS_FORWARD +#define CREST_HDRP_FORWARD_PASS 1 +#define CREST_SHADERGRAPH_CONSTANTS_H + +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/RP/HDRP/Common.hlsl" diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterHDRP.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterHDRP.hlsl.meta new file mode 100644 index 0000000..d3191fa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterHDRP.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3b3db686f3a7746698c6193fcdc22ff2 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterShared.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterShared.hlsl new file mode 100644 index 0000000..f23a02f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterShared.hlsl @@ -0,0 +1,346 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#ifndef CREST_UNDERWATER_EFFECT_SHARED_INCLUDED +#define CREST_UNDERWATER_EFFECT_SHARED_INCLUDED + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl" + +#if d_Crest_Portal +#include "Packages/com.waveharmonic.crest.portals/Runtime/Shaders/Library/Portals.hlsl" +#endif + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Cascade.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Lighting.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Shadows.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl" + +// These are set via call to CopyPropertiesFromMaterial() and must have the same +// names as the surface material parameters. +CBUFFER_START(CrestPerMaterial) + +// +// Surface Shared +// + +#ifndef d_Crest_WaterSurface + +half4 _Crest_Absorption; +half4 _Crest_Scattering; +half _Crest_Anisotropy; + +half _Crest_DirectTerm; +half _Crest_AmbientTerm; +half _Crest_ShadowsAffectsAmbientFactor; + +bool _Crest_CausticsEnabled; +float _Crest_CausticsTextureScale; +float _Crest_CausticsScrollSpeed; +float _Crest_CausticsTextureAverage; +float _Crest_CausticsStrength; +float _Crest_CausticsFocalDepth; +float _Crest_CausticsDepthOfField; +float _Crest_CausticsDistortionStrength; +float _Crest_CausticsDistortionScale; +half _Crest_CausticsMotionBlur; +float4 _Crest_CausticsTexture_TexelSize; +float4 _Crest_CausticsDistortionTexture_TexelSize; + +#endif // !d_Crest_WaterSurface + +// +// Volume Only +// + +// Out-scattering. Driven by the Water Renderer and Underwater Environmental Lighting. +float _Crest_VolumeExtinctionLength; +float _Crest_UnderwaterEnvironmentalLightingWeight; + +// Also applied to transparent objects. +half _Crest_ExtinctionMultiplier; +half _Crest_SunBoost; +float _Crest_OutScatteringFactor; +float _Crest_OutScatteringExtinctionFactor; +half3 _Crest_AmbientLighting; +int _Crest_DataSliceOffset; + +half _Crest_DitheringIntensity; +CBUFFER_END + +TEXTURE2D_X(_Crest_WaterMaskDepthTexture); + +#ifndef d_Crest_WaterSurface +TEXTURE2D_X(_Crest_WaterMaskTexture); + +TEXTURE2D(_Crest_CausticsTexture); +SAMPLER(sampler_Crest_CausticsTexture); +TEXTURE2D(_Crest_CausticsDistortionTexture); +SAMPLER(sampler_Crest_CausticsDistortionTexture); + +// NOTE: Cannot put this in namespace due to compiler bug. Fixed when using DXC. +static const m_Crest::TiledTexture _Crest_CausticsTiledTexture = + m_Crest::TiledTexture::Make(_Crest_CausticsTexture, sampler_Crest_CausticsTexture, _Crest_CausticsTexture_TexelSize, _Crest_CausticsTextureScale, _Crest_CausticsScrollSpeed); +static const m_Crest::TiledTexture _Crest_CausticsDistortionTiledTexture = + m_Crest::TiledTexture::Make(_Crest_CausticsDistortionTexture, sampler_Crest_CausticsDistortionTexture, _Crest_CausticsDistortionTexture_TexelSize, _Crest_CausticsDistortionScale, 1.0); +#endif // !d_Crest_WaterSurface + +m_CrestNameSpace + +// Get the out-scattering term. +half3 EvaluateOutScattering +( + const half3 i_Extinction, + const float3 i_PositionWS, + const half3 i_ViewWS, + const half i_Multiplier, + const float i_RawDepth, + const float i_WaterLevel +) +{ + float3 positionWS = i_PositionWS; + +#if !CREST_REFLECTION + // Project point onto sphere at the extinction length. + const float3 toSphere = -i_ViewWS * _Crest_VolumeExtinctionLength * i_Multiplier * _Crest_OutScatteringExtinctionFactor; + const float3 toScene = i_PositionWS - _WorldSpaceCameraPos.xyz; + positionWS = _WorldSpaceCameraPos.xyz + toSphere; + + // Get closest position. + positionWS = dot(toScene, toScene) < dot(toSphere, toSphere) ? i_PositionWS : positionWS; +#endif + + // Account for average extinction of light as it travels down through volume. Assume flat water as anything + // else would be expensive. + float waterDepth = max(0.0, (i_WaterLevel - positionWS.y)); + +#if CREST_REFLECTION + waterDepth *= 2.0; + if (i_RawDepth == 0.0) waterDepth = _Crest_VolumeExtinctionLength * i_Multiplier; +#else + // Full strength seems too extreme. Third strength seems reasonable. + waterDepth *= _Crest_OutScatteringFactor; +#endif + + const float3 outScatteringTerm = exp(-i_Extinction * waterDepth); + + // Transition between the Underwater Environmental Lighting (if present) and this. This will give us the + // benefit of both approaches. + return lerp(outScatteringTerm, 1.0, _Crest_UnderwaterEnvironmentalLightingWeight); +} + +void GetWaterSurfaceAndUnderwaterData +( + const float4 positionCS, + const int2 positionSS, + const float rawMaskDepth, + const float mask, + inout float rawDepth, + inout bool isWaterSurface, + inout bool isUnderwater, + inout bool hasCaustics, + inout bool io_OutScatterScene, + inout bool io_ApplyLighting, + inout float sceneZ +) +{ + const float rawSceneDepth = rawDepth; + hasCaustics = rawDepth != 0.0; + isWaterSurface = false; + isUnderwater = mask <= CREST_MASK_BELOW_SURFACE; + io_OutScatterScene = true; + io_ApplyLighting = true; + +#if defined(d_Crest_PortalWithBackFace) || defined(d_Crest_FogBefore) + // Has back-face or is back-face. + Portal::EvaluateVolume(positionCS, positionSS, rawMaskDepth, rawSceneDepth, rawDepth, hasCaustics, isUnderwater, io_OutScatterScene, io_ApplyLighting); +#endif + + // Merge water depth with scene depth. + if (rawDepth < rawMaskDepth) + { + isWaterSurface = true; + hasCaustics = false; + rawDepth = rawMaskDepth; + } + + sceneZ = Utility::CrestLinearEyeDepth(rawDepth); +} + +void ApplyWaterVolumeToUnderwaterFog(float4 positionCS, inout float fogDistance) +{ + // TODO: could we use min here with near plane? less optimized +#if d_Crest_FogAfter + fogDistance -= Utility::CrestLinearEyeDepth(positionCS.z); +#else + // Subtract near plane. + fogDistance -= _ProjectionParams.y; +#endif +} + +half3 ApplyUnderwaterEffect +( + half3 sceneColour, + const float rawDepth, + const float sceneZ, + const float fogDistance, + const half3 view, + const uint2 i_positionSS, + const float3 i_positionWS, + const bool hasCaustics, + const bool i_OutScatterScene, + const bool i_ApplyLighting, + const half i_multiplier +) +{ + const bool isUnderwater = true; + + float3 lightDirection; float3 lightColor; + PrimaryLight(i_positionWS, lightColor, lightDirection); + + // Uniform effect calculated from camera position. + half3 volumeLight = 0.0; + half3 volumeOpacity = 1.0; + { + half3 absorption = _Crest_Absorption.xyz; + half3 scattering = _Crest_Scattering.xyz; + + // We sample shadows at the camera position. Pass a user defined slice offset for smoothing out detail. + // Offset slice so that we dont get high freq detail. But never use last lod as this has crossfading. + int sliceIndex = clamp(_Crest_DataSliceOffset, 0, g_Crest_LodCount - 2); + + if (g_Crest_SampleAbsorptionSimulation) absorption = Cascade::MakeAbsorption(sliceIndex).Sample(_WorldSpaceCameraPos.xz).xyz; + if (g_Crest_SampleScatteringSimulation) scattering = Cascade::MakeScattering(sliceIndex).Sample(_WorldSpaceCameraPos.xz).xyz; + + absorption *= _Crest_ExtinctionMultiplier; + scattering *= _Crest_ExtinctionMultiplier; + + const float waterLevel = g_Crest_WaterCenter.y + Cascade::MakeAnimatedWaves(sliceIndex).Sample(_WorldSpaceCameraPos.xz).w; + + half shadow = 1.0; + { +// #if CREST_SHADOWS_ON + // Camera should be at center of LOD system so no need for blending (alpha, weights, etc). This might not be + // the case if there is large horizontal displacement, but the _Crest_DataSliceOffset should help by setting a + // large enough slice as minimum. + half2 shadowSoftHard = Cascade::MakeShadow(sliceIndex).SampleShadow(_WorldSpaceCameraPos.xz); + // Soft in red, hard in green. But hard not computed in HDRP. + shadow = 1.0 - shadowSoftHard.x; +// #endif + } + + half3 ambientLighting = AmbientLight(_Crest_AmbientLighting); + + const half3 extinction = VolumeExtinction(absorption, scattering); + + // Out-Scattering Term. + { + const half3 outScatteringTerm = EvaluateOutScattering + ( + extinction, + i_positionWS, + view, + i_multiplier, + rawDepth, + waterLevel + ); + + // Darken scene and light. + sceneColour *= i_OutScatterScene ? outScatteringTerm : 1.0; +#if !CREST_REFLECTION + lightColor *= outScatteringTerm; + ambientLighting *= outScatteringTerm; +#endif + } + + volumeOpacity = VolumeOpacity(extinction, fogDistance); + volumeLight = VolumeLighting + ( + extinction, + scattering, + _Crest_Anisotropy, + shadow, + view, + ambientLighting, + lightDirection, + lightColor, + half3(0.0, 0.0, 0.0), + _Crest_AmbientTerm, + _Crest_DirectTerm, + _Crest_SunBoost, + _Crest_ShadowsAffectsAmbientFactor + ); + } + +#ifndef k_DisableCaustics + if (_Crest_CausticsEnabled && hasCaustics) + { + half lightOcclusion = PrimaryLightShadows(i_positionWS, i_positionSS); + half blur = 0.0; + + const uint slice0 = PositionToSliceIndex(i_positionWS.xz, 0, g_Crest_WaterScale); + +#ifdef CREST_FLOW_ON + half2 flowData = Cascade::MakeFlow(slice0).SampleFlow(i_positionWS.xz); + const Flow flow = Flow::Make(flowData, g_Crest_Time); + blur = _Crest_CausticsMotionBlur; +#endif + + const float4 displacement = Cascade::MakeAnimatedWaves(slice0).Sample(i_positionWS.xz); + const float surfaceHeight = displacement.y + g_Crest_WaterCenter.y + displacement.w; + + sceneColour *= Caustics + ( +#ifdef CREST_FLOW_ON + flow, +#endif + i_positionWS, + surfaceHeight, + lightColor, + lightDirection, + lightOcclusion, + sceneZ, + _Crest_CausticsTiledTexture, + _Crest_CausticsTextureAverage, + _Crest_CausticsStrength, + _Crest_CausticsFocalDepth, + _Crest_CausticsDepthOfField, + _Crest_CausticsDistortionTiledTexture, + _Crest_CausticsDistortionStrength, + blur, + isUnderwater + ); + } +#endif + +#if CREST_HDRP + volumeLight *= GetCurrentExposureMultiplier(); +#endif + +#ifndef k_DisableDithering +#if d_Dithering + // Increasing intensity can be required for HDRP. + volumeLight += Utility::ScreenSpaceDither(i_positionSS) * _Crest_DitheringIntensity; +#endif +#endif + + if (i_ApplyLighting) + { + sceneColour = lerp(sceneColour, volumeLight, volumeOpacity); + } + + return sceneColour; +} + +m_CrestNameSpaceEnd + +#endif // CREST_UNDERWATER_EFFECT_SHARED_INCLUDED diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterShared.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterShared.hlsl.meta new file mode 100644 index 0000000..215e57a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterShared.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: decff59e1280c4df1bd50de3e83a28a6 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterURP.hlsl b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterURP.hlsl new file mode 100644 index 0000000..676f561 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterURP.hlsl @@ -0,0 +1,16 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#pragma multi_compile_fragment _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile_fragment _ _SHADOWS_SOFT + +#define CREST_URP 1 +#define CREST_SHADERGRAPH_CONSTANTS_H + +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareOpaqueTexture.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl" diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterURP.hlsl.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterURP.hlsl.meta new file mode 100644 index 0000000..eb75f8d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Volume/UnderwaterURP.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 40ef61909a559462ab3c6dd2143a77f8 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves.meta new file mode 100644 index 0000000..e43df5a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ebffa456d12d4ff883a968a851bc9e9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT.meta new file mode 100644 index 0000000..72488d4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0875fc0c65d1c4fb7aeb19264860f573 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTCompute.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTCompute.compute new file mode 100644 index 0000000..57124fd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTCompute.compute @@ -0,0 +1,176 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Inspired by https://github.com/speps/GX-EncinoWaves + +// First SIZE constant must match FFT_KERNEL_0_RESOLUTION in FFTCompute.cs +#pragma kernel ComputeFFT SIZE=8 PASSES=3 CHANNEL=x TX=8 TY=1 FINAL=0 +#pragma kernel ComputeFFT SIZE=8 PASSES=3 CHANNEL=y TX=1 TY=8 FINAL=1 +#pragma kernel ComputeFFT SIZE=16 PASSES=4 CHANNEL=x TX=16 TY=1 FINAL=0 +#pragma kernel ComputeFFT SIZE=16 PASSES=4 CHANNEL=y TX=1 TY=16 FINAL=1 +#pragma kernel ComputeFFT SIZE=32 PASSES=5 CHANNEL=x TX=32 TY=1 FINAL=0 +#pragma kernel ComputeFFT SIZE=32 PASSES=5 CHANNEL=y TX=1 TY=32 FINAL=1 +#pragma kernel ComputeFFT SIZE=64 PASSES=6 CHANNEL=x TX=64 TY=1 FINAL=0 +#pragma kernel ComputeFFT SIZE=64 PASSES=6 CHANNEL=y TX=1 TY=64 FINAL=1 +#pragma kernel ComputeFFT SIZE=128 PASSES=7 CHANNEL=x TX=128 TY=1 FINAL=0 +#pragma kernel ComputeFFT SIZE=128 PASSES=7 CHANNEL=y TX=1 TY=128 FINAL=1 +#pragma kernel ComputeFFT SIZE=256 PASSES=8 CHANNEL=x TX=256 TY=1 FINAL=0 +#pragma kernel ComputeFFT SIZE=256 PASSES=8 CHANNEL=y TX=1 TY=256 FINAL=1 +#pragma kernel ComputeFFT SIZE=512 PASSES=9 CHANNEL=x TX=512 TY=1 FINAL=0 +#pragma kernel ComputeFFT SIZE=512 PASSES=9 CHANNEL=y TX=1 TY=512 FINAL=1 + +// Must match CASCADE_COUNT in FFTCompute.cs +#define CASCADE_COUNT 16 + +Texture2D _Crest_InputButterfly; +#if !FINAL +RWTexture2DArray _Crest_Output1; +RWTexture2DArray _Crest_Output2; +RWTexture2DArray _Crest_Output3; +#else +Texture2DArray _Crest_InputH; +Texture2DArray _Crest_InputX; +Texture2DArray _Crest_InputZ; +// Write zero to W to clear garbage. +RWTexture2DArray _Crest_Output; +#endif + +groupshared float2 _Crest_IntermediatesH[SIZE]; +groupshared float2 _Crest_ScratchH[SIZE]; +groupshared float2 _Crest_IntermediatesX[SIZE]; +groupshared float2 _Crest_ScratchX[SIZE]; +groupshared float2 _Crest_IntermediatesZ[SIZE]; +groupshared float2 _Crest_ScratchZ[SIZE]; + +// This was required for Intel machines, but not required for Apple Silicon. +#if defined(SHADER_API_METAL) +// reversebits function appears to not make it across to Metal +#if !defined(reversebits) +uint reversebits( uint x ) +{ + x = ((x >> 1) & 0x55555555u) | ((x & 0x55555555u) << 1); + x = ((x >> 2) & 0x33333333u) | ((x & 0x33333333u) << 2); + x = ((x >> 4) & 0x0f0f0f0fu) | ((x & 0x0f0f0f0fu) << 4); + x = ((x >> 8) & 0x00ff00ffu) | ((x & 0x00ff00ffu) << 8); + x = ((x >> 16) & 0xffffu) | ((x & 0xffffu) << 16); + return x; +} +#endif +#endif + +void ButterflyPass(float2 butterfly, uint coord, uint passIndex, uint cascade) +{ + uint indexA, indexB; + + const uint offset = 1 << passIndex; + if ((coord / offset) % 2 == 1) + { + indexA = coord - offset; + indexB = coord; + } + else + { + indexA = coord; + indexB = coord + offset; + } + + if (passIndex == 0) + { + indexA = reversebits(indexA) >> (32 - PASSES); + indexB = reversebits(indexB) >> (32 - PASSES); + } + + const bool pingpong = (passIndex % 2) == 0; + + float2 valueA_H, valueB_H; + float2 valueA_X, valueB_X; + float2 valueA_Z, valueB_Z; + if (pingpong) + { + valueA_H = _Crest_IntermediatesH[indexA]; + valueB_H = _Crest_IntermediatesH[indexB]; + + valueA_X = _Crest_IntermediatesX[indexA]; + valueB_X = _Crest_IntermediatesX[indexB]; + + valueA_Z = _Crest_IntermediatesZ[indexA]; + valueB_Z = _Crest_IntermediatesZ[indexB]; + } + else + { + valueA_H = _Crest_ScratchH[indexA]; + valueB_H = _Crest_ScratchH[indexB]; + + valueA_X = _Crest_ScratchX[indexA]; + valueB_X = _Crest_ScratchX[indexB]; + + valueA_Z = _Crest_ScratchZ[indexA]; + valueB_Z = _Crest_ScratchZ[indexB]; + } + + const float2 weight = butterfly.xy; + const float2 weightedValueH = weight * valueB_H.r + weight.gr * valueB_H.g * float2(-1.0, 1.0); + const float2 weightedValueX = weight * valueB_X.r + weight.gr * valueB_X.g * float2(-1.0, 1.0); + const float2 weightedValueZ = weight * valueB_Z.r + weight.gr * valueB_Z.g * float2(-1.0, 1.0); + const float2 resultH = valueA_H + weightedValueH; + const float2 resultX = valueA_X + weightedValueX; + const float2 resultZ = valueA_Z + weightedValueZ; + + if (pingpong) + { + _Crest_ScratchH[coord] = resultH; + _Crest_ScratchX[coord] = resultX; + _Crest_ScratchZ[coord] = resultZ; + } + else + { + _Crest_IntermediatesH[coord] = resultH; + _Crest_IntermediatesX[coord] = resultX; + _Crest_IntermediatesZ[coord] = resultZ; + } +} + +float2 conj(float2 v) +{ + return float2(v.x, -v.y); +} + +[numthreads(TX,TY,1)] +void ComputeFFT(const uint3 id : SV_DispatchThreadID) +{ + const uint coord = id.CHANNEL; +#if !FINAL + _Crest_IntermediatesH[coord] = conj(_Crest_Output1[id]); + _Crest_IntermediatesX[coord] = conj(_Crest_Output2[id]); + _Crest_IntermediatesZ[coord] = conj(_Crest_Output3[id]); +#else + _Crest_IntermediatesH[coord] = _Crest_InputH[id]; + _Crest_IntermediatesX[coord] = _Crest_InputX[id]; + _Crest_IntermediatesZ[coord] = _Crest_InputZ[id]; +#endif + + [unroll(PASSES)] + for (uint passIndex = 0; passIndex < PASSES; ++passIndex) + { + GroupMemoryBarrierWithGroupSync(); + ButterflyPass(_Crest_InputButterfly[uint2(coord, passIndex)].xy, coord, passIndex, id.z); + } + + GroupMemoryBarrierWithGroupSync(); + + const bool pingpong = (PASSES % 2) == 0; + const float2 resultH = pingpong ? _Crest_IntermediatesH[coord] : _Crest_ScratchH[coord]; + const float2 resultX = pingpong ? _Crest_IntermediatesX[coord] : _Crest_ScratchX[coord]; + const float2 resultZ = pingpong ? _Crest_IntermediatesZ[coord] : _Crest_ScratchZ[coord]; + +#if !FINAL + _Crest_Output1[id] = resultH; + _Crest_Output2[id] = resultX; + _Crest_Output3[id] = resultZ; +#else + const float sign = ((id.x + id.y) % 2) == 1 ? -1.0 : 1.0; + const float3 res = float3(sign * resultX.x, sign * resultH.x, sign * resultZ.x); + // Write zero to W to clear garbage. + _Crest_Output[id] = float4(sign * resultX.x, sign * resultH.x, sign * resultZ.x, 1.0); +#endif +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTCompute.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTCompute.compute.meta new file mode 100644 index 0000000..2b93969 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTCompute.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a5caa5dfb6d2c4632b41493dc2ba74d0 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTSpectrum.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTSpectrum.compute new file mode 100644 index 0000000..2857a42 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTSpectrum.compute @@ -0,0 +1,263 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Inspired by https://github.com/speps/GX-EncinoWaves + +#pragma kernel SpectrumInitalize +#pragma kernel SpectrumUpdate + +#define INV2PI 0.15915494309f +#define PI4 0.33661977236f +#define INVPI2 0.63661977236f +#define HPI 1.57079632679f +#define PI 3.14159265358f +#define PI2 6.28318530717f +#define HSQRT2 0.70710678118f + +// These must match corresponding constants in WaveSpectrum.cs +#define SPECTRUM_OCTAVE_COUNT 14.0 +#define SPECTRUM_SMALLEST_WL_POW_2 -4.0 + +uint _Crest_Size; +float _Crest_WindSpeed; +float _Crest_Turbulence; +float _Crest_Gravity; +float _Crest_Period; +float _Crest_Alignment; + +uint WangHash(uint seed) +{ + seed = (seed ^ 61) ^ (seed >> 16); + seed *= 9; + seed = seed ^ (seed >> 4); + seed *= 0x27d4eb2d; + seed = seed ^ (seed >> 15); + return seed; +} + +uint Rand(inout uint rngState) +{ + rngState ^= (rngState << 13); + rngState ^= (rngState >> 17); + rngState ^= (rngState << 5); + return rngState; +} + +float RandFloat(inout uint rngState) +{ + return Rand(rngState) / 4294967296.0f; +} + +float RandGauss(inout uint rngState) +{ + float u1 = RandFloat(rngState); + float u2 = RandFloat(rngState); + if (u1 < 1e-6f) + u1 = 1e-6f; + return sqrt(-2.0f * log(u1)) * cos(PI2 * u2); +} + +void DeepDispersion(float k, out float w, out float dwdk) +{ + w = sqrt(abs(_Crest_Gravity * k)); + + // Allow FFT to loop in time + if( _Crest_Period > 0.0 ) + { + float thisPeriod = PI2 / w; + float loops = _Crest_Period / thisPeriod; + // Make sure loops integral number of times + loops = ceil( loops ); + // Work our way back to frequency + thisPeriod = _Crest_Period / loops; + w = PI2 / thisPeriod; + } + + dwdk = _Crest_Gravity / (2.0f * w); +} + +float AlphaBetaSpectrum(float A, float B, float g, float w, float wm) +{ + return + (A * g * g / pow(w, 5.0f)) * + exp(-B * pow(wm / w, 4.0f)); +} + +float PiersonMoskowitzSpectrum(float w) +{ + float wm = 0.87f * _Crest_Gravity / _Crest_WindSpeed; + return AlphaBetaSpectrum(8.1e-3f, 1.291f, _Crest_Gravity, w, wm); +} + +float PiersonMoskowitzWindTerm( float w ) +{ + float wm = 0.87f * _Crest_Gravity / _Crest_WindSpeed; + return exp( -1.291 * pow( wm / w, 4.0f ) ); +} + +float PosCosSquaredDirectionalSpreading( float cosTheta ) +{ + // Aligned waves. + float alignment; + { + float minWeight = lerp(1.0, 0.1, _Crest_Alignment); + float wt = max(cosTheta, minWeight); + wt *= lerp(0.25, 1.5, _Crest_Alignment); + float power = lerp(1.0, 16.0, _Crest_Alignment); + + // Needs 2 to match current settings. + alignment = wt * INVPI2 * pow(abs(cosTheta), power) * PI; + } + + float turbulence; + { + if (cosTheta > 0.0) + { + turbulence = lerp(INVPI2 * (cosTheta * cosTheta), PI4, _Crest_Turbulence); + } + else + { + turbulence = PI4 * _Crest_Turbulence; + } + } + + // Integrate alignment and turbulence. + return lerp(turbulence, alignment, _Crest_Alignment * (1.0 - _Crest_Turbulence)); +} + +RWTexture2DArray _Crest_ResultInit; +Texture2D _Crest_SpectrumControls; +SamplerState linear_clamp_sampler; +float2 _Crest_WindDir; + +[numthreads(8,8,1)] +void SpectrumInitalize(uint3 id : SV_DispatchThreadID) +{ + const int2 center = _Crest_Size.xx / 2; + const int2 coord = id.xy - center; + + if( coord.x == 0 && coord.y == 0 ) + { + _Crest_ResultInit[id] = 0.0; + return; + } + + uint depth; + { + uint width, height; + _Crest_ResultInit.GetDimensions( width, height, depth ); + } + + uint maxCoord = int( max( abs( coord.x ), abs( coord.y ) ) ); + + // Matches variable with same name in ShapeFFT.cs + uint WAVE_SAMPLE_FACTOR = 8; + + // If not largest cascade which will get all wavelengths, then limit + // so we split range of frequencies with no overlaps. + // The check on maxCoord below looks pretty magic. It is optimised version of: + // uint samplesPerWave = _Crest_Size / WAVE_SAMPLE_FACTOR; + // Too low wavelength (maxCoord < _Crest_Size / (2 * samplesPerWave) || + // Too high wavelength maxCoord >= _Crest_Size / samplesPerWave) + if ( id.z < (depth - 1) && + // Too low wavelength + maxCoord < WAVE_SAMPLE_FACTOR / 2 || + // Too high wavelength + maxCoord >= WAVE_SAMPLE_FACTOR + ) + { + _Crest_ResultInit[id] = 0.0; + return; + } + + const float worldSize = 0.5f * (1 << id.z); + + // Find wave vector and number + const float2 k = PI2 * coord / worldSize; + const float kMag = length(k); + + // Init seed. rngState was _RngState (file level variable), but GameCore platforms does not allow assigning to them. + // See issue #856 for more information: https://github.com/wave-harmonic/crest/issues/856 + uint rngState = WangHash(id.z * _Crest_Size * _Crest_Size + id.y * _Crest_Size + id.x); + + // Dispersion + float w; float dwdk; + DeepDispersion(kMag, w, dwdk); + + // Spectrum - use power values from users spectrum, but borrow wind term from PM + const float wavelength = PI2 / kMag; + const float octaveIndex = log2( wavelength ) - SPECTRUM_SMALLEST_WL_POW_2; + const float2 spectrumUV = float2((octaveIndex + 0.5) / SPECTRUM_OCTAVE_COUNT, 0.5); + const float spectrum = _Crest_SpectrumControls.SampleLevel( linear_clamp_sampler, spectrumUV, 0.0 ) * + PiersonMoskowitzWindTerm( w ); + + float deltaSPos = spectrum; + float deltaSNeg = spectrum; + + // Directional spreading + const float cosTheta = dot( k, _Crest_WindDir ) / kMag; + deltaSPos *= PosCosSquaredDirectionalSpreading( cosTheta ); + deltaSNeg *= PosCosSquaredDirectionalSpreading( -cosTheta ); + const float dK = PI2 / worldSize; + deltaSPos *= (dK * dK) * dwdk / kMag; + deltaSNeg *= (dK * dK) * dwdk / kMag; + + // Amplitude + const float ampPos = RandGauss(rngState) * sqrt(abs(deltaSPos) * 2.0f); + const float ampNeg = RandGauss(rngState) * sqrt(abs(deltaSNeg) * 2.0f); + + // Output + const float phasePos = RandFloat(rngState) * PI2; + const float phaseNeg = RandFloat(rngState) * PI2; + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + const float spiceyMultiplier = 1.5; + _Crest_ResultInit[id] = float4(ampPos * float2(cos(phasePos), -sin(phasePos)), ampNeg * float2(cos(phaseNeg), -sin(phaseNeg))) + * spiceyMultiplier; +} + +float _Crest_Time; +float _Crest_Chop; + +Texture2DArray _Crest_Init0; +RWTexture2DArray _Crest_ResultHeight; +RWTexture2DArray _Crest_ResultDisplaceX; +RWTexture2DArray _Crest_ResultDisplaceZ; + +float2 cmul(float2 lhs, float2 rhs) +{ + return float2( + lhs.x * rhs.x - lhs.y * rhs.y, + lhs.x * rhs.y + lhs.y * rhs.x + ); +} + +[numthreads(8, 8, 1)] +void SpectrumUpdate(uint3 id : SV_DispatchThreadID) +{ + const int2 center = _Crest_Size.xx / 2; + const int2 coord = id.xy - center; + + // Find wave vector and number + const float worldSize = 0.5 * (1 << id.z); + const float2 k = PI2 * coord / worldSize; + const float kMag = length(k); + + // Dispersion + float w; float dwdk; + DeepDispersion(kMag, w, dwdk); + + // Advance time + float sw; float cw; + sincos(w * _Crest_Time, sw, cw); + + const float2 fwd = float2(cw, -sw); + const float2 bkwd = float2(cw, sw); + + const float4 h0 = _Crest_Init0[id]; + const float2 h = cmul(h0.xy, fwd) + cmul(h0.zw, bkwd); + + _Crest_ResultHeight[id] = h; + _Crest_ResultDisplaceX[id] = _Crest_Chop * float2(-h.y * k.x, h.x * k.x) / (kMag + 0.00001f); + _Crest_ResultDisplaceZ[id] = _Crest_Chop * float2(-h.y * k.y, h.x * k.y) / (kMag + 0.00001f); +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTSpectrum.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTSpectrum.compute.meta new file mode 100644 index 0000000..69c45e0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/FFT/FFTSpectrum.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d493ec731bb6e43dfac22cc5921d31e3 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner.meta new file mode 100644 index 0000000..b24f483 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 431e29194508d4bcfaeb17cac204bc08 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner/Gerstner.compute b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner/Gerstner.compute new file mode 100644 index 0000000..7c2f80f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner/Gerstner.compute @@ -0,0 +1,114 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Computes a set of patches of waves, one for each scale. + +#pragma kernel Gerstner + +#include "HLSLSupport.cginc" + +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl" +#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Helpers.hlsl" + +float _Crest_TextureRes; +uint _Crest_FirstCascadeIndex; + +struct GerstnerCascadeParams +{ + int _StartIndex; +}; +StructuredBuffer _Crest_GerstnerCascadeParams; + +struct GerstnerWaveComponent4 +{ + float4 _TwoPiOverWavelength; + float4 _Amplitude; + float4 _WaveDirectionX; + float4 _WaveDirectionZ; + float4 _Omega; + float4 _Phase; + float4 _ChopAmplitude; + // Waves are generated in pairs, these values are for the second in the pair + float4 _Amplitude2; + float4 _ChopAmplitude2; + float4 _Phase2; +}; +StructuredBuffer _Crest_GerstnerWaveData; + +RWTexture2DArray _Crest_WaveBuffer; + +void ComputeGerstner( float2 worldPosXZ, float worldSize, GerstnerWaveComponent4 data, inout float3 result ) +{ + // direction + half4 Dx = data._WaveDirectionX; + half4 Dz = data._WaveDirectionZ; + + // wave number + half4 k = data._TwoPiOverWavelength; + + half4 kx = k * Dx; + half4 kz = k * Dz; + + // spatial location + float4 x = kx * worldPosXZ.x + kz * worldPosXZ.y; + + // Compute a pair of waves, travelling in opposite directions (see + // sign in front of data._Omega). This matches how FFT wave gen works + // and produces waves that have a time varying amplitude, resulting in + // a more dynamic surface appearance. + half4 resultx, resulty, resultz; + { + half4 angle = x + data._Phase - data._Omega * g_Crest_Time; + + half4 sinangle, cosangle; + sincos( angle, sinangle, cosangle ); + + half4 disp = data._ChopAmplitude * sinangle; + resultx = disp * Dx; + resultz = disp * Dz; + + resulty = data._Amplitude * cosangle; + } + + { + half4 angle = x + data._Phase2 + data._Omega * g_Crest_Time; + + half4 sinangle, cosangle; + sincos( angle, sinangle, cosangle ); + + half4 disp = data._ChopAmplitude2 * sinangle; + resultx += disp * Dx; + resultz += disp * Dz; + + resulty += data._Amplitude2 * cosangle; + } + + // sum the vector results + result.x += dot( resultx, 1.0 ); + result.y += dot( resulty, 1.0 ); + result.z += dot( resultz, 1.0 ); +} + +[numthreads(THREAD_GROUP_SIZE_X, THREAD_GROUP_SIZE_Y, 1)] +void Gerstner(uint3 id : SV_DispatchThreadID) +{ + const uint cascadeIndex = id.z + _Crest_FirstCascadeIndex; + const float worldSize = 0.5f * (1 << cascadeIndex); + + // Each cascade lies on XZ plane and starts from the origin + const float texelWidth = worldSize / _Crest_TextureRes; + const float2 worldPosXZ = (id.xy + 0.5) * texelWidth; + + float3 result = 0.0; + + const int startIndex = _Crest_GerstnerCascadeParams[cascadeIndex]._StartIndex; + const int endIndex = _Crest_GerstnerCascadeParams[cascadeIndex + 1]._StartIndex; + for( int i = startIndex; i < endIndex; i++ ) + { + // Sum up waves from another buffer + ComputeGerstner( worldPosXZ, worldSize, _Crest_GerstnerWaveData[i], result ); + } + + _Crest_WaveBuffer[uint3(id.xy, cascadeIndex)] = float4(result, 1.0); +} diff --git a/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner/Gerstner.compute.meta b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner/Gerstner.compute.meta new file mode 100644 index 0000000..db427f5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Shaders/Waves/Gerstner/Gerstner.compute.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c7470afd2715c48b89d1e4a2a557d6d7 +ComputeShaderImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures.meta b/Packages/com.waveharmonic.crest/Runtime/Textures.meta new file mode 100644 index 0000000..678e4fe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 377c1810bc00c49f6ad2d80484cdc91c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics.meta b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics.meta new file mode 100644 index 0000000..240f25b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2bca8ea133133417ea9c7d9d7d71354f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Caustics.png b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Caustics.png new file mode 100644 index 0000000..8b13bc9 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Caustics.png differ diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Caustics.png.meta b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Caustics.png.meta new file mode 100644 index 0000000..d7a380a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Caustics.png.meta @@ -0,0 +1,114 @@ +fileFormatVersion: 2 +guid: 1407209016967410da2ae6fdd4d97fc6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 0 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Source.txt b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Source.txt new file mode 100644 index 0000000..dbf445c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Source.txt @@ -0,0 +1,3 @@ +Source: https://forums.unrealengine.com/t/water-caustics/28155 +Download: http://i2.photobucket.com/albums/y43/8thMan/Caustics_tex_zpsc0xyvivw.png +Modifications: Modified to add separation in colour channels. diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Source.txt.meta b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Source.txt.meta new file mode 100644 index 0000000..c45882d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/Caustics/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f551a0ace500746d090fbab20f13f39e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals.meta b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals.meta new file mode 100644 index 0000000..3ec2edd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bcb2c0e17ec214469b7462c44150b8db +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/Source.txt b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/Source.txt new file mode 100644 index 0000000..e0f3dd7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/Source.txt @@ -0,0 +1,14 @@ +Source: https://textures.pixel-furnace.com/texture?name=Animated%20Water + +Terms: +https://textures.pixel-furnace.com/terms + +After downloading digital products from Pixel-Furnace the user is allowed to use them for: +- Distributing and selling 3D models and computer games bundled with modified or unmodified versions of the textures. +- Creating and publishing 2D and 3D graphics, websites, website templates, movies, advertisements, design themes and printed media. + +The user is not allowed to use the products for: +- Selling or distributing them in collections or by themselves. +- Any purpose that violates German or other applicable law or regulation. + +The user is not required provide attribution. diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/Source.txt.meta b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/Source.txt.meta new file mode 100644 index 0000000..f5e07e5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/Source.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d07b67edeff0a48729c796d02cbeacfe +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/WaveNormals.png b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/WaveNormals.png new file mode 100644 index 0000000..bf87a02 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/WaveNormals.png differ diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/WaveNormals.png.meta b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/WaveNormals.png.meta new file mode 100644 index 0000000..765a2a9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/WaveNormals/WaveNormals.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 7aa3f69cfb40b429a865c45a7271c5f5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/foam.png b/Packages/com.waveharmonic.crest/Runtime/Textures/foam.png new file mode 100644 index 0000000..452ab8a Binary files /dev/null and b/Packages/com.waveharmonic.crest/Runtime/Textures/foam.png differ diff --git a/Packages/com.waveharmonic.crest/Runtime/Textures/foam.png.meta b/Packages/com.waveharmonic.crest/Runtime/Textures/foam.png.meta new file mode 100644 index 0000000..4c572f4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Runtime/Textures/foam.png.meta @@ -0,0 +1,114 @@ +fileFormatVersion: 2 +guid: 959dd0505e2c54585865f51257daa0e3 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats.meta b/Packages/com.waveharmonic.crest/Samples~/Boats.meta new file mode 100644 index 0000000..800cd9f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5ed869a4bb144982bacf865e94edca9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Data.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Data.meta new file mode 100644 index 0000000..d87d512 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 58c1042f8dfca4593bfb97825d4befc6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Calm.asset b/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Calm.asset new file mode 100644 index 0000000..4a40699 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Calm.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: Boats_Waves_Calm + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 90 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.39794 + - -7.39794 + - -6.598513 + - -6.1093907 + - -5.6443586 + - -5.0608916 + - -4.513266 + - -3.4068804 + - -2.7731915 + - -2.4056463 + - -2.5869184 + - -4.421911 + - -7.39794 + - -7.39794 + _PowerDisabled: 0000000000000000000001010101 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.69 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Calm.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Calm.asset.meta new file mode 100644 index 0000000..62666e9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Calm.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28a29b5ef0c644735b5d7ba47d2863d4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Moderate.asset b/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Moderate.asset new file mode 100644 index 0000000..36216f3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Moderate.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: Boats_Waves_Moderate + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 90 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.39794 + - -7.39794 + - -6.598513 + - -6.1406407 + - -4.8268056 + - -4.3421416 + - -3.232016 + - -2.909008 + - -2.7731915 + - -2.4056463 + - -2.5869184 + - -4.421911 + - -7.39794 + - -7.39794 + _PowerDisabled: 0000000000000000000001010101 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.69 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Moderate.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Moderate.asset.meta new file mode 100644 index 0000000..ee3257f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Data/Boats_Waves_Moderate.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4fde516347f8f410cb7bf7ec2b66c163 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Materials.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials.meta new file mode 100644 index 0000000..9a74075 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d3fc0f71b618485cbfb3f8f5c03ef15 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_AnimatedWavesWaveParticle.mat b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_AnimatedWavesWaveParticle.mat new file mode 100644 index 0000000..f1e7e5a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_AnimatedWavesWaveParticle.mat @@ -0,0 +1,32 @@ +%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: Boats_AnimatedWavesWaveParticle + m_Shader: {fileID: 4800000, guid: c1519a4fd6d8a4a62b59870be79b3857, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _Crest_Amplitude: 5.5 + - _Crest_Radius: 5.5 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_AnimatedWavesWaveParticle.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_AnimatedWavesWaveParticle.mat.meta new file mode 100644 index 0000000..7b733f6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_AnimatedWavesWaveParticle.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 80058df675809418c8cc68aa9c770d13 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_Hull.mat b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_Hull.mat new file mode 100644 index 0000000..fa4d128 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_Hull.mat @@ -0,0 +1,239 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4129264835413728531 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &-4006929973867857426 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Boats_Hull + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Albedo: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _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: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Alpha_Cutoff: 0.5 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _CastShadows: 1 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoMapScale: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnvironmentReflections: 1 + - _ExcludeFromTUAndAA: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _Normal_Flip_Back_Faces: 1 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SPECULARHIGHLIGHTS_OFF: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _Surface: 0 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteControl: 0 + m_Colors: + - _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 0} + - _SpecularColor: {r: 0.19999987, g: 0.19999987, b: 0.19999987, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &3579710415365486419 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_Hull.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_Hull.mat.meta new file mode 100644 index 0000000..494d241 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Materials/Boats_Hull.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs.meta new file mode 100644 index 0000000..1132f4b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b27ca952088747c79734cf0202fc834 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_AlignNormal.prefab b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_AlignNormal.prefab new file mode 100644 index 0000000..92ed4f3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_AlignNormal.prefab @@ -0,0 +1,571 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1101438575393472 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4144419704406498} + - component: {fileID: 33078994270761266} + - component: {fileID: 23986883009571642} + - component: {fileID: 3330673141854086305} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4144419704406498 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1101438575393472} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1.81, z: -1.1100001} + m_LocalScale: {x: 2.3208153, y: 3.3449237, z: 3.3449237} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8451484833444656965} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33078994270761266 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1101438575393472} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23986883009571642 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1101438575393472} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &3330673141854086305 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1101438575393472} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 0.9999996, y: 1, z: 0.99999964} + m_Center: {x: -0.00000023841858, y: 0, z: 0.00000047683716} +--- !u!1 &1179779444260730 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4675692173269740} + - component: {fileID: 33253585210816130} + - component: {fileID: 23744682549831734} + - component: {fileID: 7692861982659245908} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4675692173269740 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1179779444260730} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0.000000029802326, z: 0.000000029802326, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 4, y: 4, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8451484833444656965} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &33253585210816130 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1179779444260730} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23744682549831734 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1179779444260730} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &7692861982659245908 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1179779444260730} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 2, z: 0.5} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &1586036824446524 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4274299234749796} + m_Layer: 0 + m_Name: Camera Position + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4274299234749796 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1586036824446524} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: 0.0000087072885, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 6.46, z: -15.24} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4341219009766782} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1935509346245718 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4341219009766782} + - component: {fileID: 54124699236053002} + - component: {fileID: 5698509921356587367} + - component: {fileID: 2363303711291887437} + m_Layer: 0 + m_Name: Boats_AlignNormal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4341219009766782 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1935509346245718} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4274299234749796} + - {fileID: 8451484833444656965} + - {fileID: 1045387248513333459} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &54124699236053002 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1935509346245718} + serializedVersion: 4 + m_Mass: 32000 + m_Drag: 0 + m_AngularDrag: 1.5 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 1 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &5698509921356587367 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1935509346245718} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eba37e6f7ba7a4a488c7831f45a078b2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _RigidBody: {fileID: 54124699236053002} + _Model: 0 + _Layer: 1 + _BuoyancyForceStrength: 1.5 + _BuoyancyTorqueStrength: 8 + _MaximumBuoyancyForce: Infinity + _CenterToBottomOffset: -1.3 + _AccelerateDownhill: 0 + _Probes: [] + _Drag: {x: 2, y: 3, z: 1} + _AngularDrag: 0.2 + _ForceHeightOffset: -0.3 + _ObjectWidth: 4.5 + _UseObjectLength: 1 + _ObjectLength: 7 + _Debug: + _DrawQueries: 0 +--- !u!114 &2363303711291887437 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1935509346245718} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9310a3e8fdd024e06bb9d6970db822d2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _FloatingObject: {fileID: 0} + _Control: {fileID: 0} + _ForceHeightOffset: -0.3 + _ThrustPower: 11 + _SteerPower: 1.3 + _TurningHeel: 0.35 + _BuoyancyCurveFactor: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0.01267637 + outSlope: 0.01267637 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6626424 + value: 0.1791001 + inSlope: 0.8680198 + outSlope: 0.8680198 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 3.38758 + outSlope: 3.38758 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1 &1091444920262533504 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8451484833444656965} + m_Layer: 0 + m_Name: Hull + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8451484833444656965 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091444920262533504} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 4144419704406498} + - {fileID: 4675692173269740} + m_Father: {fileID: 4341219009766782} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2232859459982646888 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6571122149417955733} + - component: {fileID: 7560149910363692706} + m_Layer: 0 + m_Name: Back + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6571122149417955733 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2232859459982646888} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1.9399992} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1045387248513333459} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7560149910363692706 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2232859459982646888} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2.4 + _Weight: 3 + _WeightVerticalMultiplier: 0.1 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.75 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &5616775644819927798 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 483489108023645903} + - component: {fileID: 7165778020089324222} + m_Layer: 0 + m_Name: Front + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &483489108023645903 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5616775644819927798} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 2.3899994} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1045387248513333459} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7165778020089324222 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5616775644819927798} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2.4 + _Weight: 2 + _WeightVerticalMultiplier: 0.1 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.75 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &7193031488571952751 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1045387248513333459} + m_Layer: 0 + m_Name: Interactions + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1045387248513333459 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7193031488571952751} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 483489108023645903} + - {fileID: 6571122149417955733} + m_Father: {fileID: 4341219009766782} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_AlignNormal.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_AlignNormal.prefab.meta new file mode 100644 index 0000000..9faf033 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_AlignNormal.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 40b143bc273314da29022a07899ee9da +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatScene.prefab b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatScene.prefab new file mode 100644 index 0000000..e2c2212 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatScene.prefab @@ -0,0 +1,4361 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &28699388178304066 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7908827383684285303} + - component: {fileID: 7316095084194147545} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7908827383684285303 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 28699388178304066} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.862069, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3892724689903558712} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7316095084194147545 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 28699388178304066} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &55196674450853449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8486778599265021502} + m_Layer: 0 + m_Name: Entity + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8486778599265021502 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 55196674450853449} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7510205674214501026} + - {fileID: 3165803516736325573} + m_Father: {fileID: 2128158282063340194} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &587546518363464773 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6783273435874499886} + - component: {fileID: 1451108345288864215} + - component: {fileID: 5607877506227865496} + - component: {fileID: 4668782139702135769} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6783273435874499886 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587546518363464773} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 3, y: 0, z: 0} + m_LocalScale: {x: 1, y: 5, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3165803516736325573} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!33 &1451108345288864215 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587546518363464773} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5607877506227865496 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587546518363464773} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &4668782139702135769 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587546518363464773} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.50000024 + m_Height: 2.0000005 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940699} +--- !u!1 &734396121963123157 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3926999345176316209} + - component: {fileID: 2924497574534487090} + m_Layer: 0 + m_Name: ClipSurfaceConvexHull + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3926999345176316209 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 734396121963123157} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.125, z: 0} + m_LocalScale: {x: 4.5, y: 4.625, z: 9.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7510205674214501026} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2924497574534487090 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 734396121963123157} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26623fd0e291a478a9f8b68a3df7e8a6, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 4 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Version: 0 + _Primitive: 3 + _Inverted: 0 + _WaterHeightDistanceCulling: 0 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &820576533209771957 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 400367776216104282} + - component: {fileID: 1809806125488598340} + - component: {fileID: 6974069512929315691} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &400367776216104282 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820576533209771957} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.25, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 5, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7510205674214501026} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1809806125488598340 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820576533209771957} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6974069512929315691 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820576533209771957} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1045345610825241572 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7995128781084985873} + - component: {fileID: 3607673093136510341} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7995128781084985873 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1045345610825241572} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.51724136, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1723958554013126548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3607673093136510341 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1045345610825241572} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &1206480192614866284 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2466847559837504906} + - component: {fileID: 5026345690564488943} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2466847559837504906 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1206480192614866284} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.862069, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3892724689903558712} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5026345690564488943 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1206480192614866284} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &1378505291112725813 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1104104952597646128} + - component: {fileID: 6815696415028053429} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1104104952597646128 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1378505291112725813} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.17241377, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1723958554013126548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6815696415028053429 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1378505291112725813} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &1427589541763392806 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6852310033111569586} + m_Layer: 0 + m_Name: Boats_BoatScene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6852310033111569586 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1427589541763392806} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7125992986799510647} + - {fileID: 2983559810032803670} + - {fileID: 1171287903743493598} + - {fileID: 1858204714668369909} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1843178392891338198 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3892724689903558712} + - component: {fileID: 2697762350631023093} + - component: {fileID: 2212784003301480797} + - component: {fileID: 7431243963398625099} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3892724689903558712 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843178392891338198} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 2.9, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2466847559837504906} + - {fileID: 5754499724867864064} + - {fileID: 680900771833511952} + - {fileID: 8090670239111763498} + - {fileID: 6415748434813489669} + - {fileID: 7908827383684285303} + m_Father: {fileID: 3621650881387848085} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} +--- !u!33 &2697762350631023093 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843178392891338198} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2212784003301480797 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843178392891338198} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &7431243963398625099 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843178392891338198} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &1881613067762504182 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6889079988869669729} + - component: {fileID: 116167780343262239} + - component: {fileID: 1858663400055815152} + - component: {fileID: 2418430584346868151} + - component: {fileID: 6233985589516183238} + - component: {fileID: 593305678042839599} + m_Layer: 0 + m_Name: Floating Object + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6889079988869669729 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881613067762504182} + serializedVersion: 2 + m_LocalRotation: {x: 0.29674196, y: -0.48152652, z: 0.10358026, w: 0.81813663} + m_LocalPosition: {x: -3.4, y: 0, z: 4} + m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1858204714668369909} + m_LocalEulerAnglesHint: {x: 35.824, y: -63.629, z: -8.246} +--- !u!33 &116167780343262239 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881613067762504182} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1858663400055815152 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881613067762504182} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &2418430584346868151 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881613067762504182} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!54 &6233985589516183238 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881613067762504182} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &593305678042839599 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881613067762504182} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eba37e6f7ba7a4a488c7831f45a078b2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _RigidBody: {fileID: 0} + _Model: 0 + _Layer: 1 + _BuoyancyForceStrength: 3 + _BuoyancyTorqueStrength: 8 + _MaximumBuoyancyForce: Infinity + _CenterToBottomOffset: -1 + _AccelerateDownhill: 0 + _Probes: [] + _Drag: {x: 2, y: 3, z: 1} + _AngularDrag: 0.2 + _ForceHeightOffset: 0 + _ObjectWidth: 3 + _UseObjectLength: 0 + _ObjectLength: 3 + _Debug: + _DrawQueries: 0 +--- !u!1 &2192150221325140045 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 671248675658142729} + - component: {fileID: 5383168895242455525} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &671248675658142729 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2192150221325140045} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.5172414, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7048914220628107569} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5383168895242455525 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2192150221325140045} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &2202567958684207806 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5754499724867864064} + - component: {fileID: 5687268933594254831} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5754499724867864064 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2202567958684207806} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5172416, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3892724689903558712} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5687268933594254831 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2202567958684207806} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &2276880585651166123 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2128158282063340194} + - component: {fileID: 5451612068166675287} + - component: {fileID: 1187564077497833059} + m_Layer: 0 + m_Name: Open Container + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2128158282063340194 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2276880585651166123} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 104.2, y: 0, z: -109.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8486778599265021502} + m_Father: {fileID: 1858204714668369909} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &5451612068166675287 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2276880585651166123} + serializedVersion: 4 + m_Mass: 1000 + m_Drag: 0 + m_AngularDrag: 1.5 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &1187564077497833059 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2276880585651166123} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eba37e6f7ba7a4a488c7831f45a078b2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _RigidBody: {fileID: 5451612068166675287} + _Model: 0 + _Layer: 1 + _BuoyancyForceStrength: 7 + _BuoyancyTorqueStrength: 1 + _MaximumBuoyancyForce: Infinity + _CenterToBottomOffset: -1 + _AccelerateDownhill: 0 + _Probes: [] + _Drag: {x: 2, y: 3, z: 1} + _AngularDrag: 0.2 + _ForceHeightOffset: 0 + _ObjectWidth: 3 + _UseObjectLength: 0 + _ObjectLength: 3 + _Debug: + _DrawQueries: 0 +--- !u!1 &2721324893641125790 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3621650881387848085} + - component: {fileID: 5219546841131633790} + m_Layer: 0 + m_Name: Spinner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3621650881387848085 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2721324893641125790} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 10.9, y: 0, z: -23.5} + m_LocalScale: {x: 4, y: 4, z: 4} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1723958554013126548} + - {fileID: 7048914220628107569} + - {fileID: 3892724689903558712} + m_Father: {fileID: 1858204714668369909} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5219546841131633790 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2721324893641125790} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e67c8b7e3e4e04c46b61963b7c204049, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Axis: {x: 0, y: 1, z: 0} + _Amplitude: 0 + _Frequency: 1 + _OrthogonalMotion: 0 + _RotationFrequency: 1 + _RotationVelocity: 100 +--- !u!1 &2816999131764084598 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3515850158997807284} + - component: {fileID: 1941610653028489933} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3515850158997807284 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2816999131764084598} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.862069, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7048914220628107569} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1941610653028489933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2816999131764084598} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3099867633458282823 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5980899437414904189} + - component: {fileID: 2950730437040094418} + - component: {fileID: 4001420615843909709} + - component: {fileID: 3766056023456898569} + m_Layer: 0 + m_Name: Wave Particle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!4 &5980899437414904189 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3099867633458282823} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 39.7, y: 0, z: 6.5} + m_LocalScale: {x: 36, y: 36, z: 36} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1171287903743493598} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &2950730437040094418 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3099867633458282823} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4001420615843909709 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3099867633458282823} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 80058df675809418c8cc68aa9c770d13, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &3766056023456898569 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3099867633458282823} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d64d1f50f3b548bcbe279507f0e78da, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 162836781179600911 + _DrawBounds: 0 + _DisplacementPass: 1 + _FilterByWavelength: 0 + _OctaveWavelength: 11 + _MaximumDisplacementVertical: 5.5 + _MaximumDisplacementHorizontal: 0 + _ReportRendererBounds: 0 + _Version: 1 + _RenderPostCombine: 1 + references: + version: 2 + RefIds: + - rid: 162836781179600911 + type: {class: AnimatedWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 3766056023456898569} + _Renderer: {fileID: 4001420615843909709} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1 &3222425953409788435 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 996034502518883789} + - component: {fileID: 4370556757814677058} + - component: {fileID: 1472868047847528257} + - component: {fileID: 2227448411089352966} + - component: {fileID: 6012860975079108483} + - component: {fileID: 5962315847646101748} + m_Layer: 0 + m_Name: Animated Object + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &996034502518883789 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3222425953409788435} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 35.3, y: -2, z: -13.7} + m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1858204714668369909} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4370556757814677058 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3222425953409788435} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1472868047847528257 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3222425953409788435} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &2227448411089352966 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3222425953409788435} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &6012860975079108483 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3222425953409788435} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e67c8b7e3e4e04c46b61963b7c204049, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Axis: {x: 0, y: 0, z: 1} + _Amplitude: 10 + _Frequency: 1 + _OrthogonalMotion: 1 + _RotationFrequency: 1 + _RotationVelocity: 0 +--- !u!114 &5962315847646101748 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3222425953409788435} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 1 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3240624095945761966 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7379105659903475986} + - component: {fileID: 437259974358298521} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7379105659903475986 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3240624095945761966} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.17241383, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7048914220628107569} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &437259974358298521 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3240624095945761966} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3268126830476160423 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6604047126589733223} + - component: {fileID: 5490896284178104416} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6604047126589733223 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3268126830476160423} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.86206883, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1723958554013126548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5490896284178104416 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3268126830476160423} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3273295414032881957 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4190376389019131971} + - component: {fileID: 839102077705189316} + m_Layer: 0 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4190376389019131971 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3273295414032881957} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 5, y: 5, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7510205674214501026} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &839102077705189316 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3273295414032881957} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &3390359604264235364 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1171287903743493598} + - component: {fileID: 4630600876798402635} + m_Layer: 0 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1171287903743493598 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3390359604264235364} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6032088585867314841} + - {fileID: 5980899437414904189} + - {fileID: 3968172323667147081} + - {fileID: 5635713696044972408} + m_Father: {fileID: 6852310033111569586} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4630600876798402635 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3390359604264235364} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e64c239f69eea46778ded6dcc3427a34, type: 3} + m_Name: + m_EditorClassIdentifier: + _Layer: 4 + _Material: {fileID: 2100000, guid: 8ab064b6606504a55b489af2787350c2, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Version: 1 + _Camera: {fileID: 0} + _TimeProvider: {fileID: 0} + _WindZone: {fileID: 0} + _OverrideWindZoneWindSpeed: 0 + _WindSpeed: 150 + _OverrideWindZoneWindDirection: 0 + _WindDirection: 0 + _OverrideWindZoneWindTurbulence: 0 + _WindTurbulence: 0.145 + _OverrideGravity: 0 + _GravityOverride: -9.8 + _GravityMultiplier: 1 + _PrimaryLight: {fileID: 0} + _InjectionPoint: 0 + _WriteToColorTexture: 1 + _WriteToDepthTexture: 1 + _WriteMotionVectors: 1 + _OverrideRenderHDR: 0 + _RenderHDR: 1 + _Surface: + rid: 1002 + _ScaleRange: {x: 4, y: 256} + _DropDetailHeightBasedOnWaves: 0.2 + _Slices: 7 + _Resolution: 384 + _GeometryDownSampleFactor: 2 + _ExtentsSizeMultiplier: 100 + _Viewpoint: {fileID: 0} + _CenterOfDetailDisplacementCorrection: 1 + _SampleTerrainHeightForScale: 1 + _ForceScaleChangeSmoothing: 0 + _TeleportThreshold: 10 + _AnimatedWavesLod: + rid: 162836781179600896 + _DepthLod: + rid: 162836781179600897 + _LevelLod: + rid: 162836781179600898 + _FoamLod: + rid: 162836781179600899 + _DynamicWavesLod: + rid: 162836781179600900 + _FlowLod: + rid: 162836781179600901 + _ShadowLod: + rid: 162836781179600902 + _AbsorptionLod: + rid: 1000 + _ScatteringLod: + rid: 1001 + _ClipLod: + rid: 162836781179600903 + _AlbedoLod: + rid: 162836781179600904 + _Reflections: + rid: 162836781179600905 + _Underwater: + rid: 162836781179600906 + _Meniscus: + rid: 1003 + _Portals: + rid: 162836781179600907 + _ShowWaterProxyPlane: 0 + _EditModeFrameRate: 30 + _FollowSceneCamera: 1 + _HeightQueries: 1 + _Debug: + _AttachDebugGUI: 0 + _ShowHiddenObjects: 0 + _DisableFollowViewpoint: 0 + _DestroyResourcesInOnDisable: 0 + _DrawLodOutline: 0 + _ShowDebugInformation: 0 + _LogScaleChange: 0 + _PauseOnScaleChange: 0 + _IgnoreWavesForScaleChange: 0 + _ForceNoGraphics: 0 + _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + references: + version: 2 + RefIds: + - rid: 1000 + type: {class: AbsorptionLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 7 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 1.026, g: 2.085, b: 2.5500002, a: 0.306} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1001 + type: {class: ScatteringLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 23 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 0, g: 0.588, b: 1.2, a: 6} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1002 + type: {class: SurfaceRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 8ab064b6606504a55b489af2787350c2, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Debug: + _UniformTiles: 0 + _DisableSkirt: 0 + - rid: 1003 + type: {class: Meniscus, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 238e45299a5ec46308e9bf99ddf67963, type: 2} + - rid: 162836781179600896 + type: {class: AnimatedWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 48 + _WaveResolutionMultiplier: 1 + _AttenuationInShallows: 0.95 + _ShallowsMaximumDepth: 1000 + _CollisionSource: 2 + _CollisionLayers: -1 + _MaximumQueryCount: 4096 + _BakedWaveData: {fileID: 0} + - rid: 162836781179600897 + type: {class: DepthLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 46 + _IncludeTerrainHeight: 0 + _EnableSignedDistanceFields: 1 + - rid: 162836781179600898 + type: {class: LevelLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 300 + _TextureFormat: 45 + - rid: 162836781179600899 + type: {class: FoamLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 45 + _SimulationFrequency: 30 + _Prewarm: 1 + _Settings: {fileID: 11400000, guid: 01b6d2d72f0e04b0abc7d62cfc8b5355, type: 2} + - rid: 162836781179600900 + type: {class: DynamicWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 512 + _TextureFormatMode: 300 + _TextureFormat: 46 + _SimulationFrequency: 120 + _AttenuationInShallows: 1 + _Settings: {fileID: 11400000, guid: 97eb5eccada85449e9c98d91709b5f74, type: 2} + - rid: 162836781179600901 + type: {class: FlowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 128 + _TextureFormatMode: 100 + _TextureFormat: 46 + - rid: 162836781179600902 + type: {class: ShadowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 6 + _SimulationFrequency: 60 + _DynamicSoftShadows: 1 + _SoftJitterExtinctionFactor: 0.75 + _JitterDiameterSoft: 15 + _CurrentFrameWeightSoft: 0.03 + _JitterDiameterHard: 0.6 + _CurrentFrameWeightHard: 0.15 + _AllowNullLight: 0 + _AllowNoShadows: 0 + - rid: 162836781179600903 + type: {class: ClipLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 5 + _DefaultClippingState: 0 + - rid: 162836781179600904 + type: {class: AlbedoLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 768 + _TextureFormatMode: 100 + _TextureFormat: 8 + - rid: 162836781179600905 + type: {class: WaterReflections, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 0 + _Mode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 1 + _Resolution: 256 + _RenderOnlySingleCamera: 0 + _Sky: 0 + _DisablePixelLights: 1 + _DisableShadows: 1 + _HDR: 1 + _Stencil: 0 + _AllowMSAA: 0 + _QualitySettingsOverride: + _OverrideLodBias: 0 + _LodBias: Infinity + _OverrideMaximumLodLevel: 0 + _MaximumLodLevel: 1 + _OverrideTerrainPixelError: 0 + _TerrainPixelError: 10 + _ClipPlaneOffset: 0 + _FarClipPlane: 1000 + _DisableOcclusionCulling: 1 + _RefreshPerFrames: 1 + _FrameRefreshOffset: 0 + _UseObliqueMatrix: 1 + _NonObliqueNearSurface: 0 + _NonObliqueNearSurfaceThreshold: 0.05 + _Debug: + _ShowHiddenObjects: 0 + _DisableRecursiveRendering: 0 + - rid: 162836781179600906 + type: {class: UnderwaterRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: f2b096e4d95e646c49d48ece0afa0547, type: 2} + _EnvironmentalLightingEnable: 0 + _EnvironmentalLightingWeight: 1 + _EnvironmentalLightingVolumeProfile: {fileID: 0} + _AllCameras: 0 + _CopyWaterMaterialParametersEachFrame: 1 + _FarPlaneMultiplier: 0.68 + _CullLimit: 0.001 + _Debug: + _VisualizeMask: 0 + _DisableMask: 0 + _VisualizeStencil: 0 + _DisableHeightAboveWaterOptimization: 0 + _DisableArtifactCorrection: 0 + _OnlyReflectionCameras: 0 + - rid: 162836781179600907 + type: {class: PortalRenderer, ns: WaveHarmonic.Crest.Portals, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _Mode: 2 + _Geometry: {fileID: 0} + _Invert: 0 +--- !u!1 &3576324786297675206 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 616877857402367063} + - component: {fileID: 2601810710299904230} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &616877857402367063 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3576324786297675206} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.17241383, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7048914220628107569} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2601810710299904230 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3576324786297675206} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3917641867652737502 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8090670239111763498} + - component: {fileID: 1845065616768916179} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8090670239111763498 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3917641867652737502} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.1724138, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3892724689903558712} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1845065616768916179 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3917641867652737502} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &4147972531259541783 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7048914220628107569} + - component: {fileID: 3596642668807943528} + - component: {fileID: 7339559918913296959} + - component: {fileID: 8153915366555601323} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7048914220628107569 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4147972531259541783} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 2.9, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3515850158997807284} + - {fileID: 7324807244766591466} + - {fileID: 616877857402367063} + - {fileID: 7379105659903475986} + - {fileID: 671248675658142729} + - {fileID: 7053438766487089175} + m_Father: {fileID: 3621650881387848085} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!33 &3596642668807943528 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4147972531259541783} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7339559918913296959 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4147972531259541783} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &8153915366555601323 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4147972531259541783} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &4356199968453365679 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6032088585867314841} + - component: {fileID: 1766414488390050390} + m_Layer: 0 + m_Name: Waves + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6032088585867314841 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4356199968453365679} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1171287903743493598} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1766414488390050390 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4356199968453365679} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 5 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: 4fde516347f8f410cb7bf7ec2b66c163, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 0 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.145 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &4417722864988766079 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1723958554013126548} + - component: {fileID: 669368143199697366} + - component: {fileID: 7865181549912506541} + - component: {fileID: 7023400246185249663} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1723958554013126548 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4417722864988766079} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 2.9, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6604047126589733223} + - {fileID: 1592437480570374672} + - {fileID: 7546771024349476122} + - {fileID: 7995128781084985873} + - {fileID: 1104104952597646128} + - {fileID: 6397010901601026565} + m_Father: {fileID: 3621650881387848085} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &669368143199697366 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4417722864988766079} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7865181549912506541 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4417722864988766079} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &7023400246185249663 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4417722864988766079} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &5280154092048975035 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1858204714668369909} + m_Layer: 0 + m_Name: Objects + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1858204714668369909 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5280154092048975035} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8063069271912496830} + - {fileID: 409871377063997656} + - {fileID: 7138845213044378491} + - {fileID: 6889079988869669729} + - {fileID: 996034502518883789} + - {fileID: 3621650881387848085} + - {fileID: 2128158282063340194} + m_Father: {fileID: 6852310033111569586} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5299786828699061102 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7053438766487089175} + - component: {fileID: 6147083366992240572} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7053438766487089175 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5299786828699061102} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.862069, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7048914220628107569} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6147083366992240572 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5299786828699061102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &6117207620980339788 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7127307760713061867} + - component: {fileID: 271825327687063954} + - component: {fileID: 3006457731079277873} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7127307760713061867 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6117207620980339788} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.25, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 5, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7510205674214501026} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &271825327687063954 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6117207620980339788} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &3006457731079277873 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6117207620980339788} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &6315107126400850527 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2983559810032803670} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2983559810032803670 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6315107126400850527} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 7178022086296940611} + - {fileID: 7210877153105205153} + - {fileID: 3769564076674209257} + m_Father: {fileID: 6852310033111569586} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6441011933310197421 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6397010901601026565} + - component: {fileID: 8036716668665673872} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6397010901601026565 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6441011933310197421} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.17241377, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1723958554013126548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8036716668665673872 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6441011933310197421} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &6794630884304521221 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 680900771833511952} + - component: {fileID: 9017722573816939494} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &680900771833511952 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6794630884304521221} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.1724138, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3892724689903558712} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &9017722573816939494 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6794630884304521221} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &6868367054856889658 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5635713696044972408} + - component: {fileID: 2128651512409030102} + m_Layer: 0 + m_Name: Set Water Height + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5635713696044972408 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6868367054856889658} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 196, y: -13, z: -115} + m_LocalScale: {x: 100, y: 100, z: 100} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1171287903743493598} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &2128651512409030102 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6868367054856889658} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4edd034314af4679ba066d79580dc1d, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 7 + _Weight: 1 + _Queue: 0 + _Blend: 0 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 1790563051476091040 + _DrawBounds: 0 + _OverrideHeight: 0 + _HeightRange: {x: -100, y: 100} + _Version: 1 + references: + version: 2 + RefIds: + - rid: 1790563051476091040 + type: {class: LevelGeometryLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 2128651512409030102} + _Geometry: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &7037259033703674994 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5063239821410350522} + - component: {fileID: 4335503686349249842} + - component: {fileID: 4391996938505590963} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5063239821410350522 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7037259033703674994} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 4.75} + m_LocalScale: {x: 5, y: 5, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7510205674214501026} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4335503686349249842 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7037259033703674994} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4391996938505590963 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7037259033703674994} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &7709088517995504856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5257000737416208092} + - component: {fileID: 7648854513551070687} + - component: {fileID: 8552571828903192823} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5257000737416208092 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7709088517995504856} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -2.25, z: 0} + m_LocalScale: {x: 5, y: 0.5, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7510205674214501026} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7648854513551070687 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7709088517995504856} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8552571828903192823 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7709088517995504856} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &7737089923940668818 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7125992986799510647} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7125992986799510647 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7737089923940668818} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 57879957050890245} + - {fileID: 6462723379690648530} + m_Father: {fileID: 6852310033111569586} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7811732493831698289 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6415748434813489669} + - component: {fileID: 3736714621935328851} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6415748434813489669 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7811732493831698289} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.51724154, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3892724689903558712} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3736714621935328851 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7811732493831698289} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &7972416914477878933 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3165803516736325573} + m_Layer: 0 + m_Name: Attachments + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3165803516736325573 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7972416914477878933} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6783273435874499886} + - {fileID: 5352818857462300272} + m_Father: {fileID: 8486778599265021502} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8086364348780568192 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7510205674214501026} + m_Layer: 0 + m_Name: Box + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7510205674214501026 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8086364348780568192} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4190376389019131971} + - {fileID: 7127307760713061867} + - {fileID: 400367776216104282} + - {fileID: 5063239821410350522} + - {fileID: 9022376035852753702} + - {fileID: 5257000737416208092} + - {fileID: 3926999345176316209} + m_Father: {fileID: 8486778599265021502} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8243802514550712268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3968172323667147081} + - component: {fileID: 8316348047750523354} + - component: {fileID: 8591667271796193603} + - component: {fileID: 5496405015140427606} + m_Layer: 0 + m_Name: Push Water Below Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3968172323667147081 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8243802514550712268} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 19.9, y: 17.8, z: -87.6} + m_LocalScale: {x: 82.89557, y: 82.89557, z: 82.89557} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1171287903743493598} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8316348047750523354 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8243802514550712268} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8591667271796193603 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8243802514550712268} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: fbe311c1027b04a3d8401654d4a9d72f, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &5496405015140427606 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8243802514550712268} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d64d1f50f3b548bcbe279507f0e78da, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 162836781179600908 + _DrawBounds: 0 + _DisplacementPass: 1 + _FilterByWavelength: 0 + _OctaveWavelength: 0 + _MaximumDisplacementVertical: 0 + _MaximumDisplacementHorizontal: 0 + _ReportRendererBounds: 0 + _Version: 1 + _RenderPostCombine: 1 + references: + version: 2 + RefIds: + - rid: 162836781179600908 + type: {class: AnimatedWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 5496405015140427606} + _Renderer: {fileID: 8591667271796193603} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1 &8365182390949711213 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9022376035852753702} + - component: {fileID: 8868514895751324453} + - component: {fileID: 4339976582062167103} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9022376035852753702 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8365182390949711213} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -4.75} + m_LocalScale: {x: 5, y: 5, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7510205674214501026} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8868514895751324453 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8365182390949711213} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4339976582062167103 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8365182390949711213} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &8625622067702060755 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7324807244766591466} + - component: {fileID: 2704616905265537170} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7324807244766591466 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8625622067702060755} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5172414, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7048914220628107569} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2704616905265537170 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8625622067702060755} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &8707134337766202188 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7546771024349476122} + - component: {fileID: 5524038172308984529} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7546771024349476122 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8707134337766202188} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.86206883, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1723958554013126548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5524038172308984529 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8707134337766202188} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &9075768718047502216 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1592437480570374672} + - component: {fileID: 8440990443979326373} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1592437480570374672 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9075768718047502216} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.51724136, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1723958554013126548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8440990443979326373 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9075768718047502216} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &9138608807978546511 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5352818857462300272} + - component: {fileID: 1933694569782438319} + - component: {fileID: 5617108192058471187} + - component: {fileID: 6922805665282167854} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5352818857462300272 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9138608807978546511} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: -3, y: 0, z: 0} + m_LocalScale: {x: 1, y: 5, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3165803516736325573} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!33 &1933694569782438319 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9138608807978546511} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5617108192058471187 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9138608807978546511} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &6922805665282167854 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9138608807978546511} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.50000024 + m_Height: 2.0000005 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940699} +--- !u!1001 &414132739731084710 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1858204714668369909} + m_Modifications: + - target: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_Name + value: Boat (Player) + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.x + value: -14.2 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.z + value: 14.13 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.w + value: 0.449241 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.y + value: 0.8934106 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 126.61 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + insertIndex: -1 + addedObject: {fileID: 2366402809176065510} + m_SourcePrefab: {fileID: 100100000, guid: 40b143bc273314da29022a07899ee9da, type: 3} +--- !u!4 &409871377063997656 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 414132739731084710} + m_PrefabAsset: {fileID: 0} +--- !u!4 &409938597673359554 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4274299234749796, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 414132739731084710} + m_PrefabAsset: {fileID: 0} +--- !u!1 &412549809687038448 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 414132739731084710} + m_PrefabAsset: {fileID: 0} +--- !u!114 &2366402809176065510 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 412549809687038448} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 00270ad31891444bcb3fa64c9df57571, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _DriveForward: 37 + _DriveBackward: 33 + _SteerLeftward: 15 + _SteerRightward: 18 + _FloatUpward: 19 + _FloatDownward: 31 + _DriveInputAxis: Vertical + _SteerInputAxis: Horizontal + _FloatUpwards: 101 + _FloatDownwards: 113 + _Submersible: 0 +--- !u!1001 &2505209658683894217 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7125992986799510647} + m_Modifications: + - target: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_Name + value: Camera + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.x + value: -31.31 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.y + value: 2.32 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.z + value: 24.13 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.70710677 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8684350033661323091} + m_SourcePrefab: {fileID: 100100000, guid: c26fe2b4fef6c484089497b549dd6b04, type: 3} +--- !u!1 &57879957050890242 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 2505209658683894217} + m_PrefabAsset: {fileID: 0} +--- !u!114 &8684350033661323091 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 57879957050890242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a8eca7a783ef84759a4e965c9d6d8827, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ExecuteUpdateEvery: 0 + _StopExecutingUpdateAfter: Infinity + _OnEnable: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 188068815630709660} + m_TargetAssemblyTypeName: WaveHarmonic.Crest.Examples.LerpCam, WaveHarmonic.Crest.Samples + m_MethodName: set_Target + m_Mode: 2 + m_Arguments: + m_ObjectArgument: {fileID: 409938597673359554} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Transform, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 188068815630709660} + m_TargetAssemblyTypeName: WaveHarmonic.Crest.Examples.LerpCam, WaveHarmonic.Crest.Samples + m_MethodName: set_LookAt + m_Mode: 2 + m_Arguments: + m_ObjectArgument: {fileID: 409871377063997656} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Transform, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 188068815630709660} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 8707758115798251395} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + _OnDisable: + m_PersistentCalls: + m_Calls: [] + _OnUpdate: + m_PersistentCalls: + m_Calls: [] + _OnLegacyRenderPipeline: + m_PersistentCalls: + m_Calls: [] + _OnHighDefinitionPipeline: + m_PersistentCalls: + m_Calls: [] + _OnUniversalRenderPipeline: + m_PersistentCalls: + m_Calls: [] +--- !u!4 &57879957050890245 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 2505209658683894217} + m_PrefabAsset: {fileID: 0} +--- !u!114 &188068815630709660 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2330733195991194197, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 2505209658683894217} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 57879957050890242} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7c0bccaa30631446891d9da26fb6bfec, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &8707758115798251395 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6493171654625517130, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 2505209658683894217} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 57879957050890242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1ffaccddaf6fd4ef0bacf218202412e8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &2640489010772149149 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7125992986799510647} + m_Modifications: + - target: {fileID: 6079220456006713144, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_Name + value: Post-Processing + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5e01cffb9e8324147affb8e08fd5ed13, type: 3} +--- !u!4 &6462723379690648530 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + m_PrefabInstance: {fileID: 2640489010772149149} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7134557662055009759 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1858204714668369909} + m_Modifications: + - target: {fileID: 1371779553471058, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_Name + value: Boat Probes + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalPosition.x + value: 49.3 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalPosition.z + value: -21.3 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1371779553471058, guid: e5ae8aebf92c54902819a765cdde29d1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6755089930514639205} + m_SourcePrefab: {fileID: 100100000, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} +--- !u!1 &7135907176486938509 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1371779553471058, guid: e5ae8aebf92c54902819a765cdde29d1, + type: 3} + m_PrefabInstance: {fileID: 7134557662055009759} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6755089930514639205 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7135907176486938509} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0773b7cb9424ddb87749b40d94c1ce, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Move: 1 + _Turn: 1 +--- !u!4 &7138845213044378491 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, + type: 3} + m_PrefabInstance: {fileID: 7134557662055009759} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7487978905625948915 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2983559810032803670} + m_Modifications: + - target: {fileID: 963553959586484309, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_Name + value: Lighting + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bece9afbf3ddd49059dd73ba2cc986f6, type: 3} +--- !u!4 &3769564076674209257 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + m_PrefabInstance: {fileID: 7487978905625948915} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8064445655647394752 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1858204714668369909} + m_Modifications: + - target: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_Name + value: Boat (Forced) + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.x + value: -6.2 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.z + value: 24.9 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.w + value: 0.449241 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.y + value: 0.8934106 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 126.61 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + insertIndex: -1 + addedObject: {fileID: 7848150221165996526} + m_SourcePrefab: {fileID: 100100000, guid: 40b143bc273314da29022a07899ee9da, type: 3} +--- !u!4 &8063069271912496830 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 8064445655647394752} + m_PrefabAsset: {fileID: 0} +--- !u!1 &8064903278456260502 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 8064445655647394752} + m_PrefabAsset: {fileID: 0} +--- !u!114 &7848150221165996526 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8064903278456260502} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0773b7cb9424ddb87749b40d94c1ce, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Move: 1 + _Turn: 0.8 +--- !u!1001 &8139707096666703564 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2983559810032803670} + m_Modifications: + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.68926716 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.2855038 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.61519444 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.25482187 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5304508333967466499, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_Name + value: Sun + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.w + value: 8.8530536e+24 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.x + value: 1e-45 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.y + value: 8.8530536e+24 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.z + value: 1e-45 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 774ab582b39374a7e9d5dac8e31b9a5a, type: 3} +--- !u!4 &7178022086296940611 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + m_PrefabInstance: {fileID: 8139707096666703564} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8906683963972511845 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2983559810032803670} + m_Modifications: + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2942909709672342223, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_Name + value: Atmosphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63a4b7e65d06948649ac3e10077d8c2e, type: 3} +--- !u!4 &7210877153105205153 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + m_PrefabInstance: {fileID: 8906683963972511845} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatScene.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatScene.prefab.meta new file mode 100644 index 0000000..07c586d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatScene.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f56bf99bb225486c996f58f9288c20f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatsScene.prefab b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatsScene.prefab new file mode 100644 index 0000000..884ef5f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatsScene.prefab @@ -0,0 +1,1405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2813623345015063601 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2826614106350488870} + - component: {fileID: 5093046347935664451} + m_Layer: 0 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2826614106350488870 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2813623345015063601} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3333966355713744998} + m_Father: {fileID: 6866301169458832456} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5093046347935664451 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2813623345015063601} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e64c239f69eea46778ded6dcc3427a34, type: 3} + m_Name: + m_EditorClassIdentifier: + _Layer: 4 + _Material: {fileID: 2100000, guid: 8ab064b6606504a55b489af2787350c2, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Version: 1 + _Camera: {fileID: 0} + _TimeProvider: {fileID: 0} + _WindZone: {fileID: 0} + _OverrideWindZoneWindSpeed: 0 + _WindSpeed: 150 + _OverrideWindZoneWindDirection: 0 + _WindDirection: 0 + _OverrideWindZoneWindTurbulence: 0 + _WindTurbulence: 0.145 + _OverrideGravity: 0 + _GravityOverride: -9.8 + _GravityMultiplier: 1 + _PrimaryLight: {fileID: 0} + _InjectionPoint: 0 + _WriteToColorTexture: 1 + _WriteToDepthTexture: 1 + _WriteMotionVectors: 1 + _OverrideRenderHDR: 0 + _RenderHDR: 1 + _Surface: + rid: 1002 + _ScaleRange: {x: 4, y: 256} + _DropDetailHeightBasedOnWaves: 0.2 + _Slices: 7 + _Resolution: 384 + _GeometryDownSampleFactor: 2 + _ExtentsSizeMultiplier: 100 + _Viewpoint: {fileID: 0} + _CenterOfDetailDisplacementCorrection: 1 + _SampleTerrainHeightForScale: 1 + _ForceScaleChangeSmoothing: 0 + _TeleportThreshold: 10 + _AnimatedWavesLod: + rid: 162836781179600912 + _DepthLod: + rid: 162836781179600913 + _LevelLod: + rid: 162836781179600914 + _FoamLod: + rid: 162836781179600915 + _DynamicWavesLod: + rid: 162836781179600916 + _FlowLod: + rid: 162836781179600917 + _ShadowLod: + rid: 162836781179600918 + _AbsorptionLod: + rid: 1000 + _ScatteringLod: + rid: 1001 + _ClipLod: + rid: 162836781179600919 + _AlbedoLod: + rid: 162836781179600920 + _Reflections: + rid: 162836781179600921 + _Underwater: + rid: 162836781179600922 + _Meniscus: + rid: 1003 + _Portals: + rid: 162836781179600923 + _ShowWaterProxyPlane: 0 + _EditModeFrameRate: 30 + _FollowSceneCamera: 1 + _HeightQueries: 1 + _Debug: + _AttachDebugGUI: 0 + _ShowHiddenObjects: 0 + _DisableFollowViewpoint: 0 + _DestroyResourcesInOnDisable: 0 + _DrawLodOutline: 0 + _ShowDebugInformation: 0 + _LogScaleChange: 0 + _PauseOnScaleChange: 0 + _IgnoreWavesForScaleChange: 0 + _ForceNoGraphics: 0 + _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + references: + version: 2 + RefIds: + - rid: 1000 + type: {class: AbsorptionLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 7 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 1.026, g: 2.085, b: 2.5500002, a: 0.306} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1001 + type: {class: ScatteringLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 23 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 0, g: 0.588, b: 1.2, a: 6} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1002 + type: {class: SurfaceRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 8ab064b6606504a55b489af2787350c2, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Debug: + _UniformTiles: 0 + _DisableSkirt: 0 + - rid: 1003 + type: {class: Meniscus, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 238e45299a5ec46308e9bf99ddf67963, type: 2} + - rid: 162836781179600912 + type: {class: AnimatedWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 48 + _WaveResolutionMultiplier: 1 + _AttenuationInShallows: 0.95 + _ShallowsMaximumDepth: 1000 + _CollisionSource: 2 + _CollisionLayers: -1 + _MaximumQueryCount: 4096 + _BakedWaveData: {fileID: 0} + - rid: 162836781179600913 + type: {class: DepthLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 46 + _IncludeTerrainHeight: 0 + _EnableSignedDistanceFields: 1 + - rid: 162836781179600914 + type: {class: LevelLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 300 + _TextureFormat: 45 + - rid: 162836781179600915 + type: {class: FoamLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 45 + _SimulationFrequency: 30 + _Prewarm: 1 + _Settings: {fileID: 11400000, guid: 01b6d2d72f0e04b0abc7d62cfc8b5355, type: 2} + - rid: 162836781179600916 + type: {class: DynamicWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 512 + _TextureFormatMode: 300 + _TextureFormat: 46 + _SimulationFrequency: 120 + _AttenuationInShallows: 1 + _Settings: {fileID: 11400000, guid: 97eb5eccada85449e9c98d91709b5f74, type: 2} + - rid: 162836781179600917 + type: {class: FlowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 128 + _TextureFormatMode: 100 + _TextureFormat: 46 + - rid: 162836781179600918 + type: {class: ShadowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 6 + _SimulationFrequency: 60 + _DynamicSoftShadows: 1 + _SoftJitterExtinctionFactor: 0.75 + _JitterDiameterSoft: 15 + _CurrentFrameWeightSoft: 0.03 + _JitterDiameterHard: 0.6 + _CurrentFrameWeightHard: 0.15 + _AllowNullLight: 0 + _AllowNoShadows: 0 + - rid: 162836781179600919 + type: {class: ClipLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 5 + _DefaultClippingState: 0 + - rid: 162836781179600920 + type: {class: AlbedoLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 768 + _TextureFormatMode: 100 + _TextureFormat: 8 + - rid: 162836781179600921 + type: {class: WaterReflections, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 0 + _Mode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 1 + _Resolution: 256 + _RenderOnlySingleCamera: 0 + _Sky: 0 + _DisablePixelLights: 1 + _DisableShadows: 1 + _HDR: 1 + _Stencil: 0 + _AllowMSAA: 0 + _QualitySettingsOverride: + _OverrideLodBias: 0 + _LodBias: Infinity + _OverrideMaximumLodLevel: 0 + _MaximumLodLevel: 1 + _OverrideTerrainPixelError: 0 + _TerrainPixelError: 10 + _ClipPlaneOffset: 0 + _FarClipPlane: 1000 + _DisableOcclusionCulling: 1 + _RefreshPerFrames: 1 + _FrameRefreshOffset: 0 + _UseObliqueMatrix: 1 + _NonObliqueNearSurface: 0 + _NonObliqueNearSurfaceThreshold: 0.05 + _Debug: + _ShowHiddenObjects: 0 + _DisableRecursiveRendering: 0 + - rid: 162836781179600922 + type: {class: UnderwaterRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: f2b096e4d95e646c49d48ece0afa0547, type: 2} + _EnvironmentalLightingEnable: 0 + _EnvironmentalLightingWeight: 1 + _EnvironmentalLightingVolumeProfile: {fileID: 0} + _AllCameras: 0 + _CopyWaterMaterialParametersEachFrame: 1 + _FarPlaneMultiplier: 0.68 + _CullLimit: 0.001 + _Debug: + _VisualizeMask: 0 + _DisableMask: 0 + _VisualizeStencil: 0 + _DisableHeightAboveWaterOptimization: 0 + _DisableArtifactCorrection: 0 + _OnlyReflectionCameras: 0 + - rid: 162836781179600923 + type: {class: PortalRenderer, ns: WaveHarmonic.Crest.Portals, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _Mode: 2 + _Geometry: {fileID: 0} + _Invert: 0 +--- !u!1 &3437938290840855108 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3333966355713744998} + - component: {fileID: 1934042227803624052} + m_Layer: 0 + m_Name: Waves + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3333966355713744998 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3437938290840855108} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2826614106350488870} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1934042227803624052 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3437938290840855108} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 5 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: 28a29b5ef0c644735b5d7ba47d2863d4, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 180 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 32 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.145 + _WindAlignment: 0 + _TimeLoopLength: 32 + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &4955621236796541404 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8502268477106537203} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8502268477106537203 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4955621236796541404} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 7588247899154469714} + - {fileID: 6912088328653614242} + - {fileID: 8328022133407810532} + m_Father: {fileID: 6866301169458832456} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5165285943062863725 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6866301169458832456} + m_Layer: 0 + m_Name: Boats_BoatsScene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6866301169458832456 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5165285943062863725} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1396767754596656607} + - {fileID: 8502268477106537203} + - {fileID: 2826614106350488870} + - {fileID: 3716576917091979191} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5412495051306547783 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3716576917091979191} + m_Layer: 0 + m_Name: Objects + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3716576917091979191 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5412495051306547783} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 768468011009276602} + - {fileID: 357942616878318578} + - {fileID: 7971536655091725388} + - {fileID: 4776048564658873584} + - {fileID: 3424438176737251140} + m_Father: {fileID: 6866301169458832456} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &9164766882155421075 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1396767754596656607} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1396767754596656607 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9164766882155421075} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 8054499747787377927} + - {fileID: 26477736572326577} + m_Father: {fileID: 6866301169458832456} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &358254669085648524 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 3716576917091979191} + m_Modifications: + - target: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_Name + value: BoatAlignNormal (1) + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.x + value: -6.2 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.z + value: 24.9 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.w + value: 0.449241 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.y + value: 0.8934106 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 126.61 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6152756422894563550} + m_SourcePrefab: {fileID: 100100000, guid: 40b143bc273314da29022a07899ee9da, type: 3} +--- !u!4 &357942616878318578 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 358254669085648524} + m_PrefabAsset: {fileID: 0} +--- !u!1 &359767818829527770 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 358254669085648524} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6152756422894563550 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 359767818829527770} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0773b7cb9424ddb87749b40d94c1ce, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Move: 1 + _Turn: 1 +--- !u!1001 &2317559042866914558 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8502268477106537203} + m_Modifications: + - target: {fileID: 963553959586484309, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_Name + value: Lighting + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bece9afbf3ddd49059dd73ba2cc986f6, type: 3} +--- !u!4 &8328022133407810532 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + m_PrefabInstance: {fileID: 2317559042866914558} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3429284277427325408 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 3716576917091979191} + m_Modifications: + - target: {fileID: 1371779553471058, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_Name + value: MediumBoat + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalPosition.x + value: 22.6 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalPosition.z + value: -50.5 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1371779553471058, guid: e5ae8aebf92c54902819a765cdde29d1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 522955970919966783} + m_SourcePrefab: {fileID: 100100000, guid: e5ae8aebf92c54902819a765cdde29d1, type: 3} +--- !u!4 &3424438176737251140 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4872491186423460, guid: e5ae8aebf92c54902819a765cdde29d1, + type: 3} + m_PrefabInstance: {fileID: 3429284277427325408} + m_PrefabAsset: {fileID: 0} +--- !u!1 &3428255547652957106 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1371779553471058, guid: e5ae8aebf92c54902819a765cdde29d1, + type: 3} + m_PrefabInstance: {fileID: 3429284277427325408} + m_PrefabAsset: {fileID: 0} +--- !u!114 &522955970919966783 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3428255547652957106} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0773b7cb9424ddb87749b40d94c1ce, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Move: 1 + _Turn: 1 +--- !u!1001 &4639939921621717862 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8502268477106537203} + m_Modifications: + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2942909709672342223, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_Name + value: Atmosphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63a4b7e65d06948649ac3e10077d8c2e, type: 3} +--- !u!4 &6912088328653614242 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + m_PrefabInstance: {fileID: 4639939921621717862} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &4776210950124044686 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 3716576917091979191} + m_Modifications: + - target: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_Name + value: BoatAlignNormal (3) + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.x + value: 25.7 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.z + value: 8.7 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.w + value: 0.449241 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.y + value: 0.8934106 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 126.61 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8026949252407526889} + m_SourcePrefab: {fileID: 100100000, guid: 40b143bc273314da29022a07899ee9da, type: 3} +--- !u!4 &4776048564658873584 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 4776210950124044686} + m_PrefabAsset: {fileID: 0} +--- !u!1 &4777864936106974680 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 4776210950124044686} + m_PrefabAsset: {fileID: 0} +--- !u!114 &8026949252407526889 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4777864936106974680} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0773b7cb9424ddb87749b40d94c1ce, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Move: 1 + _Turn: -0.7 +--- !u!1001 &5445559392483203293 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 3716576917091979191} + m_Modifications: + - target: {fileID: 4036194036648923335, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_Name + value: OceanLiner + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalPosition.x + value: 320 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalPosition.z + value: -317 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4036194036648923335, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6678757090335858545} + m_SourcePrefab: {fileID: 100100000, guid: 74c8f2f95ac074785be75df0fde34cdb, type: 3} +--- !u!4 &768468011009276602 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4699689828683719271, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + m_PrefabInstance: {fileID: 5445559392483203293} + m_PrefabAsset: {fileID: 0} +--- !u!1 &8327703805194045466 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4036194036648923335, guid: 74c8f2f95ac074785be75df0fde34cdb, + type: 3} + m_PrefabInstance: {fileID: 5445559392483203293} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6678757090335858545 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8327703805194045466} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0773b7cb9424ddb87749b40d94c1ce, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Move: 1 + _Turn: -0.4 +--- !u!1001 &5606629358963670219 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1396767754596656607} + m_Modifications: + - target: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_Name + value: Camera + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.x + value: -37.1 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.y + value: 9.94 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.73520315 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.0511765 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.6742806 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.046935763 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 12.047001 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 91 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c26fe2b4fef6c484089497b549dd6b04, type: 3} +--- !u!4 &8054499747787377927 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 5606629358963670219} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7975868388105212210 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 3716576917091979191} + m_Modifications: + - target: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_Name + value: BoatAlignNormal (2) + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.x + value: 67.1 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalPosition.z + value: 11.5 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.w + value: 0.449241 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.y + value: 0.8934106 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 126.61 + objectReference: {fileID: 0} + - target: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + insertIndex: -1 + addedObject: {fileID: 5370329665501685305} + m_SourcePrefab: {fileID: 100100000, guid: 40b143bc273314da29022a07899ee9da, type: 3} +--- !u!4 &7971536655091725388 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4341219009766782, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 7975868388105212210} + m_PrefabAsset: {fileID: 0} +--- !u!1 &7973933612226415972 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1935509346245718, guid: 40b143bc273314da29022a07899ee9da, + type: 3} + m_PrefabInstance: {fileID: 7975868388105212210} + m_PrefabAsset: {fileID: 0} +--- !u!114 &5370329665501685305 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7973933612226415972} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0773b7cb9424ddb87749b40d94c1ce, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Move: 1 + _Turn: -0.8 +--- !u!1001 &8801623799429359069 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8502268477106537203} + m_Modifications: + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7016851 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.29064745 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.6009921 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.24893905 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5304508333967466499, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_Name + value: Sun + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.w + value: 1.469592e-39 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.x + value: 7.17e-43 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.y + value: 1.46957e-39 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.z + value: 7.17e-43 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 774ab582b39374a7e9d5dac8e31b9a5a, type: 3} +--- !u!4 &7588247899154469714 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + m_PrefabInstance: {fileID: 8801623799429359069} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &9028243030094553854 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1396767754596656607} + m_Modifications: + - target: {fileID: 6079220456006713144, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_Name + value: Post-Processing + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5e01cffb9e8324147affb8e08fd5ed13, type: 3} +--- !u!4 &26477736572326577 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + m_PrefabInstance: {fileID: 9028243030094553854} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatsScene.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatsScene.prefab.meta new file mode 100644 index 0000000..6ff07ec --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_BoatsScene.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e0085283eb1c64097ad21966be22734e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_OceanLiner.prefab b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_OceanLiner.prefab new file mode 100644 index 0000000..b6b6ff8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_OceanLiner.prefab @@ -0,0 +1,1140 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &395078229554482828 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4676003223697204548} + m_Layer: 0 + m_Name: Hull + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4676003223697204548 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 395078229554482828} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6552292598085690517} + - {fileID: 7004465649187820915} + - {fileID: 2410872689526142103} + - {fileID: 448349304985821630} + - {fileID: 7345570915878659534} + m_Father: {fileID: 4699689828683719271} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &496677165362072600 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7345570915878659534} + - component: {fileID: 767402527018824486} + - component: {fileID: 6910422432521250271} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7345570915878659534 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 496677165362072600} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 8.566847, z: 70.096} + m_LocalScale: {x: 28.080664, y: 7.1969504, z: 136.03627} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4676003223697204548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &767402527018824486 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 496677165362072600} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6910422432521250271 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 496677165362072600} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &672092219431369091 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4873389824975062598} + - component: {fileID: 3342304663921928844} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4873389824975062598 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 672092219431369091} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 112.2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 306330708190938992} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3342304663921928844 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 672092219431369091} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 10 + _Weight: 4 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &1505799907152315829 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6600500412028569301} + - component: {fileID: 7492905526018332743} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6600500412028569301 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1505799907152315829} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 130.41} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 306330708190938992} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7492905526018332743 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1505799907152315829} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 5 + _Weight: 4 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &2581816919730867749 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5440412411261671542} + m_Layer: 0 + m_Name: Camera Position + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5440412411261671542 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2581816919730867749} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 40.9, z: -172.1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4699689828683719271} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3365392575864642213 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 448349304985821630} + - component: {fileID: 4583933313721353989} + - component: {fileID: 6285718233533907592} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &448349304985821630 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3365392575864642213} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -92.675} + m_LocalScale: {x: 28.030594, y: 42.12505, z: 31.628101} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4676003223697204548} + m_LocalEulerAnglesHint: {x: 90, y: -0.000015258789, z: -0.000015258789} +--- !u!33 &4583933313721353989 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3365392575864642213} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6285718233533907592 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3365392575864642213} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &3625280196177849988 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8079949103966153449} + - component: {fileID: 6884600242932306506} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8079949103966153449 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3625280196177849988} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 60.4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 306330708190938992} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6884600242932306506 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3625280196177849988} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 10 + _Weight: 4 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3637049894953701043 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7427468181772914864} + - component: {fileID: 196909111758105337} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7427468181772914864 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3637049894953701043} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -126.6} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 306330708190938992} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &196909111758105337 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3637049894953701043} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 10 + _Weight: 4 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &4036194036648923335 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4699689828683719271} + - component: {fileID: 8380954490411808174} + - component: {fileID: 3400758738886186750} + - component: {fileID: 2375001577304536436} + m_Layer: 0 + m_Name: Boats_OceanLiner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4699689828683719271 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4036194036648923335} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5440412411261671542} + - {fileID: 4676003223697204548} + - {fileID: 306330708190938992} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &8380954490411808174 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4036194036648923335} + serializedVersion: 4 + m_Mass: 50000000 + m_Drag: 0.2 + m_AngularDrag: 2 + m_CenterOfMass: {x: 0, y: -8, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 0 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 1 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &3400758738886186750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4036194036648923335} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eba37e6f7ba7a4a488c7831f45a078b2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _RigidBody: {fileID: 8380954490411808174} + _Model: 1 + _Layer: 1 + _BuoyancyForceStrength: 15000 + _BuoyancyTorqueStrength: 8 + _MaximumBuoyancyForce: Infinity + _CenterToBottomOffset: 0 + _AccelerateDownhill: 0 + _Probes: + - _Weight: 1 + _Position: {x: -11, y: 0, z: 120} + - _Weight: 1 + _Position: {x: 0, y: 0, z: 120} + - _Weight: 1 + _Position: {x: 11, y: 0, z: 120} + - _Weight: 1 + _Position: {x: -11, y: 0, z: 80} + - _Weight: 1 + _Position: {x: 0, y: 0, z: 80} + - _Weight: 1 + _Position: {x: 11, y: 0, z: 80} + - _Weight: 1 + _Position: {x: -11, y: 0, z: 40} + - _Weight: 1 + _Position: {x: 0, y: 0, z: 40} + - _Weight: 1 + _Position: {x: 11, y: 0, z: 40} + - _Weight: 1 + _Position: {x: -11, y: 0, z: 0} + - _Weight: 1 + _Position: {x: 0, y: 0, z: 0} + - _Weight: 1 + _Position: {x: 11, y: 0, z: 0} + - _Weight: 1 + _Position: {x: 11, y: 0, z: -120} + - _Weight: 1 + _Position: {x: 0, y: 0, z: -40} + - _Weight: 1 + _Position: {x: 11, y: 0, z: -40} + - _Weight: 1 + _Position: {x: -11, y: 0, z: -80} + - _Weight: 1 + _Position: {x: 0, y: 0, z: -80} + - _Weight: 1 + _Position: {x: 11, y: 0, z: -80} + - _Weight: 1 + _Position: {x: -11, y: 0, z: -120} + - _Weight: 1 + _Position: {x: 0, y: 0, z: -120} + - _Weight: 1 + _Position: {x: 11, y: 0, z: -120} + _Drag: {x: 4, y: 1, z: 0} + _AngularDrag: 0.2 + _ForceHeightOffset: 0 + _ObjectWidth: 24 + _UseObjectLength: 0 + _ObjectLength: 3 + _Debug: + _DrawQueries: 0 +--- !u!114 &2375001577304536436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4036194036648923335} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9310a3e8fdd024e06bb9d6970db822d2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _FloatingObject: {fileID: 0} + _Control: {fileID: 0} + _ForceHeightOffset: 0 + _ThrustPower: 4 + _SteerPower: 0.15 + _TurningHeel: 0.35 + _BuoyancyCurveFactor: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0.01267637 + outSlope: 0.01267637 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6626424 + value: 0.1791001 + inSlope: 0.8680198 + outSlope: 0.8680198 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 3.38758 + outSlope: 3.38758 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1 &5087247450138140366 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1644379665467751225} + - component: {fileID: 7368772420817160657} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1644379665467751225 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5087247450138140366} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -82.6} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 306330708190938992} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7368772420817160657 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5087247450138140366} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 10 + _Weight: 4 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &5161712154300537121 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8054278709008703397} + - component: {fileID: 3147806395417442872} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8054278709008703397 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5161712154300537121} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 16.5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 306330708190938992} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3147806395417442872 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5161712154300537121} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 10 + _Weight: 4 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &5881206417359290328 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2410872689526142103} + - component: {fileID: 4630421392553022072} + - component: {fileID: 5653684819523411608} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2410872689526142103 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5881206417359290328} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 8.566855, z: -33.7} + m_LocalScale: {x: 28.030594, y: 202.20026, z: 14.278117} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4676003223697204548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4630421392553022072 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5881206417359290328} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5653684819523411608 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5881206417359290328} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &6812833054626026270 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 306330708190938992} + m_Layer: 0 + m_Name: Interactions + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &306330708190938992 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6812833054626026270} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 6600500412028569301} + - {fileID: 4873389824975062598} + - {fileID: 8079949103966153449} + - {fileID: 8054278709008703397} + - {fileID: 5417098587075673970} + - {fileID: 1644379665467751225} + - {fileID: 7427468181772914864} + m_Father: {fileID: 4699689828683719271} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7211350261527780770 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5417098587075673970} + - component: {fileID: 4171906452006746563} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5417098587075673970 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7211350261527780770} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -31.4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 306330708190938992} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4171906452006746563 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7211350261527780770} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 10 + _Weight: 4 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &7280846314752337608 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6552292598085690517} + - component: {fileID: 5122964793416484149} + - component: {fileID: 2060918184526796367} + - component: {fileID: 2216691414284818486} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6552292598085690517 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7280846314752337608} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 28.030594, y: 134.80013, z: 33.933342} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4676003223697204548} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &5122964793416484149 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7280846314752337608} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2060918184526796367 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7280846314752337608} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &2216691414284818486 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7280846314752337608} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &7379495003815580121 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7004465649187820915} + - component: {fileID: 6032399095467076252} + - component: {fileID: 1894605028622133989} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7004465649187820915 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7379495003815580121} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 15.420329, z: -8.425} + m_LocalScale: {x: 16.26195, y: 17.688906, z: 119.425514} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4676003223697204548} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6032399095467076252 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7379495003815580121} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1894605028622133989 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7379495003815580121} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_OceanLiner.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_OceanLiner.prefab.meta new file mode 100644 index 0000000..0115df5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_OceanLiner.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 74c8f2f95ac074785be75df0fde34cdb +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_Probes.prefab b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_Probes.prefab new file mode 100644 index 0000000..4d04dd7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_Probes.prefab @@ -0,0 +1,860 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1297567163227450 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4739854507099122} + m_Layer: 0 + m_Name: Hull + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4739854507099122 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1297567163227450} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4183929038744730} + - {fileID: 4139957336652634} + - {fileID: 4866521643516314} + - {fileID: 4774174764444222} + - {fileID: 4900931267026566} + - {fileID: 7129320516320632141} + m_Father: {fileID: 4872491186423460} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1371779553471058 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4872491186423460} + - component: {fileID: 54707522104481946} + - component: {fileID: 1514688467311079998} + - component: {fileID: 3415084549772005532} + m_Layer: 0 + m_Name: Boats_Probes + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4872491186423460 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1371779553471058} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4559169209441218} + - {fileID: 4739854507099122} + - {fileID: 1513948845443407612} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &54707522104481946 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1371779553471058} + serializedVersion: 4 + m_Mass: 5000 + m_Drag: 0 + m_AngularDrag: 2 + m_CenterOfMass: {x: 0, y: -1, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 0 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 1 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &1514688467311079998 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1371779553471058} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eba37e6f7ba7a4a488c7831f45a078b2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _RigidBody: {fileID: 54707522104481946} + _Model: 1 + _Layer: 1 + _BuoyancyForceStrength: 6 + _BuoyancyTorqueStrength: 8 + _MaximumBuoyancyForce: Infinity + _CenterToBottomOffset: 0 + _AccelerateDownhill: 0 + _Probes: + - _Weight: 1 + _Position: {x: -2.5, y: 0, z: 6} + - _Weight: 1 + _Position: {x: 0, y: 0, z: 6} + - _Weight: 1 + _Position: {x: 2.5, y: 0, z: 6} + - _Weight: 1 + _Position: {x: -2.5, y: 0, z: 2} + - _Weight: 1 + _Position: {x: 0, y: 0, z: 2} + - _Weight: 1 + _Position: {x: 2.5, y: 0, z: 2} + - _Weight: 1 + _Position: {x: -2.5, y: 0, z: -2} + - _Weight: 1 + _Position: {x: 0, y: 0, z: -2} + - _Weight: 1 + _Position: {x: 2, y: 0, z: -2} + - _Weight: 1 + _Position: {x: -2.5, y: 0, z: -6} + - _Weight: 1 + _Position: {x: 0, y: 0, z: -6} + - _Weight: 1 + _Position: {x: 2.5, y: 0, z: -6} + _Drag: {x: 4, y: 3, z: 0.5} + _AngularDrag: 0.2 + _ForceHeightOffset: 0 + _ObjectWidth: 24 + _UseObjectLength: 0 + _ObjectLength: 3 + _Debug: + _DrawQueries: 0 +--- !u!114 &3415084549772005532 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1371779553471058} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9310a3e8fdd024e06bb9d6970db822d2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _FloatingObject: {fileID: 0} + _Control: {fileID: 0} + _ForceHeightOffset: 0 + _ThrustPower: 5 + _SteerPower: 0.5 + _TurningHeel: 0.35 + _BuoyancyCurveFactor: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0.01267637 + outSlope: 0.01267637 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6626424 + value: 0.1791001 + inSlope: 0.8680198 + outSlope: 0.8680198 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 3.38758 + outSlope: 3.38758 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1 &1375191122035062 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4559169209441218} + m_Layer: 0 + m_Name: Camera Position + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4559169209441218 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1375191122035062} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 8, z: -16.82} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4872491186423460} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1485063291319162 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4900931267026566} + - component: {fileID: 33081414023793434} + - component: {fileID: 23087138381802674} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4900931267026566 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1485063291319162} + serializedVersion: 2 + m_LocalRotation: {x: 0.0000000024510702, y: -0.013089582, z: -0.00000018723746, + w: 0.99991435} + m_LocalPosition: {x: 0.019996643, y: 0.8999996, z: 4.16} + m_LocalScale: {x: 6, y: 0.75608367, z: 8.077367} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4739854507099122} + m_LocalEulerAnglesHint: {x: 0, y: -1.5, z: -0.000015258789} +--- !u!33 &33081414023793434 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1485063291319162} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23087138381802674 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1485063291319162} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1612092800351810 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4183929038744730} + - component: {fileID: 33031733351483578} + - component: {fileID: 23165060350728114} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4183929038744730 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1612092800351810} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 6, y: 8, z: 3.5649018} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4739854507099122} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &33031733351483578 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1612092800351810} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23165060350728114 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1612092800351810} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1645384925348842 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4774174764444222} + - component: {fileID: 33789757766815006} + - component: {fileID: 23694823958058340} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4774174764444222 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645384925348842} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -5.5} + m_LocalScale: {x: 6, y: 2.500001, z: 3.3227222} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4739854507099122} + m_LocalEulerAnglesHint: {x: 90, y: -0.000015258789, z: -0.000015258789} +--- !u!33 &33789757766815006 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645384925348842} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23694823958058340 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645384925348842} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1735289438465796 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4866521643516314} + - component: {fileID: 33265983417920460} + - component: {fileID: 23743893550967156} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4866521643516314 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1735289438465796} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0.9000006, z: -2} + m_LocalScale: {x: 6, y: 12, z: 1.5000019} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4739854507099122} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33265983417920460 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1735289438465796} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23743893550967156 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1735289438465796} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1905517588466528 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4139957336652634} + - component: {fileID: 33331850122770134} + - component: {fileID: 23698013350609702} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4139957336652634 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1905517588466528} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1.6199999, z: -3.130001} + m_LocalScale: {x: 3.4809, y: 2.6801, z: 7.0875673} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4739854507099122} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33331850122770134 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1905517588466528} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23698013350609702 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1905517588466528} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bc40ef3bdf21e4a61a2ebdb2ceb6ea69, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &242171641499116580 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7129320516320632141} + - component: {fileID: 4639128169616714001} + m_Layer: 0 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7129320516320632141 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 242171641499116580} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.05, z: -0.45} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 4739854507099122} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!136 &4639128169616714001 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 242171641499116580} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 2.8 + m_Height: 17 + m_Direction: 2 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &4618319844283316308 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2331444261730833172} + - component: {fileID: 7419317283925165840} + m_Layer: 0 + m_Name: Interaction Back + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2331444261730833172 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4618319844283316308} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -5.9} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1513948845443407612} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7419317283925165840 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4618319844283316308} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2.6 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 1 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &6714154590604868730 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1513948845443407612} + m_Layer: 0 + m_Name: Interactions + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1513948845443407612 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6714154590604868730} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 2071417752236337297} + - {fileID: 2331444261730833172} + m_Father: {fileID: 4872491186423460} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6964410616415419724 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2071417752236337297} + - component: {fileID: 6015142303167450928} + m_Layer: 0 + m_Name: Interaction Front + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2071417752236337297 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6964410616415419724} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 5.44} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1513948845443407612} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6015142303167450928 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6964410616415419724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 3.3 + _Weight: 5 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.07 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_Probes.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_Probes.prefab.meta new file mode 100644 index 0000000..59e9066 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Prefabs/Boats_Probes.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e5ae8aebf92c54902819a765cdde29d1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes.meta new file mode 100644 index 0000000..406e3c0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 080efe252c36a4ab3989f0088454f140 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boat.unity b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boat.unity new file mode 100644 index 0000000..5ec2f76 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boat.unity @@ -0,0 +1,198 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.83137256, g: 0.92941177, b: 0.93333334, a: 1} + m_FogMode: 3 + m_FogDensity: 0.0001 + m_LinearFogStart: 1000 + m_LinearFogEnd: 10000 + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 1 + m_BakeResolution: 50 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 0 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 4890085278179872738, guid: 6e72aca972f324f7886200f86939d735, + type: 2} +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &5885618385214431306 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1427589541763392806, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_Name + value: Scene + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6852310033111569586, guid: 5f56bf99bb225486c996f58f9288c20f, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5f56bf99bb225486c996f58f9288c20f, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 5885618385214431306} diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boat.unity.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boat.unity.meta new file mode 100644 index 0000000..ded268b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boat.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 89b52647b3f5248b4b8c99696135d3d8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boats.unity b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boats.unity new file mode 100644 index 0000000..319bf13 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boats.unity @@ -0,0 +1,198 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.83137256, g: 0.92941177, b: 0.93333334, a: 1} + m_FogMode: 3 + m_FogDensity: 0.0001 + m_LinearFogStart: 1000 + m_LinearFogEnd: 10000 + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 1 + m_BakeResolution: 50 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 0 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 4890085278179872738, guid: 6e72aca972f324f7886200f86939d735, + type: 2} +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &6613661219893388780 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 5165285943062863725, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_Name + value: Scene + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6866301169458832456, guid: e0085283eb1c64097ad21966be22734e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e0085283eb1c64097ad21966be22734e, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 6613661219893388780} diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boats.unity.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boats.unity.meta new file mode 100644 index 0000000..d44cbdd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scenes/Boats.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d8f1aa2fd7fa64d6b88a2243a453edaf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts.meta new file mode 100644 index 0000000..cbf9714 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fc9c2733d1aee4ef8b298af371597136 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/Assembly.cs b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/Assembly.cs new file mode 100644 index 0000000..5bf00ef --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/Assembly.cs @@ -0,0 +1,9 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Submarine")] + +// Define empty namespaces for when assemblies are not present. +namespace UnityEngine.InputSystem { } diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/Assembly.cs.meta new file mode 100644 index 0000000..b48649f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31c79f361b2bd40af9a7d52025a8c0f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/PlayerControl.cs b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/PlayerControl.cs new file mode 100644 index 0000000..2d844b8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/PlayerControl.cs @@ -0,0 +1,121 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_Unity_InputSystem && ENABLE_INPUT_SYSTEM +#define d_InputSystem +#endif + +using UnityEngine; +using UnityEngine.InputSystem; + +#pragma warning disable CS0414 + +namespace WaveHarmonic.Crest.Watercraft.Examples +{ + sealed class PlayerControl : Control + { + [SerializeField, HideInInspector] + int _Version = 0; + +#if d_InputSystem + [SerializeField] + Key _DriveForward = Key.W; + + [SerializeField] + Key _DriveBackward = Key.S; + + [SerializeField] + Key _SteerLeftward = Key.A; + + [SerializeField] + Key _SteerRightward = Key.D; + + [SerializeField] + Key _FloatUpward = Key.E; + + [SerializeField] + Key _FloatDownward = Key.Q; +#else + [SerializeField] + int _DriveForward; + + [SerializeField] + int _DriveBackward; + + [SerializeField] + int _SteerLeftward; + + [SerializeField] + int _SteerRightward; + + [SerializeField] + int _FloatUpward; + + [SerializeField] + int _FloatDownward; +#endif + +#if d_InputSystem + [HideInInspector] +#endif + [Tooltip("The input axis name for throttle. See Project Settings > Input Manager.")] + [SerializeField] + string _DriveInputAxis = "Vertical"; + +#if d_InputSystem + [HideInInspector] +#endif + [Tooltip("The input axis name for steering. See Project Settings > Input Manager.")] + [SerializeField] + string _SteerInputAxis = "Horizontal"; + +#if d_InputSystem + [HideInInspector] +#endif + [SerializeField] + KeyCode _FloatUpwards = KeyCode.E; + +#if d_InputSystem + [HideInInspector] +#endif + [SerializeField] + KeyCode _FloatDownwards = KeyCode.Q; + + [Tooltip("Whether to allow submerge control.")] + [SerializeField] + bool _Submersible; + +#pragma warning disable UNT0001 + // Here to force the checkbox to show. + void Start() { } +#pragma warning restore UNT0001 + + public override Vector3 Input + { + get + { + if (!isActiveAndEnabled || !Application.isFocused) return Vector3.zero; + + var input = Vector3.zero; +#if d_InputSystem + input.z += Keyboard.current[_DriveForward].isPressed ? 1f : 0f; + input.z += Keyboard.current[_DriveBackward].isPressed ? -1f : 0f; + input.x += Keyboard.current[_SteerLeftward].isPressed ? -1f : 0f; + input.x += Keyboard.current[_SteerRightward].isPressed ? 1f : 0f; + input.y += Keyboard.current[_FloatUpward].isPressed ? 1f : 0f; + input.y += Keyboard.current[_FloatDownward].isPressed ? -1f : 0f; +#else + input.z = UnityEngine.Input.GetAxis(_DriveInputAxis); + input.x = UnityEngine.Input.GetAxis(_SteerInputAxis); + input.y += UnityEngine.Input.GetKey(_FloatUpwards) ? 1f : 0f; + input.y += UnityEngine.Input.GetKey(_FloatDownwards) ? -1f : 0f; +#endif + + // Steering towards same direction as forward when going backwards. + if (input.z < 0f) input.x *= -1f; + if (!_Submersible) input.y = 0f; + return input; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/PlayerControl.cs.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/PlayerControl.cs.meta new file mode 100644 index 0000000..310aced --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/PlayerControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00270ad31891444bcb3fa64c9df57571 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/WaveHarmonic.Crest.Samples.Boats.asmdef b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/WaveHarmonic.Crest.Samples.Boats.asmdef new file mode 100644 index 0000000..5d4d969 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/WaveHarmonic.Crest.Samples.Boats.asmdef @@ -0,0 +1,31 @@ +{ + "name": "WaveHarmonic.Crest.Samples.Boats", + "rootNamespace": "", + "references": [ + "GUID:75469ad4d38634e559750d17036d5f7c", + "GUID:7c347618730f5467f86a58f333ce21df" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER", + "d_Crest" + ], + "versionDefines": [ + { + "name": "com.unity.inputsystem", + "expression": "", + "define": "d_Unity_InputSystem" + }, + { + "name": "com.waveharmonic.crest", + "expression": "", + "define": "d_Crest" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/WaveHarmonic.Crest.Samples.Boats.asmdef.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/WaveHarmonic.Crest.Samples.Boats.asmdef.meta new file mode 100644 index 0000000..b8ef32b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Scripts/WaveHarmonic.Crest.Samples.Boats.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b764708e9f9f5422cb50bbec2bdf0c0e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Settings.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings.meta new file mode 100644 index 0000000..d617400 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cfaab8ad3534144c29369933e12deb6e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_DynamicWaves.asset b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_DynamicWaves.asset new file mode 100644 index 0000000..8c89d28 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_DynamicWaves.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 7df05608a083e4ad4bc4758f1df0ee29, type: 3} + m_Name: Boats_Lod_DynamicWaves + m_EditorClassIdentifier: + _Version: 0 + _Damping: 0 + _CourantNumber: 1 + _HorizontalDisplace: 9.66 + _DisplaceClamp: 0.3 + _GravityMultiplier: 1 diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_DynamicWaves.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_DynamicWaves.asset.meta new file mode 100644 index 0000000..e2a76ff --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_DynamicWaves.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97eb5eccada85449e9c98d91709b5f74 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_Foam.asset b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_Foam.asset new file mode 100644 index 0000000..4481f78 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_Foam.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 03aa24b56404b45a190a2cfc0c7cc100, type: 3} + m_Name: Boats_Lod_Foam + m_EditorClassIdentifier: + _Version: 0 + _Maximum: Infinity + _FoamFadeRate: 0.1 + _WaveFoamStrength: 3.27 + _WaveFoamCoverage: 0.569 + _FilterWaves: 0 + _ShorelineFoamMaximumDepth: 0.65 + _ShorelineFoamStrength: 2 + _ShorelineFoamPriming: 5 diff --git a/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_Foam.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_Foam.asset.meta new file mode 100644 index 0000000..3119d26 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Boats/Settings/Boats_Lod_Foam.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 01b6d2d72f0e04b0abc7d62cfc8b5355 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples.meta b/Packages/com.waveharmonic.crest/Samples~/Examples.meta new file mode 100644 index 0000000..1305e6c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b3efdf0407834cbca0fab8e7bb688c7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations.meta new file mode 100644 index 0000000..e3ac05d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 86dad0fc3e1a14bb69aa9b658e8ce095 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.anim b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.anim new file mode 100644 index 0000000..516aec1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.anim @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_AudioFromShorelineDistance + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: -15, y: 1, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 15 + value: {x: 15, y: 1, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 30 + value: {x: -15, y: 1, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 30 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -15 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 15 + value: 15 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 30 + value: -15 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: + classID: 4 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: + classID: 4 + script: {fileID: 0} + flags: 0 + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 1 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.anim.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.anim.meta new file mode 100644 index 0000000..f15af9b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d28f66b08ee114cd48da44280b4e9382 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.controller b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.controller new file mode 100644 index 0000000..156f6da --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-2809536210069966853 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_AudioFromShorelineDistance + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: d28f66b08ee114cd48da44280b4e9382, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_AudioFromShorelineDistance + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 53929236492165312} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &53929236492165312 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -2809536210069966853} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -2809536210069966853} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.controller.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.controller.meta new file mode 100644 index 0000000..3465705 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromShorelineDistance.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1bfd12080c3674beaa7fbbd36299b110 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.anim b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.anim new file mode 100644 index 0000000..adbbe52 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.anim @@ -0,0 +1,213 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_AudioFromSurfaceDistance + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 5, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 15 + value: {x: 0, y: -5, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 30 + value: {x: 0, y: 5, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 30 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 15 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 30 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: + classID: 4 + script: {fileID: 0} + flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 15 + value: -5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 30 + value: 5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: + classID: 4 + script: {fileID: 0} + flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 15 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 30 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.z + path: + classID: 4 + script: {fileID: 0} + flags: 16 + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 1 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.anim.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.anim.meta new file mode 100644 index 0000000..848e42c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33b152ef70a3e4dfb92c1e6635b6e232 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.controller b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.controller new file mode 100644 index 0000000..a92c92a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_AudioFromSurfaceDistance + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 5776987720967967023} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &5776987720967967023 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 8069439504337816009} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 8069439504337816009} +--- !u!1102 &8069439504337816009 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_Animation_Audio + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 33b152ef70a3e4dfb92c1e6635b6e232, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.controller.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.controller.meta new file mode 100644 index 0000000..4c7df31 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_AudioFromSurfaceDistance.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d680eb04bc284eea9e892eaed4b99cf +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.anim b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.anim new file mode 100644 index 0000000..387c1c5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.anim @@ -0,0 +1,213 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_Clipping + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 6, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 5 + value: {x: 0, y: -6, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 10 + value: {x: 0, y: 6, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 10 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 1 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 10 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: + classID: 4 + script: {fileID: 0} + flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 5 + value: -6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 10 + value: 6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: + classID: 4 + script: {fileID: 0} + flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 10 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.z + path: + classID: 4 + script: {fileID: 0} + flags: 16 + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 1 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.anim.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.anim.meta new file mode 100644 index 0000000..343b8f0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7754d1fa44054c62b3c1b7f0c62608f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.controller b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.controller new file mode 100644 index 0000000..fc4af96 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-7484451868038142777 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -2666918858029681641} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -2666918858029681641} +--- !u!1102 &-2666918858029681641 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: New Animation + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: b7754d1fa44054c62b3c1b7f0c62608f, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_Clipping + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -7484451868038142777} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.controller.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.controller.meta new file mode 100644 index 0000000..52b76df --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Animations/Examples_Clipping.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 425c8bec3f4834bb1968a58c32f495f5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio.meta new file mode 100644 index 0000000..753c420 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0821063d8eece47de9036390b2a5eb25 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Shoreline.flac b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Shoreline.flac new file mode 100644 index 0000000..d66b3a6 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Shoreline.flac differ diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Shoreline.flac.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Shoreline.flac.meta new file mode 100644 index 0000000..7adbd0b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Shoreline.flac.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: e32127731094449be80fae3d8e2b9d4a +AudioImporter: + externalObjects: {} + serializedVersion: 7 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Underwater.wav b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Underwater.wav new file mode 100644 index 0000000..73bd7dc Binary files /dev/null and b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Underwater.wav differ diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Underwater.wav.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Underwater.wav.meta new file mode 100644 index 0000000..a19caf2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_Underwater.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 7bdd4f6975cad464f98739af0ea17dce +AudioImporter: + externalObjects: {} + serializedVersion: 7 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 1 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_WaterSurface.flac b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_WaterSurface.flac new file mode 100644 index 0000000..9825ed6 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_WaterSurface.flac differ diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_WaterSurface.flac.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_WaterSurface.flac.meta new file mode 100644 index 0000000..a842a6d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/Examples_WaterSurface.flac.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 87844326d709c4375a39023c2ef63faa +AudioImporter: + externalObjects: {} + serializedVersion: 7 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 1 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/License.txt b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/License.txt new file mode 100644 index 0000000..562fd4e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/License.txt @@ -0,0 +1,11 @@ +Filename: Examples_WaterSurface.flac +License: Creative Commons https://creativecommons.org/licenses/by/3.0/ +Link: https://freesound.org/s/39901/ + +Filename: Examples_Underwater.wav +License: Public Domain https://creativecommons.org/publicdomain/zero/1.0/ +Link: https://freesound.org/s/448460/ + +Filename: Examples_Shoreline.flac +License: Public Domain https://creativecommons.org/publicdomain/zero/1.0/ +Link: https://freesound.org/s/277480/ diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/License.txt.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/License.txt.meta new file mode 100644 index 0000000..8721e22 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Audio/License.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0686209e1bcb14124ac6e6274b9263a8 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Data.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Data.meta new file mode 100644 index 0000000..61775b5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 913ade38970b545f99da4b63a2c51601 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_OpenOcean.asset b/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_OpenOcean.asset new file mode 100644 index 0000000..afedc23 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_OpenOcean.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: Examples_WaveSpectrum_OpenOcean + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 90 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.39794 + - -7.39794 + - -6.598513 + - -6.1406407 + - -4.8268056 + - -4.3421416 + - -3.232016 + - -2.909008 + - -2.7731915 + - -2.4056463 + - -2.5869184 + - -4.421911 + - -7.39794 + - -7.39794 + _PowerDisabled: 0000000000000000000001010101 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.69 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_OpenOcean.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_OpenOcean.asset.meta new file mode 100644 index 0000000..a2e055b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_OpenOcean.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e13a1902b10e34e9fb08e1d09e39b5d4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_Trochoidal.asset b/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_Trochoidal.asset new file mode 100644 index 0000000..a6db245 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_Trochoidal.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: Examples_WaveSpectrum_Trochoidal + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 0 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.10794 + - -6.42794 + - -5.93794 + - -5.27794 + - -4.67794 + - -3.71794 + - -3.17794 + - -2.60794 + - 0.74 + - -1.11794 + - -0.85794 + - -0.36794 + - 0.04206 + - -8 + _PowerDisabled: 0101010101010101000101010101 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.1 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_Trochoidal.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_Trochoidal.asset.meta new file mode 100644 index 0000000..cb0adbb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Data/Examples_WaveSpectrum_Trochoidal.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6b50b5218dbe2488fb5d00db49d15dae +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials.meta new file mode 100644 index 0000000..5c28bbb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b7464c68b11f4ad6ab5d63757cb6ed5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Absorption.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Absorption.mat new file mode 100644 index 0000000..fe4bb61 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Absorption.mat @@ -0,0 +1,35 @@ +%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: Examples_Absorption + m_Shader: {fileID: 4800000, guid: 9a866ef153cd246c58ef554043275848, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - d_Feather + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _Crest_Feather: 1 + - _Crest_FeatherWidth: 0.1 + m_Colors: + - _Crest_Absorption: {r: 0.70172215, g: 0.13051344, b: 0.10529934, a: 1} + - _Crest_AbsorptionColor: {r: 0.3411765, g: 0.8187262, b: 0.8509804, a: 0.101960786} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Absorption.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Absorption.mat.meta new file mode 100644 index 0000000..442fc4b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Absorption.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 942c58eb9fdd547db965493725bb7b94 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddFoam.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddFoam.mat new file mode 100644 index 0000000..cad405d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddFoam.mat @@ -0,0 +1,90 @@ +%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: Examples_AddFoam + m_Shader: {fileID: 4800000, guid: 955fe6ade516e42e0ab0b0bbb116170a, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Crest_Texture: + 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} + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _BumpScale: 1 + - _Crest_Strength: 100 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _FoamValue: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddFoam.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddFoam.mat.meta new file mode 100644 index 0000000..52c4b1e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddFoam.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd761ca472aded547ad7c481436a7a08 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddMaskedFoam.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddMaskedFoam.mat new file mode 100644 index 0000000..0bf43c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddMaskedFoam.mat @@ -0,0 +1,35 @@ +%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: Examples_AddMaskedFoam + m_Shader: {fileID: 4800000, guid: 955fe6ade516e42e0ab0b0bbb116170a, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Crest_Texture: + m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _Crest_Strength: 3 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddMaskedFoam.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddMaskedFoam.mat.meta new file mode 100644 index 0000000..ef85038 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AddMaskedFoam.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10dbe9bc7d24d4b3f94343d10694d4fc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AlbedoCrestLogo.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AlbedoCrestLogo.mat new file mode 100644 index 0000000..ca3ecaf --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AlbedoCrestLogo.mat @@ -0,0 +1,41 @@ +%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: Examples_AlbedoCrestLogo + m_Shader: {fileID: 4800000, guid: aa7b1bc481cf34f229ffd793be4a01c3, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Crest_Texture: + m_Texture: {fileID: 2800000, guid: 72a325a76c6624c768822a08fe625d55, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: + - _Crest_BlendModeSource: 5 + - _Crest_BlendModeTarget: 10 + - _Crest_Version: 0 + m_Floats: + - _Alpha: 1 + - _Crest_BlendModeSource: 5 + - _Crest_BlendModeTarget: 10 + - _Crest_Cutoff: 0.5 + m_Colors: + - _Crest_Color: {r: 0.35, g: 0.35, b: 0.35, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AlbedoCrestLogo.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AlbedoCrestLogo.mat.meta new file mode 100644 index 0000000..2c149a9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_AlbedoCrestLogo.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e40b4c328aeec4f43943883ee9c70ccc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_CompareWaves.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_CompareWaves.mat new file mode 100644 index 0000000..fa2e8d0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_CompareWaves.mat @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8518889649984849879 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_CompareWaves + m_Shader: {fileID: 4800000, guid: 95ec6475fc33247d4b80d07df23f2748, 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: {} + 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: + - _Crest_Version: 0 + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Crest_BlendModeSource: 1 + - _Crest_BlendModeTarget: 1 + - _Crest_Feather: 0 + - _Crest_FeatherWaveStart: 0.1 + - _Crest_FeatherWidth: 0.1 + - _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.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_CompareWaves.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_CompareWaves.mat.meta new file mode 100644 index 0000000..07101b2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_CompareWaves.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 360fdb51577a04cfabcee8f199858cd5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideOne.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideOne.mat new file mode 100644 index 0000000..7fc9dbd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideOne.mat @@ -0,0 +1,87 @@ +%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: Examples_FoamOverrideOne + m_Shader: {fileID: 4800000, guid: 288a089f90e714983b8a760dd49e5a5c, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _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} + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _BumpScale: 1 + - _Crest_ColorMask: 15 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _FoamValue: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Crest_Value: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideOne.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideOne.mat.meta new file mode 100644 index 0000000..59db8f5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideOne.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 99f41ed341ffedc4181a46734c9fa3e9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideZero.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideZero.mat new file mode 100644 index 0000000..474a68a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideZero.mat @@ -0,0 +1,87 @@ +%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: Examples_FoamOverrideZero + m_Shader: {fileID: 4800000, guid: 288a089f90e714983b8a760dd49e5a5c, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _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} + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _BumpScale: 1 + - _Crest_ColorMask: 15 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _FoamValue: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Crest_Value: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideZero.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideZero.mat.meta new file mode 100644 index 0000000..d24616b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_FoamOverrideZero.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dedb48ec93e47a44691254da0aa8f80b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Scattering.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Scattering.mat new file mode 100644 index 0000000..0f6263f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Scattering.mat @@ -0,0 +1,34 @@ +%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: Examples_Scattering + m_Shader: {fileID: 4800000, guid: ea69fc35da7574631aea97812ee8652b, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - d_Feather + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _Crest_Feather: 1 + - _Crest_FeatherWidth: 0.1 + m_Colors: + - _Crest_Scattering: {r: 0, g: 0.2, b: 0.00055766106, a: 0} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Scattering.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Scattering.mat.meta new file mode 100644 index 0000000..8469133 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Scattering.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1adf67044a694bc28d41fd27a71d64c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_ShaderGraphSineWave.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_ShaderGraphSineWave.mat new file mode 100644 index 0000000..5279a92 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_ShaderGraphSineWave.mat @@ -0,0 +1,137 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3539827784301916406 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_ShaderGraphSineWave + m_Shader: {fileID: -6465566751694194690, guid: 91e55ddaf9db84c6cb588a8ef20a3a8b, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - 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: + - _AddPrecomputedVelocity: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _Amplitude: 2 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BlendMode: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _DepthOffsetEnable: 0 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 0 + - _EnableFogOnTransparent: 1 + - _ExcludeFromTUAndAA: 0 + - _Frequency: 5 + - _OpaqueCullMode: 2 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RenderQueueType: 1 + - _Speed: 0.5 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 1 + - _StencilRefDistortionVec: 4 + - _StencilRefMV: 33 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 9 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskMV: 43 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &1920337754816572153 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &7825577572917700357 +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 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_ShaderGraphSineWave.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_ShaderGraphSineWave.mat.meta new file mode 100644 index 0000000..2364bf8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_ShaderGraphSineWave.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8904d567bc07944d693dcc17ff3959bf +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_TransparentPrimitive.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_TransparentPrimitive.mat new file mode 100644 index 0000000..f6cd36c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_TransparentPrimitive.mat @@ -0,0 +1,233 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4428319493951143694 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &-1057055694433109061 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_TransparentPrimitive + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _DISABLE_SSR_TRANSPARENT + - _ENABLE_FOG_ON_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + MotionVector: User + RenderType: Transparent + disabledShaderPasses: + - DepthOnly + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Albedo: + 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} + - 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: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 10 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Alpha_Cutoff: 0.5 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 10 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 5 + - _BUILTIN_Surface: 1 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 0 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _CastShadows: 1 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoMapScale: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 10 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _ExcludeFromTUAndAA: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _Normal_Flip_Back_Faces: 1 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 4 + - _RequireSplitLighting: 0 + - _SPECULARHIGHLIGHTS_OFF: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _StencilRef: 0 + - _StencilRefDepth: 0 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 2 + - _StencilRefMV: 32 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _Surface: 1 + - _SurfaceType: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZTestDepthEqualForOpaque: 4 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 0 + - _ZWriteControl: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 0.5019608} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 0} + - _SpecularColor: {r: 0.19999987, g: 0.19999987, b: 0.19999987, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &8832854165098546343 +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 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_TransparentPrimitive.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_TransparentPrimitive.mat.meta new file mode 100644 index 0000000..90297e8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_TransparentPrimitive.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ecfe7530e35f6ef4599de91f34369545 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Water.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Water.mat new file mode 100644 index 0000000..866ee2c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Water.mat @@ -0,0 +1,104 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6220944165555138509 +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 +--- !u!114 &-3939334617012234168 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-2291610378276161277 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_Water + m_Shader: {fileID: -6465566751694194690, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_Parent: {fileID: -876546973899608171, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - CREST_FLOW_ON + - _ALPHATEST_ON + - _BUILTIN_ALPHATEST_ON + - _BUILTIN_AlphaClip + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _SPECULAR_SETUP + - _SURFACE_TYPE_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_InvalidKeywords: + - CREST_CAUSTICS_ON + - CREST_FOAM_ON + - _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - CREST_FLOW: 1 + - _BUILTIN_DstBlend: 10 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_SrcBlend: 5 + - _BUILTIN_ZWrite: 1 + - _Crest_AlbedoEnabled: 1 + - _Crest_FoamFeather: 1 + - _Crest_FoamScale: 1.3 + - _Crest_NormalMapEnabled: 0 + - _DstBlend: 10 + - _QueueControl: 0 + - _SrcBlend: 5 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Water.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Water.mat.meta new file mode 100644 index 0000000..fb90cf7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_Water.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d82d92d8d8f214cd0b8bf7c185b2c341 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WaveParticle.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WaveParticle.mat new file mode 100644 index 0000000..459ca77 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WaveParticle.mat @@ -0,0 +1,32 @@ +%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: Examples_WaveParticle + m_Shader: {fileID: 4800000, guid: c1519a4fd6d8a4a62b59870be79b3857, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _Crest_Amplitude: 5.5 + - _Crest_Radius: 5.5 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WaveParticle.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WaveParticle.mat.meta new file mode 100644 index 0000000..3dd5794 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WaveParticle.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4242b74bff27c4f748a61b16954c595a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavePatch.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavePatch.mat new file mode 100644 index 0000000..b9dfe04 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavePatch.mat @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8518889649984849879 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Examples_WavePatch + m_Shader: {fileID: 4800000, guid: 95ec6475fc33247d4b80d07df23f2748, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - d_Feather + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + 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: + - _Crest_Version: 0 + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Crest_BlendModeSource: 1 + - _Crest_BlendModeTarget: 1 + - _Crest_Feather: 1 + - _Crest_FeatherWaveStart: 0.1 + - _Crest_FeatherWidth: 0.1 + - _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.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavePatch.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavePatch.mat.meta new file mode 100644 index 0000000..cc54862 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavePatch.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f035e5443c57f47fc85159fad71c7ac9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesFromGeometry.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesFromGeometry.mat new file mode 100644 index 0000000..ba88d4a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesFromGeometry.mat @@ -0,0 +1,35 @@ +%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: Examples_WavesFromGeometry + m_Shader: {fileID: 4800000, guid: 95ec6475fc33247d4b80d07df23f2748, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _Crest_BlendModeSource: 1 + - _Crest_BlendModeTarget: 1 + - _Crest_Feather: 0 + - _Crest_FeatherWaveStart: 0.1 + - _Crest_FeatherWidth: 0.1 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesFromGeometry.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesFromGeometry.mat.meta new file mode 100644 index 0000000..2f668f8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesFromGeometry.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1c04affcdace0413bbd1c4307b1e0a9b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesScaleByFactor.mat b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesScaleByFactor.mat new file mode 100644 index 0000000..04a4a3a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesScaleByFactor.mat @@ -0,0 +1,40 @@ +%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: Examples_WavesScaleByFactor + m_Shader: {fileID: 4800000, guid: cbf67e7cbdc0a4cc09a539707e0007b9, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - d_Feather + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Crest_Texture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: + - _Crest_Version: 0 + m_Floats: + - _Crest_ApplyTexture: 0 + - _Crest_Feather: 1 + - _Crest_FeatherWidth: 0.25 + - _Crest_Invert: 0 + - _Crest_Scale: 0 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesScaleByFactor.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesScaleByFactor.mat.meta new file mode 100644 index 0000000..0028950 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Materials/Examples_WavesScaleByFactor.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 246582b609c364fe1b58409fc147e04c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes.meta new file mode 100644 index 0000000..5a3ef3c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0be8cc64555e445088ce31a3b774cf4d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes/Examples_Sphere.fbx b/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes/Examples_Sphere.fbx new file mode 100644 index 0000000..d49b021 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes/Examples_Sphere.fbx differ diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes/Examples_Sphere.fbx.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes/Examples_Sphere.fbx.meta new file mode 100644 index 0000000..ac72952 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Meshes/Examples_Sphere.fbx.meta @@ -0,0 +1,109 @@ +fileFormatVersion: 2 +guid: 9c3d81a71669f4dc0a6539b488f2c5c0 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 100 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 100 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs.meta new file mode 100644 index 0000000..344641f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f05efff7c248a407581a26d3bec130fb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_FloatingBox.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_FloatingBox.prefab new file mode 100644 index 0000000..e75720e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_FloatingBox.prefab @@ -0,0 +1,193 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &875385380025743593 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8356280719142672529} + - component: {fileID: 4613117188296977213} + - component: {fileID: 8919303644900217297} + - component: {fileID: 9142129686535531302} + - component: {fileID: 1070174069395279094} + - component: {fileID: 7065213192571102027} + - component: {fileID: 8337144158012529292} + m_Layer: 0 + m_Name: Examples_FloatingBox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8356280719142672529 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 875385380025743593} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -1.4553477, y: 15.966841, z: -0.9122448} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4613117188296977213 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 875385380025743593} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8919303644900217297 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 875385380025743593} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 35af310c2690e42a6a9d2ca36256e92c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!54 &9142129686535531302 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 875385380025743593} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &1070174069395279094 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 875385380025743593} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 0.9999999, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &7065213192571102027 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 875385380025743593} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 0.75 + _Weight: 1 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!114 &8337144158012529292 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 875385380025743593} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eba37e6f7ba7a4a488c7831f45a078b2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _RigidBody: {fileID: 9142129686535531302} + _Model: 0 + _Layer: 0 + _BuoyancyForceStrength: 10 + _BuoyancyTorqueStrength: 8 + _MaximumBuoyancyForce: 100 + _CenterToBottomOffset: -1 + _AccelerateDownhill: 0 + _Probes: [] + _Drag: {x: 2, y: 3, z: 1} + _AngularDrag: 0.2 + _ForceHeightOffset: 0 + _ObjectWidth: 3 + _UseObjectLength: 0 + _ObjectLength: 3 + _Debug: + _DrawQueries: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_FloatingBox.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_FloatingBox.prefab.meta new file mode 100644 index 0000000..049cd5d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_FloatingBox.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 84f17dfc7c7a7485296643a4e64d6200 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_Scenes.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_Scenes.prefab new file mode 100644 index 0000000..03c3ebd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_Scenes.prefab @@ -0,0 +1,1885 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &327404822791118873 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1537803801386969555} + - component: {fileID: 4529264329706058755} + - component: {fileID: 504479523708076214} + - component: {fileID: 6094660498847485368} + m_Layer: 0 + m_Name: Mask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1537803801386969555 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 327404822791118873} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 20, y: 20, z: 20} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3082800800829376572} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4529264329706058755 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 327404822791118873} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 12fa5fcd0e5ac436b8581c4441a2683e, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Clip: 0 + _Material: {fileID: 0} + _BelowSurfaceMaterial: {fileID: 0} + _VolumeMaterial: {fileID: 0} +--- !u!114 &504479523708076214 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 327404822791118873} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26623fd0e291a478a9f8b68a3df7e8a6, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 4 + _Weight: 1 + _Queue: -1 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Version: 0 + _Primitive: 0 + _Inverted: 1 + _WaterHeightDistanceCulling: 0 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!33 &6094660498847485368 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 327404822791118873} + m_Mesh: {fileID: 289301614986012343, guid: 9c3d81a71669f4dc0a6539b488f2c5c0, type: 3} +--- !u!1 &752538001624813735 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6645193019033919324} + - component: {fileID: 6156714772357720086} + - component: {fileID: 2508899403888335694} + - component: {fileID: 5513391880227232170} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6645193019033919324 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 752538001624813735} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8715398006083763250} + m_Father: {fileID: 4756183279575944939} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -40, y: -40} + m_SizeDelta: {x: 70, y: 70} + m_Pivot: {x: 1, y: 1} +--- !u!222 &6156714772357720086 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 752538001624813735} + m_CullTransparentMesh: 1 +--- !u!114 &2508899403888335694 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 752538001624813735} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 3ac2b00bfeca4b34482fa33bb6aab50c, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &5513391880227232170 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 752538001624813735} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 1 +--- !u!1 &955584948468918588 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8373608527154903543} + - component: {fileID: 1097921016841186123} + - component: {fileID: 6119524809475244111} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8373608527154903543 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 955584948468918588} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8508843123630950484} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 160, y: 160} + m_Pivot: {x: 0.5, y: 0} +--- !u!222 &1097921016841186123 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 955584948468918588} + m_CullTransparentMesh: 1 +--- !u!114 &6119524809475244111 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 955584948468918588} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.6} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 80 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 300 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Example +--- !u!1 &1115572721750479147 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3108025400259455776} + - component: {fileID: 4219513508376601501} + m_Layer: 0 + m_Name: Waves + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3108025400259455776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115572721750479147} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4912233197470644161} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4219513508376601501 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115572721750479147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 5 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: e13a1902b10e34e9fb08e1d09e39b5d4, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 0 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 32 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.35 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &1241806918637547819 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4583927076051335723} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &4583927076051335723 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1241806918637547819} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4439941709532542476} + m_Father: {fileID: 6710306375200902518} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1853976499324314591 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8715398006083763250} + - component: {fileID: 4079535216415300733} + - component: {fileID: 6715433284312728006} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8715398006083763250 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1853976499324314591} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6645193019033919324} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4079535216415300733 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1853976499324314591} + m_CullTransparentMesh: 1 +--- !u!114 &6715433284312728006 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1853976499324314591} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8039216, g: 0.5176471, b: 1, a: 0.6} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2130284292857808106 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4216997059981498178} + m_Layer: 5 + m_Name: NotSupported + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &4216997059981498178 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2130284292857808106} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5249640841318866070} + m_Father: {fileID: 8508843123630950484} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &2811534093688003712 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4756183279575944939} + m_Layer: 5 + m_Name: Preview + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &4756183279575944939 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2811534093688003712} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5247774070925551825} + - {fileID: 6645193019033919324} + m_Father: {fileID: 8508843123630950484} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &2823138595762987762 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5655619906866042202} + m_Layer: 0 + m_Name: Examples_Scenes + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5655619906866042202 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2823138595762987762} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7451036494515983304} + - {fileID: 4912233197470644161} + - {fileID: 3082800800829376572} + - {fileID: 8508843123630950484} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3432127265701024614 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7451036494515983304} + - component: {fileID: 1211632696631868302} + m_Layer: 0 + m_Name: Example + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7451036494515983304 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3432127265701024614} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5655619906866042202} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1211632696631868302 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3432127265701024614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a8eca7a783ef84759a4e965c9d6d8827, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ExecuteUpdateEvery: 0 + _StopExecutingUpdateAfter: Infinity + _OnEnable: + m_PersistentCalls: + m_Calls: [] + _OnDisable: + m_PersistentCalls: + m_Calls: [] + _OnUpdate: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 5549572483640152611} + m_TargetAssemblyTypeName: UnityEngine.UI.Slider, UnityEngine.UI + m_MethodName: set_value + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + _OnLegacyRenderPipeline: + m_PersistentCalls: + m_Calls: [] + _OnHighDefinitionPipeline: + m_PersistentCalls: + m_Calls: [] + _OnUniversalRenderPipeline: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &3774081463988487212 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8508843123630950484} + - component: {fileID: 864986373740929998} + - component: {fileID: 8932041227434579438} + - component: {fileID: 2594223297161076933} + - component: {fileID: 5628891711212661418} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8508843123630950484 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3774081463988487212} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6710306375200902518} + - {fileID: 8373608527154903543} + - {fileID: 4756183279575944939} + - {fileID: 4216997059981498178} + m_Father: {fileID: 5655619906866042202} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &864986373740929998 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3774081463988487212} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &8932041227434579438 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3774081463988487212} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1600, y: 1200} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &2594223297161076933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3774081463988487212} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &5628891711212661418 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3774081463988487212} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a8eca7a783ef84759a4e965c9d6d8827, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ExecuteUpdateEvery: 0 + _StopExecutingUpdateAfter: Infinity + _OnEnable: + m_PersistentCalls: + m_Calls: [] + _OnDisable: + m_PersistentCalls: + m_Calls: [] + _OnUpdate: + m_PersistentCalls: + m_Calls: [] + _OnLegacyRenderPipeline: + m_PersistentCalls: + m_Calls: [] + _OnHighDefinitionPipeline: + m_PersistentCalls: + m_Calls: [] + _OnUniversalRenderPipeline: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &4383142685895245554 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 809695123049724894} + - component: {fileID: 3863665756249752423} + - component: {fileID: 838713473354403732} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &809695123049724894 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4383142685895245554} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2011709273370429250} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3863665756249752423 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4383142685895245554} + m_CullTransparentMesh: 1 +--- !u!114 &838713473354403732 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4383142685895245554} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.6} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5278351310767075283 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2011709273370429250} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2011709273370429250 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5278351310767075283} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 809695123049724894} + m_Father: {fileID: 6710306375200902518} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &5934383098451048299 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5247774070925551825} + - component: {fileID: 2637455736181698835} + - component: {fileID: 9213561088142874804} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5247774070925551825 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5934383098451048299} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4756183279575944939} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -120, y: 0} + m_SizeDelta: {x: 300, y: 150} + m_Pivot: {x: 1, y: 1} +--- !u!222 &2637455736181698835 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5934383098451048299} + m_CullTransparentMesh: 1 +--- !u!114 &9213561088142874804 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5934383098451048299} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8026813, g: 0.5157232, b: 1, a: 0.6} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 60 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 120 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Preview +--- !u!1 &5942465880724536934 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3082800800829376572} + - component: {fileID: 6569302601408354596} + m_Layer: 0 + m_Name: Rig + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3082800800829376572 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5942465880724536934} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1532193951456099954} + - {fileID: 1537803801386969555} + - {fileID: 2613380069347621712} + m_Father: {fileID: 5655619906866042202} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6569302601408354596 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5942465880724536934} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f069d1ec9fe154d3ba75ff75ed08e5b9, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ResetOnDisable: 1 + _IsLocal: 0 + _Velocity: {x: -5, y: 0, z: 0} + _AngularVelocity: {x: 0, y: 0, z: 0} +--- !u!1 &6025157281597741479 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6710306375200902518} + - component: {fileID: 5549572483640152611} + m_Layer: 5 + m_Name: Slider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6710306375200902518 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6025157281597741479} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 9161415325889171774} + - {fileID: 2011709273370429250} + - {fileID: 4583927076051335723} + m_Father: {fileID: 8508843123630950484} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 25} + m_Pivot: {x: 0.5, y: 0.25} +--- !u!114 &5549572483640152611 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6025157281597741479} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 0 + m_TargetGraphic: {fileID: 2367000814331364466} + m_FillRect: {fileID: 809695123049724894} + m_HandleRect: {fileID: 4439941709532542476} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 1 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &6622434646978147655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4439941709532542476} + - component: {fileID: 7154511050642823623} + - component: {fileID: 2367000814331364466} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4439941709532542476 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6622434646978147655} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4583927076051335723} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7154511050642823623 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6622434646978147655} + m_CullTransparentMesh: 1 +--- !u!114 &2367000814331364466 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6622434646978147655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &6687281491074397554 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5249640841318866070} + - component: {fileID: 4231131790373154547} + - component: {fileID: 4073730310395142793} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5249640841318866070 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6687281491074397554} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4216997059981498178} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -120, y: 0} + m_SizeDelta: {x: 300, y: 150} + m_Pivot: {x: 1, y: 1} +--- !u!222 &4231131790373154547 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6687281491074397554} + m_CullTransparentMesh: 1 +--- !u!114 &4073730310395142793 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6687281491074397554} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 0, b: 0, a: 0.6} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 60 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 120 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: No Supported +--- !u!1 &7073353168858055978 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1532193951456099954} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1532193951456099954 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7073353168858055978} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1182797344158084794} + - {fileID: 4441022467784161535} + m_Father: {fileID: 3082800800829376572} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7376691663823679560 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2613380069347621712} + m_Layer: 0 + m_Name: Viewpoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2613380069347621712 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7376691663823679560} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3082800800829376572} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8912400735101172235 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4912233197470644161} + - component: {fileID: 2853796242865667210} + m_Layer: 0 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4912233197470644161 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8912400735101172235} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3108025400259455776} + m_Father: {fileID: 5655619906866042202} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2853796242865667210 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8912400735101172235} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e64c239f69eea46778ded6dcc3427a34, type: 3} + m_Name: + m_EditorClassIdentifier: + _Layer: 4 + _Material: {fileID: 2100000, guid: d82d92d8d8f214cd0b8bf7c185b2c341, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 0} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Version: 1 + _Camera: {fileID: 0} + _TimeProvider: {fileID: 0} + _WindZone: {fileID: 0} + _OverrideWindZoneWindSpeed: 0 + _WindSpeed: 10 + _OverrideWindZoneWindDirection: 0 + _WindDirection: 0 + _OverrideWindZoneWindTurbulence: 0 + _WindTurbulence: 0.145 + _OverrideGravity: 0 + _GravityOverride: -9.8 + _GravityMultiplier: 1 + _PrimaryLight: {fileID: 0} + _InjectionPoint: 0 + _WriteToColorTexture: 1 + _WriteToDepthTexture: 1 + _WriteMotionVectors: 1 + _OverrideRenderHDR: 0 + _RenderHDR: 1 + _Surface: + rid: 1013 + _ScaleRange: {x: 8, y: 8} + _DropDetailHeightBasedOnWaves: 0.081 + _Slices: 7 + _Resolution: 384 + _GeometryDownSampleFactor: 2 + _ExtentsSizeMultiplier: 100 + _Viewpoint: {fileID: 2613380069347621712} + _CenterOfDetailDisplacementCorrection: 1 + _SampleTerrainHeightForScale: 1 + _ForceScaleChangeSmoothing: 0 + _TeleportThreshold: 10 + _AnimatedWavesLod: + rid: 5163698739167625228 + _DepthLod: + rid: 1001 + _LevelLod: + rid: 1002 + _FoamLod: + rid: 1003 + _DynamicWavesLod: + rid: 1004 + _FlowLod: + rid: 1005 + _ShadowLod: + rid: 1006 + _AbsorptionLod: + rid: 1000 + _ScatteringLod: + rid: 1012 + _ClipLod: + rid: 1007 + _AlbedoLod: + rid: 1008 + _Reflections: + rid: 1009 + _Underwater: + rid: 1010 + _Meniscus: + rid: 1014 + _Portals: + rid: 1011 + _ShowWaterProxyPlane: 0 + _EditModeFrameRate: 30 + _FollowSceneCamera: 1 + _HeightQueries: 1 + _Debug: + _AttachDebugGUI: 0 + _ShowHiddenObjects: 0 + _DisableFollowViewpoint: 0 + _DestroyResourcesInOnDisable: 0 + _DrawLodOutline: 0 + _ShowDebugInformation: 0 + _LogScaleChange: 0 + _PauseOnScaleChange: 0 + _IgnoreWavesForScaleChange: 0 + _ForceNoGraphics: 0 + _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + references: + version: 2 + RefIds: + - rid: 1000 + type: {class: AbsorptionLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 7 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 1.026, g: 2.085, b: 2.5500002, a: 0.306} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1001 + type: {class: DepthLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 46 + _IncludeTerrainHeight: 0 + _EnableSignedDistanceFields: 1 + - rid: 1002 + type: {class: LevelLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 300 + _TextureFormat: 45 + - rid: 1003 + type: {class: FoamLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 45 + _SimulationFrequency: 30 + _Prewarm: 1 + _Settings: {fileID: 0} + - rid: 1004 + type: {class: DynamicWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 512 + _TextureFormatMode: 300 + _TextureFormat: 46 + _SimulationFrequency: 120 + _AttenuationInShallows: 1 + _Settings: {fileID: 0} + - rid: 1005 + type: {class: FlowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 128 + _TextureFormatMode: 100 + _TextureFormat: 46 + - rid: 1006 + type: {class: ShadowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 6 + _SimulationFrequency: 60 + _DynamicSoftShadows: 1 + _SoftJitterExtinctionFactor: 0.75 + _JitterDiameterSoft: 15 + _CurrentFrameWeightSoft: 0.03 + _JitterDiameterHard: 0.6 + _CurrentFrameWeightHard: 0.15 + _AllowNullLight: 0 + _AllowNoShadows: 0 + - rid: 1007 + type: {class: ClipLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 5 + _DefaultClippingState: 1 + - rid: 1008 + type: {class: AlbedoLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 768 + _TextureFormatMode: 100 + _TextureFormat: 8 + - rid: 1009 + type: {class: WaterReflections, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 0 + _Mode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 1 + _Resolution: 256 + _RenderOnlySingleCamera: 0 + _Sky: 0 + _DisablePixelLights: 1 + _DisableShadows: 1 + _HDR: 1 + _Stencil: 0 + _AllowMSAA: 0 + _QualitySettingsOverride: + _OverrideLodBias: 0 + _LodBias: 0.5 + _OverrideMaximumLodLevel: 0 + _MaximumLodLevel: 1 + _OverrideTerrainPixelError: 0 + _TerrainPixelError: 10 + _ClipPlaneOffset: 0 + _FarClipPlane: 1000 + _DisableOcclusionCulling: 1 + _RefreshPerFrames: 1 + _FrameRefreshOffset: 0 + _UseObliqueMatrix: 1 + _NonObliqueNearSurface: 0 + _NonObliqueNearSurfaceThreshold: 0.05 + _Debug: + _ShowHiddenObjects: 0 + _DisableRecursiveRendering: 0 + - rid: 1010 + type: {class: UnderwaterRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: f2b096e4d95e646c49d48ece0afa0547, type: 2} + _EnvironmentalLightingEnable: 0 + _EnvironmentalLightingWeight: 1 + _EnvironmentalLightingVolumeProfile: {fileID: 0} + _AllCameras: 0 + _CopyWaterMaterialParametersEachFrame: 1 + _FarPlaneMultiplier: 0.68 + _CullLimit: 0.001 + _Debug: + _VisualizeMask: 0 + _DisableMask: 0 + _VisualizeStencil: 0 + _DisableHeightAboveWaterOptimization: 0 + _DisableArtifactCorrection: 0 + _OnlyReflectionCameras: 0 + - rid: 1011 + type: {class: PortalRenderer, ns: WaveHarmonic.Crest.Portals, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Mode: 3 + _Geometry: {fileID: 6094660498847485368} + _Invert: 0 + - rid: 1012 + type: {class: ScatteringLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 23 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 0, g: 0.588, b: 1.2, a: 6} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1013 + type: {class: SurfaceRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: d82d92d8d8f214cd0b8bf7c185b2c341, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 0} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Debug: + _UniformTiles: 0 + _DisableSkirt: 0 + - rid: 1014 + type: {class: Meniscus, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 238e45299a5ec46308e9bf99ddf67963, type: 2} + - rid: 5163698739167625228 + type: {class: AnimatedWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 48 + _WaveResolutionMultiplier: 1 + _AttenuationInShallows: 0.95 + _ShallowsMaximumDepth: 1000 + _CollisionSource: 2 + _CollisionLayers: -1 + _MaximumQueryCount: 4096 + _BakedWaveData: {fileID: 0} +--- !u!1 &9077896628645171223 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9161415325889171774} + - component: {fileID: 4573700645987790673} + - component: {fileID: 2974041216723351245} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &9161415325889171774 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9077896628645171223} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6710306375200902518} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4573700645987790673 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9077896628645171223} + m_CullTransparentMesh: 1 +--- !u!114 &2974041216723351245 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9077896628645171223} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.46226418, g: 0.46226418, b: 0.46226418, a: 0} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1001 &3630966176769138550 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1532193951456099954} + m_Modifications: + - target: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_Name + value: Camera + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.y + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.z + value: -21 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.9659258 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.2588191 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c26fe2b4fef6c484089497b549dd6b04, type: 3} +--- !u!4 &1182797344158084794 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 3630966176769138550} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &4662769363411699888 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1532193951456099954} + m_Modifications: + - target: {fileID: 6079220456006713144, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_Name + value: PostProcessing + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5e01cffb9e8324147affb8e08fd5ed13, type: 3} +--- !u!4 &4441022467784161535 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + m_PrefabInstance: {fileID: 4662769363411699888} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_Scenes.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_Scenes.prefab.meta new file mode 100644 index 0000000..2d70a4a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Examples_Scenes.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8b98a14ae91dd498d8f577f0f8f4aff1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes.meta new file mode 100644 index 0000000..6dffad2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40d6edbce24bb4de78a970565f41bac5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Albedo.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Albedo.prefab new file mode 100644 index 0000000..cccaec1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Albedo.prefab @@ -0,0 +1,408 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3542824373030059513 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1838333010390672545} + - component: {fileID: 7774492666511606227} + - component: {fileID: 2404576928627305884} + - component: {fileID: 5663845876579632776} + m_Layer: 0 + m_Name: CrestLogo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1838333010390672545 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3542824373030059513} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 7.5, y: 7.5, z: 7.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2657230488372934684} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &7774492666511606227 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3542824373030059513} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2404576928627305884 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3542824373030059513} + m_Enabled: 0 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 0 + m_StaticShadowCaster: 0 + m_MotionVectors: 2 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e40b4c328aeec4f43943883ee9c70ccc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &5663845876579632776 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3542824373030059513} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c972e8f11f2447768dc0314b7bc34a4, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5163698717554376705 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 5163698717554376705 + type: {class: AlbedoRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 5663845876579632776} + _Renderer: {fileID: 2404576928627305884} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1 &4811082362463432963 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3045335462880455184} + - component: {fileID: 1686987402272609885} + - component: {fileID: 493122196572431846} + m_Layer: 0 + m_Name: Albedo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &3045335462880455184 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811082362463432963} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2657230488372934684} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1686987402272609885 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811082362463432963} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c948522afe4014818ad3ab8b5dad00b6, type: 3} + m_Name: + m_EditorClassIdentifier: + _Previous: 44 + _Next: 46 + _Prefabs: [] +--- !u!114 &493122196572431846 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811082362463432963} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a8eca7a783ef84759a4e965c9d6d8827, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ExecuteUpdateEvery: 0 + _StopExecutingUpdateAfter: Infinity + _OnEnable: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: UnityEngine.UI.Text, UnityEngine.UI + m_MethodName: set_text + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Albedo + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: UnityEngine.UI.Slider, UnityEngine.UI + m_MethodName: set_maxValue + m_Mode: 4 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + _OnDisable: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: Crest.OceanRenderer, Crest + m_MethodName: ClearLodData + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + _OnUpdate: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: UnityEngine.UI.Slider, UnityEngine.UI + m_MethodName: set_value + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + _OnLegacyRenderPipeline: + m_PersistentCalls: + m_Calls: [] + _OnHighDefinitionPipeline: + m_PersistentCalls: + m_Calls: [] + _OnUniversalRenderPipeline: + m_PersistentCalls: + m_Calls: [] +--- !u!1001 &4865865868520106964 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_Albedo + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1008]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Albedo + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 3045335462880455184} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1838333010390672545} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &2657230488372934684 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 4865865868520106964} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Albedo.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Albedo.prefab.meta new file mode 100644 index 0000000..88035f5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Albedo.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c991a6f7c7bf14d29a1868ab0ba78d9b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AnimatedObjectWaterInteraction.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AnimatedObjectWaterInteraction.prefab new file mode 100644 index 0000000..409153a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AnimatedObjectWaterInteraction.prefab @@ -0,0 +1,299 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3495908683225573380 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5925470013758854825} + - component: {fileID: 7984029441643147436} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5925470013758854825 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3495908683225573380} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6020503174337168388} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7984029441643147436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3495908683225573380} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 2 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &7858669412983570364 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6020503174337168388} + - component: {fileID: 2500991241181967549} + - component: {fileID: 5676854774867548718} + - component: {fileID: 2394250645192636544} + - component: {fileID: 5069160288498630691} + m_Layer: 0 + m_Name: AnimatedObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6020503174337168388 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858669412983570364} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5925470013758854825} + m_Father: {fileID: 7883320378712145387} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2500991241181967549 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858669412983570364} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5676854774867548718 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858669412983570364} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 35af310c2690e42a6a9d2ca36256e92c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &2394250645192636544 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858669412983570364} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &5069160288498630691 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858669412983570364} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e67c8b7e3e4e04c46b61963b7c204049, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Axis: {x: 0, y: 0, z: 1} + _Amplitude: 10 + _Frequency: 1 + _OrthogonalMotion: 1 + _RotationFrequency: 1 + _RotationVelocity: 0 +--- !u!1001 &720655290162540067 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1115572721750479147, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_AnimatedObjectWaterInteraction + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _SurfaceSelfIntersectionFixMode + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1004]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Animated Object Water Interaction + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6020503174337168388} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &7883320378712145387 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 720655290162540067} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AnimatedObjectWaterInteraction.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AnimatedObjectWaterInteraction.prefab.meta new file mode 100644 index 0000000..8f8cc3a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AnimatedObjectWaterInteraction.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: db335a3706b7d44d1ac6b241f9626d5f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromShorelineDistance.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromShorelineDistance.prefab new file mode 100644 index 0000000..e28b77a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromShorelineDistance.prefab @@ -0,0 +1,589 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4023746972332693635 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5986233323415515897} + - component: {fileID: 5680421479114229220} + m_Layer: 0 + m_Name: DepthProbe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5986233323415515897 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4023746972332693635} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 25, y: 1, z: 25} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3953065886040743313} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5680421479114229220 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4023746972332693635} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70deb49b538e247b9ab1bf7773d16809, type: 3} + m_Name: + m_EditorClassIdentifier: + _Type: 0 + _RefreshMode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 2147483648 + _Resolution: 512 + _CaptureRange: {x: -1000, y: 1000} + _FillHolesCaptureHeight: 0 + _EnableBackFaceInclusion: 1 + _QualitySettingsOverride: + _OverrideLodBias: 1 + _LodBias: Infinity + _OverrideMaximumLodLevel: 1 + _MaximumLodLevel: 0 + _OverrideTerrainPixelError: 1 + _TerrainPixelError: 0 + _SavedTexture: {fileID: 0} + _GenerateSignedDistanceField: 1 + _AdditionalJumpFloodRounds: 7 + _Debug: + _ForceAlwaysUpdateDebug: 0 + _ShowHiddenObjects: 0 + _ShowSimulationDataInScene: 0 + _Version: 1 +--- !u!1 &4699276825329845214 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 263026714941628710} + - component: {fileID: 3367902521283844933} + - component: {fileID: 8897215140587064799} + - component: {fileID: 3394218185223768033} + - component: {fileID: 8446232894501823197} + - component: {fileID: 4439216925166734363} + m_Layer: 0 + m_Name: Listener + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &263026714941628710 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4699276825329845214} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -15, y: 1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3953065886040743313} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3367902521283844933 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4699276825329845214} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8897215140587064799 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4699276825329845214} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 35af310c2690e42a6a9d2ca36256e92c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &3394218185223768033 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4699276825329845214} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 555f01a6f203a4b6db9ec558f7451e4c, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Source: 0 + _Layer: 0 + _MinimumWavelength: 1 + _DistanceFromSurfaceSigned: 0 + _DistanceFromSurfaceMaximum: 100 + _DistanceFromSurfaceUseCurve: 1 + _DistanceFromSurfaceCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + _DistanceFromEdgeSigned: 0 + _DistanceFromEdgeMaximum: 10 + _DistanceFromEdgeUseCurve: 1 + _DistanceFromEdgeCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + _OnBelowWater: + m_PersistentCalls: + m_Calls: [] + _OnAboveWater: + m_PersistentCalls: + m_Calls: [] + _DistanceFromSurface: + m_PersistentCalls: + m_Calls: [] + _DistanceFromEdge: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 8446232894501823197} + m_TargetAssemblyTypeName: UnityEngine.AudioSource, UnityEngine + m_MethodName: set_volume + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!82 &8446232894501823197 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4699276825329845214} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: e32127731094449be80fae3d8e2b9d4a, type: 3} + m_PlayOnAwake: 1 + m_Volume: 0 + m_Pitch: 1 + Loop: 1 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!95 &4439216925166734363 +Animator: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4699276825329845214} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 1bfd12080c3674beaa7fbbd36299b110, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 +--- !u!1 &5507303797803518522 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7918390616013998140} + - component: {fileID: 8574675338044503541} + - component: {fileID: 7481491128146161828} + - component: {fileID: 6304607435952483912} + m_Layer: 31 + m_Name: Island + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7918390616013998140 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5507303797803518522} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.75, z: 0} + m_LocalScale: {x: 15, y: 2, z: 15} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3953065886040743313} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8574675338044503541 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5507303797803518522} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7481491128146161828 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5507303797803518522} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &6304607435952483912 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5507303797803518522} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &5889435405882003033 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_AudioFromShorelineDistance + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1001]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1003]._Settings + value: + objectReference: {fileID: 11400000, guid: 716e7acbfd99c48d59432325fdfd1657, + type: 2} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Audio From Shoreline Distance + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 263026714941628710} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 7918390616013998140} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 5986233323415515897} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &3953065886040743313 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 5889435405882003033} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromShorelineDistance.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromShorelineDistance.prefab.meta new file mode 100644 index 0000000..e039c99 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromShorelineDistance.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d808526de1dd84298843230df4361f27 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromSurfaceDistance.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromSurfaceDistance.prefab new file mode 100644 index 0000000..99308ef --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromSurfaceDistance.prefab @@ -0,0 +1,689 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1211408513248259621 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7807888801931198709} + - component: {fileID: 4193335865982452581} + - component: {fileID: 1022050665209294642} + - component: {fileID: 936791613751610604} + - component: {fileID: 1193137090130217728} + - component: {fileID: 2682475239444047075} + m_Layer: 0 + m_Name: Listener + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7807888801931198709 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211408513248259621} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2331456815662467157} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4193335865982452581 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211408513248259621} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1022050665209294642 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211408513248259621} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 35af310c2690e42a6a9d2ca36256e92c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &936791613751610604 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211408513248259621} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &1193137090130217728 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211408513248259621} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 555f01a6f203a4b6db9ec558f7451e4c, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Source: 0 + _Layer: 0 + _MinimumWavelength: 1 + _DistanceFromSurfaceSigned: 0 + _DistanceFromSurfaceMaximum: 7 + _DistanceFromSurfaceUseCurve: 1 + _DistanceFromSurfaceCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + _DistanceFromEdgeSigned: 0 + _DistanceFromEdgeMaximum: 100 + _DistanceFromEdgeUseCurve: 1 + _DistanceFromEdgeCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + _OnBelowWater: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 5875393770494529479} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 6521053220879226861} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + _OnAboveWater: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 5875393770494529479} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 6521053220879226861} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + _DistanceFromSurface: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 7235614830846868296} + m_TargetAssemblyTypeName: UnityEngine.AudioSource, UnityEngine + m_MethodName: set_volume + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + _DistanceFromEdge: + m_PersistentCalls: + m_Calls: [] +--- !u!95 &2682475239444047075 +Animator: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211408513248259621} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 3d680eb04bc284eea9e892eaed4b99cf, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 +--- !u!1 &2103837336283650378 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4498844211400433554} + m_Layer: 0 + m_Name: Audio + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4498844211400433554 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2103837336283650378} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4545352005400537390} + - {fileID: 5728373604658596846} + m_Father: {fileID: 2331456815662467157} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8757997039483614501 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5728373604658596846} + - component: {fileID: 6521053220879226861} + m_Layer: 0 + m_Name: BelowWater + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5728373604658596846 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8757997039483614501} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4498844211400433554} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!82 &6521053220879226861 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8757997039483614501} + m_Enabled: 0 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 7bdd4f6975cad464f98739af0ea17dce, type: 3} + m_PlayOnAwake: 1 + m_Volume: 0.5 + m_Pitch: 1 + Loop: 1 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1 &9170129753840689287 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4545352005400537390} + - component: {fileID: 7235614830846868296} + - component: {fileID: 5875393770494529479} + m_Layer: 0 + m_Name: AboveWater + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4545352005400537390 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9170129753840689287} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4498844211400433554} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!82 &7235614830846868296 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9170129753840689287} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 87844326d709c4375a39023c2ef63faa, type: 3} + m_PlayOnAwake: 1 + m_Volume: 0 + m_Pitch: 1 + Loop: 1 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!169 &5875393770494529479 +AudioLowPassFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9170129753840689287} + m_Enabled: 0 + serializedVersion: 3 + m_LowpassResonanceQ: 1 + lowpassLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.029104138 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1001 &5133428105202981789 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_AudioFromSurfaceDistance + objectReference: {fileID: 0} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Audio From Surface Distance + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 7807888801931198709} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 4498844211400433554} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &2331456815662467157 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 5133428105202981789} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromSurfaceDistance.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromSurfaceDistance.prefab.meta new file mode 100644 index 0000000..f4197e2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_AudioFromSurfaceDistance.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1f89b1c7604634513b0fdd493a0fca4c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Clipping.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Clipping.prefab new file mode 100644 index 0000000..25f0ea0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Clipping.prefab @@ -0,0 +1,361 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6992450865259139609 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2040891020350016424} + - component: {fileID: 6155576512080950423} + - component: {fileID: 6275004083890305462} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2040891020350016424 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6992450865259139609} + serializedVersion: 2 + m_LocalRotation: {x: 0.25598985, y: -0.11130756, z: 0.38289875, w: 0.88060683} + m_LocalPosition: {x: 0, y: 6, z: 0} + m_LocalScale: {x: 5, y: 5, z: 5} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4880731786236650491} + m_Father: {fileID: 2274655822827284848} + m_LocalEulerAnglesHint: {x: 32.418, y: 0, z: 47} +--- !u!114 &6155576512080950423 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6992450865259139609} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26623fd0e291a478a9f8b68a3df7e8a6, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 4 + _Weight: 1 + _Queue: 1 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Version: 0 + _Primitive: 3 + _Inverted: 1 + _WaterHeightDistanceCulling: 0 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!95 &6275004083890305462 +Animator: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6992450865259139609} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 425c8bec3f4834bb1968a58c32f495f5, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 +--- !u!1 &7954058421475806798 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6247429439536972074} + - component: {fileID: 7753874332638154716} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6247429439536972074 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7954058421475806798} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2274655822827284848} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7753874332638154716 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7954058421475806798} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26623fd0e291a478a9f8b68a3df7e8a6, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 4 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Version: 0 + _Primitive: 0 + _Inverted: 0 + _WaterHeightDistanceCulling: 0 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &8482956829687836774 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4880731786236650491} + - component: {fileID: 8337751942636764263} + - component: {fileID: 8301462729270035960} + - component: {fileID: 6380356144163358633} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4880731786236650491 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8482956829687836774} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2040891020350016424} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8337751942636764263 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8482956829687836774} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8301462729270035960 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8482956829687836774} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: ecfe7530e35f6ef4599de91f34369545, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &6380356144163358633 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8482956829687836774} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &8716247989862808248 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1115572721750479147, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_Clipping + objectReference: {fileID: 0} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Surface Clip + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6247429439536972074} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 2040891020350016424} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &2274655822827284848 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 8716247989862808248} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Clipping.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Clipping.prefab.meta new file mode 100644 index 0000000..c24b3db --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Clipping.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c593e62ba4a5f44ec88f8d817bdff3ef +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Color.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Color.prefab new file mode 100644 index 0000000..56f9dfc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Color.prefab @@ -0,0 +1,390 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1110113421552575520 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3202780988344745363} + - component: {fileID: 5705020565991623131} + - component: {fileID: 5220331307787431442} + - component: {fileID: 6335437839286390866} + - component: {fileID: 6879009723071428106} + m_Layer: 0 + m_Name: Absorption + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3202780988344745363 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1110113421552575520} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2657230488372934684} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &5705020565991623131 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1110113421552575520} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5220331307787431442 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1110113421552575520} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 942c58eb9fdd547db965493725bb7b94, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &6335437839286390866 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1110113421552575520} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &6879009723071428106 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1110113421552575520} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 247a7260095bc49429a7f7cb2a4851d5, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 4 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 323759375422586995 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 323759375422586995 + type: {class: AbsorptionRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 6879009723071428106} + _Renderer: {fileID: 5220331307787431442} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1 &4435887530159174512 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2879688496419657466} + - component: {fileID: 7104301442065879252} + - component: {fileID: 7308856809087349850} + - component: {fileID: 7347029058404462362} + m_Layer: 0 + m_Name: Scattering + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2879688496419657466 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4435887530159174512} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2657230488372934684} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &7104301442065879252 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4435887530159174512} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7308856809087349850 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4435887530159174512} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b1adf67044a694bc28d41fd27a71d64c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &7347029058404462362 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4435887530159174512} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c85179d3b43c5467da99463c8a2199ab, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 4 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 323759375422586998 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 323759375422586998 + type: {class: ScatteringRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 7347029058404462362} + _Renderer: {fileID: 7308856809087349850} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1001 &4865865868520106964 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_Color + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1000]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1012]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Absorption and Scattering + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 3202780988344745363} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 2879688496419657466} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &2657230488372934684 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 4865865868520106964} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Color.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Color.prefab.meta new file mode 100644 index 0000000..e2acdc9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Color.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 548ae7b2e9efd4de685e7f9df67c4356 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ComplexObjectWaterInteraction.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ComplexObjectWaterInteraction.prefab new file mode 100644 index 0000000..73b2d06 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ComplexObjectWaterInteraction.prefab @@ -0,0 +1,2169 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &656956603992063944 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7715370253436845793} + - component: {fileID: 4942887101738908549} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7715370253436845793 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 656956603992063944} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1383078743145615170} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &4942887101738908549 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 656956603992063944} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &897517666941272465 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7438665226294950477} + - component: {fileID: 4106438202450624974} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7438665226294950477 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 897517666941272465} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8196679608120218674} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &4106438202450624974 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 897517666941272465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &1145551216656734788 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3258910299618787340} + - component: {fileID: 748018048404946945} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3258910299618787340 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145551216656734788} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 857732351245764653} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &748018048404946945 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145551216656734788} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &1187586763540934360 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 242085513304535582} + - component: {fileID: 2901580597580214544} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &242085513304535582 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1187586763540934360} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8151466449197499155} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &2901580597580214544 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1187586763540934360} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &1660871373271159445 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1326935151482864539} + - component: {fileID: 1994925341476223517} + - component: {fileID: 1150399446315585805} + - component: {fileID: 7749992621172835268} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1326935151482864539 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1660871373271159445} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 2.9, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7284268494372076831} + - {fileID: 5264987200103310935} + - {fileID: 5462965061748164190} + - {fileID: 1383078743145615170} + - {fileID: 857732351245764653} + - {fileID: 8813906679418559534} + m_Father: {fileID: 8623857918174994108} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1994925341476223517 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1660871373271159445} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1150399446315585805 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1660871373271159445} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &7749992621172835268 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1660871373271159445} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &1724481368684180033 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 857732351245764653} + m_Layer: 0 + m_Name: Sphere (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &857732351245764653 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724481368684180033} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.51724136, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3258910299618787340} + m_Father: {fileID: 1326935151482864539} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2022951585586873862 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 869163461044330765} + - component: {fileID: 1796729354565713657} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &869163461044330765 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2022951585586873862} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1264313061248432196} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &1796729354565713657 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2022951585586873862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &2141953708484073644 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8650997888409795061} + - component: {fileID: 5459612673583366752} + - component: {fileID: 7534242005069972378} + - component: {fileID: 1454555780902741345} + m_Layer: 0 + m_Name: Cylinder (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8650997888409795061 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2141953708484073644} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 2.9, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1792005808136002654} + - {fileID: 8303874154608198899} + - {fileID: 9123510874130713450} + - {fileID: 5892547179783611981} + - {fileID: 1264313061248432196} + - {fileID: 5015703990062346824} + m_Father: {fileID: 8623857918174994108} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!33 &5459612673583366752 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2141953708484073644} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7534242005069972378 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2141953708484073644} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &1454555780902741345 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2141953708484073644} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &2460104911236305580 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1792005808136002654} + m_Layer: 0 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1792005808136002654 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2460104911236305580} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.8620689, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6683028200346588568} + m_Father: {fileID: 8650997888409795061} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2764468114143594268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8623857918174994108} + - component: {fileID: 1313852499239455775} + m_Layer: 0 + m_Name: Spinner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8623857918174994108 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2764468114143594268} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1326935151482864539} + - {fileID: 8650997888409795061} + - {fileID: 6221927669577225041} + m_Father: {fileID: 4780313556621431966} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1313852499239455775 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2764468114143594268} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e67c8b7e3e4e04c46b61963b7c204049, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Axis: {x: 0, y: 1, z: 0} + _Amplitude: 0 + _Frequency: 1 + _OrthogonalMotion: 0 + _RotationFrequency: 1 + _RotationVelocity: 100 +--- !u!1 &2977899173332876813 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3676429522358593934} + - component: {fileID: 4353697168512318996} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3676429522358593934 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2977899173332876813} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8813906679418559534} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &4353697168512318996 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2977899173332876813} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3165919886189754546 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1366873693928920086} + - component: {fileID: 2600763222212301447} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1366873693928920086 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3165919886189754546} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5462965061748164190} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &2600763222212301447 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3165919886189754546} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3376433679663147256 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5810342754497851510} + - component: {fileID: 1420589978585080553} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5810342754497851510 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3376433679663147256} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7780833494627834120} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &1420589978585080553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3376433679663147256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &3770627334946573709 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1503998906979759044} + m_Layer: 0 + m_Name: Sphere (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1503998906979759044 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3770627334946573709} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.17241378, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8743854272323023198} + m_Father: {fileID: 6221927669577225041} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3824731145085267884 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5749868989672109666} + - component: {fileID: 6815426206778217783} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5749868989672109666 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3824731145085267884} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5015703990062346824} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &6815426206778217783 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3824731145085267884} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &4083585538651381382 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9123510874130713450} + m_Layer: 0 + m_Name: Sphere (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9123510874130713450 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4083585538651381382} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.17241378, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4813476122133436143} + m_Father: {fileID: 8650997888409795061} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4237327800200168414 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8743854272323023198} + - component: {fileID: 8612530352345413860} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8743854272323023198 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4237327800200168414} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1503998906979759044} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &8612530352345413860 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4237327800200168414} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &4586714561961641917 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6683028200346588568} + - component: {fileID: 8391763896561844689} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6683028200346588568 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4586714561961641917} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1792005808136002654} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &8391763896561844689 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4586714561961641917} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &5045418988823547867 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8303874154608198899} + m_Layer: 0 + m_Name: Sphere (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8303874154608198899 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5045418988823547867} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.51724136, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6605813324301977634} + m_Father: {fileID: 8650997888409795061} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5092433424008194046 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7780833494627834120} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7780833494627834120 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5092433424008194046} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.8620689, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5810342754497851510} + m_Father: {fileID: 6221927669577225041} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5534440405011431109 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5462965061748164190} + m_Layer: 0 + m_Name: Sphere (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5462965061748164190 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5534440405011431109} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.17241378, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1366873693928920086} + m_Father: {fileID: 1326935151482864539} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5680210071271907968 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8813906679418559534} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8813906679418559534 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5680210071271907968} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.8620689, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3676429522358593934} + m_Father: {fileID: 1326935151482864539} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5931199047342814778 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4813476122133436143} + - component: {fileID: 1595713134818400636} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4813476122133436143 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5931199047342814778} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 9123510874130713450} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &1595713134818400636 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5931199047342814778} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &6231325079852454965 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8151466449197499155} + m_Layer: 0 + m_Name: Sphere (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8151466449197499155 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6231325079852454965} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.51724136, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 242085513304535582} + m_Father: {fileID: 6221927669577225041} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6238714089520932489 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1383078743145615170} + m_Layer: 0 + m_Name: Sphere (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1383078743145615170 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6238714089520932489} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.17241378, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7715370253436845793} + m_Father: {fileID: 1326935151482864539} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6616007905535293776 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4756657598194672312} + - component: {fileID: 7476578026220195915} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4756657598194672312 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6616007905535293776} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7284268494372076831} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &7476578026220195915 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6616007905535293776} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &6709323608197725246 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 429469726558267881} + m_Layer: 0 + m_Name: Sphere (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &429469726558267881 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6709323608197725246} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.17241378, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5128883333633415258} + m_Father: {fileID: 6221927669577225041} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6769655978994920495 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1264313061248432196} + m_Layer: 0 + m_Name: Sphere (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1264313061248432196 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6769655978994920495} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.51724136, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 869163461044330765} + m_Father: {fileID: 8650997888409795061} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6769812832721879253 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6605813324301977634} + - component: {fileID: 7142590504540676838} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6605813324301977634 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6769812832721879253} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8303874154608198899} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &7142590504540676838 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6769812832721879253} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &7020520627443738041 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3974312459409408205} + - component: {fileID: 1103656560181329525} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3974312459409408205 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7020520627443738041} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5264987200103310935} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &1103656560181329525 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7020520627443738041} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &7032294043178006815 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5892547179783611981} + m_Layer: 0 + m_Name: Sphere (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5892547179783611981 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7032294043178006815} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.17241378, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3755307066050119201} + m_Father: {fileID: 8650997888409795061} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7105310737722017689 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5128883333633415258} + - component: {fileID: 8113071677135627888} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5128883333633415258 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7105310737722017689} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 429469726558267881} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &8113071677135627888 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7105310737722017689} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &7712287944459438818 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5015703990062346824} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5015703990062346824 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7712287944459438818} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.8620689, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5749868989672109666} + m_Father: {fileID: 8650997888409795061} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7900757412190706033 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6221927669577225041} + - component: {fileID: 6285500139846024276} + - component: {fileID: 3182227753729248263} + - component: {fileID: 2664538837687115043} + m_Layer: 0 + m_Name: Cylinder (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6221927669577225041 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7900757412190706033} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 2.9, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8196679608120218674} + - {fileID: 6708888155170164711} + - {fileID: 429469726558267881} + - {fileID: 1503998906979759044} + - {fileID: 8151466449197499155} + - {fileID: 7780833494627834120} + m_Father: {fileID: 8623857918174994108} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} +--- !u!33 &6285500139846024276 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7900757412190706033} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &3182227753729248263 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7900757412190706033} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &2664538837687115043 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7900757412190706033} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &8195114696094213901 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6708888155170164711} + m_Layer: 0 + m_Name: Sphere (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6708888155170164711 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8195114696094213901} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.51724136, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5390648789627486538} + m_Father: {fileID: 6221927669577225041} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8563272778261003512 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5264987200103310935} + m_Layer: 0 + m_Name: Sphere (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5264987200103310935 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8563272778261003512} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.51724136, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3974312459409408205} + m_Father: {fileID: 1326935151482864539} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8649471603707439003 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5390648789627486538} + - component: {fileID: 6223931662004559409} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5390648789627486538 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8649471603707439003} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6708888155170164711} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &6223931662004559409 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8649471603707439003} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &8932607260129305267 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7284268494372076831} + m_Layer: 0 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7284268494372076831 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8932607260129305267} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.8620689, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4756657598194672312} + m_Father: {fileID: 1326935151482864539} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &9052779083288350902 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3755307066050119201} + - component: {fileID: 4380125012821543921} + m_Layer: 0 + m_Name: ProceduralInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3755307066050119201 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9052779083288350902} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5892547179783611981} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &4380125012821543921 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9052779083288350902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 3 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.45 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &9079598187134830145 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8196679608120218674} + m_Layer: 0 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8196679608120218674 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9079598187134830145} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.8620689, z: 0} + m_LocalScale: {x: 1, y: 0.34482756, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7438665226294950477} + m_Father: {fileID: 6221927669577225041} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2679769238578612054 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1115572721750479147, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_ComplexObjectWaterInteraction + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _ScaleRange.y + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _SurfaceSelfIntersectionFixMode + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1004]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1004]._Settings + value: + objectReference: {fileID: 11400000, guid: 287009c927f61554e858440ab8f5520b, + type: 2} + - target: {fileID: 4945500242396800069, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.35355338 + objectReference: {fileID: 0} + - target: {fileID: 4945500242396800069, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.1464466 + objectReference: {fileID: 0} + - target: {fileID: 4945500242396800069, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.8535535 + objectReference: {fileID: 0} + - target: {fileID: 4945500242396800069, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.35355338 + objectReference: {fileID: 0} + - target: {fileID: 4945500242396800069, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 45 + objectReference: {fileID: 0} + - target: {fileID: 4945500242396800069, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 135 + objectReference: {fileID: 0} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Complex Object Water Interaction + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8623857918174994108} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &4780313556621431966 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 2679769238578612054} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ComplexObjectWaterInteraction.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ComplexObjectWaterInteraction.prefab.meta new file mode 100644 index 0000000..d3dbd51 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ComplexObjectWaterInteraction.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9798c3ecca7e743339ca45802ff112cf +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FloatingObjects.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FloatingObjects.prefab new file mode 100644 index 0000000..2f96e13 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FloatingObjects.prefab @@ -0,0 +1,413 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &341145004360408629 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_FloatingObjects + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1004]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Floating Objects + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 4586859356124459972} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 510414307367690215} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8023298220426844320} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1585603024147405864} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &7195797433741594109 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 341145004360408629} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &2066873169911808049 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7195797433741594109} + m_Modifications: + - target: {fileID: 875385380025743593, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_Name + value: Examples_FloatingBox (2) + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84f17dfc7c7a7485296643a4e64d6200, type: 3} +--- !u!4 &8023298220426844320 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + m_PrefabInstance: {fileID: 2066873169911808049} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &5499094441694620501 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7195797433741594109} + m_Modifications: + - target: {fileID: 875385380025743593, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_Name + value: Examples_FloatingBox + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84f17dfc7c7a7485296643a4e64d6200, type: 3} +--- !u!4 &4586859356124459972 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + m_PrefabInstance: {fileID: 5499094441694620501} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7347139586002683065 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7195797433741594109} + m_Modifications: + - target: {fileID: 875385380025743593, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_Name + value: Examples_FloatingBox (3) + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.y + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84f17dfc7c7a7485296643a4e64d6200, type: 3} +--- !u!4 &1585603024147405864 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + m_PrefabInstance: {fileID: 7347139586002683065} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8422331713121437558 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7195797433741594109} + m_Modifications: + - target: {fileID: 875385380025743593, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_Name + value: Examples_FloatingBox (1) + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 84f17dfc7c7a7485296643a4e64d6200, type: 3} +--- !u!4 &510414307367690215 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8356280719142672529, guid: 84f17dfc7c7a7485296643a4e64d6200, + type: 3} + m_PrefabInstance: {fileID: 8422331713121437558} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FloatingObjects.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FloatingObjects.prefab.meta new file mode 100644 index 0000000..fb2ed17 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FloatingObjects.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bf5234a12cb8e44c4b5d8cdd224ab70b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FoamOverride.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FoamOverride.prefab new file mode 100644 index 0000000..52e551e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FoamOverride.prefab @@ -0,0 +1,701 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &705896221209381348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1834481402092340261} + - component: {fileID: 5268219813367229484} + m_Layer: 0 + m_Name: Spheres + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1834481402092340261 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705896221209381348} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4188193581593310332} + - {fileID: 4968593595413102927} + m_Father: {fileID: 6963057479425185542} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5268219813367229484 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705896221209381348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f069d1ec9fe154d3ba75ff75ed08e5b9, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ResetOnDisable: 0 + _IsLocal: 0 + _Velocity: {x: 0, y: 0, z: 0} + _AngularVelocity: {x: 0, y: 30, z: 0} +--- !u!1 &4337612368008300472 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4188193581593310332} + - component: {fileID: 8626405215151421599} + - component: {fileID: 7560813693079055819} + - component: {fileID: 8806216312614158669} + - component: {fileID: 4273708477456612640} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4188193581593310332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4337612368008300472} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 5} + m_LocalScale: {x: 5, y: 5, z: 5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1834481402092340261} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8626405215151421599 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4337612368008300472} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7560813693079055819 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4337612368008300472} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 99f41ed341ffedc4181a46734c9fa3e9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &8806216312614158669 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4337612368008300472} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &4273708477456612640 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4337612368008300472} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67bc7f0b9724d44ab9f0ddf0b1b5a773, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 1 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5163698717554376718 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 5163698717554376718 + type: {class: FoamRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 4273708477456612640} + _Renderer: {fileID: 7560813693079055819} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1 &5600424525568430332 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4968593595413102927} + - component: {fileID: 6337353098305340578} + - component: {fileID: 3130732529645916157} + - component: {fileID: 4437671991000323885} + - component: {fileID: 4777843738052628931} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4968593595413102927 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5600424525568430332} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -5} + m_LocalScale: {x: 5, y: 5, z: 5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1834481402092340261} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6337353098305340578 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5600424525568430332} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &3130732529645916157 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5600424525568430332} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: dedb48ec93e47a44691254da0aa8f80b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &4437671991000323885 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5600424525568430332} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &4777843738052628931 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5600424525568430332} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67bc7f0b9724d44ab9f0ddf0b1b5a773, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5163698717554376719 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 5163698717554376719 + type: {class: FoamRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 4777843738052628931} + _Renderer: {fileID: 3130732529645916157} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1 &6722937163714686976 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2485581345121730325} + - component: {fileID: 5257974380066342584} + - component: {fileID: 8008957703403072447} + - component: {fileID: 5399413260865741105} + m_Layer: 0 + m_Name: HalfFoam + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2485581345121730325 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6722937163714686976} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: -5, y: 0, z: 0} + m_LocalScale: {x: 10, y: 20, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6963057479425185542} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &5257974380066342584 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6722937163714686976} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8008957703403072447 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6722937163714686976} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bd761ca472aded547ad7c481436a7a08, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &5399413260865741105 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6722937163714686976} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67bc7f0b9724d44ab9f0ddf0b1b5a773, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 0.01 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5163698717554376720 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 5163698717554376720 + type: {class: FoamRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 5399413260865741105} + _Renderer: {fileID: 8008957703403072447} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1 &9200821330332384382 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3829629599389006906} + - component: {fileID: 1466608893003710589} + - component: {fileID: 1353571277396455784} + - component: {fileID: 8716336446455610138} + - component: {fileID: 8472705919931354767} + m_Layer: 0 + m_Name: HalfFoamPrime + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3829629599389006906 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9200821330332384382} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: -5, y: 0, z: 0} + m_LocalScale: {x: 10, y: 20, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6963057479425185542} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &1466608893003710589 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9200821330332384382} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1353571277396455784 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9200821330332384382} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: bd761ca472aded547ad7c481436a7a08, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &8716336446455610138 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9200821330332384382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67bc7f0b9724d44ab9f0ddf0b1b5a773, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5163698717554376720 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 5163698717554376720 + type: {class: FoamRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 8716336446455610138} + _Renderer: {fileID: 1353571277396455784} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!114 &8472705919931354767 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9200821330332384382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e3080de53ec3d224eba7fe59e0309668, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _LifeTime: 0.1 + _ScaleToZeroDuration: 0 +--- !u!1001 &560374709617362126 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_FoamOverride + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1003]._Settings + value: + objectReference: {fileID: 11400000, guid: 8c749742a2e70417e80c7ffddc9fe800, + type: 2} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Foam Override + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1834481402092340261} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 2485581345121730325} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 3829629599389006906} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &6963057479425185542 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 560374709617362126} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FoamOverride.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FoamOverride.prefab.meta new file mode 100644 index 0000000..0af37c6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_FoamOverride.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6aafc5cd4fcb24225acbb60555c4606c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_NestedFloatingObjects.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_NestedFloatingObjects.prefab new file mode 100644 index 0000000..471f8c3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_NestedFloatingObjects.prefab @@ -0,0 +1,1331 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &117025830056761632 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7979159119992690252} + - component: {fileID: 5082653054678002414} + - component: {fileID: 251394715416600060} + - component: {fileID: 7595090040795257982} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7979159119992690252 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 117025830056761632} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -4.75} + m_LocalScale: {x: 5, y: 5, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3491830378026218768} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &5082653054678002414 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 117025830056761632} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &251394715416600060 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 117025830056761632} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &7595090040795257982 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 117025830056761632} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1.0000001, y: 1, z: 1.0000001} + m_Center: {x: 0.000000038398092, y: 0, z: -0.0000009536743} +--- !u!1 &617910333914959549 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7034391957431008131} + - component: {fileID: 4294919725571002836} + - component: {fileID: 4398941353667612635} + - component: {fileID: 3036066877926364892} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7034391957431008131 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617910333914959549} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 4.75} + m_LocalScale: {x: 5, y: 5, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3491830378026218768} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4294919725571002836 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617910333914959549} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4398941353667612635 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617910333914959549} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &3036066877926364892 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617910333914959549} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1.0000001, y: 1, z: 1.0000001} + m_Center: {x: -0.000000038398092, y: 0, z: 0.0000009536743} +--- !u!1 &1300718774177703279 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4276982485925709554} + m_Layer: 0 + m_Name: Entity + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4276982485925709554 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1300718774177703279} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3491830378026218768} + - {fileID: 379791309925608387} + m_Father: {fileID: 7521799479354922213} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2162439605249084187 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5992697082937368351} + - component: {fileID: 6400713732861093504} + - component: {fileID: 8903673515281048361} + m_Layer: 0 + m_Name: Spawner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5992697082937368351 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2162439605249084187} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 15, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7343756901737848769} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6400713732861093504 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2162439605249084187} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fd850100d148b4b8b8ce7855c080de37, type: 3} + m_Name: + m_EditorClassIdentifier: + _Prefab: {fileID: 875385380025743593, guid: 84f17dfc7c7a7485296643a4e64d6200, type: 3} + _Mode: 1 + _DestroyInstances: 1 + _SpawnAsChild: 1 + _RandomizePosition: 1 + _RandomizePositionSphericalSize: 2 +--- !u!114 &8903673515281048361 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2162439605249084187} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a8eca7a783ef84759a4e965c9d6d8827, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ExecuteUpdateEvery: 0.2 + _StopExecutingUpdateAfter: 15 + _OnEnable: + m_PersistentCalls: + m_Calls: [] + _OnDisable: + m_PersistentCalls: + m_Calls: [] + _OnUpdate: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 6400713732861093504} + m_TargetAssemblyTypeName: WaveHarmonic.Crest.Examples.PrefabSpawner, WaveHarmonic.Crest.Samples + m_MethodName: Execute + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + _OnLegacyRenderPipeline: + m_PersistentCalls: + m_Calls: [] + _OnHighDefinitionPipeline: + m_PersistentCalls: + m_Calls: [] + _OnUniversalRenderPipeline: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &2608503289177932908 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1884075882832161950} + - component: {fileID: 4649215288419772468} + - component: {fileID: 2317157241118972220} + - component: {fileID: 1104737707508877825} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1884075882832161950 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2608503289177932908} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -2.25, z: 0} + m_LocalScale: {x: 5, y: 0.5, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3491830378026218768} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4649215288419772468 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2608503289177932908} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2317157241118972220 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2608503289177932908} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &1104737707508877825 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2608503289177932908} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1.0000002, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &2866911463717857655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5394964662119436845} + - component: {fileID: 2938701360988432238} + - component: {fileID: 6795958289520562835} + - component: {fileID: 2411251473714423911} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5394964662119436845 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2866911463717857655} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 3, y: 0, z: 0} + m_LocalScale: {x: 1, y: 5, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 379791309925608387} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!33 &2938701360988432238 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2866911463717857655} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6795958289520562835 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2866911463717857655} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &2411251473714423911 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2866911463717857655} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.50000024 + m_Height: 2.0000005 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940699} +--- !u!1 &3346691312990163104 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7521799479354922213} + - component: {fileID: 1642166530445019307} + - component: {fileID: 4273063063003778951} + m_Layer: 0 + m_Name: Open Container + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7521799479354922213 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3346691312990163104} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0.38268343, z: 0, w: 0.92387956} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4276982485925709554} + m_Father: {fileID: 7343756901737848769} + m_LocalEulerAnglesHint: {x: 0, y: 45, z: 0} +--- !u!54 &1642166530445019307 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3346691312990163104} + serializedVersion: 4 + m_Mass: 1000 + m_Drag: 0 + m_AngularDrag: 1.5 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &4273063063003778951 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3346691312990163104} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eba37e6f7ba7a4a488c7831f45a078b2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _RigidBody: {fileID: 1642166530445019307} + _Model: 0 + _Layer: 1 + _BuoyancyForceStrength: 7 + _BuoyancyTorqueStrength: 1 + _MaximumBuoyancyForce: Infinity + _CenterToBottomOffset: -1 + _AccelerateDownhill: 0 + _Probes: [] + _Drag: {x: 2, y: 3, z: 1} + _AngularDrag: 0.2 + _ForceHeightOffset: 0 + _ObjectWidth: 3 + _UseObjectLength: 0 + _ObjectLength: 3 + _Debug: + _DrawQueries: 0 +--- !u!1 &4454854836067234392 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7922282897426210489} + - component: {fileID: 2040903186261584450} + m_Layer: 0 + m_Name: RaiseWaterLevel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7922282897426210489 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4454854836067234392} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 21, y: 10, z: 21} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7343756901737848769} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2040903186261584450 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4454854836067234392} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4edd034314af4679ba066d79580dc1d, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 7 + _Weight: 1 + _Queue: 2 + _Blend: 0 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5498492912763142557 + _DrawBounds: 0 + _OverrideHeight: 0 + _HeightRange: {x: -100, y: 100} + _Version: 1 + references: + version: 2 + RefIds: + - rid: 5498492912763142557 + type: {class: LevelGeometryLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 2040903186261584450} + _Geometry: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &4825034609286131583 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2328411043987759021} + - component: {fileID: 7088506954994264167} + - component: {fileID: 4741364424116685745} + - component: {fileID: 3682873840882656938} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2328411043987759021 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4825034609286131583} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.25, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 5, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3491830378026218768} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7088506954994264167 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4825034609286131583} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4741364424116685745 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4825034609286131583} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &3682873840882656938 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4825034609286131583} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1.0000005, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0.000000011820373} +--- !u!1 &7096075005139923939 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3491830378026218768} + m_Layer: 0 + m_Name: Box + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3491830378026218768 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7096075005139923939} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -1.6, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2328411043987759021} + - {fileID: 3465834390558128220} + - {fileID: 7034391957431008131} + - {fileID: 7979159119992690252} + - {fileID: 1884075882832161950} + - {fileID: 6476827735626203773} + m_Father: {fileID: 4276982485925709554} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7172251002196798106 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3680574967886725646} + - component: {fileID: 7934161365930778394} + m_Layer: 0 + m_Name: LowerWaterLevel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3680574967886725646 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7172251002196798106} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -100, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 7343756901737848769} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7934161365930778394 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7172251002196798106} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4edd034314af4679ba066d79580dc1d, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 7 + _Weight: 1 + _Queue: 0 + _Blend: 0 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5498492912763142557 + _DrawBounds: 0 + _OverrideHeight: 0 + _HeightRange: {x: -100, y: 100} + _Version: 1 + references: + version: 2 + RefIds: + - rid: 5498492912763142557 + type: {class: LevelGeometryLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 7934161365930778394} + _Geometry: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &7193244289740569582 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6476827735626203773} + - component: {fileID: 8828546489631543412} + m_Layer: 0 + m_Name: ClipSurfaceConvexHull + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6476827735626203773 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7193244289740569582} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.125, z: 0} + m_LocalScale: {x: 4.5, y: 4.625, z: 9.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3491830378026218768} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8828546489631543412 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7193244289740569582} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ba152b967dd345829964814e3b3a4e6, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} + _Queue: 0 + _Mode: 0 + _Inverted: 0 + _UseClipWithDisplacement: 1 + _Debug: + _DrawBounds: 0 + _Version: 1 +--- !u!1 &8801716549099871655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3465834390558128220} + - component: {fileID: 2785517938215710681} + - component: {fileID: 1063568618838198746} + - component: {fileID: 9222062804435688643} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3465834390558128220 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8801716549099871655} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.25, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 5, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3491830378026218768} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2785517938215710681 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8801716549099871655} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1063568618838198746 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8801716549099871655} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &9222062804435688643 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8801716549099871655} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1.0000005, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: -0.000000011820373} +--- !u!1 &8983630524047813457 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5890297897985552762} + - component: {fileID: 8662831519097131115} + - component: {fileID: 5879782540484114233} + - component: {fileID: 5649559417456939316} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5890297897985552762 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8983630524047813457} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: -3, y: 0, z: 0} + m_LocalScale: {x: 1, y: 5, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 379791309925608387} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!33 &8662831519097131115 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8983630524047813457} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5879782540484114233 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8983630524047813457} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a46562f9ff954d159455b01470f91ad, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &5649559417456939316 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8983630524047813457} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.50000024 + m_Height: 2.0000005 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940699} +--- !u!1 &9128690918767125380 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 379791309925608387} + m_Layer: 0 + m_Name: Attachments + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &379791309925608387 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9128690918767125380} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5394964662119436845} + - {fileID: 5890297897985552762} + m_Father: {fileID: 4276982485925709554} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &183844703617190921 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_NestedFloatingObjects + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1002]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1004]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 20 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Nested Floating Objects + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 7521799479354922213} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 5992697082937368351} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 3680574967886725646} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 7922282897426210489} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &7343756901737848769 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 183844703617190921} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_NestedFloatingObjects.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_NestedFloatingObjects.prefab.meta new file mode 100644 index 0000000..8d0508b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_NestedFloatingObjects.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dd8d505ebe7284a20aa743028c1d94ac +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_OverrideGlobalWaves.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_OverrideGlobalWaves.prefab new file mode 100644 index 0000000..e78afed --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_OverrideGlobalWaves.prefab @@ -0,0 +1,209 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5022796648010760929 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 720419771755490151} + - component: {fileID: 5261791568129114886} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &720419771755490151 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5022796648010760929} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 1, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3193899142543925849} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5261791568129114886 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5022796648010760929} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 6 + _Weight: 1 + _Queue: 1 + _Blend: 4 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 5498492930452619820 + _DrawBounds: 0 + _Spectrum: {fileID: 0} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 0 + _OverrideGlobalWindSpeed: 1 + _WindSpeed: 3 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.145 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: 5498492930452619820 + type: {class: ShapeWavesTextureLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 5261791568129114886} + _Texture: {fileID: 2800000, guid: b922f588948724e039eadd46288af89d, type: 3} + _Multiplier: {x: 1, y: 1, z: 1, w: 1} + _NegativeValues: 1 +--- !u!1001 &5419066683695935889 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_OverrideGlobalWaves + objectReference: {fileID: 0} + - target: {fileID: 4219513508376601501, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _WindSpeed + value: 150 + objectReference: {fileID: 0} + - target: {fileID: 4219513508376601501, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _OverrideGlobalWindSpeed + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Override Global Waves + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 720419771755490151} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &3193899142543925849 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 5419066683695935889} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_OverrideGlobalWaves.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_OverrideGlobalWaves.prefab.meta new file mode 100644 index 0000000..0392de1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_OverrideGlobalWaves.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 445412854b5ba47dcbd1a51a5ab23250 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ParticlesRenderer.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ParticlesRenderer.prefab new file mode 100644 index 0000000..047e978 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ParticlesRenderer.prefab @@ -0,0 +1,5080 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1239425993379814624 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2244881770830539353} + - component: {fileID: 3078417664285710373} + m_Layer: 0 + m_Name: Interaction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2244881770830539353 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239425993379814624} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 404373737387698553} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3078417664285710373 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239425993379814624} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 1 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0 + _CompensateForWaveMotion: 0 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &2655210129290852679 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 404373737387698553} + - component: {fileID: 6977648356943886122} + - component: {fileID: 4772028070266665312} + - component: {fileID: 7982559133766518504} + m_Layer: 0 + m_Name: Particles + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &404373737387698553 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2655210129290852679} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2244881770830539353} + m_Father: {fileID: 6388724061895407090} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!198 &6977648356943886122 +ParticleSystem: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2655210129290852679} + serializedVersion: 8 + lengthInSec: 5 + simulationSpeed: 2 + stopAction: 0 + cullingMode: 0 + ringBufferMode: 0 + ringBufferLoopRange: {x: 0, y: 1} + emitterVelocityMode: 1 + looping: 1 + prewarm: 0 + playOnAwake: 1 + useUnscaledTime: 0 + autoRandomSeed: 1 + startDelay: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + moveWithTransform: 1 + moveWithCustomTransform: {fileID: 0} + scalingMode: 1 + randomSeed: 0 + InitialModule: + serializedVersion: 3 + enabled: 1 + startLifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 2.5 + minScalar: 5 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSpeed: + serializedVersion: 2 + minMaxState: 0 + scalar: 10 + minScalar: 5 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startColor: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + startSize: + serializedVersion: 2 + minMaxState: 0 + scalar: 2 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeY: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotation: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + randomizeRotationDirection: 0 + gravitySource: 0 + maxNumParticles: 100000 + customEmitterVelocity: {x: 0, y: 0, z: 0} + size3D: 0 + rotation3D: 0 + gravityModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ShapeModule: + serializedVersion: 6 + enabled: 1 + type: 4 + angle: 25 + length: 5 + boxThickness: {x: 0, y: 0, z: 0} + radiusThickness: 1 + donutRadius: 0.2 + m_Position: {x: 0, y: 0, z: 0} + m_Rotation: {x: 0, y: 180, z: 0} + m_Scale: {x: 1, y: 1, z: 1} + placementMode: 0 + m_MeshMaterialIndex: 0 + m_MeshNormalOffset: 0 + m_MeshSpawn: + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Mesh: {fileID: 0} + m_MeshRenderer: {fileID: 0} + m_SkinnedMeshRenderer: {fileID: 0} + m_Sprite: {fileID: 0} + m_SpriteRenderer: {fileID: 0} + m_UseMeshMaterialIndex: 0 + m_UseMeshColors: 1 + alignToDirection: 0 + m_Texture: {fileID: 0} + m_TextureClipChannel: 3 + m_TextureClipThreshold: 0 + m_TextureUVChannel: 0 + m_TextureColorAffectsParticles: 1 + m_TextureAlphaAffectsParticles: 1 + m_TextureBilinearFiltering: 0 + randomDirectionAmount: 0 + sphericalDirectionAmount: 0 + randomPositionAmount: 0 + radius: + value: 0.0001 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + arc: + value: 360 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + EmissionModule: + enabled: 1 + serializedVersion: 4 + rateOverTime: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 10 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rateOverDistance: + serializedVersion: 2 + minMaxState: 0 + scalar: 40 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_BurstCount: 0 + m_Bursts: [] + SizeModule: + enabled: 0 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + RotationModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.7853982 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + ColorModule: + enabled: 0 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + UVModule: + serializedVersion: 2 + enabled: 0 + mode: 0 + timeMode: 0 + fps: 30 + frameOverTime: + serializedVersion: 2 + minMaxState: 1 + scalar: 0.9999 + minScalar: 0.9999 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startFrame: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedRange: {x: 0, y: 1} + tilesX: 1 + tilesY: 1 + animationType: 0 + rowIndex: 0 + cycles: 1 + uvChannelMask: -1 + rowMode: 1 + sprites: + - sprite: {fileID: 0} + flipU: 0 + flipV: 0 + VelocityModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + radial: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + InheritVelocityModule: + enabled: 0 + m_Mode: 0 + m_Curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + LifetimeByEmitterSpeedModule: + enabled: 0 + m_Curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: -0.8 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.2 + inSlope: -0.8 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Range: {x: 0, y: 1} + ForceModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + randomizePerFrame: 0 + ExternalForcesModule: + serializedVersion: 2 + enabled: 0 + multiplierCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + influenceFilter: 0 + influenceMask: + serializedVersion: 2 + m_Bits: 4294967295 + influenceList: [] + ClampVelocityModule: + enabled: 1 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + magnitude: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxis: 0 + inWorldSpace: 0 + multiplyDragByParticleSize: 1 + multiplyDragByParticleVelocity: 1 + dampen: 0 + drag: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + NoiseModule: + enabled: 0 + strength: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthY: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + frequency: 0.5 + damping: 1 + octaves: 1 + octaveMultiplier: 0.5 + octaveScale: 2 + quality: 2 + scrollSpeed: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remap: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 0 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapY: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 0 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapZ: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 0 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapEnabled: 0 + positionAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rotationAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + sizeAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + SizeBySpeedModule: + enabled: 0 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + range: {x: 0, y: 1} + separateAxes: 0 + RotationBySpeedModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.7853982 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + range: {x: 0, y: 1} + ColorBySpeedModule: + enabled: 0 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + range: {x: 0, y: 1} + CollisionModule: + enabled: 0 + serializedVersion: 4 + type: 0 + collisionMode: 0 + colliderForce: 0 + multiplyColliderForceByParticleSize: 0 + multiplyColliderForceByParticleSpeed: 0 + multiplyColliderForceByCollisionAngle: 1 + m_Planes: [] + m_Dampen: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Bounce: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_EnergyLossOnCollision: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minKillSpeed: 0 + maxKillSpeed: 10000 + radiusScale: 1 + collidesWith: + serializedVersion: 2 + m_Bits: 4294967295 + maxCollisionShapes: 256 + quality: 0 + voxelSize: 0.5 + collisionMessages: 0 + collidesWithDynamic: 1 + interiorCollisions: 0 + TriggerModule: + enabled: 0 + serializedVersion: 2 + inside: 1 + outside: 0 + enter: 0 + exit: 0 + colliderQueryMode: 0 + radiusScale: 1 + primitives: [] + SubModule: + serializedVersion: 2 + enabled: 0 + subEmitters: + - serializedVersion: 3 + emitter: {fileID: 0} + type: 0 + properties: 0 + emitProbability: 1 + LightsModule: + enabled: 0 + ratio: 0 + light: {fileID: 0} + randomDistribution: 1 + color: 1 + range: 1 + intensity: 1 + rangeCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + intensityCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + maxLights: 20 + TrailModule: + enabled: 0 + mode: 0 + ratio: 1 + lifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minVertexDistance: 0.2 + textureMode: 0 + textureScale: {x: 1, y: 1} + ribbonCount: 1 + shadowBias: 0.5 + worldSpace: 0 + dieWithParticles: 1 + sizeAffectsWidth: 1 + sizeAffectsLifetime: 0 + inheritParticleColor: 1 + generateLightingData: 0 + splitSubEmitterRibbons: 0 + attachRibbonsToTransform: 0 + colorOverLifetime: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + widthOverTrail: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorOverTrail: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + CustomDataModule: + enabled: 0 + mode0: 0 + vectorComponentCount0: 4 + color0: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel0: Color + vector0_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_0: X + vector0_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_1: Y + vector0_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_2: Z + vector0_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_3: W + mode1: 0 + vectorComponentCount1: 4 + color1: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel1: Color + vector1_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_0: X + vector1_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_1: Y + vector1_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_2: Z + vector1_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_3: W +--- !u!199 &4772028070266665312 +ParticleSystemRenderer: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2655210129290852679} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 10dbe9bc7d24d4b3f94343d10694d4fc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_RenderMode: 2 + m_MeshDistribution: 0 + m_SortMode: 0 + m_MinParticleSize: 0 + m_MaxParticleSize: 0.5 + m_CameraVelocityScale: 0 + m_VelocityScale: 0 + m_LengthScale: 2 + m_SortingFudge: 0 + m_NormalDirection: 1 + m_ShadowBias: 0 + m_RenderAlignment: 0 + m_Pivot: {x: 0, y: 0, z: 0} + m_Flip: {x: 0, y: 0, z: 0} + m_EnableGPUInstancing: 1 + m_ApplyActiveColorSpace: 1 + m_AllowRoll: 1 + m_FreeformStretching: 0 + m_RotateWithStretchDirection: 1 + m_UseCustomVertexStreams: 0 + m_VertexStreams: 00010304 + m_UseCustomTrailVertexStreams: 0 + m_TrailVertexStreams: 00010304 + m_Mesh: {fileID: 0} + m_Mesh1: {fileID: 0} + m_Mesh2: {fileID: 0} + m_Mesh3: {fileID: 0} + m_MeshWeighting: 1 + m_MeshWeighting1: 1 + m_MeshWeighting2: 1 + m_MeshWeighting3: 1 + m_MaskInteraction: 0 +--- !u!114 &7982559133766518504 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2655210129290852679} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67bc7f0b9724d44ab9f0ddf0b1b5a773, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 9154139389720788993 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 9154139389720788993 + type: {class: FoamRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 7982559133766518504} + _Renderer: {fileID: 4772028070266665312} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1 &7320620651557629896 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6388724061895407090} + - component: {fileID: 5797451488902500288} + m_Layer: 0 + m_Name: FoamTrail + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6388724061895407090 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7320620651557629896} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 404373737387698553} + m_Father: {fileID: 3104130276457045551} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5797451488902500288 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7320620651557629896} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f069d1ec9fe154d3ba75ff75ed08e5b9, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ResetOnDisable: 0 + _IsLocal: 0 + _Velocity: {x: 0, y: 0, z: 0} + _AngularVelocity: {x: 0, y: 180, z: 0} +--- !u!1001 &5508870175037394407 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_ParticlesRenderer + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1004]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Particle Renderer + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6388724061895407090} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &3104130276457045551 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 5508870175037394407} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ParticlesRenderer.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ParticlesRenderer.prefab.meta new file mode 100644 index 0000000..f22c326 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ParticlesRenderer.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ff1ff3da569614cb085123e4b2d0aa72 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_PushWaterBelowGeometry.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_PushWaterBelowGeometry.prefab new file mode 100644 index 0000000..5b6b289 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_PushWaterBelowGeometry.prefab @@ -0,0 +1,241 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8738372323349608780 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2154887623236287147} + - component: {fileID: 1081428564999821561} + - component: {fileID: 8797361803737930552} + - component: {fileID: 2878631226503820878} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2154887623236287147 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8738372323349608780} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7766271868652867914} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1081428564999821561 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8738372323349608780} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8797361803737930552 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8738372323349608780} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: fbe311c1027b04a3d8401654d4a9d72f, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &2878631226503820878 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8738372323349608780} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d64d1f50f3b548bcbe279507f0e78da, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5498492892080767024 + _DrawBounds: 0 + _DisplacementPass: 1 + _FilterByWavelength: 0 + _OctaveWavelength: 0 + _MaximumDisplacementVertical: 0 + _MaximumDisplacementHorizontal: 0 + _ReportRendererBounds: 0 + _Version: 1 + _RenderPostCombine: 1 + references: + version: 2 + RefIds: + - rid: 5498492892080767024 + type: {class: AnimatedWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 2878631226503820878} + _Renderer: {fileID: 8797361803737930552} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1001 &909781185753842306 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_PushWaterBelowGeometry + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Push Water Below Geometry + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 2154887623236287147} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &7766271868652867914 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 909781185753842306} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_PushWaterBelowGeometry.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_PushWaterBelowGeometry.prefab.meta new file mode 100644 index 0000000..67681e6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_PushWaterBelowGeometry.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9747c333947364a609ae327261925d91 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ScaleWaves.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ScaleWaves.prefab new file mode 100644 index 0000000..ced9c24 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ScaleWaves.prefab @@ -0,0 +1,241 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4903089117338764161 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8833684171188005572} + - component: {fileID: 8619640914209770311} + - component: {fileID: 6400578777511710056} + - component: {fileID: 684761497578884912} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8833684171188005572 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4903089117338764161} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 15, y: 15, z: 15} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 792510108219235885} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &8619640914209770311 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4903089117338764161} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6400578777511710056 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4903089117338764161} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 246582b609c364fe1b58409fc147e04c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &684761497578884912 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4903089117338764161} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d64d1f50f3b548bcbe279507f0e78da, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5163698717554376716 + _DrawBounds: 0 + _DisplacementPass: 1 + _FilterByWavelength: 0 + _OctaveWavelength: 0 + _MaximumDisplacementVertical: 0 + _MaximumDisplacementHorizontal: 0 + _ReportRendererBounds: 0 + _Version: 1 + _RenderPostCombine: 1 + references: + version: 2 + RefIds: + - rid: 5163698717554376716 + type: {class: AnimatedWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 684761497578884912} + _Renderer: {fileID: 6400578777511710056} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1001 &7897318718819569125 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_ScaleWaves + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Scale Waves + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8833684171188005572} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &792510108219235885 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 7897318718819569125} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ScaleWaves.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ScaleWaves.prefab.meta new file mode 100644 index 0000000..808f946 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ScaleWaves.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c078839e9bf984167aa1bcdd6ca8d265 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ShaderGraphInput.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ShaderGraphInput.prefab new file mode 100644 index 0000000..f25c83f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ShaderGraphInput.prefab @@ -0,0 +1,256 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8072713028100456124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2266064932902504950} + - component: {fileID: 6046656334438981817} + - component: {fileID: 5120915862431122677} + - component: {fileID: 4504938849896926721} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2266064932902504950 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8072713028100456124} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 3, y: 1, z: 3} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 116172233970398260} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6046656334438981817 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8072713028100456124} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5120915862431122677 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8072713028100456124} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8904d567bc07944d693dcc17ff3959bf, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &4504938849896926721 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8072713028100456124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d64d1f50f3b548bcbe279507f0e78da, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5498492930452619757 + _DrawBounds: 0 + _DisplacementPass: 1 + _FilterByWavelength: 0 + _OctaveWavelength: 512 + _MaximumDisplacementVertical: 2 + _MaximumDisplacementHorizontal: 0 + _ReportRendererBounds: 0 + _Version: 1 + _RenderPostCombine: 1 + references: + version: 2 + RefIds: + - rid: 5498492930452619757 + type: {class: AnimatedWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 4504938849896926721} + _Renderer: {fileID: 5120915862431122677} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 0 + _CheckShaderPasses: 1 +--- !u!1001 &7420766973803980796 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1115572721750479147, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2075185344719608113, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _OnHighDefinitionPipeline.m_PersistentCalls.m_Calls.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2075185344719608113, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _OnHighDefinitionPipeline.m_PersistentCalls.m_Calls.Array.data[0].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_ShaderGraphInput + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Shader Graph Input + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 2266064932902504950} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &116172233970398260 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 7420766973803980796} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ShaderGraphInput.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ShaderGraphInput.prefab.meta new file mode 100644 index 0000000..242e1b7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_ShaderGraphInput.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d567dc7b091ab41dca1737015904294c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrailRenderer.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrailRenderer.prefab new file mode 100644 index 0000000..5059507 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrailRenderer.prefab @@ -0,0 +1,331 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &387189778486253024 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6707140411732769630} + - component: {fileID: 6539653093959841722} + m_Layer: 0 + m_Name: Trails + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6707140411732769630 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 387189778486253024} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8510416350880986239} + m_Father: {fileID: 347115325611017585} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6539653093959841722 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 387189778486253024} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f069d1ec9fe154d3ba75ff75ed08e5b9, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ResetOnDisable: 0 + _IsLocal: 0 + _Velocity: {x: 0, y: 0, z: 0} + _AngularVelocity: {x: 0, y: 30, z: 0} +--- !u!1 &5004646023057777348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8510416350880986239} + - component: {fileID: 6477949415211515217} + - component: {fileID: 5188318994818385360} + m_Layer: 0 + m_Name: Trail + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8510416350880986239 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5004646023057777348} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6707140411732769630} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!96 &6477949415211515217 +TrailRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5004646023057777348} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 99f41ed341ffedc4181a46734c9fa3e9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Time: 5 + m_PreviewTimeScale: 1 + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 1 + textureMode: 0 + textureScale: {x: 1, y: 1} + shadowBias: 0.5 + generateLightingData: 0 + m_MinVertexDistance: 0.1 + m_MaskInteraction: 0 + m_Autodestruct: 0 + m_Emitting: 1 + m_ApplyActiveColorSpace: 0 +--- !u!114 &5188318994818385360 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5004646023057777348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67bc7f0b9724d44ab9f0ddf0b1b5a773, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 9154139389720788992 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 9154139389720788992 + type: {class: FoamRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 5188318994818385360} + _Renderer: {fileID: 6477949415211515217} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!1001 &7185024514063554233 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_TrailRenderer + objectReference: {fileID: 0} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Trail Renderer + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6707140411732769630} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &347115325611017585 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 7185024514063554233} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrailRenderer.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrailRenderer.prefab.meta new file mode 100644 index 0000000..7381b88 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrailRenderer.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6eec5b49d0d9c4ac0bf7f4445b765f1a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrochoidalWaves.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrochoidalWaves.prefab new file mode 100644 index 0000000..cd14769 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrochoidalWaves.prefab @@ -0,0 +1,194 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6548194843542302230 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6111300953785123850} + - component: {fileID: 378750184092539753} + m_Layer: 0 + m_Name: Gerstner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6111300953785123850 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6548194843542302230} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2448249579945829150} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &378750184092539753 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6548194843542302230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 002f2642204d348f3a2fab18595c44cd, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 5 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: 6b50b5218dbe2488fb5d00db49d15dae, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 0 + _OverrideGlobalWindSpeed: 1 + _WindSpeed: 150 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _Swell: 0 + _ReverseWaveWeight: 0 + _ComponentsPerOctave: 8 + _RandomSeed: 0 + _ManualGeneration: 0 + _Version: 2 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1001 &5088654383448813782 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1115572721750479147, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_TrochoidalWaves + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Trochoidal Wave + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6111300953785123850} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &2448249579945829150 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 5088654383448813782} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrochoidalWaves.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrochoidalWaves.prefab.meta new file mode 100644 index 0000000..bd04f55 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_TrochoidalWaves.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c50867f10fd47468a888b2cad362e3f3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_VaryingWaterLevel.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_VaryingWaterLevel.prefab new file mode 100644 index 0000000..d0087fe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_VaryingWaterLevel.prefab @@ -0,0 +1,189 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4952424350175726752 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8671601318401841212} + - component: {fileID: 6591046838509233045} + m_Layer: 0 + m_Name: WaterLevelUpper + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8671601318401841212 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4952424350175726752} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 146751655809735661} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6591046838509233045 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4952424350175726752} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4edd034314af4679ba066d79580dc1d, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 7 + _Weight: 1 + _Queue: 0 + _Blend: 0 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 5498492890225574320 + _DrawBounds: 0 + _OverrideHeight: 0 + _HeightRange: {x: -100, y: 100} + _Version: 1 + references: + version: 2 + RefIds: + - rid: 5498492890225574320 + type: {class: LevelGeometryLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 6591046838509233045} + _Geometry: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &7308845132527536165 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_VaryingWaterLevel + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1002]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3174606876987848017, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Varying Water Level + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8671601318401841212} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &146751655809735661 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 7308845132527536165} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_VaryingWaterLevel.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_VaryingWaterLevel.prefab.meta new file mode 100644 index 0000000..894671f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_VaryingWaterLevel.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d10ed315b04684e88b6b6ea760a627ec +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Wake.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Wake.prefab new file mode 100644 index 0000000..08e5f0d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Wake.prefab @@ -0,0 +1,308 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1605716020211781090 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2811471156355903973} + - component: {fileID: 2410482013220558543} + - component: {fileID: 5189433086147224383} + m_Layer: 0 + m_Name: SphereWaterInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2811471156355903973 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1605716020211781090} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2488858557151659419} + m_Father: {fileID: 5870674879646157198} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2410482013220558543 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1605716020211781090} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 3 + _Weight: 6 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.08 + _CompensateForWaveMotion: 0.5 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!114 &5189433086147224383 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1605716020211781090} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f069d1ec9fe154d3ba75ff75ed08e5b9, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ResetOnDisable: 0 + _IsLocal: 0 + _Velocity: {x: -10, y: 0, z: 0} + _AngularVelocity: {x: 0, y: 0, z: 0} +--- !u!1 &2462268965620185005 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2488858557151659419} + - component: {fileID: 3208687696389503319} + - component: {fileID: 5877780088331738605} + - component: {fileID: 2924061704419095076} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2488858557151659419 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2462268965620185005} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 5, y: 5, z: 5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2811471156355903973} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3208687696389503319 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2462268965620185005} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5877780088331738605 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2462268965620185005} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 35af310c2690e42a6a9d2ca36256e92c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &2924061704419095076 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2462268965620185005} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &3900035380883659334 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_Wake + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _SurfaceSelfIntersectionFixMode + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1004]._Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2853796242865667210, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: managedReferences[1004]._Settings + value: + objectReference: {fileID: 11400000, guid: 6e347d08403cf4db5bca5da4695cb3bb, + type: 2} + - target: {fileID: 5549572483640152611, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_MaxValue + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Wake + objectReference: {fileID: 0} + - target: {fileID: 6569302601408354596, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6569302601408354596, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: _Velocity.x + value: -10 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 2811471156355903973} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &5870674879646157198 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 3900035380883659334} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Wake.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Wake.prefab.meta new file mode 100644 index 0000000..e601fe8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_Wake.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1849ae200153d474fab9dfcd311b74e3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveComparison.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveComparison.prefab new file mode 100644 index 0000000..163512e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveComparison.prefab @@ -0,0 +1,748 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &31784261299129603 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 508548365693870703} + - component: {fileID: 6332870194869196489} + - component: {fileID: 6339518626587980944} + m_Layer: 0 + m_Name: Divider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &508548365693870703 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 31784261299129603} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4990632531106768604} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 10, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6332870194869196489 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 31784261299129603} + m_CullTransparentMesh: 1 +--- !u!114 &6339518626587980944 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 31784261299129603} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.50200003, g: 0.50200003, b: 0.50200003, a: 0.14901961} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &676498321465149528 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1918176850244310873} + - component: {fileID: 4466624576101825100} + - component: {fileID: 7798178862052506330} + m_Layer: 0 + m_Name: Left + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1918176850244310873 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676498321465149528} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4990632531106768604} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 160} + m_Pivot: {x: 0.5, y: 0} +--- !u!222 &4466624576101825100 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676498321465149528} + m_CullTransparentMesh: 1 +--- !u!114 &7798178862052506330 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676498321465149528} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.6} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 80 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 80 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: FFT +--- !u!1 &2148910995481445710 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4746234276137706839} + - component: {fileID: 2827377323468785439} + - component: {fileID: 4334820758151527670} + - component: {fileID: 5651362053109087375} + m_Layer: 0 + m_Name: Gerstner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4746234276137706839 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2148910995481445710} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3065610801215746181} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2827377323468785439 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2148910995481445710} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 002f2642204d348f3a2fab18595c44cd, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 5498492911464218864 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: e13a1902b10e34e9fb08e1d09e39b5d4, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: -58.00273 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _Swell: 0 + _ReverseWaveWeight: 0.5 + _ComponentsPerOctave: 8 + _RandomSeed: 0 + _ManualGeneration: 0 + _Version: 2 + references: + version: 2 + RefIds: + - rid: 5498492911464218864 + type: {class: ShapeWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 2827377323468785439} + _Renderer: {fileID: 5651362053109087375} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!33 &4334820758151527670 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2148910995481445710} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5651362053109087375 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2148910995481445710} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 360fdb51577a04cfabcee8f199858cd5, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &2280579469293003027 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1495747626388291938} + - component: {fileID: 3962592855575957568} + - component: {fileID: 141230271595038818} + m_Layer: 0 + m_Name: Right + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1495747626388291938 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2280579469293003027} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4990632531106768604} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 160} + m_Pivot: {x: 0.5, y: 0} +--- !u!222 &3962592855575957568 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2280579469293003027} + m_CullTransparentMesh: 1 +--- !u!114 &141230271595038818 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2280579469293003027} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.6} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 80 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 80 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: "Gerstner\t" +--- !u!1 &6063280358999853263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 335653901262101943} + - component: {fileID: 2912691268591623129} + - component: {fileID: 8905308283905458067} + - component: {fileID: 9056547554985079878} + m_Layer: 0 + m_Name: FFT + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &335653901262101943 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6063280358999853263} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3065610801215746181} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2912691268591623129 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6063280358999853263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 5498492892080767375 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: e13a1902b10e34e9fb08e1d09e39b5d4, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 0 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.145 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: 5498492892080767375 + type: {class: ShapeWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 2912691268591623129} + _Renderer: {fileID: 9056547554985079878} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!33 &8905308283905458067 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6063280358999853263} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &9056547554985079878 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6063280358999853263} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 360fdb51577a04cfabcee8f199858cd5, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &7901450957617473115 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4990632531106768604} + - component: {fileID: 2623459378921003983} + - component: {fileID: 2025291583288313071} + - component: {fileID: 810960577656664157} + m_Layer: 0 + m_Name: Canvas (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4990632531106768604 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7901450957617473115} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 508548365693870703} + - {fileID: 1918176850244310873} + - {fileID: 1495747626388291938} + m_Father: {fileID: 3065610801215746181} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &2623459378921003983 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7901450957617473115} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &2025291583288313071 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7901450957617473115} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1600, y: 1200} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &810960577656664157 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7901450957617473115} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1001 &5614962886184559437 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 955584948468918588, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1115572721750479147, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_WaveComparison + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Wave Comparison + objectReference: {fileID: 0} + - target: {fileID: 7529923708490514748, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 335653901262101943} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 4746234276137706839} + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 4990632531106768604} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &3065610801215746181 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 5614962886184559437} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveComparison.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveComparison.prefab.meta new file mode 100644 index 0000000..34e73cb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveComparison.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 133e9997408ec4db8b40405a35388986 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveParticle.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveParticle.prefab new file mode 100644 index 0000000..88146da --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveParticle.prefab @@ -0,0 +1,241 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &301477654081295215 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6266556457696848431} + - component: {fileID: 8440421854440813461} + - component: {fileID: 8667131938688432550} + - component: {fileID: 866027872667867661} + - component: {fileID: 5026342289894165753} + m_Layer: 0 + m_Name: WaveParticle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6266556457696848431 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 301477654081295215} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 36, y: 36, z: 36} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 435372066998964081} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &8440421854440813461 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 301477654081295215} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8667131938688432550 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 301477654081295215} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4242b74bff27c4f748a61b16954c595a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &866027872667867661 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 301477654081295215} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d64d1f50f3b548bcbe279507f0e78da, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 1 + _Data: + rid: 5498492892080767265 + _DrawBounds: 0 + _DisplacementPass: 1 + _FilterByWavelength: 0 + _OctaveWavelength: 11 + _MaximumDisplacementVertical: 0 + _MaximumDisplacementHorizontal: 0 + _ReportRendererBounds: 0 + _Version: 1 + _RenderPostCombine: 1 + references: + version: 2 + RefIds: + - rid: 5498492892080767265 + type: {class: AnimatedWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 866027872667867661} + _Renderer: {fileID: 8667131938688432550} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!114 &5026342289894165753 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 301477654081295215} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e67c8b7e3e4e04c46b61963b7c204049, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Axis: {x: 1, y: 0, z: 1} + _Amplitude: 15 + _Frequency: 1 + _OrthogonalMotion: 1 + _RotationFrequency: 0 + _RotationVelocity: 0 +--- !u!1001 &7020450602387840185 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_WaveParticle + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Wave Particle + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 6266556457696848431} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &435372066998964081 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 7020450602387840185} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveParticle.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveParticle.prefab.meta new file mode 100644 index 0000000..97068de --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WaveParticle.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7a9396aa30746479e98eb1ee24d9c607 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WavePatch.prefab b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WavePatch.prefab new file mode 100644 index 0000000..7613421 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WavePatch.prefab @@ -0,0 +1,259 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4264947161958629688 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8391639339905830388} + - component: {fileID: 7519625472829840564} + - component: {fileID: 7044737358446376589} + - component: {fileID: 446232514223694072} + m_Layer: 0 + m_Name: Waves + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8391639339905830388 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4264947161958629688} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7016793409602223968} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7519625472829840564 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4264947161958629688} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 5498492892080767520 + _DrawBounds: 0 + _Spectrum: {fileID: 0} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 0 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 32 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.145 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: 5498492892080767520 + type: {class: ShapeWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 7519625472829840564} + _Renderer: {fileID: 446232514223694072} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 0 +--- !u!33 &7044737358446376589 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4264947161958629688} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &446232514223694072 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4264947161958629688} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: f035e5443c57f47fc85159fad71c7ac9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1001 &434542779733683368 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809695123049724894, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1115572721750479147, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2823138595762987762, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Name + value: Examples_WavePatch + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4439941709532542476, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5655619906866042202, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6025157281597741479, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6119524809475244111, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + propertyPath: m_Text + value: Wave Patch + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8391639339905830388} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, type: 3} +--- !u!4 &7016793409602223968 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7451036494515983304, guid: 8b98a14ae91dd498d8f577f0f8f4aff1, + type: 3} + m_PrefabInstance: {fileID: 434542779733683368} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WavePatch.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WavePatch.prefab.meta new file mode 100644 index 0000000..b794085 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Prefabs/Scenes/Examples_WavePatch.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5074ae8abcc0849198c130c8b136f655 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes.meta new file mode 100644 index 0000000..1e34ec1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b45c517bb07c4d20a3f9d1d6c2a97dd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes/Examples.unity b/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes/Examples.unity new file mode 100644 index 0000000..8d30d77 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes/Examples.unity @@ -0,0 +1,1516 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 4890085278179872738, guid: 6e72aca972f324f7886200f86939d735, + type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &226886513 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 226886514} + - component: {fileID: 226886516} + - component: {fileID: 226886515} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &226886514 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 226886513} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 616175715} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -70} + m_SizeDelta: {x: 40, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &226886515 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 226886513} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: (M) +--- !u!222 &226886516 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 226886513} + m_CullTransparentMesh: 1 +--- !u!1 &275656478 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 275656479} + - component: {fileID: 275656481} + - component: {fileID: 275656480} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &275656479 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275656478} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 884963844} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &275656480 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275656478} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &275656481 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275656478} + m_CullTransparentMesh: 1 +--- !u!1 &616175714 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 616175715} + - component: {fileID: 616175718} + - component: {fileID: 616175717} + - component: {fileID: 616175716} + m_Layer: 5 + m_Name: Button (Next) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &616175715 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 616175714} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 884963844} + - {fileID: 226886514} + m_Father: {fileID: 1835631277} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -35, y: -40} + m_SizeDelta: {x: 90, y: 80} + m_Pivot: {x: 1, y: 0} +--- !u!114 &616175716 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 616175714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 616175717} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 800785260} + m_TargetAssemblyTypeName: WaveHarmonic.Crest.Examples.ExamplesController, + WaveHarmonic.Crest.Development + m_MethodName: Next + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &616175717 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 616175714} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &616175718 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 616175714} + m_CullTransparentMesh: 1 +--- !u!1 &627061426 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 627061427} + - component: {fileID: 627061430} + - component: {fileID: 627061429} + - component: {fileID: 627061428} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &627061427 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627061426} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.25, y: 1.5, z: 1.25} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 854974472} + m_Father: {fileID: 2128464136} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -2.5} + m_SizeDelta: {x: 0, y: -5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &627061428 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627061426} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 1 +--- !u!114 &627061429 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627061426} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 522eb8ddfc4444cfa871927291d9ae6c, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &627061430 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627061426} + m_CullTransparentMesh: 1 +--- !u!1 &800785258 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 800785259} + - component: {fileID: 800785260} + m_Layer: 0 + m_Name: Examples + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &800785259 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 800785258} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &800785260 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 800785258} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c948522afe4014818ad3ab8b5dad00b6, type: 3} + m_Name: + m_EditorClassIdentifier: + _Previous: 110 + _Next: 109 + _Prefabs: + - {fileID: 7253832949013104934, guid: c991a6f7c7bf14d29a1868ab0ba78d9b, type: 3} + - {fileID: 4743998664470201614, guid: d567dc7b091ab41dca1737015904294c, type: 3} + - {fileID: 1239184910764439732, guid: 1849ae200153d474fab9dfcd311b74e3, type: 3} + - {fileID: 152487371204109732, guid: 9798c3ecca7e743339ca45802ff112cf, type: 3} + - {fileID: 3255405111375105233, guid: db335a3706b7d44d1ac6b241f9626d5f, type: 3} + - {fileID: 6907282429033699402, guid: c593e62ba4a5f44ec88f8d817bdff3ef, type: 3} + - {fileID: 2389726690367065690, guid: 5074ae8abcc0849198c130c8b136f655, type: 3} + - {fileID: 5383248581021757207, guid: c078839e9bf984167aa1bcdd6ca8d265, type: 3} + - {fileID: 7789443911385895779, guid: 445412854b5ba47dcbd1a51a5ab23250, type: 3} + - {fileID: 7040047243488301604, guid: c50867f10fd47468a888b2cad362e3f3, type: 3} + - {fileID: 2564289859789847751, guid: bf5234a12cb8e44c4b5d8cdd224ab70b, type: 3} + - {fileID: 2711422409408605947, guid: dd8d505ebe7284a20aa743028c1d94ac, type: 3} + - {fileID: 2372011946263111228, guid: 6aafc5cd4fcb24225acbb60555c4606c, type: 3} + - {fileID: 7253832949013104934, guid: 548ae7b2e9efd4de685e7f9df67c4356, type: 3} + - {fileID: 4774931012087999191, guid: d10ed315b04684e88b6b6ea760a627ec, type: 3} + - {fileID: 4943712288421885003, guid: 6eec5b49d0d9c4ac0bf7f4445b765f1a, type: 3} + - {fileID: 7736829725313396501, guid: ff1ff3da569614cb085123e4b2d0aa72, type: 3} + - {fileID: 3138442362956865648, guid: 9747c333947364a609ae327261925d91, type: 3} + - {fileID: 5062163869940907595, guid: 7a9396aa30746479e98eb1ee24d9c607, type: 3} + - {fileID: 7692596105051996607, guid: 133e9997408ec4db8b40405a35388986, type: 3} + - {fileID: 6922125198888319343, guid: 1f89b1c7604634513b0fdd493a0fca4c, type: 3} + - {fileID: 8545219464932715691, guid: d808526de1dd84298843230df4361f27, type: 3} +--- !u!1 &854974471 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 854974472} + - component: {fileID: 854974474} + - component: {fileID: 854974473} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &854974472 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 854974471} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 627061427} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &854974473 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 854974471} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &854974474 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 854974471} + m_CullTransparentMesh: 1 +--- !u!1 &884963843 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 884963844} + - component: {fileID: 884963847} + - component: {fileID: 884963846} + - component: {fileID: 884963845} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &884963844 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884963843} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.25, y: 1.5, z: 1.25} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 275656479} + m_Father: {fileID: 616175715} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -2.5} + m_SizeDelta: {x: 0, y: -5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &884963845 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884963843} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 1 +--- !u!114 &884963846 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884963843} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 4ae6644b0437140e3af74b68b5fc1066, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &884963847 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884963843} + m_CullTransparentMesh: 1 +--- !u!1 &1122580652 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1122580656} + - component: {fileID: 1122580655} + - component: {fileID: 1122580654} + - component: {fileID: 1122580653} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1122580653 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1122580652} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_MoveRepeatDelay: 0.5 + m_MoveRepeatRate: 0.1 + m_XRTrackingOrigin: {fileID: 0} + m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_PointAction: {fileID: 1054132383583890850, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_MoveAction: {fileID: 3710738434707379630, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_SubmitAction: {fileID: 2064916234097673511, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_CancelAction: {fileID: -1967631576421560919, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_LeftClickAction: {fileID: 8056856818456041789, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_MiddleClickAction: {fileID: 3279352641294131588, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_RightClickAction: {fileID: 3837173908680883260, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_ScrollWheelAction: {fileID: 4502412055082496612, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_TrackedDevicePositionAction: {fileID: 4754684134866288074, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_TrackedDeviceOrientationAction: {fileID: 1025543830046995696, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_DeselectOnBackgroundClick: 1 + m_PointerBehavior: 0 + m_CursorLockBehavior: 0 + m_ScrollDeltaPerTick: 6 +--- !u!114 &1122580654 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1122580652} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1122580655 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1122580652} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &1122580656 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1122580652} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1131128992 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1131128996} + - component: {fileID: 1131128995} + - component: {fileID: 1131128994} + m_Layer: 0 + m_Name: ForceEnableShadows + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1131128994 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1131128992} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 35af310c2690e42a6a9d2ca36256e92c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1131128995 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1131128992} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1131128996 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1131128992} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -20, z: 0} + m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1364867123 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1845454492} + m_Modifications: + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.w + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.9063079 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.42261827 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 105 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 15 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5304508333967466499, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_Name + value: Sun + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 774ab582b39374a7e9d5dac8e31b9a5a, type: 3} +--- !u!4 &1364867124 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + m_PrefabInstance: {fileID: 1364867123} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1682107712 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1682107713} + - component: {fileID: 1682107715} + - component: {fileID: 1682107714} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1682107713 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1682107712} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2128464136} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -70} + m_SizeDelta: {x: 40, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1682107714 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1682107712} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: '(N) + +' +--- !u!222 &1682107715 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1682107712} + m_CullTransparentMesh: 1 +--- !u!1001 &1734491899 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1845454492} + m_Modifications: + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2942909709672342223, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_Name + value: Atmosphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63a4b7e65d06948649ac3e10077d8c2e, type: 3} +--- !u!4 &1734491900 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + m_PrefabInstance: {fileID: 1734491899} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1835631273 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1835631277} + - component: {fileID: 1835631276} + - component: {fileID: 1835631275} + - component: {fileID: 1835631274} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1835631274 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835631273} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1835631275 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835631273} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1600, y: 1200} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &1835631276 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835631273} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1835631277 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835631273} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 616175715} + - {fileID: 2128464136} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &1845454491 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1845454492} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1845454492 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1845454491} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1364867124} + - {fileID: 1886939755} + - {fileID: 1734491900} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1886939754 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1845454492} + m_Modifications: + - target: {fileID: 963553959586484309, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_Name + value: Lighting + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bece9afbf3ddd49059dd73ba2cc986f6, type: 3} +--- !u!4 &1886939755 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + m_PrefabInstance: {fileID: 1886939754} + m_PrefabAsset: {fileID: 0} +--- !u!1 &2128464135 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2128464136} + - component: {fileID: 2128464139} + - component: {fileID: 2128464138} + - component: {fileID: 2128464137} + m_Layer: 5 + m_Name: Button (Previous) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2128464136 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2128464135} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 627061427} + - {fileID: 1682107713} + m_Father: {fileID: 1835631277} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 125, y: -40} + m_SizeDelta: {x: 90, y: 80} + m_Pivot: {x: 1, y: 0} +--- !u!114 &2128464137 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2128464135} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2128464138} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 800785260} + m_TargetAssemblyTypeName: WaveHarmonic.Crest.Examples.ExamplesController, + WaveHarmonic.Crest.Development + m_MethodName: Previous + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &2128464138 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2128464135} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2128464139 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2128464135} + m_CullTransparentMesh: 1 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 800785259} + - {fileID: 1845454492} + - {fileID: 1835631277} + - {fileID: 1122580656} + - {fileID: 1131128996} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes/Examples.unity.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes/Examples.unity.meta new file mode 100644 index 0000000..19c540d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Scenes/Examples.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1b80df69b86b342fdb5e8139a2357cdc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts.meta new file mode 100644 index 0000000..8afabe3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: adfaec6f617394753aee441ba316b460 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/ExamplesController.cs b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/ExamplesController.cs new file mode 100644 index 0000000..3ef9369 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/ExamplesController.cs @@ -0,0 +1,104 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace WaveHarmonic.Crest.Examples +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class ExamplesController : MonoBehaviour + { + [@DecoratedField, SerializeField] + KeyCode _Previous = KeyCode.Comma; + + [@DecoratedField, SerializeField] + KeyCode _Next = KeyCode.Period; + + [SerializeField] + List _Prefabs = new(); + + int _Index = 0; + + public void Previous() => Cycle(true); + public void Next() => Cycle(false); + + void OnEnable() + { + if (_Prefabs.Count == 0) + { + enabled = false; + return; + } + + var prefab = Instantiate(_Prefabs[_Index]); + prefab.transform.SetParent(transform, worldPositionStays: true); + } + + void OnDisable() + { + var child = transform.GetChild(0); + if (child == null) + { + return; + } + + Destroy(child.gameObject); + } + + void Update() + { + if (Input.GetKeyUp(_Previous)) + { + Previous(); + } + else if (Input.GetKeyUp(_Next)) + { + Next(); + } + } + + internal void Cycle(bool isReverse = false) + { + _Index += isReverse ? -1 : 1; + + // Wrap index. + if (_Index < 0) _Index = _Prefabs.Count - 1; + if (_Index == _Prefabs.Count) _Index = 0; + + var go = transform.GetChild(0).gameObject; + go.SetActive(false); + + Helpers.Destroy(go); + + var prefab = Instantiate(_Prefabs[_Index]); + prefab.transform.SetParent(transform, worldPositionStays: true); + } + } + +#if UNITY_EDITOR + [CustomEditor(typeof(ExamplesController))] + sealed class ExamplesControllerEditor : Editor.Inspector + { + protected override void RenderInspectorGUI() + { + base.RenderInspectorGUI(); + + var target = this.target as ExamplesController; + + if (GUILayout.Button("Previous")) + { + target.Previous(); + } + + if (GUILayout.Button("Next")) + { + target.Next(); + } + } + } +#endif +} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/ExamplesController.cs.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/ExamplesController.cs.meta new file mode 100644 index 0000000..cad1bb5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/ExamplesController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c948522afe4014818ad3ab8b5dad00b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/WaveHarmonic.Crest.Samples.Examples.asmdef b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/WaveHarmonic.Crest.Samples.Examples.asmdef new file mode 100644 index 0000000..afe58c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/WaveHarmonic.Crest.Samples.Examples.asmdef @@ -0,0 +1,33 @@ +{ + "name": "WaveHarmonic.Crest.Samples.Examples", + "rootNamespace": "", + "references": [ + "GUID:75469ad4d38634e559750d17036d5f7c", + "GUID:7c347618730f5467f86a58f333ce21df", + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:1ab2a6c2a51cd4b43867788dbaee1a55" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER", + "d_Crest" + ], + "versionDefines": [ + { + "name": "com.unity.inputsystem", + "expression": "", + "define": "d_Unity_InputSystem" + }, + { + "name": "com.waveharmonic.crest", + "expression": "", + "define": "d_Crest" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/WaveHarmonic.Crest.Samples.Examples.asmdef.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/WaveHarmonic.Crest.Samples.Examples.asmdef.meta new file mode 100644 index 0000000..268120f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Scripts/WaveHarmonic.Crest.Samples.Examples.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 318deac13168c44f2a24fae14a38474c +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings.meta new file mode 100644 index 0000000..a4c9d96 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0a2cbed6cfe34b82add7daa8244f22f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Fast.asset b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Fast.asset new file mode 100644 index 0000000..0cd380b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Fast.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 7df05608a083e4ad4bc4758f1df0ee29, type: 3} + m_Name: Examples_DynamicWavesLod_Fast + m_EditorClassIdentifier: + _Version: 0 + _Damping: 0 + _CourantNumber: 1 + _HorizontalDisplace: 9.66 + _DisplaceClamp: 0.3 + _GravityMultiplier: 4 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Fast.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Fast.asset.meta new file mode 100644 index 0000000..35cddf6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Fast.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 287009c927f61554e858440ab8f5520b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Wakes.asset b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Wakes.asset new file mode 100644 index 0000000..f581a51 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Wakes.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 7df05608a083e4ad4bc4758f1df0ee29, type: 3} + m_Name: Examples_DynamicWavesLod_Wakes + m_EditorClassIdentifier: + _Version: 0 + _Damping: 0 + _CourantNumber: 1 + _HorizontalDisplace: 9.66 + _DisplaceClamp: 0.3 + _GravityMultiplier: 1 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Wakes.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Wakes.asset.meta new file mode 100644 index 0000000..bb6c0c7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_DynamicWavesLod_Wakes.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6e347d08403cf4db5bca5da4695cb3bb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Clamped.asset b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Clamped.asset new file mode 100644 index 0000000..0858456 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Clamped.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 03aa24b56404b45a190a2cfc0c7cc100, type: 3} + m_Name: Examples_FoamLod_Clamped + m_EditorClassIdentifier: + _Version: 0 + _Maximum: 1 + _FoamFadeRate: 0.8 + _WaveFoamStrength: 1 + _WaveFoamCoverage: 0.55 + _FilterWaves: 0 + _ShorelineFoamMaximumDepth: 0.65 + _ShorelineFoamStrength: 2 + _ShorelineFoamPriming: 5 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Clamped.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Clamped.asset.meta new file mode 100644 index 0000000..1bbe161 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Clamped.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c749742a2e70417e80c7ffddc9fe800 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Shoreline.asset b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Shoreline.asset new file mode 100644 index 0000000..e8fd9e8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Shoreline.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 03aa24b56404b45a190a2cfc0c7cc100, type: 3} + m_Name: Examples_FoamLod_Shoreline + m_EditorClassIdentifier: + _Version: 0 + _Maximum: 10 + _FoamFadeRate: 0.8 + _WaveFoamStrength: 1 + _WaveFoamCoverage: 0.55 + _FilterWaves: 2 + _ShorelineFoamMaximumDepth: 0.5 + _ShorelineFoamStrength: 1.5 + _ShorelineFoamPriming: 5 diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Shoreline.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Shoreline.asset.meta new file mode 100644 index 0000000..011aefe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Settings/Examples_FoamLod_Shoreline.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 716e7acbfd99c48d59432325fdfd1657 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders.meta new file mode 100644 index 0000000..f2038f7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b81a6dd70b0abbd40a045c5ab5ed6545 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders/Sine Wave.shadergraph b/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders/Sine Wave.shadergraph new file mode 100644 index 0000000..c477183 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders/Sine Wave.shadergraph @@ -0,0 +1,2038 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "22918182df7f43d18734e660c9bb0e6d", + "m_Properties": [ + { + "m_Id": "8a7a2c92411a4d9d8ee719524b8dd588" + }, + { + "m_Id": "552e4f8c1e9649f19731bd3fb785c6c9" + }, + { + "m_Id": "f0f354cf556f40b29e7563637c9e46a2" + } + ], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "1a4f713a71a04478a9ddb7b4065db460" + } + ], + "m_Nodes": [ + { + "m_Id": "e75e209e189441569189ac1995fac814" + }, + { + "m_Id": "6c521f93ae1c4418bbcd7db95ba77072" + }, + { + "m_Id": "049e2a11617540cd91b5905d7e602360" + }, + { + "m_Id": "7adbe727b57a468eaafd52267fc097d2" + }, + { + "m_Id": "cd0f156c542b4619b7281770039836b5" + }, + { + "m_Id": "98621ce2e8384650a727003ac9fe6ae3" + }, + { + "m_Id": "b4846ac2bd214f35a6fd38ed65f67842" + }, + { + "m_Id": "792cfaf6a9614455aa35da7aafd52b73" + }, + { + "m_Id": "f7f1ac81623c4a90b169ae38efecf59e" + }, + { + "m_Id": "f11caf2ff96341a2a8c7d8c9dc3324fb" + }, + { + "m_Id": "379b4dece73b4307852f9801afb22206" + }, + { + "m_Id": "b278af22a4f84f4ab9d3010efe92c9d7" + }, + { + "m_Id": "804c995ea2f24c0f9b89eec63536fc9d" + }, + { + "m_Id": "b3011a75913442638c8b515a6c1a68a1" + }, + { + "m_Id": "6353ffab56804d8b929fde9bd29f9621" + }, + { + "m_Id": "b60ed52ab93b44d69b79905e42e21b52" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "379b4dece73b4307852f9801afb22206" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cd0f156c542b4619b7281770039836b5" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6353ffab56804d8b929fde9bd29f9621" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f11caf2ff96341a2a8c7d8c9dc3324fb" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "792cfaf6a9614455aa35da7aafd52b73" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f11caf2ff96341a2a8c7d8c9dc3324fb" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "804c995ea2f24c0f9b89eec63536fc9d" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b4846ac2bd214f35a6fd38ed65f67842" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "98621ce2e8384650a727003ac9fe6ae3" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6353ffab56804d8b929fde9bd29f9621" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b278af22a4f84f4ab9d3010efe92c9d7" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "379b4dece73b4307852f9801afb22206" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b3011a75913442638c8b515a6c1a68a1" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "804c995ea2f24c0f9b89eec63536fc9d" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b4846ac2bd214f35a6fd38ed65f67842" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "379b4dece73b4307852f9801afb22206" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b60ed52ab93b44d69b79905e42e21b52" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6353ffab56804d8b929fde9bd29f9621" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cd0f156c542b4619b7281770039836b5" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "7adbe727b57a468eaafd52267fc097d2" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f11caf2ff96341a2a8c7d8c9dc3324fb" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "804c995ea2f24c0f9b89eec63536fc9d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f7f1ac81623c4a90b169ae38efecf59e" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "792cfaf6a9614455aa35da7aafd52b73" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "e75e209e189441569189ac1995fac814" + }, + { + "m_Id": "6c521f93ae1c4418bbcd7db95ba77072" + }, + { + "m_Id": "049e2a11617540cd91b5905d7e602360" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "7adbe727b57a468eaafd52267fc097d2" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"fileID\":10210,\"guid\":\"0000000000000000e000000000000000\",\"type\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Hidden/Crest/Examples", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_SubDatas": [], + "m_ActiveTargets": [ + { + "m_Id": "1b9d4d1e66054d0f8c6930b3fa52d986" + }, + { + "m_Id": "d844ace01485410e80662a30ebca0fe0" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "0078bfa772ad4df99fca58014a20d00d", + "m_Id": 0, + "m_DisplayName": "Speed", + "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.BlockNode", + "m_ObjectId": "049e2a11617540cd91b5905d7e602360", + "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": "7b3d97d734c44535b6e92bdaf9c04b2a" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "08a55b5a42bd49f48c59572ff22c288b", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "0eb3e79280f84094ad27a5f103b1039c", + "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.Vector1MaterialSlot", + "m_ObjectId": "117aae4c2c9345e4a8e9771a4d24b018", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "186d62d80d5342778df6756e00152eb0" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "19ea973ddf0c4b148dbca46ddaeeae7d", + "m_Id": 4, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "1a4f713a71a04478a9ddb7b4065db460", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "8a7a2c92411a4d9d8ee719524b8dd588" + }, + { + "m_Id": "552e4f8c1e9649f19731bd3fb785c6c9" + }, + { + "m_Id": "f0f354cf556f40b29e7563637c9e46a2" + } + ] +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInTarget", + "m_ObjectId": "1b9d4d1e66054d0f8c6930b3fa52d986", + "m_ActiveSubTarget": { + "m_Id": "69a1cbd2aa654c2caf86b26520c4717f" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZWriteControl": 2, + "m_ZTestMode": 8, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CustomEditorGUI": "" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "379b4dece73b4307852f9801afb22206", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -473.4999694824219, + "y": 196.9999237060547, + "width": 208.00003051757813, + "height": 302.00006103515627 + } + }, + "m_Slots": [ + { + "m_Id": "7184212f523e48aeb618209eefda8812" + }, + { + "m_Id": "3a7f74e178d44909825cd690b7bf9971" + }, + { + "m_Id": "5c9437c7ad6442518b9cc7e5bfa5bd7b" + } + ], + "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.DynamicValueMaterialSlot", + "m_ObjectId": "3a7f74e178d44909825cd690b7bf9971", + "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": "3d23c24a778e43889f85ea215e20c01d", + "m_Id": 3, + "m_DisplayName": "Z", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Z", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "Z" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "3d47edbe05f841289a33b6daaf5b97a9", + "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.Vector1MaterialSlot", + "m_ObjectId": "44476240d8604ef58a11ee3bc950c1a4", + "m_Id": 0, + "m_DisplayName": "Frequency", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "46a3a8476e24489aacda14252a9b9bfc", + "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": "4e8685ec667240db92456e304aebb75a", + "m_Id": 3, + "m_DisplayName": "Delta Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Delta Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "4ebf5dba557b49f09fe1c26297cd978b", + "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": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "552e4f8c1e9649f19731bd3fb785c6c9", + "m_Guid": { + "m_GuidSerialized": "4b53c42f-1dd3-4f26-9b05-8a3e33e3dac7" + }, + "m_Name": "Frequency", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Frequency", + "m_DefaultReferenceName": "_Frequency", + "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": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "5644802291704783b5edb990c094f174", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "57483a0d32254d8b88e5c70d13e690a7", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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", + "m_ObjectId": "5b9f04ddb2cd4ea5b24f8e84f88d51ae", + "m_Id": 0, + "m_DisplayName": "Amplitude", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "5c9437c7ad6442518b9cc7e5bfa5bd7b", + "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.Vector1MaterialSlot", + "m_ObjectId": "5f46b55c761643cb810fd9a4f7709407", + "m_Id": 2, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "62b08d76e5b14203a1a18905a418107b", + "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.MultiplyNode", + "m_ObjectId": "6353ffab56804d8b929fde9bd29f9621", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1331.5, + "y": 532.9999389648438, + "width": 126.0, + "height": 118.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "ad8be46615a545d6bf650505fe938b98" + }, + { + "m_Id": "46a3a8476e24489aacda14252a9b9bfc" + }, + { + "m_Id": "7dde372cc07f40e38c013867a8c3e6f7" + } + ], + "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", + "m_ObjectId": "63845547eb8346bf9a080756f05514ec", + "m_Id": 4, + "m_DisplayName": "Smooth Delta", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Smooth Delta", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInUnlitSubTarget", + "m_ObjectId": "69a1cbd2aa654c2caf86b26520c4717f" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "6c521f93ae1c4418bbcd7db95ba77072", + "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": "3d47edbe05f841289a33b6daaf5b97a9" + } + ], + "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.Vector1MaterialSlot", + "m_ObjectId": "6cfc9ab0da284349b388401fe23ec0f9", + "m_Id": 1, + "m_DisplayName": "Sine Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Sine Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "70a2445fa90f447abb345a2055b6ebdf", + "m_Id": 2, + "m_DisplayName": "Y", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Y", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "Y" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "7184212f523e48aeb618209eefda8812", + "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.SplitNode", + "m_ObjectId": "792cfaf6a9614455aa35da7aafd52b73", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Split", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -1320.5, + "y": 197.0, + "width": 118.0, + "height": 77.0 + } + }, + "m_Slots": [ + { + "m_Id": "57483a0d32254d8b88e5c70d13e690a7" + }, + { + "m_Id": "9232ab0666be437cb11d1f496e780194" + }, + { + "m_Id": "5f46b55c761643cb810fd9a4f7709407" + }, + { + "m_Id": "c5ac0dc722204852b9053cae308e84e8" + }, + { + "m_Id": "19ea973ddf0c4b148dbca46ddaeeae7d" + } + ], + "synonyms": [ + "separate" + ], + "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": "7adbe727b57a468eaafd52267fc097d2", + "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": "4ebf5dba557b49f09fe1c26297cd978b" + } + ], + "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.TangentMaterialSlot", + "m_ObjectId": "7b3d97d734c44535b6e92bdaf9c04b2a", + "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.PositionMaterialSlot", + "m_ObjectId": "7d79882cb18d46c793783a205d945c9f", + "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": "7dde372cc07f40e38c013867a8c3e6f7", + "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.MultiplyNode", + "m_ObjectId": "804c995ea2f24c0f9b89eec63536fc9d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -945.5, + "y": 197.0, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "9e2ffdbd58814c0e819573e67c95b984" + }, + { + "m_Id": "5644802291704783b5edb990c094f174" + }, + { + "m_Id": "0eb3e79280f84094ad27a5f103b1039c" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "8a7a2c92411a4d9d8ee719524b8dd588", + "m_Guid": { + "m_GuidSerialized": "ea6aab9b-304e-4630-b055-9c6300dd4783" + }, + "m_Name": "Amplitude", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Amplitude", + "m_DefaultReferenceName": "_Amplitude", + "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": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9232ab0666be437cb11d1f496e780194", + "m_Id": 1, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "95b0f00e5d2a4413ae0f02fde30507f1", + "m_Id": 2, + "m_DisplayName": "Cosine Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Cosine Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TimeNode", + "m_ObjectId": "98621ce2e8384650a727003ac9fe6ae3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Time", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -1426.0, + "y": 533.0, + "width": 79.0, + "height": 77.0 + } + }, + "m_Slots": [ + { + "m_Id": "e113ba628adb42d9b00abe4e7d316894" + }, + { + "m_Id": "6cfc9ab0da284349b388401fe23ec0f9" + }, + { + "m_Id": "95b0f00e5d2a4413ae0f02fde30507f1" + }, + { + "m_Id": "4e8685ec667240db92456e304aebb75a" + }, + { + "m_Id": "63845547eb8346bf9a080756f05514ec" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "9868502ff55c4fe2815bef5cd65e99e0", + "m_Id": 1, + "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.DynamicValueMaterialSlot", + "m_ObjectId": "9e2ffdbd58814c0e819573e67c95b984", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "ad8be46615a545d6bf650505fe938b98", + "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.PropertyNode", + "m_ObjectId": "b278af22a4f84f4ab9d3010efe92c9d7", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -625.4999389648438, + "y": 474.9999694824219, + "width": 128.0, + "height": 34.000030517578128 + } + }, + "m_Slots": [ + { + "m_Id": "5b9f04ddb2cd4ea5b24f8e84f88d51ae" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "8a7a2c92411a4d9d8ee719524b8dd588" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "b3011a75913442638c8b515a6c1a68a1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1102.5, + "y": 499.0, + "width": 130.5, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "44476240d8604ef58a11ee3bc950c1a4" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "552e4f8c1e9649f19731bd3fb785c6c9" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SineNode", + "m_ObjectId": "b4846ac2bd214f35a6fd38ed65f67842", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sine", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -705.5, + "y": 197.0, + "width": 208.00003051757813, + "height": 277.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "b7d6723e628147f8b093834965aa0589" + }, + { + "m_Id": "9868502ff55c4fe2815bef5cd65e99e0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "b60ed52ab93b44d69b79905e42e21b52", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1455.5, + "y": 610.0, + "width": 108.5, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "0078bfa772ad4df99fca58014a20d00d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "f0f354cf556f40b29e7563637c9e46a2" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b7d6723e628147f8b093834965aa0589", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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", + "m_ObjectId": "b7f390f0096e4b47948cf3294df15fae", + "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": 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.Vector3MaterialSlot", + "m_ObjectId": "bac6204db91041e084eef127ccc6f687", + "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": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c5ac0dc722204852b9053cae308e84e8", + "m_Id": 3, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3Node", + "m_ObjectId": "cd0f156c542b4619b7281770039836b5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Vector 3", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -248.50003051757813, + "y": 197.0, + "width": 127.50003051757813, + "height": 77.0 + } + }, + "m_Slots": [ + { + "m_Id": "117aae4c2c9345e4a8e9771a4d24b018" + }, + { + "m_Id": "70a2445fa90f447abb345a2055b6ebdf" + }, + { + "m_Id": "3d23c24a778e43889f85ea215e20c01d" + }, + { + "m_Id": "bac6204db91041e084eef127ccc6f687" + } + ], + "synonyms": [ + "3", + "v3", + "vec3", + "float3" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "d844ace01485410e80662a30ebca0fe0", + "m_Datas": [], + "m_ActiveSubTarget": { + "m_Id": "186d62d80d5342778df6756e00152eb0" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZTestMode": 8, + "m_ZWriteControl": 2, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CastShadows": false, + "m_ReceiveShadows": true, + "m_SupportsLODCrossFade": false, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "df855aea2c7642b7bcb8873203daed3e", + "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", + "m_ObjectId": "e113ba628adb42d9b00abe4e7d316894", + "m_Id": 0, + "m_DisplayName": "Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "e75e209e189441569189ac1995fac814", + "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": "7d79882cb18d46c793783a205d945c9f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "f0f354cf556f40b29e7563637c9e46a2", + "m_Guid": { + "m_GuidSerialized": "ac9c9fc0-2463-4540-af45-8267af98d4a4" + }, + "m_Name": "Speed", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Speed", + "m_DefaultReferenceName": "_Speed", + "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": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "f11caf2ff96341a2a8c7d8c9dc3324fb", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1180.0, + "y": 197.0, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "08a55b5a42bd49f48c59572ff22c288b" + }, + { + "m_Id": "df855aea2c7642b7bcb8873203daed3e" + }, + { + "m_Id": "62b08d76e5b14203a1a18905a418107b" + } + ], + "synonyms": [ + "addition", + "sum", + "plus" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "f7f1ac81623c4a90b169ae38efecf59e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1556.0, + "y": 197.0, + "width": 208.0, + "height": 312.5 + } + }, + "m_Slots": [ + { + "m_Id": "b7f390f0096e4b47948cf3294df15fae" + } + ], + "synonyms": [ + "texcoords", + "coords", + "coordinates" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders/Sine Wave.shadergraph.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders/Sine Wave.shadergraph.meta new file mode 100644 index 0000000..cdcdbe0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Shaders/Sine Wave.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 91e55ddaf9db84c6cb588a8ef20a3a8b +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites.meta new file mode 100644 index 0000000..b9ba36f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8845937d1fc52b439df5ab1d54fd610 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons.meta new file mode 100644 index 0000000..7211c4b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2fd5d2508ab1a4718a5df156d45d9e12 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowLeft.png b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowLeft.png new file mode 100644 index 0000000..d438e73 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowLeft.png differ diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowLeft.png.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowLeft.png.meta new file mode 100644 index 0000000..8d2bc67 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowLeft.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 522eb8ddfc4444cfa871927291d9ae6c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowRight.png b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowRight.png new file mode 100644 index 0000000..4b43505 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowRight.png differ diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowRight.png.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowRight.png.meta new file mode 100644 index 0000000..64b3862 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/ArrowRight.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 4ae6644b0437140e3af74b68b5fc1066 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/CHANGES b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/CHANGES new file mode 100644 index 0000000..fb38aaa --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/CHANGES @@ -0,0 +1 @@ +SVG icons have been converted to PNG. \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/CHANGES.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/CHANGES.meta new file mode 100644 index 0000000..59e244e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/CHANGES.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 68506965a60b7423b829836bb0b6d182 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/Flask.png b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/Flask.png new file mode 100644 index 0000000..d78d34a Binary files /dev/null and b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/Flask.png differ diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/Flask.png.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/Flask.png.meta new file mode 100644 index 0000000..48736e6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/Flask.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 3ac2b00bfeca4b34482fa33bb6aab50c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/LICENSE b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/LICENSE.meta b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/LICENSE.meta new file mode 100644 index 0000000..e6153e3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Examples/Sprites/MaterialIcons/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2bf0842a7eb404a01bc065143fcde2ce +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main.meta b/Packages/com.waveharmonic.crest/Samples~/Main.meta new file mode 100644 index 0000000..f10de21 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 243d61c9c51b841df9a5d397623e76b2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Materials.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Materials.meta new file mode 100644 index 0000000..7335e57 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5df83d742fa4a4fa1928c8ba387abc2f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Materials/Main_Water.mat b/Packages/com.waveharmonic.crest/Samples~/Main/Materials/Main_Water.mat new file mode 100644 index 0000000..bf47050 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Materials/Main_Water.mat @@ -0,0 +1,108 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6352005692287663048 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Main_Water + m_Shader: {fileID: -6465566751694194690, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_Parent: {fileID: -876546973899608171, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHATEST_ON + - _BUILTIN_ALPHATEST_ON + - _BUILTIN_AlphaClip + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _SPECULAR_SETUP + - _SURFACE_TYPE_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + MotionVector: User + RenderType: Transparent + disabledShaderPasses: + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _AlphaDstBlend: 10 + - _BUILTIN_DstBlend: 10 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_SrcBlend: 5 + - _BUILTIN_ZWrite: 1 + - _Crest_SSSDirectionalFalloff: 2 + - _Crest_SSSEnabled: 1 + - _Crest_SSSIntensity: 10 + - _Crest_SSSPinchFalloff: 2 + - _Crest_SSSPinchMaximum: 1.45 + - _Crest_SSSPinchMinimum: 0.45 + - _CullMode: 0 + - _CullModeForward: 0 + - _DstBlend: 10 + - _QueueControl: 0 + - _SrcBlend: 5 + - _ZTestGBuffer: 3 + m_Colors: + - _DoubleSidedConstants: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &1850022774379464565 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &7290408913889521333 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Materials/Main_Water.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Materials/Main_Water.mat.meta new file mode 100644 index 0000000..87a6e1a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Materials/Main_Water.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d340825b528984c3ea62563460223aa4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs.meta new file mode 100644 index 0000000..3baffff --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aaacb99c2eaa34c0db02f85709c4ab96 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs/Main_Scene.prefab b/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs/Main_Scene.prefab new file mode 100644 index 0000000..ab059e4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs/Main_Scene.prefab @@ -0,0 +1,1214 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &232902470714040458 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4204837857986613113} + - component: {fileID: 3996868714281853055} + m_Layer: 0 + m_Name: Waves + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4204837857986613113 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232902470714040458} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3629816661827269896} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3996868714281853055 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232902470714040458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 5 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: ce5a3f1aff978418c90b45d58f574528, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 0 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: 180 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.145 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &1104516363224853624 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 870797664709546069} + - component: {fileID: 7747841886290853953} + - component: {fileID: 8176426703623185542} + - component: {fileID: 8382319829487582714} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &870797664709546069 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1104516363224853624} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: -18, z: 0} + m_LocalScale: {x: 1000, y: 1000, z: 1000} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 5975219636523943332} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &7747841886290853953 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1104516363224853624} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8176426703623185542 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1104516363224853624} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1f54201eccb6e41d9bb362168241d966, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &8382319829487582714 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1104516363224853624} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1503756617474981124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8874229334513369341} + - component: {fileID: 354048457674067382} + m_Layer: 0 + m_Name: IslandDepthCache + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8874229334513369341 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1503756617474981124} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: 0.27672777, z: -0, w: 0.96094835} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 540, y: 1, z: 540} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5975219636523943332} + m_LocalEulerAnglesHint: {x: 0, y: 32.13, z: 0} +--- !u!114 &354048457674067382 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1503756617474981124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70deb49b538e247b9ab1bf7773d16809, type: 3} + m_Name: + m_EditorClassIdentifier: + _Type: 0 + _RefreshMode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 2147483648 + _Resolution: 384 + _CaptureRange: {x: -1000, y: 100} + _FillHolesCaptureHeight: 0 + _EnableBackFaceInclusion: 1 + _QualitySettingsOverride: + _OverrideLodBias: 1 + _LodBias: Infinity + _OverrideMaximumLodLevel: 1 + _MaximumLodLevel: 0 + _OverrideTerrainPixelError: 1 + _TerrainPixelError: 0 + _SavedTexture: {fileID: 2800000, guid: 83ef00b95b0b64a31b16163a45a7323b, type: 3} + _GenerateSignedDistanceField: 1 + _AdditionalJumpFloodRounds: 7 + _Debug: + _ForceAlwaysUpdateDebug: 0 + _ShowHiddenObjects: 0 + _ShowSimulationDataInScene: 0 + _Version: 1 +--- !u!1 &2635084430958343231 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3629816661827269896} + - component: {fileID: 1270079207173733000} + m_Layer: 4 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3629816661827269896 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2635084430958343231} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4204837857986613113} + m_Father: {fileID: 8969366642797183597} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1270079207173733000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2635084430958343231} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e64c239f69eea46778ded6dcc3427a34, type: 3} + m_Name: + m_EditorClassIdentifier: + _Layer: 4 + _Material: {fileID: 2100000, guid: d340825b528984c3ea62563460223aa4, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 0} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Version: 1 + _Camera: {fileID: 0} + _TimeProvider: {fileID: 0} + _WindZone: {fileID: 0} + _OverrideWindZoneWindSpeed: 0 + _WindSpeed: 150 + _OverrideWindZoneWindDirection: 0 + _WindDirection: 0 + _OverrideWindZoneWindTurbulence: 0 + _WindTurbulence: 0.145 + _OverrideGravity: 0 + _GravityOverride: -9.8 + _GravityMultiplier: 1 + _PrimaryLight: {fileID: 0} + _InjectionPoint: 0 + _WriteToColorTexture: 1 + _WriteToDepthTexture: 1 + _WriteMotionVectors: 1 + _OverrideRenderHDR: 0 + _RenderHDR: 1 + _Surface: + rid: 1010 + _ScaleRange: {x: 4, y: 256} + _DropDetailHeightBasedOnWaves: 0.2 + _Slices: 9 + _Resolution: 384 + _GeometryDownSampleFactor: 4 + _ExtentsSizeMultiplier: 100 + _Viewpoint: {fileID: 0} + _CenterOfDetailDisplacementCorrection: 1 + _SampleTerrainHeightForScale: 1 + _ForceScaleChangeSmoothing: 0 + _TeleportThreshold: 10 + _AnimatedWavesLod: + rid: 1000 + _DepthLod: + rid: 1001 + _LevelLod: + rid: 7000983677634084866 + _FoamLod: + rid: 1002 + _DynamicWavesLod: + rid: 1003 + _FlowLod: + rid: 1004 + _ShadowLod: + rid: 1005 + _AbsorptionLod: + rid: 1008 + _ScatteringLod: + rid: 1009 + _ClipLod: + rid: 1006 + _AlbedoLod: + rid: 1007 + _Reflections: + rid: 1720327093404827649 + _Underwater: + rid: 1720327093404827648 + _Meniscus: + rid: 1011 + _Portals: + rid: 7000983677634084867 + _ShowWaterProxyPlane: 0 + _EditModeFrameRate: 30 + _FollowSceneCamera: 1 + _HeightQueries: 1 + _Debug: + _AttachDebugGUI: 0 + _ShowHiddenObjects: 0 + _DisableFollowViewpoint: 0 + _DestroyResourcesInOnDisable: 0 + _DrawLodOutline: 0 + _ShowDebugInformation: 0 + _LogScaleChange: 0 + _PauseOnScaleChange: 0 + _IgnoreWavesForScaleChange: 0 + _ForceNoGraphics: 0 + _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + references: + version: 2 + RefIds: + - rid: 1000 + type: {class: AnimatedWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 48 + _WaveResolutionMultiplier: 1 + _AttenuationInShallows: 0.85 + _ShallowsMaximumDepth: 1000 + _CollisionSource: 2 + _CollisionLayers: -1 + _MaximumQueryCount: 4096 + _BakedWaveData: {fileID: 0} + - rid: 1001 + type: {class: DepthLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 46 + _IncludeTerrainHeight: 0 + _EnableSignedDistanceFields: 1 + - rid: 1002 + type: {class: FoamLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 45 + _SimulationFrequency: 30 + _Prewarm: 1 + _Settings: {fileID: 11400000, guid: e0a56d841e8854da48f505141f729c19, type: 2} + - rid: 1003 + type: {class: DynamicWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 512 + _TextureFormatMode: 300 + _TextureFormat: 46 + _SimulationFrequency: 60 + _AttenuationInShallows: 1 + _Settings: {fileID: 0} + - rid: 1004 + type: {class: FlowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 128 + _TextureFormatMode: 100 + _TextureFormat: 46 + - rid: 1005 + type: {class: ShadowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 6 + _SimulationFrequency: 60 + _DynamicSoftShadows: 1 + _SoftJitterExtinctionFactor: 0.75 + _JitterDiameterSoft: 15 + _CurrentFrameWeightSoft: 0.03 + _JitterDiameterHard: 0.6 + _CurrentFrameWeightHard: 0.15 + _AllowNullLight: 0 + _AllowNoShadows: 0 + - rid: 1006 + type: {class: ClipLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 5 + _DefaultClippingState: 0 + - rid: 1007 + type: {class: AlbedoLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 768 + _TextureFormatMode: 100 + _TextureFormat: 8 + - rid: 1008 + type: {class: AbsorptionLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 7 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 1.026, g: 2.085, b: 2.5500002, a: 0.306} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1009 + type: {class: ScatteringLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 23 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 0, g: 0.588, b: 1.2, a: 6} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1010 + type: {class: SurfaceRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: d340825b528984c3ea62563460223aa4, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 0} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Debug: + _UniformTiles: 0 + _DisableSkirt: 0 + - rid: 1011 + type: {class: Meniscus, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 238e45299a5ec46308e9bf99ddf67963, type: 2} + - rid: 1720327093404827648 + type: {class: UnderwaterRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: f2b096e4d95e646c49d48ece0afa0547, type: 2} + _EnvironmentalLightingEnable: 0 + _EnvironmentalLightingWeight: 1 + _EnvironmentalLightingVolumeProfile: {fileID: 0} + _AllCameras: 0 + _CopyWaterMaterialParametersEachFrame: 1 + _FarPlaneMultiplier: 0.68 + _CullLimit: 0.001 + _Debug: + _VisualizeMask: 0 + _DisableMask: 0 + _VisualizeStencil: 0 + _DisableHeightAboveWaterOptimization: 0 + _DisableArtifactCorrection: 0 + _OnlyReflectionCameras: 0 + - rid: 1720327093404827649 + type: {class: WaterReflections, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 0 + _Mode: 1 + _Layers: + serializedVersion: 2 + m_Bits: 2147483649 + _Resolution: 1024 + _RenderOnlySingleCamera: 0 + _Sky: 1 + _DisablePixelLights: 1 + _DisableShadows: 0 + _HDR: 1 + _Stencil: 0 + _AllowMSAA: 0 + _QualitySettingsOverride: + _OverrideLodBias: 0 + _LodBias: 0.5 + _OverrideMaximumLodLevel: 0 + _MaximumLodLevel: 1 + _OverrideTerrainPixelError: 0 + _TerrainPixelError: 10 + _ClipPlaneOffset: 0 + _FarClipPlane: 1000 + _DisableOcclusionCulling: 1 + _RefreshPerFrames: 1 + _FrameRefreshOffset: 0 + _UseObliqueMatrix: 1 + _NonObliqueNearSurface: 0 + _NonObliqueNearSurfaceThreshold: 0.05 + _Debug: + _ShowHiddenObjects: 0 + _DisableRecursiveRendering: 0 + - rid: 7000983677634084866 + type: {class: LevelLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 300 + _TextureFormat: 45 + - rid: 7000983677634084867 + type: {class: PortalRenderer, ns: WaveHarmonic.Crest.Portals, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _Mode: 2 + _Geometry: {fileID: 0} + _Invert: 0 +--- !u!1 &2945459103226009377 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5784295955613114531} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5784295955613114531 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2945459103226009377} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2383475393890819625} + - {fileID: 8633781964726676059} + m_Father: {fileID: 8969366642797183597} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3944601585446996055 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1416533258819384556} + m_Layer: 0 + m_Name: Environment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1416533258819384556 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3944601585446996055} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5975219636523943332} + m_Father: {fileID: 8969366642797183597} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4917276513506780838 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8969366642797183597} + m_Layer: 0 + m_Name: Main_Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8969366642797183597 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4917276513506780838} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5784295955613114531} + - {fileID: 2104327229655518219} + - {fileID: 3629816661827269896} + - {fileID: 1416533258819384556} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7219759713160417206 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2104327229655518219} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2104327229655518219 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7219759713160417206} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8235888314339679732} + - {fileID: 578263838878607630} + - {fileID: 219593412942282853} + m_Father: {fileID: 8969366642797183597} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &223532178001506277 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5784295955613114531} + m_Modifications: + - target: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_Name + value: Camera + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.x + value: 42 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.y + value: 12.5 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.z + value: 39 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7273085 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.008222009 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.6862176 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.007757488 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c26fe2b4fef6c484089497b549dd6b04, type: 3} +--- !u!4 &2383475393890819625 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 223532178001506277} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &776176713108429332 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5784295955613114531} + m_Modifications: + - target: {fileID: 6079220456006713144, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_Name + value: Post-Processing + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5e01cffb9e8324147affb8e08fd5ed13, type: 3} +--- !u!4 &8633781964726676059 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + m_PrefabInstance: {fileID: 776176713108429332} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1697483866391910090 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2104327229655518219} + m_Modifications: + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2942909709672342223, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_Name + value: Atmosphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63a4b7e65d06948649ac3e10077d8c2e, type: 3} +--- !u!4 &578263838878607630 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + m_PrefabInstance: {fileID: 1697483866391910090} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &5203518671358745123 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1416533258819384556} + m_Modifications: + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalPosition.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648531452862698620, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_Layer + value: 31 + objectReference: {fileID: 0} + - target: {fileID: 4918157582040048824, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_Name + value: Island + objectReference: {fileID: 0} + - target: {fileID: 4918157582040048824, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + propertyPath: m_Layer + value: 31 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8874229334513369341} + - targetCorrespondingSourceObject: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + insertIndex: -1 + addedObject: {fileID: 870797664709546069} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 87040033c33e7412c848211eea50db3e, type: 3} +--- !u!4 &5975219636523943332 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1935037318922608519, guid: 87040033c33e7412c848211eea50db3e, + type: 3} + m_PrefabInstance: {fileID: 5203518671358745123} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &5816025779141502847 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2104327229655518219} + m_Modifications: + - target: {fileID: 963553959586484309, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_Name + value: Lighting + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bece9afbf3ddd49059dd73ba2cc986f6, type: 3} +--- !u!4 &219593412942282853 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + m_PrefabInstance: {fileID: 5816025779141502847} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &6998798045305990011 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 2104327229655518219} + m_Modifications: + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.y + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.68657625 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.28438917 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.6181961 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.2560652 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5304508333967466499, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_Name + value: Sun + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.w + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 774ab582b39374a7e9d5dac8e31b9a5a, type: 3} +--- !u!4 &8235888314339679732 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + m_PrefabInstance: {fileID: 6998798045305990011} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs/Main_Scene.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs/Main_Scene.prefab.meta new file mode 100644 index 0000000..dbe5c15 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Prefabs/Main_Scene.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 63940726193fe4fa3a458e216e6cfff3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Props.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Props.meta new file mode 100644 index 0000000..d7e949e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Props.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76992cd3eba82492abc46acd9cb00b06 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island.meta new file mode 100644 index 0000000..ed1ceef --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 34b349214492e4d67aef5ff3365b114e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.fbx b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.fbx new file mode 100644 index 0000000..6635c52 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.fbx differ diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.fbx.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.fbx.meta new file mode 100644 index 0000000..c67e26b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.fbx.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 588a3a4e3a02940b69aad8ad12f74016 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: + - first: + 1: 100000 + second: //RootNode + - first: + 4: 400000 + second: //RootNode + - first: + 21: 2100000 + second: No Name + - first: + 23: 2300000 + second: //RootNode + - first: + 33: 3300000 + second: //RootNode + - first: + 43: 4300000 + second: Mounts + externalObjects: {} + materials: + materialImportMode: 0 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 10 + meshCompression: 0 + addColliders: 1 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 0 + importBlendShapes: 0 + importCameras: 0 + importLights: 0 + nodeNameCollisionStrategy: 0 + fileIdsGeneration: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 0 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 0 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 0 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 10 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 0 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 0 + importBlendShapeDeformPercent: 0 + remapMaterialsIfMaterialImportModeIsNone: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.mat b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.mat new file mode 100644 index 0000000..edfdc44 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.mat @@ -0,0 +1,229 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3729511000394478701 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Island + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Albedo: + 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} + - 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: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Alpha_Cutoff: 0.5 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _CastShadows: 1 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoMapScale: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _ExcludeFromTUAndAA: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0.25 + - _Mode: 0 + - _Normal_Flip_Back_Faces: 1 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SPECULARHIGHLIGHTS_OFF: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 9 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 15 + - _StencilWriteMaskMV: 41 + - _SupportDecals: 1 + - _Surface: 0 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteControl: 0 + m_Colors: + - _Color: {r: 0.603, g: 0.603, b: 0.603, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 0} + - _SpecularColor: {r: 0.19999987, g: 0.19999987, b: 0.19999987, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &3657522232568859003 +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 +--- !u!114 &3702943853698020124 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.mat.meta new file mode 100644 index 0000000..76a1ea2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f54201eccb6e41d9bb362168241d966 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.prefab b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.prefab new file mode 100644 index 0000000..34d49ea --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.prefab @@ -0,0 +1,101 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4918157582040048824 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1935037318922608519} + m_Layer: 0 + m_Name: Island + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1935037318922608519 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4918157582040048824} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4648531452862597212} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &4648531452862730972 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1935037318922608519} + m_Modifications: + - target: {fileID: 100000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_Name + value: Island + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalPosition.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalRotation.x + value: 0.000000021855694 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2300000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 1f54201eccb6e41d9bb362168241d966, type: 2} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 588a3a4e3a02940b69aad8ad12f74016, type: 3} +--- !u!4 &4648531452862597212 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 400000, guid: 588a3a4e3a02940b69aad8ad12f74016, + type: 3} + m_PrefabInstance: {fileID: 4648531452862730972} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.prefab.meta new file mode 100644 index 0000000..6831378 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Props/Island/Island.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 87040033c33e7412c848211eea50db3e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Scenes.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Scenes.meta new file mode 100644 index 0000000..919736a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88bea92d23e6843deb0730efdfae501b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Scenes/Main.unity b/Packages/com.waveharmonic.crest/Samples~/Main/Scenes/Main.unity new file mode 100644 index 0000000..213ef67 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Scenes/Main.unity @@ -0,0 +1,248 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.867, g: 0.9962, b: 1, a: 1} + m_FogMode: 2 + m_FogDensity: 0.00025 + m_LinearFogStart: 10 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 1 + m_BakeResolution: 50 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 0 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000000, guid: 184df75fa69c64aaabbe087a1ac35fb9, + type: 2} + m_LightingSettings: {fileID: 4890085278179872738, guid: 6e72aca972f324f7886200f86939d735, + type: 2} +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &2142142569 +GameObject: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2142142571} + - component: {fileID: 2142142570} + m_Layer: 0 + m_Name: StaticLightingSky + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2142142570 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2142142569} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 441482e8936e35048a1dffac814e3ef8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Profile: {fileID: 11400000, guid: ec2b869d521934af4a38390f24190cbc, type: 2} + m_StaticLightingSkyUniqueID: 4 + m_StaticLightingCloudsUniqueID: 0 + m_StaticLightingVolumetricClouds: 1 +--- !u!4 &2142142571 +Transform: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2142142569} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &5211704708078166315 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4917276513506780838, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_Name + value: Scene + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8969366642797183597, guid: 63940726193fe4fa3a458e216e6cfff3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63940726193fe4fa3a458e216e6cfff3, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 2142142571} + - {fileID: 5211704708078166315} diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Scenes/Main.unity.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Scenes/Main.unity.meta new file mode 100644 index 0000000..ad4e778 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Scenes/Main.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8c0fc83a6594144348db45c1fdd92640 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Settings.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Settings.meta new file mode 100644 index 0000000..8637d7f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c32c34617fcda4c2bb379a9c02cc7724 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Settings/Main_Lod_Foam.asset b/Packages/com.waveharmonic.crest/Samples~/Main/Settings/Main_Lod_Foam.asset new file mode 100644 index 0000000..9165ad4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Settings/Main_Lod_Foam.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 03aa24b56404b45a190a2cfc0c7cc100, type: 3} + m_Name: Main_Lod_Foam + m_EditorClassIdentifier: + _Version: 0 + _Maximum: Infinity + _FoamFadeRate: 0.5 + _WaveFoamStrength: 1 + _WaveFoamCoverage: 0.8 + _FilterWaves: 2 + _ShorelineFoamMaximumDepth: 0.8 + _ShorelineFoamStrength: 0.5 + _ShorelineFoamPriming: 5 diff --git a/Packages/com.waveharmonic.crest/Samples~/Main/Settings/Main_Lod_Foam.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Main/Settings/Main_Lod_Foam.asset.meta new file mode 100644 index 0000000..0540490 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Main/Settings/Main_Lod_Foam.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0a56d841e8854da48f505141f729c19 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples.meta new file mode 100644 index 0000000..aeb9929 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1533567352a46480587c84d04ebb12f0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials.meta new file mode 100644 index 0000000..b563fb1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9be24e9d83348468d9e3d070ff304415 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_AddBump.mat b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_AddBump.mat new file mode 100644 index 0000000..e30f0c3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_AddBump.mat @@ -0,0 +1,31 @@ +%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: Ripples_AddBump + m_Shader: {fileID: 4800000, guid: 7e8ca175bc339b74880584aa1544100e, 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: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _Crest_Amplitude: -20 + - _Crest_Radius: 1 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_AddBump.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_AddBump.mat.meta new file mode 100644 index 0000000..8a069c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_AddBump.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e068bb5f43bd40729e16f7c34c96f91 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_Water.mat b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_Water.mat new file mode 100644 index 0000000..926af56 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_Water.mat @@ -0,0 +1,107 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5994654682710206810 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-4042563326011365698 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Ripples_Water + m_Shader: {fileID: -6465566751694194690, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_Parent: {fileID: -876546973899608171, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHATEST_ON + - _BUILTIN_ALPHATEST_ON + - _BUILTIN_AlphaClip + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _SPECULAR_SETUP + - _SURFACE_TYPE_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + MotionVector: User + RenderType: Transparent + disabledShaderPasses: + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _AlphaDstBlend: 10 + - _BUILTIN_DstBlend: 10 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_SrcBlend: 5 + - _BUILTIN_ZWrite: 1 + - _Crest_NormalMapEnabled: 0 + - _Crest_PlanarReflectionsEnabled: 1 + - _Crest_Smoothness: 1 + - _Crest_SmoothnessFar: 1 + - _CullMode: 0 + - _CullModeForward: 0 + - _DstBlend: 10 + - _QueueControl: 0 + - _RefractionModel: 0 + - _SrcBlend: 5 + - _ZTestGBuffer: 3 + m_Colors: + - _DoubleSidedConstants: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &4748330692745026848 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_Water.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_Water.mat.meta new file mode 100644 index 0000000..f76a7b1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Materials/Ripples_Water.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa74fe26a90564079a48cdae97645f7b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs.meta new file mode 100644 index 0000000..3334a09 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec5d0727239a94e64b5133210259f440 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs/Ripples_RippleGenerator.prefab b/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs/Ripples_RippleGenerator.prefab new file mode 100644 index 0000000..96f84d1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs/Ripples_RippleGenerator.prefab @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6920241850790494902 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 873869071320452477} + - component: {fileID: 8502610257264510849} + - component: {fileID: 7469831289853732886} + - component: {fileID: 4365008454756617228} + - component: {fileID: 2709839245419151378} + m_Layer: 0 + m_Name: Ripples_RippleGenerator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &873869071320452477 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6920241850790494902} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &8502610257264510849 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6920241850790494902} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7469831289853732886 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6920241850790494902} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 0 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1e068bb5f43bd40729e16f7c34c96f91, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &4365008454756617228 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6920241850790494902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 82638e366ec3c4f5587d1ff63e01d8b2, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 3 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: 5130806863891791890 + _DrawBounds: 0 + _Version: 0 + references: + version: 2 + RefIds: + - rid: 5130806863891791890 + type: {class: DynamicWavesRendererLodInputData, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Input: {fileID: 4365008454756617228} + _Renderer: {fileID: 7469831289853732886} + _DisableRenderer: 1 + _OverrideShaderPass: 0 + _ShaderPassIndex: 0 + _CheckShaderName: 1 + _CheckShaderPasses: 1 +--- !u!114 &2709839245419151378 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6920241850790494902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 09287a67a2abc7943a2310ed30507b52, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _WarmUp: 1 + _OnTime: 0.25 + _Period: 4 diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs/Ripples_RippleGenerator.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs/Ripples_RippleGenerator.prefab.meta new file mode 100644 index 0000000..f472b35 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Prefabs/Ripples_RippleGenerator.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 178ae2ae1dc4f4224a165b75c017acfa +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes.meta new file mode 100644 index 0000000..6231e6f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cabc8ed05907543b8ba08181fded3b19 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes/Ripples.unity b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes/Ripples.unity new file mode 100644 index 0000000..0b99957 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes/Ripples.unity @@ -0,0 +1,1014 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 4890085278179872738, guid: 6e72aca972f324f7886200f86939d735, + type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &204793447 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 204793448} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &204793448 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 204793447} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1730370255} + - {fileID: 1305144323} + m_Father: {fileID: 1713053107} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &849648605 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1737612588} + m_Modifications: + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2942909709672342223, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_Name + value: Atmosphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63a4b7e65d06948649ac3e10077d8c2e, type: 3} +--- !u!4 &849648606 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + m_PrefabInstance: {fileID: 849648605} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1305144322 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 204793448} + m_Modifications: + - target: {fileID: 6079220456006713144, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_Name + value: PostProcessing + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5e01cffb9e8324147affb8e08fd5ed13, type: 3} +--- !u!4 &1305144323 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + m_PrefabInstance: {fileID: 1305144322} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1713053106 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1713053107} + m_Layer: 0 + m_Name: Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1713053107 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1713053106} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 204793448} + - {fileID: 1737612588} + - {fileID: 1887373153} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1730370254 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 204793448} + m_Modifications: + - target: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_Name + value: Camera + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.x + value: -12.755484 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.y + value: 3.9116275 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.z + value: -0.47643661 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.6911961 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.1276672 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.6994695 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.12919533 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c26fe2b4fef6c484089497b549dd6b04, type: 3} +--- !u!4 &1730370255 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 1730370254} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1737612587 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1737612588} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1737612588 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1737612587} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1745844464} + - {fileID: 1773514259} + - {fileID: 849648606} + m_Father: {fileID: 1713053107} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1745844463 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1737612588} + m_Modifications: + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.6898038 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.28572607 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.6145928 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.25457266 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 45 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 276.6 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5304508333967466499, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_Name + value: Sun + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 774ab582b39374a7e9d5dac8e31b9a5a, type: 3} +--- !u!4 &1745844464 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + m_PrefabInstance: {fileID: 1745844463} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1773514258 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1737612588} + m_Modifications: + - target: {fileID: 963553959586484309, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_Name + value: Lighting + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bece9afbf3ddd49059dd73ba2cc986f6, type: 3} +--- !u!4 &1773514259 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + m_PrefabInstance: {fileID: 1773514258} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1887373152 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1887373153} + - component: {fileID: 1887373154} + m_Layer: 0 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1887373153 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1887373152} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1713053107} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1887373154 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1887373152} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e64c239f69eea46778ded6dcc3427a34, type: 3} + m_Name: + m_EditorClassIdentifier: + _Layer: 4 + _Material: {fileID: 2100000, guid: aa74fe26a90564079a48cdae97645f7b, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Version: 1 + _Camera: {fileID: 0} + _TimeProvider: {fileID: 0} + _WindZone: {fileID: 0} + _OverrideWindZoneWindSpeed: 0 + _WindSpeed: 10 + _OverrideWindZoneWindDirection: 0 + _WindDirection: 0 + _OverrideWindZoneWindTurbulence: 0 + _WindTurbulence: 0.145 + _OverrideGravity: 0 + _GravityOverride: -9.8 + _GravityMultiplier: 1 + _PrimaryLight: {fileID: 0} + _InjectionPoint: 0 + _WriteToColorTexture: 1 + _WriteToDepthTexture: 1 + _WriteMotionVectors: 1 + _OverrideRenderHDR: 0 + _RenderHDR: 1 + _Surface: + rid: 4199187345983668226 + _ScaleRange: {x: 4, y: 256} + _DropDetailHeightBasedOnWaves: 0.2 + _Slices: 7 + _Resolution: 384 + _GeometryDownSampleFactor: 2 + _ExtentsSizeMultiplier: 100 + _Viewpoint: {fileID: 0} + _CenterOfDetailDisplacementCorrection: 1 + _SampleTerrainHeightForScale: 1 + _ForceScaleChangeSmoothing: 0 + _TeleportThreshold: 10 + _AnimatedWavesLod: + rid: 9154139594981113859 + _DepthLod: + rid: 9154139594981113860 + _LevelLod: + rid: 9154139594981113861 + _FoamLod: + rid: 9154139594981113862 + _DynamicWavesLod: + rid: 9154139594981113863 + _FlowLod: + rid: 9154139594981113864 + _ShadowLod: + rid: 9154139594981113865 + _AbsorptionLod: + rid: 323759186686771352 + _ScatteringLod: + rid: 323759186686771353 + _ClipLod: + rid: 9154139594981113866 + _AlbedoLod: + rid: 9154139594981113867 + _Reflections: + rid: 9154139594981113868 + _Underwater: + rid: 9154139594981113869 + _Meniscus: + rid: 9040549687677943810 + _Portals: + rid: 9154139594981113870 + _ShowWaterProxyPlane: 0 + _EditModeFrameRate: 30 + _FollowSceneCamera: 1 + _HeightQueries: 1 + _Debug: + _AttachDebugGUI: 0 + _ShowHiddenObjects: 0 + _DisableFollowViewpoint: 0 + _DestroyResourcesInOnDisable: 0 + _DrawLodOutline: 0 + _ShowDebugInformation: 0 + _LogScaleChange: 0 + _PauseOnScaleChange: 0 + _IgnoreWavesForScaleChange: 0 + _ForceNoGraphics: 0 + _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + references: + version: 2 + RefIds: + - rid: 323759186686771352 + type: {class: AbsorptionLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 7 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 1.026, g: 2.085, b: 2.5500002, a: 0.306} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 323759186686771353 + type: {class: ScatteringLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 23 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 0, g: 0.588, b: 1.2, a: 6} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 4199187345983668226 + type: {class: SurfaceRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: aa74fe26a90564079a48cdae97645f7b, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Debug: + _UniformTiles: 0 + _DisableSkirt: 0 + - rid: 9040549687677943810 + type: {class: Meniscus, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 238e45299a5ec46308e9bf99ddf67963, type: 2} + - rid: 9154139594981113859 + type: {class: AnimatedWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 48 + _WaveResolutionMultiplier: 1 + _AttenuationInShallows: 0.95 + _ShallowsMaximumDepth: 1000 + _CollisionSource: 2 + _CollisionLayers: -1 + _MaximumQueryCount: 4096 + _BakedWaveData: {fileID: 0} + - rid: 9154139594981113860 + type: {class: DepthLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 46 + _IncludeTerrainHeight: 0 + _EnableSignedDistanceFields: 1 + - rid: 9154139594981113861 + type: {class: LevelLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 300 + _TextureFormat: 45 + - rid: 9154139594981113862 + type: {class: FoamLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 45 + _SimulationFrequency: 30 + _Prewarm: 1 + _Settings: {fileID: 0} + - rid: 9154139594981113863 + type: {class: DynamicWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 512 + _TextureFormatMode: 300 + _TextureFormat: 46 + _SimulationFrequency: 60 + _AttenuationInShallows: 1 + _Settings: {fileID: 0} + - rid: 9154139594981113864 + type: {class: FlowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 128 + _TextureFormatMode: 100 + _TextureFormat: 46 + - rid: 9154139594981113865 + type: {class: ShadowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 6 + _SimulationFrequency: 60 + _DynamicSoftShadows: 1 + _SoftJitterExtinctionFactor: 0.75 + _JitterDiameterSoft: 15 + _CurrentFrameWeightSoft: 0.03 + _JitterDiameterHard: 0.6 + _CurrentFrameWeightHard: 0.15 + _AllowNullLight: 0 + _AllowNoShadows: 0 + - rid: 9154139594981113866 + type: {class: ClipLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 5 + _DefaultClippingState: 0 + - rid: 9154139594981113867 + type: {class: AlbedoLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 768 + _TextureFormatMode: 100 + _TextureFormat: 8 + - rid: 9154139594981113868 + type: {class: WaterReflections, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Mode: 1 + _Layers: + serializedVersion: 2 + m_Bits: 1 + _Resolution: 512 + _RenderOnlySingleCamera: 0 + _Sky: 1 + _DisablePixelLights: 1 + _DisableShadows: 1 + _HDR: 1 + _Stencil: 0 + _AllowMSAA: 0 + _QualitySettingsOverride: + _OverrideLodBias: 0 + _LodBias: 0.5 + _OverrideMaximumLodLevel: 0 + _MaximumLodLevel: 1 + _OverrideTerrainPixelError: 0 + _TerrainPixelError: 10 + _ClipPlaneOffset: 0 + _FarClipPlane: 1000 + _DisableOcclusionCulling: 1 + _RefreshPerFrames: 1 + _FrameRefreshOffset: 0 + _UseObliqueMatrix: 1 + _NonObliqueNearSurface: 0 + _NonObliqueNearSurfaceThreshold: 0.05 + _Debug: + _ShowHiddenObjects: 0 + _DisableRecursiveRendering: 0 + - rid: 9154139594981113869 + type: {class: UnderwaterRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: f2b096e4d95e646c49d48ece0afa0547, type: 2} + _EnvironmentalLightingEnable: 0 + _EnvironmentalLightingWeight: 1 + _EnvironmentalLightingVolumeProfile: {fileID: 0} + _AllCameras: 0 + _CopyWaterMaterialParametersEachFrame: 1 + _FarPlaneMultiplier: 0.68 + _CullLimit: 0.001 + _Debug: + _VisualizeMask: 0 + _DisableMask: 0 + _VisualizeStencil: 0 + _DisableHeightAboveWaterOptimization: 0 + _DisableArtifactCorrection: 0 + _OnlyReflectionCameras: 0 + - rid: 9154139594981113870 + type: {class: PortalRenderer, ns: WaveHarmonic.Crest.Portals, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _Mode: 2 + _Geometry: {fileID: 0} + _Invert: 0 +--- !u!1001 &2904561123747805697 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 90 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 873869071320452477, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6920241850790494902, guid: 178ae2ae1dc4f4224a165b75c017acfa, + type: 3} + propertyPath: m_Name + value: Ripple Generator + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 178ae2ae1dc4f4224a165b75c017acfa, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1713053107} + - {fileID: 2904561123747805697} diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes/Ripples.unity.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes/Ripples.unity.meta new file mode 100644 index 0000000..7cd6ba2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scenes/Ripples.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 026a0dc43f0e44e039bedc43ba02ce3e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts.meta new file mode 100644 index 0000000..20123df --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e277df4e45b3340b2a81947c76e7651c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/RippleGenerator.cs b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/RippleGenerator.cs new file mode 100644 index 0000000..8671800 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/RippleGenerator.cs @@ -0,0 +1,58 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Examples +{ + [RequireComponent(typeof(DynamicWavesLodInput))] + [@ExecuteDuringEditMode] + [AddComponentMenu(Constants.k_MenuPrefixSample + "Ripple Generator")] + sealed class RippleGenerator : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + float _WarmUp = 3f; + + [SerializeField] + float _OnTime = 0.2f; + + [SerializeField] + float _Period = 4f; + + DynamicWavesLodInput _DynamicWavesLodInput; + + private protected override void Initialize() + { + base.Initialize(); + if (_DynamicWavesLodInput == null) _DynamicWavesLodInput = GetComponent(); + _DynamicWavesLodInput.ForceRenderingOff = true; + } + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + if (!water.DynamicWavesLod.Enabled || _DynamicWavesLodInput == null) + { + return; + } + + var time = water.CurrentTime; + + if (time < _WarmUp) + { + _DynamicWavesLodInput.ForceRenderingOff = true; + return; + } + + time -= _WarmUp; + time = Mathf.Repeat(time, _Period); + _DynamicWavesLodInput.ForceRenderingOff = time >= _OnTime; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/RippleGenerator.cs.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/RippleGenerator.cs.meta new file mode 100644 index 0000000..e26896b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/RippleGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 09287a67a2abc7943a2310ed30507b52 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/WaveHarmonic.Crest.Samples.Ripples.asmdef b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/WaveHarmonic.Crest.Samples.Ripples.asmdef new file mode 100644 index 0000000..991fa16 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/WaveHarmonic.Crest.Samples.Ripples.asmdef @@ -0,0 +1,26 @@ +{ + "name": "WaveHarmonic.Crest.Samples.Ripples", + "rootNamespace": "", + "references": [ + "GUID:7c347618730f5467f86a58f333ce21df", + "GUID:056ff2a5b2f124d468c6655552acdca5" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER", + "d_Crest" + ], + "versionDefines": [ + { + "name": "com.waveharmonic.crest", + "expression": "", + "define": "d_Crest" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/WaveHarmonic.Crest.Samples.Ripples.asmdef.meta b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/WaveHarmonic.Crest.Samples.Ripples.asmdef.meta new file mode 100644 index 0000000..1b4a4a7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Ripples/Scripts/WaveHarmonic.Crest.Samples.Ripples.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bfd5c7117a4004d0888e3b2a1a5140c0 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes.meta new file mode 100644 index 0000000..52094b8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f05fef5f801384f3395c06ec2696fb93 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Data.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Data.meta new file mode 100644 index 0000000..8e64f22 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 201a90992155943edaad5414502f73fc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Data/Wakes_Waves.asset b/Packages/com.waveharmonic.crest/Samples~/Wakes/Data/Wakes_Waves.asset new file mode 100644 index 0000000..d70fef1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Data/Wakes_Waves.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 382a5d8b1147b4e78a31353c022b8e15, type: 3} + m_Name: Wakes_Waves + m_EditorClassIdentifier: + _Version: 0 + _WaveDirectionVariance: 90 + _GravityScale: 1 + _Multiplier: 1 + _PowerLogarithmicScales: + - -7.39794 + - -7.39794 + - -6.598513 + - -6.1406407 + - -4.8268056 + - -4.3421416 + - -3.232016 + - -2.909008 + - -2.7731915 + - -2.4056463 + - -2.5869184 + - -4.421911 + - -7.39794 + - -7.39794 + _PowerDisabled: 0000000000000000000001010101 + _ChopScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _GravityScales: + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + - 1 + _Chop: 1.69 + _ShowAdvancedControls: 0 + _Model: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Data/Wakes_Waves.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Data/Wakes_Waves.asset.meta new file mode 100644 index 0000000..51e84d7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Data/Wakes_Waves.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30151f29a777a41f39698cb262ee599b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials.meta new file mode 100644 index 0000000..1604104 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5a3dbdfd8dbf46c7ad2ef7974f95ed0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Skybox.mat b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Skybox.mat new file mode 100644 index 0000000..6b228e0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Skybox.mat @@ -0,0 +1,30 @@ +%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: Wakes_Skybox + m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _Rotation: 151.6 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Skybox.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Skybox.mat.meta new file mode 100644 index 0000000..98bf408 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Skybox.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ce41d2630b464900950fda7b232b2f3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Water.mat b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Water.mat new file mode 100644 index 0000000..14617f7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Water.mat @@ -0,0 +1,104 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5994654682710206810 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-4042563326011365698 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Wakes_Water + m_Shader: {fileID: -6465566751694194690, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_Parent: {fileID: -876546973899608171, guid: 00ffe7d0b7161420897069dc6e12822c, + type: 3} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHATEST_ON + - _BUILTIN_ALPHATEST_ON + - _BUILTIN_AlphaClip + - _BUILTIN_SURFACE_TYPE_TRANSPARENT + - _BUILTIN_TRANSPARENT_RECEIVES_SHADOWS + - _DOUBLESIDED_ON + - _ENABLE_FOG_ON_TRANSPARENT + - _SPECULAR_SETUP + - _SURFACE_TYPE_TRANSPARENT + - _TRANSPARENT_WRITES_MOTION_VEC + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + MotionVector: User + RenderType: Transparent + disabledShaderPasses: + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _AlphaDstBlend: 10 + - _BUILTIN_DstBlend: 10 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_SrcBlend: 5 + - _BUILTIN_ZWrite: 1 + - _Crest_Anisotropy: 0 + - _CullMode: 0 + - _CullModeForward: 0 + - _DstBlend: 10 + - _QueueControl: 0 + - _SrcBlend: 5 + - _ZTestGBuffer: 3 + m_Colors: + - _Crest_Scattering: {r: 0, g: 0.04848485, b: 0.1, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &4748330692745026848 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Water.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Water.mat.meta new file mode 100644 index 0000000..1db1236 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/Wakes_Water.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d6e4d43be817745be8c654fe12d10077 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/White.mat b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/White.mat new file mode 100644 index 0000000..6e2f86a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/White.mat @@ -0,0 +1,227 @@ +%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: White + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Albedo: + 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} + - 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: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Alpha_Cutoff: 0.5 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _CastShadows: 1 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoMapScale: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _Normal_Flip_Back_Faces: 1 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SPECULARHIGHLIGHTS_OFF: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _Surface: 0 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteControl: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 0} + - _SpecularColor: {r: 0.19999987, g: 0.19999987, b: 0.19999987, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &64603560720380681 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &3999515451107788836 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &6681470257461779220 +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 diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/White.mat.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/White.mat.meta new file mode 100644 index 0000000..bf5e2b2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Materials/White.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b52345831a9243fb9eef6af7a64bce1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs.meta new file mode 100644 index 0000000..ba1c94b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cfcef81d645604467aa4e402ff92dcf3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs/Wakes_Scene.prefab b/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs/Wakes_Scene.prefab new file mode 100644 index 0000000..37146bc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs/Wakes_Scene.prefab @@ -0,0 +1,1693 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &20686035996052114 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2087432261701429710} + - component: {fileID: 6344175151932737465} + - component: {fileID: 5733009697335579863} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2087432261701429710 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 20686035996052114} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2, y: 2, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2761910563489756842} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6344175151932737465 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 20686035996052114} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5733009697335579863 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 20686035996052114} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b52345831a9243fb9eef6af7a64bce1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &178055086136913821 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6817083790718907453} + - component: {fileID: 1423317228768787992} + m_Layer: 0 + m_Name: Wake 5m + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6817083790718907453 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 178055086136913821} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 30, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5106902306583215722} + m_Father: {fileID: 8735806159853400568} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1423317228768787992 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 178055086136913821} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 5 + _Weight: 6 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.16 + _CompensateForWaveMotion: 0.5 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &462074012035794570 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2572968821584599838} + - component: {fileID: 2231941672010319715} + - component: {fileID: 2054636517843770851} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2572968821584599838 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 462074012035794570} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 5, y: 5, z: 5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5347239147462169160} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2231941672010319715 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 462074012035794570} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2054636517843770851 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 462074012035794570} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b52345831a9243fb9eef6af7a64bce1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1639977966930744319 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6347881110646451066} + - component: {fileID: 5783253898884206363} + m_Layer: 0 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6347881110646451066 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1639977966930744319} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5743668489789966581} + m_Father: {fileID: 1327046202153068283} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5783253898884206363 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1639977966930744319} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e64c239f69eea46778ded6dcc3427a34, type: 3} + m_Name: + m_EditorClassIdentifier: + _Layer: 4 + _Material: {fileID: 2100000, guid: d6e4d43be817745be8c654fe12d10077, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Version: 1 + _Camera: {fileID: 0} + _TimeProvider: {fileID: 0} + _WindZone: {fileID: 0} + _OverrideWindZoneWindSpeed: 0 + _WindSpeed: 150 + _OverrideWindZoneWindDirection: 0 + _WindDirection: 0 + _OverrideWindZoneWindTurbulence: 0 + _WindTurbulence: 0.145 + _OverrideGravity: 0 + _GravityOverride: -9.8 + _GravityMultiplier: 1 + _PrimaryLight: {fileID: 0} + _InjectionPoint: 0 + _WriteToColorTexture: 1 + _WriteToDepthTexture: 1 + _WriteMotionVectors: 1 + _OverrideRenderHDR: 0 + _RenderHDR: 1 + _Surface: + rid: 1002 + _ScaleRange: {x: 4, y: 256} + _DropDetailHeightBasedOnWaves: 0.2 + _Slices: 9 + _Resolution: 384 + _GeometryDownSampleFactor: 2 + _ExtentsSizeMultiplier: 100 + _Viewpoint: {fileID: 0} + _CenterOfDetailDisplacementCorrection: 1 + _SampleTerrainHeightForScale: 1 + _ForceScaleChangeSmoothing: 0 + _TeleportThreshold: 10 + _AnimatedWavesLod: + rid: 162836781179600924 + _DepthLod: + rid: 162836781179600925 + _LevelLod: + rid: 162836781179600926 + _FoamLod: + rid: 162836781179600927 + _DynamicWavesLod: + rid: 162836781179600928 + _FlowLod: + rid: 162836781179600929 + _ShadowLod: + rid: 162836781179600930 + _AbsorptionLod: + rid: 1000 + _ScatteringLod: + rid: 1001 + _ClipLod: + rid: 162836781179600931 + _AlbedoLod: + rid: 162836781179600932 + _Reflections: + rid: 162836781179600933 + _Underwater: + rid: 162836781179600934 + _Meniscus: + rid: 1003 + _Portals: + rid: 162836781179600935 + _ShowWaterProxyPlane: 0 + _EditModeFrameRate: 30 + _FollowSceneCamera: 1 + _HeightQueries: 1 + _Debug: + _AttachDebugGUI: 0 + _ShowHiddenObjects: 0 + _DisableFollowViewpoint: 0 + _DestroyResourcesInOnDisable: 0 + _DrawLodOutline: 0 + _ShowDebugInformation: 0 + _LogScaleChange: 0 + _PauseOnScaleChange: 0 + _IgnoreWavesForScaleChange: 0 + _ForceNoGraphics: 0 + _Resources: {fileID: 11400000, guid: 0817af17dea584e5382e6216db162d4a, type: 2} + references: + version: 2 + RefIds: + - rid: 1000 + type: {class: AbsorptionLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 7 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 1.026, g: 2.085, b: 2.5500002, a: 0.306} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1001 + type: {class: ScatteringLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 200 + _TextureFormat: 23 + _ShorelineColorSource: 0 + _ShorelineColor: {r: 0, g: 0.588, b: 1.2, a: 6} + _ShorelineColorMaximumDistance: 10 + _ShorelineColorFalloff: 2 + - rid: 1002 + type: {class: SurfaceRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: d6e4d43be817745be8c654fe12d10077, type: 2} + _VolumeMaterial: {fileID: 0} + _ChunkTemplate: {fileID: 1516456258233481520, guid: 17840562212c147d6bdb5144d35bc442, + type: 3} + _CastShadows: 0 + _WaterBodyCulling: 1 + _TimeSliceBoundsUpdateFrameCount: 1 + _SurfaceSelfIntersectionFixMode: 4 + _AllowRenderQueueSorting: 0 + _Debug: + _UniformTiles: 0 + _DisableSkirt: 0 + - rid: 1003 + type: {class: Meniscus, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: 238e45299a5ec46308e9bf99ddf67963, type: 2} + - rid: 162836781179600924 + type: {class: AnimatedWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 48 + _WaveResolutionMultiplier: 1 + _AttenuationInShallows: 0.95 + _ShallowsMaximumDepth: 1000 + _CollisionSource: 2 + _CollisionLayers: -1 + _MaximumQueryCount: 4096 + _BakedWaveData: {fileID: 0} + - rid: 162836781179600925 + type: {class: DepthLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 46 + _IncludeTerrainHeight: 0 + _EnableSignedDistanceFields: 1 + - rid: 162836781179600926 + type: {class: LevelLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 0 + _Resolution: 256 + _TextureFormatMode: 300 + _TextureFormat: 45 + - rid: 162836781179600927 + type: {class: FoamLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 45 + _SimulationFrequency: 30 + _Prewarm: 0 + _Settings: {fileID: 11400000, guid: fb1aaea1e5e8d4ba6b718be97218a083, type: 2} + - rid: 162836781179600928 + type: {class: DynamicWavesLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 1 + _OverrideResolution: 0 + _Resolution: 512 + _TextureFormatMode: 300 + _TextureFormat: 46 + _SimulationFrequency: 60 + _AttenuationInShallows: 1 + _Settings: {fileID: 11400000, guid: 8dea483b97d254faa99deffab2bbfd05, type: 2} + - rid: 162836781179600929 + type: {class: FlowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 128 + _TextureFormatMode: 100 + _TextureFormat: 46 + - rid: 162836781179600930 + type: {class: ShadowLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 6 + _SimulationFrequency: 60 + _DynamicSoftShadows: 1 + _SoftJitterExtinctionFactor: 0.75 + _JitterDiameterSoft: 15 + _CurrentFrameWeightSoft: 0.03 + _JitterDiameterHard: 0.6 + _CurrentFrameWeightHard: 0.15 + _AllowNullLight: 0 + _AllowNoShadows: 0 + - rid: 162836781179600931 + type: {class: ClipLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 256 + _TextureFormatMode: 100 + _TextureFormat: 5 + _DefaultClippingState: 0 + - rid: 162836781179600932 + type: {class: AlbedoLod, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _OverrideResolution: 1 + _Resolution: 768 + _TextureFormatMode: 100 + _TextureFormat: 8 + - rid: 162836781179600933 + type: {class: WaterReflections, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 0 + _Mode: 0 + _Layers: + serializedVersion: 2 + m_Bits: 1 + _Resolution: 256 + _RenderOnlySingleCamera: 0 + _Sky: 0 + _DisablePixelLights: 1 + _DisableShadows: 1 + _HDR: 1 + _Stencil: 0 + _AllowMSAA: 0 + _QualitySettingsOverride: + _OverrideLodBias: 0 + _LodBias: 0.5 + _OverrideMaximumLodLevel: 0 + _MaximumLodLevel: 1 + _OverrideTerrainPixelError: 0 + _TerrainPixelError: 10 + _ClipPlaneOffset: 0 + _FarClipPlane: 1000 + _DisableOcclusionCulling: 1 + _RefreshPerFrames: 1 + _FrameRefreshOffset: 0 + _UseObliqueMatrix: 1 + _NonObliqueNearSurface: 0 + _NonObliqueNearSurfaceThreshold: 0.05 + _Debug: + _ShowHiddenObjects: 0 + _DisableRecursiveRendering: 0 + - rid: 162836781179600934 + type: {class: UnderwaterRenderer, ns: WaveHarmonic.Crest, asm: WaveHarmonic.Crest} + data: + _Version: 0 + _Enabled: 1 + _Layer: 4 + _Material: {fileID: 2100000, guid: f2b096e4d95e646c49d48ece0afa0547, type: 2} + _EnvironmentalLightingEnable: 0 + _EnvironmentalLightingWeight: 1 + _EnvironmentalLightingVolumeProfile: {fileID: 0} + _AllCameras: 0 + _CopyWaterMaterialParametersEachFrame: 1 + _FarPlaneMultiplier: 0.68 + _CullLimit: 0.001 + _Debug: + _VisualizeMask: 0 + _DisableMask: 0 + _VisualizeStencil: 0 + _DisableHeightAboveWaterOptimization: 0 + _DisableArtifactCorrection: 0 + _OnlyReflectionCameras: 0 + - rid: 162836781179600935 + type: {class: PortalRenderer, ns: WaveHarmonic.Crest.Portals, asm: WaveHarmonic.Crest} + data: + _Enabled: 0 + _Mode: 2 + _Geometry: {fileID: 0} + _Invert: 0 +--- !u!1 &2433033423460560345 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8735806159853400568} + - component: {fileID: 4017145043297406249} + m_Layer: 0 + m_Name: Track + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8735806159853400568 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2433033423460560345} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3157906893216447488} + - {fileID: 7180956579974921332} + - {fileID: 6817083790718907453} + - {fileID: 5347239147462169160} + - {fileID: 2761910563489756842} + - {fileID: 4181489854103466341} + m_Father: {fileID: 1327046202153068283} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4017145043297406249 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2433033423460560345} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f069d1ec9fe154d3ba75ff75ed08e5b9, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _ResetOnDisable: 0 + _IsLocal: 0 + _Velocity: {x: 0, y: 0, z: 9} + _AngularVelocity: {x: 0, y: 0, z: 0} +--- !u!1 &3009166439874572054 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5743668489789966581} + - component: {fileID: 6183632398033846740} + m_Layer: 0 + m_Name: Waves + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5743668489789966581 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3009166439874572054} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6347881110646451066} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6183632398033846740 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3009166439874572054} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88bb6e05d83b64105a4d8cbd478f5916, type: 3} + m_Name: + m_EditorClassIdentifier: + _Mode: 5 + _Weight: 1 + _Queue: 0 + _Blend: 1 + _FeatherWidth: 0.1 + _FollowHorizontalWaveMotion: 0 + _Data: + rid: -2 + _DrawBounds: 0 + _Spectrum: {fileID: 11400000, guid: 30151f29a777a41f39698cb262ee599b, type: 2} + _EvaluateSpectrumAtRunTimeEveryFrame: 1 + _RespectShallowWaterAttenuation: 1 + _OverrideGlobalWindDirection: 1 + _WaveDirectionHeadingAngle: -90 + _OverrideGlobalWindSpeed: 0 + _WindSpeed: 20 + _Resolution: 128 + _DrawSlicesInEditor: 0 + _AlphaSource: 0 + _OverrideGlobalWindTurbulence: 1 + _WindTurbulence: 0.145 + _WindAlignment: 0 + _TimeLoopLength: Infinity + _MaximumVerticalDisplacement: 10 + _MaximumHorizontalDisplacement: 15 + _EnableBakedCollision: 0 + _TimeResolution: 4 + _SmallestWavelengthRequired: 2 + _BakedTimeLoopLength: 32 + _Version: 2 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } +--- !u!1 &3223943399787074587 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2825961531527956308} + - component: {fileID: 1307157075554847996} + - component: {fileID: 6598862181808892976} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2825961531527956308 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3223943399787074587} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4181489854103466341} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1307157075554847996 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3223943399787074587} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6598862181808892976 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3223943399787074587} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b52345831a9243fb9eef6af7a64bce1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &3702440848664065328 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3157906893216447488} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3157906893216447488 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3702440848664065328} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 3697856952021169906} + - {fileID: 5232638321919799400} + m_Father: {fileID: 8735806159853400568} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4119266590503936378 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2761910563489756842} + - component: {fileID: 6623256577474389554} + m_Layer: 0 + m_Name: Wake 1m + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2761910563489756842 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4119266590503936378} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 75, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2087432261701429710} + m_Father: {fileID: 8735806159853400568} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6623256577474389554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4119266590503936378} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 1 + _Weight: 4 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.5 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &4130147698797859340 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5249352634612458374} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5249352634612458374 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4130147698797859340} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3610791962434705709} + - {fileID: 1713295339014179689} + - {fileID: 4492245157322892219} + m_Father: {fileID: 1327046202153068283} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4320895712002472273 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7180956579974921332} + - component: {fileID: 2066177269349931890} + m_Layer: 0 + m_Name: Wake 10m + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7180956579974921332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4320895712002472273} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -15, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8584538336157196543} + m_Father: {fileID: 8735806159853400568} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2066177269349931890 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4320895712002472273} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 10 + _Weight: 8 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.46 + _CompensateForWaveMotion: 0.5 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &4915304192325342201 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1327046202153068283} + m_Layer: 0 + m_Name: Wakes_Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1327046202153068283 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4915304192325342201} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6347881110646451066} + - {fileID: 5249352634612458374} + - {fileID: 8735806159853400568} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5209730265424392240 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5347239147462169160} + - component: {fileID: 6096360234716126342} + m_Layer: 0 + m_Name: Wake 2.5m + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5347239147462169160 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5209730265424392240} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 60, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2572968821584599838} + m_Father: {fileID: 8735806159853400568} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6096360234716126342 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5209730265424392240} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 2.5 + _Weight: 6 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.08 + _CompensateForWaveMotion: 0.5 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &6512823017041313315 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8584538336157196543} + - component: {fileID: 893560014785342096} + - component: {fileID: 487230516339555629} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8584538336157196543 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6512823017041313315} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 20, y: 20, z: 20} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7180956579974921332} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &893560014785342096 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6512823017041313315} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &487230516339555629 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6512823017041313315} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b52345831a9243fb9eef6af7a64bce1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &7442276582847542784 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4181489854103466341} + - component: {fileID: 930411080212801945} + m_Layer: 0 + m_Name: Wake 0.5m + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4181489854103466341 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7442276582847542784} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 85, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2825961531527956308} + m_Father: {fileID: 8735806159853400568} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &930411080212801945 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7442276582847542784} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8958fecc82ae04c7d9128101addbdc3b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Radius: 0.5 + _Weight: 6 + _WeightVerticalMultiplier: 0.5 + _InnerSphereMultiplier: 1.55 + _InnerSphereOffset: 0.109 + _VelocityOffset: 0.04 + _CompensateForWaveMotion: 0.456 + _BoostLargeWaves: 0 + _TeleportSpeed: 500 + _WarnOnTeleport: 0 + _MaximumSpeed: 100 + _WarnOnSpeedClamp: 0 + _DebugSubsteps: 0 +--- !u!1 &8666284635679026844 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5106902306583215722} + - component: {fileID: 4649506145502178742} + - component: {fileID: 4296682747726998401} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5106902306583215722 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8666284635679026844} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6817083790718907453} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4649506145502178742 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8666284635679026844} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4296682747726998401 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8666284635679026844} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9b52345831a9243fb9eef6af7a64bce1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1001 &598436109099922605 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5249352634612458374} + m_Modifications: + - target: {fileID: 2054049920268771810, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: sharedProfile + value: + objectReference: {fileID: 11400000, guid: 26a21902be1c8495ab8fe6ce57a56b7f, + type: 2} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2942909709672342223, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: m_Name + value: Atmosphere + objectReference: {fileID: 0} + - target: {fileID: 8705736009777882428, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + propertyPath: _SkyBox + value: + objectReference: {fileID: 2100000, guid: 5ce41d2630b464900950fda7b232b2f3, type: 2} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63a4b7e65d06948649ac3e10077d8c2e, type: 3} +--- !u!4 &1713295339014179689 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2272289698115174340, guid: 63a4b7e65d06948649ac3e10077d8c2e, + type: 3} + m_PrefabInstance: {fileID: 598436109099922605} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1249896388749625150 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 3157906893216447488} + m_Modifications: + - target: {fileID: 2452750316707852747, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_Name + value: Camera + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.x + value: 91.10611 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.y + value: 4.962348 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalPosition.z + value: 2.4358063 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.515789 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.08262099 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.8419886 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.13487287 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c26fe2b4fef6c484089497b549dd6b04, type: 3} +--- !u!4 &3697856952021169906 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2452750316707852748, guid: c26fe2b4fef6c484089497b549dd6b04, + type: 3} + m_PrefabInstance: {fileID: 1249896388749625150} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &2411507572598714274 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5249352634612458374} + m_Modifications: + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.w + value: -0.7791921 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.3227519 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.49640015 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.20561567 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5304508333967466499, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_Name + value: Sun + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.w + value: 2.4342669e+36 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.x + value: 1e-45 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.y + value: 2.4342669e+36 + objectReference: {fileID: 0} + - target: {fileID: 8430430470315967237, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + propertyPath: m_BoundingSphereOverride.z + value: 1e-45 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 774ab582b39374a7e9d5dac8e31b9a5a, type: 3} +--- !u!4 &3610791962434705709 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1399345652565587599, guid: 774ab582b39374a7e9d5dac8e31b9a5a, + type: 3} + m_PrefabInstance: {fileID: 2411507572598714274} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3858110140021932071 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 3157906893216447488} + m_Modifications: + - target: {fileID: 6079220456006713144, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_Name + value: Post-Processing + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5e01cffb9e8324147affb8e08fd5ed13, type: 3} +--- !u!4 &5232638321919799400 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9013060131419009103, guid: 5e01cffb9e8324147affb8e08fd5ed13, + type: 3} + m_PrefabInstance: {fileID: 3858110140021932071} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7921025258830529697 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5249352634612458374} + m_Modifications: + - target: {fileID: 963553959586484309, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_Name + value: Lighting + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bece9afbf3ddd49059dd73ba2cc986f6, type: 3} +--- !u!4 &4492245157322892219 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6033288213199496986, guid: bece9afbf3ddd49059dd73ba2cc986f6, + type: 3} + m_PrefabInstance: {fileID: 7921025258830529697} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs/Wakes_Scene.prefab.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs/Wakes_Scene.prefab.meta new file mode 100644 index 0000000..e13c69f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Prefabs/Wakes_Scene.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f008e92d3479d4788a9ed63746d4940c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes.meta new file mode 100644 index 0000000..de40a00 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7cda7c106dd5c4df186ca459aba3700f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes/Wakes.unity b/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes/Wakes.unity new file mode 100644 index 0000000..2d7826b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes/Wakes.unity @@ -0,0 +1,199 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.83137256, g: 0.92941177, b: 0.93333334, a: 1} + m_FogMode: 3 + m_FogDensity: 0.0001 + m_LinearFogStart: 1000 + m_LinearFogEnd: 10000 + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 5ce41d2630b464900950fda7b232b2f3, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 1 + m_BakeResolution: 50 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 0 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000000, guid: 1a6ad1414f33a48ecb2c3de0a79053b6, + type: 2} + m_LightingSettings: {fileID: 4890085278179872738, guid: 6e72aca972f324f7886200f86939d735, + type: 2} +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &7009076187777051488 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1327046202153068283, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4915304192325342201, guid: f008e92d3479d4788a9ed63746d4940c, + type: 3} + propertyPath: m_Name + value: Scene + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f008e92d3479d4788a9ed63746d4940c, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 7009076187777051488} diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes/Wakes.unity.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes/Wakes.unity.meta new file mode 100644 index 0000000..004858f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Scenes/Wakes.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3d4818322ada647649a7e942f48e8aa6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings.meta new file mode 100644 index 0000000..1928e75 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6af221c9cc1f54e6985cdc348f7d3e44 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Atmosphere.asset b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Atmosphere.asset new file mode 100644 index 0000000..3254bed --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Atmosphere.asset @@ -0,0 +1,137 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6396158824247504523 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 59b6606ef2548734bb6d11b9d160bc7e, type: 3} + m_Name: HDRISky + m_EditorClassIdentifier: + active: 1 + rotation: + m_OverrideState: 1 + m_Value: 151.6 + skyIntensityMode: + m_OverrideState: 0 + m_Value: 0 + exposure: + m_OverrideState: 0 + m_Value: 0 + multiplier: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxValue: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxColor: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + desiredLuxValue: + m_OverrideState: 0 + m_Value: 20000 + updateMode: + m_OverrideState: 0 + m_Value: 0 + updatePeriod: + m_OverrideState: 0 + m_Value: 0 + includeSunInBaking: + m_OverrideState: 0 + m_Value: 0 + hdriSky: + m_OverrideState: 0 + m_Value: {fileID: 0} + distortionMode: + m_OverrideState: 0 + m_Value: 0 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollOrientation: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 0 + additiveValue: 0 + multiplyValue: 1 + scrollSpeed: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 100 + additiveValue: 0 + multiplyValue: 1 + enableBackplate: + m_OverrideState: 0 + m_Value: 0 + backplateType: + m_OverrideState: 0 + m_Value: 0 + groundLevel: + m_OverrideState: 0 + m_Value: 0 + scale: + m_OverrideState: 0 + m_Value: {x: 32, y: 32} + projectionDistance: + m_OverrideState: 0 + m_Value: 16 + plateRotation: + m_OverrideState: 0 + m_Value: 0 + plateTexRotation: + m_OverrideState: 0 + m_Value: 0 + plateTexOffset: + m_OverrideState: 0 + m_Value: {x: 0, y: 0} + blendAmount: + m_OverrideState: 0 + m_Value: 0 + shadowTint: + m_OverrideState: 0 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + pointLightShadow: + m_OverrideState: 0 + m_Value: 0 + dirLightShadow: + m_OverrideState: 0 + m_Value: 0 + rectLightShadow: + m_OverrideState: 0 + m_Value: 0 + m_SkyVersion: 1 + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteScrollSpeed: + m_OverrideState: 0 + m_Value: 1 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: Wakes_Atmosphere + m_EditorClassIdentifier: + components: + - {fileID: -6396158824247504523} diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Atmosphere.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Atmosphere.asset.meta new file mode 100644 index 0000000..c7a285e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Atmosphere.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26a21902be1c8495ab8fe6ce57a56b7f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_DynamicWaves.asset b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_DynamicWaves.asset new file mode 100644 index 0000000..e8736f9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_DynamicWaves.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 7df05608a083e4ad4bc4758f1df0ee29, type: 3} + m_Name: Wakes_Lod_DynamicWaves + m_EditorClassIdentifier: + _Version: 0 + _Damping: 0 + _CourantNumber: 1 + _HorizontalDisplace: 9.66 + _DisplaceClamp: 0.3 + _GravityMultiplier: 1 diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_DynamicWaves.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_DynamicWaves.asset.meta new file mode 100644 index 0000000..7718a3c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_DynamicWaves.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8dea483b97d254faa99deffab2bbfd05 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_Foam.asset b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_Foam.asset new file mode 100644 index 0000000..7312990 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_Foam.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 03aa24b56404b45a190a2cfc0c7cc100, type: 3} + m_Name: Wakes_Lod_Foam + m_EditorClassIdentifier: + _Version: 0 + _Maximum: Infinity + _FoamFadeRate: 0.1 + _WaveFoamStrength: 3.27 + _WaveFoamCoverage: 0.569 + _FilterWaves: 0 + _ShorelineFoamMaximumDepth: 0.65 + _ShorelineFoamStrength: 2 + _ShorelineFoamPriming: 5 diff --git a/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_Foam.asset.meta b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_Foam.asset.meta new file mode 100644 index 0000000..7351962 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Samples~/Wakes/Settings/Wakes_Lod_Foam.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb1aaea1e5e8d4ba6b718be97218a083 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared.meta b/Packages/com.waveharmonic.crest/Shared.meta new file mode 100644 index 0000000..f16c39d --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d16297273e79e446498999bf9710b7ae +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects.meta b/Packages/com.waveharmonic.crest/Shared/Effects.meta new file mode 100644 index 0000000..1df1d5e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f987e705967144f4dbad9b916c682b19 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares.meta new file mode 100644 index 0000000..cda8989 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 03fc9fcd0d0e64477a04dbd91bab5810 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares.meta new file mode 100644 index 0000000..e5306f3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5042ff6d7612c450d840b5ad085c1a7a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.asset b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.asset new file mode 100644 index 0000000..ffcf1d4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.asset @@ -0,0 +1,981 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 877e1507ae8d81c40bf1b94c1a86036f, type: 3} + m_Name: Sun + m_EditorClassIdentifier: + elements: + - visible: 1 + position: 0 + positionOffset: {x: 0, y: 0} + angularOffset: 0 + translationScale: {x: 1, y: 1} + m_LocalIntensity: 1.32 + lensFlareTexture: {fileID: 0} + uniformScale: 5.87 + sizeXY: {x: 1, y: 1} + allowMultipleElement: 0 + m_Count: 5 + preserveAspectRatio: 0 + rotation: 0 + tint: {r: 1, g: 0.6921896, b: 0.13679248, a: 0.5} + blendMode: 0 + autoRotate: 0 + flareType: 1 + modulateByLightColor: 1 + isFoldOpened: 1 + distribution: 0 + lengthSpread: 1 + positionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scaleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + seed: 0 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + m_IntensityVariation: 0.75 + positionVariation: {x: 1, y: 0} + scaleVariation: 1 + rotationVariation: 180 + enableRadialDistortion: 0 + targetSizeDistortion: {x: 1, y: 1} + distortionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + distortionRelativeToCenter: 0 + m_FallOff: 0.638 + m_EdgeOffset: 0.94 + m_SideCount: 6 + m_SdfRoundness: 0 + inverseSDF: 0 + uniformAngle: 0 + uniformAngleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + - visible: 1 + position: 0.4 + positionOffset: {x: 0, y: 0} + angularOffset: 0 + translationScale: {x: 1, y: 1} + m_LocalIntensity: 1 + lensFlareTexture: {fileID: 0} + uniformScale: 3.56 + sizeXY: {x: 1, y: 1} + allowMultipleElement: 1 + m_Count: 10 + preserveAspectRatio: 0 + rotation: 0 + tint: {r: 0.028301895, g: 0.028301895, b: 0.028301895, a: 1} + blendMode: 0 + autoRotate: 0 + flareType: 2 + modulateByLightColor: 1 + isFoldOpened: 1 + distribution: 2 + lengthSpread: 0.5 + positionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scaleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + seed: 0 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 0.6600066, b: 0.3537736, a: 1} + key2: {r: 1, g: 0.33182937, b: 0.1462264, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 52043 + ctime2: 65342 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 3 + m_NumAlphaKeys: 2 + m_IntensityVariation: 0.75 + positionVariation: {x: 1, y: 0} + scaleVariation: 0.9 + rotationVariation: 360 + enableRadialDistortion: 0 + targetSizeDistortion: {x: 1, y: 1} + distortionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + distortionRelativeToCenter: 0 + m_FallOff: 0.95 + m_EdgeOffset: 0.462 + m_SideCount: 6 + m_SdfRoundness: 0.503 + inverseSDF: 0 + uniformAngle: 0 + uniformAngleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + - visible: 1 + position: 0.1 + positionOffset: {x: 0, y: 0} + angularOffset: 0 + translationScale: {x: 1, y: 1} + m_LocalIntensity: 1 + lensFlareTexture: {fileID: 0} + uniformScale: 0.9 + sizeXY: {x: 2, y: 1} + allowMultipleElement: 1 + m_Count: 12 + preserveAspectRatio: 0 + rotation: 0 + tint: {r: 0.0754717, g: 0.0754717, b: 0.0754717, a: 0.5} + blendMode: 0 + autoRotate: 1 + flareType: 1 + modulateByLightColor: 1 + isFoldOpened: 1 + distribution: 2 + lengthSpread: 0.2 + positionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scaleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + seed: 0 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 0.6600066, b: 0.3537736, a: 1} + key2: {r: 1, g: 0.33182937, b: 0.1462264, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 52043 + ctime2: 65342 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 3 + m_NumAlphaKeys: 2 + m_IntensityVariation: 0.75 + positionVariation: {x: 1, y: 0} + scaleVariation: 1 + rotationVariation: 0 + enableRadialDistortion: 0 + targetSizeDistortion: {x: 1, y: 1} + distortionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + distortionRelativeToCenter: 0 + m_FallOff: 0.799 + m_EdgeOffset: 0.91 + m_SideCount: 6 + m_SdfRoundness: 0 + inverseSDF: 0 + uniformAngle: 0 + uniformAngleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + - visible: 1 + position: 0 + positionOffset: {x: 0, y: 0} + angularOffset: 0 + translationScale: {x: 1, y: 1} + m_LocalIntensity: 1.5 + lensFlareTexture: {fileID: 2800000, guid: e0f14938bc8914d51835c7bc2c800d95, type: 3} + uniformScale: 12.33 + sizeXY: {x: 1, y: 1} + allowMultipleElement: 0 + m_Count: 5 + preserveAspectRatio: 0 + rotation: 0 + tint: {r: 1, g: 1, b: 1, a: 0.5} + blendMode: 0 + autoRotate: 0 + flareType: 0 + modulateByLightColor: 1 + isFoldOpened: 1 + distribution: 0 + lengthSpread: 1 + positionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scaleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + seed: 0 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + m_IntensityVariation: 0.75 + positionVariation: {x: 1, y: 0} + scaleVariation: 1 + rotationVariation: 180 + enableRadialDistortion: 0 + targetSizeDistortion: {x: 1, y: 1} + distortionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + distortionRelativeToCenter: 0 + m_FallOff: 1 + m_EdgeOffset: 0.1 + m_SideCount: 6 + m_SdfRoundness: 0 + inverseSDF: 0 + uniformAngle: 0 + uniformAngleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + - visible: 1 + position: 0.35 + positionOffset: {x: 0, y: 0} + angularOffset: 0 + translationScale: {x: 1, y: 1} + m_LocalIntensity: 0.44 + lensFlareTexture: {fileID: 2800000, guid: a0b8f3cd4a5414d5a997a8f52ab2945c, type: 3} + uniformScale: 4.2 + sizeXY: {x: 1, y: 1} + allowMultipleElement: 0 + m_Count: 5 + preserveAspectRatio: 0 + rotation: 0 + tint: {r: 1, g: 1, b: 1, a: 0.5} + blendMode: 0 + autoRotate: 0 + flareType: 0 + modulateByLightColor: 0 + isFoldOpened: 1 + distribution: 0 + lengthSpread: 1 + positionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scaleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + seed: 0 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + m_IntensityVariation: 0.75 + positionVariation: {x: 1, y: 0} + scaleVariation: 1 + rotationVariation: 180 + enableRadialDistortion: 1 + targetSizeDistortion: {x: 20, y: 20} + distortionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + distortionRelativeToCenter: 1 + m_FallOff: 1 + m_EdgeOffset: 0.1 + m_SideCount: 6 + m_SdfRoundness: 0 + inverseSDF: 0 + uniformAngle: 0 + uniformAngleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + - visible: 1 + position: 0.33 + positionOffset: {x: 0, y: 0} + angularOffset: 0 + translationScale: {x: 1, y: 1} + m_LocalIntensity: 1 + lensFlareTexture: {fileID: 2800000, guid: b625e8f2bcf7a4352be376e723a58db7, type: 3} + uniformScale: 3.93 + sizeXY: {x: 1, y: 1} + allowMultipleElement: 0 + m_Count: 5 + preserveAspectRatio: 0 + rotation: 0.14 + tint: {r: 1, g: 1, b: 1, a: 0.5} + blendMode: 0 + autoRotate: 1 + flareType: 0 + modulateByLightColor: 0 + isFoldOpened: 1 + distribution: 0 + lengthSpread: 1 + positionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scaleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + seed: 0 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + m_IntensityVariation: 0.75 + positionVariation: {x: 1, y: 0} + scaleVariation: 1 + rotationVariation: 180 + enableRadialDistortion: 1 + targetSizeDistortion: {x: 1, y: 1} + distortionCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: -1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + distortionRelativeToCenter: 1 + m_FallOff: 1 + m_EdgeOffset: 0.1 + m_SideCount: 6 + m_SdfRoundness: 0 + inverseSDF: 0 + uniformAngle: 0 + uniformAngleCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.asset.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.asset.meta new file mode 100644 index 0000000..8558d6e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 01a78af7295034dfbb3e00d6dfec64e3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.flare b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.flare new file mode 100644 index 0000000..4b8262c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.flare @@ -0,0 +1,168 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!121 &12100000 +Flare: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Sun + m_FlareTexture: {fileID: 2800000, guid: 5895aae2a9c5f4f75b0628e00c450dbe, type: 3} + m_TextureLayout: 1 + m_Elements: + - m_ImageIndex: 9 + m_Position: 0 + m_Size: 50 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 1 + m_Fade: 1 + - m_ImageIndex: 0 + m_Position: 0 + m_Size: 50 + m_Color: {r: 0.09411765, g: 0.09411765, b: 0.09411765, a: 1} + m_UseLightColor: 1 + m_Rotate: 1 + m_Zoom: 1 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: 0 + m_Size: 20 + m_Color: {r: 0.03137255, g: 0.019607844, b: 0.019607844, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: -0.26999998 + m_Size: 36.39 + m_Color: {r: 0.03137255, g: 0.023529412, b: 0.019607844, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: -0.74999994 + m_Size: 28.689999 + m_Color: {r: 0.019607844, g: 0.015686275, b: 0.011764706, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 3 + m_Position: 0 + m_Size: 10.250002 + m_Color: {r: 0.44705883, g: 0, b: 0.007843138, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: 0.4359998 + m_Size: 4.014 + m_Color: {r: 0.011764706, g: 0.023529412, b: 0.039215688, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: 0.33599988 + m_Size: 2.59 + m_Color: {r: 0.03529412, g: 0.023529412, b: 0.078431375, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: 0.3909999 + m_Size: 7.4700007 + m_Color: {r: 0.015686275, g: 0.023529412, b: 0.039215688, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 7 + m_Position: 1.5 + m_Size: 7.4700007 + m_Color: {r: 0.09411765, g: 0.05882353, b: 0, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: 1.4530003 + m_Size: 4.4499936 + m_Color: {r: 0.07058824, g: 0.043137256, b: 0, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 4 + m_Position: 1.2820016 + m_Size: 1.5 + m_Color: {r: 0.27058825, g: 0.81960785, b: 0.57254905, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 6 + m_Position: 1.7420015 + m_Size: 2.769993 + m_Color: {r: 0.15686275, g: 0.078431375, b: 0.27058825, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: 1.723 + m_Size: 2.7699928 + m_Color: {r: 0.02745098, g: 0.09411765, b: 0.05882353, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: 1.5230002 + m_Size: 2.1299937 + m_Color: {r: 0.050980393, g: 0.03137255, b: 0, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 8 + m_Position: -0.23900001 + m_Size: 4.589999 + m_Color: {r: 0.1882353, g: 0.14901961, b: 0.05882353, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 2 + m_Position: 2.4609997 + m_Size: 25.969997 + m_Color: {r: 0.16470589, g: 0.16470589, b: 0.16470589, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 1 + m_Position: 2.1309998 + m_Size: 17.209995 + m_Color: {r: 0.16470589, g: 0.16470589, b: 0.16470589, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + - m_ImageIndex: 5 + m_Position: 0.82 + m_Size: 2.659996 + m_Color: {r: 0.050980393, g: 0.023529412, b: 0, a: 1} + m_UseLightColor: 1 + m_Rotate: 0 + m_Zoom: 0 + m_Fade: 1 + m_UseFog: 1 +--- !u!1002 &12100001 +EditorExtensionImpl: + serializedVersion: 6 diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.flare.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.flare.meta new file mode 100644 index 0000000..71509e4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Flares/Sun.flare.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69f43258575d14c9693eda803607cb00 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 12100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/License.txt b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/License.txt new file mode 100644 index 0000000..3859fb0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/License.txt @@ -0,0 +1,2 @@ +Files in this folder are part of the Unity Standard Assets and are subject to the Unity Companion License. +https://unity.com/legal/licenses/unity-companion-license diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/License.txt.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/License.txt.meta new file mode 100644 index 0000000..4896228 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/License.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ed5612f2aef9940458863cf4e8d892ea +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures.meta new file mode 100644 index 0000000..a7c0acf --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 60427c2d96eb0409ea1a88019b5d05b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Flare50mm.psd b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Flare50mm.psd new file mode 100644 index 0000000..4136f76 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Flare50mm.psd differ diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Flare50mm.psd.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Flare50mm.psd.meta new file mode 100644 index 0000000..e130c3c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Flare50mm.psd.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 5895aae2a9c5f4f75b0628e00c450dbe +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.1 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 512 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/PartialRing.png b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/PartialRing.png new file mode 100644 index 0000000..7164046 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/PartialRing.png differ diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/PartialRing.png.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/PartialRing.png.meta new file mode 100644 index 0000000..05c0dd1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/PartialRing.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: b625e8f2bcf7a4352be376e723a58db7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Ring.png b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Ring.png new file mode 100644 index 0000000..437c071 Binary files /dev/null and b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Ring.png differ diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Ring.png.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Ring.png.meta new file mode 100644 index 0000000..2491f05 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Ring.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: a0b8f3cd4a5414d5a997a8f52ab2945c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Shimmer.png b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Shimmer.png new file mode 100644 index 0000000..9c205ac Binary files /dev/null and b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Shimmer.png differ diff --git a/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Shimmer.png.meta b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Shimmer.png.meta new file mode 100644 index 0000000..b58d52a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Effects/LensFlares/Textures/Shimmer.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: e0f14938bc8914d51835c7bc2c800d95 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Materials.meta b/Packages/com.waveharmonic.crest/Shared/Materials.meta new file mode 100644 index 0000000..bd415d6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2b1682c2883fe4400820a76f6577b20c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Materials/Grey.mat b/Packages/com.waveharmonic.crest/Shared/Materials/Grey.mat new file mode 100644 index 0000000..94bc538 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Materials/Grey.mat @@ -0,0 +1,237 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4129264835413728531 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &-4006929973867857426 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Grey + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Albedo: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _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: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Alpha_Cutoff: 0.5 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _CastShadows: 1 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoMapScale: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnvironmentReflections: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _Normal_Flip_Back_Faces: 1 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SPECULARHIGHLIGHTS_OFF: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _Surface: 0 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteControl: 0 + m_Colors: + - _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 0} + - _SpecularColor: {r: 0.19999987, g: 0.19999987, b: 0.19999987, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &3579710415365486419 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Packages/com.waveharmonic.crest/Shared/Materials/Grey.mat.meta b/Packages/com.waveharmonic.crest/Shared/Materials/Grey.mat.meta new file mode 100644 index 0000000..19f32dd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Materials/Grey.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8a46562f9ff954d159455b01470f91ad +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Materials/Skybox.mat b/Packages/com.waveharmonic.crest/Shared/Materials/Skybox.mat new file mode 100644 index 0000000..db58c3f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Materials/Skybox.mat @@ -0,0 +1,90 @@ +%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: Skybox + m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _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} + - _Tex: + m_Texture: {fileID: 8900000, guid: b04e3fd8ac149468c93ae5deec99b0d7, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Exposure: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Rotation: 296 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + m_BuildTextureStacks: [] diff --git a/Packages/com.waveharmonic.crest/Shared/Materials/Skybox.mat.meta b/Packages/com.waveharmonic.crest/Shared/Materials/Skybox.mat.meta new file mode 100644 index 0000000..ece63e6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Materials/Skybox.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9dbeaf053c6fb4c2f93b45a9995c408e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Materials/White.mat b/Packages/com.waveharmonic.crest/Shared/Materials/White.mat new file mode 100644 index 0000000..6e2f86a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Materials/White.mat @@ -0,0 +1,227 @@ +%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: White + m_Shader: {fileID: -6465566751694194690, guid: 717b077102735454887bdc5c26938762, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _DISABLE_SSR_TRANSPARENT + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + RenderType: Opaque + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Albedo: + 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} + - 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: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Alpha_Cutoff: 0.5 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _CastShadows: 1 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoMapScale: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _Normal_Flip_Back_Faces: 1 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SPECULARHIGHLIGHTS_OFF: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _Surface: 0 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteControl: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 0} + - _SpecularColor: {r: 0.19999987, g: 0.19999987, b: 0.19999987, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &64603560720380681 +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: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &3999515451107788836 +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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 13 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &6681470257461779220 +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 diff --git a/Packages/com.waveharmonic.crest/Shared/Materials/White.mat.meta b/Packages/com.waveharmonic.crest/Shared/Materials/White.mat.meta new file mode 100644 index 0000000..6a69c91 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Materials/White.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 35af310c2690e42a6a9d2ca36256e92c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs.meta b/Packages/com.waveharmonic.crest/Shared/Prefabs.meta new file mode 100644 index 0000000..b9b0327 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf040e9acd289488a9f66148e017cf76 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/Atmosphere.prefab b/Packages/com.waveharmonic.crest/Shared/Prefabs/Atmosphere.prefab new file mode 100644 index 0000000..ffb751c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/Atmosphere.prefab @@ -0,0 +1,84 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2942909709672342223 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2272289698115174340} + - component: {fileID: 2016193150076743249} + - component: {fileID: 2054049920268771810} + - component: {fileID: 8705736009777882428} + m_Layer: 0 + m_Name: Atmosphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2272289698115174340 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2942909709672342223} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2016193150076743249 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2942909709672342223} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: ec2b869d521934af4a38390f24190cbc, type: 2} +--- !u!114 &2054049920268771810 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2942909709672342223} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 1 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 0} +--- !u!114 &8705736009777882428 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2942909709672342223} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8911488f4e1ce40e1b2766334def268b, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _SkyBox: {fileID: 2100000, guid: 9dbeaf053c6fb4c2f93b45a9995c408e, type: 2} diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/Atmosphere.prefab.meta b/Packages/com.waveharmonic.crest/Shared/Prefabs/Atmosphere.prefab.meta new file mode 100644 index 0000000..afd3617 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/Atmosphere.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 63a4b7e65d06948649ac3e10077d8c2e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/Camera.prefab b/Packages/com.waveharmonic.crest/Shared/Prefabs/Camera.prefab new file mode 100644 index 0000000..bf46945 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/Camera.prefab @@ -0,0 +1,423 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2452750316707852747 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2452750316707852748} + - component: {fileID: 6389200137749898762} + - component: {fileID: 4316267833568120809} + - component: {fileID: 5808830097548158429} + - component: {fileID: 8371988589787276463} + - component: {fileID: 4404543170510296217} + - component: {fileID: 7690153919105444442} + - component: {fileID: 8458686438976561129} + - component: {fileID: 2330733195991194197} + - component: {fileID: 6493171654625517130} + - component: {fileID: 4625463845267562382} + - component: {fileID: 3696783435737642390} + m_Layer: 0 + m_Name: Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2452750316707852748 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &6389200137749898762 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.22794116, g: 0.22794116, b: 0.22794116, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 10000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 1 + m_OcclusionCulling: 0 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!114 &4316267833568120809 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + clearColorMode: 0 + backgroundColorHDR: {r: 0.025, g: 0.07, b: 0.19, a: 0} + clearDepth: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 257 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.5 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 + taaBaseBlendFactor: 0.875 + taaJitterScale: 1 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + xrRendering: 1 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + screenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + screenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + allowDeepLearningSuperSampling: 1 + deepLearningSuperSamplingUseCustomQualitySettings: 0 + deepLearningSuperSamplingQuality: 0 + deepLearningSuperSamplingUseCustomAttributes: 0 + deepLearningSuperSamplingUseOptimalSettings: 1 + deepLearningSuperSamplingSharpening: 0 + fsrOverrideSharpness: 0 + fsrSharpness: 0.92 + exposureTarget: {fileID: 0} + materialMipBias: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 140666587840333 + data2: 13763000512783810584 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 + msaaMode: 1 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 + m_Version: 9 + m_ObsoleteRenderingPath: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 0 + enableContactShadows: 0 + enableShadowMask: 0 + enableSSR: 0 + enableSSAO: 0 + enableSubsurfaceScattering: 0 + enableTransmission: 0 + enableAtmosphericScattering: 0 + enableVolumetrics: 0 + enableReprojectionForVolumetrics: 0 + enableLightLayers: 0 + enableExposureControl: 1 + diffuseGlobalDimmer: 0 + specularGlobalDimmer: 0 + shaderLitMode: 0 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 0 + enableMotionVectors: 0 + enableObjectMotionVectors: 0 + enableDecals: 0 + enableRoughRefraction: 0 + enableTransparentPostpass: 0 + enableDistortion: 0 + enablePostprocess: 0 + enableOpaqueObjects: 0 + enableTransparentObjects: 0 + enableRealtimePlanarReflection: 0 + enableMSAA: 0 + enableAsyncCompute: 0 + runLightListAsync: 0 + runSSRAsync: 0 + runSSAOAsync: 0 + runContactShadowsAsync: 0 + runVolumeVoxelizationAsync: 0 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 0 + enableComputeLightEvaluation: 0 + enableComputeLightVariants: 0 + enableComputeMaterialVariants: 0 + enableFptlForForwardOpaque: 0 + enableBigTilePrepass: 0 + isFptlEnabled: 0 +--- !u!114 &5808830097548158429 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 257 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 1 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 1 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 +--- !u!114 &8371988589787276463 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8ee84b2ccf836471c94ceaafe58b392e, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 +--- !u!114 &4404543170510296217 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2b740d83895ff4657b903a39cce9286c, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 +--- !u!81 &7690153919105444442 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 +--- !u!124 &8458686438976561129 +Behaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 +--- !u!114 &2330733195991194197 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7c0bccaa30631446891d9da26fb6bfec, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _LerpAlpha: 0.01 + _Target: {fileID: 0} + _LookAt: {fileID: 0} + _LookAtOffset: 5 + _MinimumHeightAboveWater: 0.5 +--- !u!114 &6493171654625517130 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1ffaccddaf6fd4ef0bacf218202412e8, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _LinearSpeed: 10 + _AngularSpeed: 70 + _SimulateForwardInput: 0 + _RequireLeftMouseButtonToMove: 0 + _FixedDeltaTime: 0.01666667 + _Debug: + _EnableCameraRoll: 0 + _DisableOcclusionMesh: 0 + _OcclusionMeshScale: 1 +--- !u!114 &4625463845267562382 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3} + m_Name: + m_EditorClassIdentifier: + volumeTrigger: {fileID: 2452750316707852748} + volumeLayer: + serializedVersion: 2 + m_Bits: 256 + stopNaNPropagation: 1 + finalBlitToCameraTarget: 0 + antialiasingMode: 0 + temporalAntialiasing: + jitterSpread: 0.75 + sharpness: 0.25 + stationaryBlending: 0.95 + motionBlending: 0.85 + subpixelMorphologicalAntialiasing: + quality: 2 + fastApproximateAntialiasing: + fastMode: 0 + keepAlpha: 0 + fog: + enabled: 1 + excludeSkybox: 1 + debugLayer: + lightMeter: + width: 512 + height: 256 + showCurves: 1 + histogram: + width: 512 + height: 256 + channel: 3 + waveform: + exposure: 0.12 + height: 256 + vectorscope: + size: 256 + exposure: 0.12 + overlaySettings: + linearDepth: 0 + motionColorIntensity: 4 + motionGridSize: 64 + colorBlindnessType: 0 + colorBlindnessStrength: 1 + m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2} + m_ShowToolkit: 0 + m_ShowCustomSorter: 0 + breakBeforeColorGrading: 0 + m_BeforeTransparentBundles: [] + m_BeforeStackBundles: [] + m_AfterStackBundles: [] +--- !u!114 &3696783435737642390 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2452750316707852747} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 37330e43f019941fcb1368f1db1be0ac, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/Camera.prefab.meta b/Packages/com.waveharmonic.crest/Shared/Prefabs/Camera.prefab.meta new file mode 100644 index 0000000..8d2bdf7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/Camera.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c26fe2b4fef6c484089497b549dd6b04 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/Lighting.prefab b/Packages/com.waveharmonic.crest/Shared/Prefabs/Lighting.prefab new file mode 100644 index 0000000..d7f8bed --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/Lighting.prefab @@ -0,0 +1,99 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &963553959586484309 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6033288213199496986} + - component: {fileID: 8303751716929612922} + - component: {fileID: 8737282204864156058} + - component: {fileID: 5103662451354464692} + - component: {fileID: 1248158243766869604} + m_Layer: 0 + m_Name: Lighting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6033288213199496986 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963553959586484309} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8303751716929612922 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963553959586484309} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: 1b855fdf6e03846cfa67429f60b5c0a8, type: 2} +--- !u!114 &8737282204864156058 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963553959586484309} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 1 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 0} +--- !u!114 &5103662451354464692 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963553959586484309} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fdfa905826925432690154f06e557c79, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 +--- !u!114 &1248158243766869604 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963553959586484309} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 41f656df4b8434812870960da35d35b4, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _LightsUseLinearIntensity: 1 + _LightsUseColorTemperature: 1 diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/Lighting.prefab.meta b/Packages/com.waveharmonic.crest/Shared/Prefabs/Lighting.prefab.meta new file mode 100644 index 0000000..b53081c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/Lighting.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bece9afbf3ddd49059dd73ba2cc986f6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/PostProcessing.prefab b/Packages/com.waveharmonic.crest/Shared/Prefabs/PostProcessing.prefab new file mode 100644 index 0000000..d96d3de --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/PostProcessing.prefab @@ -0,0 +1,120 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6079220456006713144 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9013060131419009103} + - component: {fileID: 6908910288483476123} + - component: {fileID: 1008384038640650285} + - component: {fileID: 5901309481885904616} + - component: {fileID: 23519737791931107} + - component: {fileID: 8797002428012619525} + m_Layer: 0 + m_Name: PostProcessing + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9013060131419009103 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6079220456006713144} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6908910288483476123 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6079220456006713144} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: 004d41514688842a38d03fb44d744f31, type: 2} +--- !u!114 &1008384038640650285 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6079220456006713144} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 1 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 0} +--- !u!114 &5901309481885904616 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6079220456006713144} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3} + m_Name: + m_EditorClassIdentifier: + sharedProfile: {fileID: 11400000, guid: f9dbc838d620d43c5a1c16e44ac0981a, type: 2} + isGlobal: 1 + blendDistance: 0 + weight: 1 + priority: 0 +--- !u!114 &23519737791931107 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6079220456006713144} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3} + m_Name: + m_EditorClassIdentifier: + sharedProfile: {fileID: 0} + isGlobal: 1 + blendDistance: 0 + weight: 1 + priority: 1 +--- !u!114 &8797002428012619525 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6079220456006713144} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c1d3923e4ad524d8997140b39308dc69, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Layer: 8 diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/PostProcessing.prefab.meta b/Packages/com.waveharmonic.crest/Shared/Prefabs/PostProcessing.prefab.meta new file mode 100644 index 0000000..f43dfa7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/PostProcessing.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5e01cffb9e8324147affb8e08fd5ed13 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/Sun.prefab b/Packages/com.waveharmonic.crest/Shared/Prefabs/Sun.prefab new file mode 100644 index 0000000..269cb8e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/Sun.prefab @@ -0,0 +1,546 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5304508333967466499 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1399345652565587599} + - component: {fileID: 8430430470315967237} + - component: {fileID: 2230416686532317428} + - component: {fileID: 4476332497348187229} + - component: {fileID: 1802176044191304336} + - component: {fileID: 4559410043327184601} + - component: {fileID: 3382831289302390136} + - component: {fileID: 3652315765138964706} + - component: {fileID: 7778653892561422245} + m_Layer: 0 + m_Name: Sun + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1399345652565587599 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!108 &8430430470315967237 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 8 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 2 + m_AreaSize: {x: 0.5, y: 0.5} + m_BounceIntensity: 1 + m_ColorTemperature: 5500 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: -4.328533e-10, z: 3e-45, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!114 &2230416686532317428 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Intensity: 100000 + m_EnableSpotReflector: 1 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_SpotIESCutoffPercent: 100 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 2 + m_FadeDistance: 10000 + m_VolumetricFadeDistance: 10000 + m_AffectDiffuse: 1 + m_AffectSpecular: 1 + m_NonLightmappedOnly: 0 + m_ShapeWidth: 0.5 + m_ShapeHeight: 0.5 + m_AspectRatio: 1 + m_ShapeRadius: 0.025 + m_SoftnessScale: 1 + m_UseCustomSpotLightShadowCone: 0 + m_CustomSpotLightShadowCone: 30 + m_MaxSmoothness: 0.99 + m_ApplyRangeAttenuation: 1 + m_DisplayAreaLightEmissiveMesh: 0 + m_AreaLightCookie: {fileID: 0} + m_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} + m_IncludeForRayTracing: 1 + m_AreaLightShadowCone: 120 + m_UseScreenSpaceShadows: 0 + m_InteractsWithSky: 1 + m_AngularDiameter: 0.5 + m_FlareSize: 2 + m_FlareTint: {r: 1, g: 1, b: 1, a: 1} + m_FlareFalloff: 4 + m_SurfaceTexture: {fileID: 0} + m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + m_Distance: 1.5e+11 + m_UseRayTracedShadows: 0 + m_NumRayTracingSamples: 4 + m_FilterTracedShadow: 1 + m_FilterSizeTraced: 16 + m_SunLightConeAngle: 0.5 + m_LightShadowRadius: 0.5 + m_SemiTransparentShadow: 0 + m_ColorShadow: 1 + m_DistanceBasedFiltering: 0 + m_EvsmExponent: 15 + m_EvsmLightLeakBias: 0 + m_EvsmVarianceBias: 0.00001 + m_EvsmBlurPasses: 0 + m_LightlayersMask: 1 + m_LinkShadowLayers: 1 + m_ShadowNearPlane: 0.1 + m_BlockerSampleCount: 24 + m_FilterSampleCount: 16 + m_MinFilterSize: 0.1 + m_KernelSize: 5 + m_LightAngle: 1 + m_MaxDepthBias: 0.001 + m_ShadowResolution: + m_Override: 512 + m_UseOverride: 1 + m_Level: 0 + m_ShadowDimmer: 1 + m_VolumetricShadowDimmer: 1 + m_ShadowFadeDistance: 10000 + m_UseContactShadow: + m_Override: 0 + m_UseOverride: 1 + m_Level: 0 + m_RayTracedContactShadow: 0 + m_ShadowTint: {r: 0, g: 0, b: 0, a: 1} + m_PenumbraTint: 0 + m_NormalBias: 0.75 + m_SlopeBias: 0.5 + m_ShadowUpdateMode: 0 + m_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 + m_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 + m_OnDemandShadowRenderOnPlacement: 1 + m_ShadowCascadeRatios: + - 0.05 + - 0.2 + - 0.3 + m_ShadowCascadeBorders: + - 0.2 + - 0.2 + - 0.2 + - 0.2 + m_ShadowAlgorithm: 0 + m_ShadowVariant: 0 + m_ShadowPrecision: 0 + useOldInspector: 0 + useVolumetric: 0 + featuresFoldout: 1 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 + m_Version: 11 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 +--- !u!114 &4476332497348187229 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 +--- !u!114 &1802176044191304336 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc4d76f733087744991913c9d19d5274, type: 3} + m_Name: + m_EditorClassIdentifier: + m_LensFlareData: {fileID: 11400000, guid: 01a78af7295034dfbb3e00d6dfec64e3, type: 2} + intensity: 0.2 + maxAttenuationDistance: 100 + maxAttenuationScale: 100 + distanceAttenuationCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scaleByDistanceCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attenuationByLightShape: 1 + radialScreenAttenuationCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + useOcclusion: 1 + occlusionRadius: 0.5 + useBackgroundCloudOcclusion: 0 + sampleCount: 33 + occlusionOffset: 0.005 + scale: 0.4 + allowOffScreen: 1 + volumetricCloudOcclusion: 0 + occlusionRemapCurve: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 1 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!123 &4559410043327184601 +LensFlare: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + m_Enabled: 1 + m_Flare: {fileID: 12100000, guid: 69f43258575d14c9693eda803607cb00, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_Brightness: 1 + m_FadeSpeed: 3 + m_IgnoreLayers: + serializedVersion: 2 + m_Bits: 262 + m_Directional: 1 +--- !u!114 &3382831289302390136 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8ee84b2ccf836471c94ceaafe58b392e, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 +--- !u!114 &3652315765138964706 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a245210cb0ef4c94aac318662d37252, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 +--- !u!114 &7778653892561422245 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304508333967466499} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 555f01a6f203a4b6db9ec558f7451e4c, type: 3} + m_Name: + m_EditorClassIdentifier: + _Version: 0 + _Source: 1 + _Layer: 0 + _MinimumWavelength: 1 + _DistanceFromSurfaceSigned: 0 + _DistanceFromSurfaceMaximum: 100 + _DistanceFromSurfaceUseCurve: 1 + _DistanceFromSurfaceCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + _DistanceFromEdgeSigned: 0 + _DistanceFromEdgeMaximum: 100 + _DistanceFromEdgeUseCurve: 1 + _DistanceFromEdgeCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + _OnBelowWater: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4559410043327184601} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 1802176044191304336} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + _OnAboveWater: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4559410043327184601} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 1802176044191304336} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + _DistanceFromSurface: + m_PersistentCalls: + m_Calls: [] + _DistanceFromEdge: + m_PersistentCalls: + m_Calls: [] diff --git a/Packages/com.waveharmonic.crest/Shared/Prefabs/Sun.prefab.meta b/Packages/com.waveharmonic.crest/Shared/Prefabs/Sun.prefab.meta new file mode 100644 index 0000000..66d9f9f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Prefabs/Sun.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 774ab582b39374a7e9d5dac8e31b9a5a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts.meta b/Packages/com.waveharmonic.crest/Shared/Scripts.meta new file mode 100644 index 0000000..3771bf5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e7af15f7111f443a9cbc7783dc1fdcd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/AlignSceneViewToCamera.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/AlignSceneViewToCamera.cs new file mode 100644 index 0000000..b24fa03 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/AlignSceneViewToCamera.cs @@ -0,0 +1,74 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace WaveHarmonic.Crest.Examples +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [ExecuteAlways] + [RequireComponent(typeof(Camera))] + sealed class AlignSceneViewToCamera : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if UNITY_EDITOR + static int s_Scene; + static bool s_SceneChanged; + + [InitializeOnLoadMethod] + static void OnLoad() + { + EditorSceneManager.sceneClosed -= OnSceneClosed; + EditorSceneManager.sceneClosed += OnSceneClosed; + s_Scene = SceneManager.GetActiveScene().handle; + } + + static void OnSceneClosed(Scene a) + { + // TODO: Report to Unity + // Does not work if only game view is open. Handles will never update. + if (s_Scene == a.handle) return; + s_SceneChanged = true; + s_Scene = a.handle; + } + + void OnEnable() + { + EditorApplication.update -= EditorUpdate; + EditorApplication.update += EditorUpdate; + } + + void OnDisable() + { + EditorApplication.update -= EditorUpdate; + } + + void EditorUpdate() + { + var water = WaterRenderer.Instance; + if (s_SceneChanged && SceneView.lastActiveSceneView != null && water != null && water.IsSceneViewActive) + { + TeleportSceneCamera(transform); + s_SceneChanged = false; + } + } + + public static void TeleportSceneCamera(Transform transform) + { + var view = SceneView.lastActiveSceneView; + if (view == null) return; + view.pivot = transform.position + transform.forward * view.cameraDistance; + view.rotation = Quaternion.LookRotation(transform.forward); + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/AlignSceneViewToCamera.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/AlignSceneViewToCamera.cs.meta new file mode 100644 index 0000000..76876d7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/AlignSceneViewToCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37330e43f019941fcb1368f1db1be0ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Assembly.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Assembly.cs new file mode 100644 index 0000000..ab44665 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Assembly.cs @@ -0,0 +1,11 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("WaveHarmonic.Crest.Samples.Editor")] + +namespace UnityEditor.SceneManagement { } +namespace UnityEngine.InputSystem { } +namespace UnityEngine.Rendering.HighDefinition { } + diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Assembly.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Assembly.cs.meta new file mode 100644 index 0000000..fc152fe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Assembly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d4528094ca3f47b29eaf5cc6056652c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/CameraController.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/CameraController.cs new file mode 100644 index 0000000..3e8cbbe --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/CameraController.cs @@ -0,0 +1,248 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityInputSystem && ENABLE_INPUT_SYSTEM +#define INPUT_SYSTEM_ENABLED +#endif + +using UnityEngine; +using UnityEngine.InputSystem; +using UnityEngine.XR; + +namespace WaveHarmonic.Crest.Examples +{ + /// + /// A simple and dumb camera script that can be controlled using WASD and the mouse. + /// +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class CameraController : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + float _LinearSpeed = 10f; + + [SerializeField] + float _AngularSpeed = 70f; + + [SerializeField] + bool _SimulateForwardInput = false; + + [SerializeField] + bool _RequireLeftMouseButtonToMove = false; + + [SerializeField] + float _FixedDeltaTime = 1 / 60f; + + [UnityEngine.Space(10)] + + [SerializeField] + DebugFields _Debug = new(); + + [System.Serializable] + sealed class DebugFields + { + [Tooltip("Allows the camera to roll (rotating on the z axis).")] + public bool _EnableCameraRoll = false; + + [Tooltip("Disables the XR occlusion mesh for debugging purposes. Only works with legacy XR.")] + public bool _DisableOcclusionMesh = false; + + [Tooltip("Sets the XR occlusion mesh scale. Useful for debugging refractions. Only works with legacy XR."), UnityEngine.Range(1f, 2f)] + public float _OcclusionMeshScale = 1f; + } + + + Vector2 _LastMousePosition = -Vector2.one; + bool _Dragging = false; + Transform _TargetTransform; + Camera _Camera; + + + void Awake() + { + _TargetTransform = transform; + + if (!TryGetComponent(out _Camera)) + { + enabled = false; + return; + } + +#if ENABLE_VR && d_UnityModuleVR + if (XRSettings.enabled) + { + // Seems like the best place to put this for now. Most XR debugging happens using this component. + // @FixMe: useOcclusionMesh doesn't work anymore. Might be a Unity bug. + XRSettings.useOcclusionMesh = !_Debug._DisableOcclusionMesh; + XRSettings.occlusionMaskScale = _Debug._OcclusionMeshScale; + } +#endif + } + + void Update() + { + var dt = Time.deltaTime; + if (_FixedDeltaTime > 0f) + dt = _FixedDeltaTime; + + UpdateMovement(dt); + +#if ENABLE_VR && d_UnityModuleVR + // These aren't useful and can break for XR hardware. + if (!XRSettings.enabled || XRSettings.loadedDeviceName.Contains("MockHMD")) +#endif + { + UpdateDragging(dt); + UpdateKillRoll(); + } + +#if ENABLE_VR && d_UnityModuleVR + if (XRSettings.enabled) + { + // Check if property has changed. + if (XRSettings.useOcclusionMesh == _Debug._DisableOcclusionMesh) + { + // @FixMe: useOcclusionMesh doesn't work anymore. Might be a Unity bug. + XRSettings.useOcclusionMesh = !_Debug._DisableOcclusionMesh; + } + + XRSettings.occlusionMaskScale = _Debug._OcclusionMeshScale; + } +#endif + } + + void UpdateMovement(float dt) + { + // New input system works even when game view is not focused. + if (!Application.isFocused) + { + return; + } + +#if INPUT_SYSTEM_ENABLED + if (!Mouse.current.leftButton.isPressed && _RequireLeftMouseButtonToMove) return; + float forward = (Keyboard.current.wKey.isPressed ? 1 : 0) - (Keyboard.current.sKey.isPressed ? 1 : 0); +#else + if (!Input.GetMouseButton(0) && _RequireLeftMouseButtonToMove) return; + float forward = (Input.GetKey(KeyCode.W) ? 1 : 0) - (Input.GetKey(KeyCode.S) ? 1 : 0); +#endif + if (_SimulateForwardInput) + { + forward = 1f; + } + + var speed = _LinearSpeed; + +#if INPUT_SYSTEM_ENABLED + if (Keyboard.current.leftShiftKey.isPressed) +#else + if (Input.GetKey(KeyCode.LeftShift)) +#endif + { + speed *= 3f; + } + + _TargetTransform.position += dt * forward * speed * _TargetTransform.forward; + // _TargetTransform.position += _LinearSpeed * _TargetTransform.right * Input.GetAxis( "Horizontal" ) * dt; +#if INPUT_SYSTEM_ENABLED + _TargetTransform.position += (Keyboard.current.eKey.isPressed ? 1 : 0) * dt * _LinearSpeed * _TargetTransform.up; + _TargetTransform.position -= (Keyboard.current.qKey.isPressed ? 1 : 0) * dt * _LinearSpeed * _TargetTransform.up; + _TargetTransform.position -= (Keyboard.current.aKey.isPressed ? 1 : 0) * dt * _LinearSpeed * _TargetTransform.right; + _TargetTransform.position += (Keyboard.current.dKey.isPressed ? 1 : 0) * dt * _LinearSpeed * _TargetTransform.right; + _TargetTransform.position += (Keyboard.current.eKey.isPressed ? 1 : 0) * dt * speed * _TargetTransform.up; + _TargetTransform.position -= (Keyboard.current.qKey.isPressed ? 1 : 0) * dt * speed * _TargetTransform.up; + _TargetTransform.position -= (Keyboard.current.aKey.isPressed ? 1 : 0) * dt * speed * _TargetTransform.right; + _TargetTransform.position += (Keyboard.current.dKey.isPressed ? 1 : 0) * dt * speed * _TargetTransform.right; +#else + _TargetTransform.position += (Input.GetKey(KeyCode.E) ? 1 : 0) * dt * _LinearSpeed * _TargetTransform.up; + _TargetTransform.position -= (Input.GetKey(KeyCode.Q) ? 1 : 0) * dt * _LinearSpeed * _TargetTransform.up; + _TargetTransform.position -= (Input.GetKey(KeyCode.A) ? 1 : 0) * dt * _LinearSpeed * _TargetTransform.right; + _TargetTransform.position += (Input.GetKey(KeyCode.D) ? 1 : 0) * dt * _LinearSpeed * _TargetTransform.right; + _TargetTransform.position += (Input.GetKey(KeyCode.E) ? 1 : 0) * dt * speed * _TargetTransform.up; + _TargetTransform.position -= (Input.GetKey(KeyCode.Q) ? 1 : 0) * dt * speed * _TargetTransform.up; + _TargetTransform.position -= (Input.GetKey(KeyCode.A) ? 1 : 0) * dt * speed * _TargetTransform.right; + _TargetTransform.position += (Input.GetKey(KeyCode.D) ? 1 : 0) * dt * speed * _TargetTransform.right; +#endif + { + var rotate = 0f; +#if INPUT_SYSTEM_ENABLED + rotate += Keyboard.current.rightArrowKey.isPressed ? 1 : 0; + rotate -= Keyboard.current.leftArrowKey.isPressed ? 1 : 0; +#else + rotate += Input.GetKey(KeyCode.RightArrow) ? 1 : 0; + rotate -= Input.GetKey(KeyCode.LeftArrow) ? 1 : 0; +#endif + + rotate *= 5f; + var ea = _TargetTransform.eulerAngles; + ea.y += 0.1f * _AngularSpeed * rotate * dt; + _TargetTransform.eulerAngles = ea; + } + } + + void UpdateDragging(float dt) + { + // New input system works even when game view is not focused. + if (!Application.isFocused) + { + return; + } + + var mousePos = +#if INPUT_SYSTEM_ENABLED + Mouse.current.position.ReadValue(); +#else + new Vector2(Input.mousePosition.x, Input.mousePosition.y); +#endif + + var wasLeftMouseButtonPressed = +#if INPUT_SYSTEM_ENABLED + Mouse.current.leftButton.wasPressedThisFrame; +#else + Input.GetMouseButtonDown(0); +#endif + + if (!_Dragging && wasLeftMouseButtonPressed && _Camera.rect.Contains(_Camera.ScreenToViewportPoint(mousePos)) && + !DebugGUI.OverGUI(mousePos)) + { + _Dragging = true; + _LastMousePosition = mousePos; + } +#if INPUT_SYSTEM_ENABLED + if (_Dragging && Mouse.current.leftButton.wasReleasedThisFrame) +#else + if (_Dragging && Input.GetMouseButtonUp(0)) +#endif + { + _Dragging = false; + _LastMousePosition = -Vector2.one; + } + + if (_Dragging) + { + var delta = mousePos - _LastMousePosition; + + var ea = _TargetTransform.eulerAngles; + ea.x += -0.1f * _AngularSpeed * delta.y * dt; + ea.y += 0.1f * _AngularSpeed * delta.x * dt; + _TargetTransform.eulerAngles = ea; + + _LastMousePosition = mousePos; + } + } + + void UpdateKillRoll() + { + if (_Debug._EnableCameraRoll) return; + var ea = _TargetTransform.eulerAngles; + ea.z = 0f; + transform.eulerAngles = ea; + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/CameraController.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/CameraController.cs.meta new file mode 100644 index 0000000..4d4a100 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/CameraController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ffaccddaf6fd4ef0bacf218202412e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/LerpCamera.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/LerpCamera.cs new file mode 100644 index 0000000..e88ca29 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/LerpCamera.cs @@ -0,0 +1,60 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Examples +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class LerpCamera : ManagedBehaviour + { +#pragma warning disable IDE0032 // Use auto property + + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + float _LerpAlpha = 0.1f; + + [SerializeField] + Transform _Target = null; + + [SerializeField] + Transform _LookAt = null; + + [SerializeField] + float _LookAtOffset = 5f; + + [SerializeField] + float _MinimumHeightAboveWater = 0.5f; + +#pragma warning restore IDE0032 // Use auto property + + public Transform Target { get => _Target; set => _Target = value; } + public Transform LookAt { get => _LookAt; set => _LookAt = value; } + + readonly SampleCollisionHelper _SampleHeightHelper = new(); + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + if (_Target == null) + { + return; + } + + _SampleHeightHelper.SampleHeight(transform.position, out var h); + + var targetPos = _Target.position; + targetPos.y = Mathf.Max(targetPos.y, h + _MinimumHeightAboveWater); + + transform.position = Vector3.Lerp(transform.position, targetPos, _LerpAlpha * water.DeltaTime * 60f); + transform.LookAt(_LookAt.position + _LookAtOffset * Vector3.up); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/LerpCamera.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/LerpCamera.cs.meta new file mode 100644 index 0000000..9732980 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/LerpCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7c0bccaa30631446891d9da26fb6bfec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/PrefabSpawner.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/PrefabSpawner.cs new file mode 100644 index 0000000..070f7b4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/PrefabSpawner.cs @@ -0,0 +1,73 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using System.Collections.Generic; + +namespace WaveHarmonic.Crest.Examples +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class PrefabSpawner : MonoBehaviour + { + enum Mode + { + OnStart, + OnDemand, + } + + + [SerializeField] + GameObject _Prefab; + + [SerializeField] + Mode _Mode; + + [SerializeField] + bool _DestroyInstances = true; + + [SerializeField] + bool _SpawnAsChild = true; + + [SerializeField] + bool _RandomizePosition; + + [SerializeField] + float _RandomizePositionSphericalSize = 1f; + + + readonly List _Instances = new(); + + + // Start is called before the first frame update + void Start() + { + if (_Mode is Mode.OnDemand) return; + Execute(); + } + + void OnDestroy() + { + if (!_DestroyInstances) + { + return; + } + + foreach (var instance in _Instances) + { + Destroy(instance); + } + } + + public void Execute() + { + var prefab = Instantiate(_Prefab); + prefab.transform.SetPositionAndRotation(transform.position + + (_RandomizePosition ? Random.insideUnitSphere * _RandomizePositionSphericalSize : Vector3.zero), transform.rotation); + prefab.transform.localScale = transform.localScale; + if (_SpawnAsChild) prefab.transform.SetParent(transform, worldPositionStays: true); + _Instances.Add(prefab); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/PrefabSpawner.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/PrefabSpawner.cs.meta new file mode 100644 index 0000000..313d42b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/PrefabSpawner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fd850100d148b4b8b8ce7855c080de37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Queries.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries.meta new file mode 100644 index 0000000..ec9fd4e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f031f6d9a813d46f78118d5291310b2c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleDisplacementDemo.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleDisplacementDemo.cs new file mode 100644 index 0000000..94ebaf6 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleDisplacementDemo.cs @@ -0,0 +1,92 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System; +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Examples +{ + /// + /// Attach this script to any GameObject and it will create three collision probes in front of the camera + /// + [AddComponentMenu(Constants.k_MenuPrefixSample + "Sample Displacement Demo")] + sealed class SampleDisplacementDemo : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Tooltip(ICollisionProvider.k_LayerTooltip)] + [SerializeField] + CollisionLayer _Layer; + + [SerializeField] + bool _TrackCamera = true; + + [UnityEngine.Range(0f, 32f)] + [SerializeField] + float _MinimumGridSize = 0f; + + + readonly GameObject[] _MarkerObjects = new GameObject[3]; + readonly Vector3[] _MarkerPosition = new Vector3[3]; + readonly Vector3[] _ResultDisplacement = new Vector3[3]; + readonly Vector3[] _ResultNormal = new Vector3[3]; + readonly Vector3[] _ResultVelocity = new Vector3[3]; + readonly float _SamplesRadius = 5f; + + private protected override Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + if (_TrackCamera) + { + var height = Mathf.Abs(Camera.main.transform.position.y - water.SeaLevel); + var lookAngle = Mathf.Max(Mathf.Abs(Camera.main.transform.forward.y), 0.001f); + var offset = height / lookAngle; + _MarkerPosition[0] = Camera.main.transform.position + Camera.main.transform.forward * offset; + _MarkerPosition[1] = Camera.main.transform.position + Camera.main.transform.forward * offset + _SamplesRadius * Vector3.right; + _MarkerPosition[2] = Camera.main.transform.position + Camera.main.transform.forward * offset + _SamplesRadius * Vector3.forward; + } + + var collProvider = water.AnimatedWavesLod.Provider; + + var status = collProvider.Query(GetHashCode(), _MinimumGridSize, _MarkerPosition, _ResultDisplacement, _ResultNormal, _ResultVelocity, _Layer); + + if (collProvider.RetrieveSucceeded(status)) + { + for (var i = 0; i < _ResultDisplacement.Length; i++) + { + if (_MarkerObjects[i] == null) + { + _MarkerObjects[i] = GameObject.CreatePrimitive(PrimitiveType.Cube); + Helpers.Destroy(_MarkerObjects[i].GetComponent()); + _MarkerObjects[i].transform.localScale = Vector3.one * 0.5f; + } + + var query = _MarkerPosition[i]; + query.y = water.SeaLevel; + + var disp = _ResultDisplacement[i]; + + var pos = query; + pos.y = disp.y; + Debug.DrawLine(pos, pos - disp); + + _MarkerObjects[i].transform.SetPositionAndRotation(pos, Quaternion.FromToRotation(Vector3.up, _ResultNormal[i])); + } + + for (var i = 0; i < _ResultNormal.Length; i++) + { + Debug.DrawLine(_MarkerObjects[i].transform.position, _MarkerObjects[i].transform.position + _ResultNormal[i], Color.blue); + } + + for (var i = 0; i < _ResultVelocity.Length; i++) + { + Debug.DrawLine(_MarkerObjects[i].transform.position, _MarkerObjects[i].transform.position + _ResultVelocity[i], Color.green); + } + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleDisplacementDemo.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleDisplacementDemo.cs.meta new file mode 100644 index 0000000..f7cedfd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleDisplacementDemo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb222be11f47b450c873a21b733311c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleHeightDemo.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleHeightDemo.cs new file mode 100644 index 0000000..051fac8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleHeightDemo.cs @@ -0,0 +1,40 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using WaveHarmonic.Crest.Internal; + +namespace WaveHarmonic.Crest.Examples +{ + /// + /// Places the game object on the water surface by moving it vertically. + /// + [AddComponentMenu(Constants.k_MenuPrefixSample + "Sample Height Demo")] + sealed class SampleHeightDemo : ManagedBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Tooltip(ICollisionProvider.k_LayerTooltip)] + [SerializeField] + CollisionLayer _Layer; + + readonly SampleCollisionHelper _SampleHeightHelper = new(); + + private protected override System.Action OnUpdateMethod => OnUpdate; + void OnUpdate(WaterRenderer water) + { + // Assume a primitive like a sphere or box. + var r = transform.lossyScale.magnitude; + + if (_SampleHeightHelper.SampleHeight(transform.position, out var height, minimumLength: 2f * r, _Layer)) + { + var pos = transform.position; + pos.y = height; + transform.position = pos; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleHeightDemo.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleHeightDemo.cs.meta new file mode 100644 index 0000000..71a4e21 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Queries/SampleHeightDemo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e958915a82f294814bc369b4962ed05c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/RandomMotion.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/RandomMotion.cs new file mode 100644 index 0000000..5a865d3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/RandomMotion.cs @@ -0,0 +1,85 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest.Examples +{ + /// + /// Shoves the gameobject around random amounts, occasionally useful for debugging where some motion is required to reproduce an issue. + /// +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class RandomMotion : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [Header("Translation")] + + [SerializeField] + Vector3 _Axis = Vector3.up; + + [@Range(0, 15)] + [SerializeField] + float _Amplitude = 1f; + + [@Range(0, 5)] + [SerializeField] + float _Frequency = 1f; + + [@Range(0, 1)] + [SerializeField] + float _OrthogonalMotion = 0f; + + + [Header("Rotation")] + + [@Range(0, 5)] + [SerializeField] + float _RotationFrequency = 1f; + + [SerializeField] + float _RotationVelocity = 0f; + + + Vector3 _Origin; + Vector3 _OrthogonalAxis; + + + void Start() + { + _Origin = transform.position; + + _OrthogonalAxis = Quaternion.AngleAxis(90f, Vector3.up) * _Axis; + } + + void Update() + { + // Translation + { + // Do circles in perlin noise + var rnd = 2f * (Mathf.PerlinNoise(0.5f + 0.5f * Mathf.Cos(_Frequency * Time.time), 0.5f + 0.5f * Mathf.Sin(_Frequency * Time.time)) - 0.5f); + + var orthoPhaseOff = Mathf.PI / 2f; + var rndOrtho = 2f * (Mathf.PerlinNoise(0.5f + 0.5f * Mathf.Cos(_Frequency * Time.time + orthoPhaseOff), 0.5f + 0.5f * Mathf.Sin(_Frequency * Time.time + orthoPhaseOff)) - 0.5f); + + transform.position = _Origin + (_Axis * rnd + _OrthogonalMotion * rndOrtho * _OrthogonalAxis) * _Amplitude; + } + + // Rotation + { + var f1 = Mathf.Sin(Time.time * _RotationFrequency * 1.0f); + var f2 = Mathf.Sin(Time.time * _RotationFrequency * 0.83f); + var f3 = Mathf.Sin(Time.time * _RotationFrequency * 1.14f); + transform.rotation *= Quaternion.Euler( + f1 * _RotationVelocity * Time.deltaTime, + f2 * _RotationVelocity * Time.deltaTime, + f3 * _RotationVelocity * Time.deltaTime); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/RandomMotion.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/RandomMotion.cs.meta new file mode 100644 index 0000000..5f2dc8a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/RandomMotion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e67c8b7e3e4e04c46b61963b7c204049 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering.meta new file mode 100644 index 0000000..d385f00 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90acd0fc619264df3bbb62a37697e17e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/AmbientLightPatcher.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/AmbientLightPatcher.cs new file mode 100644 index 0000000..a08db24 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/AmbientLightPatcher.cs @@ -0,0 +1,98 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +namespace WaveHarmonic.Crest.Editor +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [ExecuteAlways] + sealed class AmbientLightPatcher : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if UNITY_EDITOR + void OnEnable() => InitializeAmbientLighting(); + void Update() => InitializeAmbientLighting(); + + bool _Baked; + + void InitializeAmbientLighting() + { + if (_Baked) + { + return; + } + + if (UnityEditor.Lightmapping.isRunning) + { + return; + } + + if (Application.isPlaying) + { + return; + } + + // Throws a warning. + if (UnityEditor.ShaderUtil.anythingCompiling) + { + return; + } + + // Only do skyboxes for now. + if (RenderSettings.ambientMode != AmbientMode.Skybox) + { + return; + } + + // NOTE: Cannot use as API introduced in 6000.0.22f1 which cannot be targeted by defines. + // if (UnityEditor.Lightmapping.bakeOnSceneLoad == UnityEditor.Lightmapping.BakeOnSceneLoadMode.IfMissingLightingData) + // { + // return; + // } + + var bake = true; + var probe = RenderSettings.ambientProbe; + + // Check if the ambient probe is effectively empty. + for (var i = 0; i < 9; i++) + { + if (probe[0, i] != 0 || probe[1, i] != 0 || probe[2, i] != 0) + { + bake = false; + break; + } + } + + if (bake) + { +#if !UNITY_6000_0_OR_NEWER + var oldWorkflow = UnityEditor.Lightmapping.giWorkflowMode; + UnityEditor.Lightmapping.giWorkflowMode = UnityEditor.Lightmapping.GIWorkflowMode.OnDemand; +#endif + // Only attempt to bake once per scene load. + _Baked = UnityEditor.Lightmapping.BakeAsync(); +#if !UNITY_6000_0_OR_NEWER + UnityEditor.Lightmapping.giWorkflowMode = oldWorkflow; +#endif + +#if CREST_DEBUG + Debug.Log($"Crest: Baked scene lighting!"); +#endif + + if (!_Baked) + { + Debug.LogWarning($"Crest: Could not generate scene lighting. Lighting will look incorrect."); + } + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/AmbientLightPatcher.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/AmbientLightPatcher.cs.meta new file mode 100644 index 0000000..2d13ba1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/AmbientLightPatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fdfa905826925432690154f06e557c79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LegacyPostProcessingVolume.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LegacyPostProcessingVolume.cs new file mode 100644 index 0000000..b59a44e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LegacyPostProcessingVolume.cs @@ -0,0 +1,120 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +#if d_UnityPostProcessing + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering.PostProcessing; + +namespace WaveHarmonic.Crest.Examples +{ + // ExecuteDuringEditMode does not work with scene camera. +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [ExecuteAlways, RequireComponent(typeof(PostProcessVolume))] + sealed class LegacyPostProcessingVolume : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [@Layer] + [SerializeField] + int _Layer; + + readonly List _QuickVolumes = new(); + + void OnEnable() + { + if (!RenderPipelineHelper.IsLegacy) + { + return; + } + + _QuickVolumes.Clear(); + + foreach (var volume in GetComponents()) + { + if (volume.sharedProfile == null) continue; + _QuickVolumes.Add(PostProcessManager.instance.QuickVolume(_Layer, volume.priority, volume.sharedProfile.settings.ToArray())); + } + } + + void OnDisable() + { + foreach (var volume in _QuickVolumes) + { + if (volume == null) continue; + Helpers.Destroy(volume.profile); + var gameObject = volume.gameObject; + Helpers.Destroy(volume); + Helpers.Destroy(gameObject); + } + } + } +} + +#else + +using UnityEditor; +using UnityEngine; +using UnityEngine.SceneManagement; +using WaveHarmonic.Crest.Editor; + +namespace WaveHarmonic.Crest.Examples +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [ExecuteAlways] + sealed class LegacyPostProcessingVolume : MonoBehaviour + { + [@Layer] + [SerializeField] + int _Layer; + + static string s_SceneName; + + void Awake() + { + // Ask only once per scene load. + var scene = SceneManager.GetActiveScene(); + if (!RenderPipelineHelper.IsLegacy || s_SceneName == scene.name) + { + return; + } + + s_SceneName = scene.name; + +#if UNITY_EDITOR + var install = EditorUtility.DisplayDialog + ( + "Missing Package", + "This sample scene requires the post-processing package when using the built-in renderer. Without it the scene will be overexposed. Would you like to install it?", + "Install", + "Ignore" + ); + + if (install) + { + PackageManagerHelpers.AddMissingPackage("com.unity.postprocessing"); + } +#endif + } + + void OnEnable() + { + if (!RenderPipelineHelper.IsLegacy) + { + return; + } + + Debug.LogWarning("Crest: This scene requires the post-processing package. Without it the scene will be overexposed."); + } + } +} + +#endif diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LegacyPostProcessingVolume.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LegacyPostProcessingVolume.cs.meta new file mode 100644 index 0000000..97ed848 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LegacyPostProcessingVolume.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1d3923e4ad524d8997140b39308dc69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LightingPatcher.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LightingPatcher.cs new file mode 100644 index 0000000..4a2b72a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LightingPatcher.cs @@ -0,0 +1,114 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; + +#if UNITY_EDITOR +using MonoBehaviour = WaveHarmonic.Crest.Internal.EditorBehaviour; +#endif + +namespace WaveHarmonic.Crest.Editor +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [DefaultExecutionOrder(-1000)] + [ExecuteAlways] + sealed class LightingPatcher : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if !CREST_DEBUG + [HideInInspector] +#endif + [@DecoratedField, SerializeField] + bool _LightsUseLinearIntensity; + +#if !CREST_DEBUG + [HideInInspector] +#endif + [@DecoratedField, SerializeField] + bool _LightsUseColorTemperature; + + bool _CurrentLightsUseLinearIntensity; + bool _CurrentLightsUseColorTemperature; + + void OnEnable() + { + // SRP is always linear with temperature. + if (RenderPipelineHelper.IsLegacy) + { + Camera.onPreCull -= OnBeginRendering; + Camera.onPreCull += OnBeginRendering; + Camera.onPostRender -= OnEndRendering; + Camera.onPostRender += OnEndRendering; + } + else + { + RenderPipelineManager.beginContextRendering -= OnBeginContextRendering; + RenderPipelineManager.beginContextRendering += OnBeginContextRendering; + RenderPipelineManager.endContextRendering -= OnEndContextRendering; + RenderPipelineManager.endContextRendering += OnEndContextRendering; + } + + _CurrentLightsUseLinearIntensity = GraphicsSettings.lightsUseLinearIntensity; + _CurrentLightsUseColorTemperature = GraphicsSettings.lightsUseColorTemperature; + } + + void OnDisable() + { + if (RenderPipelineHelper.IsLegacy) + { + Camera.onPreCull -= OnBeginRendering; + Camera.onPostRender -= OnEndRendering; + } + else + { + RenderPipelineManager.beginContextRendering -= OnBeginContextRendering; + RenderPipelineManager.endContextRendering -= OnEndContextRendering; + } + } + + void OnBeginContextRendering(ScriptableRenderContext context, List cameras) => ChangeLighting(); + void OnEndContextRendering(ScriptableRenderContext context, List cameras) => RestoreLighting(); + + void OnBeginRendering(Camera camera) => ChangeLighting(); + void OnEndRendering(Camera camera) => RestoreLighting(); + + void ChangeLighting() + { + _CurrentLightsUseLinearIntensity = GraphicsSettings.lightsUseLinearIntensity; + _CurrentLightsUseColorTemperature = GraphicsSettings.lightsUseColorTemperature; + GraphicsSettings.lightsUseLinearIntensity = true; + GraphicsSettings.lightsUseColorTemperature = true; + } + + void RestoreLighting() + { + GraphicsSettings.lightsUseLinearIntensity = _CurrentLightsUseLinearIntensity; + GraphicsSettings.lightsUseColorTemperature = _CurrentLightsUseColorTemperature; + } + +#if UNITY_EDITOR + private protected override void Reset() + { + _LightsUseLinearIntensity = GraphicsSettings.lightsUseLinearIntensity; + _LightsUseColorTemperature = GraphicsSettings.lightsUseColorTemperature; + + base.Reset(); + } + + [@OnChange] + void OnChange(string propertyPath, object previousValue) + { + GraphicsSettings.lightsUseLinearIntensity = _LightsUseLinearIntensity; + GraphicsSettings.lightsUseColorTemperature = _LightsUseColorTemperature; + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LightingPatcher.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LightingPatcher.cs.meta new file mode 100644 index 0000000..3ce0bad --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/LightingPatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41f656df4b8434812870960da35d35b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 30 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineCameraPatcher.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineCameraPatcher.cs new file mode 100644 index 0000000..b0903db --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineCameraPatcher.cs @@ -0,0 +1,47 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest.Editor +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [RequireComponent(typeof(Camera))] + sealed class RenderPipelineCameraPatcher : RenderPipelinePatcher + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if UNITY_EDITOR + protected override void OnActiveRenderPipelineTypeChanged() + { + if (PrefabStageUtility.GetCurrentPrefabStage() != null) + { + return; + } + + if (!isActiveAndEnabled) + { + return; + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + if (TryGetComponent(out var data)) + { + // This component will try to modify serialized HDR & MSAA properties every frame. Disgusting. + data.enabled = true; + } + } +#endif + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineCameraPatcher.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineCameraPatcher.cs.meta new file mode 100644 index 0000000..a59e364 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineCameraPatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b740d83895ff4657b903a39cce9286c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineLightPatcher.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineLightPatcher.cs new file mode 100644 index 0000000..7ab2c0a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineLightPatcher.cs @@ -0,0 +1,79 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using System.Reflection; +using UnityEditor; +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; + +namespace WaveHarmonic.Crest.Editor +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [RequireComponent(typeof(Light))] + [DefaultExecutionOrder(10)] + sealed class RenderPipelineLightPatcher : RenderPipelinePatcher + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if d_UnityHDRP + // For 2023.3 onwards, HDAdditionalLightData.intensity is obsolete and returns Light.intensity. + // It still serializes the old value so grab it via reflection. + static readonly FieldInfo s_Intensity = typeof(HDAdditionalLightData) + .GetField("m_Intensity", BindingFlags.Instance | BindingFlags.NonPublic); +#endif + +#if UNITY_EDITOR + private protected override void Awake() + { + base.Awake(); + if (!Application.isPlaying) OnActiveRenderPipelineTypeChanged(); + } + + protected override void OnActiveRenderPipelineTypeChanged() + { + EditorApplication.update -= OnActiveRenderPipelineTypeChanged; + + if (PrefabStageUtility.GetCurrentPrefabStage() != null) + { + return; + } + + // Can happen. + if (this == null) + { + return; + } + + if (!isActiveAndEnabled) + { + return; + } + +#if d_UnityHDRP + if (RenderPipelineHelper.IsHighDefinition) + { + if (TryGetComponent(out var light) && TryGetComponent(out var data)) + { + var intensity = (float)s_Intensity.GetValue(data); + + if (light.intensity == intensity) return; + + // HDRP will not restore the correct intensity. + light.intensity = intensity; + + // Execute next frame as revert prefab interferes despite executing afterwards. + EditorApplication.update -= OnActiveRenderPipelineTypeChanged; + EditorApplication.update += OnActiveRenderPipelineTypeChanged; + } + } +#endif + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineLightPatcher.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineLightPatcher.cs.meta new file mode 100644 index 0000000..efb8c3e --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineLightPatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a245210cb0ef4c94aac318662d37252 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelinePatcher.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelinePatcher.cs new file mode 100644 index 0000000..944a3c1 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelinePatcher.cs @@ -0,0 +1,31 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Rendering; + +#if UNITY_EDITOR +using MonoBehaviour = WaveHarmonic.Crest.Internal.EditorBehaviour; +#endif + +namespace WaveHarmonic.Crest.Editor +{ + [ExecuteAlways] + abstract class RenderPipelinePatcher : MonoBehaviour + { +#if UNITY_EDITOR + protected virtual void OnEnable() + { + RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged; + RenderPipelineManager.activeRenderPipelineTypeChanged += OnActiveRenderPipelineTypeChanged; + } + + protected virtual void OnDisable() + { + RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged; + } + + protected abstract void OnActiveRenderPipelineTypeChanged(); +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelinePatcher.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelinePatcher.cs.meta new file mode 100644 index 0000000..c3fa474 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelinePatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c5e6eb7e2ef841d38e15a82c8b83964 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineSettingsPatcher.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineSettingsPatcher.cs new file mode 100644 index 0000000..c3d12f7 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineSettingsPatcher.cs @@ -0,0 +1,53 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +// Restores "Lighting > Environment" settings after switching from HDRP. "Lighting > Other Settings" do not need +// restoring. We only need to restore the skybox as we use the default values for everything else. + +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class RenderPipelineSettingsPatcher : RenderPipelinePatcher + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [@AttachMaterialEditor] + [@DecoratedField, SerializeField] + Material _SkyBox; + +#if UNITY_EDITOR + private protected override void Reset() + { + _SkyBox = RenderSettings.skybox; + + base.Reset(); + } + + protected override void OnEnable() + { + base.OnEnable(); + OnActiveRenderPipelineTypeChanged(); + } + + protected override void OnActiveRenderPipelineTypeChanged() + { + if (!isActiveAndEnabled) + { + return; + } + + if (RenderPipelineHelper.IsLegacy || RenderPipelineHelper.IsUniversal) + { + RenderSettings.skybox = _SkyBox; + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineSettingsPatcher.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineSettingsPatcher.cs.meta new file mode 100644 index 0000000..c8afbcb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineSettingsPatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8911488f4e1ce40e1b2766334def268b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineTerrainPatcher.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineTerrainPatcher.cs new file mode 100644 index 0000000..c70e546 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineTerrainPatcher.cs @@ -0,0 +1,62 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor.SceneManagement; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class RenderPipelineTerrainPatcher : RenderPipelinePatcher + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + Material _Material; + + [SerializeField] + Material _MaterialHDRP; + + [SerializeField] + Material _MaterialURP; + +#if UNITY_EDITOR + protected override void OnEnable() + { + base.OnEnable(); + OnActiveRenderPipelineTypeChanged(); + } + + protected override void OnActiveRenderPipelineTypeChanged() + { + if (PrefabStageUtility.GetCurrentPrefabStage() != null) + { + return; + } + + if (!isActiveAndEnabled) + { + return; + } + +#if d_Unity_Terrain + foreach (var terrain in GetComponentsInChildren()) + { + terrain.materialTemplate = RenderPipelineHelper.RenderPipeline switch + { + RenderPipeline.Legacy => _Material, + RenderPipeline.Universal => _MaterialURP, + RenderPipeline.HighDefinition => _MaterialHDRP, + _ => throw new System.NotImplementedException(), + }; + } +#endif // d_Unity_Terrain + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineTerrainPatcher.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineTerrainPatcher.cs.meta new file mode 100644 index 0000000..404c268 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RenderPipelineTerrainPatcher.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: e49c7e9e3297f44b3a07573b45ec815d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _Material: {fileID: 10650, guid: 0000000000000000f000000000000000, type: 0} + - _MaterialHDRP: {fileID: 2100000, guid: 22ff8771d87ef27429e670136399094b, type: 2} + - _MaterialURP: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RevertPrefabOnRenderPipelineChange.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RevertPrefabOnRenderPipelineChange.cs new file mode 100644 index 0000000..b5259dc --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RevertPrefabOnRenderPipelineChange.cs @@ -0,0 +1,49 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEditor; +using UnityEditor.SceneManagement; +using UnityEngine; + +namespace WaveHarmonic.Crest.Editor +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class RevertPrefabOnRenderPipelineChange : RenderPipelinePatcher + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + +#if UNITY_EDITOR + private protected override void Awake() + { + base.Awake(); + if (!Application.isPlaying) OnActiveRenderPipelineTypeChanged(); + } + + protected override void OnActiveRenderPipelineTypeChanged() + { + if (PrefabStageUtility.GetCurrentPrefabStage() != null) + { + return; + } + + if (!isActiveAndEnabled) + { + return; + } + + foreach (var item in gameObject.GetComponents()) + { + if (item is Transform) continue; + if (item == null) continue; // Can happen if missing packages/scripts. + if (!PrefabUtility.IsPartOfPrefabInstance(item)) continue; + PrefabUtility.RevertObjectOverride(item, InteractionMode.AutomatedAction); + } + } +#endif + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RevertPrefabOnRenderPipelineChange.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RevertPrefabOnRenderPipelineChange.cs.meta new file mode 100644 index 0000000..d39c59f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/Rendering/RevertPrefabOnRenderPipelineChange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ee84b2ccf836471c94ceaafe58b392e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/SendUnityEvent.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/SendUnityEvent.cs new file mode 100644 index 0000000..8e3dbd9 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/SendUnityEvent.cs @@ -0,0 +1,91 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; +using UnityEngine.Events; + +namespace WaveHarmonic.Crest.Examples +{ +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + [ExecuteAlways] + sealed class SendUnityEvent : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + float _ExecuteUpdateEvery; + + [SerializeField] + float _StopExecutingUpdateAfter = Mathf.Infinity; + + [SerializeField] + UnityEvent _OnEnable = new(); + + [SerializeField] + UnityEvent _OnDisable = new(); + + [SerializeField] + UnityEvent _OnUpdate = new(); + + [SerializeField] + UnityEvent _OnLegacyRenderPipeline = new(); + + [SerializeField] + UnityEvent _OnHighDefinitionPipeline = new(); + + [SerializeField] + UnityEvent _OnUniversalRenderPipeline = new(); + + float _TimeSinceEnabled; + float _LastUpdateTime; + + void OnEnable() + { + _TimeSinceEnabled = 0f; + _OnEnable.Invoke(); + + if (RenderPipelineHelper.IsHighDefinition) + { + _OnHighDefinitionPipeline?.Invoke(); + } + else if (RenderPipelineHelper.IsUniversal) + { + _OnUniversalRenderPipeline?.Invoke(); + } + else + { + _OnLegacyRenderPipeline?.Invoke(); + } + } + + void OnDisable() + { + _OnDisable.Invoke(); + } + + void Update() + { + _TimeSinceEnabled += Time.deltaTime; + _LastUpdateTime += Time.deltaTime; + + if (_LastUpdateTime < _ExecuteUpdateEvery) + { + return; + } + + _LastUpdateTime = 0; + + if (_TimeSinceEnabled > _StopExecutingUpdateAfter) + { + return; + } + + _OnUpdate.Invoke(_TimeSinceEnabled); + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/SendUnityEvent.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/SendUnityEvent.cs.meta new file mode 100644 index 0000000..d0498a3 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/SendUnityEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8eca7a783ef84759a4e965c9d6d8827 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/SimpleMotion.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/SimpleMotion.cs new file mode 100644 index 0000000..ec8a19b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/SimpleMotion.cs @@ -0,0 +1,65 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest.Examples +{ + /// + /// Moves this transform. + /// +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class SimpleMotion : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + bool _ResetOnDisable; + + [SerializeField] + bool _IsLocal; + + [Header("Translation")] + [SerializeField] + Vector3 _Velocity; + + [Header("Rotation")] + [SerializeField] + Vector3 _AngularVelocity; + + Vector3 _OldPosition; + Quaternion _OldRotation; + + void OnEnable() + { + _OldPosition = transform.position; + _OldRotation = transform.rotation; + } + + void OnDisable() + { + if (_ResetOnDisable) + { + transform.SetPositionAndRotation(_OldPosition, _OldRotation); + } + } + + void Update() + { + // Translation + { + transform.position += (_IsLocal ? transform.TransformDirection(_Velocity) : _Velocity) * Time.deltaTime; + } + + // Rotation + { + transform.rotation *= Quaternion.Euler(_AngularVelocity * Time.deltaTime); + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/SimpleMotion.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/SimpleMotion.cs.meta new file mode 100644 index 0000000..fa8f797 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/SimpleMotion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f069d1ec9fe154d3ba75ff75ed08e5b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/TimedDestroy.cs b/Packages/com.waveharmonic.crest/Shared/Scripts/TimedDestroy.cs new file mode 100644 index 0000000..7b064ac --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/TimedDestroy.cs @@ -0,0 +1,62 @@ +// Crest Water System +// Copyright © 2024 Wave Harmonic. All rights reserved. + +using UnityEngine; + +namespace WaveHarmonic.Crest.Examples +{ + /// + /// Simple utility script to destroy the gameobject after a set time. + /// +#if !CREST_DEBUG + [AddComponentMenu("")] +#endif + sealed class TimedDestroy : MonoBehaviour + { + [SerializeField, HideInInspector] +#pragma warning disable 414 + int _Version = 0; +#pragma warning restore 414 + + [SerializeField] + float _LifeTime = 2.0f; + + // this seems to make motion stutter? + // [SerializeField] + // float _ScaleToOneDuration = 0.1f; + + [SerializeField] + float _ScaleToZeroDuration = 0.0f; + + Vector3 _Scale; + float _BirthTime; + + void Start() + { + _BirthTime = Time.time; + _Scale = transform.localScale; + } + + void Update() + { + var age = Time.time - _BirthTime; + + if (age >= _LifeTime) + { + Helpers.Destroy(gameObject); + } + else if (age > _LifeTime - _ScaleToZeroDuration) + { + transform.localScale = _Scale * (1.0f - (age - (_LifeTime - _ScaleToZeroDuration)) / _ScaleToZeroDuration); + } + /*else if (age < _ScaleToOneDuration && _ScaleToOneDuration > 0.0f) + { + transform.localScale = _Scale * age / _ScaleToOneDuration; + }*/ + else + { + transform.localScale = _Scale; + } + } + } +} diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/TimedDestroy.cs.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/TimedDestroy.cs.meta new file mode 100644 index 0000000..00b4b03 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/TimedDestroy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3080de53ec3d224eba7fe59e0309668 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/WaveHarmonic.Crest.Samples.asmdef b/Packages/com.waveharmonic.crest/Shared/Scripts/WaveHarmonic.Crest.Samples.asmdef new file mode 100644 index 0000000..73dc4c2 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/WaveHarmonic.Crest.Samples.asmdef @@ -0,0 +1,55 @@ +{ + "name": "WaveHarmonic.Crest.Samples", + "rootNamespace": "", + "references": [ + "GUID:75469ad4d38634e559750d17036d5f7c", + "GUID:d60799ab2a985554ea1a39cd38695018", + "GUID:df380645f10b7bc4b97d4f5eb6303d95", + "GUID:457756d89b35d2941b3e7b37b4ece6f1", + "GUID:7c347618730f5467f86a58f333ce21df", + "GUID:056ff2a5b2f124d468c6655552acdca5", + "GUID:1ab2a6c2a51cd4b43867788dbaee1a55" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_2022_3_OR_NEWER" + ], + "versionDefines": [ + { + "name": "com.unity.modules.terrain", + "expression": "", + "define": "d_Unity_Terrain" + }, + { + "name": "com.unity.modules.vr", + "expression": "", + "define": "d_UnityModuleVR" + }, + { + "name": "com.unity.inputsystem", + "expression": "", + "define": "d_UnityInputSystem" + }, + { + "name": "com.unity.postprocessing", + "expression": "", + "define": "d_UnityPostProcessing" + }, + { + "name": "com.unity.render-pipelines.high-definition", + "expression": "", + "define": "d_UnityHDRP" + }, + { + "name": "com.unity.render-pipelines.universal", + "expression": "", + "define": "d_UnityURP" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/Shared/Scripts/WaveHarmonic.Crest.Samples.asmdef.meta b/Packages/com.waveharmonic.crest/Shared/Scripts/WaveHarmonic.Crest.Samples.asmdef.meta new file mode 100644 index 0000000..3a7ec86 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Scripts/WaveHarmonic.Crest.Samples.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3a6ae266c63a146c6876ee98745a14fa +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Settings.meta b/Packages/com.waveharmonic.crest/Shared/Settings.meta new file mode 100644 index 0000000..39f6921 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 042620ef65bd84cf1a42418416f92608 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/Atmosphere.asset b/Packages/com.waveharmonic.crest/Shared/Settings/Atmosphere.asset new file mode 100644 index 0000000..3e09345 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/Atmosphere.asset @@ -0,0 +1,557 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8129522367056695605 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: d877ec3e844f2ca46830012e8e79319b, type: 3} + m_Name: PhysicallyBasedSky + m_EditorClassIdentifier: + active: 1 + rotation: + m_OverrideState: 0 + m_Value: 0 + skyIntensityMode: + m_OverrideState: 0 + m_Value: 0 + exposure: + m_OverrideState: 0 + m_Value: 0 + multiplier: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxValue: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxColor: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + desiredLuxValue: + m_OverrideState: 0 + m_Value: 20000 + updateMode: + m_OverrideState: 0 + m_Value: 0 + updatePeriod: + m_OverrideState: 0 + m_Value: 0 + includeSunInBaking: + m_OverrideState: 0 + m_Value: 0 + type: + m_OverrideState: 0 + m_Value: 1 + sphericalMode: + m_OverrideState: 0 + m_Value: 1 + seaLevel: + m_OverrideState: 0 + m_Value: 0 + planetaryRadius: + m_OverrideState: 0 + m_Value: 6378100 + planetCenterPosition: + m_OverrideState: 0 + m_Value: {x: 0, y: -6378100, z: 0} + airDensityR: + m_OverrideState: 0 + m_Value: 0.04534 + airDensityG: + m_OverrideState: 0 + m_Value: 0.10237241 + airDensityB: + m_OverrideState: 0 + m_Value: 0.23264056 + airTint: + m_OverrideState: 0 + m_Value: {r: 0.9, g: 0.9, b: 1, a: 1} + airMaximumAltitude: + m_OverrideState: 0 + m_Value: 55261.973 + aerosolDensity: + m_OverrideState: 0 + m_Value: 0.01192826 + aerosolTint: + m_OverrideState: 0 + m_Value: {r: 0.9, g: 0.9, b: 0.9, a: 1} + aerosolMaximumAltitude: + m_OverrideState: 0 + m_Value: 8289.296 + aerosolAnisotropy: + m_OverrideState: 0 + m_Value: 0 + groundTint: + m_OverrideState: 0 + m_Value: {r: 0.4, g: 0.25, b: 0.15, a: 1} + groundColorTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + groundEmissionTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + groundEmissionMultiplier: + m_OverrideState: 0 + m_Value: 1 + planetRotation: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + spaceEmissionTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + spaceEmissionMultiplier: + m_OverrideState: 0 + m_Value: 1 + spaceRotation: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + colorSaturation: + m_OverrideState: 0 + m_Value: 1 + alphaSaturation: + m_OverrideState: 0 + m_Value: 1 + alphaMultiplier: + m_OverrideState: 0 + m_Value: 1 + horizonTint: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + zenithTint: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + horizonZenithShift: + m_OverrideState: 0 + m_Value: 0 + numberOfBounces: + m_OverrideState: 0 + m_Value: 3 + m_SkyVersion: 1 + m_ObsoleteEarthPreset: + m_OverrideState: 0 + m_Value: 1 +--- !u!114 &-3053135762479981819 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: e88178bb13f64a54f90d6cd6ef7aa9a1, type: 3} + m_Name: CloudLayer + m_EditorClassIdentifier: + active: 1 + opacity: + m_OverrideState: 1 + m_Value: 1 + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + layers: + m_OverrideState: 1 + m_Value: 0 + resolution: + m_OverrideState: 0 + m_Value: 1024 + shadowMultiplier: + m_OverrideState: 0 + m_Value: 1 + shadowTint: + m_OverrideState: 0 + m_Value: {r: 0, g: 0, b: 0, a: 1} + shadowResolution: + m_OverrideState: 0 + m_Value: 256 + shadowSize: + m_OverrideState: 0 + m_Value: 500 + layerA: + cloudMap: + m_OverrideState: 0 + m_Value: {fileID: 2800000, guid: 57a33fc2476a01644865bfde5f06e2f4, type: 3} + opacityR: + m_OverrideState: 0 + m_Value: 1 + opacityG: + m_OverrideState: 0 + m_Value: 0 + opacityB: + m_OverrideState: 0 + m_Value: 0.145 + opacityA: + m_OverrideState: 0 + m_Value: 0 + altitude: + m_OverrideState: 1 + m_Value: 1000 + rotation: + m_OverrideState: 0 + m_Value: 0 + tint: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + exposure: + m_OverrideState: 1 + m_Value: 2 + distortionMode: + m_OverrideState: 0 + m_Value: 0 + scrollOrientation: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 0 + additiveValue: 0 + multiplyValue: 1 + scrollSpeed: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 100 + additiveValue: 0 + multiplyValue: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + lighting: + m_OverrideState: 0 + m_Value: 1 + steps: + m_OverrideState: 0 + m_Value: 6 + thickness: + m_OverrideState: 0 + m_Value: 0.5 + ambientProbeDimmer: + m_OverrideState: 0 + m_Value: 1 + castShadows: + m_OverrideState: 0 + m_Value: 0 + layerB: + cloudMap: + m_OverrideState: 0 + m_Value: {fileID: 2800000, guid: 57a33fc2476a01644865bfde5f06e2f4, type: 3} + opacityR: + m_OverrideState: 0 + m_Value: 1 + opacityG: + m_OverrideState: 0 + m_Value: 0 + opacityB: + m_OverrideState: 0 + m_Value: 0 + opacityA: + m_OverrideState: 0 + m_Value: 0 + altitude: + m_OverrideState: 0 + m_Value: 2000 + rotation: + m_OverrideState: 0 + m_Value: 0 + tint: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + exposure: + m_OverrideState: 0 + m_Value: 0 + distortionMode: + m_OverrideState: 0 + m_Value: 0 + scrollOrientation: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 0 + additiveValue: 0 + multiplyValue: 1 + scrollSpeed: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 100 + additiveValue: 0 + multiplyValue: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + lighting: + m_OverrideState: 0 + m_Value: 1 + steps: + m_OverrideState: 0 + m_Value: 6 + thickness: + m_OverrideState: 0 + m_Value: 0.5 + ambientProbeDimmer: + m_OverrideState: 0 + m_Value: 1 + castShadows: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &-1658960478407648048 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 59b6606ef2548734bb6d11b9d160bc7e, type: 3} + m_Name: HDRISky + m_EditorClassIdentifier: + active: 1 + rotation: + m_OverrideState: 1 + m_Value: 296 + skyIntensityMode: + m_OverrideState: 1 + m_Value: 0 + exposure: + m_OverrideState: 1 + m_Value: 14 + multiplier: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxValue: + m_OverrideState: 1 + m_Value: 4.738129 + upperHemisphereLuxColor: + m_OverrideState: 1 + m_Value: {x: 0.4377769, y: 0.45977402, z: 0.5} + desiredLuxValue: + m_OverrideState: 0 + m_Value: 20000 + updateMode: + m_OverrideState: 0 + m_Value: 0 + updatePeriod: + m_OverrideState: 0 + m_Value: 0 + includeSunInBaking: + m_OverrideState: 0 + m_Value: 0 + hdriSky: + m_OverrideState: 1 + m_Value: {fileID: 8900000, guid: b04e3fd8ac149468c93ae5deec99b0d7, type: 3} + distortionMode: + m_OverrideState: 0 + m_Value: 0 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollOrientation: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 0 + additiveValue: 0 + multiplyValue: 1 + scrollSpeed: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 100 + additiveValue: 0 + multiplyValue: 1 + enableBackplate: + m_OverrideState: 0 + m_Value: 0 + backplateType: + m_OverrideState: 0 + m_Value: 0 + groundLevel: + m_OverrideState: 0 + m_Value: 0 + scale: + m_OverrideState: 0 + m_Value: {x: 32, y: 32} + projectionDistance: + m_OverrideState: 0 + m_Value: 16 + plateRotation: + m_OverrideState: 0 + m_Value: 0 + plateTexRotation: + m_OverrideState: 0 + m_Value: 0 + plateTexOffset: + m_OverrideState: 0 + m_Value: {x: 0, y: 0} + blendAmount: + m_OverrideState: 0 + m_Value: 0 + shadowTint: + m_OverrideState: 0 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + pointLightShadow: + m_OverrideState: 0 + m_Value: 0 + dirLightShadow: + m_OverrideState: 0 + m_Value: 0 + rectLightShadow: + m_OverrideState: 0 + m_Value: 0 + m_SkyVersion: 1 + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteScrollSpeed: + m_OverrideState: 0 + m_Value: 1 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: Atmosphere + m_EditorClassIdentifier: + components: + - {fileID: 3912485203739470195} + - {fileID: -1658960478407648048} + - {fileID: -8129522367056695605} + - {fileID: 5321722785694334585} + - {fileID: -3053135762479981819} +--- !u!114 &3912485203739470195 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 0d7593b3a9277ac4696b20006c21dde2, type: 3} + m_Name: + m_EditorClassIdentifier: + active: 1 + skyType: + m_OverrideState: 1 + m_Value: 1 + cloudType: + m_OverrideState: 1 + m_Value: 0 + skyAmbientMode: + m_OverrideState: 1 + m_Value: 1 + windOrientation: + m_OverrideState: 0 + m_Value: 0 + windSpeed: + m_OverrideState: 0 + m_Value: 100 + fogType: + m_OverrideState: 1 + m_Value: 3 +--- !u!114 &5321722785694334585 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 953beb541740ddc499d005ee80c9ff29, type: 3} + m_Name: Fog + m_EditorClassIdentifier: + active: 1 + quality: + m_OverrideState: 0 + m_Value: 1 + enabled: + m_OverrideState: 1 + m_Value: 1 + colorMode: + m_OverrideState: 0 + m_Value: 1 + color: + m_OverrideState: 0 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + tint: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + maxFogDistance: + m_OverrideState: 0 + m_Value: 5000 + mipFogMaxMip: + m_OverrideState: 0 + m_Value: 0.5 + mipFogNear: + m_OverrideState: 0 + m_Value: 0 + mipFogFar: + m_OverrideState: 0 + m_Value: 1000 + baseHeight: + m_OverrideState: 0 + m_Value: 0 + maximumHeight: + m_OverrideState: 0 + m_Value: 50 + meanFreePath: + m_OverrideState: 1 + m_Value: 10000 + enableVolumetricFog: + m_OverrideState: 1 + m_Value: 0 + albedo: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + globalLightProbeDimmer: + m_OverrideState: 0 + m_Value: 1 + depthExtent: + m_OverrideState: 0 + m_Value: 64 + denoisingMode: + m_OverrideState: 0 + m_Value: 2 + anisotropy: + m_OverrideState: 0 + m_Value: 0.6 + sliceDistributionUniformity: + m_OverrideState: 0 + m_Value: 0.75 + m_FogControlMode: + m_OverrideState: 0 + m_Value: 0 + screenResolutionPercentage: + m_OverrideState: 0 + m_Value: 12.5 + volumeSliceCount: + m_OverrideState: 0 + m_Value: 64 + m_VolumetricFogBudget: + m_OverrideState: 0 + m_Value: 0.33 + m_ResolutionDepthRatio: + m_OverrideState: 0 + m_Value: 0.666 + directionalLightsOnly: + m_OverrideState: 0 + m_Value: 0 diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/Atmosphere.asset.meta b/Packages/com.waveharmonic.crest/Shared/Settings/Atmosphere.asset.meta new file mode 100644 index 0000000..94af0d8 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/Atmosphere.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec2b869d521934af4a38390f24190cbc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.asset b/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.asset new file mode 100644 index 0000000..fd0a30c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.asset @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6490523387845513046 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 384c4d03a551c44448145f4093304119, type: 3} + m_Name: ScreenSpaceReflection + m_EditorClassIdentifier: + active: 1 + quality: + m_OverrideState: 0 + m_Value: 1 + enabled: + m_OverrideState: 1 + m_Value: 1 + enabledTransparent: + m_OverrideState: 1 + m_Value: 1 + tracing: + m_OverrideState: 0 + m_Value: 1 + m_MinSmoothness: + m_OverrideState: 1 + m_Value: 0.8 + m_SmoothnessFadeStart: + m_OverrideState: 0 + m_Value: 0.9 + reflectSky: + m_OverrideState: 1 + m_Value: 1 + usedAlgorithm: + m_OverrideState: 0 + m_Value: 0 + depthBufferThickness: + m_OverrideState: 0 + m_Value: 0.1 + screenFadeDistance: + m_OverrideState: 0 + m_Value: 0.1 + accumulationFactor: + m_OverrideState: 0 + m_Value: 0.75 + biasFactor: + m_OverrideState: 0 + m_Value: 0.5 + speedRejectionParam: + m_OverrideState: 0 + m_Value: 0.5 + speedRejectionScalerFactor: + m_OverrideState: 0 + m_Value: 0.2 + speedSmoothReject: + m_OverrideState: 0 + m_Value: 0 + speedSurfaceOnly: + m_OverrideState: 0 + m_Value: 1 + speedTargetOnly: + m_OverrideState: 0 + m_Value: 1 + enableWorldSpeedRejection: + m_OverrideState: 0 + m_Value: 0 + m_RayMaxIterations: + m_OverrideState: 0 + m_Value: 32 + rayMiss: + m_OverrideState: 0 + m_Value: 3 + lastBounceFallbackHierarchy: + m_OverrideState: 0 + m_Value: 3 + ambientProbeDimmer: + m_OverrideState: 0 + m_Value: 1 + layerMask: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Bits: 4294967295 + textureLodBias: + m_OverrideState: 0 + m_Value: 1 + m_RayLength: + m_OverrideState: 0 + m_Value: 50 + m_ClampValue: + m_OverrideState: 0 + m_Value: 1 + m_Denoise: + m_OverrideState: 0 + m_Value: 1 + m_DenoiserRadius: + m_OverrideState: 0 + m_Value: 8 + m_AffectSmoothSurfaces: + m_OverrideState: 0 + m_Value: 0 + mode: + m_OverrideState: 0 + m_Value: 2 + m_FullResolution: + m_OverrideState: 0 + m_Value: 0 + sampleCount: + m_OverrideState: 0 + m_Value: 1 + bounceCount: + m_OverrideState: 0 + m_Value: 1 + m_RayMaxIterationsRT: + m_OverrideState: 0 + m_Value: 48 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: Lighting + m_EditorClassIdentifier: + components: + - {fileID: -6490523387845513046} diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.asset.meta b/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.asset.meta new file mode 100644 index 0000000..a356abb --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1b855fdf6e03846cfa67429f60b5c0a8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.lighting b/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.lighting new file mode 100644 index 0000000..c92f9fd --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.lighting @@ -0,0 +1,66 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Lighting + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 2 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 2 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentImportanceSampling: 1 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_PVRTiledBaking: 0 + m_NumRaysToShootPerTexel: -1 + m_RespectSceneVisibilityWhenBakingGI: 0 diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.lighting.meta b/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.lighting.meta new file mode 100644 index 0000000..0213e53 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/Lighting.lighting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6e72aca972f324f7886200f86939d735 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4890085278179872738 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessing.asset b/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessing.asset new file mode 100644 index 0000000..55d71ae --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessing.asset @@ -0,0 +1,518 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6684861221409925966 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 0b2db86121404754db890f4c8dfe81b2, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: + active: 1 + skipIterations: + m_OverrideState: 0 + m_Value: 1 + threshold: + m_OverrideState: 1 + m_Value: 1 + intensity: + m_OverrideState: 1 + m_Value: 0.2 + scatter: + m_OverrideState: 0 + m_Value: 0.7 + clamp: + m_OverrideState: 0 + m_Value: 65472 + tint: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + highQualityFiltering: + m_OverrideState: 0 + m_Value: 0 + downscale: + m_OverrideState: 0 + m_Value: 0 + maxIterations: + m_OverrideState: 0 + m_Value: 6 + dirtTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + dimension: 1 + dirtIntensity: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &-2109818796249167647 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 598e2d32e2c7b0c418e030c3236d663a, type: 3} + m_Name: ChromaticAberration + m_EditorClassIdentifier: + active: 1 + quality: + m_OverrideState: 0 + m_Value: 1 + spectralLut: + m_OverrideState: 0 + m_Value: {fileID: 0} + intensity: + m_OverrideState: 1 + m_Value: 0.05 + m_MaxSamples: + m_OverrideState: 0 + m_Value: 6 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: PostProcessing + m_EditorClassIdentifier: + components: + - {fileID: 5230380330664722816} + - {fileID: 8711377374188185572} + - {fileID: 6640133647794636954} + - {fileID: 396278178000043239} + - {fileID: -2109818796249167647} + - {fileID: -6684861221409925966} + - {fileID: 2718417390662674063} + - {fileID: 1692474355597373712} + - {fileID: 89624805562497374} + - {fileID: 7577113519358791614} + - {fileID: 4527986752527755293} +--- !u!114 &89624805562497374 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: f086a068d4c5889438831b3ae9afc11c, type: 3} + m_Name: Tonemapping + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 2 + useFullACES: + m_OverrideState: 0 + m_Value: 0 + toeStrength: + m_OverrideState: 0 + m_Value: 0 + toeLength: + m_OverrideState: 0 + m_Value: 0.5 + shoulderStrength: + m_OverrideState: 0 + m_Value: 0 + shoulderLength: + m_OverrideState: 0 + m_Value: 0.5 + shoulderAngle: + m_OverrideState: 0 + m_Value: 0 + gamma: + m_OverrideState: 0 + m_Value: 1 + lutTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + lutContribution: + m_OverrideState: 0 + m_Value: 1 + neutralHDRRangeReductionMode: + m_OverrideState: 0 + m_Value: 2 + acesPreset: + m_OverrideState: 0 + m_Value: 3 + fallbackMode: + m_OverrideState: 0 + m_Value: 1 + hueShiftAmount: + m_OverrideState: 0 + m_Value: 0 + detectPaperWhite: + m_OverrideState: 0 + m_Value: 0 + paperWhite: + m_OverrideState: 0 + m_Value: 300 + detectBrightnessLimits: + m_OverrideState: 0 + m_Value: 1 + minNits: + m_OverrideState: 0 + m_Value: 0.005 + maxNits: + m_OverrideState: 0 + m_Value: 1000 +--- !u!114 &396278178000043239 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: b51a78e223a2e504bb88a059b55229ea, type: 3} + m_Name: WhiteBalance + m_EditorClassIdentifier: + active: 0 + temperature: + m_OverrideState: 0 + m_Value: 0 + tint: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &1692474355597373712 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 66f335fb1ffd8684294ad653bf1c7564, type: 3} + m_Name: ColorAdjustments + m_EditorClassIdentifier: + active: 1 + postExposure: + m_OverrideState: 0 + m_Value: 0 + contrast: + m_OverrideState: 1 + m_Value: 10 + colorFilter: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + hueShift: + m_OverrideState: 0 + m_Value: 0 + saturation: + m_OverrideState: 1 + m_Value: 10 +--- !u!114 &2718417390662674063 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 97c23e3b12dc18c42a140437e53d3951, type: 3} + m_Name: Tonemapping + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 2 + neutralHDRRangeReductionMode: + m_OverrideState: 0 + m_Value: 2 + acesPreset: + m_OverrideState: 0 + m_Value: 3 + hueShiftAmount: + m_OverrideState: 0 + m_Value: 0 + detectPaperWhite: + m_OverrideState: 0 + m_Value: 0 + paperWhite: + m_OverrideState: 0 + m_Value: 300 + detectBrightnessLimits: + m_OverrideState: 0 + m_Value: 1 + minNits: + m_OverrideState: 0 + m_Value: 0.005 + maxNits: + m_OverrideState: 0 + m_Value: 1000 +--- !u!114 &4527986752527755293 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 81180773991d8724ab7f2d216912b564, type: 3} + m_Name: ChromaticAberration + m_EditorClassIdentifier: + active: 1 + intensity: + m_OverrideState: 1 + m_Value: 0.05 +--- !u!114 &5230380330664722816 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 899c54efeace73346a0a16faa3afe726, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + color: + m_OverrideState: 0 + m_Value: {r: 0, g: 0, b: 0, a: 1} + center: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + intensity: + m_OverrideState: 1 + m_Value: 0.3 + smoothness: + m_OverrideState: 0 + m_Value: 0.2 + rounded: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &6640133647794636954 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 2d08ce26990eb1a4a9177b860541e702, type: 3} + m_Name: Exposure + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 1 + meteringMode: + m_OverrideState: 0 + m_Value: 2 + luminanceSource: + m_OverrideState: 0 + m_Value: 1 + fixedExposure: + m_OverrideState: 1 + m_Value: 8.5 + compensation: + m_OverrideState: 0 + m_Value: 0 + limitMin: + m_OverrideState: 0 + m_Value: -5 + limitMax: + m_OverrideState: 1 + m_Value: 13 + curveMap: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: -10 + value: -10 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 20 + value: 20 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + limitMinCurveMap: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: -10 + value: -12 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 20 + value: 18 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + limitMaxCurveMap: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: -10 + value: -8 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 20 + value: 22 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + adaptationMode: + m_OverrideState: 0 + m_Value: 1 + adaptationSpeedDarkToLight: + m_OverrideState: 0 + m_Value: 3 + adaptationSpeedLightToDark: + m_OverrideState: 0 + m_Value: 1 + weightTextureMask: + m_OverrideState: 0 + m_Value: {fileID: 0} + histogramPercentages: + m_OverrideState: 0 + m_Value: {x: 40, y: 90} + histogramUseCurveRemapping: + m_OverrideState: 0 + m_Value: 0 + targetMidGray: + m_OverrideState: 0 + m_Value: 0 + centerAroundExposureTarget: + m_OverrideState: 0 + m_Value: 0 + proceduralCenter: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + proceduralRadii: + m_OverrideState: 0 + m_Value: {x: 0.3, y: 0.3} + maskMinIntensity: + m_OverrideState: 0 + m_Value: -30 + maskMaxIntensity: + m_OverrideState: 0 + m_Value: 30 + proceduralSoftness: + m_OverrideState: 0 + m_Value: 0.5 +--- !u!114 &7577113519358791614 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 4b8bcdf71d7fafa419fca1ed162f5fc9, type: 3} + m_Name: ColorAdjustments + m_EditorClassIdentifier: + active: 1 + postExposure: + m_OverrideState: 0 + m_Value: 0 + contrast: + m_OverrideState: 1 + m_Value: 10 + colorFilter: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + hueShift: + m_OverrideState: 0 + m_Value: 0 + saturation: + m_OverrideState: 1 + m_Value: 40 +--- !u!114 &8711377374188185572 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 2c1be1b6c95cd2e41b27903b9270817f, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 0 + m_Value: 0 + color: + m_OverrideState: 0 + m_Value: {r: 0, g: 0, b: 0, a: 1} + center: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + intensity: + m_OverrideState: 1 + m_Value: 0.25 + smoothness: + m_OverrideState: 0 + m_Value: 0.2 + roundness: + m_OverrideState: 0 + m_Value: 1 + rounded: + m_OverrideState: 0 + m_Value: 0 + mask: + m_OverrideState: 0 + m_Value: {fileID: 0} + opacity: + m_OverrideState: 0 + m_Value: 1 diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessing.asset.meta b/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessing.asset.meta new file mode 100644 index 0000000..a7d8993 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessing.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 004d41514688842a38d03fb44d744f31 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessingV2.asset b/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessingV2.asset new file mode 100644 index 0000000..b8f748b --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessingV2.asset @@ -0,0 +1,1500 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-7257162781466735012 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 48a79b01ea5641d4aa6daa2e23605641, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: + active: 1 + enabled: + overrideState: 1 + value: 1 + intensity: + overrideState: 1 + value: 0.3 + threshold: + overrideState: 1 + value: 1 + softKnee: + overrideState: 0 + value: 0.5 + clamp: + overrideState: 0 + value: 65472 + diffusion: + overrideState: 0 + value: 7 + anamorphicRatio: + overrideState: 0 + value: 0 + color: + overrideState: 0 + value: {r: 1, g: 1, b: 1, a: 1} + fastMode: + overrideState: 0 + value: 0 + dirtTexture: + overrideState: 0 + value: {fileID: 0} + defaultState: 1 + dirtIntensity: + overrideState: 0 + value: 0 +--- !u!114 &-6986014162803398553 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 40b924e2dad56384a8df2a1e111bb675, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + enabled: + overrideState: 1 + value: 1 + mode: + overrideState: 1 + value: 0 + color: + overrideState: 0 + value: {r: 0, g: 0, b: 0, a: 1} + center: + overrideState: 0 + value: {x: 0.5, y: 0.5} + intensity: + overrideState: 1 + value: 0.3 + smoothness: + overrideState: 0 + value: 0.2 + roundness: + overrideState: 0 + value: 1 + rounded: + overrideState: 0 + value: 0 + mask: + overrideState: 0 + value: {fileID: 0} + defaultState: 1 + opacity: + overrideState: 0 + value: 1 +--- !u!114 &-6610383233836386135 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 6050e2d5de785ce4d931e4dbdbf2d755, type: 3} + m_Name: ChromaticAberration + m_EditorClassIdentifier: + active: 1 + enabled: + overrideState: 1 + value: 1 + spectralLut: + overrideState: 0 + value: {fileID: 0} + defaultState: 1 + intensity: + overrideState: 1 + value: 0.05 + fastMode: + overrideState: 0 + value: 0 +--- !u!114 &-3725662966176326820 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: c1cb7e9e120078f43bce4f0b1be547a7, type: 3} + m_Name: AmbientOcclusion + m_EditorClassIdentifier: + active: 1 + enabled: + overrideState: 1 + value: 1 + mode: + overrideState: 1 + value: 1 + intensity: + overrideState: 1 + value: 0.25 + color: + overrideState: 0 + value: {r: 0, g: 0, b: 0, a: 1} + ambientOnly: + overrideState: 0 + value: 1 + noiseFilterTolerance: + overrideState: 0 + value: 0 + blurTolerance: + overrideState: 0 + value: -4.6 + upsampleTolerance: + overrideState: 0 + value: -12 + thicknessModifier: + overrideState: 0 + value: 1 + zBias: + overrideState: 0 + value: 0.0001 + directLightingStrength: + overrideState: 0 + value: 0 + radius: + overrideState: 0 + value: 0.25 + quality: + overrideState: 0 + value: 2 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: 8e6292b2c06870d4495f009f912b9600, type: 3} + m_Name: PostProcessingV2 + m_EditorClassIdentifier: + settings: + - {fileID: -6986014162803398553} + - {fileID: -7257162781466735012} + - {fileID: -3725662966176326820} + - {fileID: 652007791346231872} + - {fileID: -6610383233836386135} +--- !u!114 &652007791346231872 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: adb84e30e02715445aeb9959894e3b4d, type: 3} + m_Name: ColorGrading + m_EditorClassIdentifier: + active: 1 + enabled: + overrideState: 1 + value: 1 + gradingMode: + overrideState: 1 + value: 1 + externalLut: + overrideState: 0 + value: {fileID: 0} + defaultState: 1 + tonemapper: + overrideState: 1 + value: 2 + toneCurveToeStrength: + overrideState: 0 + value: 0 + toneCurveToeLength: + overrideState: 0 + value: 0.5 + toneCurveShoulderStrength: + overrideState: 0 + value: 0 + toneCurveShoulderLength: + overrideState: 0 + value: 0.5 + toneCurveShoulderAngle: + overrideState: 0 + value: 0 + toneCurveGamma: + overrideState: 0 + value: 1 + ldrLut: + overrideState: 0 + value: {fileID: 0} + defaultState: 4 + ldrLutContribution: + overrideState: 0 + value: 1 + temperature: + overrideState: 0 + value: 24.8 + tint: + overrideState: 0 + value: 0 + colorFilter: + overrideState: 0 + value: {r: 1, g: 1, b: 1, a: 1} + hueShift: + overrideState: 0 + value: 0 + saturation: + overrideState: 1 + value: 10 + brightness: + overrideState: 0 + value: 0 + postExposure: + overrideState: 0 + value: 0 + contrast: + overrideState: 1 + value: 10 + mixerRedOutRedIn: + overrideState: 0 + value: 100 + mixerRedOutGreenIn: + overrideState: 0 + value: 0 + mixerRedOutBlueIn: + overrideState: 0 + value: 0 + mixerGreenOutRedIn: + overrideState: 0 + value: 0 + mixerGreenOutGreenIn: + overrideState: 0 + value: 100 + mixerGreenOutBlueIn: + overrideState: 0 + value: 0 + mixerBlueOutRedIn: + overrideState: 0 + value: 0 + mixerBlueOutGreenIn: + overrideState: 0 + value: 0 + mixerBlueOutBlueIn: + overrideState: 0 + value: 100 + lift: + overrideState: 0 + value: {x: 1, y: 1, z: 1, w: 0} + gamma: + overrideState: 0 + value: {x: 1, y: 1, z: 1, w: 0} + gain: + overrideState: 0 + value: {x: 1, y: 1, z: 1, w: 0} + masterCurve: + overrideState: 0 + value: + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + cachedData: + - 0 + - 0.0078125 + - 0.015625 + - 0.0234375 + - 0.03125 + - 0.0390625 + - 0.046875 + - 0.0546875 + - 0.0625 + - 0.0703125 + - 0.078125 + - 0.0859375 + - 0.09375 + - 0.1015625 + - 0.109375 + - 0.1171875 + - 0.125 + - 0.1328125 + - 0.140625 + - 0.1484375 + - 0.15625 + - 0.1640625 + - 0.171875 + - 0.1796875 + - 0.1875 + - 0.1953125 + - 0.203125 + - 0.2109375 + - 0.21875 + - 0.2265625 + - 0.234375 + - 0.2421875 + - 0.25 + - 0.2578125 + - 0.265625 + - 0.2734375 + - 0.28125 + - 0.2890625 + - 0.296875 + - 0.3046875 + - 0.3125 + - 0.3203125 + - 0.328125 + - 0.3359375 + - 0.34375 + - 0.3515625 + - 0.359375 + - 0.3671875 + - 0.375 + - 0.3828125 + - 0.390625 + - 0.3984375 + - 0.40625 + - 0.4140625 + - 0.421875 + - 0.4296875 + - 0.4375 + - 0.4453125 + - 0.453125 + - 0.4609375 + - 0.46875 + - 0.4765625 + - 0.484375 + - 0.4921875 + - 0.5 + - 0.5078125 + - 0.515625 + - 0.5234375 + - 0.53125 + - 0.5390625 + - 0.546875 + - 0.5546875 + - 0.5625 + - 0.5703125 + - 0.578125 + - 0.5859375 + - 0.59375 + - 0.6015625 + - 0.609375 + - 0.6171875 + - 0.625 + - 0.6328125 + - 0.640625 + - 0.6484375 + - 0.65625 + - 0.6640625 + - 0.671875 + - 0.6796875 + - 0.6875 + - 0.6953125 + - 0.703125 + - 0.7109375 + - 0.71875 + - 0.7265625 + - 0.734375 + - 0.7421875 + - 0.75 + - 0.7578125 + - 0.765625 + - 0.7734375 + - 0.78125 + - 0.7890625 + - 0.796875 + - 0.8046875 + - 0.8125 + - 0.8203125 + - 0.828125 + - 0.8359375 + - 0.84375 + - 0.8515625 + - 0.859375 + - 0.8671875 + - 0.875 + - 0.8828125 + - 0.890625 + - 0.8984375 + - 0.90625 + - 0.9140625 + - 0.921875 + - 0.9296875 + - 0.9375 + - 0.9453125 + - 0.953125 + - 0.9609375 + - 0.96875 + - 0.9765625 + - 0.984375 + - 0.9921875 + redCurve: + overrideState: 0 + value: + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + cachedData: + - 0 + - 0.0078125 + - 0.015625 + - 0.0234375 + - 0.03125 + - 0.0390625 + - 0.046875 + - 0.0546875 + - 0.0625 + - 0.0703125 + - 0.078125 + - 0.0859375 + - 0.09375 + - 0.1015625 + - 0.109375 + - 0.1171875 + - 0.125 + - 0.1328125 + - 0.140625 + - 0.1484375 + - 0.15625 + - 0.1640625 + - 0.171875 + - 0.1796875 + - 0.1875 + - 0.1953125 + - 0.203125 + - 0.2109375 + - 0.21875 + - 0.2265625 + - 0.234375 + - 0.2421875 + - 0.25 + - 0.2578125 + - 0.265625 + - 0.2734375 + - 0.28125 + - 0.2890625 + - 0.296875 + - 0.3046875 + - 0.3125 + - 0.3203125 + - 0.328125 + - 0.3359375 + - 0.34375 + - 0.3515625 + - 0.359375 + - 0.3671875 + - 0.375 + - 0.3828125 + - 0.390625 + - 0.3984375 + - 0.40625 + - 0.4140625 + - 0.421875 + - 0.4296875 + - 0.4375 + - 0.4453125 + - 0.453125 + - 0.4609375 + - 0.46875 + - 0.4765625 + - 0.484375 + - 0.4921875 + - 0.5 + - 0.5078125 + - 0.515625 + - 0.5234375 + - 0.53125 + - 0.5390625 + - 0.546875 + - 0.5546875 + - 0.5625 + - 0.5703125 + - 0.578125 + - 0.5859375 + - 0.59375 + - 0.6015625 + - 0.609375 + - 0.6171875 + - 0.625 + - 0.6328125 + - 0.640625 + - 0.6484375 + - 0.65625 + - 0.6640625 + - 0.671875 + - 0.6796875 + - 0.6875 + - 0.6953125 + - 0.703125 + - 0.7109375 + - 0.71875 + - 0.7265625 + - 0.734375 + - 0.7421875 + - 0.75 + - 0.7578125 + - 0.765625 + - 0.7734375 + - 0.78125 + - 0.7890625 + - 0.796875 + - 0.8046875 + - 0.8125 + - 0.8203125 + - 0.828125 + - 0.8359375 + - 0.84375 + - 0.8515625 + - 0.859375 + - 0.8671875 + - 0.875 + - 0.8828125 + - 0.890625 + - 0.8984375 + - 0.90625 + - 0.9140625 + - 0.921875 + - 0.9296875 + - 0.9375 + - 0.9453125 + - 0.953125 + - 0.9609375 + - 0.96875 + - 0.9765625 + - 0.984375 + - 0.9921875 + greenCurve: + overrideState: 0 + value: + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + cachedData: + - 0 + - 0.0078125 + - 0.015625 + - 0.0234375 + - 0.03125 + - 0.0390625 + - 0.046875 + - 0.0546875 + - 0.0625 + - 0.0703125 + - 0.078125 + - 0.0859375 + - 0.09375 + - 0.1015625 + - 0.109375 + - 0.1171875 + - 0.125 + - 0.1328125 + - 0.140625 + - 0.1484375 + - 0.15625 + - 0.1640625 + - 0.171875 + - 0.1796875 + - 0.1875 + - 0.1953125 + - 0.203125 + - 0.2109375 + - 0.21875 + - 0.2265625 + - 0.234375 + - 0.2421875 + - 0.25 + - 0.2578125 + - 0.265625 + - 0.2734375 + - 0.28125 + - 0.2890625 + - 0.296875 + - 0.3046875 + - 0.3125 + - 0.3203125 + - 0.328125 + - 0.3359375 + - 0.34375 + - 0.3515625 + - 0.359375 + - 0.3671875 + - 0.375 + - 0.3828125 + - 0.390625 + - 0.3984375 + - 0.40625 + - 0.4140625 + - 0.421875 + - 0.4296875 + - 0.4375 + - 0.4453125 + - 0.453125 + - 0.4609375 + - 0.46875 + - 0.4765625 + - 0.484375 + - 0.4921875 + - 0.5 + - 0.5078125 + - 0.515625 + - 0.5234375 + - 0.53125 + - 0.5390625 + - 0.546875 + - 0.5546875 + - 0.5625 + - 0.5703125 + - 0.578125 + - 0.5859375 + - 0.59375 + - 0.6015625 + - 0.609375 + - 0.6171875 + - 0.625 + - 0.6328125 + - 0.640625 + - 0.6484375 + - 0.65625 + - 0.6640625 + - 0.671875 + - 0.6796875 + - 0.6875 + - 0.6953125 + - 0.703125 + - 0.7109375 + - 0.71875 + - 0.7265625 + - 0.734375 + - 0.7421875 + - 0.75 + - 0.7578125 + - 0.765625 + - 0.7734375 + - 0.78125 + - 0.7890625 + - 0.796875 + - 0.8046875 + - 0.8125 + - 0.8203125 + - 0.828125 + - 0.8359375 + - 0.84375 + - 0.8515625 + - 0.859375 + - 0.8671875 + - 0.875 + - 0.8828125 + - 0.890625 + - 0.8984375 + - 0.90625 + - 0.9140625 + - 0.921875 + - 0.9296875 + - 0.9375 + - 0.9453125 + - 0.953125 + - 0.9609375 + - 0.96875 + - 0.9765625 + - 0.984375 + - 0.9921875 + blueCurve: + overrideState: 0 + value: + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + cachedData: + - 0 + - 0.0078125 + - 0.015625 + - 0.0234375 + - 0.03125 + - 0.0390625 + - 0.046875 + - 0.0546875 + - 0.0625 + - 0.0703125 + - 0.078125 + - 0.0859375 + - 0.09375 + - 0.1015625 + - 0.109375 + - 0.1171875 + - 0.125 + - 0.1328125 + - 0.140625 + - 0.1484375 + - 0.15625 + - 0.1640625 + - 0.171875 + - 0.1796875 + - 0.1875 + - 0.1953125 + - 0.203125 + - 0.2109375 + - 0.21875 + - 0.2265625 + - 0.234375 + - 0.2421875 + - 0.25 + - 0.2578125 + - 0.265625 + - 0.2734375 + - 0.28125 + - 0.2890625 + - 0.296875 + - 0.3046875 + - 0.3125 + - 0.3203125 + - 0.328125 + - 0.3359375 + - 0.34375 + - 0.3515625 + - 0.359375 + - 0.3671875 + - 0.375 + - 0.3828125 + - 0.390625 + - 0.3984375 + - 0.40625 + - 0.4140625 + - 0.421875 + - 0.4296875 + - 0.4375 + - 0.4453125 + - 0.453125 + - 0.4609375 + - 0.46875 + - 0.4765625 + - 0.484375 + - 0.4921875 + - 0.5 + - 0.5078125 + - 0.515625 + - 0.5234375 + - 0.53125 + - 0.5390625 + - 0.546875 + - 0.5546875 + - 0.5625 + - 0.5703125 + - 0.578125 + - 0.5859375 + - 0.59375 + - 0.6015625 + - 0.609375 + - 0.6171875 + - 0.625 + - 0.6328125 + - 0.640625 + - 0.6484375 + - 0.65625 + - 0.6640625 + - 0.671875 + - 0.6796875 + - 0.6875 + - 0.6953125 + - 0.703125 + - 0.7109375 + - 0.71875 + - 0.7265625 + - 0.734375 + - 0.7421875 + - 0.75 + - 0.7578125 + - 0.765625 + - 0.7734375 + - 0.78125 + - 0.7890625 + - 0.796875 + - 0.8046875 + - 0.8125 + - 0.8203125 + - 0.828125 + - 0.8359375 + - 0.84375 + - 0.8515625 + - 0.859375 + - 0.8671875 + - 0.875 + - 0.8828125 + - 0.890625 + - 0.8984375 + - 0.90625 + - 0.9140625 + - 0.921875 + - 0.9296875 + - 0.9375 + - 0.9453125 + - 0.953125 + - 0.9609375 + - 0.96875 + - 0.9765625 + - 0.984375 + - 0.9921875 + hueVsHueCurve: + overrideState: 0 + value: + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Loop: 1 + m_ZeroValue: 0.5 + m_Range: 1 + cachedData: + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + hueVsSatCurve: + overrideState: 0 + value: + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Loop: 1 + m_ZeroValue: 0.5 + m_Range: 1 + cachedData: + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + satVsSatCurve: + overrideState: 0 + value: + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Loop: 0 + m_ZeroValue: 0.5 + m_Range: 1 + cachedData: + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + lumVsSatCurve: + overrideState: 0 + value: + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Loop: 0 + m_ZeroValue: 0.5 + m_Range: 1 + cachedData: + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 + - 0.5 diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessingV2.asset.meta b/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessingV2.asset.meta new file mode 100644 index 0000000..41b6e12 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/PostProcessingV2.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f9dbc838d620d43c5a1c16e44ac0981a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/UnderwaterLighting.asset b/Packages/com.waveharmonic.crest/Shared/Settings/UnderwaterLighting.asset new file mode 100644 index 0000000..7ef8f56 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/UnderwaterLighting.asset @@ -0,0 +1,166 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2074244729520876864 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: f034cba68ab55e046ae1445a42f18c0e, type: 3} + m_Name: IndirectLightingController + m_EditorClassIdentifier: + active: 1 + indirectDiffuseLightingMultiplier: + m_OverrideState: 1 + m_Value: 0 + indirectDiffuseLightingLayers: + m_OverrideState: 0 + m_Value: 255 + reflectionLightingMultiplier: + m_OverrideState: 0 + m_Value: 1 + reflectionLightingLayers: + m_OverrideState: 0 + m_Value: 255 + reflectionProbeIntensityMultiplier: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-2037576497745832785 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 59b6606ef2548734bb6d11b9d160bc7e, type: 3} + m_Name: HDRISky + m_EditorClassIdentifier: + active: 1 + rotation: + m_OverrideState: 0 + m_Value: 0 + skyIntensityMode: + m_OverrideState: 0 + m_Value: 0 + exposure: + m_OverrideState: 1 + m_Value: 0 + multiplier: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxValue: + m_OverrideState: 0 + m_Value: 1 + upperHemisphereLuxColor: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + desiredLuxValue: + m_OverrideState: 0 + m_Value: 20000 + updateMode: + m_OverrideState: 0 + m_Value: 0 + updatePeriod: + m_OverrideState: 0 + m_Value: 0 + includeSunInBaking: + m_OverrideState: 0 + m_Value: 0 + hdriSky: + m_OverrideState: 0 + m_Value: {fileID: 0} + distortionMode: + m_OverrideState: 0 + m_Value: 0 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollOrientation: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 0 + additiveValue: 0 + multiplyValue: 1 + scrollSpeed: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 100 + additiveValue: 0 + multiplyValue: 1 + enableBackplate: + m_OverrideState: 0 + m_Value: 0 + backplateType: + m_OverrideState: 0 + m_Value: 0 + groundLevel: + m_OverrideState: 0 + m_Value: 0 + scale: + m_OverrideState: 0 + m_Value: {x: 32, y: 32} + projectionDistance: + m_OverrideState: 0 + m_Value: 16 + plateRotation: + m_OverrideState: 0 + m_Value: 0 + plateTexRotation: + m_OverrideState: 0 + m_Value: 0 + plateTexOffset: + m_OverrideState: 0 + m_Value: {x: 0, y: 0} + blendAmount: + m_OverrideState: 0 + m_Value: 0 + shadowTint: + m_OverrideState: 0 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + pointLightShadow: + m_OverrideState: 0 + m_Value: 0 + dirLightShadow: + m_OverrideState: 0 + m_Value: 0 + rectLightShadow: + m_OverrideState: 0 + m_Value: 0 + m_SkyVersion: 1 + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteScrollSpeed: + m_OverrideState: 0 + m_Value: 2 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + 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: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: UnderwaterLighting + m_EditorClassIdentifier: + components: + - {fileID: -2074244729520876864} + - {fileID: -2037576497745832785} diff --git a/Packages/com.waveharmonic.crest/Shared/Settings/UnderwaterLighting.asset.meta b/Packages/com.waveharmonic.crest/Shared/Settings/UnderwaterLighting.asset.meta new file mode 100644 index 0000000..b8563b5 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Settings/UnderwaterLighting.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 900f04ab6f87d474eaf8c86396dec455 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Shaders.meta b/Packages/com.waveharmonic.crest/Shared/Shaders.meta new file mode 100644 index 0000000..9c49455 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 701d1737e6143426c9c1555af9b8ffb2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Shaders/Lit.shadergraph b/Packages/com.waveharmonic.crest/Shared/Shaders/Lit.shadergraph new file mode 100644 index 0000000..4cf3119 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Shaders/Lit.shadergraph @@ -0,0 +1,9734 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "37bfac943f684b8aabe8321d76e9336d", + "m_Properties": [ + { + "m_Id": "f9d39431664f4db282bf85cda7330e04" + }, + { + "m_Id": "073fbba2726346708a435d231acd7994" + }, + { + "m_Id": "b20ecbb6b51842189aa09a748f852aac" + }, + { + "m_Id": "226dd52085fd4c5f96cbd5b5ce8c1932" + }, + { + "m_Id": "e1260fde245f4582a46223b43a512871" + }, + { + "m_Id": "fd2e5f1ae08c4f45b0c795fb9673845c" + }, + { + "m_Id": "a9ae7d9f9bb342668379f294b997a024" + }, + { + "m_Id": "6653a111fd9e437d8669bdd9670b0bcd" + }, + { + "m_Id": "a6514c562dcf45fb942466fd9b4581a0" + }, + { + "m_Id": "5fbe70a88c3441e88ae8d195aba3b134" + }, + { + "m_Id": "a45878eacd044a68aae28771783def4f" + }, + { + "m_Id": "d9463d7b8c064ec89cf8a937bd5a27c5" + }, + { + "m_Id": "d29cc0a358fe4e11adf98951bf90803e" + }, + { + "m_Id": "89b8f3104f6f45b7a09de6483d127676" + }, + { + "m_Id": "9dcbe1b467374735bd6902ef8a4b5fea" + }, + { + "m_Id": "d26edc375b4c4243938ad5141a4772f2" + }, + { + "m_Id": "f03ed8b9043f469381375a4ce7291134" + }, + { + "m_Id": "512fb8b4826e48fab65b83b8744dcc78" + }, + { + "m_Id": "9783263798cc4b25a7a122df318a57f8" + }, + { + "m_Id": "988d3fda4b75435b9f2630355731fbc7" + } + ], + "m_Keywords": [ + { + "m_Id": "65d8361074904a08ba28f1116b517849" + } + ], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "e8dc3ed688a74734819643d0041f5e84" + }, + { + "m_Id": "2a1de778e8714e0d8a9787d48f97fe83" + }, + { + "m_Id": "6b44a145175a4c7f9c7dd719960259ce" + }, + { + "m_Id": "2af241d837ff4983940c6e30937b72d2" + }, + { + "m_Id": "1acddea35a31457fbd706aeedbfa4397" + }, + { + "m_Id": "1b1b8217eb194876b9ccd3127f15a0fd" + }, + { + "m_Id": "ccbb3780be7a4f95a0e4097ce1deb474" + }, + { + "m_Id": "74a97f54e8d44a3b9a020081d1e1768d" + }, + { + "m_Id": "0164e72437a64b44bc7ad519bd8c99c1" + } + ], + "m_Nodes": [ + { + "m_Id": "c76502e563064684b6843ddfd14da25a" + }, + { + "m_Id": "8f60dac23b7b4dc19e74482e8ab0d940" + }, + { + "m_Id": "f31b7daaa9204711a7fed011b26dbc8a" + }, + { + "m_Id": "bc13f29ae89348fd880b7361cff27f24" + }, + { + "m_Id": "d0d2e0ffa03f4e34b9eaf8227f527aea" + }, + { + "m_Id": "eb207ee80e7a43fb9485b15792cc0b42" + }, + { + "m_Id": "99aea177043447d3adf16a8476eb38aa" + }, + { + "m_Id": "fca2a686d3fd4b588cde3b54823bb062" + }, + { + "m_Id": "d4a644e38a094910857c3832321b616e" + }, + { + "m_Id": "1e5bfaa51ee04aa08e0a5fcbb07dc1d2" + }, + { + "m_Id": "8d46109eb9204186933dd03b62aa5318" + }, + { + "m_Id": "95f3657663484b8e990cd7400d169b39" + }, + { + "m_Id": "06b5b1cd124a48188ddff4bf4e9a6a8c" + }, + { + "m_Id": "028c98d7289e4310893c5258d08b62d2" + }, + { + "m_Id": "e3238989e2c24727be4ff3a509e22b32" + }, + { + "m_Id": "5aebdfb77ba14f6b9eff2c32e7f13938" + }, + { + "m_Id": "135c5e5185144e63bd354959291045f1" + }, + { + "m_Id": "2855e36325bd4d128bb40b4a941d5646" + }, + { + "m_Id": "2a1bd03ce9264ee8bc0450364d67cba6" + }, + { + "m_Id": "b2b8b9f6255d4b348f0a6e893e918aa2" + }, + { + "m_Id": "2df48290175b491e81b863b3c0855b09" + }, + { + "m_Id": "c14a8937cbd94b5abf1ab7c367caddcb" + }, + { + "m_Id": "4a6047b5bead4985b4f7322eecad7419" + }, + { + "m_Id": "9375c82739f44b6bbdb78d0a74151a34" + }, + { + "m_Id": "c470a679d8084e2d98f9f97fb350661b" + }, + { + "m_Id": "7ba8fdf5005249f6bba8c396995899ae" + }, + { + "m_Id": "c0db1c57607b4218b9fe4a494acc32bd" + }, + { + "m_Id": "d5e45089bcab4d2d822fb10275983e32" + }, + { + "m_Id": "9c9ba87b32ad441dba6e9b9f11388d9b" + }, + { + "m_Id": "c493086a18fd4d91af06067576d3b393" + }, + { + "m_Id": "5b364a3b3f674212ba3399f19a28ee98" + }, + { + "m_Id": "b774027047014045a64b4163e87330c9" + }, + { + "m_Id": "520ecbe721e34ff8b1a210ba99e4c012" + }, + { + "m_Id": "c0309b0ff34244ea97160fe5fc583e46" + }, + { + "m_Id": "05b98fd02a7f47d3826c3e2b99f5aec4" + }, + { + "m_Id": "221d8b24b13946f5a02c7668f63ea433" + }, + { + "m_Id": "4a5d841c6a6d4b6881c9e62fc22ab114" + }, + { + "m_Id": "fa01c85ba84f46ad8526a72cf40096aa" + }, + { + "m_Id": "f5d0d252a08b45c68d2737a801473424" + }, + { + "m_Id": "a4dd0c6239aa478ba424219e8584a2ec" + }, + { + "m_Id": "63df3fd85f3b42ef91149243e4228a47" + }, + { + "m_Id": "7958ddaf74f84d10b4c52d980f7a2caf" + }, + { + "m_Id": "e556d99ab36040ee8da300db433d398a" + }, + { + "m_Id": "cd0e1f20815e4e1684051141b3f87a4c" + }, + { + "m_Id": "9ddc490d58d443a699694376870e4007" + }, + { + "m_Id": "0eb29ed7a83441a089f8ce611fc807eb" + }, + { + "m_Id": "4b94de380ed84deb9b55e5ce8d3aa365" + }, + { + "m_Id": "c8586dfffdde4291b53fea53da86f2fb" + }, + { + "m_Id": "5fc3fb4427364d89ba464df7069757af" + }, + { + "m_Id": "59dadd2dd4fa403db2d437e0ca9a0d93" + }, + { + "m_Id": "0ff01f6d26a846d290181ba4d0e326f3" + }, + { + "m_Id": "43fc89e0f03a4fdd9b3bad3de5fa67c0" + }, + { + "m_Id": "a331dade344845c389375e2828f69a68" + }, + { + "m_Id": "077be58326b74a9794cb912d914b699b" + }, + { + "m_Id": "48ee8e67ce3e4e548f03ee2ccdc0ccb5" + }, + { + "m_Id": "624c99e5cf554cc09377549b72c10ed7" + }, + { + "m_Id": "ca2a1fd237384498b16fa84ee5965ae0" + }, + { + "m_Id": "d717b908373c4a72854e9002cf1e059c" + }, + { + "m_Id": "2cded22ab3774ad290d22b02d024533c" + }, + { + "m_Id": "1d13ebcfecc64e93b7ae542b9d5bd4bb" + }, + { + "m_Id": "81e8f861d3854a619d550942dd0b2ae2" + }, + { + "m_Id": "67f62854fb9746aea59b8e9362b02e59" + }, + { + "m_Id": "713229f0e40a4ffea70185df0f86d91a" + }, + { + "m_Id": "c4963951ce554480911fd26643c8049d" + }, + { + "m_Id": "b4f0174124dc498db636372a66063897" + }, + { + "m_Id": "6f4036ddae1d4369b66ae1ecf209815d" + }, + { + "m_Id": "ab6a9bc49dfd4a0190d46c6ab2cc20fe" + }, + { + "m_Id": "10ad0652e2254860b4b38187fd4a10ca" + }, + { + "m_Id": "9417f7fcc072407fa41ae71034a5f4c3" + }, + { + "m_Id": "406fe111bf714ef3b757aa5772e5d7e7" + }, + { + "m_Id": "36890c4ddfba47ed8fa68bc64fa88f89" + }, + { + "m_Id": "3dc06e3c9ccb4bc8b1479d4d78855705" + }, + { + "m_Id": "3d920b053a2f4bbfaaf6ba4f8c9f137e" + } + ], + "m_GroupDatas": [ + { + "m_Id": "75ae407f7549455383d1c32d8989f303" + }, + { + "m_Id": "cebae50b11e94e838b6e7a5a61d4f2e8" + }, + { + "m_Id": "8dbd81486d314bc690d94dc6281fe289" + }, + { + "m_Id": "40a7b9274eb447a48d0f1e31def6ba52" + }, + { + "m_Id": "8c0e1cebdf4b4a90ae93ed60f9876e72" + }, + { + "m_Id": "f0446934f1f84b8480c20f72122e30f3" + }, + { + "m_Id": "5a905965f0d64818bbfb2d4f869e738b" + }, + { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + { + "m_Id": "cd446e3cb81b417a8bd2dc2ccafcd42e" + }, + { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + { + "m_Id": "b8b5e48f3c87435c8fe78bddf85831ee" + } + ], + "m_StickyNoteDatas": [ + { + "m_Id": "137c4a5054b249e98aa4a62c625d4053" + }, + { + "m_Id": "34d2897ff99d4577b2f11cf3213bf669" + } + ], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "028c98d7289e4310893c5258d08b62d2" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "43fc89e0f03a4fdd9b3bad3de5fa67c0" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "028c98d7289e4310893c5258d08b62d2" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b2b8b9f6255d4b348f0a6e893e918aa2" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "05b98fd02a7f47d3826c3e2b99f5aec4" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d4a644e38a094910857c3832321b616e" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "06b5b1cd124a48188ddff4bf4e9a6a8c" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "028c98d7289e4310893c5258d08b62d2" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "06b5b1cd124a48188ddff4bf4e9a6a8c" + }, + "m_SlotId": 7 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "7ba8fdf5005249f6bba8c396995899ae" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "077be58326b74a9794cb912d914b699b" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "48ee8e67ce3e4e548f03ee2ccdc0ccb5" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "0eb29ed7a83441a089f8ce611fc807eb" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9ddc490d58d443a699694376870e4007" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "0ff01f6d26a846d290181ba4d0e326f3" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "59dadd2dd4fa403db2d437e0ca9a0d93" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "10ad0652e2254860b4b38187fd4a10ca" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d0d2e0ffa03f4e34b9eaf8227f527aea" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "135c5e5185144e63bd354959291045f1" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c470a679d8084e2d98f9f97fb350661b" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1d13ebcfecc64e93b7ae542b9d5bd4bb" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "67f62854fb9746aea59b8e9362b02e59" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "221d8b24b13946f5a02c7668f63ea433" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1e5bfaa51ee04aa08e0a5fcbb07dc1d2" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "2855e36325bd4d128bb40b4a941d5646" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4a5d841c6a6d4b6881c9e62fc22ab114" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "2a1bd03ce9264ee8bc0450364d67cba6" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a4dd0c6239aa478ba424219e8584a2ec" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "2cded22ab3774ad290d22b02d024533c" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1d13ebcfecc64e93b7ae542b9d5bd4bb" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "2df48290175b491e81b863b3c0855b09" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "95f3657663484b8e990cd7400d169b39" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "36890c4ddfba47ed8fa68bc64fa88f89" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "406fe111bf714ef3b757aa5772e5d7e7" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3d920b053a2f4bbfaaf6ba4f8c9f137e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "bc13f29ae89348fd880b7361cff27f24" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3d920b053a2f4bbfaaf6ba4f8c9f137e" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "fca2a686d3fd4b588cde3b54823bb062" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3dc06e3c9ccb4bc8b1479d4d78855705" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "10ad0652e2254860b4b38187fd4a10ca" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3dc06e3c9ccb4bc8b1479d4d78855705" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6f4036ddae1d4369b66ae1ecf209815d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "406fe111bf714ef3b757aa5772e5d7e7" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "10ad0652e2254860b4b38187fd4a10ca" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "43fc89e0f03a4fdd9b3bad3de5fa67c0" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3d920b053a2f4bbfaaf6ba4f8c9f137e" + }, + "m_SlotId": 18569658 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "48ee8e67ce3e4e548f03ee2ccdc0ccb5" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "43fc89e0f03a4fdd9b3bad3de5fa67c0" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4a5d841c6a6d4b6881c9e62fc22ab114" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "eb207ee80e7a43fb9485b15792cc0b42" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4a6047b5bead4985b4f7322eecad7419" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4a5d841c6a6d4b6881c9e62fc22ab114" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4a6047b5bead4985b4f7322eecad7419" + }, + "m_SlotId": 7 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "7ba8fdf5005249f6bba8c396995899ae" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4b94de380ed84deb9b55e5ce8d3aa365" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c8586dfffdde4291b53fea53da86f2fb" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "520ecbe721e34ff8b1a210ba99e4c012" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b774027047014045a64b4163e87330c9" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "59dadd2dd4fa403db2d437e0ca9a0d93" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5fc3fb4427364d89ba464df7069757af" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5aebdfb77ba14f6b9eff2c32e7f13938" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "028c98d7289e4310893c5258d08b62d2" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5b364a3b3f674212ba3399f19a28ee98" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c493086a18fd4d91af06067576d3b393" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5fc3fb4427364d89ba464df7069757af" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "077be58326b74a9794cb912d914b699b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "624c99e5cf554cc09377549b72c10ed7" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5fc3fb4427364d89ba464df7069757af" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "63df3fd85f3b42ef91149243e4228a47" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0eb29ed7a83441a089f8ce611fc807eb" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "67f62854fb9746aea59b8e9362b02e59" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c4963951ce554480911fd26643c8049d" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6f4036ddae1d4369b66ae1ecf209815d" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "10ad0652e2254860b4b38187fd4a10ca" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "713229f0e40a4ffea70185df0f86d91a" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "67f62854fb9746aea59b8e9362b02e59" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "713229f0e40a4ffea70185df0f86d91a" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b4f0174124dc498db636372a66063897" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7958ddaf74f84d10b4c52d980f7a2caf" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "63df3fd85f3b42ef91149243e4228a47" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7ba8fdf5005249f6bba8c396995899ae" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c470a679d8084e2d98f9f97fb350661b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "81e8f861d3854a619d550942dd0b2ae2" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1d13ebcfecc64e93b7ae542b9d5bd4bb" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9375c82739f44b6bbdb78d0a74151a34" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4a6047b5bead4985b4f7322eecad7419" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9417f7fcc072407fa41ae71034a5f4c3" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "406fe111bf714ef3b757aa5772e5d7e7" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9c9ba87b32ad441dba6e9b9f11388d9b" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5e45089bcab4d2d822fb10275983e32" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9ddc490d58d443a699694376870e4007" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "59dadd2dd4fa403db2d437e0ca9a0d93" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a331dade344845c389375e2828f69a68" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "48ee8e67ce3e4e548f03ee2ccdc0ccb5" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a4dd0c6239aa478ba424219e8584a2ec" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3d920b053a2f4bbfaaf6ba4f8c9f137e" + }, + "m_SlotId": -457410494 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ab6a9bc49dfd4a0190d46c6ab2cc20fe" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "36890c4ddfba47ed8fa68bc64fa88f89" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b2b8b9f6255d4b348f0a6e893e918aa2" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8d46109eb9204186933dd03b62aa5318" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b4f0174124dc498db636372a66063897" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c4963951ce554480911fd26643c8049d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b774027047014045a64b4163e87330c9" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "05b98fd02a7f47d3826c3e2b99f5aec4" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c0309b0ff34244ea97160fe5fc583e46" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "05b98fd02a7f47d3826c3e2b99f5aec4" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c0db1c57607b4218b9fe4a494acc32bd" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "7ba8fdf5005249f6bba8c396995899ae" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c470a679d8084e2d98f9f97fb350661b" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "99aea177043447d3adf16a8476eb38aa" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c493086a18fd4d91af06067576d3b393" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "713229f0e40a4ffea70185df0f86d91a" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c4963951ce554480911fd26643c8049d" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3dc06e3c9ccb4bc8b1479d4d78855705" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c8586dfffdde4291b53fea53da86f2fb" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9ddc490d58d443a699694376870e4007" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ca2a1fd237384498b16fa84ee5965ae0" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "2cded22ab3774ad290d22b02d024533c" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cd0e1f20815e4e1684051141b3f87a4c" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e556d99ab36040ee8da300db433d398a" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d5e45089bcab4d2d822fb10275983e32" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c493086a18fd4d91af06067576d3b393" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d717b908373c4a72854e9002cf1e059c" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ca2a1fd237384498b16fa84ee5965ae0" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e3238989e2c24727be4ff3a509e22b32" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "06b5b1cd124a48188ddff4bf4e9a6a8c" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e556d99ab36040ee8da300db433d398a" + }, + "m_SlotId": 7 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "077be58326b74a9794cb912d914b699b" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e556d99ab36040ee8da300db433d398a" + }, + "m_SlotId": 7 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a331dade344845c389375e2828f69a68" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e556d99ab36040ee8da300db433d398a" + }, + "m_SlotId": 7 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c4963951ce554480911fd26643c8049d" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f5d0d252a08b45c68d2737a801473424" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "fa01c85ba84f46ad8526a72cf40096aa" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "fa01c85ba84f46ad8526a72cf40096aa" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a4dd0c6239aa478ba424219e8584a2ec" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "c76502e563064684b6843ddfd14da25a" + }, + { + "m_Id": "8f60dac23b7b4dc19e74482e8ab0d940" + }, + { + "m_Id": "f31b7daaa9204711a7fed011b26dbc8a" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "bc13f29ae89348fd880b7361cff27f24" + }, + { + "m_Id": "8d46109eb9204186933dd03b62aa5318" + }, + { + "m_Id": "d0d2e0ffa03f4e34b9eaf8227f527aea" + }, + { + "m_Id": "eb207ee80e7a43fb9485b15792cc0b42" + }, + { + "m_Id": "99aea177043447d3adf16a8476eb38aa" + }, + { + "m_Id": "fca2a686d3fd4b588cde3b54823bb062" + }, + { + "m_Id": "d4a644e38a094910857c3832321b616e" + }, + { + "m_Id": "1e5bfaa51ee04aa08e0a5fcbb07dc1d2" + }, + { + "m_Id": "95f3657663484b8e990cd7400d169b39" + }, + { + "m_Id": "c14a8937cbd94b5abf1ab7c367caddcb" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Hidden/Crest/Samples/Scenes", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_SubDatas": [], + "m_ActiveTargets": [ + { + "m_Id": "840c4b73cabf4489982965630032a419" + }, + { + "m_Id": "88f2fa4395e14c27b2c4cd4c39f4a557" + }, + { + "m_Id": "e2ddf66d492a4aa19a63c60af0009914" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "0164e72437a64b44bc7ad519bd8c99c1", + "m_Name": "Advanced", + "m_ChildObjectList": [ + { + "m_Id": "65d8361074904a08ba28f1116b517849" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "017ecd6b90fc4939b6cf764a39f8ccfd", + "m_Id": 0, + "m_DisplayName": "Emission", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "02617dfed10a46669baf63b3ac51be54", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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.MultiplyNode", + "m_ObjectId": "028c98d7289e4310893c5258d08b62d2", + "m_Group": { + "m_Id": "75ae407f7549455383d1c32d8989f303" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1883.0003662109375, + "y": -267.99993896484377, + "width": 130.0, + "height": 117.99990844726563 + } + }, + "m_Slots": [ + { + "m_Id": "6fb2c59bbe084f8586f527e73fef9585" + }, + { + "m_Id": "2661a5abd4004602a688696757e15740" + }, + { + "m_Id": "6be3d0264cbc448db4b71e04e054dfcb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "030b46cbb68048eeba105ae309540d9f", + "m_Id": 0, + "m_DisplayName": "Metallic Map", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "04c95fb063ef48ea9e818b21c24d9ab5", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "05b1adbcae5d43cbb632e7116698acf6", + "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.LerpNode", + "m_ObjectId": "05b98fd02a7f47d3826c3e2b99f5aec4", + "m_Group": { + "m_Id": "8c0e1cebdf4b4a90ae93ed60f9876e72" + }, + "m_Name": "Lerp", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -408.0000305175781, + "y": 1387.0001220703125, + "width": 126.0, + "height": 141.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "4fb2c48006f446c68ff80767c6e74072" + }, + { + "m_Id": "04c95fb063ef48ea9e818b21c24d9ab5" + }, + { + "m_Id": "ed53035c29c048458068300e1fd0cd27" + }, + { + "m_Id": "bd5fb7d289e643638297678200aa9587" + } + ], + "synonyms": [ + "mix", + "blend", + "linear interpolate" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "06b5b1cd124a48188ddff4bf4e9a6a8c", + "m_Group": { + "m_Id": "75ae407f7549455383d1c32d8989f303" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -2085.000244140625, + "y": -267.99993896484377, + "width": 180.0001220703125, + "height": 178.99993896484376 + } + }, + "m_Slots": [ + { + "m_Id": "ed64aea815874cefa9b56f70b2aa8f21" + }, + { + "m_Id": "10b69e37e43d433da17048418160eeef" + }, + { + "m_Id": "f21103cd07f74ccea687ed97d7b20650" + }, + { + "m_Id": "67a38caa544c45b889e45d23aaab060f" + }, + { + "m_Id": "6bc6b9e0a2624ed396e3442317be8715" + }, + { + "m_Id": "67a402877e3a477c82a85c2a2a073d1a" + }, + { + "m_Id": "e87e64d077ad46dc9db7a2ae96d5f6c9" + }, + { + "m_Id": "d0cec5fd4f9545178c523d7bf5de5a5c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0, + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 +} + +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "073fbba2726346708a435d231acd7994", + "m_Guid": { + "m_GuidSerialized": "1196b676-8872-4b32-bac8-78de5154945c" + }, + "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": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "r": 1.0, + "g": 1.0, + "b": 1.0, + "a": 1.0 + }, + "isMainColor": false, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "077be58326b74a9794cb912d914b699b", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1397.0003662109375, + "y": -754.0, + "width": 130.0001220703125, + "height": 117.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "7b7da8cb8bb7489c97677230e8c1461c" + }, + { + "m_Id": "202915ebf35c4046ba7e0ab14237fd1c" + }, + { + "m_Id": "cede2400ec2c454d8b3f440251012d0a" + } + ], + "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.Vector3MaterialSlot", + "m_ObjectId": "09330e46b8a7473c93eca4e14fb9ac28", + "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 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "09999c95de154f74ba5d0dbdf45712ff", + "m_Id": 0, + "m_DisplayName": "Detail Albedo Map Scale", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "0e139607c05b4bb8935e59a8ddfc2a34", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.SwizzleNode", + "m_ObjectId": "0eb29ed7a83441a089f8ce611fc807eb", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Swizzle", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2062.000244140625, + "y": -754.0, + "width": 132.0, + "height": 121.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "c9d5678677584ccb8b641247cc2366ab" + }, + { + "m_Id": "5c98ba512ccb4391a3899ff1c57b71be" + } + ], + "synonyms": [ + "swap", + "reorder", + "component mask" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "_maskInput": "xyz", + "convertedMask": "xyz" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "0f1f525eddfa43a5a87310c4243524be", + "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.PropertyNode", + "m_ObjectId": "0ff01f6d26a846d290181ba4d0e326f3", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1930.000244140625, + "y": -636.0000610351563, + "width": 202.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "09999c95de154f74ba5d0dbdf45712ff" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "f03ed8b9043f469381375a4ce7291134" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BranchNode", + "m_ObjectId": "10ad0652e2254860b4b38187fd4a10ca", + "m_Group": { + "m_Id": "b8b5e48f3c87435c8fe78bddf85831ee" + }, + "m_Name": "Branch", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1103.9998779296875, + "y": -52.99998474121094, + "width": 172.00006103515626, + "height": 142.0000762939453 + } + }, + "m_Slots": [ + { + "m_Id": "361e5d3ec4f44c40941c32ef7c5f3801" + }, + { + "m_Id": "90287b4a7df746ada6dfe95f76af25de" + }, + { + "m_Id": "5f635683c91e4d76ad13402d7c1a1d30" + }, + { + "m_Id": "b0524f4fe77047f0816faf49fc8f18bb" + } + ], + "synonyms": [ + "switch", + "if", + "else" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "10b69e37e43d433da17048418160eeef", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "115cd36f048046628951d753480b5287", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "12099210038e4184bdf161275f73e17e", + "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.PropertyNode", + "m_ObjectId": "135c5e5185144e63bd354959291045f1", + "m_Group": { + "m_Id": "8dbd81486d314bc690d94dc6281fe289" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -864.0, + "y": 792.0000610351563, + "width": 139.99993896484376, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "7cff47f9096a42979f5ad71205d49755" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "226dd52085fd4c5f96cbd5b5ce8c1932" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "137c4a5054b249e98aa4a62c625d4053", + "m_Title": "Important", + "m_Content": "Metallic should be one if Metallic Map is set.", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -1628.0, + "y": 618.0, + "width": 200.0, + "height": 100.0 + }, + "m_Group": { + "m_Id": "cebae50b11e94e838b6e7a5a61d4f2e8" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "137d12cbd4304d52b1cf0d95ca5c5410", + "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.Vector1MaterialSlot", + "m_ObjectId": "15149423a05142f6ae480acabae805fa", + "m_Id": 4, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "16bec3f0eed24305afcdbdf9549fbd2c", + "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.Vector1MaterialSlot", + "m_ObjectId": "178daa7b355442e19e7d9f8ae47d73ff", + "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.BooleanMaterialSlot", + "m_ObjectId": "19c29931a233417b925b12021ce1f258", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "1a4ab993ade94a9a8667c4f54451441b", + "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.CategoryData", + "m_ObjectId": "1acddea35a31457fbd706aeedbfa4397", + "m_Name": "Normal", + "m_ChildObjectList": [ + { + "m_Id": "5fbe70a88c3441e88ae8d195aba3b134" + }, + { + "m_Id": "988d3fda4b75435b9f2630355731fbc7" + }, + { + "m_Id": "a6514c562dcf45fb942466fd9b4581a0" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "1b1b8217eb194876b9ccd3127f15a0fd", + "m_Name": "Emission", + "m_ChildObjectList": [ + { + "m_Id": "e1260fde245f4582a46223b43a512871" + }, + { + "m_Id": "89b8f3104f6f45b7a09de6483d127676" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalStrengthNode", + "m_ObjectId": "1d13ebcfecc64e93b7ae542b9d5bd4bb", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Normal Strength", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2362.000244140625, + "y": 112.99996948242188, + "width": 166.0, + "height": 118.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "a0d211ee5b864f99bafe73484c82b392" + }, + { + "m_Id": "3b0af83765444a7c8750e1aa7883c726" + }, + { + "m_Id": "732c9009a78c4960993614ab33c3f88a" + } + ], + "synonyms": [ + "intensity" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1e09e77599594ad1a7b6189f70f9dd97", + "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": "1e5bfaa51ee04aa08e0a5fcbb07dc1d2", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Specular", + "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": "ba7ce452f5af4d5d83da6be19e04ab1b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Specular" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "202915ebf35c4046ba7e0ab14237fd1c", + "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.SamplerStateMaterialSlot", + "m_ObjectId": "2135c3468ed047baa13605f17d4d9f4e", + "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.Vector1MaterialSlot", + "m_ObjectId": "2209a6af91524b00bee1b03dcd2a8e7c", + "m_Id": 1, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "221d8b24b13946f5a02c7668f63ea433", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -155.00006103515626, + "y": 519.0, + "width": 123.0000228881836, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "28f64bd01e294763a8c44f50182c5c2b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "d29cc0a358fe4e11adf98951bf90803e" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "225aa4516d5e48a0ae38c04d68387ac4", + "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": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "226dd52085fd4c5f96cbd5b5ce8c1932", + "m_Guid": { + "m_GuidSerialized": "ab572b4a-5ce7-4501-be77-20fd7dc66b6f" + }, + "m_Name": "Smoothness", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Smoothness", + "m_DefaultReferenceName": "_Smoothness", + "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.5, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "22b0b0a6f9cf42c2ac76aaea991d86c5", + "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": "2661a5abd4004602a688696757e15740", + "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", + "m_ObjectId": "2855e36325bd4d128bb40b4a941d5646", + "m_Group": { + "m_Id": "cebae50b11e94e838b6e7a5a61d4f2e8" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1797.000244140625, + "y": 670.0000610351563, + "width": 116.0, + "height": 34.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "3d88d8fc234847f3a61159b25596dcbd" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "b20ecbb6b51842189aa09a748f852aac" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "28b00750ef0c4d0eb57e6933cc57f2ec", + "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 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "28f64bd01e294763a8c44f50182c5c2b", + "m_Id": 0, + "m_DisplayName": "Specular", + "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.PropertyNode", + "m_ObjectId": "2a1bd03ce9264ee8bc0450364d67cba6", + "m_Group": { + "m_Id": "5a905965f0d64818bbfb2d4f869e738b" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -808.0000610351563, + "y": 1186.0001220703125, + "width": 122.99993896484375, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "017ecd6b90fc4939b6cf764a39f8ccfd" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "e1260fde245f4582a46223b43a512871" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "2a1c3313d7c347198330c12bb12e3699", + "m_Id": 0, + "m_DisplayName": "Normal (Tangent Space)", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "NormalTS", + "m_StageCapability": 2, + "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": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "2a1de778e8714e0d8a9787d48f97fe83", + "m_Name": "Color", + "m_ChildObjectList": [ + { + "m_Id": "073fbba2726346708a435d231acd7994" + }, + { + "m_Id": "f9d39431664f4db282bf85cda7330e04" + }, + { + "m_Id": "fd2e5f1ae08c4f45b0c795fb9673845c" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "2af241d837ff4983940c6e30937b72d2", + "m_Name": "Smoothness", + "m_ChildObjectList": [ + { + "m_Id": "226dd52085fd4c5f96cbd5b5ce8c1932" + }, + { + "m_Id": "6653a111fd9e437d8669bdd9670b0bcd" + } + ] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.SwizzleNode", + "m_ObjectId": "2cded22ab3774ad290d22b02d024533c", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Swizzle", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2507.000244140625, + "y": 112.99996948242188, + "width": 132.0, + "height": 122.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "eb715a1cbee24abca45f0b829d21fb57" + }, + { + "m_Id": "4337a79f17b245959a8873f7d984f824" + } + ], + "synonyms": [ + "swap", + "reorder", + "component mask" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "_maskInput": "xyz", + "convertedMask": "xyz" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "2de504e01c2245718e40baa6acc1b5f8", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "2df48290175b491e81b863b3c0855b09", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -157.00001525878907, + "y": 565.0, + "width": 140.9999542236328, + "height": 33.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "cc02227c38dd474882ab79ab5e96c1b8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "fd2e5f1ae08c4f45b0c795fb9673845c" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2f7034eaf21b4eedaf6c9dbfbc101d80", + "m_Id": -1490972, + "m_DisplayName": "Multiplier", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_0640f7e405ca4ded9cced0944e419139", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInLitSubTarget", + "m_ObjectId": "300cf1de2b6f4a5a8d350ea32a6575dc", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "30ea8aa1acd74238908b99818ba782cc", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "32eaf090c3674c5ebb4292090b0c710b", + "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.StickyNoteData", + "m_ObjectId": "34d2897ff99d4577b2f11cf3213bf669", + "m_Title": "Important", + "m_Content": "Normal Strength should be one if Normal Map is not set.", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -2503.0, + "y": 536.0, + "width": 200.0, + "height": 100.0 + }, + "m_Group": { + "m_Id": "40a7b9274eb447a48d0f1e31def6ba52" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "361e5d3ec4f44c40941c32ef7c5f3801", + "m_Id": 0, + "m_DisplayName": "Predicate", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Predicate", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NotNode", + "m_ObjectId": "36890c4ddfba47ed8fa68bc64fa88f89", + "m_Group": { + "m_Id": "b8b5e48f3c87435c8fe78bddf85831ee" + }, + "m_Name": "Not", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1386.9998779296875, + "y": -52.99998474121094, + "width": 132.0, + "height": 77.00003814697266 + } + }, + "m_Slots": [ + { + "m_Id": "3da033f1c9de4b20ac82e863c704bb72" + }, + { + "m_Id": "2de504e01c2245718e40baa6acc1b5f8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "37f12b97fedb4b4b96703b7ffcf30030", + "m_Id": 0, + "m_DisplayName": "Occlusion Map", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "3a602edeb2024d569404597b3371b727", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "3a80fdaf15c049d7b2d48df8a631ce75", + "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.Texture2DMaterialSlot", + "m_ObjectId": "3aa232cc599b4f2d880a83ab15707fed", + "m_Id": 0, + "m_DisplayName": "Detail Albedo Map", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "3b0af83765444a7c8750e1aa7883c726", + "m_Id": 1, + "m_DisplayName": "Strength", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Strength", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3b1a4698236b4d14af95e76b8054c1fe", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "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.UVMaterialSlot", + "m_ObjectId": "3c4a010407374c46a20b6f57f475bb4f", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "3c7221ca62a346f9935cfcff7e86c508", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "3c81612868394518bb14dfc968f36746", + "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": "3d88d8fc234847f3a61159b25596dcbd", + "m_Id": 0, + "m_DisplayName": "Metallic", + "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.SubGraphNode", + "m_ObjectId": "3d920b053a2f4bbfaaf6ba4f8c9f137e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integrate Water Volume", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -494.00006103515627, + "y": 249.5000457763672, + "width": 195.00006103515626, + "height": 142.9999542236328 + } + }, + "m_Slots": [ + { + "m_Id": "620ebe491daf41b7a2a79b30e2820846" + }, + { + "m_Id": "9f92af83b5ad4eb6840f7858e51e9736" + }, + { + "m_Id": "2f7034eaf21b4eedaf6c9dbfbc101d80" + }, + { + "m_Id": "5bff6fd9b79f4cef83b76fa7991d407b" + }, + { + "m_Id": "7a6d09da26b84c7abd84a17926d857cf" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"df63a8d198812478985b6d0a5d68a59a\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "4e700f9f-71e1-44ca-82f1-a15c46d60057", + "bebcb4b2-70d3-4426-b192-1c54922e3a4a", + "33f7abbf-d481-4327-84fd-12645ebd2beb" + ], + "m_PropertyIds": [ + 18569658, + -457410494, + -1490972 + ], + "m_Dropdowns": [], + "m_DropdownSelectedEntries": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "3da033f1c9de4b20ac82e863c704bb72", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "3dc06e3c9ccb4bc8b1479d4d78855705", + "m_Group": { + "m_Id": "b8b5e48f3c87435c8fe78bddf85831ee" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1453.9998779296875, + "y": 58.00003433227539, + "width": 56.0, + "height": 23.999996185302736 + } + }, + "m_Slots": [ + { + "m_Id": "f3d07d2931b6413b94adab5997472567" + }, + { + "m_Id": "3c7221ca62a346f9935cfcff7e86c508" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "3f4fb2c225ed4bf99bdf6d980fc57b07", + "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.AndNode", + "m_ObjectId": "406fe111bf714ef3b757aa5772e5d7e7", + "m_Group": { + "m_Id": "b8b5e48f3c87435c8fe78bddf85831ee" + }, + "m_Name": "And", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1254.9998779296875, + "y": -52.99998474121094, + "width": 130.0, + "height": 101.00003051757813 + } + }, + "m_Slots": [ + { + "m_Id": "7aa785b3d31148ffa058660ef34f791f" + }, + { + "m_Id": "c37bf412fa78488b83b00b597bea9648" + }, + { + "m_Id": "19c29931a233417b925b12021ce1f258" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "40a7b9274eb447a48d0f1e31def6ba52", + "m_Title": "Normal", + "m_Position": { + "x": -2894.0, + "y": 348.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "41aec16a03e94dd4932f5b7b7ca29ad0", + "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.SamplerStateMaterialSlot", + "m_ObjectId": "41d15aa932134f9181a3541493113dd4", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "424c46a55e2b42f0a62ef916f70379fa", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "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.Vector3MaterialSlot", + "m_ObjectId": "4337a79f17b245959a8873f7d984f824", + "m_Id": 1, + "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 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "43cc4527815f4d1599563c230ac464b7", + "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.MultiplyNode", + "m_ObjectId": "43fc89e0f03a4fdd9b3bad3de5fa67c0", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1137.000244140625, + "y": -752.0000610351563, + "width": 130.00006103515626, + "height": 118.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "60b4c10b2bf34a32bf7124621a59aa0d" + }, + { + "m_Id": "f889217dee1146989a34f29e5a436a20" + }, + { + "m_Id": "a4e6f6f87e714c15927b5a73283680bf" + } + ], + "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.Vector4MaterialSlot", + "m_ObjectId": "465c5643e0c347719108034ea60221ec", + "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.Texture2DInputMaterialSlot", + "m_ObjectId": "46f3e25e0a2b43ed82ae5839c10bc783", + "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.AddNode", + "m_ObjectId": "48ee8e67ce3e4e548f03ee2ccdc0ccb5", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1267.000244140625, + "y": -752.0000610351563, + "width": 130.0, + "height": 118.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "c078413bcc9c4a009c89c0d60c650582" + }, + { + "m_Id": "cfe41b26d48e41ccb8ada17b080239e2" + }, + { + "m_Id": "4abac64486b54345921d846167adedff" + } + ], + "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.Vector1MaterialSlot", + "m_ObjectId": "492fc3b3185e4b428e30268d4fc0db7e", + "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.MultiplyNode", + "m_ObjectId": "4a5d841c6a6d4b6881c9e62fc22ab114", + "m_Group": { + "m_Id": "cebae50b11e94e838b6e7a5a61d4f2e8" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1634.000244140625, + "y": 491.0, + "width": 126.0, + "height": 118.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "3f4fb2c225ed4bf99bdf6d980fc57b07" + }, + { + "m_Id": "3c81612868394518bb14dfc968f36746" + }, + { + "m_Id": "55d7efbd09744e6191353110dcd86a9d" + } + ], + "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.SampleTexture2DNode", + "m_ObjectId": "4a6047b5bead4985b4f7322eecad7419", + "m_Group": { + "m_Id": "cebae50b11e94e838b6e7a5a61d4f2e8" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -1837.0001220703125, + "y": 491.0, + "width": 155.9998779296875, + "height": 179.00006103515626 + } + }, + "m_Slots": [ + { + "m_Id": "79c084fe5532421b886da16371380922" + }, + { + "m_Id": "bc38cd4f0b6b4002aeb9d47ea7359bf4" + }, + { + "m_Id": "be8214b41a724c1b97fdc6315992cdea" + }, + { + "m_Id": "137d12cbd4304d52b1cf0d95ca5c5410" + }, + { + "m_Id": "3a80fdaf15c049d7b2d48df8a631ce75" + }, + { + "m_Id": "68acdb187f3a47ba93cdb9ed83d1e455" + }, + { + "m_Id": "05b1adbcae5d43cbb632e7116698acf6" + }, + { + "m_Id": "41d15aa932134f9181a3541493113dd4" + } + ], + "synonyms": [ + "tex2d" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "4abac64486b54345921d846167adedff", + "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.PropertyNode", + "m_ObjectId": "4b94de380ed84deb9b55e5ce8d3aa365", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2264.000244140625, + "y": -599.0, + "width": 202.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "f165143c0ab24ffaa8ae35cb701930cd" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "f03ed8b9043f469381375a4ce7291134" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDLitData", + "m_ObjectId": "4c3410a856f64b1891067d0733654e57", + "m_RayTracing": false, + "m_MaterialType": 0, + "m_RefractionModel": 0, + "m_SSSTransmission": true, + "m_EnergyConservingSpecular": true, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "4d122725ff954eaca698dd559a56fbad", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "4df7031916b8431180ed5ee67882c193", + "m_Id": 3, + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "4fb2c48006f446c68ff80767c6e74072", + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "512fb8b4826e48fab65b83b8744dcc78", + "m_Guid": { + "m_GuidSerialized": "57654b9c-894c-4f32-b130-660037d21826" + }, + "m_Name": "Detail Normal Map", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Detail Normal Map", + "m_DefaultReferenceName": "_Detail_Normal_Map", + "m_OverrideReferenceName": "_DetailNormalMap", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": true, + "m_Modifiable": true, + "m_DefaultType": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "519093d5818a40cb80eb9afd313dabb2", + "m_Id": 0, + "m_DisplayName": "Normal Flip Back Faces", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "520ecbe721e34ff8b1a210ba99e4c012", + "m_Group": { + "m_Id": "8c0e1cebdf4b4a90ae93ed60f9876e72" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -851.0000610351563, + "y": 1427.0, + "width": 161.0, + "height": 34.0001220703125 + } + }, + "m_Slots": [ + { + "m_Id": "37f12b97fedb4b4b96703b7ffcf30030" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "a45878eacd044a68aae28771783def4f" + } +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget", + "m_ObjectId": "53055d2fa81b42c99a7a251de6391a7d", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0, + "m_ClearCoat": false, + "m_BlendModePreserveSpecular": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "539bceae6166422cb427aa13ed735a70", + "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.Vector1MaterialSlot", + "m_ObjectId": "54306c72430547cbace417b315aee172", + "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.Vector1MaterialSlot", + "m_ObjectId": "54a56818e1fc4bf7a9a9eb2ab9f2eef2", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "55d7efbd09744e6191353110dcd86a9d", + "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.Vector1MaterialSlot", + "m_ObjectId": "579cfd2ccc024a8ca575e17769040c93", + "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.Vector1MaterialSlot", + "m_ObjectId": "581de728483f49beb19182b2da1a957d", + "m_Id": 0, + "m_DisplayName": "Normal", + "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.Vector1MaterialSlot", + "m_ObjectId": "5972e9a9acc849b3a192e51466f53583", + "m_Id": 0, + "m_DisplayName": "Occlusion", + "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.SubtractNode", + "m_ObjectId": "59dadd2dd4fa403db2d437e0ca9a0d93", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Subtract", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1700.0001220703125, + "y": -754.0, + "width": 129.999755859375, + "height": 117.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "74303bd9fc384474ab44ed2c3900cae3" + }, + { + "m_Id": "b9c856725396493d9bdb07bfabb1bf4f" + }, + { + "m_Id": "6e946e24be054ed1916271e424f8490a" + } + ], + "synonyms": [ + "subtraction", + "remove", + "minus", + "take away" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "59ed337330594b83a0cb18509a2103c4", + "m_Id": 1, + "m_DisplayName": "True", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "True", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "5a8a475ff31e41249e61d6d446f7045d", + "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.GroupData", + "m_ObjectId": "5a905965f0d64818bbfb2d4f869e738b", + "m_Title": "Emission", + "m_Position": { + "x": -1077.0, + "y": 972.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "5aebdfb77ba14f6b9eff2c32e7f13938", + "m_Group": { + "m_Id": "75ae407f7549455383d1c32d8989f303" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2011.000244140625, + "y": -88.99999237060547, + "width": 105.0, + "height": 34.00002670288086 + } + }, + "m_Slots": [ + { + "m_Id": "92e728130d914968ba764a679cfeb1e7" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "073fbba2726346708a435d231acd7994" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "5b364a3b3f674212ba3399f19a28ee98", + "m_Group": { + "m_Id": "40a7b9274eb447a48d0f1e31def6ba52" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2642.000244140625, + "y": 562.0000610351563, + "width": 113.0, + "height": 33.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "581de728483f49beb19182b2da1a957d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "5fbe70a88c3441e88ae8d195aba3b134" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "5bff6fd9b79f4cef83b76fa7991d407b", + "m_Id": 1, + "m_DisplayName": "Color", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Color", + "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.Vector3MaterialSlot", + "m_ObjectId": "5c98ba512ccb4391a3899ff1c57b71be", + "m_Id": 1, + "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 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "5d7640497f27495a9d3b18f11d1a8331", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": true, + "m_DefaultValue": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "5d992a286f434f3bbc7331596e782159", + "m_Id": 0, + "m_DisplayName": "Normal Map", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5f36a9459b9e4861ad3a4ae75d144e06", + "m_Id": 2, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5f5bab486feb4d5ab13dcf73e7176262", + "m_Id": 3, + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "5f635683c91e4d76ad13402d7c1a1d30", + "m_Id": 2, + "m_DisplayName": "False", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "False", + "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": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "5fbe70a88c3441e88ae8d195aba3b134", + "m_Guid": { + "m_GuidSerialized": "c0ce0039-faef-4069-b561-aa8b956a5604" + }, + "m_Name": "Normal", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Normal", + "m_DefaultReferenceName": "_Normal", + "m_OverrideReferenceName": "_BumpScale", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData", + "m_ObjectId": "5fc050c17ffe49f6ba85bbda45c46f59", + "m_MaterialNeedsUpdateHash": 279841, + "m_SurfaceType": 0, + "m_RenderingPass": 1, + "m_BlendMode": 0, + "m_ZTest": 4, + "m_ZWrite": false, + "m_TransparentCullMode": 2, + "m_OpaqueCullMode": 2, + "m_SortPriority": 0, + "m_AlphaTest": true, + "m_ExcludeFromTUAndAA": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false, + "m_DoubleSidedMode": 0, + "m_DOTSInstancing": false, + "m_CustomVelocity": false, + "m_Tessellation": false, + "m_TessellationMode": 0, + "m_TessellationFactorMinDistance": 20.0, + "m_TessellationFactorMaxDistance": 50.0, + "m_TessellationFactorTriangleSize": 100.0, + "m_TessellationShapeFactor": 0.75, + "m_TessellationBackFaceCullEpsilon": -0.25, + "m_TessellationMaxDisplacement": 0.009999999776482582, + "m_Version": 1, + "inspectorFoldoutMask": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "5fc3fb4427364d89ba464df7069757af", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1527.0001220703125, + "y": -754.0, + "width": 129.999755859375, + "height": 117.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "225aa4516d5e48a0ae38c04d68387ac4" + }, + { + "m_Id": "ca182aad34fe4f0799d1c040f65d652f" + }, + { + "m_Id": "c8d114c11ddd4984849c196a2e265810" + } + ], + "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", + "m_ObjectId": "60b4c10b2bf34a32bf7124621a59aa0d", + "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.Vector4MaterialSlot", + "m_ObjectId": "620ebe491daf41b7a2a79b30e2820846", + "m_Id": 18569658, + "m_DisplayName": "Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Color_5d923c2657794970996af7cb7159276f", + "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.Vector1Node", + "m_ObjectId": "624c99e5cf554cc09377549b72c10ed7", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Float", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1700.0001220703125, + "y": -636.0000610351563, + "width": 125.9998779296875, + "height": 77.0 + } + }, + "m_Slots": [ + { + "m_Id": "d632b87ac84b4359856a748b3cce4dfd" + }, + { + "m_Id": "888af6a388dc476c8685ccf44bff5596" + } + ], + "synonyms": [ + "Vector 1", + "1", + "v1", + "vec1", + "scalar" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": 0.0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "63df3fd85f3b42ef91149243e4228a47", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -2242.000244140625, + "y": -754.0, + "width": 180.0, + "height": 155.0 + } + }, + "m_Slots": [ + { + "m_Id": "1a4ab993ade94a9a8667c4f54451441b" + }, + { + "m_Id": "492fc3b3185e4b428e30268d4fc0db7e" + }, + { + "m_Id": "54a56818e1fc4bf7a9a9eb2ab9f2eef2" + }, + { + "m_Id": "eca3ea913291477491bbedf7be0f7cf0" + }, + { + "m_Id": "aa15bd26d8304da9b70db7e98b3c0e19" + }, + { + "m_Id": "9f5fdd1cfbc148498541990fb2973dc1" + }, + { + "m_Id": "539bceae6166422cb427aa13ed735a70" + }, + { + "m_Id": "a0895cb3da544fd8a9fd0c98afed3d53" + } + ], + "synonyms": [ + "tex2d" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "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.Vector3MaterialSlot", + "m_ObjectId": "65c83f57096f481d9cd93d6f769b332b", + "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": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "65d8361074904a08ba28f1116b517849", + "m_Guid": { + "m_GuidSerialized": "f157d3e4-dc1d-4f88-a68e-8aa8e974d09c" + }, + "m_Name": "Disable Specular Highlights", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Disable Specular Highlights", + "m_DefaultReferenceName": "_DISABLE_SPECULAR_HIGHLIGHTS", + "m_OverrideReferenceName": "_SPECULARHIGHLIGHTS_OFF", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_KeywordType": 0, + "m_KeywordDefinition": 0, + "m_KeywordScope": 0, + "m_KeywordStages": 2, + "m_Entries": [], + "m_Value": 1, + "m_IsEditable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "6653a111fd9e437d8669bdd9670b0bcd", + "m_Guid": { + "m_GuidSerialized": "294b879c-cbd2-43ca-9572-1611fb715020" + }, + "m_Name": "Smoothness From Albedo", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Smoothness From Albedo", + "m_DefaultReferenceName": "_Smoothness_From_Albedo", + "m_OverrideReferenceName": "_SmoothnessTextureChannel", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "67a38caa544c45b889e45d23aaab060f", + "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.Texture2DInputMaterialSlot", + "m_ObjectId": "67a402877e3a477c82a85c2a2a073d1a", + "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.NormalBlendNode", + "m_ObjectId": "67f62854fb9746aea59b8e9362b02e59", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Normal Blend", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2143.000244140625, + "y": 111.00003814697266, + "width": 145.0, + "height": 152.99993896484376 + } + }, + "m_Slots": [ + { + "m_Id": "65c83f57096f481d9cd93d6f769b332b" + }, + { + "m_Id": "aa6972e57da74f35acd5277428223e4f" + }, + { + "m_Id": "28b00750ef0c4d0eb57e6933cc57f2ec" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_BlendMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "68acdb187f3a47ba93cdb9ed83d1e455", + "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.Vector1MaterialSlot", + "m_ObjectId": "69589060132b47bc906b6b537466b085", + "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.Vector1MaterialSlot", + "m_ObjectId": "6a3b470a319e4621b9d39ed2dde90105", + "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.CategoryData", + "m_ObjectId": "6b44a145175a4c7f9c7dd719960259ce", + "m_Name": "Specular/Metallic", + "m_ChildObjectList": [ + { + "m_Id": "d29cc0a358fe4e11adf98951bf90803e" + }, + { + "m_Id": "b20ecbb6b51842189aa09a748f852aac" + }, + { + "m_Id": "a9ae7d9f9bb342668379f294b997a024" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "6b68d6d0d36541818ea5cc8c6aa6d27c", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Smoothness", + "m_StageCapability": 2, + "m_Value": 0.5, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "6bc6b9e0a2624ed396e3442317be8715", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "6be3d0264cbc448db4b71e04e054dfcb", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "6d3fe6dc716a4ba3b25f865ccc312268", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "6e946e24be054ed1916271e424f8490a", + "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.Texture2DMaterialSlot", + "m_ObjectId": "6f3b61224b9442079ae7397ab5ac3a3b", + "m_Id": 0, + "m_DisplayName": "Emission Map", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.FlipNode", + "m_ObjectId": "6f4036ddae1d4369b66ae1ecf209815d", + "m_Group": { + "m_Id": "b8b5e48f3c87435c8fe78bddf85831ee" + }, + "m_Name": "Flip", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1308.9998779296875, + "y": 89.00009155273438, + "width": 160.0, + "height": 206.99990844726563 + } + }, + "m_Slots": [ + { + "m_Id": "115cd36f048046628951d753480b5287" + }, + { + "m_Id": "ed9c10e3f10d4fa5bcdbef8bb8023ffb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_RedChannel": false, + "m_GreenChannel": false, + "m_BlueChannel": true, + "m_AlphaChannel": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "6fb2c59bbe084f8586f527e73fef9585", + "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.RedirectNodeData", + "m_ObjectId": "713229f0e40a4ffea70185df0f86d91a", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2252.000244140625, + "y": 231.00003051757813, + "width": 56.0, + "height": 23.999969482421876 + } + }, + "m_Slots": [ + { + "m_Id": "842d765c848140099b05b29b58cf3fe7" + }, + { + "m_Id": "424c46a55e2b42f0a62ef916f70379fa" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "7224ddffb24f4e5ea31957e3a09bdc45", + "m_Id": 1, + "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.Vector3MaterialSlot", + "m_ObjectId": "732c9009a78c4960993614ab33c3f88a", + "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 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "74303bd9fc384474ab44ed2c3900cae3", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "74a97f54e8d44a3b9a020081d1e1768d", + "m_Name": "Detail", + "m_ChildObjectList": [ + { + "m_Id": "d26edc375b4c4243938ad5141a4772f2" + }, + { + "m_Id": "9dcbe1b467374735bd6902ef8a4b5fea" + }, + { + "m_Id": "f03ed8b9043f469381375a4ce7291134" + }, + { + "m_Id": "512fb8b4826e48fab65b83b8744dcc78" + }, + { + "m_Id": "9783263798cc4b25a7a122df318a57f8" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "75ae407f7549455383d1c32d8989f303", + "m_Title": "Albedo", + "m_Position": { + "x": -2232.0, + "y": -326.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "7844c309071b4f42b7329805070ce54e", + "m_Title": "Apply Albedo Detail", + "m_Position": { + "x": -2462.0, + "y": -812.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "78dec7a33602431b8db670856518614e", + "m_Id": 0, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "m_StageCapability": 2, + "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_ColorMode": 1, + "m_DefaultColor": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "7958ddaf74f84d10b4c52d980f7a2caf", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2437.000244140625, + "y": -715.0, + "width": 179.0, + "height": 33.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "3aa232cc599b4f2d880a83ab15707fed" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "9dcbe1b467374735bd6902ef8a4b5fea" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "79bc26ac5b6c4941a175a5f220ac954d", + "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.Vector4MaterialSlot", + "m_ObjectId": "79c084fe5532421b886da16371380922", + "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.Vector3MaterialSlot", + "m_ObjectId": "7a6d09da26b84c7abd84a17926d857cf", + "m_Id": 2, + "m_DisplayName": "Emission", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "7aa785b3d31148ffa058660ef34f791f", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "7abb9cd41a5547868cdd6e7f4ca18168", + "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": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "7b7da8cb8bb7489c97677230e8c1461c", + "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.BranchNode", + "m_ObjectId": "7ba8fdf5005249f6bba8c396995899ae", + "m_Group": { + "m_Id": "8dbd81486d314bc690d94dc6281fe289" + }, + "m_Name": "Branch", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -894.0000610351563, + "y": 650.0000610351563, + "width": 170.0, + "height": 142.0 + } + }, + "m_Slots": [ + { + "m_Id": "c59ca170ab6a447395283b3d809130c7" + }, + { + "m_Id": "59ed337330594b83a0cb18509a2103c4" + }, + { + "m_Id": "b43a641d3cae4fbba6c9139f6343e467" + }, + { + "m_Id": "5f5bab486feb4d5ab13dcf73e7176262" + } + ], + "synonyms": [ + "switch", + "if", + "else" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7cff47f9096a42979f5ad71205d49755", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "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.Vector1MaterialSlot", + "m_ObjectId": "80c8e146a8eb4ac9a8b2b1d35cc5c629", + "m_Id": 1, + "m_DisplayName": "Strength", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Strength", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "81e8f861d3854a619d550942dd0b2ae2", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2578.000244140625, + "y": 267.99993896484377, + "width": 203.0, + "height": 34.000030517578128 + } + }, + "m_Slots": [ + { + "m_Id": "82d2d8bce5af41ad85bbbac46fbd5860" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "9783263798cc4b25a7a122df318a57f8" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "824610f03ea3492a9d4b6a52f9e36a28", + "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.Vector1MaterialSlot", + "m_ObjectId": "82d2d8bce5af41ad85bbbac46fbd5860", + "m_Id": 0, + "m_DisplayName": "Detail Normal Map Scale", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInTarget", + "m_ObjectId": "840c4b73cabf4489982965630032a419", + "m_ActiveSubTarget": { + "m_Id": "300cf1de2b6f4a5a8d350ea32a6575dc" + }, + "m_AllowMaterialOverride": true, + "m_SurfaceType": 0, + "m_ZWriteControl": 0, + "m_ZTestMode": 4, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CustomEditorGUI": "" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "842d765c848140099b05b29b58cf3fe7", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "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", + "m_ObjectId": "857db9a72e0843eda0356895111ba521", + "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.Vector1MaterialSlot", + "m_ObjectId": "888af6a388dc476c8685ccf44bff5596", + "m_Id": 0, + "m_DisplayName": "Out", + "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.Rendering.HighDefinition.ShaderGraph.HDTarget", + "m_ObjectId": "88f2fa4395e14c27b2c4cd4c39f4a557", + "m_ActiveSubTarget": { + "m_Id": "db66042a72e84f748d977f37482b94da" + }, + "m_Datas": [ + { + "m_Id": "4c3410a856f64b1891067d0733654e57" + }, + { + "m_Id": "a6c8f4439ed748e28b75ed4abb646670" + }, + { + "m_Id": "e4ab9c6a4dc244088f8d38f2fdfd371d" + }, + { + "m_Id": "5fc050c17ffe49f6ba85bbda45c46f59" + } + ], + "m_CustomEditorGUI": "", + "m_SupportVFX": false, + "m_SupportComputeForVertexSetup": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "89b8f3104f6f45b7a09de6483d127676", + "m_Guid": { + "m_GuidSerialized": "4e9d075f-76cf-4d21-a25f-8b252bfb9697" + }, + "m_Name": "Emission Map", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Emission Map", + "m_DefaultReferenceName": "_Emission_Map", + "m_OverrideReferenceName": "_EmissionMap", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "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.GroupData", + "m_ObjectId": "8c0e1cebdf4b4a90ae93ed60f9876e72", + "m_Title": "Occlusion", + "m_Position": { + "x": -876.0, + "y": 1328.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "8d46109eb9204186933dd03b62aa5318", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 12.000020027160645, + "y": 272.0, + "width": 199.99998474121095, + "height": 41.0 + } + }, + "m_Slots": [ + { + "m_Id": "3a602edeb2024d569404597b3371b727" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "8dbd81486d314bc690d94dc6281fe289", + "m_Title": "Smoothness", + "m_Position": { + "x": -1159.0, + "y": 591.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "8edf9697a6d142868b9d0920b81bc661", + "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.BlockNode", + "m_ObjectId": "8f60dac23b7b4dc19e74482e8ab0d940", + "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": "ca853667bae249479c020428e08b741e" + } + ], + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "90287b4a7df746ada6dfe95f76af25de", + "m_Id": 1, + "m_DisplayName": "True", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "True", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "92e728130d914968ba764a679cfeb1e7", + "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.PropertyNode", + "m_ObjectId": "9375c82739f44b6bbdb78d0a74151a34", + "m_Group": { + "m_Id": "cebae50b11e94e838b6e7a5a61d4f2e8" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2005.000244140625, + "y": 531.0000610351563, + "width": 150.0, + "height": 33.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "030b46cbb68048eeba105ae309540d9f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "a9ae7d9f9bb342668379f294b997a024" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "9417f7fcc072407fa41ae71034a5f4c3", + "m_Group": { + "m_Id": "b8b5e48f3c87435c8fe78bddf85831ee" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1453.9998779296875, + "y": 24.000051498413087, + "width": 199.0, + "height": 33.99998474121094 + } + }, + "m_Slots": [ + { + "m_Id": "519093d5818a40cb80eb9afd313dabb2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "988d3fda4b75435b9f2630355731fbc7" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "946f784fadc0474db2247d51607a62e5", + "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.BlockNode", + "m_ObjectId": "95f3657663484b8e990cd7400d169b39", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.AlphaClipThreshold", + "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": "c2a367ea37dd46e6a9432b098707f847" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "9783263798cc4b25a7a122df318a57f8", + "m_Guid": { + "m_GuidSerialized": "05535f00-ba18-4a28-96e8-e5d6e974b753" + }, + "m_Name": "Detail Normal Map Scale", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Detail Normal Map Scale", + "m_DefaultReferenceName": "_Detail_Normal_Map_Scale", + "m_OverrideReferenceName": "_DetailNormalMapScale", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 2.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty", + "m_ObjectId": "988d3fda4b75435b9f2630355731fbc7", + "m_Guid": { + "m_GuidSerialized": "918837a0-42bc-444d-806b-abd320b50a07" + }, + "m_Name": "Normal Flip Back Faces", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Normal Flip Back Faces", + "m_DefaultReferenceName": "_Normal_Flip_Back_Faces", + "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": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "99ac011d37c84d85aedf16ed6c010acb", + "m_Id": 0, + "m_DisplayName": "Smoothness From Albedo", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "99aea177043447d3adf16a8476eb38aa", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Smoothness", + "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": "6b68d6d0d36541818ea5cc8c6aa6d27c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Smoothness" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "99bbd3725e40426a810b5a8087433abe", + "m_Id": 0, + "m_DisplayName": "Bent Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BentNormal", + "m_StageCapability": 2, + "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": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "9b426de8795444ab806ff53a0526bdba", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "9b7a84a37f604649918c5d605f50bfcb", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "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", + "m_ObjectId": "9b994b58b2c445d38d601439bc7bfec2", + "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.Texture2DMaterialSlot", + "m_ObjectId": "9bb08656de9a41bbac558c1aa2b01540", + "m_Id": 0, + "m_DisplayName": "Detail Normal Map", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "9c9ba87b32ad441dba6e9b9f11388d9b", + "m_Group": { + "m_Id": "40a7b9274eb447a48d0f1e31def6ba52" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2869.000244140625, + "y": 446.0000915527344, + "width": 147.0, + "height": 33.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "5d992a286f434f3bbc7331596e782159" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "a6514c562dcf45fb942466fd9b4581a0" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "9d00fbf2976e40adb8d8be2e67781d7b", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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.Internal.Texture2DShaderProperty", + "m_ObjectId": "9dcbe1b467374735bd6902ef8a4b5fea", + "m_Guid": { + "m_GuidSerialized": "b4fef325-83c4-42aa-aa65-98d4472bcce3" + }, + "m_Name": "Detail Albedo Map", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Detail Albedo Map", + "m_DefaultReferenceName": "_Detail_Albedo_Map", + "m_OverrideReferenceName": "_DetailAlbedoMap", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": true, + "m_Modifiable": true, + "m_DefaultType": 4 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "9ddc490d58d443a699694376870e4007", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1858.000244140625, + "y": -754.0, + "width": 130.0, + "height": 117.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "12099210038e4184bdf161275f73e17e" + }, + { + "m_Id": "8edf9697a6d142868b9d0920b81bc661" + }, + { + "m_Id": "ce2504f5970a4304b7030dd6c14d2981" + } + ], + "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.Texture2DInputMaterialSlot", + "m_ObjectId": "9f5fdd1cfbc148498541990fb2973dc1", + "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.Vector3MaterialSlot", + "m_ObjectId": "9f92af83b5ad4eb6840f7858e51e9736", + "m_Id": -457410494, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "_Emission", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "a0895cb3da544fd8a9fd0c98afed3d53", + "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.Vector3MaterialSlot", + "m_ObjectId": "a0d211ee5b864f99bafe73484c82b392", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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.Texture2DInputMaterialSlot", + "m_ObjectId": "a1ad125b194f4e8aba9bf4c859d9d3fd", + "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.OneMinusNode", + "m_ObjectId": "a331dade344845c389375e2828f69a68", + "m_Group": { + "m_Id": "cd446e3cb81b417a8bd2dc2ccafcd42e" + }, + "m_Name": "One Minus", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2480.000244140625, + "y": -292.00006103515627, + "width": 128.0, + "height": 94.00009155273438 + } + }, + "m_Slots": [ + { + "m_Id": "ec6b6e488bcf422cb3bef77bf3645cd8" + }, + { + "m_Id": "7224ddffb24f4e5ea31957e3a09bdc45" + } + ], + "synonyms": [ + "complement", + "invert", + "opposite" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "a45878eacd044a68aae28771783def4f", + "m_Guid": { + "m_GuidSerialized": "abea17b7-9c12-4d45-b46e-46ecca387bb5" + }, + "m_Name": "Occlusion Map", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Occlusion Map", + "m_DefaultReferenceName": "_Occlusion_Map", + "m_OverrideReferenceName": "_OcclusionMap", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "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.MultiplyNode", + "m_ObjectId": "a4dd0c6239aa478ba424219e8584a2ec", + "m_Group": { + "m_Id": "5a905965f0d64818bbfb2d4f869e738b" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -663.0000610351563, + "y": 1031.0001220703125, + "width": 130.0, + "height": 118.0 + } + }, + "m_Slots": [ + { + "m_Id": "c3238e33047441e2ba186d03e7820e09" + }, + { + "m_Id": "32eaf090c3674c5ebb4292090b0c710b" + }, + { + "m_Id": "bef11b50009a4bac8221b0a22e26289a" + } + ], + "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.DynamicValueMaterialSlot", + "m_ObjectId": "a4e6f6f87e714c15927b5a73283680bf", + "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.Internal.Texture2DShaderProperty", + "m_ObjectId": "a6514c562dcf45fb942466fd9b4581a0", + "m_Guid": { + "m_GuidSerialized": "dc25cb40-caa0-4462-844e-470a34ea682f" + }, + "m_Name": "Normal Map", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Normal Map", + "m_DefaultReferenceName": "_Normal_Map", + "m_OverrideReferenceName": "_BumpMap", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": true, + "m_Modifiable": true, + "m_DefaultType": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData", + "m_ObjectId": "a6c8f4439ed748e28b75ed4abb646670", + "m_Distortion": false, + "m_DistortionMode": 0, + "m_DistortionDepthTest": true, + "m_AddPrecomputedVelocity": false, + "m_TransparentWritesMotionVec": false, + "m_DepthOffset": false, + "m_ConservativeDepthOffset": false, + "m_TransparencyFog": true, + "m_AlphaTestShadow": false, + "m_BackThenFrontRendering": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "a6f52d99a14d4561b749eaa8034b8dee", + "m_Id": 0, + "m_DisplayName": "Detail Mask", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "a9ae7d9f9bb342668379f294b997a024", + "m_Guid": { + "m_GuidSerialized": "f9ba635a-eee1-4036-8914-6c540b5c8dce" + }, + "m_Name": "Metallic Map", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Metallic Map", + "m_DefaultReferenceName": "_Metallic_Map", + "m_OverrideReferenceName": "_MetallicGlossMap", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "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.Vector1MaterialSlot", + "m_ObjectId": "aa15bd26d8304da9b70db7e98b3c0e19", + "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.Vector3MaterialSlot", + "m_ObjectId": "aa6972e57da74f35acd5277428223e4f", + "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": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.IsFrontFaceNode", + "m_ObjectId": "ab6a9bc49dfd4a0190d46c6ab2cc20fe", + "m_Group": { + "m_Id": "b8b5e48f3c87435c8fe78bddf85831ee" + }, + "m_Name": "Is Front Face", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1506.9998779296875, + "y": -52.99998474121094, + "width": 120.0, + "height": 77.00003814697266 + } + }, + "m_Slots": [ + { + "m_Id": "5d7640497f27495a9d3b18f11d1a8331" + } + ], + "synonyms": [ + "face", + "side" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "abb0d78c509d4e99b94f76bc161cbfbf", + "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.Vector4MaterialSlot", + "m_ObjectId": "ad135feac44b4a9092c1bc6a399986ad", + "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": "ad18512df63043deb798f7e281e57691", + "m_Id": 3, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "adb53098703d462f9d82c495cfcb09e9", + "m_Title": "Apply Normal Detail", + "m_Position": { + "x": -2892.0, + "y": 52.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "af5686ba559143aaa6a6d1411da15050", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "b0524f4fe77047f0816faf49fc8f18bb", + "m_Id": 3, + "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.DynamicValueMaterialSlot", + "m_ObjectId": "b07e5f27fa6f45438a017da790f26d52", + "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": "b1247c6500664956afd5a04f39369d7f", + "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": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "b20ecbb6b51842189aa09a748f852aac", + "m_Guid": { + "m_GuidSerialized": "8178a468-7c5b-4177-9ef1-c5048926332c" + }, + "m_Name": "Metallic", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Metallic", + "m_DefaultReferenceName": "_Metallic", + "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": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "b2b8b9f6255d4b348f0a6e893e918aa2", + "m_Group": { + "m_Id": "f0446934f1f84b8480c20f72122e30f3" + }, + "m_Name": "Split", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -1139.9998779296875, + "y": -402.0, + "width": 119.0, + "height": 77.0 + } + }, + "m_Slots": [ + { + "m_Id": "02617dfed10a46669baf63b3ac51be54" + }, + { + "m_Id": "2209a6af91524b00bee1b03dcd2a8e7c" + }, + { + "m_Id": "5f36a9459b9e4861ad3a4ae75d144e06" + }, + { + "m_Id": "ad18512df63043deb798f7e281e57691" + }, + { + "m_Id": "15149423a05142f6ae480acabae805fa" + } + ], + "synonyms": [ + "separate" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b2e183de88cd4dc3a4cfb3f6f22a122c", + "m_Id": 0, + "m_DisplayName": "Ambient Occlusion", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Occlusion", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "b42e2178393d4f398283d13201a86a3b", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "b43a641d3cae4fbba6c9139f6343e467", + "m_Id": 2, + "m_DisplayName": "False", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "False", + "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.RedirectNodeData", + "m_ObjectId": "b4f0174124dc498db636372a66063897", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2054.000244140625, + "y": 263.9999694824219, + "width": 56.0, + "height": 24.000091552734376 + } + }, + "m_Slots": [ + { + "m_Id": "9b7a84a37f604649918c5d605f50bfcb" + }, + { + "m_Id": "6d3fe6dc716a4ba3b25f865ccc312268" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "b6fb41ea27c64fb79b77d4cecf118640", + "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.SampleTexture2DNode", + "m_ObjectId": "b774027047014045a64b4163e87330c9", + "m_Group": { + "m_Id": "8c0e1cebdf4b4a90ae93ed60f9876e72" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -666.0000610351563, + "y": 1387.0001220703125, + "width": 156.00003051757813, + "height": 155.0 + } + }, + "m_Slots": [ + { + "m_Id": "d718ce0dfe504a9d8517339ac0f8ff45" + }, + { + "m_Id": "b1247c6500664956afd5a04f39369d7f" + }, + { + "m_Id": "e2d4e47a62cd4e5d9c0299785a6a9a4c" + }, + { + "m_Id": "857db9a72e0843eda0356895111ba521" + }, + { + "m_Id": "41aec16a03e94dd4932f5b7b7ca29ad0" + }, + { + "m_Id": "a1ad125b194f4e8aba9bf4c859d9d3fd" + }, + { + "m_Id": "3c4a010407374c46a20b6f57f475bb4f" + }, + { + "m_Id": "b93b8d143ae54e96b285a52a0ab11192" + } + ], + "synonyms": [ + "tex2d" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "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.Vector1MaterialSlot", + "m_ObjectId": "b792fa00cc2943f988eef88091fc962f", + "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.GroupData", + "m_ObjectId": "b8b5e48f3c87435c8fe78bddf85831ee", + "m_Title": "Flip Normal", + "m_Position": { + "x": -1532.0, + "y": -111.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "b93b8d143ae54e96b285a52a0ab11192", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "b9c856725396493d9bdb07bfabb1bf4f", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "ba7ce452f5af4d5d83da6be19e04ab1b", + "m_Id": 0, + "m_DisplayName": "Specular Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Specular", + "m_StageCapability": 2, + "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_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "bc13f29ae89348fd880b7361cff27f24", + "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": "c736625d58fc43b9b19c035fe6f37dcd" + } + ], + "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.Vector1MaterialSlot", + "m_ObjectId": "bc38cd4f0b6b4002aeb9d47ea7359bf4", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "bd5fb7d289e643638297678200aa9587", + "m_Id": 3, + "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.Vector1MaterialSlot", + "m_ObjectId": "be8214b41a724c1b97fdc6315992cdea", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "bef11b50009a4bac8221b0a22e26289a", + "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.PropertyNode", + "m_ObjectId": "c0309b0ff34244ea97160fe5fc583e46", + "m_Group": { + "m_Id": "8c0e1cebdf4b4a90ae93ed60f9876e72" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -711.0, + "y": 1542.0001220703125, + "width": 126.99993896484375, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "5972e9a9acc849b3a192e51466f53583" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "d9463d7b8c064ec89cf8a937bd5a27c5" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c078413bcc9c4a009c89c0d60c650582", + "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.PropertyNode", + "m_ObjectId": "c0db1c57607b4218b9fe4a494acc32bd", + "m_Group": { + "m_Id": "8dbd81486d314bc690d94dc6281fe289" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1134.0, + "y": 690.0, + "width": 211.99993896484376, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "99ac011d37c84d85aedf16ed6c010acb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "6653a111fd9e437d8669bdd9670b0bcd" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "c14a8937cbd94b5abf1ab7c367caddcb", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BentNormal", + "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": "99bbd3725e40426a810b5a8087433abe" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BentNormal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c2a367ea37dd46e6a9432b098707f847", + "m_Id": 0, + "m_DisplayName": "Alpha Clip Threshold", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "AlphaClipThreshold", + "m_StageCapability": 2, + "m_Value": 0.5, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c30d61a20c864d8fbebf20c9a6285982", + "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.DynamicValueMaterialSlot", + "m_ObjectId": "c3238e33047441e2ba186d03e7820e09", + "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.BooleanMaterialSlot", + "m_ObjectId": "c37bf412fa78488b83b00b597bea9648", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "c470a679d8084e2d98f9f97fb350661b", + "m_Group": { + "m_Id": "8dbd81486d314bc690d94dc6281fe289" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -700.0, + "y": 650.0000610351563, + "width": 126.0, + "height": 117.99993896484375 + } + }, + "m_Slots": [ + { + "m_Id": "e53736c8a02a4bbf916e9fdb2518a12f" + }, + { + "m_Id": "b07e5f27fa6f45438a017da790f26d52" + }, + { + "m_Id": "d4fb460b6cbc4637bad16e493bdf03fb" + } + ], + "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.NormalStrengthNode", + "m_ObjectId": "c493086a18fd4d91af06067576d3b393", + "m_Group": { + "m_Id": "40a7b9274eb447a48d0f1e31def6ba52" + }, + "m_Name": "Normal Strength", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2508.000244140625, + "y": 406.9999694824219, + "width": 166.0, + "height": 118.00021362304688 + } + }, + "m_Slots": [ + { + "m_Id": "9d00fbf2976e40adb8d8be2e67781d7b" + }, + { + "m_Id": "80c8e146a8eb4ac9a8b2b1d35cc5c629" + }, + { + "m_Id": "09330e46b8a7473c93eca4e14fb9ac28" + } + ], + "synonyms": [ + "intensity" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "c4963951ce554480911fd26643c8049d", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Lerp", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1969.0003662109375, + "y": 112.99996948242188, + "width": 130.0001220703125, + "height": 142.00003051757813 + } + }, + "m_Slots": [ + { + "m_Id": "eb5b6b79fcb9472ea3a520becab5351a" + }, + { + "m_Id": "0e139607c05b4bb8935e59a8ddfc2a34" + }, + { + "m_Id": "3b1a4698236b4d14af95e76b8054c1fe" + }, + { + "m_Id": "4df7031916b8431180ed5ee67882c193" + } + ], + "synonyms": [ + "mix", + "blend", + "linear interpolate" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "c59ca170ab6a447395283b3d809130c7", + "m_Id": 0, + "m_DisplayName": "Predicate", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Predicate", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "c6551ed58a3341e9b9c79a2546ef66f2", + "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.ColorRGBMaterialSlot", + "m_ObjectId": "c736625d58fc43b9b19c035fe6f37dcd", + "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": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "c76502e563064684b6843ddfd14da25a", + "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": "b6fb41ea27c64fb79b77d4cecf118640" + } + ], + "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.MultiplyNode", + "m_ObjectId": "c8586dfffdde4291b53fea53da86f2fb", + "m_Group": { + "m_Id": "7844c309071b4f42b7329805070ce54e" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2056.00048828125, + "y": -632.0000610351563, + "width": 126.000244140625, + "height": 118.00006103515625 + } + }, + "m_Slots": [ + { + "m_Id": "16bec3f0eed24305afcdbdf9549fbd2c" + }, + { + "m_Id": "abb0d78c509d4e99b94f76bc161cbfbf" + }, + { + "m_Id": "4d122725ff954eaca698dd559a56fbad" + } + ], + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "c8d114c11ddd4984849c196a2e265810", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "c9d5678677584ccb8b641247cc2366ab", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "ca182aad34fe4f0799d1c040f65d652f", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.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.SampleTexture2DNode", + "m_ObjectId": "ca2a1fd237384498b16fa84ee5965ae0", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -2687.00048828125, + "y": 112.99996948242188, + "width": 180.000244140625, + "height": 154.99996948242188 + } + }, + "m_Slots": [ + { + "m_Id": "5a8a475ff31e41249e61d6d446f7045d" + }, + { + "m_Id": "946f784fadc0474db2247d51607a62e5" + }, + { + "m_Id": "43cc4527815f4d1599563c230ac464b7" + }, + { + "m_Id": "6a3b470a319e4621b9d39ed2dde90105" + }, + { + "m_Id": "178daa7b355442e19e7d9f8ae47d73ff" + }, + { + "m_Id": "7abb9cd41a5547868cdd6e7f4ca18168" + }, + { + "m_Id": "9b426de8795444ab806ff53a0526bdba" + }, + { + "m_Id": "d2c603d505484d34a8cb1d68e0b5cf12" + } + ], + "synonyms": [ + "tex2d" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 1, + "m_NormalMapSpace": 0, + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "ca4cc91850cf490387cae299ff400e85", + "m_Id": 0, + "m_DisplayName": "Metallic", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Metallic", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "ca853667bae249479c020428e08b741e", + "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.Vector1MaterialSlot", + "m_ObjectId": "cc02227c38dd474882ab79ab5e96c1b8", + "m_Id": 0, + "m_DisplayName": "Alpha Cutoff", + "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.CategoryData", + "m_ObjectId": "ccbb3780be7a4f95a0e4097ce1deb474", + "m_Name": "Occlusion", + "m_ChildObjectList": [ + { + "m_Id": "d9463d7b8c064ec89cf8a937bd5a27c5" + }, + { + "m_Id": "a45878eacd044a68aae28771783def4f" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "cd0e1f20815e4e1684051141b3f87a4c", + "m_Group": { + "m_Id": "cd446e3cb81b417a8bd2dc2ccafcd42e" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2865.000244140625, + "y": -251.99996948242188, + "width": 145.0, + "height": 33.99989318847656 + } + }, + "m_Slots": [ + { + "m_Id": "a6f52d99a14d4561b749eaa8034b8dee" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "d26edc375b4c4243938ad5141a4772f2" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "cd446e3cb81b417a8bd2dc2ccafcd42e", + "m_Title": "Detail Mask", + "m_Position": { + "x": -2890.0, + "y": -350.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "ce2504f5970a4304b7030dd6c14d2981", + "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.GroupData", + "m_ObjectId": "cebae50b11e94e838b6e7a5a61d4f2e8", + "m_Title": "Metallic", + "m_Position": { + "x": -2030.0, + "y": 432.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "cede2400ec2c454d8b3f440251012d0a", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "cfe41b26d48e41ccb8ada17b080239e2", + "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", + "m_ObjectId": "d00e7c0a86c84976bfe67bc5d7e65c3a", + "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.SamplerStateMaterialSlot", + "m_ObjectId": "d0cec5fd4f9545178c523d7bf5de5a5c", + "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.BlockNode", + "m_ObjectId": "d0d2e0ffa03f4e34b9eaf8227f527aea", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.NormalTS", + "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": "2a1c3313d7c347198330c12bb12e3699" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.NormalTS" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "d26edc375b4c4243938ad5141a4772f2", + "m_Guid": { + "m_GuidSerialized": "2bad0a19-a55c-4c54-ad62-b79f3130bc03" + }, + "m_Name": "Detail Mask", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Detail Mask", + "m_DefaultReferenceName": "_Detail_Mask", + "m_OverrideReferenceName": "_DetailMask", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": true, + "m_Modifiable": true, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "d29cc0a358fe4e11adf98951bf90803e", + "m_Guid": { + "m_GuidSerialized": "47e18621-9ab3-4434-bbd1-22efa52e1da8" + }, + "m_Name": "Specular", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Specular", + "m_DefaultReferenceName": "_Specular", + "m_OverrideReferenceName": "_SpecularColor", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "r": 0.19999989867210389, + "g": 0.19999989867210389, + "b": 0.19999989867210389, + "a": 0.0 + }, + "isMainColor": false, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "d2c603d505484d34a8cb1d68e0b5cf12", + "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.BlockNode", + "m_ObjectId": "d4a644e38a094910857c3832321b616e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Occlusion", + "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": "b2e183de88cd4dc3a4cfb3f6f22a122c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Occlusion" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "d4fb460b6cbc4637bad16e493bdf03fb", + "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": "d5e45089bcab4d2d822fb10275983e32", + "m_Group": { + "m_Id": "40a7b9274eb447a48d0f1e31def6ba52" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -2709.000244140625, + "y": 406.9999694824219, + "width": 180.0, + "height": 155.00009155273438 + } + }, + "m_Slots": [ + { + "m_Id": "9b994b58b2c445d38d601439bc7bfec2" + }, + { + "m_Id": "b792fa00cc2943f988eef88091fc962f" + }, + { + "m_Id": "79bc26ac5b6c4941a175a5f220ac954d" + }, + { + "m_Id": "c30d61a20c864d8fbebf20c9a6285982" + }, + { + "m_Id": "0f1f525eddfa43a5a87310c4243524be" + }, + { + "m_Id": "f9b3f03a2edc4eef9a2e7cd7a3ecfb52" + }, + { + "m_Id": "b42e2178393d4f398283d13201a86a3b" + }, + { + "m_Id": "e851a24e24e840be9399463cc00aff83" + } + ], + "synonyms": [ + "tex2d" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 1, + "m_NormalMapSpace": 0, + "m_EnableGlobalMipBias": true, + "m_MipSamplingMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d632b87ac84b4359856a748b3cce4dfd", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 1.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "d717b908373c4a72854e9002cf1e059c", + "m_Group": { + "m_Id": "adb53098703d462f9d82c495cfcb09e9" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2867.000244140625, + "y": 153.00006103515626, + "width": 179.999755859375, + "height": 33.99989318847656 + } + }, + "m_Slots": [ + { + "m_Id": "9bb08656de9a41bbac558c1aa2b01540" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "512fb8b4826e48fab65b83b8744dcc78" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "d718ce0dfe504a9d8517339ac0f8ff45", + "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": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "d9463d7b8c064ec89cf8a937bd5a27c5", + "m_Guid": { + "m_GuidSerialized": "4a077f11-71c3-4f7e-9abf-ca71239f33c8" + }, + "m_Name": "Occlusion", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Occlusion", + "m_DefaultReferenceName": "_Occlusion", + "m_OverrideReferenceName": "_OcclusionStrength", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDLitSubTarget", + "m_ObjectId": "db66042a72e84f748d977f37482b94da" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "dca5f61b8f7345768c56decca584a2d3", + "m_Id": 0, + "m_DisplayName": "Color Map", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "dd87e9b0a4f1465281871a4fbe972488", + "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": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "e1260fde245f4582a46223b43a512871", + "m_Guid": { + "m_GuidSerialized": "63ba6aa1-c8e7-47a0-84aa-2187571f561a" + }, + "m_Name": "Emission", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Emission", + "m_DefaultReferenceName": "_Emission", + "m_OverrideReferenceName": "_EmissiveColor", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 1, + "m_Hidden": false, + "m_Value": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "a": 0.0 + }, + "isMainColor": false, + "m_ColorMode": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e2d4e47a62cd4e5d9c0299785a6a9a4c", + "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": "e2ddf66d492a4aa19a63c60af0009914", + "m_Datas": [], + "m_ActiveSubTarget": { + "m_Id": "53055d2fa81b42c99a7a251de6391a7d" + }, + "m_AllowMaterialOverride": true, + "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.PropertyNode", + "m_ObjectId": "e3238989e2c24727be4ff3a509e22b32", + "m_Group": { + "m_Id": "75ae407f7549455383d1c32d8989f303" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2207.000244140625, + "y": -228.0, + "width": 138.0, + "height": 34.000030517578128 + } + }, + "m_Slots": [ + { + "m_Id": "dca5f61b8f7345768c56decca584a2d3" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "f9d39431664f4db282bf85cda7330e04" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData", + "m_ObjectId": "e4ab9c6a4dc244088f8d38f2fdfd371d", + "m_NormalDropOffSpace": 0, + "m_BlendPreserveSpecular": true, + "m_ReceiveDecals": true, + "m_ReceiveSSR": true, + "m_ReceiveSSRTransparent": false, + "m_SpecularAA": false, + "m_SpecularOcclusionMode": 1, + "m_OverrideBakedGI": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "e53736c8a02a4bbf916e9fdb2518a12f", + "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.SampleTexture2DNode", + "m_ObjectId": "e556d99ab36040ee8da300db433d398a", + "m_Group": { + "m_Id": "cd446e3cb81b417a8bd2dc2ccafcd42e" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -2706.00048828125, + "y": -292.00006103515627, + "width": 156.000244140625, + "height": 154.99998474121095 + } + }, + "m_Slots": [ + { + "m_Id": "465c5643e0c347719108034ea60221ec" + }, + { + "m_Id": "22b0b0a6f9cf42c2ac76aaea991d86c5" + }, + { + "m_Id": "54306c72430547cbace417b315aee172" + }, + { + "m_Id": "69589060132b47bc906b6b537466b085" + }, + { + "m_Id": "d00e7c0a86c84976bfe67bc5d7e65c3a" + }, + { + "m_Id": "af5686ba559143aaa6a6d1411da15050" + }, + { + "m_Id": "824610f03ea3492a9d4b6a52f9e36a28" + }, + { + "m_Id": "c6551ed58a3341e9b9c79a2546ef66f2" + } + ], + "synonyms": [ + "tex2d" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "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.SamplerStateMaterialSlot", + "m_ObjectId": "e851a24e24e840be9399463cc00aff83", + "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.UVMaterialSlot", + "m_ObjectId": "e87e64d077ad46dc9db7a2ae96d5f6c9", + "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.CategoryData", + "m_ObjectId": "e8dc3ed688a74734819643d0041f5e84", + "m_Name": "", + "m_ChildObjectList": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "eb207ee80e7a43fb9485b15792cc0b42", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Metallic", + "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": "ca4cc91850cf490387cae299ff400e85" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Metallic" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "eb5b6b79fcb9472ea3a520becab5351a", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "eb715a1cbee24abca45f0b829d21fb57", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "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.TangentMaterialSlot", + "m_ObjectId": "ec59d9fdb4e049e4954372bf22e1da8d", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "ec6b6e488bcf422cb3bef77bf3645cd8", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "eca3ea913291477491bbedf7be0f7cf0", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "ed53035c29c048458068300e1fd0cd27", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "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", + "m_ObjectId": "ed64aea815874cefa9b56f70b2aa8f21", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "ed9c10e3f10d4fa5bcdbef8bb8023ffb", + "m_Id": 1, + "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.UVMaterialSlot", + "m_ObjectId": "edb318cc9df14d5dbdc71f78dbaac9b3", + "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": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "f03ed8b9043f469381375a4ce7291134", + "m_Guid": { + "m_GuidSerialized": "4f93283b-e2b1-422c-8873-a57874500dad" + }, + "m_Name": "Detail Albedo Map Scale", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Detail Albedo Map Scale", + "m_DefaultReferenceName": "_Detail_Albedo_Map_Scale", + "m_OverrideReferenceName": "_DetailAlbedoMapScale", + "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.GroupData", + "m_ObjectId": "f0446934f1f84b8480c20f72122e30f3", + "m_Title": "Alpha", + "m_Position": { + "x": -1165.0, + "y": -460.5 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f165143c0ab24ffaa8ae35cb701930cd", + "m_Id": 0, + "m_DisplayName": "Detail Albedo Map Scale", + "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.Vector1MaterialSlot", + "m_ObjectId": "f21103cd07f74ccea687ed97d7b20650", + "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", + "m_ObjectId": "f31b7daaa9204711a7fed011b26dbc8a", + "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": "ec59d9fdb4e049e4954372bf22e1da8d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f3d07d2931b6413b94adab5997472567", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "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.PropertyNode", + "m_ObjectId": "f5d0d252a08b45c68d2737a801473424", + "m_Group": { + "m_Id": "5a905965f0d64818bbfb2d4f869e738b" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1052.0, + "y": 1070.0, + "width": 155.99993896484376, + "height": 34.0001220703125 + } + }, + "m_Slots": [ + { + "m_Id": "6f3b61224b9442079ae7397ab5ac3a3b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "89b8f3104f6f45b7a09de6483d127676" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "f889217dee1146989a34f29e5a436a20", + "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.Texture2DInputMaterialSlot", + "m_ObjectId": "f9b3f03a2edc4eef9a2e7cd7a3ecfb52", + "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": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "f9d39431664f4db282bf85cda7330e04", + "m_Guid": { + "m_GuidSerialized": "5a4a57c8-ebcb-4526-b253-a7ff1b3fa66e" + }, + "m_Name": "Color Map", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Color Map", + "m_DefaultReferenceName": "_Color_Map", + "m_OverrideReferenceName": "_MainTex", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "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.SampleTexture2DNode", + "m_ObjectId": "fa01c85ba84f46ad8526a72cf40096aa", + "m_Group": { + "m_Id": "5a905965f0d64818bbfb2d4f869e738b" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": false, + "m_Position": { + "serializedVersion": "2", + "x": -865.0000610351563, + "y": 1031.0001220703125, + "width": 179.99993896484376, + "height": 155.0 + } + }, + "m_Slots": [ + { + "m_Id": "ad135feac44b4a9092c1bc6a399986ad" + }, + { + "m_Id": "dd87e9b0a4f1465281871a4fbe972488" + }, + { + "m_Id": "30ea8aa1acd74238908b99818ba782cc" + }, + { + "m_Id": "579cfd2ccc024a8ca575e17769040c93" + }, + { + "m_Id": "1e09e77599594ad1a7b6189f70f9dd97" + }, + { + "m_Id": "46f3e25e0a2b43ed82ae5839c10bc783" + }, + { + "m_Id": "edb318cc9df14d5dbdc71f78dbaac9b3" + }, + { + "m_Id": "2135c3468ed047baa13605f17d4d9f4e" + } + ], + "synonyms": [ + "tex2d" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "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.BlockNode", + "m_ObjectId": "fca2a686d3fd4b588cde3b54823bb062", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Emission", + "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": "78dec7a33602431b8db670856518614e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Emission" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "fd2e5f1ae08c4f45b0c795fb9673845c", + "m_Guid": { + "m_GuidSerialized": "b31689b2-87ce-478c-a252-517feeea1f75" + }, + "m_Name": "Alpha Cutoff", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Alpha Cutoff", + "m_DefaultReferenceName": "_Alpha_Cutoff", + "m_OverrideReferenceName": "_Cutoff", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 2, + "m_Hidden": false, + "m_Value": 0.5, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + diff --git a/Packages/com.waveharmonic.crest/Shared/Shaders/Lit.shadergraph.meta b/Packages/com.waveharmonic.crest/Shared/Shaders/Lit.shadergraph.meta new file mode 100644 index 0000000..52c59f4 --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Shaders/Lit.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 717b077102735454887bdc5c26938762 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/Packages/com.waveharmonic.crest/Shared/Textures.meta b/Packages/com.waveharmonic.crest/Shared/Textures.meta new file mode 100644 index 0000000..89cf33c --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 345057e2fcf864bb3aaf2d8e106a6da5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Textures/Red.png b/Packages/com.waveharmonic.crest/Shared/Textures/Red.png new file mode 100644 index 0000000..54bb92e Binary files /dev/null and b/Packages/com.waveharmonic.crest/Shared/Textures/Red.png differ diff --git a/Packages/com.waveharmonic.crest/Shared/Textures/Red.png.meta b/Packages/com.waveharmonic.crest/Shared/Textures/Red.png.meta new file mode 100644 index 0000000..a367c1a --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Textures/Red.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: b922f588948724e039eadd46288af89d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/Shared/Textures/Skybox.hdr b/Packages/com.waveharmonic.crest/Shared/Textures/Skybox.hdr new file mode 100644 index 0000000..31843fc Binary files /dev/null and b/Packages/com.waveharmonic.crest/Shared/Textures/Skybox.hdr differ diff --git a/Packages/com.waveharmonic.crest/Shared/Textures/Skybox.hdr.meta b/Packages/com.waveharmonic.crest/Shared/Textures/Skybox.hdr.meta new file mode 100644 index 0000000..45a821f --- /dev/null +++ b/Packages/com.waveharmonic.crest/Shared/Textures/Skybox.hdr.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: b04e3fd8ac149468c93ae5deec99b0d7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 2 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/ThirdPartyNotices.md b/Packages/com.waveharmonic.crest/ThirdPartyNotices.md new file mode 100644 index 0000000..c236f5d --- /dev/null +++ b/Packages/com.waveharmonic.crest/ThirdPartyNotices.md @@ -0,0 +1,18 @@ +# THIRD PARTY NOTICES +This Third Party Notices file provides notices and information about the third party code or other materials listed below ("Third Party Software") which are included with the Software. Wave Harmonic reserves all other rights to the Third Party Software not expressly granted by Wave Harmonic, whether by implication, estoppel or otherwise. The notices and licenses below are provided for informational purposes only. + +For more information please refer to: + +https://support.unity3d.com/hc/en-us/articles/360013314071-Am-I-allowed-to-use-content-that-has-a-license-which-states-I-am-allowed-to-resell-or-distribute-it- + +++++++++++++++++++++++++++++++ + +Crest Ocean System (for built-in render pipeline) | MIT License +Copyright (c) 2019 Wave Harmonic and contributors + +++++++++++++++++++++++++++++++ + +Quality hashes collection | MIT License +Copyright (c) 2018 nimitz (twitter: @stormoid) + +++++++++++++++++++++++++++++++ diff --git a/Packages/com.waveharmonic.crest/ThirdPartyNotices.md.meta b/Packages/com.waveharmonic.crest/ThirdPartyNotices.md.meta new file mode 100644 index 0000000..2a06434 --- /dev/null +++ b/Packages/com.waveharmonic.crest/ThirdPartyNotices.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 09672d425b0494ba580cadc6191f0904 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.waveharmonic.crest/package.json b/Packages/com.waveharmonic.crest/package.json new file mode 100644 index 0000000..4e7bbcd --- /dev/null +++ b/Packages/com.waveharmonic.crest/package.json @@ -0,0 +1,48 @@ +{ + "name": "com.waveharmonic.crest", + "version": "5.6.3", + "displayName": "Crest", + "description": "An advanced water system for Unity.", + "unity": "2022.3", + "unityRelease": "21f1", + "hideInEditor": false, + "documentationUrl": "https://docs.crest.waveharmonic.com/About/Introduction.html", + "changelogUrl": "https://docs.crest.waveharmonic.com/About/History.html", + "author": { + "name": "Wave Harmonic", + "email": "support@waveharmonic.com", + "url": "https://waveharmonic.com/" + }, + "keywords": [], + "samples": [ + { + "displayName": "Main", + "description": "A simple sample scene", + "path": "Samples~/Main" + }, + { + "displayName": "Examples", + "description": "Contains several examples of less common use cases in one scene. Highly recommended.", + "path": "Samples~/Examples" + }, + { + "displayName": "Ripples", + "description": "An example of manipulating inputs to generate dynamic ripples.", + "path": "Samples~/Ripples" + }, + { + "displayName": "Wakes", + "description": "Demonstrates wakes using the Sphere Water Interaction.", + "path": "Samples~/Wakes" + }, + { + "displayName": "Boats", + "description": "Simple examples using boats.", + "path": "Samples~/Boats" + } + ], + "dependencies": { + "com.unity.render-pipelines.core": "14.0.12", + "com.unity.shadergraph": "14.0.12" + } +} \ No newline at end of file diff --git a/Packages/com.waveharmonic.crest/package.json.meta b/Packages/com.waveharmonic.crest/package.json.meta new file mode 100644 index 0000000..3dbbee0 --- /dev/null +++ b/Packages/com.waveharmonic.crest/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c7f630660b354476a83c9e4962b34b1 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json new file mode 100644 index 0000000..729a2b6 --- /dev/null +++ b/Packages/manifest.json @@ -0,0 +1,47 @@ +{ + "dependencies": { + "com.unity.ai.navigation": "1.1.6", + "com.unity.cinemachine": "2.10.3", + "com.unity.collab-proxy": "2.7.1", + "com.unity.ide.rider": "3.0.36", + "com.unity.ide.visualstudio": "2.0.22", + "com.unity.ide.vscode": "1.2.5", + "com.unity.render-pipelines.universal": "14.0.12", + "com.unity.test-framework": "1.1.33", + "com.unity.textmeshpro": "3.0.7", + "com.unity.timeline": "1.7.7", + "com.unity.ugui": "1.0.0", + "com.unity.visualscripting": "1.9.4", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } +} diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json new file mode 100644 index 0000000..936eb39 --- /dev/null +++ b/Packages/packages-lock.json @@ -0,0 +1,436 @@ +{ + "dependencies": { + "com.unity.ai.navigation": { + "version": "1.1.6", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.ai": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.burst": { + "version": "1.8.21", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.mathematics": "1.2.1", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.cinemachine": { + "version": "2.10.3", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.31" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.collab-proxy": { + "version": "2.7.1", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.ext.nunit": { + "version": "1.0.6", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.ide.rider": { + "version": "3.0.36", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.22", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.ide.vscode": { + "version": "1.2.5", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.mathematics": { + "version": "1.2.6", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.render-pipelines.core": { + "version": "14.0.12", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.ugui": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.render-pipelines.universal": { + "version": "14.0.12", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.mathematics": "1.2.1", + "com.unity.burst": "1.8.9", + "com.unity.render-pipelines.core": "14.0.12", + "com.unity.shadergraph": "14.0.12", + "com.unity.render-pipelines.universal-config": "14.0.9" + } + }, + "com.unity.render-pipelines.universal-config": { + "version": "14.0.10", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.render-pipelines.core": "14.0.10" + } + }, + "com.unity.searcher": { + "version": "4.9.2", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.shadergraph": { + "version": "14.0.12", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.render-pipelines.core": "14.0.12", + "com.unity.searcher": "4.9.2" + } + }, + "com.unity.test-framework": { + "version": "1.1.33", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.textmeshpro": { + "version": "3.0.7", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.timeline": { + "version": "1.7.7", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.ugui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + } + }, + "com.unity.visualscripting": { + "version": "1.9.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.waveharmonic.crest": { + "version": "file:com.waveharmonic.crest", + "depth": 0, + "source": "embedded", + "dependencies": { + "com.unity.render-pipelines.core": "14.0.12", + "com.unity.shadergraph": "14.0.12" + } + }, + "com.waveharmonic.crest.shallow-water": { + "version": "file:com.waveharmonic.crest.shallow-water", + "depth": 0, + "source": "embedded", + "dependencies": { + "com.waveharmonic.crest": "5.6.0" + } + }, + "com.unity.modules.ai": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.androidjni": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.animation": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.assetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.cloth": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.director": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.animation": "1.0.0" + } + }, + "com.unity.modules.imageconversion": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.jsonserialize": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.particlesystem": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics2d": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.screencapture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.subsystems": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.terrain": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.terrainphysics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.modules.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics2d": "1.0.0" + } + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.uielements": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.umbra": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unityanalytics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.unitywebrequest": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unitywebrequestassetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestaudio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.audio": "1.0.0" + } + }, + "com.unity.modules.unitywebrequesttexture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestwww": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.vehicles": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.video": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.vr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } + }, + "com.unity.modules.wind": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.xr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.subsystems": "1.0.0" + } + } + } +} diff --git a/ProjectSettings/AudioManager.asset b/ProjectSettings/AudioManager.asset new file mode 100644 index 0000000..27287fe --- /dev/null +++ b/ProjectSettings/AudioManager.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 + m_RequestedDSPBufferSize: 0 diff --git a/ProjectSettings/AutoStreamingSettings.asset b/ProjectSettings/AutoStreamingSettings.asset new file mode 100644 index 0000000..d3e071e --- /dev/null +++ b/ProjectSettings/AutoStreamingSettings.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1200 &1 +AutoStreamingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + mSearchMode: 15 + mCustomSearchFile: + mTextureSearchString: + mMeshSearchString: + mTextures: [] + mAudios: [] + mMeshes: [] + mScenes: [] + mConfigCCD: + useCCD: 0 + cosKey: + projectGuid: + bucketUuid: + bucketName: + badgeName: diff --git a/ProjectSettings/BurstAotSettings_StandaloneWindows.json b/ProjectSettings/BurstAotSettings_StandaloneWindows.json new file mode 100644 index 0000000..e02ae33 --- /dev/null +++ b/ProjectSettings/BurstAotSettings_StandaloneWindows.json @@ -0,0 +1,17 @@ +{ + "MonoBehaviour": { + "Version": 4, + "EnableBurstCompilation": true, + "EnableOptimisations": true, + "EnableSafetyChecks": false, + "EnableDebugInAllBuilds": false, + "UsePlatformSDKLinker": false, + "CpuMinTargetX32": 0, + "CpuMaxTargetX32": 0, + "CpuMinTargetX64": 0, + "CpuMaxTargetX64": 0, + "CpuTargetsX32": 6, + "CpuTargetsX64": 72, + "OptimizeFor": 0 + } +} diff --git a/ProjectSettings/BurstAotSettings_WebGL.json b/ProjectSettings/BurstAotSettings_WebGL.json new file mode 100644 index 0000000..eed54c3 --- /dev/null +++ b/ProjectSettings/BurstAotSettings_WebGL.json @@ -0,0 +1,16 @@ +{ + "MonoBehaviour": { + "Version": 4, + "EnableBurstCompilation": true, + "EnableOptimisations": true, + "EnableSafetyChecks": false, + "EnableDebugInAllBuilds": false, + "DebugDataKind": 1, + "EnableArmv9SecurityFeatures": false, + "CpuMinTargetX32": 0, + "CpuMaxTargetX32": 0, + "CpuMinTargetX64": 0, + "CpuMaxTargetX64": 0, + "OptimizeFor": 0 + } +} diff --git a/ProjectSettings/ClusterInputManager.asset b/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 0000000..e7886b2 --- /dev/null +++ b/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/ProjectSettings/CommonBurstAotSettings.json b/ProjectSettings/CommonBurstAotSettings.json new file mode 100644 index 0000000..0293daf --- /dev/null +++ b/ProjectSettings/CommonBurstAotSettings.json @@ -0,0 +1,6 @@ +{ + "MonoBehaviour": { + "Version": 4, + "DisabledWarnings": "" + } +} diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset new file mode 100644 index 0000000..1596c42 --- /dev/null +++ b/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0.1 + m_ClothInterCollisionStiffness: 0.2 + m_ContactsGeneration: 1 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_AutoSimulation: 1 + m_AutoSyncTransforms: 0 + m_ReuseCollisionCallbacks: 0 + m_ClothInterCollisionSettingsToggle: 0 + m_ClothGravity: {x: 0, y: -9.81, z: 0} + m_ContactPairsMode: 0 + m_BroadphaseType: 0 + m_WorldBounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 250, y: 250, z: 250} + m_WorldSubdivisions: 8 + m_FrictionType: 0 + m_EnableEnhancedDeterminism: 0 + m_EnableUnifiedHeightmaps: 1 + m_SolverType: 0 + m_DefaultMaxAngularSpeed: 50 diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 0000000..60ca53c --- /dev/null +++ b/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/Scenes/BeiXi.unity + guid: 99c9720ab356a0642a771bea13969a05 + - enabled: 0 + path: Assets/Scenes/SampleScene1.unity + guid: 94a6835ddea3d514d87c67a17c0512d3 + - enabled: 0 + path: Assets/Scenes/SampleSceneshu0930.unity + guid: f8564b23750d4584f8dd21d0341aadc4 + - enabled: 0 + path: Assets/Scenes/SampleSceneche.unity + guid: 9fc0d4010bbf28b4594072e72b8655ab + m_configObjects: {} diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset new file mode 100644 index 0000000..0b0999b --- /dev/null +++ b/ProjectSettings/EditorSettings.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 0 + m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} + m_SpritePackerMode: 0 + m_SpritePackerPaddingPower: 1 + m_Bc7TextureCompressor: 0 + m_EtcTextureCompressorBehavior: 1 + m_EtcTextureFastCompressor: 1 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 4 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp + m_ProjectGenerationRootNamespace: + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_AsyncShaderCompilation: 1 + m_CachingShaderPreprocessor: 1 + m_PrefabModeAllowAutoSave: 1 + m_EnterPlayModeOptionsEnabled: 0 + m_EnterPlayModeOptions: 3 + m_GameObjectNamingDigits: 1 + m_GameObjectNamingScheme: 0 + m_AssetNamingUsesSpace: 1 + m_UseLegacyProbeSampleCount: 0 + m_SerializeInlineMappingsOnOneLine: 0 + m_DisableCookiesInLightmapper: 1 + m_AssetPipelineMode: 1 + m_RefreshImportMode: 0 + m_CacheServerMode: 0 + m_CacheServerEndpoint: + m_CacheServerNamespacePrefix: default + m_CacheServerEnableDownload: 1 + m_CacheServerEnableUpload: 1 + m_CacheServerEnableAuth: 0 + m_CacheServerEnableTls: 0 diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 0000000..8c5e761 --- /dev/null +++ b/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,71 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 15 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_VideoShadersIncludeMode: 2 + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_PreloadShadersBatchTimeLimit: -1 + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 11400000, guid: 7b7fd9122c28c4d15b667c7040e3b3fd, + type: 2} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_BrgStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 1 + m_LightsUseColorTemperature: 1 + m_DefaultRenderingLayerMask: 1 + m_LogWhenShaderIsCompiled: 0 + m_SRPDefaultSettings: + UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 18dc0cd2c080841dea60987a38ce93fa, + type: 2} + m_LightProbeOutsideHullStrategy: 0 + m_CameraRelativeLightCulling: 0 + m_CameraRelativeShadowCulling: 0 diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset new file mode 100644 index 0000000..b16147e --- /dev/null +++ b/ProjectSettings/InputManager.asset @@ -0,0 +1,487 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Enable Debug Button 1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: joystick button 8 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Enable Debug Button 2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: backspace + altNegativeButton: + altPositiveButton: joystick button 9 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Reset + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Next + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: page down + altNegativeButton: + altPositiveButton: joystick button 5 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Previous + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: page up + altNegativeButton: + altPositiveButton: joystick button 4 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Validate + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Persistent + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: right shift + altNegativeButton: + altPositiveButton: joystick button 2 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Multiplier + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: joystick button 3 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 2 + axis: 6 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 2 + axis: 5 + joyNum: 0 diff --git a/ProjectSettings/MemorySettings.asset b/ProjectSettings/MemorySettings.asset new file mode 100644 index 0000000..5b5face --- /dev/null +++ b/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/ProjectSettings/NavMeshAreas.asset b/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 0000000..d4480e4 --- /dev/null +++ b/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,93 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.25 + agentHeight: 2 + agentSlope: 60 + agentClimb: 1.04 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/ProjectSettings/PackageManagerSettings.asset b/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 0000000..c414591 --- /dev/null +++ b/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + 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: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_EnablePreReleasePackages: 0 + m_EnablePackageDependencies: 0 + m_AdvancedSettingsExpanded: 1 + m_ScopedRegistriesSettingsExpanded: 1 + m_SeeAllPackageVersions: 0 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.cn + m_Scopes: [] + m_IsDefault: 1 + m_Capabilities: 7 + m_ConfigSource: 0 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_Modified: 0 + m_ErrorMessage: + m_UserModificationsInstanceId: -844 + m_OriginalInstanceId: -846 + m_LoadAssets: 0 diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 0000000..6c5cf8a --- /dev/null +++ b/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_JobOptions: + serializedVersion: 2 + useMultithreading: 0 + useConsistencySorting: 0 + m_InterpolationPosesPerJob: 100 + m_NewContactsPerJob: 30 + m_CollideContactsPerJob: 100 + m_ClearFlagsPerJob: 200 + m_ClearBodyForcesPerJob: 200 + m_SyncDiscreteFixturesPerJob: 50 + m_SyncContinuousFixturesPerJob: 50 + m_FindNearestContactsPerJob: 100 + m_UpdateTriggerContactsPerJob: 100 + m_IslandSolverCostThreshold: 100 + m_IslandSolverBodyCostScale: 1 + m_IslandSolverContactCostScale: 10 + m_IslandSolverJointCostScale: 10 + m_IslandSolverBodiesPerJob: 50 + m_IslandSolverContactsPerJob: 50 + m_AutoSimulation: 1 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_CallbacksOnDisable: 1 + m_ReuseCollisionCallbacks: 0 + m_AutoSyncTransforms: 0 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/ProjectSettings/PresetManager.asset b/ProjectSettings/PresetManager.asset new file mode 100644 index 0000000..67a94da --- /dev/null +++ b/ProjectSettings/PresetManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_DefaultPresets: {} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset new file mode 100644 index 0000000..ca78a87 --- /dev/null +++ b/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,957 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 26 + productGUID: 54b4ed1bdad61d34f8d5ca4f99d3ffa3 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: DefaultCompany + productName: My project + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1500 + defaultScreenHeight: 800 + defaultScreenWidthWeb: 1920 + defaultScreenHeightWeb: 1080 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 1 + unsupportedMSAAFallback: 0 + m_SpriteBatchVertexThreshold: 300 + m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + numberOfMipsStrippedPerMipmapLimitGroup: {} + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosUseCustomAppBackgroundBehavior: 0 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 1 + androidUseSwappy: 0 + androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + androidAutoRotationBehavior: 1 + androidPredictiveBackSupport: 1 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 0 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + audioSpatialExperience: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + dedicatedServerOptimizations: 0 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + useFlipModelSwapchain: 1 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 1 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + fullscreenMode: 3 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 1048576 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchGpuScratchPoolGranularity: 2097152 + switchAllowGpuScratchShrinking: 0 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + switchNVNGraphicsFirmwareMemory: 32 + switchMaxWorkerMultiple: 8 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 + vulkanNumSwapchainBuffers: 3 + vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 1 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + loadStoreDebugModeEnabled: 0 + visionOSBundleVersion: 1.0 + tvOSBundleVersion: 1.0 + bundleVersion: 0.1.0 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 1 + xboxOneEnable7thCore: 1 + vrSettings: + enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 + enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 + allowHDRDisplaySupport: 0 + useHDRDisplay: 0 + hdrBitDepth: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: + Android: com.UnityTechnologies.com.unity.template.urpblank + Standalone: com.UnityTechnologies.com.unity.template.urp-blank + iPhone: com.Unity-Technologies.com.unity.template.urp-blank + buildNumber: + Standalone: 0 + VisionOS: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 1 + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 22 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + APKExpansionFiles: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 0 + strictShaderVariantMatching: 0 + VertexChannelCompressionMask: 4054 + iPhoneSdkVersion: 988 + iOSSimulatorArchitecture: 0 + iOSTargetOSVersionString: 12.0 + tvOSSdkVersion: 0 + tvOSSimulatorArchitecture: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 12.0 + VisionOSSdkVersion: 0 + VisionOSTargetOSVersionString: 1.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + macOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + metalCompileShaderBinary: 0 + iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + VisionOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 + shaderPrecisionModel: 0 + clonedFromGUID: 3c72c65a16f0acb438eed22b8b16c24a + templatePackageId: com.unity.template.urp-blank@2.0.6 + templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 + useCustomProguardFile: 0 + AndroidTargetArchitectures: 1 + AndroidTargetDevices: 0 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: + AndroidKeyaliasName: + AndroidEnableArmv9SecurityFeatures: 0 + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 0 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + chromeosInputEmulation: 1 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: + - m_BuildTarget: iPhone + m_Icons: + - m_Textures: [] + m_Width: 180 + m_Height: 180 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 167 + m_Height: 167 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 152 + m_Height: 152 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 76 + m_Height: 76 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 87 + m_Height: 87 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 60 + m_Height: 60 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 20 + m_Height: 20 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 1024 + m_Height: 1024 + m_Kind: 4 + m_SubKind: App Store + - m_BuildTarget: Android + m_Icons: + - m_Textures: [] + m_Width: 432 + m_Height: 432 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 324 + m_Height: 324 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 216 + m_Height: 216 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 162 + m_Height: 162 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 108 + m_Height: 108 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 81 + m_Height: 81 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 0 + m_SubKind: + - m_BuildTarget: tvOS + m_Icons: + - m_Textures: [] + m_Width: 1280 + m_Height: 768 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 800 + m_Height: 480 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 400 + m_Height: 240 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 4640 + m_Height: 1440 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 2320 + m_Height: 720 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 3840 + m_Height: 1440 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 1920 + m_Height: 720 + m_Kind: 1 + m_SubKind: + m_BuildTargetBatching: [] + m_BuildTargetShaderSettings: [] + m_BuildTargetGraphicsJobs: [] + m_BuildTargetGraphicsJobMode: [] + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: AndroidPlayer + m_APIs: 150000000b000000 + m_Automatic: 1 + - m_BuildTarget: WebGLSupport + m_APIs: 0b000000 + m_Automatic: 0 + - m_BuildTarget: LinuxStandaloneSupport + m_APIs: 1100000015000000 + m_Automatic: 0 + - m_BuildTarget: MacStandaloneSupport + m_APIs: 10000000 + m_Automatic: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_APIs: 02000000 + m_Automatic: 0 + m_BuildTargetVRSettings: [] + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + openGLRequireES32: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: + - m_BuildTarget: Android + m_EncodingQuality: 1 + - m_BuildTarget: WebGL + m_EncodingQuality: 1 + m_BuildTargetGroupHDRCubemapEncodingQuality: [] + m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetGroupLoadStoreDebugModeSettings: [] + m_BuildTargetNormalMapEncoding: + - m_BuildTarget: Android + m_Encoding: 1 + m_BuildTargetDefaultTextureCompressionFormat: + - m_BuildTarget: Android + m_Format: 3 + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + bluetoothUsageDescription: + macOSTargetOSVersion: 10.13.0 + switchNMETAOverride: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchEnableFileSystemTrace: 0 + switchLTOSetting: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchCompilerFlags: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchTitleNames_15: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchPublisherNames_15: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchRatingsInt_12: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 + switchSupportedNpadStyles: 22 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchDisableHTCSPlayerConnection: 0 + switchUseNewStyleFilepaths: 0 + switchUseLegacyFmodPriorities: 1 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 2 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 2 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 + monoEnv: + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 + spritePackerPolicy: + webGLMemorySize: 32 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLShowDiagnostics: 0 + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 2 + webGLWasmArithmeticExceptions: 0 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 + webGLInitialMemorySize: 32 + webGLMaximumMemorySize: 2048 + webGLMemoryGrowthMode: 2 + webGLMemoryLinearGrowthStep: 16 + webGLMemoryGeometricGrowthStep: 0.2 + webGLMemoryGeometricGrowthCap: 96 + webGLPowerPreference: 2 + scriptingDefineSymbols: + Android: ENVIRO_3;ENVIRO_URP + EmbeddedLinux: ENVIRO_3;ENVIRO_URP + GameCoreXboxOne: ENVIRO_3;ENVIRO_URP + Nintendo Switch: ENVIRO_3;ENVIRO_URP + PS4: ENVIRO_3;ENVIRO_URP + PS5: ENVIRO_3;ENVIRO_URP + QNX: ENVIRO_3;ENVIRO_URP + Stadia: ENVIRO_3;ENVIRO_URP + Standalone: ENVIRO_3;ENVIRO_URP + VisionOS: ENVIRO_3;ENVIRO_URP + WebGL: ENVIRO_3;ENVIRO_URP + XboxOne: ENVIRO_3;ENVIRO_URP + tvOS: ENVIRO_3;ENVIRO_URP + additionalCompilerArguments: {} + platformArchitecture: {} + scriptingBackend: {} + il2cppCompilerConfiguration: {} + il2cppCodeGeneration: {} + managedStrippingLevel: + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Lumin: 1 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + Stadia: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 + incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 + allowUnsafeCode: 0 + useDeterministicCompilation: 1 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + gcIncremental: 0 + gcWBarrierValidation: 0 + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: com.unity.template-starter-kit + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: com.unity.template-starter-kit + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, + a: 1} + metroSplashScreenUseBackgroundColor: 0 + syncCapabilities: 0 + platformCapabilities: {} + metroTargetDeviceFamilies: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + vcxProjDefaultLanguage: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 + XboxOneEnableGPUVariability: 1 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} + cloudServicesEnabled: {} + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: + hmiPlayerDataPath: + hmiForceSRGBBlit: 1 + embeddedLinuxEnableGamepadInput: 1 + hmiLogStartupTiming: 0 + hmiCpuConfiguration: + apiCompatibilityLevel: 6 + activeInputHandler: 0 + windowsGamepadBackendHint: 0 + cloudProjectId: + framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] + projectName: + organizationId: + cloudEnabled: 0 + legacyClampBlendShapeWeights: 0 + hmiLoadingImage: {fileID: 0} + platformRequiresReadableAssets: 0 + virtualTexturingSupportEnabled: 0 + insecureHttpOption: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt new file mode 100644 index 0000000..11e271c --- /dev/null +++ b/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 2022.3.62f3c1 +m_EditorVersionWithRevision: 2022.3.62f3c1 (1623fc0bbb97) diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset new file mode 100644 index 0000000..1380c9f --- /dev/null +++ b/ProjectSettings/QualitySettings.asset @@ -0,0 +1,176 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 2 + m_QualitySettings: + - serializedVersion: 3 + name: Performant + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 2 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + useLegacyDetailDistribution: 1 + vSyncCount: 0 + realtimeGICPUUsage: 25 + lodBias: 0.4 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 11400000, guid: d0e2fc18fe036412f8223b3b3d9ad574, + type: 2} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + - serializedVersion: 3 + name: Balanced + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 4 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + useLegacyDetailDistribution: 1 + vSyncCount: 1 + realtimeGICPUUsage: 25 + lodBias: 1 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 64 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 11400000, guid: e1260c1148f6143b28bae5ace5e9c5d1, + type: 2} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + - serializedVersion: 3 + name: High Fidelity + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 255 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 2 + antiAliasing: 4 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + useLegacyDetailDistribution: 1 + vSyncCount: 1 + realtimeGICPUUsage: 25 + lodBias: 2 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 2048 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 11400000, guid: 7b7fd9122c28c4d15b667c7040e3b3fd, + type: 2} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + m_TextureMipmapLimitGroupNames: [] + m_PerPlatformDefaultQuality: + Android: 1 + CloudRendering: 2 + GameCoreScarlett: 2 + GameCoreXboxOne: 2 + Lumin: 2 + Nintendo Switch: 1 + PS4: 2 + PS5: 2 + Server: 0 + Stadia: 2 + Standalone: 2 + WebGL: 2 + Windows Store Apps: 2 + XboxOne: 2 + iPhone: 1 + tvOS: 1 diff --git a/ProjectSettings/SceneTemplateSettings.json b/ProjectSettings/SceneTemplateSettings.json new file mode 100644 index 0000000..6f3e60f --- /dev/null +++ b/ProjectSettings/SceneTemplateSettings.json @@ -0,0 +1,167 @@ +{ + "templatePinStates": [], + "dependencyTypeInfos": [ + { + "userAdded": false, + "type": "UnityEngine.AnimationClip", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.Animations.AnimatorController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.AnimatorOverrideController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.Audio.AudioMixerController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.ComputeShader", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Cubemap", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.GameObject", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.LightingDataAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": false + }, + { + "userAdded": false, + "type": "UnityEngine.LightingSettings", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Material", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.MonoScript", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicMaterial", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial2D", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.VolumeProfile", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.SceneAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": false + }, + { + "userAdded": false, + "type": "UnityEngine.Shader", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.ShaderVariantCollection", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Texture", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Texture2D", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Timeline.TimelineAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + } + ], + "defaultDependencyTypeInfo": { + "userAdded": false, + "type": "", + "ignore": false, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + "newSceneOverride": 0 +} \ No newline at end of file diff --git a/ProjectSettings/ShaderGraphSettings.asset b/ProjectSettings/ShaderGraphSettings.asset new file mode 100644 index 0000000..486aaba --- /dev/null +++ b/ProjectSettings/ShaderGraphSettings.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + 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: de02f9e1d18f588468e474319d09a723, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderVariantLimit: 2048 + customInterpolatorErrorThreshold: 32 + customInterpolatorWarningThreshold: 16 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset new file mode 100644 index 0000000..eccb300 --- /dev/null +++ b/ProjectSettings/TagManager.asset @@ -0,0 +1,58 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 2 + tags: + - Target + - "\u632F\u52A8\u52A0\u901F\u5EA6" + - "\u6C89\u964D\u76D1\u6D4B" + - "\u6D41\u91CF\u76D1\u6D4B" + - "\u6C14\u8C61\u76D1\u6D4B" + - "\u503E\u89D2\u76D1\u6D4B" + - "\u5E94\u53D8\u76D1\u6D4B" + - "\u88C2\u7F1D\u76D1\u6D4B" + - "\u5168\u90E8" + - TAZOFX + - AutomativeLighting + - StreetLighting + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - Hightlight + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 + - name: fugai + uniqueID: 1049114679 + locked: 0 diff --git a/ProjectSettings/TimeManager.asset b/ProjectSettings/TimeManager.asset new file mode 100644 index 0000000..558a017 --- /dev/null +++ b/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/ProjectSettings/TimelineSettings.asset b/ProjectSettings/TimelineSettings.asset new file mode 100644 index 0000000..cfaebd7 --- /dev/null +++ b/ProjectSettings/TimelineSettings.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + 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: a287be6c49135cd4f9b2b8666c39d999, type: 3} + m_Name: + m_EditorClassIdentifier: + assetDefaultFramerate: 60 + m_DefaultFrameRate: 60 diff --git a/ProjectSettings/URPProjectSettings.asset b/ProjectSettings/URPProjectSettings.asset new file mode 100644 index 0000000..cd7fd8c --- /dev/null +++ b/ProjectSettings/URPProjectSettings.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + 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: 247994e1f5a72c2419c26a37e9334c01, type: 3} + m_Name: + m_EditorClassIdentifier: + m_LastMaterialVersion: 7 diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 0000000..a4b74d6 --- /dev/null +++ b/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,38 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 1 + m_Enabled: 1 + m_TestMode: 0 + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com + m_CNEventUrl: https://cdp.cloud.unity.cn/v1/events + m_CNConfigUrl: https://cdp.cloud.unity.cn/config + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com + m_Enabled: 0 + m_LogBufferSize: 10 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 1 + m_TestMode: 0 + m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/ProjectSettings/VFXManager.asset b/ProjectSettings/VFXManager.asset new file mode 100644 index 0000000..3a95c98 --- /dev/null +++ b/ProjectSettings/VFXManager.asset @@ -0,0 +1,12 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_StripUpdateShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 diff --git a/ProjectSettings/VersionControlSettings.asset b/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 0000000..dca2881 --- /dev/null +++ b/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/ProjectSettings/XRSettings.asset b/ProjectSettings/XRSettings.asset new file mode 100644 index 0000000..482590c --- /dev/null +++ b/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file