浏览代码

Removed WaterSystem submodule and embedded as local Package.

No build tests so may not work in build in this commit
/main
Andre McGrail 6 年前
当前提交
316d47cb
共有 137 个文件被更改,包括 10175 次插入248 次删除
  1. 4
      .gitignore
  2. 3
      .gitmodules
  3. 2
      Assets/Objects/boats/Interceptor.mat
  4. 2
      Assets/Objects/environment/Trees/Materials/Softvegetation.mat
  5. 2
      Assets/Objects/environment/Trees/Materials/Trees.mat
  6. 2
      Assets/Objects/environment/Trees/Materials/Trees_billboards.mat
  7. 3
      Assets/Objects/props/houses/Materials/Matr_BuildingsJettys.mat
  8. 3
      Assets/Objects/props/props/Matr_Props.mat
  9. 2
      Assets/Objects/props/props/Matr_Props_Hue.mat
  10. 4
      Assets/Scripts/Boat/Engine.cs
  11. 279
      Assets/scenes/Island.unity
  12. 10
      Packages/manifest.json
  13. 2
      ProjectSettings/ProjectVersion.txt
  14. 135
      Packages/com.verasl.water-system/Scripts/Rendering/WaterFXPass.cs
  15. 8
      Packages/com.verasl.water-system/Data.meta
  16. 17
      Packages/com.verasl.water-system/Data/WaterResources.cs
  17. 11
      Packages/com.verasl.water-system/Data/WaterResources.cs.meta
  18. 26
      Packages/com.verasl.water-system/Data/WaterSettingsData.asset
  19. 8
      Packages/com.verasl.water-system/Data/WaterSettingsData.asset.meta
  20. 45
      Packages/com.verasl.water-system/Data/WaterSettingsData.cs
  21. 11
      Packages/com.verasl.water-system/Data/WaterSettingsData.cs.meta
  22. 228
      Packages/com.verasl.water-system/Data/WaterSurfaceData.asset
  23. 8
      Packages/com.verasl.water-system/Data/WaterSurfaceData.asset.meta
  24. 85
      Packages/com.verasl.water-system/Data/WaterSurfaceData.cs
  25. 11
      Packages/com.verasl.water-system/Data/WaterSurfaceData.cs.meta
  26. 8
      Packages/com.verasl.water-system/Editor.meta
  27. 46
      Packages/com.verasl.water-system/Editor/PlanarSettingsDrawer.cs
  28. 11
      Packages/com.verasl.water-system/Editor/PlanarSettingsDrawer.cs.meta
  29. 79
      Packages/com.verasl.water-system/Editor/WaterEditor.cs
  30. 11
      Packages/com.verasl.water-system/Editor/WaterEditor.cs.meta
  31. 47
      Packages/com.verasl.water-system/Editor/WaterSettingsDataEditor.cs
  32. 11
      Packages/com.verasl.water-system/Editor/WaterSettingsDataEditor.cs.meta
  33. 361
      Packages/com.verasl.water-system/Editor/WaterSurfaceDataEditor.cs
  34. 11
      Packages/com.verasl.water-system/Editor/WaterSurfaceDataEditor.cs.meta
  35. 8
      Packages/com.verasl.water-system/Meshes.meta
  36. 68
      Packages/com.verasl.water-system/Meshes/InfiniteSea.fbx
  37. 99
      Packages/com.verasl.water-system/Meshes/InfiniteSea.fbx.meta
  38. 1001
      Packages/com.verasl.water-system/Meshes/SeaVertDisp.fbx
  39. 228
      Packages/com.verasl.water-system/Meshes/SeaVertDisp.fbx.meta
  40. 253
      Packages/com.verasl.water-system/Meshes/Water.fbx
  41. 138
      Packages/com.verasl.water-system/Meshes/Water.fbx.meta
  42. 8
      Packages/com.verasl.water-system/Resources.meta
  43. 16
      Packages/com.verasl.water-system/Resources/WaterResources.asset
  44. 8
      Packages/com.verasl.water-system/Resources/WaterResources.asset.meta
  45. 8
      Packages/com.verasl.water-system/Scripts.meta
  46. 335
      Packages/com.verasl.water-system/Scripts/BuoyantObject.cs
  47. 11
      Packages/com.verasl.water-system/Scripts/BuoyantObject.cs.meta
  48. 268
      Packages/com.verasl.water-system/Scripts/GerstnerWavesJobs.cs
  49. 11
      Packages/com.verasl.water-system/Scripts/GerstnerWavesJobs.cs.meta
  50. 38
      Packages/com.verasl.water-system/Scripts/MainCameraAlign.cs
  51. 11
      Packages/com.verasl.water-system/Scripts/MainCameraAlign.cs.meta
  52. 8
      Packages/com.verasl.water-system/Scripts/Rendering.meta
  53. 350
      Packages/com.verasl.water-system/Scripts/Water.cs
  54. 11
      Packages/com.verasl.water-system/Scripts/Water.cs.meta
  55. 24
      Packages/com.verasl.water-system/Sea.mat
  56. 8
      Packages/com.verasl.water-system/Sea.mat.meta
  57. 1001
      Packages/com.verasl.water-system/SeaVisual.prefab
  58. 8
      Packages/com.verasl.water-system/SeaVisual.prefab.meta
  59. 8
      Packages/com.verasl.water-system/Shaders.meta
  60. 28
      Packages/com.verasl.water-system/Shaders/CommonUtilities.hlsl
  61. 9
      Packages/com.verasl.water-system/Shaders/CommonUtilities.hlsl.meta
  62. 101
      Packages/com.verasl.water-system/Shaders/GerstnerWaves.hlsl
  63. 9
      Packages/com.verasl.water-system/Shaders/GerstnerWaves.hlsl.meta
  64. 83
      Packages/com.verasl.water-system/Shaders/InfiniteWater.mat
  65. 8
      Packages/com.verasl.water-system/Shaders/InfiniteWater.mat.meta
  66. 158
      Packages/com.verasl.water-system/Shaders/InfiniteWater.shader
  67. 9
      Packages/com.verasl.water-system/Shaders/InfiniteWater.shader.meta
  68. 38
      Packages/com.verasl.water-system/Shaders/Water.shader
  69. 9
      Packages/com.verasl.water-system/Shaders/Water.shader.meta
  70. 240
      Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl
  71. 9
      Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl.meta
  72. 43
      Packages/com.verasl.water-system/Shaders/WaterInput.hlsl
  73. 9
      Packages/com.verasl.water-system/Shaders/WaterInput.hlsl.meta
  74. 73
      Packages/com.verasl.water-system/Shaders/WaterLighting.hlsl
  75. 9
      Packages/com.verasl.water-system/Shaders/WaterLighting.hlsl.meta
  76. 41
      Packages/com.verasl.water-system/Shaders/WaterTessellated.shader
  77. 9
      Packages/com.verasl.water-system/Shaders/WaterTessellated.shader.meta
  78. 128
      Packages/com.verasl.water-system/Shaders/WaterTessellation.hlsl
  79. 9
      Packages/com.verasl.water-system/Shaders/WaterTessellation.hlsl.meta
  80. 8
      Packages/com.verasl.water-system/Textures.meta
  81. 195
      Packages/com.verasl.water-system/Textures/DefaultFoamRamp.tif
  82. 108
      Packages/com.verasl.water-system/Textures/DefaultFoamRamp.tif.meta
  83. 167
      Packages/com.verasl.water-system/Textures/PeakMap.tif
  84. 99
      Packages/com.verasl.water-system/Textures/PeakMap.tif.meta
  85. 8
      Packages/com.verasl.water-system/Textures/SurfaceSequence.meta
  86. 1001
      Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0001.png
  87. 130
      Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0001.png.meta
  88. 1001
      Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0002.png
  89. 130
      Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0002.png.meta
  90. 1001
      Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0003.png
  91. 130
      Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0003.png.meta

4
.gitignore


*.unitypackage
Assets/_Ignore
_Ignore.meta
Packages/PostProcessing
Packages/LightweightPipeline
Packages/Core
Packages/com.unity.shadergraph
.idea
Logs

3
.gitmodules


[submodule "Assets/WaterSystem"]
path = Assets/WaterSystem
url = https://github.com/Verasl/WaterSystem

2
Assets/Objects/boats/Interceptor.mat


m_Shader: {fileID: 4800000, guid: 7cc6d8245162d41df970ab2856566de3, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}

2
Assets/Objects/environment/Trees/Materials/Softvegetation.mat


m_Shader: {fileID: 4800000, guid: 1adca499d9899854aa1b4011854d49fb, type: 3}
m_ShaderKeywords: _ALPHATEST_ON _CORRECTNORMALS_OFF _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _NORMALMAP _VERTEXANIMATION
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 1
m_CustomRenderQueue: 2100
stringTagMap: {}

2
Assets/Objects/environment/Trees/Materials/Trees.mat


m_Shader: {fileID: 4800000, guid: 1adca499d9899854aa1b4011854d49fb, type: 3}
m_ShaderKeywords: _ALPHATEST_ON _CORRECTNORMALS _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _NORMALMAP _VERTEXANIMATION
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 1
m_CustomRenderQueue: 2090
stringTagMap: {}

2
Assets/Objects/environment/Trees/Materials/Trees_billboards.mat


m_Shader: {fileID: 4800000, guid: 1adca499d9899854aa1b4011854d49fb, type: 3}
m_ShaderKeywords: _ALPHATEST_ON _NORMALMAP _OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}

3
Assets/Objects/props/houses/Materials/Matr_BuildingsJettys.mat


m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _ALPHATEST_ON _NORMALMAP _SPECULAR_SETUP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap: {}

- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _ReceiveShadows: 1
- _Shininess: 1
- _SmoothnessTextureChannel: 0
- _SpecSource: 0

3
Assets/Objects/props/props/Matr_Props.mat


m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}

- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _ReceiveShadows: 1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

2
Assets/Objects/props/props/Matr_Props_Hue.mat


m_Shader: {fileID: 4800000, guid: e7d662204c5464355bc5f5911874653a, type: 3}
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}

4
Assets/Scripts/Boat/Engine.cs


void Awake()
{
RB = gameObject.GetComponent<Rigidbody>(); // get the RB
engineSound.time = Random.Range(0f, engineSound.clip.length); // randomly start the engine sound
waterSound.time = Random.Range(0f, waterSound.clip.length); // randomly start the water sound
engineSound.time = UnityEngine.Random.Range(0f, engineSound.clip.length); // randomly start the engine sound
waterSound.time = UnityEngine.Random.Range(0f, waterSound.clip.length); // randomly start the water sound
_guid = this.GetInstanceID(); // Get the engines GUID for the buoyancy system
}

279
Assets/scenes/Island.unity


m_Father: {fileID: 1436267381}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &13342340
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 4554327062270080, guid: 2cac2e60f3f6f2447ad9b550450f60ed, type: 3}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1442025832}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -6.25, y: 0, z: 6.25}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 173199068}
m_Father: {fileID: 1621733248}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &18376806
PrefabInstance:
m_ObjectHideFlags: 0

m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 13342340}
m_TransformParent: {fileID: 1621733248}
value: 0
value: -50
value: 0
value: -0.25
value: 0
value: -56.25
value: 0
value: -0
value: 0
value: -0
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 074aa8ca109924e18baf19f3e26665b6, type: 3}
propertyPath: m_LocalRotation.w

propertyPath: m_RootOrder
value: 0
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2300030, guid: 074aa8ca109924e18baf19f3e26665b6, type: 3}
propertyPath: m_ReflectionProbeUsage

m_CorrespondingSourceObject: {fileID: 100000, guid: 074aa8ca109924e18baf19f3e26665b6, type: 3}
m_PrefabInstance: {fileID: 471000514}
m_PrefabAsset: {fileID: 0}
--- !u!114 &633812932
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 633812931}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9a6b4e1e324e641ff86ca879104e20de, type: 3}
m_Name:
m_EditorClassIdentifier:
quantizeValue: 6.25
forwards: 10
yOffset: -0.25
--- !u!114 &633812933
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 633812931}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b6edb8448c9b94f018953ca2a6fa5891, type: 3}
m_Name:
m_EditorClassIdentifier:
_rampTexture: {fileID: 1915053870}
_waves:
- amplitude: 0.4072035
direction: -167.8483
wavelength: 3.9317474
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.5117522
direction: -164.84064
wavelength: 5.0679083
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.7500642
direction: -213.10376
wavelength: 4.8436303
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.73293275
direction: -167.51822
wavelength: 7.4353476
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.800196
direction: -143.65651
wavelength: 9.009473
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 1.0951778
direction: -181.8624
wavelength: 14.354873
origin: {x: 0, y: 0}
onmiDir: 0
_debugMode: 0
settingsData: {fileID: 11400000, guid: a4cacf74654e54b35b9eaea74fd20b4e, type: 2}
surfaceData: {fileID: 11400000, guid: 846f3dc3b5341447a86687211f741bc7, type: 2}
resources: {fileID: 11400000, guid: 40615c805d6e84ce7800418367985fe1, type: 2}
--- !u!1 &636757617
GameObject:
m_ObjectHideFlags: 3

onValueChanged:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1442025834}
- m_Target: {fileID: 0}
m_MethodName: set_enabled
m_Mode: 0
m_Arguments:

m_ReflectLayers:
serializedVersion: 2
m_Bits: 4294967295
target: {fileID: 1442025832}
target: {fileID: 633812931}
--- !u!114 &1017609903
MonoBehaviour:
m_ObjectHideFlags: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1143740434}
m_LocalRotation: {x: -0.0020256494, y: 0.94006026, z: -0.005584321, w: -0.34095684}
m_LocalRotation: {x: -0.0020256492, y: 0.94006014, z: -0.0055843205, w: -0.34095684}
m_LocalPosition: {x: 42, y: 2.51, z: 62.1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

onValueChanged:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1442025835}
- m_Target: {fileID: 0}
m_MethodName: ToggleFXCam
m_Mode: 0
m_Arguments:

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1376922736}
m_LocalRotation: {x: -0.013267021, y: 0.9827769, z: -0.16695736, w: -0.078094944}
m_LocalRotation: {x: -0.0132670235, y: 0.9827769, z: -0.16695733, w: -0.078094974}
m_LocalPosition: {x: 69.76, y: 3.82, z: 81.16}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

m_CorrespondingSourceObject: {fileID: 4031187866992282, guid: 6f553d50deb1945daad6e14da200e86c, type: 3}
m_PrefabInstance: {fileID: 1442005819}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1442025832
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 1015499191777110, guid: 2cac2e60f3f6f2447ad9b550450f60ed, type: 3}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 13342340}
- component: {fileID: 1442025835}
- component: {fileID: 1442025834}
- component: {fileID: 1442025838}
m_Layer: 4
m_Name: SeaVisual
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 64
m_IsActive: 1
--- !u!114 &1442025834
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 114084614423911968, guid: 2cac2e60f3f6f2447ad9b550450f60ed, type: 3}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1442025832}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 301a6cf3893eb4e2b9a5de3e341ac44b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1442025835
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 114943683913522278, guid: 2cac2e60f3f6f2447ad9b550450f60ed, type: 3}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1442025832}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b6edb8448c9b94f018953ca2a6fa5891, type: 3}
m_Name:
m_EditorClassIdentifier:
_rampTexture: {fileID: 1689201338}
_waves:
- amplitude: 0.4072035
direction: -167.8483
wavelength: 3.9317474
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.5117522
direction: -164.84064
wavelength: 5.0679083
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.7500642
direction: -213.10376
wavelength: 4.8436303
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.73293275
direction: -167.51822
wavelength: 7.4353476
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.800196
direction: -143.65651
wavelength: 9.009473
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 1.0951778
direction: -181.8624
wavelength: 14.354873
origin: {x: 0, y: 0}
onmiDir: 0
_debugMode: 0
settingsData: {fileID: 11400000, guid: a4cacf74654e54b35b9eaea74fd20b4e, type: 2}
surfaceData: {fileID: 11400000, guid: 846f3dc3b5341447a86687211f741bc7, type: 2}
resources: {fileID: 11400000, guid: 40615c805d6e84ce7800418367985fe1, type: 2}
--- !u!114 &1442025838
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1442025832}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9a6b4e1e324e641ff86ca879104e20de, type: 3}
m_Name:
m_EditorClassIdentifier:
quantizeValue: 6.25
forwards: 10
--- !u!1 &1448888966
GameObject:
m_ObjectHideFlags: 0

m_Children:
- {fileID: 1174372660}
- {fileID: 355399364}
- {fileID: 13342340}
- {fileID: 173199068}
- {fileID: 820027663}
- {fileID: 1526800901}
- {fileID: 1953005500}

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cf92f64c366a83f42b7636e1086fec18, type: 3}
--- !u!28 &1689201338
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 128
m_Height: 4
m_CompleteImageSize: 2048
m_TextureFormat: 5
m_MipCount: 1
m_IsReadable: 1
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 1
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_LightmapFormat: 0
m_ColorSpace: 1
image data: 2048
_typelessdata: ffcfffffffb6fafaff9cf5f5ff83f0f0ff69ebebff50e6e6ff36e1e1ff22ddddff21dadaff21d7d7ff20d4d5ff1fd1d2ff1ececfff1dcccdff1cc9caff1bc6c7ff1bc3c4ff1ac0c2ff19bdbfff18bbbcff17b8baff16b5b7ff15b2b4ff15afb2ff14acafff13aaacff12a7a9ff11a4a7ff10a1a4ff0f9ea1ff0f9b9fff0e999cff0d9699ff0c9397ff0b9094ff0a8d91ff098a8eff09878cff088589ff078286ff067f84ff057d82ff057b81ff057a81ff057981ff057880ff057680ff05757fff05747fff04737fff04727eff04707eff046f7dff046e7dff046d7dff046b7cff046a7cff03697bff03687bff03667bff03657aff03647aff036379ff036179ff036079ff025f78ff025e78ff025d77ff025b77ff025a77ff025976ff025876ff025675ff025575ff015475ff015374ff015174ff015073ff014f73ff014e73ff014c72ff014b72ff004a71ff004971ff004871ff004670ff00456eff00436bff004169ff004066ff003e63ff003d61ff003b5eff00395cff003859ff003656ff003454ff003351ff00314eff002f4cff002e49ff002c47ff002b44ff002941ff00273fff00263cff00243aff002237ff002134ff001f32ff001d2fff001c2cff001a2aff001927ff001725ff001522ff00141fff00121dff00101aff000f18ff000d15ff000b12ff000a10ff00080dff00070aff000508ff000305ff000203ff000000ff010505ff020b09ff03100eff041612ff051b17ff06211bff072620ff092c24ff0a3129ff0b362dff0c3c32ff0d4136ff0e473bff0f4c3fff105244ff115748ff125d4dff136251ff146756ff156957ff156957ff156a58ff156a58ff166a58ff166b58ff166b59ff166c59ff176c59ff176c5aff176d5aff176d5aff186d5bff186e5bff186e5bff196f5cff196f5cff196f5cff19705cff1a705dff1a715dff1a715dff1a715eff1b725eff1b725eff1b725fff1b735fff1c735fff1c745fff1c7460ff1c7460ff1d7560ff1d7561ff1d7661ff1d7662ff1d7863ff1d7965ff1c7b66ff1c7c68ff1c7e6aff1b7f6bff1b816dff1b826eff1a8470ff1a8572ff198773ff198975ff198a76ff188c78ff188d7aff188f7bff17907dff17927eff179380ff169582ff169683ff169885ff159986ff159b88ff149c8aff149e8bff149f8dff13a18eff13a290ff13a492ff12a593ff12a795ff12a996ff11aa98ff11ac9aff11ad9bff10af9dff10b09eff0fb2a0ff0fb3a2ff0fb5a3ff0eb6a5ff0eb8a6ff0eb9a8ff0dbbaaff0dbcabff0dbeadff0cbfaeff0cc1b0ff0cc2b2ff0bc4b3ff0bc5b5ff0ac7b6ff0ac9b8ff0acab9ff09ccbbff09cdbdff09cfbeff08d0c0ff08d2c1ff08d3c3ff07d5c5ff07d6c6ff07d8c8ff06d9c9ff06dbcbff05dccdff05deceff05dfd0ff04e1d1ff04e2d3ff04e4d5ff03e5d6ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000009ff000018ff000028ff000039ff00004aff00005aff00006aff00007aff00008aff000099ff0000a7ff0002b5ff0009c1ff0011cdff0018d8ff001fe2ff0026ebff002ef4ff0035fbff003cffff0043faff004af6ff0050f2ff0056edff005ce9ff0062e5ff0067e1ff006edcff0073d9ff0078d5ff007dd1ff0081ceff0085caff0089c7ff008ec3ff0092c0ff0095bdff0099baff009cb7ff00a0b4ff00a3b2ff00a6afff00a9adff00acaaff00aea7ff00b1a5ff00b3a3ff00b6a1ff00b89eff00bb9bff00be99ff00c097ff00c295ff00c593ff00c790ff00c98eff02cc8cff04ce89ff05d087ff07d385ff0ad682ff0cd880ff0eda7dff11dd7aff14e077ff16e375ff19e671ff1ce96eff1fec6bff22ef67ff26f264ff2af560ff2df85cff32fd58ff36ff54ff3bfe4fff40fb4bff45f947ff4bf542ff51f23cff57ef37ff5deb32ff64e72dff6ce328ff73de22ff7bd91cff83d416ff8bcf11ff95c90bff9dc305ffa7bd00ffb1b600ffbaaf00ffc4a900ffcfa2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
m_StreamData:
offset: 0
size: 0
path:
--- !u!1001 &1690577281
PrefabInstance:
m_ObjectHideFlags: 0

m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!28 &1915053870
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 128
m_Height: 4
m_CompleteImageSize: 2048
m_TextureFormat: 5
m_MipCount: 1
m_IsReadable: 1
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 1
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_LightmapFormat: 0
m_ColorSpace: 1
image data: 2048
_typelessdata: ffcfffffffb6fafaff9cf5f5ff83f0f0ff69ebebff50e6e6ff36e1e1ff22ddddff21dadaff21d7d7ff20d4d5ff1fd1d2ff1ececfff1dcccdff1cc9caff1bc6c7ff1bc3c4ff1ac0c2ff19bdbfff18bbbcff17b8baff16b5b7ff15b2b4ff15afb2ff14acafff13aaacff12a7a9ff11a4a7ff10a1a4ff0f9ea1ff0f9b9fff0e999cff0d9699ff0c9397ff0b9094ff0a8d91ff098a8eff09878cff088589ff078286ff067f84ff057d82ff057b81ff057a81ff057981ff057880ff057680ff05757fff05747fff04737fff04727eff04707eff046f7dff046e7dff046d7dff046b7cff046a7cff03697bff03687bff03667bff03657aff03647aff036379ff036179ff036079ff025f78ff025e78ff025d77ff025b77ff025a77ff025976ff025876ff025675ff025575ff015475ff015374ff015174ff015073ff014f73ff014e73ff014c72ff014b72ff004a71ff004971ff004871ff004670ff00456eff00436bff004169ff004066ff003e63ff003d61ff003b5eff00395cff003859ff003656ff003454ff003351ff00314eff002f4cff002e49ff002c47ff002b44ff002941ff00273fff00263cff00243aff002237ff002134ff001f32ff001d2fff001c2cff001a2aff001927ff001725ff001522ff00141fff00121dff00101aff000f18ff000d15ff000b12ff000a10ff00080dff00070aff000508ff000305ff000203ff000000ff010505ff020b09ff03100eff041612ff051b17ff06211bff072620ff092c24ff0a3129ff0b362dff0c3c32ff0d4136ff0e473bff0f4c3fff105244ff115748ff125d4dff136251ff146756ff156957ff156957ff156a58ff156a58ff166a58ff166b58ff166b59ff166c59ff176c59ff176c5aff176d5aff176d5aff186d5bff186e5bff186e5bff196f5cff196f5cff196f5cff19705cff1a705dff1a715dff1a715dff1a715eff1b725eff1b725eff1b725fff1b735fff1c735fff1c745fff1c7460ff1c7460ff1d7560ff1d7561ff1d7661ff1d7662ff1d7863ff1d7965ff1c7b66ff1c7c68ff1c7e6aff1b7f6bff1b816dff1b826eff1a8470ff1a8572ff198773ff198975ff198a76ff188c78ff188d7aff188f7bff17907dff17927eff179380ff169582ff169683ff169885ff159986ff159b88ff149c8aff149e8bff149f8dff13a18eff13a290ff13a492ff12a593ff12a795ff12a996ff11aa98ff11ac9aff11ad9bff10af9dff10b09eff0fb2a0ff0fb3a2ff0fb5a3ff0eb6a5ff0eb8a6ff0eb9a8ff0dbbaaff0dbcabff0dbeadff0cbfaeff0cc1b0ff0cc2b2ff0bc4b3ff0bc5b5ff0ac7b6ff0ac9b8ff0acab9ff09ccbbff09cdbdff09cfbeff08d0c0ff08d2c1ff08d3c3ff07d5c5ff07d6c6ff07d8c8ff06d9c9ff06dbcbff05dccdff05deceff05dfd0ff04e1d1ff04e2d3ff04e4d5ff03e5d6ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000000ff000009ff000018ff000028ff000039ff00004aff00005aff00006aff00007aff00008aff000099ff0000a7ff0002b5ff0009c1ff0011cdff0018d8ff001fe2ff0026ebff002ef4ff0035fbff003cffff0043faff004af6ff0050f2ff0056edff005ce9ff0062e5ff0067e1ff006edcff0073d9ff0078d5ff007dd1ff0081ceff0085caff0089c7ff008ec3ff0092c0ff0095bdff0099baff009cb7ff00a0b4ff00a3b2ff00a6afff00a9adff00acaaff00aea7ff00b1a5ff00b3a3ff00b6a1ff00b89eff00bb9bff00be99ff00c097ff00c295ff00c593ff00c790ff00c98eff02cc8cff04ce89ff05d087ff07d385ff0ad682ff0cd880ff0eda7dff11dd7aff14e077ff16e375ff19e671ff1ce96eff1fec6bff22ef67ff26f264ff2af560ff2df85cff32fd58ff36ff54ff3bfe4fff40fb4bff45f947ff4bf542ff51f23cff57ef37ff5deb32ff64e72dff6ce328ff73de22ff7bd91cff83d416ff8bcf11ff95c90bff9dc305ffa7bd00ffb1b600ffbaaf00ffc4a900ffcfa2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &1923236546
GameObject:
m_ObjectHideFlags: 0

10
Packages/manifest.json


"registry": "https://staging-packages.unity.com",
"dependencies": {
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.0.5",
"com.unity.cinemachine": "2.2.6",
"com.unity.analytics": "3.0.9",
"com.unity.cinemachine": "2.2.7",
"com.unity.mathematics": "0.0.12-preview.10",
"com.unity.package-manager-ui": "2.0.0-preview.3",
"com.unity.mathematics": "0.0.12-preview.11",
"com.unity.package-manager-ui": "2.0.0-preview.6",
"com.unity.render-pipelines.lightweight": "3.1.0-preview",
"com.unity.render-pipelines.lightweight": "3.3.0-preview",
"com.unity.textmeshpro": "1.2.4",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0",

2
ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2018.3.0a8
m_EditorVersion: 2018.3.0a9

135
Packages/com.verasl.water-system/Scripts/Rendering/WaterFXPass.cs


using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
[ImageEffectAllowedInSceneView]
public class WaterFXPass : MonoBehaviour, IAfterSkyboxPass
namespace WaterSystem
private WaterFXPassImpl m_WaterFXPass;
[ImageEffectAllowedInSceneView]
public class WaterFXPass : MonoBehaviour, IAfterSkyboxPass
{
private WaterFXPassImpl m_WaterFXPass;
WaterFXPassImpl waterFxPass
{
get
WaterFXPassImpl waterFxPass
if (m_WaterFXPass == null)
m_WaterFXPass = new WaterFXPassImpl();
get
{
if (m_WaterFXPass == null)
m_WaterFXPass = new WaterFXPassImpl();
return m_WaterFXPass;
return m_WaterFXPass;
}
}
public ScriptableRenderPass GetPassToEnqueue(RenderTextureDescriptor baseDescriptor,
RenderTargetHandle colorHandle, RenderTargetHandle depthHandle)
{
return waterFxPass;
public ScriptableRenderPass GetPassToEnqueue(RenderTextureDescriptor baseDescriptor, RenderTargetHandle colorHandle, RenderTargetHandle depthHandle)
public class WaterFXPassImpl : ScriptableRenderPass
return waterFxPass;
}
}
const string k_RenderWaterFXTag = "Render Water FX";
private RenderTargetHandle m_WaterFX = RenderTargetHandle.CameraTarget;
public class WaterFXPassImpl : ScriptableRenderPass
{
const string k_RenderWaterFXTag = "Render Water FX";
private RenderTargetHandle m_WaterFX = RenderTargetHandle.CameraTarget;
private FilterRenderersSettings transparentFilterSettings { get; set; }
private FilterRenderersSettings transparentFilterSettings { get; set; }
public WaterFXPassImpl()
{
RegisterShaderPassName("WaterFX");
m_WaterFX.Init("_WaterFXMap");
transparentFilterSettings = new FilterRenderersSettings(true)
public WaterFXPassImpl()
renderQueueRange = RenderQueueRange.transparent,
};
}
RegisterShaderPassName("WaterFX");
m_WaterFX.Init("_WaterFXMap");
public override void Execute(ScriptableRenderer renderer, ref ScriptableRenderContext context, ref CullResults cullResults, ref RenderingData renderingData)
{
CommandBuffer cmd = CommandBufferPool.Get(k_RenderWaterFXTag);
RenderTextureDescriptor descriptor = ScriptableRenderer.CreateRTDesc(ref renderingData.cameraData);
descriptor.width = (int)(descriptor.width * 0.5f);
descriptor.height = (int)(descriptor.height * 0.5f);
transparentFilterSettings = new FilterRenderersSettings(true)
{
renderQueueRange = RenderQueueRange.transparent,
};
}
using (new ProfilingSample(cmd, k_RenderWaterFXTag))
public override void Execute(ScriptableRenderer renderer, ref ScriptableRenderContext context,
ref CullResults cullResults, ref RenderingData renderingData)
cmd.GetTemporaryRT(m_WaterFX.id, descriptor, FilterMode.Bilinear);
CommandBuffer cmd = CommandBufferPool.Get(k_RenderWaterFXTag);
RenderTextureDescriptor descriptor = ScriptableRenderer.CreateRTDesc(ref renderingData.cameraData);
descriptor.width = (int) (descriptor.width * 0.5f);
descriptor.height = (int) (descriptor.height * 0.5f);
SetRenderTarget(
cmd,
m_WaterFX.Identifier(),
RenderBufferLoadAction.DontCare,
RenderBufferStoreAction.Store,
ClearFlag.Color,
new Color(0.0f, 0.5f, 0.5f, 0.5f),
descriptor.dimension);
using (new ProfilingSample(cmd, k_RenderWaterFXTag))
{
cmd.GetTemporaryRT(m_WaterFX.id, descriptor, FilterMode.Bilinear);
context.ExecuteCommandBuffer(cmd);
cmd.Clear();
SetRenderTarget(
cmd,
m_WaterFX.Identifier(),
RenderBufferLoadAction.DontCare,
RenderBufferStoreAction.Store,
ClearFlag.Color,
new Color(0.0f, 0.5f, 0.5f, 0.5f),
descriptor.dimension);
context.ExecuteCommandBuffer(cmd);
cmd.Clear();
var drawSettings = CreateDrawRendererSettings(renderingData.cameraData.camera,
SortFlags.CommonTransparent, RendererConfiguration.None, renderingData.supportsDynamicBatching);
if (renderingData.cameraData.isStereoEnabled)
{
Camera camera = renderingData.cameraData.camera;
context.StartMultiEye(camera);
context.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, transparentFilterSettings);
context.StopMultiEye(camera);
}
else
context.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, transparentFilterSettings);
var drawSettings = CreateDrawRendererSettings(renderingData.cameraData.camera, SortFlags.CommonTransparent, RendererConfiguration.None, renderingData.supportsDynamicBatching);
if (renderingData.cameraData.isStereoEnabled)
{
Camera camera = renderingData.cameraData.camera;
context.StartMultiEye(camera);
context.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, transparentFilterSettings);
context.StopMultiEye(camera);
else
context.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, transparentFilterSettings);
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
}
public override void FrameCleanup(CommandBuffer cmd)
{
base.FrameCleanup(cmd);
if (m_WaterFX != RenderTargetHandle.CameraTarget)
public override void FrameCleanup(CommandBuffer cmd)
cmd.ReleaseTemporaryRT(m_WaterFX.id);
base.FrameCleanup(cmd);
if (m_WaterFX != RenderTargetHandle.CameraTarget)
{
cmd.ReleaseTemporaryRT(m_WaterFX.id);
}
}
}
}

8
Packages/com.verasl.water-system/Data.meta


fileFormatVersion: 2
guid: a28afa3e85133492baf302b1d3849fe9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

17
Packages/com.verasl.water-system/Data/WaterResources.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace WaterSystem
{
/// <summary>
/// This scriptable object holds default resources for the water rendering
/// </summary>
[System.Serializable][CreateAssetMenu(fileName = "WaterResources", menuName = "WaterSystem/Resource", order = 0)]
public class WaterResources : ScriptableObject
{
public Texture2D defaultFoamRamp; // a default foam ramp for the basic foam setting
public Texture2D defaultFoamMap; // a default foam texture map
public Texture2DArray defaultSurfaceMap; // a default normal/caustic map
}
}

11
Packages/com.verasl.water-system/Data/WaterResources.cs.meta


fileFormatVersion: 2
guid: e73e41b71c5f541679f1bb37dee026c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

26
Packages/com.verasl.water-system/Data/WaterSettingsData.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7ad544ee67a064d3eb407c8c47c67b8d, type: 3}
m_Name: WaterSettingsData
m_EditorClassIdentifier:
waterGeomType: 0
refType: 2
planarSettings:
m_ResolutionMultiplier: 2
m_ClipPlaneOffset: 0.24
m_ReflectLayers:
serializedVersion: 2
m_Bits: 4294967295
enableShadows: 0
maxLODLevel: 2
cubemapRefType: {fileID: 8900000, guid: a90d3c9b1c3ed4d36bffc02f6b335464, type: 3}
isInfinite: 0
originOffset: {x: 0, y: 0, z: 500, w: 500}

8
Packages/com.verasl.water-system/Data/WaterSettingsData.asset.meta


fileFormatVersion: 2
guid: a4cacf74654e54b35b9eaea74fd20b4e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

45
Packages/com.verasl.water-system/Data/WaterSettingsData.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
namespace WaterSystem.Data
{
/// <summary>
/// This scriptable object stores teh graphical/rendering settings for a water system
/// </summary>
[System.Serializable][CreateAssetMenu(fileName = "WaterSettingsData", menuName = "WaterSystem/Settings", order = 0)]
public class WaterSettingsData : ScriptableObject
{
public GeometryType waterGeomType; // The type of geometry, either vertex offset or tessellation
public ReflectionType refType = ReflectionType.PlanarReflection; // How the reflecitons are generated
// planar
public PlanerReflections.PlanarReflectionSettings planarSettings; // Planar reflection settings
// cubemap
public Cubemap cubemapRefType; // custom cubemap reference
public bool isInfinite; // Is the water infinite (shader incomplete)
public Vector4 originOffset = new Vector4(0f, 0f, 500f, 500f);
}
/// <summary>
/// The type of reflection source, custom cubemap, closest refelction probe, planar reflection
/// </summary>
[System.Serializable]
public enum ReflectionType
{
Cubemap,
ReflectionProbe,
PlanarReflection
}
/// <summary>
/// The type of geometry, either vertex offset or tessellation
/// </summary>
[System.Serializable]
public enum GeometryType
{
VertexOffset,
Tesselation
}
}

11
Packages/com.verasl.water-system/Data/WaterSettingsData.cs.meta


fileFormatVersion: 2
guid: 7ad544ee67a064d3eb407c8c47c67b8d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

228
Packages/com.verasl.water-system/Data/WaterSurfaceData.asset


%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: b17284ebf5e80436eb6089f8c7459dab, type: 3}
m_Name: WaterSurfaceData
m_EditorClassIdentifier:
_waterMaxVisibility: 40
_absorptionRamp:
serializedVersion: 2
key0: {r: 0.8117647, g: 1, b: 1, a: 1}
key1: {r: 0.13510147, g: 0.8679245, b: 0.8679245, a: 1}
key2: {r: 0.021626905, g: 0.49048996, b: 0.509434, a: 0}
key3: {r: 0, g: 0.275, b: 0.44, 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: 3470
ctime2: 20817
ctime3: 43581
ctime4: 65535
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_NumColorKeys: 5
m_NumAlphaKeys: 2
_scatterRamp:
serializedVersion: 2
key0: {r: 0, g: 0, b: 0, a: 1}
key1: {r: 0.08, g: 0.41, b: 0.34, a: 1}
key2: {r: 0.115566045, g: 0.46226418, b: 0.38125992, a: 0}
key3: {r: 0.01176471, g: 0.90588236, b: 0.84650886, 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: 9830
ctime2: 27525
ctime3: 65535
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_NumColorKeys: 4
m_NumAlphaKeys: 2
_waves:
- amplitude: 4.9
direction: -6.03
wavelength: 5.09
origin: {x: -53.403767, y: 105.14393}
onmiDir: 1
- amplitude: 1.82
direction: 178
wavelength: 3.3500388
origin: {x: 0, y: 0}
onmiDir: 0
- amplitude: 0.5
direction: 6.532788
wavelength: 7.455916
origin: {x: 0, y: 0}
onmiDir: 1
- amplitude: 0.7
direction: 4.051435
wavelength: 4.6626315
origin: {x: 0, y: 0}
onmiDir: 1
- amplitude: 0.5
direction: 2.0216856
wavelength: 2.6733496
origin: {x: 0, y: 0}
onmiDir: 1
- amplitude: 0.5
direction: -39
wavelength: 2.9848163
origin: {x: 0, y: 0}
onmiDir: 1
_customWaves: 0
randomSeed: 891
_basicWaveSettings:
numWaves: 6
amplitude: 0.8
direction: -177
wavelength: 8
_foamSettings:
foamType: 1
basicFoam:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.25280517
value: 0
inSlope: 3.040578
outSlope: 3.040578
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0.07297084
- serializedVersion: 3
time: 1
value: 0.925
inSlope: 2.2884614
outSlope: 2.2884614
tangentMode: 0
weightedMode: 0
inWeight: 0.06255044
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
liteFoam:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.2
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.4
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.7
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
mediumFoam:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.4
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.7
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
denseFoam:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.7
value: 0
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
_init: 1

8
Packages/com.verasl.water-system/Data/WaterSurfaceData.asset.meta


fileFormatVersion: 2
guid: 846f3dc3b5341447a86687211f741bc7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

85
Packages/com.verasl.water-system/Data/WaterSurfaceData.cs


using System.Collections.Generic;
using UnityEngine;
namespace WaterSystem.Data
{
/// <summary>
/// This scriptable object contains setting for how the water looks visually
/// </summary>
[System.Serializable][CreateAssetMenu(fileName = "WaterSurfaceData", menuName = "WaterSystem/Surface Data", order = 0)]
public class WaterSurfaceData : ScriptableObject
{
public float _waterMaxVisibility = 40.0f;
public Gradient _absorptionRamp;
public Gradient _scatterRamp;
public List<Wave> _waves = new List<Wave>();
public bool _customWaves = false;
public int randomSeed = 3234;
public BasicWaves _basicWaveSettings = new BasicWaves(1.5f, 45.0f, 5.0f);
public FoamSettings _foamSettings = new FoamSettings();
[SerializeField]
public bool _init = false;
}
[System.Serializable]
public struct Wave
{
public float amplitude; // height of the wave in units(m)
public float direction; // direction the wave travels in degrees from Z+
public float wavelength; // distance between crest>crest
public Vector2 origin; // Omi directional point of origin
public float onmiDir; // Is omni?
public Wave(float amp, float dir, float length, Vector2 org, bool omni)
{
amplitude = amp;
direction = dir;
wavelength = length;
origin = org;
onmiDir = omni ? 1 : 0;
}
}
[System.Serializable]
public class BasicWaves
{
public int numWaves = 6;
public float amplitude;
public float direction;
public float wavelength;
public BasicWaves(float amp, float dir, float len)
{
numWaves = 6;
amplitude = amp;
direction = dir;
wavelength = len;
}
}
[System.Serializable]
public class FoamSettings
{
public int foamType; // 0=default, 1=simple, 3=custom
public AnimationCurve basicFoam;
public AnimationCurve liteFoam;
public AnimationCurve mediumFoam;
public AnimationCurve denseFoam;
// Foam curves
public FoamSettings()
{
foamType = 0;
basicFoam = new AnimationCurve(new Keyframe[2]{new Keyframe(0.25f, 0f),
new Keyframe(1f, 1f)});
liteFoam = new AnimationCurve(new Keyframe[3]{new Keyframe(0.2f, 0f),
new Keyframe(0.4f, 1f),
new Keyframe(0.7f, 0f)});
mediumFoam = new AnimationCurve(new Keyframe[3]{new Keyframe(0.4f, 0f),
new Keyframe(0.7f, 1f),
new Keyframe(1f, 0f)});
denseFoam = new AnimationCurve(new Keyframe[2]{new Keyframe(0.7f, 0f),
new Keyframe(1f, 1f)});
}
}
}

11
Packages/com.verasl.water-system/Data/WaterSurfaceData.cs.meta


fileFormatVersion: 2
guid: b17284ebf5e80436eb6089f8c7459dab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.verasl.water-system/Editor.meta


fileFormatVersion: 2
guid: ff6ef3b3109514061b996e1f998625ba
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

46
Packages/com.verasl.water-system/Editor/PlanarSettingsDrawer.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
namespace WaterSystem
{
[CustomPropertyDrawer(typeof(PlanerReflections.PlanarReflectionSettings))]
public class PlanarSettingsDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
// Don't make child fields be indented
var indent = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
// Rects
Rect resMultiRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
Rect offsetRect = new Rect(position.x, resMultiRect.yMax + EditorGUIUtility.standardVerticalSpacing, position.width, EditorGUIUtility.singleLineHeight);
Rect layerMaskRect = new Rect(position.x, offsetRect.yMax + EditorGUIUtility.standardVerticalSpacing, position.width, EditorGUIUtility.singleLineHeight);
Rect shadowRect = new Rect(position.x, layerMaskRect.yMax + EditorGUIUtility.standardVerticalSpacing, position.width * 0.5f, EditorGUIUtility.singleLineHeight);
Rect maxLODRect = new Rect(position.x + position.width * 0.5f, layerMaskRect.yMax + EditorGUIUtility.standardVerticalSpacing, position.width * 0.5f, EditorGUIUtility.singleLineHeight);
var resMulti = property.FindPropertyRelative("m_ResolutionMultiplier");
EditorGUI.PropertyField(resMultiRect, resMulti);
position.y += EditorGUIUtility.singleLineHeight;
var offset = property.FindPropertyRelative("m_ClipPlaneOffset");
EditorGUI.Slider(offsetRect, offset, -0.500f, 0.500f);
var layerMask = property.FindPropertyRelative("m_ReflectLayers");
EditorGUI.PropertyField(layerMaskRect, layerMask);
// Set indent back to what it was
EditorGUI.indentLevel = indent;
EditorGUI.EndProperty();
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) * 4f;
}
}
}

11
Packages/com.verasl.water-system/Editor/PlanarSettingsDrawer.cs.meta


fileFormatVersion: 2
guid: e0bc0b238a7fa4c69938228f2c8d657e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

79
Packages/com.verasl.water-system/Editor/WaterEditor.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using WaterSystem.Data;
namespace WaterSystem
{
[CustomEditor(typeof(Water))]
public class WaterEditor : Editor
{
public override void OnInspectorGUI()
{
serializedObject.Update();
Water w = (Water)target;
var waterSettingsData = serializedObject.FindProperty("settingsData");
EditorGUILayout.PropertyField(waterSettingsData, true);
if(waterSettingsData.objectReferenceValue != null)
{
CreateEditor((WaterSettingsData)waterSettingsData.objectReferenceValue).OnInspectorGUI();
}
var waterSurfaceData = serializedObject.FindProperty("surfaceData");
EditorGUILayout.PropertyField(waterSurfaceData, true);
if(waterSurfaceData.objectReferenceValue != null)
{
CreateEditor((WaterSurfaceData)waterSurfaceData.objectReferenceValue).OnInspectorGUI();
}
serializedObject.ApplyModifiedProperties();
if(GUI.changed)
{
w.Init();
}
}
void OnSceneGUI()
{
Water w = target as Water;
Camera cam = SceneView.currentDrawingSceneView.camera;
var waveDebug = serializedObject.FindProperty("_debugMode");
if (cam && waveDebug.intValue != 0)
{
Vector3 pos = Vector3.zero;
float dist = 10f;
if (waveDebug.intValue == 2)
{
Plane p = new Plane(Vector3.zero, Vector3.forward, Vector3.right);
Ray r = Camera.current.ViewportPointToRay(new Vector2(0.25f, 0.25f));
if (p.Raycast(r, out dist))
{
pos = Camera.current.ViewportToWorldPoint(new Vector3(0.25f, 0.25f, dist));
}
}
for (int i = w._waves.Length - 1; i >= 0; i--)
{
Wave wave = w._waves[i];
Random.InitState(i);
Color c = Color.HSVToRGB(Random.Range(0f, 1f), 1f, 1f);
c.a = Mathf.Clamp01(0.01f * dist - 0.1f) * 0.5f;
Handles.color = c;
pos.y = wave.amplitude;
DrawWaveGizmo(pos, wave.direction, wave.amplitude, wave.wavelength);
}
}
}
void DrawWaveGizmo(Vector3 pos, float angle, float size, float length)
{
Handles.DrawSolidDisc(pos, Vector3.up, length / 2f);
Handles.ArrowHandleCap(0, pos, Quaternion.AngleAxis(angle, Vector3.up), -length / 1.75f, EventType.Repaint);
}
}
}

11
Packages/com.verasl.water-system/Editor/WaterEditor.cs.meta


fileFormatVersion: 2
guid: 7760ef1f46dfd455cae527e7f91824d3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

47
Packages/com.verasl.water-system/Editor/WaterSettingsDataEditor.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
namespace WaterSystem.Data
{
[CustomEditor(typeof(WaterSettingsData))]
public class WaterSettingsDataEditor : Editor
{
public override void OnInspectorGUI()
{
var geomType = serializedObject.FindProperty("waterGeomType");
EditorGUILayout.PropertyField(geomType);
var refType = serializedObject.FindProperty("refType");
refType.enumValueIndex = GUILayout.Toolbar(refType.enumValueIndex, refType.enumDisplayNames);
switch(refType.enumValueIndex)
{
case 0:
{
// cubemap
var cube = serializedObject.FindProperty("cubemapRefType");
EditorGUILayout.PropertyField(cube, new GUIContent("Cubemap Texture"));
}
break;
case 1:
{
// probe
EditorGUILayout.HelpBox("Reflection Probe setting has no options, it automatically uses the nearest reflection probe to the main camera", MessageType.Info);
}
break;
case 2:
{
// planar
var planarSettings = serializedObject.FindProperty("planarSettings");
EditorGUILayout.PropertyField(planarSettings, true);
}
break;
}
serializedObject.ApplyModifiedProperties();
}
}
}

11
Packages/com.verasl.water-system/Editor/WaterSettingsDataEditor.cs.meta


fileFormatVersion: 2
guid: 0935a4ad227524d3cae739e174b846b2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

361
Packages/com.verasl.water-system/Editor/WaterSurfaceDataEditor.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
namespace WaterSystem.Data
{
[CustomEditor(typeof(WaterSurfaceData))]
public class WaterSurfaceDataEditor : Editor
{
[SerializeField]
ReorderableList waveList;
private void OnEnable()
{
var init = serializedObject.FindProperty("_init");
if(init.boolValue == false)
Setup();
var standardHeight = EditorGUIUtility.singleLineHeight;
var standardLine = standardHeight + EditorGUIUtility.standardVerticalSpacing;
//Reorderable list stuff////////////////////////////////////////////////
waveList = new ReorderableList(serializedObject, serializedObject.FindProperty("_waves"), true, true, true, true);
//Single entry GUI
waveList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
{
var element = waveList.serializedProperty.GetArrayElementAtIndex(index);
rect.y += 2;
// Swell height
var preWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = rect.width * 0.2f;
Rect ampRect = new Rect(rect.x, rect.y + standardLine, rect.width * 0.5f, standardHeight);
var waveAmp = element.FindPropertyRelative("amplitude");
waveAmp.floatValue = EditorGUI.Slider(ampRect, "Swell Height", waveAmp.floatValue, 0.1f, 30f);
// Wavelength
Rect lengthRect = new Rect(rect.x + ampRect.width, rect.y + standardLine, rect.width * 0.5f, standardHeight);
var waveLen = element.FindPropertyRelative("wavelength");
waveLen.floatValue = EditorGUI.Slider(lengthRect, "Wavelength", waveLen.floatValue, 1.0f, 200f);
EditorGUIUtility.labelWidth = preWidth;
// Directional controls
Rect dirToggleRect = new Rect(rect.x, rect.y + 2 + standardLine * 2, rect.width * 0.5f, standardHeight);
Rect omniToggleRect = new Rect(rect.x + rect.width * 0.5f, dirToggleRect.y, rect.width * 0.5f, standardHeight);
Rect containerRect = new Rect(rect.x, dirToggleRect.y + 1, rect.width, standardLine * 3.2f);
// Direction/origin
var waveType = element.FindPropertyRelative("onmiDir");
var wTypeBool = (int)waveType.floatValue == 1 ? true : false;
GUI.Box(containerRect, "", EditorStyles.helpBox );
wTypeBool = !GUI.Toggle(dirToggleRect, !wTypeBool, "Directional", EditorStyles.miniButtonLeft);
wTypeBool = GUI.Toggle(omniToggleRect, wTypeBool, "Omni-directional", EditorStyles.miniButtonRight);
waveType.floatValue = wTypeBool ? 1 : 0;
Rect dirRect = new Rect(rect.x + 4, dirToggleRect.y + standardLine, rect.width - 8, standardHeight);
Rect buttonRect = new Rect(rect.x + 4, dirRect.y + standardLine + 2, rect.width - 8, standardHeight);
// Directional
if(!wTypeBool)
{
var waveDir = element.FindPropertyRelative("direction");
waveDir.floatValue = EditorGUI.Slider(dirRect, "Facing Direction", waveDir.floatValue, -180.0f, 180.0f);
if(GUI.Button(buttonRect, "Align with Scene Camera"))
waveDir.floatValue = CameraRelativeDirection();
}
else
{// Omni-Directional
EditorGUIUtility.wideMode = true;
//var perWidth = EditorGUIUtility.labelWidth;
//EditorGUIUtility.labelWidth = 20f;
var waveOrig = element.FindPropertyRelative("origin");
waveOrig.vector2Value = EditorGUI.Vector2Field(dirRect, "Point of Origin", waveOrig.vector2Value);
if(GUI.Button(buttonRect, "Project Origin from Scene Camera"))
waveOrig.vector2Value = CameraRelativeOrigin(waveOrig.vector2Value);
//EditorGUIUtility.labelWidth = perWidth;
}
};
// Check can remove to make sure at least one wave remains
waveList.onCanRemoveCallback = (ReorderableList l) =>
{
return l.count > 1;
};
// Check on remove to give a warning incase removing by accident
waveList.onRemoveCallback = (ReorderableList l) =>
{
if (EditorUtility.DisplayDialog("Warning!", "Are you sure you want to delete the wave?", "Yes", "No"))
{
ReorderableList.defaultBehaviours.DoRemoveButton(l);
}
};
// When adding, check if under 10, if so add a new random wave
waveList.onAddCallback = (ReorderableList l) =>
{
var index = l.serializedProperty.arraySize;
if (index < 10)
{
l.serializedProperty.arraySize++;
l.index = index;
var element = l.serializedProperty.GetArrayElementAtIndex(index);
element.FindPropertyRelative("amplitude").floatValue = Random.Range(0.25f, 1.5f);
element.FindPropertyRelative("direction").floatValue = Random.Range(-180f, 180f);
element.FindPropertyRelative("wavelength").floatValue = Random.Range(2f, 8f);
}
else
{
EditorUtility.DisplayDialog("Warning!", "You have reached the limit of 10 waves for this Water.", "Close");
}
};
//Draw header
waveList.drawHeaderCallback = (Rect rect) =>
{
EditorGUI.LabelField(rect, "Wave List");
};
//Do height of list entry
waveList.elementHeightCallback = (index) =>
{
var elementHeight = standardLine * 6f;
return elementHeight;
};
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.LabelField("Visual Settings", EditorStyles.boldLabel);
EditorGUI.indentLevel += 1;
// Max visibility - slider 3-300
var maxDepth = serializedObject.FindProperty("_waterMaxVisibility");
EditorGUILayout.Slider(maxDepth, 3, 300, new GUIContent("Maximum Visibility", maxDepthTT));
// Colouring settings
DoSmallHeader("Coloring Controls");
// Absorbstion Ramp
var absorpRamp = serializedObject.FindProperty("_absorptionRamp");
EditorGUILayout.PropertyField(absorpRamp, new GUIContent("Absorption Color", absorpRampTT), true, null);
// Scatter Ramp
var scatterRamp = serializedObject.FindProperty("_scatterRamp");
EditorGUILayout.PropertyField(scatterRamp, new GUIContent("Scattering Color", scatterRampTT), true, null);
// Foam Ramps
DoSmallHeader("Surface Foam");
var foamSettings = serializedObject.FindProperty("_foamSettings");
var foamType = foamSettings.FindPropertyRelative("foamType");
foamType.intValue = GUILayout.Toolbar(foamType.intValue, foamTypeOptions);
EditorGUILayout.Space();
switch (foamType.intValue)
{
case 0: //// Auto ////
{
EditorGUILayout.HelpBox("Automatic will distribute the foam suitable for an average swell", MessageType.Info);
}
break;
case 1: //// Simple ////
{
EditorGUILayout.BeginHorizontal();
DoInlineLabel("Foam Profile", foamCurveTT, 50f);
var basicFoam = foamSettings.FindPropertyRelative("basicFoam");
basicFoam.animationCurveValue = EditorGUILayout.CurveField(basicFoam.animationCurveValue, Color.white, new Rect(Vector2.zero, Vector2.one));
EditorGUILayout.EndHorizontal();
}
break;
case 2: //// Simple ////
{
EditorGUILayout.BeginHorizontal();
DoInlineLabel("Foam Profiles", foam3curvesTT, 50f);
var liteFoam = foamSettings.FindPropertyRelative("liteFoam");
liteFoam.animationCurveValue = EditorGUILayout.CurveField(liteFoam.animationCurveValue, new Color(0.5f, 0.75f, 1f, 1f), new Rect(Vector2.zero, Vector2.one));
var mediumFoam = foamSettings.FindPropertyRelative("mediumFoam");
mediumFoam.animationCurveValue = EditorGUILayout.CurveField(mediumFoam.animationCurveValue, new Color(0f, 0.5f, 1f, 1f), new Rect(Vector2.zero, Vector2.one));
var denseFoam = foamSettings.FindPropertyRelative("denseFoam");
denseFoam.animationCurveValue = EditorGUILayout.CurveField(denseFoam.animationCurveValue, Color.blue, new Rect(Vector2.zero, Vector2.one));
EditorGUILayout.EndHorizontal();
}
break;
}
EditorGUI.indentLevel -= 1;
EditorGUILayout.LabelField("Wave Settings", EditorStyles.boldLabel);
EditorGUI.indentLevel += 1;
// Wave type - Automatic / Customized
//wavesType = EditorGUILayout.Popup("System Type", wavesType, wavesTypeOptions);
// Toolbar labels here
var customWaves = serializedObject.FindProperty("_customWaves");
var intVal = customWaves.boolValue ? 1 : 0;
intVal = GUILayout.Toolbar(intVal, wavesTypeOptions);
customWaves.boolValue = intVal == 1 ? true : false;
EditorGUILayout.Space();
switch(customWaves.boolValue ? 1 : 0)
{
case 0: //// Automatic ////
{
var basicSettings = serializedObject.FindProperty("_basicWaveSettings");
// Wave count (display warning of on mobile platform and over 6) dropdown 1 > 10
var autoCount = basicSettings.FindPropertyRelative("numWaves");
EditorGUILayout.IntSlider(autoCount, 1, 10, new GUIContent("Wave Count", waveCountTT), null);
// Average Wave height - slider 0.05 - 30
var avgHeight = basicSettings.FindPropertyRelative("amplitude");
EditorGUILayout.Slider(avgHeight, 0.1f, 30.0f, new GUIContent("Avg Swell Height", avgHeightTT), null);
// Average Wavelength - slider 1 - 200
var avgWavelength = basicSettings.FindPropertyRelative("wavelength");
EditorGUILayout.Slider(avgWavelength, 1.0f, 200.0f, new GUIContent("Avg Wavelength", avgWavelengthTT), null);
// Wind direction - slider -180-180
EditorGUILayout.BeginHorizontal();
var windDir = basicSettings.FindPropertyRelative("direction");
EditorGUILayout.Slider(windDir, -180.0f, 180.0f, new GUIContent("Wind Direction", windDirTT), null);
if(GUILayout.Button(new GUIContent("Align to scene camera", alignButtonTT)))
windDir.floatValue = CameraRelativeDirection();
EditorGUILayout.EndHorizontal();
// [override] - random otherwise(on creation/override check)
// Random seed - int input
EditorGUILayout.BeginHorizontal();
var randSeed = serializedObject.FindProperty("randomSeed");
randSeed.intValue = EditorGUILayout.IntField(new GUIContent("Random Seed", randSeedTT), randSeed.intValue);
if (GUILayout.Button("Randomize Waves"))
{
randSeed.intValue = System.DateTime.Now.Millisecond * 100 - System.DateTime.Now.Millisecond;
}
EditorGUILayout.EndHorizontal();
}
break;
case 1: //// Customized ////
{
EditorGUI.indentLevel -= 1;
// Re-orderable list with wave details
waveList.DoLayoutList();
/// Type - Directional / Omi-directional
//// Amplitude - slider 0.05 - 30
//// Wavelength - slider 1 - 200
////// Direction(facing) - slider -180-180 && face scene camera direction(if scene view)
// OR
////// Origin(point of origin) - Vector input && origin at camera aim
}
break;
}
EditorUtility.SetDirty(this);
serializedObject.ApplyModifiedProperties();
}
void DoSmallHeader(string header)
{
EditorGUI.indentLevel -= 1;
EditorGUILayout.LabelField(header, EditorStyles.miniBoldLabel);
EditorGUI.indentLevel += 1;
}
void DoInlineLabel(string label, string tooltip, float width)
{
var preWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = width;
EditorGUILayout.LabelField(new GUIContent(label, tooltip));
EditorGUIUtility.labelWidth = preWidth;
}
void Setup()
{
WaterSurfaceData wsd = (WaterSurfaceData)target;
wsd._init = true;
wsd._absorptionRamp = DefaultAbsorptionGrad();
wsd._scatterRamp = DefaultScatterGrad();
EditorUtility.SetDirty(wsd);
}
Gradient DefaultAbsorptionGrad() // Preset for absorption
{
Gradient g = new Gradient();
GradientColorKey[] gck = new GradientColorKey[5];
GradientAlphaKey[] gak = new GradientAlphaKey[1];
gak[0].alpha = 1;
gak[0].time = 0;
gck[0].color = Color.white;
gck[0].time = 0f;
gck[1].color = new Color(0.22f, 0.87f, 0.87f);
gck[1].time = 0.082f;
gck[2].color = new Color(0f, 0.47f, 0.49f);
gck[2].time = 0.318f;
gck[3].color = new Color(0f, 0.275f, 0.44f);
gck[3].time = 0.665f;
gck[4].color = Color.black;
gck[4].time = 1f;
g.SetKeys(gck, gak);
return g;
}
Gradient DefaultScatterGrad() // Preset for scattering
{
Gradient g = new Gradient();
GradientColorKey[] gck = new GradientColorKey[4];
GradientAlphaKey[] gak = new GradientAlphaKey[1];
gak[0].alpha = 1;
gak[0].time = 0;
gck[0].color = Color.black;
gck[0].time = 0f;
gck[1].color = new Color(0.08f, 0.41f, 0.34f);
gck[1].time = 0.15f;
gck[2].color = new Color(0.13f, 0.55f, 0.45f);
gck[2].time = 0.42f;
gck[3].color = new Color(0.21f, 0.62f, 0.6f);
gck[3].time = 1f;
g.SetKeys(gck, gak);
return g;
}
float CameraRelativeDirection()
{
float degrees = 0;
Vector3 camFwd = UnityEditor.SceneView.lastActiveSceneView.camera.transform.forward;
camFwd.y = 0f;
camFwd.Normalize();
float dot = Vector3.Dot(-Vector3.forward, camFwd);
degrees = Mathf.LerpUnclamped(90.0f, 180.0f, dot);
if(camFwd.x < 0)
degrees *= -1f;
return Mathf.RoundToInt(degrees * 1000) / 1000;
}
Vector2 CameraRelativeOrigin(Vector2 original)
{
Camera sceneCam = UnityEditor.SceneView.lastActiveSceneView.camera;
float angle = 90f - Vector3.Angle(sceneCam.transform.forward, Vector3.down);
if (angle > 0.1f)
{
Vector3 intersect = Vector2.zero;
float hypot = (sceneCam.transform.position.y) * (1 / Mathf.Sin(Mathf.Deg2Rad * angle));
Vector3 fwd = sceneCam.transform.forward * hypot;
intersect = fwd + sceneCam.transform.position;
return new Vector2(intersect.x, intersect.z);
}
else
{
return original;
}
}
static string[] wavesTypeOptions = new string[] { "Automatic", "Customized" };
static string[] foamTypeOptions = new string[3] { "Automatic", "Simple Curve", "Density Curves" };
////TOOLTIPS////
private string maxDepthTT = "This controls the max depth of the waters transparency/visiblility, the absorption and scattering gradients map to this depth. Units:Meters";
private string absorpRampTT = "This gradient controls the color of the water as it gets deeper, darkening the surfaces under the water as they get deeper.";
private string scatterRampTT = "This gradient controls the 'scattering' of the water from shallow to deep, lighting the water as there becomes more of it.";
private string waveCountTT = "Number of waves the automatic setup creates, if aiming for mobile set to 6 or less";
private string avgHeightTT = "The average height of the waves. Units:Meters";
private string avgWavelengthTT = "The average wavelength of the waves. Units:Meters";
private string windDirTT = "The general wind direction, this is in degrees from Z+";
private string alignButtonTT = "This aligns the wave direction to the current scene view camera facing direction";
private string foamCurveTT = "This curve control the foam propagation. X is wave height and Y is foam opacity";
private string foam3curvesTT = "These three curves control the Lite, Medium and Dense foam propagation. X is wave height and Y is foam opacity";
private string randSeedTT = "This seed controls the automatic wave generation";
}
}

11
Packages/com.verasl.water-system/Editor/WaterSurfaceDataEditor.cs.meta


fileFormatVersion: 2
guid: 1016bd3ba0af54af184326cd470c1bb3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.verasl.water-system/Meshes.meta


fileFormatVersion: 2
guid: bc33e2c6cda7143a3b9bd922abb88865
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

68
Packages/com.verasl.water-system/Meshes/InfiniteSea.fbx


Kaydara FBX Binary ��FBXHeaderExtension\FBXHeaderVersionI�x
FBXVersionI��EncryptionTypeI�CreationTimeStamp�VersionI��YearI��MonthI DayI'HourI?MinuteIWSecondI t MillisecondI�'CreatorS"FBX SDK/FBX Plugins version 2015.1�' SceneInfoSGlobalInfoSceneInfoSUserData TypeSUserData0VersionId MetaData^VersionId�TitleS InfiniteSea�SubjectS�AuthorS�KeywordsS�RevisionS�CommentS� Properties70��PS DocumentUrlSKStringSUrlSSd/Users/andremcgrail/Documents/UnityProjects/SRP/BoatAttack/Assets/WaterSystem/Meshes/InfiniteSea.fbxg�PSSrcDocumentUrlSKStringSUrlSSd/Users/andremcgrail/Documents/UnityProjects/SRP/BoatAttack/Assets/WaterSystem/Meshes/InfiniteSea.fbx�$PSOriginalSCompoundSS�EPSOriginal|ApplicationVendorSKStringSSS The Foundry6<PSOriginal|ApplicationNameSKStringSSSMODO;PSOriginal|ApplicationVersionSKStringSSS�MPSOriginal|DateTime_GMTSDateTimeSSS24/12/2017 18:03:12.0001PSOriginal|FileNameSKStringSSSL%PS LastSavedSCompoundSS�FPSLastSaved|ApplicationVendorSKStringSSS The Foundry�=PSLastSaved|ApplicationNameSKStringSSSMODO5<PSLastSaved|ApplicationVersionSKStringSSS�NPSLastSaved|DateTime_GMTSDateTimeSSS24/12/2017 18:03:12.000�FileIdR)�(��-�̱ƽ.�.�� CreationTimeS2017-12-24 18:03:12:000_6CreatorS1FBX SDK/FBX Plugins version 2015.1 build=20140408� GlobalSettings�VersionI�� Properties70�)PSUpAxisSintSIntegerSI -PS
UpAxisSignSintSIntegerSIX ,PS FrontAxisSintSIntegerSI� 0PS FrontAxisSignSintSIntegerSI� ,PS CoordAxisSintSIntegerSI
0PS CoordAxisSignSintSIntegerSIM
1PSOriginalUpAxisSintSIntegerSI�����
5PSOriginalUpAxisSignSintSIntegerSI�
8PSUnitScaleFactorSdoubleSNumberSD�?$ @PSOriginalUnitScaleFactorSdoubleSNumberSD�?z HPS AmbientColorSColorRGBSColorSDDD� APS DefaultCameraSKStringSSSProducer Perspective� %PSTimeModeSenumSSI 3 )PS TimeProtocolSenumSSIm ,PSSnapOnFrameModeSenumSSI� 3PS TimeSpanStartSKTimeSTimeSL� 2PS TimeSpanStopSKTimeSTimeSLp6��54 8PSCustomFrameRateSdoubleSNumberSD��h &PS
TimeMarkerSCompoundSS� 4PSCurrentTimeMarkerSintSIntegerSI����� Documents� CountI�DocumentL�?`SSScene� Properties70k&PS SourceObjectSobjectSS�3PSActiveAnimStackNameSKStringSSS� RootNodeL
Referencesv2 DefinitionsFVersionId]CountI�
ObjectTypeSGlobalSettings�CountI�
ObjectTypeSGeometry�CountI� PropertyTemplateSFbxMesh� Properties70wAPSColorSColorRGBSColorSD�������?D�������?D�������?�DPSBBoxMinSVector3DSVectorSDDDDPSBBoxMaxSVector3DSVectorSDDDX/PSPrimary VisibilitySboolSSI�*PS Casts ShadowsSboolSSI�,PSReceive ShadowsSboolSSI�%
ObjectTypeSModel)CountI�% PropertyTemplateSFbxNodez% Properties70�2PSQuaternionInterpolateSenumSSIKPSRotationOffsetSVector3DSVectorSDDD\JPS RotationPivotSVector3DSVectorSDDD�JPS ScalingOffsetSVector3DSVectorSDDD IPS ScalingPivotSVector3DSVectorSDDDG.PSTranslationActiveSboolSSI�KPSTranslationMinSVector3DSVectorSDDD�KPSTranslationMaxSVector3DSVectorSDDD3,PSTranslationMinXSboolSSIm,PSTranslationMinYSboolSSI�,PSTranslationMinZSboolSSI�,PSTranslationMaxXSboolSSI,PSTranslationMaxYSboolSSIU,PSTranslationMaxZSboolSSI�*PS RotationOrderSenumSSI�6PSRotationSpaceForLimitOnlySboolSSI;PSRotationStiffnessXSdoubleSNumberSDc;PSRotationStiffnessYSdoubleSNumberSD�;PSRotationStiffnessZSdoubleSNumberSD�0PSAxisLenSdoubleSNumberSD$@@HPS PreRotationSVector3DSVectorSDDD�IPS PostRotationSVector3DSVectorSDDD�+PSRotationActiveSboolSSI&HPS RotationMinSVector3DSVectorSDDD|HPS RotationMaxSVector3DSVectorSDDD�)PS RotationMinXSboolSSI�)PS RotationMinYSboolSSI!)PS RotationMinZSboolSSIX)PS RotationMaxXSboolSSI�)PS RotationMaxYSboolSSI�)PS RotationMaxZSboolSSI�(PS InheritTypeSenumSSI4*PS ScalingActiveSboolSSI�GPS
ScalingMinSVector3DSVectorSDDD�GPS
ScalingMaxSVector3DSVectorSD�?D�?D�?(PS ScalingMinXSboolSSIJ(PS ScalingMinYSboolSSI�(PS ScalingMinZSboolSSI�(PS ScalingMaxXSboolSSI�(PS ScalingMaxYSboolSSI"(PS ScalingMaxZSboolSSI�QPSGeometricTranslationSVector3DSVectorSDDD�NPSGeometricRotationSVector3DSVectorSDDD8MPSGeometricScalingSVector3DSVectorSD�?D�?D�?|6PS MinDampRangeXSdoubleSNumberSD�6PS MinDampRangeYSdoubleSNumberSD6PS MinDampRangeZSdoubleSNumberSDH6PS MaxDampRangeXSdoubleSNumberSD�6PS MaxDampRangeYSdoubleSNumberSD�6PS MaxDampRangeZSdoubleSNumberSD 9PSMinDampStrengthXSdoubleSNumberSD^ 9PSMinDampStrengthYSdoubleSNumberSD� 9PSMinDampStrengthZSdoubleSNumberSD� 9PSMaxDampStrengthXSdoubleSNumberSD3!9PSMaxDampStrengthYSdoubleSNumberSDz!9PSMaxDampStrengthZSdoubleSNumberSD�!7PSPreferedAngleXSdoubleSNumberSD"7PSPreferedAngleYSdoubleSNumberSDI"7PSPreferedAngleZSdoubleSNumberSD"(PSLookAtPropertySobjectSS�"*PSUpVectorPropertySobjectSS�"!PSShowSboolSSI,#8PSNegativePercentShapeSupportSboolSSIr#8PSDefaultAttributeIndexSintSIntegerSI�����##PSFreezeSboolSSI�##PSLODBoxSboolSSI0$NPSLcl TranslationSLcl TranslationSSADDD�$HPS Lcl RotationS Lcl RotationSSADDD�$FPS Lcl ScalingS Lcl ScalingSSAD�?D�?D�?%2PS
VisibilityS
VisibilitySSAD�?m%EPSVisibility InheritanceSVisibility InheritanceSSI�,
ObjectTypeSMaterial�%CountI�,PropertyTemplateSFbxSurfacePhong|, Properties70X&1PS ShadingModelSKStringSSSPhong�&'PS
MultiLayerSboolSSI�&BPS EmissiveColorSColorSSADDD'2PSEmissiveFactorSNumberSSAD�?l'APS AmbientColorSColorSSAD�������?D�������?D�������?�'1PS AmbientFactorSNumberSSAD�?�'APS DiffuseColorSColorSSAD�������?D�������?D�������?9(1PS DiffuseFactorSNumberSSAD�?�(APSBumpSVector3DSVectorSDDD�(FPS NormalMapSVector3DSVectorSDDD)3PS
BumpFactorSdoubleSNumberSD�?p)EPSTransparentColorSColorSSADDD�)6PSTransparencyFactorSNumberSSAD*MPSDisplacementColorSColorRGBSColorSDDDX*;PSDisplacementFactorSdoubleSNumberSD�?�*SPSVectorDisplacementColorSColorRGBSColorSDDD+APSVectorDisplacementFactorSdoubleSNumberSD�?X+BPS SpecularColorSColorSSAD�������?D�������?D�������?�+2PSSpecularFactorSNumberSSAD�?�+5PSShininessExponentSNumberSSAD4@-,DPSReflectionColorSColorSSADDDo,4PSReflectionFactorSNumberSSAD�?|.
ObjectTypeSAnimationStack�,CountIo.PropertyTemplateS FbxAnimStackb. Properties70W-+PS DescriptionSKStringSSS�-0PS
LocalStartSKTimeSTimeSL�-/PS LocalStopSKTimeSTimeSL.4PSReferenceStartSKTimeSTimeSLU.3PS ReferenceStopSKTimeSTimeSL91
ObjectTypeSAnimationLayer�.CountI,1PropertyTemplateS FbxAnimLayer1 Properties70</*PSWeightSNumberSSADY@k/!PSMuteSboolSSI�/!PSSoloSboolSSI�/!PSLockSboolSSI0APSColorSColorRGBSColorSD�������?D�������?D�������?L0&PS BlendModeSenumSSI�05PSRotationAccumulationModeSenumSSI�02PSScaleAccumulationModeSenumSSI15PSBlendModeBypassS ULongLongSSL2
ObjectTypeSAnimationCurveNode~1CountI2PropertyTemplateSFbxAnimCurveNode2 Properties70�1PSdSCompoundSSi2
ObjectTypeSAnimationCurve\2CountI
�ObjectsLM!GeometryL �[��S
GeometrySMesh43 Properties70'3@PSPolygonPartNamesS
stringlistSSUISDefault'6�Verticesd��xmձ�MQ���'��;O�yQ(t�S�BHDPITT��j��/@Ea����L��u�ا�����Z�Z{�sg�Y=��vD���^d���򽬛M�wǿ�'>89{��s����oޟ>Ί����������w%��x����������Ǔ�O����,��O᩟W�?.���o�����Y��Y�?��1Ϭ�v���'��'?�?��76w�˟7�����{����W��fS\l��Ώ?~��f�_���~8u��Ǔ��_x?}>ˀ�g��������?��?.����~���<3�v�Y�p�|��ǝ/��c$��˟���Xݟ���;\}���>.�?Ώ?�����}������O�O~8��cl�w�q߿���珋���������]������ߎ$�������珻������コ�����W���ď^�������Y������x���zu�$q���V��5/=·^�K���ޜ�K�?��=|�����[�����'��*}���=o�����}^z����/�����M�9�o^�5��L_|_�<��6���yЛ�y�q+=]������Ѽ�������z��y�?�qZ]��;����'���Ox����>�y�ͭ��������O�7/=nn��}�үy��.᩿����5קU:y��|p�?���oV'|��_�������Ox֋�����_�������w3������|���]8<u����{� 3l��8�PolygonVertexIndexi�}x-��OPaF�� ��� ��EAlܜ:��S��s��svwww�x�v�v������А��UPϊ��F��s�7��yZ��ᰂ�W�6�@��a�����.�z8 �dZ_
[����!�B��a3\���0Ri}!l�+���}{K��·�p��[�@H���P�h� �tZO� p��[BȠ�Y�7h���LZ�yp�֛C_Ȣ�DX��>����nƝ
��6�7�ސM��!��z�9�>��]Z�����t�G7���X��tܧ�F�ri=���-p�~� ����z�
�i=���ׇ.�G�ѐ �i�t�|Z�� xB��v
�lБt:<��P�4'$ ��?Z��~��u�6ө��[h=�� Z��~��w���kB8��2p���\7o�z ��_�zup�;i}��7�^ ��.z~����p����C���ݿ��*�����H���^��>Z� ��]�����A��g�GZ����O�D�D����ݻ��!z�<��ô>��Z/���Ow����B�� ��h� ��}<��wZ/ ��8���8�A���ݟ�c��$=�[��)Z1���K��?M��!~�zqp�gh}D�Z/��_ ���������;R���<�Edgesi��
 !"$%&()*,-.01246789:<=>@ABDEFHIJLMNPQRTUVXYZ\]^`abdfghijlmnpqrtuvxyz|}~��������������������������������������������������������������������������������    !$%*+,-014589<=@ADEHILMPQTUZ[\]`adehilmpqtuxy|�<GeometryVersionI|XELayerElementNormalI =VersionIf*= NameSNormalsa=MappingInformationTypeSByPolygonVertex�=ReferenceInformationTypeS IndexToDirectY@�Normalsd �xm�=kTA@����B�֚;+;!բU�_Q�m��RD�C�u
Q+A����hZ �s��g�$�)����ܹ3g�#���8ހ^�]���������s����3��)�h����~� �|���y�y������|rq���������O,���_�O�n�|y������[�����3N���|uoq�=��~�ߥ��/�������}���e���g�vؗ�s%~����k̻��"^�=���^�1�g����_�×�z�5IO _r��n��������'���>� >�>v���Y}�?�������/�/ח?�����f��K^�~���O}����������z��A����Wė�«/���k�}'U��W�#�����՟�'���_�����s]���П߃£_�Ǿ�����S����g���\�ח����_ ����v�/��� ���N}��ᵿ�w��Wzjx���9Ϩ'��d�o������Cc��x�����~����}��y?�����{}�������O���P����cIC��{$�|�������w�;��ü=�˽�[7��WO�"~}~�Ϝ2����q��8�2���>����꾲��~[�������S�>|e=�9��~����_������ОO����\���㺵��Gr�ӏ���g=�Տ�D}�Y���{C NormalsWd`KE� NormalsIndexi��x���R�a�EATT�9�(FDŀ�9g����}t�j�w������=�o0 &º��>pm����|�Ӆ�7훲C77�3١�[�����Ʒ����B�����=���b_���?Ph�`�~(;t�p�~$;t�h86����j|.�?Yh|>�*?]��)�f� ������� ١��E�����K�r�R���u��p-��z���p��f�v���y'����W��d�n�/�d�n> ��k��j���Ó���i~O��?�����զʵ��t&|3ǽ��o`&� nޮ�_w����~ ��ܻ�����w��-�9�-�{���_ހ��> �]�saX�桙�����}ͽs�s���oa!�t�h_�C3�<ڿ�ݺƿ����o��k�ͣ����r5�#�}ͽs�g���oa�����u���ւ��w���i��=��JLayerElementUVI�EVersionIe�E NameSTexture�EMappingInformationTypeSByPolygonVertexFReferenceInformationTypeS IndexToDirect�HvUVd&ixm��NUQ E���O��?�܉�;b��э� !1"Q�F ��<�Xo�.�ix����v���9�4=�l��L��|��Wy����V�_��4���/�����6���ߋjUu�W=y����U<���x�mţ��o��g5������ϊ'�׆?�x����~��V<����8�}�:�KßW�e�����~����/���?�j�?>��x��^���T<��?�����G~Z�I���n��>��/�e巾ӻ�w�s�}U�qtZ��C~��C�×�����ԥĞ���;��Ͼh'ߋ��������[�R�v��u����س�%����})|C�8��a~�g|�ί�`�/s¿� R���~�����{����~�̧xd�'�R��>s~��uӟ���/x�γ������������P����է����2��[��g_�{��9��3�3��K<���=I=�� ~�[���(�Z}�k���~�}0_�g_������9�����|�':q�g�1|/��ύ���������%��O}����v��:����_�QR/2s�t���������P���������/�x�w��+���X����e_
�� >�#�γ�:��K��;/���S������z�6����JUVIndexi�x-��W�Q��iEE
M�he��(�Dv�"Y�JQ�$%�������s^������NW"������ض���� ~s7Ÿ�=�M��N�6�v����^���8�{���k���%�asw�<l�b�>�a����{was/�l�l<�͝�W����6w5>����"l����݀?�������i����s;����n��9����`sW�(l�Q���݆s��Dž�۽�*��e܂�=��Ŷe�,�����c�����ͽ�as��;l�:���݇L��`c��ާ�v�e��6�rԣ+�=Ϊhݱmg�S�F��}#��'���=�%�b������{�_���۽��v���m����ͽ�}�pl۝p�s~s��l�SȆͽ�<��Q��հ�FE���O�v�c4�澉4l�q�" ߻��&�s��o�5���� ߽�]�J�ܹ������[��w�wos_� l��X���3���#��ض���Y���! ��|���G8[`s?Dl�+���ܯỷ��a
6����.Xk��KLayerElementMaterialIKVersionIe,KNameS[K MappingInformationTypeSAllSame�KReferenceInformationTypeS IndexToDirect�K Materialsi?MLayerI�KVersionId`L LayerElement7LTypeSLayerElementNormalSL
TypedIndexI�L LayerElement�LTypeSLayerElementMaterial�L
TypedIndexI2M LayerElement MTypeSLayerElementUV%M
TypedIndexI�N)ModelL|���SInfiniteSeaModelSMesh�MVersionI��N Properties70�M+PSRotationActiveSboolSSIGNGPS
ScalingMaxSVector3DSVectorSDDD�N8PSDefaultAttributeIndexSintSIntegerSI�NShadingCY�NCullingS
CullingOff�P1ModelLH���SMODO_RenderSettingsModelSNull<OVersionI��P Properties70�OGPS
ScalingMaxSVector3DSVectorSDDD�O2PS
VisibilityS
VisibilitySSAD%P-PSCameraSKStringSSUSCamerabP/PS ResolutionXSintSIntegerSUI�P/PS ResolutionYSintSIntegerSUI��PShadingCY�PCullingS
CullingOff�S$MaterialL0����SDefaultMaterialSDQVersionIfgQ
ShadingModelSphong�Q
MultiLayerI�S Properties70�QEPSEmissiveSVector3DSVectorSDDDARDPSAmbientSVector3DSVectorSD�������?D�������?D�������?�RDPSDiffuseSVector3DSVectorSD�������?D�������?D�������?�REPSSpecularSVector3DSVectorSD�������?D�������?D�������?&S2PS ShininessSdoubleSNumberSD4@dS0PSOpacitySdoubleSNumberSD�?�S5PS ReflectivitySdoubleSNumberSDrT&AnimationStackL��`STake 001AnimStackSeT Properties70XT/PS LocalStopSKTimeSTimeSLp6��5�T'AnimationLayerL�*��SLayer 001AnimLayerS�U#AnimationCurveNodeL�`STAnimCurveNodeS�U Properties70QU'PSd|XSNumberSSAD�U'PSd|YSNumberSSAD�U'PSd|ZSNumberSSAD�V#AnimationCurveNodeL��`SRAnimCurveNodeS�V Properties70eV'PSd|XSNumberSSAD�V'PSd|YSNumberSSAD�V'PSd|ZSNumberSSAD�W#AnimationCurveNodeL��`SSAnimCurveNodeS�W Properties70yW'PSd|XSNumberSSAD�?�W'PSd|YSNumberSSAD�?�W'PSd|ZSNumberSSAD�?�^AnimationCurveL��`S AnimCurveSSX DefaultDkXKeyVerI�T\�KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_^� KeyValueFloatfy��^ KeyAttrFlagsi�^KeyAttrDataFloatf  �^KeyAttrRefCountiy�eAnimationCurveL���`S AnimCurveSS_ DefaultDk_KeyVerI�Tc�KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_e� KeyValueFloatfy��e KeyAttrFlagsi�eKeyAttrDataFloatf  �eKeyAttrRefCountiy�lAnimationCurveL���`S AnimCurveSSf DefaultDkfKeyVerI�Tj�KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_l� KeyValueFloatfy��l KeyAttrFlagsi�lKeyAttrDataFloatf  �lKeyAttrRefCountiy�sAnimationCurveL`��`S AnimCurveSSm DefaultDkmKeyVerI�Tq�KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_s� KeyValueFloatfy��s KeyAttrFlagsi�sKeyAttrDataFloatf  �sKeyAttrRefCountiy�zAnimationCurveL`��`S AnimCurveSSt DefaultDktKeyVerI�Tx�KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_z� KeyValueFloatfy���������������������������������������������������������������������������������������������������������������������������z KeyAttrFlagsi�zKeyAttrDataFloatf  �zKeyAttrRefCountiy��AnimationCurveL���`S AnimCurveSS{ DefaultDk{KeyVerI�T�KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_�� KeyValueFloatfy��� KeyAttrFlagsiÁKeyAttrDataFloatf  ��KeyAttrRefCountiy��AnimationCurveLÒ`S AnimCurveSS� DefaultD�?k�KeyVerI�T��KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_�� KeyValueFloatfy��?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�� KeyAttrFlagsiÈKeyAttrDataFloatf  ��KeyAttrRefCountiy��AnimationCurveL�Ò`S AnimCurveSS� DefaultD�?k�KeyVerI�T��KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_�� KeyValueFloatfy��?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�� KeyAttrFlagsiÏKeyAttrDataFloatf  ��KeyAttrRefCountiy��AnimationCurveL൒`S AnimCurveSS� DefaultD�?k�KeyVerI�T��KeyTimely�R^�r��h��XHy���ׅ=�5:�>��"�����PW4� {� ���kt`*�(�|(�EΆ�� �E+rC��ġ�c�h^����h �� ^y4N
����
6�3 T�Q� �� �P�� J�n� � #q �k�� @ʋV�(@����;6娮�C]!ڡ�,�~^zyм.�"�^ty����KD6�j��)��h�Q`�с� ��l:gV����(�L��W�L� 2�C����tB)��^��漑o8F��y�T�׮�.6c:������$Q��v�4� �wl��l�Q]�(���B b�n� �C#(!�ך!X� "�^@�"����"N�e#�y]�#��K$D6ƽ$��z0%��.�%:Q�&����&� L�&0ln'�ʴ�'�(iS(&��(x��8)�C��)�:*n��*�^�+�Wv+d �+�y�[,�t�,Z6)A-��ݳ-���&.PQF�.��� /� �~/Flc�/��d0�(��0<��I1��4�1�C�.22���2�R3�^�3(���3zol4�y#�4��Q5p6��5_�� KeyValueFloatfy��?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�� KeyAttrFlagsiÖKeyAttrDataFloatf  ��KeyAttrRefCountiy�� ConnectionsI�CSOOL|���Lp�CSOOL �[��L|�����CSOOL0����L|���җ-CSOPL�`L|���SLcl Translation
�*CSOPL��`L|���S Lcl RotationA�)CSOPL��`L|���S Lcl Scalingh�CSOOL�*��L��`��CSOOL�`L�*����CSOOL��`L�*��ݘCSOOL��`L�*�� �!CSOPL��`L�`Sd|X;�!CSOPL���`L�`Sd|Yj�!CSOPL���`L�`Sd|Z��!CSOPL`��`L��`Sd|Xș!CSOPL`��`L��`Sd|Y��!CSOPL���`L��`Sd|Z&�!CSOPLÒ`L��`Sd|XU�!CSOPL�Ò`L��`Sd|Y��!CSOPL൒`L��`Sd|Zn�Takes��CurrentSa� TakeSTake 001�FileNameS Take_001.tak(� LocalTimeLLp6��5T� ReferenceTimeLLp6��5���
���m�s���.t��Z�j���~�� �u�)

99
Packages/com.verasl.water-system/Meshes/InfiniteSea.fbx.meta


fileFormatVersion: 2
guid: 0694fda6617df4cd6a3d240f5eeb580b
ModelImporter:
serializedVersion: 22
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
2100000: Default
2300000: //RootNode
3300000: //RootNode
4300000: InfiniteSea
7400000: Take 001
9500000: //RootNode
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Default
second: {fileID: 2100000, guid: e9927401bf96341d5bba91ea4c815e14, type: 2}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 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: 25
meshCompression: 0
addColliders: 0
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
importAnimation: 0
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Packages/com.verasl.water-system/Meshes/SeaVertDisp.fbx
文件差异内容过多而无法显示
查看文件

228
Packages/com.verasl.water-system/Meshes/SeaVertDisp.fbx.meta


fileFormatVersion: 2
guid: 074aa8ca109924e18baf19f3e26665b6
ModelImporter:
serializedVersion: 23
fileIDToRecycleName:
100000: //RootNode
100002: SeaVertDisp_center
100004: SeaVertDisp_far1
100006: SeaVertDisp_far2
100008: SeaVertDisp_far3
100010: SeaVertDisp_far4
100012: SeaVertDisp_mid1
100014: SeaVertDisp_mid2
100016: SeaVertDisp_mid3
100018: SeaVertDisp_mid4
100020: SeaVertDisp_near1
100022: SeaVertDisp_near2
100024: SeaVertDisp_near3
100026: SeaVertDisp_near4
100028: SeaVertDisp_outter1
100030: SeaVertDisp_outter2
100032: SeaVertDisp_outter3
100034: SeaVertDisp_outter4
100036: SeaDistant_01
100038: SeaDistant_02
100040: SeaDistant_03
100042: SeaDistant_04
100044: SeaDistant_01 (2)
100046: SeaDistant_02 (2)
100048: SeaDistant_03 (2)
100050: SeaDistant_04 (2)
400000: //RootNode
400002: SeaVertDisp_center
400004: SeaVertDisp_far1
400006: SeaVertDisp_far2
400008: SeaVertDisp_far3
400010: SeaVertDisp_far4
400012: SeaVertDisp_mid1
400014: SeaVertDisp_mid2
400016: SeaVertDisp_mid3
400018: SeaVertDisp_mid4
400020: SeaVertDisp_near1
400022: SeaVertDisp_near2
400024: SeaVertDisp_near3
400026: SeaVertDisp_near4
400028: SeaVertDisp_outter1
400030: SeaVertDisp_outter2
400032: SeaVertDisp_outter3
400034: SeaVertDisp_outter4
400036: SeaDistant_01
400038: SeaDistant_02
400040: SeaDistant_03
400042: SeaDistant_04
400044: SeaDistant_01 (2)
400046: SeaDistant_02 (2)
400048: SeaDistant_03 (2)
400050: SeaDistant_04 (2)
2100000: Default
2300000: //RootNode
2300002: SeaVertDisp_center
2300004: SeaVertDisp_far1
2300006: SeaVertDisp_far2
2300008: SeaVertDisp_far3
2300010: SeaVertDisp_far4
2300012: SeaVertDisp_mid1
2300014: SeaVertDisp_mid2
2300016: SeaVertDisp_mid3
2300018: SeaVertDisp_mid4
2300020: SeaVertDisp_near1
2300022: SeaVertDisp_near2
2300024: SeaVertDisp_near3
2300026: SeaVertDisp_near4
2300028: SeaVertDisp_outter1
2300030: SeaVertDisp_outter2
2300032: SeaVertDisp_outter3
2300034: SeaVertDisp_outter4
2300036: SeaDistant_01
2300038: SeaDistant_02
2300040: SeaDistant_03
2300042: SeaDistant_04
2300044: SeaDistant_01 (2)
2300046: SeaDistant_02 (2)
2300048: SeaDistant_03 (2)
2300050: SeaDistant_04 (2)
3300000: //RootNode
3300002: SeaVertDisp_center
3300004: SeaVertDisp_far1
3300006: SeaVertDisp_far2
3300008: SeaVertDisp_far3
3300010: SeaVertDisp_far4
3300012: SeaVertDisp_mid1
3300014: SeaVertDisp_mid2
3300016: SeaVertDisp_mid3
3300018: SeaVertDisp_mid4
3300020: SeaVertDisp_near1
3300022: SeaVertDisp_near2
3300024: SeaVertDisp_near3
3300026: SeaVertDisp_near4
3300028: SeaVertDisp_outter1
3300030: SeaVertDisp_outter2
3300032: SeaVertDisp_outter3
3300034: SeaVertDisp_outter4
3300036: SeaDistant_01
3300038: SeaDistant_02
3300040: SeaDistant_03
3300042: SeaDistant_04
3300044: SeaDistant_01 (2)
3300046: SeaDistant_02 (2)
3300048: SeaDistant_03 (2)
3300050: SeaDistant_04 (2)
4300000: SeaVertDisp
4300002: SeaVertDisp_outter4
4300004: SeaVertDisp_mid4
4300006: SeaVertDisp_mid3
4300008: SeaVertDisp_outter3
4300010: SeaVertDisp_outter1
4300012: SeaVertDisp_mid2
4300014: SeaVertDisp_mid1
4300016: SeaVertDisp_outter2
4300018: SeaVertDisp_far4
4300020: SeaVertDisp_far3
4300022: SeaVertDisp_far2
4300024: SeaVertDisp_far1
4300026: SeaVertDisp_center
4300028: SeaVertDisp_near4
4300030: SeaVertDisp_near3
4300032: SeaVertDisp_near2
4300034: SeaVertDisp_near1
4300036: SeaDistant_01
4300038: SeaDistant_02
4300040: SeaDistant_03
4300042: SeaDistant_04
4300044: SeaDistant_04 (2)
4300046: SeaDistant_03 (2)
4300048: SeaDistant_02 (2)
4300050: SeaDistant_01 (2)
7400000: Take 001
9500000: //RootNode
2186277476908879412: ImportLogs
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Default
second: {fileID: 2100000, guid: 4849d4d15a9cb42eb9533ae935e2630b, type: 2}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 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: 1
addColliders: 0
useSRGBMaterialColor: 1
importVisibility: 0
importBlendShapes: 0
importCameras: 0
importLights: 0
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 0
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
previousCalculatedGlobalScale: 0.01
hasPreviousCalculatedGlobalScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 2
tangentImportMode: 2
normalCalculationMode: 1
importAnimation: 0
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0
hasExtraRoot: 1
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

253
Packages/com.verasl.water-system/Meshes/Water.fbx
文件差异内容过多而无法显示
查看文件

138
Packages/com.verasl.water-system/Meshes/Water.fbx.meta


fileFormatVersion: 2
guid: fb2f5cec30b474b89b778e3aab6f3dfe
ModelImporter:
serializedVersion: 22
fileIDToRecycleName:
100000: //RootNode
100002: WaterBlock_50m_LOD0
100004: WaterBlock_50m_LOD1
100006: WaterBlock_50m_LOD2
100008: WaterBlock_tessellation_1k
400000: //RootNode
400002: WaterBlock_50m_LOD0
400004: WaterBlock_50m_LOD1
400006: WaterBlock_50m_LOD2
400008: WaterBlock_tessellation_1k
2100000: Water
2300000: //RootNode
2300002: WaterBlock_50m_LOD0
2300004: WaterBlock_50m_LOD1
2300006: WaterBlock_50m_LOD2
2300008: WaterBlock_tessellation_1k
3300000: //RootNode
3300002: WaterBlock_50m_LOD0
3300004: WaterBlock_50m_LOD1
3300006: WaterBlock_50m_LOD2
3300008: WaterBlock_tessellation_1k
4300000: WaterBlock
4300002: WaterBlock_50m_LOD0
4300004: WaterBlock_tessellation_1k
4300006: WaterBlock_50m_LOD1
4300008: WaterBlock_50m_LOD2
7400000: Take 001
9500000: //RootNode
20500000: //RootNode
2186277476908879412: ImportLogs
2186277476908879414: ImportLogs
2186277476908879416: ImportLogs
2186277476908879418: ImportLogs
2186277476908879420: ImportLogs
2186277476908879422: ImportLogs
2186277476908879424: ImportLogs
2186277476908879426: ImportLogs
2186277476908879428: ImportLogs
2186277476908879430: ImportLogs
2186277476908879432: ImportLogs
2186277476908879434: ImportLogs
2186277476908879436: ImportLogs
2186277476908879438: ImportLogs
2186277476908879440: ImportLogs
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Default
second: {fileID: 2100000, guid: 4849d4d15a9cb42eb9533ae935e2630b, type: 2}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 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
importVisibility: 0
importBlendShapes: 0
importCameras: 0
importLights: 0
swapUVChannels: 0
generateSecondaryUV: 1
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 0
preserveHierarchy: 0
indexFormat: 2
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
importAnimation: 0
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.verasl.water-system/Resources.meta


fileFormatVersion: 2
guid: 98df19cdeec6e47e7812621d08cf3329
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

16
Packages/com.verasl.water-system/Resources/WaterResources.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e73e41b71c5f541679f1bb37dee026c1, type: 3}
m_Name: WaterResources
m_EditorClassIdentifier:
defaultFoamRamp: {fileID: 2800000, guid: 4098762bce32f44b9b7c56531d1a988e, type: 3}
defaultFoamMap: {fileID: 2800000, guid: ca439406e806ecf44a9586510be9477d, type: 3}
defaultSurfaceMap: {fileID: 18700000, guid: 2bf4e75081aab4b5f88bfb7069f598ac, type: 2}

8
Packages/com.verasl.water-system/Resources/WaterResources.asset.meta


fileFormatVersion: 2
guid: 40615c805d6e84ce7800418367985fe1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.verasl.water-system/Scripts.meta


fileFormatVersion: 2
guid: cfac61b5ac93c4101b40011e6cd637b3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

335
Packages/com.verasl.water-system/Scripts/BuoyantObject.cs


// Buoyancy.cs
// by Alex Zhdankin
// Version 2.1
//
// http://forum.unity3d.com/threads/72974-Buoyancy-script
//
// Terms of use: do whatever you like
//
// Further tweaks by Andre McGrail
//
//
using System.Collections.Generic;
using UnityEngine;
using Unity.Mathematics;
namespace WaterSystem
{
public class BuoyantObject : MonoBehaviour
{
public BuoyancyType _buoyancyType; // type of buoyancy to calculate
public float density; // density of the object, this is calculated off it's volume and mass
public float volume; // volume of the object, this is calculated via it's colliders
public float voxelResolution = 0.51f; // voxel resolution, represents the half size of a voxel when creating the voxel representation
private Bounds voxelBounds; // bounds of the voxels
public Vector3 centerOfMass = Vector3.zero; // Center Of Mass offset
private const float DAMPFER = 0.005f;
private const float WATER_DENSITY = 1000;
private float baseDrag; // reference to original drag
private float baseAngularDrag; // reference to original angular drag
private int _guid; // GUID for the height system
private Vector3 localArchimedesForce;
[SerializeField]
private Vector3[] voxels; // voxel position
private float3[] samplePoints; // sample points for height calc
private float3[] heights; // water height array(only size of 1 when simple or non-physical)
private float3[] normals; // water normal array(only used when non-physical and size of 1 also when simple)
[SerializeField]
Collider[] colliders; // colliders attatched ot this object
Rigidbody RB;
private DebugDrawing[] debugInfo; // For drawing force gizmos
public float percentSubmerged = 0f;
[ContextMenu("Initialize")]
void Init()
{
if(_buoyancyType == BuoyancyType.NonPhysicalVoxel || _buoyancyType == BuoyancyType.PhysicalVoxel) // If voxel based we need colliders and voxels
{
SetupColliders();
SliceIntoVoxels();
}
if (_buoyancyType == BuoyancyType.Physical || _buoyancyType == BuoyancyType.PhysicalVoxel) // If physical, then we need a rigidbody
{
// The object must have a RidigBody
RB = GetComponent<Rigidbody>();
if (RB == null)
{
RB = gameObject.AddComponent<Rigidbody>();
Debug.LogError(string.Format("Buoyancy:Object \"{0}\" had no Rigidbody. Rigidbody has been added.", name));
}
RB.centerOfMass = centerOfMass + voxelBounds.center;
baseDrag = RB.drag;
baseAngularDrag = RB.angularDrag;
}
float archimedesForceMagnitude = WATER_DENSITY * Mathf.Abs(Physics.gravity.y) * volume;
localArchimedesForce = new Vector3(0, archimedesForceMagnitude, 0) / voxels.Length;
samplePoints = new float3[voxels.Length];
}
private void Start()
{
_guid = gameObject.GetInstanceID();
Init();
if(_buoyancyType == BuoyancyType.NonPhysical || _buoyancyType == BuoyancyType.Physical)
{
debugInfo = new DebugDrawing[1];
heights = new float3[1];// new NativeSlice<float3>();
normals = new float3[1];//new NativeSlice<float3>();
}
else
{
debugInfo = new DebugDrawing[voxels.Length];
heights = new float3[voxels.Length]; //new NativeSlice<float3>();
}
}
void SetupColliders()
{
// The object must have a Collider
colliders = GetComponentsInChildren<Collider>();
if(colliders.Length == 0)
{
colliders = new Collider[1];
colliders[0] = gameObject.AddComponent<BoxCollider>();
Debug.LogError(string.Format("Buoyancy:Object \"{0}\" had no coll. BoxCollider has been added.", name));
}
}
void Update()
{
for(var i = 0; i < samplePoints.Length; i++)
{
samplePoints[i] = transform.TransformPoint(voxels[i]);
}
if(_buoyancyType == BuoyancyType.PhysicalVoxel || _buoyancyType == BuoyancyType.Physical) // if acurate the are more points so only heights are needed
{
GerstnerWavesJobs.UpdateSamplePoints(samplePoints, _guid, false);
GerstnerWavesJobs.GetData(_guid, ref heights);
}
else
{
GerstnerWavesJobs.UpdateSamplePoints(samplePoints, _guid, true);
GerstnerWavesJobs.GetSimpleData(_guid, ref heights, ref normals);
if(_buoyancyType == BuoyancyType.NonPhysical)
{
Vector3 vec = transform.position;
vec.y = heights[0].y;
transform.position = vec;
transform.up = Vector3.Slerp(transform.up, normals[0], Time.deltaTime);
}
else if(_buoyancyType == BuoyancyType.NonPhysicalVoxel)
{
// do the voxel non-physical
}
}
}
private void FixedUpdate()
{
float submergedAmount = 0f;
if(_buoyancyType == BuoyancyType.PhysicalVoxel)
{
for(var i = 0; i < voxels.Length; i++) BuoyancyForce(voxels[i], heights[i].y, ref submergedAmount, ref debugInfo[i]);
UpdateDrag(submergedAmount);
}
else if(_buoyancyType == BuoyancyType.Physical)
{
BuoyancyForce(Vector3.zero, heights[0].y, ref submergedAmount, ref debugInfo[0]);
UpdateDrag(submergedAmount);
}
}
private void BuoyancyForce(Vector3 position, float waterHeight, ref float submergedAmount, ref DebugDrawing _debug)
{
var wp = transform.TransformPoint(position);
float waterLevel = waterHeight;
_debug.position = wp;
_debug.waterHeight = waterLevel;
_debug.force = Vector3.zero;
if (wp.y - voxelResolution < waterLevel)
{
float k = (waterLevel - (wp.y - voxelResolution)) / (voxelResolution * 2f);
if (k > 1)
{
k = 1f;
}
else if (k < 0)
{
k = 0f;
}
submergedAmount += k / voxels.Length;//(math.clamp(waterLevel - (wp.y - voxelResolution), 0f, voxelResolution * 2f) / (voxelResolution * 2f)) / voxels.Count;
var velocity = RB.GetPointVelocity(wp);
velocity.y *= 2f;
var localDampingForce = -velocity * DAMPFER * RB.mass;
var force = localDampingForce + Mathf.Sqrt(k) * localArchimedesForce;//\
RB.AddForceAtPosition(force, wp);
_debug.force = force; // For drawing force gizmos
}
}
private void UpdateDrag(float submergedAmount)
{
percentSubmerged = Mathf.Lerp(percentSubmerged, submergedAmount, 0.25f);
RB.drag = baseDrag + (baseDrag * (percentSubmerged * 10f));
RB.angularDrag = baseAngularDrag + (percentSubmerged * 0.5f);
}
private void SliceIntoVoxels()
{
UnityEngine.Quaternion rot = transform.rotation;
Vector3 pos = transform.position;
Vector3 size = transform.localScale;
transform.SetPositionAndRotation(Vector3.zero, UnityEngine.Quaternion.identity);
transform.localScale = Vector3.one;
voxels = null;
var points = new List<Vector3>();
var rawBounds = VoxelBounds();
voxelBounds = rawBounds;
voxelBounds.size = RoundVector(rawBounds.size, voxelResolution);
for (float ix = -voxelBounds.extents.x; ix < voxelBounds.extents.x; ix += voxelResolution)
{
for (float iy = -voxelBounds.extents.y; iy < voxelBounds.extents.y; iy += voxelResolution)
{
for (float iz = -voxelBounds.extents.z; iz < voxelBounds.extents.z; iz += voxelResolution)
{
float x = (voxelResolution * 0.5f) + ix;
float y = (voxelResolution * 0.5f) + iy;
float z = (voxelResolution * 0.5f) + iz;
var p = new Vector3(x, y, z) + voxelBounds.center;
bool inside = false;
for(var i = 0; i < colliders.Length; i++)
{
if (PointIsInsideCollider(colliders[i], p))
{
inside = true;
}
}
if(inside)
points.Add(p);
}
}
}
voxels = points.ToArray();
transform.SetPositionAndRotation(pos, rot);
transform.localScale = size;
var voxelVolume = Mathf.Pow(voxelResolution, 3f) * voxels.Length;
var rawVolume = rawBounds.size.x * rawBounds.size.y * rawBounds.size.z;
volume = Mathf.Min(rawVolume, voxelVolume);
density = gameObject.GetComponent<Rigidbody>().mass / volume;
}
private Bounds VoxelBounds()
{
Bounds bounds = new Bounds();
foreach (Collider nextCollider in colliders)
{
bounds.Encapsulate(nextCollider.bounds);
}
return bounds;
}
static Vector3 RoundVector(Vector3 vec, float rounding)
{
return new Vector3(Mathf.Ceil(vec.x / rounding) * rounding, Mathf.Ceil(vec.y / rounding) * rounding, Mathf.Ceil(vec.z / rounding) * rounding);
}
private bool PointIsInsideCollider(Collider c, Vector3 p)
{
Vector3 cp = Physics.ClosestPoint(p, c, Vector3.zero, UnityEngine.Quaternion.identity);
return Vector3.Distance(cp, p) < 0.01f ? true : false;
}
private void OnDrawGizmosSelected()
{
const float gizmoSize = 0.05f;
var matrix = Matrix4x4.TRS(transform.position, transform.rotation, transform.lossyScale);
Gizmos.matrix = matrix;
if (voxels != null)
{
Gizmos.color = Color.yellow;
foreach (var p in voxels)
{
Gizmos.DrawCube(p, new Vector3(gizmoSize, gizmoSize, gizmoSize));
}
}
if (voxelResolution >= 0.1f)
{
Gizmos.DrawWireCube(voxelBounds.center, voxelBounds.size);
Vector3 center = voxelBounds.center;
float y = center.y - voxelBounds.extents.y;
for (float x = -voxelBounds.extents.x; x < voxelBounds.extents.x; x += voxelResolution)
{
Gizmos.DrawLine(new Vector3(x, y, -voxelBounds.extents.z + center.z), new Vector3(x, y, voxelBounds.extents.z + center.z));
}
for (float z = -voxelBounds.extents.z; z < voxelBounds.extents.z; z += voxelResolution)
{
Gizmos.DrawLine(new Vector3(-voxelBounds.extents.x, y, z + center.z), new Vector3(voxelBounds.extents.x, y, z + center.z));
}
}
else
voxelBounds = VoxelBounds();
Gizmos.color = Color.red;
Gizmos.DrawSphere(voxelBounds.center + centerOfMass, 0.2f);
Gizmos.matrix = Matrix4x4.identity;Gizmos.matrix = Matrix4x4.identity;
if (debugInfo != null)
{
foreach (DebugDrawing debug in debugInfo)
{
Gizmos.color = Color.cyan;
Gizmos.DrawCube(debug.position, new Vector3(gizmoSize, gizmoSize, gizmoSize)); // drawCenter
Vector3 water = debug.position;
water.y = debug.waterHeight;
Gizmos.DrawLine(debug.position, water); // draw the water line
Gizmos.DrawSphere(water, gizmoSize * 4f);
if(_buoyancyType == BuoyancyType.Physical || _buoyancyType == BuoyancyType.PhysicalVoxel)
{
Gizmos.color = Color.red;
Gizmos.DrawRay(debug.position, debug.force / RB.mass); // draw force
}
}
}
}
struct DebugDrawing
{
public Vector3 force;
public Vector3 position;
public float waterHeight;
}
public enum BuoyancyType
{
NonPhysical,
NonPhysicalVoxel,
Physical,
PhysicalVoxel
}
}
}

11
Packages/com.verasl.water-system/Scripts/BuoyantObject.cs.meta


fileFormatVersion: 2
guid: 3d5ac9593b59d4847815e4528b52a6d2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

268
Packages/com.verasl.water-system/Scripts/GerstnerWavesJobs.cs


using UnityEngine;
using System.Collections.Generic;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using WaterSystem.Data;
namespace WaterSystem
{
/// <summary>
/// C# Jobs system version of the Gerstner waves implimentation
/// </summary>
public static class GerstnerWavesJobs
{
//General variables
public static bool init;
public static bool firstFrame = true;
public static bool processing = false;
static int _waveCount;
static NativeArray<Wave> waveData; // Wave data from the water system
//Details for Buoyant Objects
static NativeArray<float3> positions;
static int positionCount = 0;
static NativeArray<float3> wavePos;
static NativeArray<float3> tempNullNormal;
static JobHandle waterHeightHandle;
static Dictionary<int, int2> registry = new Dictionary<int, int2>();
//Details for Simple Buoyant Objects
static NativeArray<float3> simplePositions;
static int simplePositionCount = 0;
static NativeArray<float3> waveSimplePos;
static NativeArray<float3> waveSimpleNormal;
static JobHandle waterSimpleHeightHandle;
static Dictionary<int, int2> simpleRegistry = new Dictionary<int, int2>();
public static void Init()
{
//Wave data
_waveCount = Water.Instance._waves.Length;
waveData = new NativeArray<Wave>(_waveCount, Allocator.Persistent);
for (var i = 0; i < waveData.Length; i++)
{
waveData[i] = Water.Instance._waves[i];
}
positions = new NativeArray<float3>(4096, Allocator.Persistent);
wavePos = new NativeArray<float3>(4096, Allocator.Persistent);
simplePositions = new NativeArray<float3>(1024, Allocator.Persistent);
waveSimplePos = new NativeArray<float3>(1024, Allocator.Persistent);
waveSimpleNormal = new NativeArray<float3>(1024, Allocator.Persistent);
tempNullNormal = new NativeArray<float3>(1, Allocator.Persistent);
init = true;
}
public static void Cleanup()
{
Debug.LogWarning("Cleaning up GerstnerWaves");
waterHeightHandle.Complete();
waterSimpleHeightHandle.Complete();
//Cleanup native arrays
waveData.Dispose();
tempNullNormal.Dispose();
positions.Dispose();
wavePos.Dispose();
simplePositions.Dispose();
waveSimplePos.Dispose();
waveSimpleNormal.Dispose();
}
public static void UpdateSamplePoints(float3[] samplePoints, int guid, bool simple)
{
CompleteJobs();
int2 offsets;
if (simple)
{
if (simpleRegistry.TryGetValue(guid, out offsets))
{
for (var i = offsets.x; i < offsets.y; i++) simplePositions[i] = samplePoints[i - offsets.x];
}
else
{
if (simplePositionCount + samplePoints.Length < simplePositions.Length)
{
offsets = new int2(simplePositionCount, simplePositionCount + samplePoints.Length);
//Debug.Log("<color=yellow>Adding Object:" + guid + " to the simple registry at offset:" + offsets + "</color>");
simpleRegistry.Add(guid, offsets);
simplePositionCount += samplePoints.Length;
}
}
}
else
{
if (registry.TryGetValue(guid, out offsets))
{
for (var i = offsets.x; i < offsets.y; i++) positions[i] = samplePoints[i - offsets.x];
}
else
{
if (positionCount + samplePoints.Length < positions.Length)
{
offsets = new int2(positionCount, positionCount + samplePoints.Length);
//Debug.Log("<color=yellow>Adding Object:" + guid + " to the registry at offset:" + offsets + "</color>");
registry.Add(guid, offsets);
positionCount += samplePoints.Length;
}
}
}
}
public static void GetSimpleData(int guid, ref float3[] outPos, ref float3[] outNorm)
{
var offsets = new int2(0, 0); ;
if (simpleRegistry.TryGetValue(guid, out offsets))
{
outPos = waveSimplePos.Slice(offsets.x, offsets.y).ToArray();
outNorm = waveSimpleNormal.Slice(offsets.x, offsets.y).ToArray();
}
}
public static void GetData(int guid, ref float3[] outPos)
{
var offsets = new int2(0, 0);
if (registry.TryGetValue(guid, out offsets))
{
outPos = wavePos.Slice(offsets.x, offsets.y).ToArray();
}
}
// Height jobs for the next frame
public static void UpdateHeights()
{
if (!processing)
{
processing = true;
// Buoyant Object Job
var waterHeight = new GerstnerWavesJobs.HeightJob()
{
waveData = waveData,
position = positions,
offsetLength = new int2(0, positions.Length),
time = Time.time,
outPosition = wavePos,
outNormal = tempNullNormal,
normal = 0
};
// dependant on job4
waterHeightHandle = waterHeight.Schedule(positionCount, 32);
// Simple Buoyant Object Job
var waterSimpleHeight = new GerstnerWavesJobs.HeightJob()
{
waveData = waveData,
position = simplePositions,
offsetLength = new int2(0, simplePositions.Length),
time = Time.time,
outPosition = waveSimplePos,
outNormal = waveSimpleNormal,
normal = 1
};
// dependant on job4
waterSimpleHeightHandle = waterSimpleHeight.Schedule(simplePositionCount, 32);
JobHandle.ScheduleBatchedJobs();
firstFrame = false;
}
}
public static void CompleteJobs()
{
if (!firstFrame && processing)
{
waterHeightHandle.Complete();
waterSimpleHeightHandle.Complete();
processing = false;
}
}
// Gerstner Height C# Job
public struct HeightJob : IJobParallelFor
{
[ReadOnly]
public NativeArray<Wave> waveData; // wave data stroed in vec4's like the shader version but packed into one
[ReadOnly]
public NativeArray<float3> position;
[WriteOnly]
public NativeArray<float3> outPosition;
[WriteOnly]
public NativeArray<float3> outNormal;
[ReadOnly]
public float time;
[ReadOnly]
public int2 offsetLength;
[ReadOnly]
public int normal;
// The code actually running on the job
public void Execute(int i)
{
if (i >= offsetLength.x && i < offsetLength.y - offsetLength.x)
{
var waveCountMulti = 1f / waveData.Length;
float3 wavePos = new float3(0f, 0f, 0f);
float3 waveNorm = new float3(0f, 0f, 0f);
for (var wave = 0; wave < waveData.Length; wave++) // for each wave
{
// Wave data vars
float2 pos = position[i].xz;
var amplitude = waveData[wave].amplitude;
var direction = waveData[wave].direction;
var wavelength = waveData[wave].wavelength;
float2 omniPos = waveData[wave].origin;
////////////////////////////////wave value calculations//////////////////////////
half w = 6.28318f / wavelength; // 2pi over wavelength(hardcoded)
half wSpeed = math.sqrt(9.8f * w); // frequency of the wave based off wavelength
half peak = 0.8f; // peak value, 1 is the sharpest peaks
half qi = peak / (amplitude * w * waveData.Length);
float2 windDir = new float2(0f, 0f);
float dir = 0;
direction = math.radians(direction); // convert the incoming degrees to radians
half2 windDirInput = new float2(math.sin(direction), math.cos(direction)) * (1 - waveData[wave].onmiDir); // calculate wind direction - TODO - currently radians
half2 windOmniInput = (pos - omniPos) * waveData[wave].onmiDir;
windDir += windDirInput;
windDir += windOmniInput;
windDir = math.normalize(windDir);
dir = math.dot(windDir, pos - (omniPos * waveData[wave].onmiDir)); // calculate a gradient along the wind direction
////////////////////////////position output calculations/////////////////////////
float calc = dir * w + -time * wSpeed; // the wave calculation
float cosCalc = math.cos(calc); // cosine version(used for horizontal undulation)
float sinCalc = math.sin(calc); // sin version(used for vertical undulation)
// calculate the offsets for the current point
wavePos.x += qi * amplitude * windDir.x * cosCalc;
wavePos.z += qi * amplitude * windDir.y * cosCalc;
wavePos.y += (((sinCalc * 0.5f + 0.5f) * amplitude)) * waveCountMulti; // the height is divided by the number of waves
if (normal == 1)
{
////////////////////////////normal output calculations/////////////////////////
half wa = w * amplitude;
// normal vector
float3 norm = new float3(-(windDir.xy * wa * cosCalc),
1 - (qi * wa * sinCalc));
waveNorm += (norm * waveCountMulti) * amplitude;
}
}
outPosition[i] = wavePos;
if (normal == 1) outNormal[i] = math.normalize(waveNorm.xzy);
}
}
}
}
}

11
Packages/com.verasl.water-system/Scripts/GerstnerWavesJobs.cs.meta


fileFormatVersion: 2
guid: e09f45dd7e088412e85c5924433ad4ff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

38
Packages/com.verasl.water-system/Scripts/MainCameraAlign.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
namespace WaterSystem
{
/// <summary>
/// Camera script to align the water mesh with the camera in a quantized manner
/// </summary>
[ExecuteInEditMode]
public class MainCameraAlign : MonoBehaviour
{
public float quantizeValue = 6.25f;
public float forwards = 10f;
public float yOffset = -1f;
private void OnEnable()
{
LightweightPipeline.beginCameraRendering += UpdatePosition;
}
private void OnDisable()
{
LightweightPipeline.beginCameraRendering -= UpdatePosition;
}
void UpdatePosition(Camera cam)
{
Vector3 newPos = cam.transform.TransformPoint(Vector3.forward * forwards);
newPos.y = yOffset;
newPos.x = quantizeValue * (int)(newPos.x / quantizeValue);
newPos.z = quantizeValue * (int)(newPos.z / quantizeValue);
transform.position = newPos;
}
}
}

11
Packages/com.verasl.water-system/Scripts/MainCameraAlign.cs.meta


fileFormatVersion: 2
guid: 9a6b4e1e324e641ff86ca879104e20de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.verasl.water-system/Scripts/Rendering.meta


fileFormatVersion: 2
guid: ceb62181994bc49eb8ac45fd7f5c4634
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

350
Packages/com.verasl.water-system/Scripts/Water.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
using WaterSystem.Data;
namespace WaterSystem
{
[ExecuteInEditMode]
public class Water : MonoBehaviour
{
// Singleton
private static Water _Instance = null;
public static Water Instance
{
get
{
if (_Instance == null)
_Instance = (Water)FindObjectOfType(typeof(Water));
return _Instance;
}
}
private bool useComputeBuffer;
private RenderTexture _depthTex;
private Camera _depthCam;
[SerializeField]
private Texture2D _rampTexture;
[SerializeField]
public Wave[] _waves;
[SerializeField]
private ComputeBuffer _waveBuffer;
private float _maxWaveHeight;
[SerializeField]
DebugMode _debugMode;
[SerializeField]
public WaterSettingsData settingsData;
[SerializeField]
public WaterSurfaceData surfaceData;
[SerializeField]
private WaterResources resources;
private float waterTime = 0;
void OnEnable()
{
useComputeBuffer = SystemInfo.supportsComputeShaders &&
Application.platform != RuntimePlatform.WebGLPlayer;
Init();
LightweightPipeline.beginCameraRendering += BeginCameraRendering;
if(resources == null)
{
resources = Resources.Load("WaterResources") as WaterResources;
}
}
private void OnDisable() {
Cleanup();
}
void Cleanup()
{
if(Application.isPlaying)
GerstnerWavesJobs.Cleanup();
LightweightPipeline.beginCameraRendering -= BeginCameraRendering;
if (_depthCam)
{
_depthCam.targetTexture = null;
SafeDestroy(_depthCam.gameObject);
}
if (_depthTex)
{
SafeDestroy(_depthTex);
}
if(_waveBuffer != null)
_waveBuffer.Dispose();
}
private void BeginCameraRendering(Camera cam)
{
Vector3 fwd = cam.transform.forward;
fwd.y = 0;
float roll = cam.transform.localEulerAngles.z;
Shader.SetGlobalFloat("_CameraRoll", roll);
Shader.SetGlobalMatrix("_InvViewProjection", (GL.GetGPUProjectionMatrix(cam.projectionMatrix, false) * cam.worldToCameraMatrix).inverse);
}
private void SafeDestroy(Object o)
{
if(Application.isPlaying)
Destroy(o);
else
DestroyImmediate(o);
}
public void Init()
{
SetWaves();
GenerateColorRamp();
CaptureDepthMap();
}
void Update()
{
if(Application.isPlaying)
{
waterTime = Time.time;
Shader.SetGlobalFloat("_GlobalTime", waterTime);
}
}
private void LateUpdate() {
if(Application.isPlaying)
GerstnerWavesJobs.UpdateHeights();
}
public void FragWaveNormals(bool toggle)
{
Material mat = GetComponent<Renderer>().sharedMaterial;
if (toggle)
mat.EnableKeyword("GERSTNER_WAVES");
else
mat.DisableKeyword("GERSTNER_WAVES");
}
void SetWaves()
{
SetupWaves(surfaceData._customWaves);
// set default resources
Shader.SetGlobalTexture("_FoamMap", resources.defaultFoamMap);
Shader.SetGlobalTexture("_SurfaceMap", resources.defaultSurfaceMap);
_maxWaveHeight = 0f;
foreach (Wave w in _waves)
{
_maxWaveHeight += w.amplitude;
}
_maxWaveHeight /= (float)_waves.Length;
Shader.SetGlobalFloat("_MaxWaveHeight", _maxWaveHeight);
Shader.SetGlobalFloat("_MaxDepth", surfaceData._waterMaxVisibility);
switch(settingsData.refType)
{
case ReflectionType.Cubemap:
Shader.EnableKeyword("_REFLECTION_CUBEMAP");
Shader.DisableKeyword("_REFLECTION_PROBES");
Shader.DisableKeyword("_REFLECTION_PLANARREFLECTION");
Shader.SetGlobalTexture("_CubemapTexture", settingsData.cubemapRefType);
break;
case ReflectionType.ReflectionProbe:
Shader.DisableKeyword("_REFLECTION_CUBEMAP");
Shader.EnableKeyword("_REFLECTION_PROBES");
Shader.DisableKeyword("_REFLECTION_PLANARREFLECTION");
break;
case ReflectionType.PlanarReflection:
Shader.DisableKeyword("_REFLECTION_CUBEMAP");
Shader.DisableKeyword("_REFLECTION_PROBES");
Shader.EnableKeyword("_REFLECTION_PLANARREFLECTION");
break;
}
Shader.SetGlobalInt("_WaveCount", _waves.Length);
//GPU side
if (useComputeBuffer)
{
if (_waveBuffer == null)
_waveBuffer = new ComputeBuffer(10, (sizeof(float) * 6));
_waveBuffer.SetData(_waves);
Shader.SetGlobalBuffer("_WaveDataBuffer", _waveBuffer);
}
else
{
Shader.SetGlobalVectorArray("waveData", GetWaveData());
}
//CPU side
if(GerstnerWavesJobs.init == false && Application.isPlaying)
GerstnerWavesJobs.Init();
}
public Vector4[] GetWaveData()
{
Vector4[] waveData = new Vector4[20];
for (int i = 0; i < _waves.Length; i++)
{
waveData[i] = new Vector4(_waves[i].amplitude, _waves[i].direction, _waves[i].wavelength, _waves[i].onmiDir);//1 is for omni testing only TODO
waveData[i+10] = new Vector4(_waves[i].origin.x, _waves[i].origin.y, 0, 0);
}
return waveData;
}
public void SetupWaves(bool custom)
{
if(!custom)
{
//create basic waves based off basic wave settings
Random.State backupSeed = Random.state;
Random.InitState(surfaceData.randomSeed);
BasicWaves basicWaves = surfaceData._basicWaveSettings;
float a = basicWaves.amplitude;
float d = basicWaves.direction;
float l = basicWaves.wavelength;
int numWave = basicWaves.numWaves;
_waves = new Wave[numWave];
float r = 1f / numWave;
for (int i = 0; i < numWave; i++)
{
float p = Mathf.Lerp(0.5f, 1.5f, (float)i * r);
float amp = a * p * Random.Range(0.8f, 1.2f);
float dir = d + Random.Range(-45f, 45f);
float len = l * p * Random.Range(0.6f, 1.4f);
_waves[i] = new Wave(amp, dir, len, Vector2.zero, false);
Random.InitState(surfaceData.randomSeed + i + 1);
}
Random.state = backupSeed;
}
else
{
_waves = surfaceData._waves.ToArray();
}
}
void GenerateVertexColors()
{
Mesh mesh = GetComponent<MeshFilter>().sharedMesh;
Vector3[] vertices = mesh.vertices;
// create new colors array where the colors will be created.
Color[] colors = new Color[vertices.Length];
RaycastHit hit;
for (int i = 0; i < vertices.Length; i++)
{
colors[i] = Color.black;
//seafloor Depth
if (Physics.Raycast(vertices[i], -Vector3.up, out hit))
colors[i].r = hit.distance;
}
// assign the array of colors to the Mesh.
mesh.colors = colors;
}
public void GenerateColorRamp()
{
_rampTexture = new Texture2D(128, 4, TextureFormat.ARGB32, false, false);
_rampTexture.wrapMode = TextureWrapMode.Clamp;
Texture2D _defaultFoamRamp = resources.defaultFoamRamp;
Color[] cols = new Color[512];
for (int i = 0; i < 128; i++)
{
cols[i] = surfaceData._absorptionRamp.Evaluate((float)i / 128f);
}
for (int i = 0; i < 128; i++)
{
cols[i + 128] = surfaceData._scatterRamp.Evaluate((float)i / 128f);
}
for (int i = 0; i < 128; i++)
{
switch(surfaceData._foamSettings.foamType)
{
case 0:
{
// default
cols[i + 256] = _defaultFoamRamp.GetPixelBilinear((float)i / 128f , 0.5f);
}break;
case 1:
{
// simple
cols[i + 256] = _defaultFoamRamp.GetPixelBilinear(surfaceData._foamSettings.basicFoam.Evaluate((float)i / 128f) , 0.5f);
}break;
case 2:
{
// custom
cols[i + 256] = Color.black;
}break;
}
}
_rampTexture.SetPixels(cols);
_rampTexture.Apply();
Shader.SetGlobalTexture("_AbsorptionScatteringRamp", _rampTexture);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////Shoreline Depth Texture/////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[ContextMenu("Capture Depth")]
public void CaptureDepthMap()
{
//Generate the camera
if(_depthCam == null)
{
GameObject go = new GameObject("depthCamera");//create the cameraObject
go.hideFlags = HideFlags.HideAndDontSave;
_depthCam = go.AddComponent<Camera>();
}
_depthCam.transform.position = Vector3.up * 4f;//center the camera on this water plane
_depthCam.transform.up = Vector3.forward;//face teh camera down
_depthCam.enabled = true;
_depthCam.orthographic = true;
_depthCam.orthographicSize = 250;//hardcoded = 1k area - TODO
_depthCam.depthTextureMode = DepthTextureMode.Depth;
_depthCam.nearClipPlane =0.1f;
_depthCam.farClipPlane = surfaceData._waterMaxVisibility;
_depthCam.allowHDR = false;
//_depthCam.allowMSAA = false;
_depthCam.cullingMask = (1 << 10);
//Generate RT
if (!_depthTex)
_depthTex = new RenderTexture(1024, 1024, 24, RenderTextureFormat.Depth);
//do depth capture
_depthCam.targetTexture = _depthTex;
_depthCam.Render();
Shader.SetGlobalTexture("_WaterDepthMap", _depthTex);
// set depthbufferParams for depth cam(since it doesnt exist and only temporary)
float n = _depthCam.nearClipPlane;
float f = _depthCam.farClipPlane;
Vector4 zParams = new Vector4(n, f, f / (f-n), f * n / (n-f));
//Vector4 zParams = new Vector4(1-f/n, f/n, (1-f/n)/f, (f/n)/f);//2015
Shader.SetGlobalVector("_depthCamZParams", zParams);
_depthCam.enabled = false;
_depthCam.targetTexture = null;
}
private void OnDrawGizmos() {
if(!Application.isPlaying)
{
#if UNITY_EDITOR
waterTime = (float)UnityEditor.EditorApplication.timeSinceStartup;
#endif
Shader.SetGlobalFloat("_GlobalTime", waterTime);
}
}
[System.Serializable]
public enum DebugMode { none, stationary, screen };
}
}

11
Packages/com.verasl.water-system/Scripts/Water.cs.meta


fileFormatVersion: 2
guid: b6edb8448c9b94f018953ca2a6fa5891
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

24
Packages/com.verasl.water-system/Sea.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Sea
m_Shader: {fileID: 4800000, guid: a94edd303261140cf9e6ce8c90d7a99a, type: 3}
m_ShaderKeywords: _REFLECTION_PLANARREFLECTION
m_LightmapFlags: 2
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Floats:
- _BumpScale: 0.5
m_Colors: []

8
Packages/com.verasl.water-system/Sea.mat.meta


fileFormatVersion: 2
guid: 4849d4d15a9cb42eb9533ae935e2630b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

1001
Packages/com.verasl.water-system/SeaVisual.prefab
文件差异内容过多而无法显示
查看文件

8
Packages/com.verasl.water-system/SeaVisual.prefab.meta


fileFormatVersion: 2
guid: 2cac2e60f3f6f2447ad9b550450f60ed
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.verasl.water-system/Shaders.meta


fileFormatVersion: 2
guid: 6aab7b5e54a384c2790bfb04db9d7cfe
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

28
Packages/com.verasl.water-system/Shaders/CommonUtilities.hlsl


#ifndef COMMON_UTILITIES_INCLUDED
#define COMMON_UTILITIES_INCLUDED
// remaps a value based on a in:min/max and out:min/max
// value = value to be remapped
// remap = x = min in, y = max in, z = min out, w = max out
float Remap(half value, half4 remap)
{
return remap.z + (value - remap.x) * (remap.w - remap.z) / (remap.y - remap.x);
}
// Converts greyscale height to normal
// _tex = input texture(separate from a sampler)
// _sampler = the sampler to use
// _uv = uv coordinates
// _intensity = intensity of the effect
float3 HeightToNormal(Texture2D _tex, SamplerState _sampler, float2 _uv, half _intensity)
{
float3 bumpSamples;
bumpSamples.x = _tex.Sample(_sampler, _uv).x; // Sample center
bumpSamples.y = _tex.Sample(_sampler, float2(_uv.x + _intensity / _ScreenParams.x, _uv.y)).x; // Sample U
bumpSamples.z = _tex.Sample(_sampler, float2(_uv.x, _uv.y + _intensity / _ScreenParams.y)).x; // Sample V
half dHdU = bumpSamples.z - bumpSamples.x;//bump U offset
half dHdV = bumpSamples.y - bumpSamples.x;//bump V offset
return float3(-dHdU, dHdV, 0.5);//return tangent normal
}
#endif // COMMON_UTILITIES_INCLUDED

9
Packages/com.verasl.water-system/Shaders/CommonUtilities.hlsl.meta


fileFormatVersion: 2
guid: 74c950d64fbb9465c9dd5b5d9800f9f5
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

101
Packages/com.verasl.water-system/Shaders/GerstnerWaves.hlsl


#ifndef GERSTNER_WAVES_INCLUDED
#define GERSTNER_WAVES_INCLUDED
uniform uint _WaveCount; // how many waves, set via the water component
float _GlobalTime; // global scene time
struct Wave
{
half amplitude;
half direction;
half wavelength;
half2 origin;
half omni;
};
#if SHADER_TARGET < 30
half4 waveData[20]; // 0-9 amplitude, direction, wavelength, omni, 10-19 origin.xy
#else
StructuredBuffer<Wave> _WaveDataBuffer;
#endif
struct WaveStruct
{
float3 position;
float3 normal;
};
WaveStruct GerstnerWave(half2 pos, float waveCountMulti, half amplitude, half direction, half wavelength, half omni, half2 omniPos)
{
WaveStruct waveOut;
////////////////////////////////wave value calculations//////////////////////////
half3 wave = 0; // wave vector
half w = 6.28318 / wavelength; // 2pi over wavelength(hardcoded)
half wSpeed = sqrt(9.8 * w); // frequency of the wave based off wavelength
half peak = 0.95; // peak value, 1 is the sharpest peaks
half qi = peak / (amplitude * w * _WaveCount);
direction = radians(direction); // convert the incoming degrees to radians, for directional waves
half2 dirWaveInput = half2(sin(direction), cos(direction)) * (1 - omni);
half2 omniWaveInput = (pos - omniPos) * omni;
half2 windDir = normalize(dirWaveInput + omniWaveInput); // calculate wind direction
half dir = dot(windDir, pos - (omniPos * omni)); // calculate a gradient along the wind direction
////////////////////////////position output calculations/////////////////////////
half calc = dir * w + -_GlobalTime * wSpeed; // the wave calculation
half cosCalc = cos(calc); // cosine version(used for horizontal undulation)
half sinCalc = sin(calc); // sin version(used for vertical undulation)
// calculate the offsets for the current point
wave.xz = qi * amplitude * windDir.xy * cosCalc;
wave.y = (((sinCalc * 0.5 + 0.5) * amplitude)) * waveCountMulti;// the height is divided by the number of waves
////////////////////////////normal output calculations/////////////////////////
half wa = w * amplitude;
// normal vector
half3 n = half3(-(windDir.xy * wa * cosCalc),
1-(qi * wa * sinCalc));
////////////////////////////////assign to output///////////////////////////////
waveOut.position = wave * saturate(amplitude * 10000);
waveOut.normal = (n * waveCountMulti) * amplitude;
return waveOut;
}
inline void SampleWaves(float3 position, half opacity, out WaveStruct waveOut)
{
half2 pos = position.xz;
WaveStruct waves[10];
waveOut.position = 0;
waveOut.normal = 0;
half waveCountMulti = 1.0 / _WaveCount;
UNITY_LOOP
for(uint i = 0; i < _WaveCount; i++)
{
#if SHADER_TARGET < 30
waves[i] = GerstnerWave(pos,
waveCountMulti,
waveData[i].x,
waveData[i].y,
waveData[i].z,
waveData[i].w,
waveData[i + 10].xy); // calculate the wave
#else
waves[i] = GerstnerWave(pos,
waveCountMulti,
_WaveDataBuffer[i].amplitude,
_WaveDataBuffer[i].direction,
_WaveDataBuffer[i].wavelength,
_WaveDataBuffer[i].omni,
_WaveDataBuffer[i].origin); // calculate the wave
#endif
waveOut.position += waves[i].position; // add the position
waveOut.normal += waves[i].normal; // add the normal
}
}
#endif // GERSTNER_WAVES_INCLUDED

9
Packages/com.verasl.water-system/Shaders/GerstnerWaves.hlsl.meta


fileFormatVersion: 2
guid: 218546c4603ef4cbd9ebc00e80bf714d
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

83
Packages/com.verasl.water-system/Shaders/InfiniteWater.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: InfiniteWater
m_Shader: {fileID: 4800000, guid: 5f51d4f8f480441339ead24ab495af7d, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
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: 2800000, guid: 4b5fce50854cd46f1b97bcd5ba7f019b, type: 3}
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}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Size: 1.2
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _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}

8
Packages/com.verasl.water-system/Shaders/InfiniteWater.mat.meta


fileFormatVersion: 2
guid: e9927401bf96341d5bba91ea4c815e14
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

158
Packages/com.verasl.water-system/Shaders/InfiniteWater.shader


// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
Shader "Unlit/InfiniteWater"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Size ("size", float) = 3.0
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent-101" "RenderPipeline" = "LightweightPipeline" }
LOD 100
Pass
{
ZWrite On
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "WaterInput.hlsl"
#include "CommonUtilities.hlsl"
#include "WaterLighting.hlsl"
#define EPSILON 0.00001
// ray-plane intersection test
// @return side of plane hit
// 0 : no hit
// 1 : front
// 2 : back
int intersect_plane (float3 ro, float3 rd, float3 po, float3 pd, out float3 hit)
{
float D = dot(po, pd); // re-parameterize plane to normal + distance
float tn = D - dot(ro, pd); // ray pos w.r.t. plane (frnt, back, on)
float td = dot (rd, pd); // ray ori w.r.t. plane (towards, away, parallel)
if (td > -EPSILON && td < EPSILON) return 0; // parallel to plane
float t = tn / td; // dist along ray to hit
if (t < 0.0) return 0; // plane lies behind ray
hit = ro + t * rd; // got a hit
return (tn > 0.0) ? 2 : 1; // which side of the plane?
}
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 screenPos : TEXCOORD2;//screen position of the verticies after wave distortion
float4 viewDir : TEXCOORD3;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float _Size;
float _CameraRoll;
v2f vert (appdata v)
{
v2f o;
float3 posWS = TransformObjectToWorld(v.vertex.xyz);
o.vertex = TransformWorldToHClip(posWS);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.screenPos = ComputeScreenPos(o.vertex);
o.viewDir.xyz = UNITY_MATRIX_IT_MV[2].xyz;
float3 viewPos = TransformWorldToView(posWS);// posWS - _WorldSpaceCameraPos;
o.viewDir.w = length(viewPos / viewPos.z);
return o;
}
void frag (v2f i, out half4 outColor:SV_Target, out float outDepth : SV_Depth) //: SV_Target
{
float3 viewDir = i.viewDir.xyz; //UNITY_MATRIX_IT_MV[2].xyz;
float3 pos = _WorldSpaceCameraPos * viewDir;
i.uv = pos.xy;
//////
float4 p = i.screenPos;
float2 uv = p.xy / p.w; // [0, 1]
half2 st = 2.0 * uv - half2(1.0, 1.0);
float asp = _ScreenParams.x / _ScreenParams.y;
float2 st_adj = float2(st.x * asp, st.y);
// camera settings
//float dist = 2.0 + 0.5*sin(0.5*Time);
//float theta = 0.1230596391*_Time.y;
// float cx = dist * sin(theta);
// float cz = dist * cos(theta);
float3 cam_ori = float3(-_WorldSpaceCameraPos.x, _WorldSpaceCameraPos.y, _WorldSpaceCameraPos.z);
// vec3 cam_look = vec3(0.0, 0.50, 0.0);
float3 cam_dir = float3(viewDir.x, -viewDir.y, -viewDir.z);
// over, up, norm basis vectors for camera
half zRot = radians(-_CameraRoll);
float3 cam_ovr = normalize(cross(cam_dir, half3(0, cos(zRot), sin(zRot))));
float3 cam_uhp = normalize(cross(cam_ovr, cam_dir));
// scene
float3 po = 0;
float3 pd = half3(0.0, 1.0, 0.0);
// ray
half3 ro = cam_ori;
float cam_dist = unity_CameraProjection._m11;//80 degrees = 1.2
float3 rt = cam_ori + cam_dist*cam_dir;
rt += st_adj.x * cam_ovr;
rt += st_adj.y * cam_uhp;
half3 rd = normalize(rt - cam_ori);
float3 hit;
int side = intersect_plane (ro, rd, po, pd, hit);
if(side == 0)
discard;
//half fog = pow(1-abs(rd.y), 20);
// plane
// - figure out UV on plane to sample texture
half3 dee = hit;
float tSize = 0.05;
float2 p_uv = float2(dot(dee, half3(1, 0, 0)) * tSize, dot(dee, half3(0, 0, 1)) * tSize);
///
// sample the texture
half4 col = tex2D(_MainTex, p_uv);
//re-construct depth
half3 camPos = _WorldSpaceCameraPos;
float a = _ProjectionParams.z / ( _ProjectionParams.z - _ProjectionParams.y );
float b = _ProjectionParams.z * _ProjectionParams.y / ( _ProjectionParams.y - _ProjectionParams.z );
float z = length(hit + half3(camPos.x, camPos.y + 1, -camPos.z)) / i.viewDir.w;
float d = a + b / z;
// apply fog
//UNITY_APPLY_FOG(i.fogCoord, col);
//return float4(col);
//outColor = half4(i.viewDir.xyz, 1);
outColor = half4(frac(p_uv), frac(1-d), 1);
outDepth = 1-d;
}
ENDHLSL
}
}
FallBack "Hidden/InternalErrorShader"
}

9
Packages/com.verasl.water-system/Shaders/InfiniteWater.shader.meta


fileFormatVersion: 2
guid: 5f51d4f8f480441339ead24ab495af7d
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

38
Packages/com.verasl.water-system/Shaders/Water.shader


Shader "BoatAttack/Water"
{
Properties
{
_BumpScale("Detail Wave Amount", Range(0, 2)) = 0.2//fine detail multiplier
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent-100" "RenderPipeline" = "LightweightPipeline" }
ZWrite Off
Pass
{
Name "WaterShading"
Tags{"LightMode" = "LightweightForward"}
HLSLPROGRAM
#pragma prefer_hlslcc gles
/////////////////SHADER FEATURES//////////////////
#pragma shader_feature _REFLECTION_CUBEMAP _REFLECTION_PROBES _REFLECTION_PLANARREFLECTION
#pragma multi_compile _ FOG_LINEAR FOG_EXP2
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
////////////////////INCLUDES//////////////////////
#include "WaterCommon.hlsl"
//non-tess
#pragma vertex WaterVertex
#pragma fragment WaterFragment
ENDHLSL
}
}
FallBack "Hidden/InternalErrorShader"
}

9
Packages/com.verasl.water-system/Shaders/Water.shader.meta


fileFormatVersion: 2
guid: a94edd303261140cf9e6ce8c90d7a99a
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

240
Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl


#ifndef WATER_COMMON_INCLUDED
#define WATER_COMMON_INCLUDED
#define _SHADOWS_SOFT
#define _SHADOWS_ENABLED
#define SHADOWS_SCREEN 0
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "WaterInput.hlsl"
#include "CommonUtilities.hlsl"
#include "GerstnerWaves.hlsl"
#include "WaterLighting.hlsl"
///////////////////////////////////////////////////////////////////////////////
// Structs //
///////////////////////////////////////////////////////////////////////////////
struct WaterVertexInput // vert struct
{
float4 vertex : POSITION; // vertex positions
float2 texcoord : TEXCOORD0; // local UVs
float4 lightmapUV : TEXCOORD1; // lightmap UVs
float4 color : COLOR; // vertex colors
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct WaterVertexOutput // fragment struct
{
float4 uv : TEXCOORD0; // Geometric UVs stored in xy, and world(pre-waves) in zw
float4 lightmapUVOrVertexSH : TEXCOORD1; // holds either lightmapUV or vertex SH. depending on LIGHTMAP_ON - TODO
float3 posWS : TEXCOORD2; // world position of the vertices
half3 normal : NORMAL; // vert normals
float3 viewDir : TEXCOORD3; // view direction
float2 preWaveSP : TEXCOORD4; // screen position of the verticies before wave distortion
half4 fogFactorAndVertexLight : TEXCOORD5; // x: fogFactor, yzw: vertex light
half4 additionalData : TEXCOORD6; // x = distance to surface, y = distance to surface??
half4 vertColor : TEXCOORD7;
half4 shadowCoord : TEXCOORD8; // for ssshadows
float4 clipPos : SV_POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
///////////////////////////////////////////////////////////////////////////////
// Water shading functions //
///////////////////////////////////////////////////////////////////////////////
half3 Scattering(half depth)
{
return SAMPLE_TEXTURE2D(_AbsorptionScatteringRamp, sampler_AbsorptionScatteringRamp, half2(depth, 0.375h)).rgb;
}
half3 Absorption(half depth)
{
return SAMPLE_TEXTURE2D(_AbsorptionScatteringRamp, sampler_AbsorptionScatteringRamp, half2(depth, 0.0h)).rgb;
}
float2 AdjustedDepth(half2 uvs, half4 additionalData)
{
float rawD = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, sampler_ScreenTextures_linear_clamp, uvs);
float d = LinearEyeDepth(rawD, _ZBufferParams);
return float2(d * additionalData.x - additionalData.y, (rawD * -_ProjectionParams.x) + (1-UNITY_REVERSED_Z));
}
float3 WaterDepth(float3 posWS, half2 texcoords, half4 additionalData, half2 screenUVs)// x = seafloor depth, y = water depth
{
float3 outDepth = 0;
outDepth.xz = AdjustedDepth(screenUVs, additionalData);
float wd = UNITY_REVERSED_Z + (SAMPLE_TEXTURE2D(_WaterDepthMap, sampler_WaterDepthMap_linear_clamp, texcoords).r * _ProjectionParams.x);
outDepth.y = ((wd * _depthCamZParams.y) - 4 - _depthCamZParams.x) + posWS.y;
return outDepth;
}
half3 Refraction(half2 distortion)
{
half3 refrac = SAMPLE_TEXTURE2D(_CameraOpaqueTexture, sampler_ScreenTextures_linear_clamp, distortion);
return refrac;
}
half2 DistortionUVs(float3 normalWS)
{
half2 distortion;
distortion.x = (normalWS.x + normalWS.z);
distortion.y = (normalWS.x + normalWS.z);
return distortion * 0.005;
}
///////////////////////////////////////////////////////////////////////////////
// Vertex and Fragment functions //
///////////////////////////////////////////////////////////////////////////////
// Vertex: Used for Standard non-tessellated water
WaterVertexOutput WaterVertex(WaterVertexInput v)
{
WaterVertexOutput o = (WaterVertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.uv.xy = v.texcoord; // geo uvs
// initializes o.normal
o.normal = float3(0, 1, 0);
o.posWS = TransformObjectToWorld(v.vertex.xyz);
o.uv.zw = o.posWS.xz;
o.vertColor = v.color;
half4 screenUV = ComputeScreenPos(TransformWorldToHClip(o.posWS));
screenUV.xyz /= screenUV.w;
//Gerstner here
WaveStruct wave;
SampleWaves(o.posWS, 1, wave);
o.normal = normalize(wave.normal.xzy);
o.posWS += wave.position;
half4 waterFX = SAMPLE_TEXTURE2D_LOD(_WaterFXMap, sampler_ScreenTextures_linear_clamp, screenUV.xy, 0);
o.posWS.y += waterFX.w * 2 - 1;
//after waves
o.clipPos = TransformWorldToHClip(o.posWS);
o.shadowCoord = ComputeScreenPos(o.clipPos);
o.viewDir = SafeNormalize(_WorldSpaceCameraPos - o.posWS);
// We either sample GI from lightmap or SH. lightmap UV and vertex SH coefficients
// are packed in lightmapUVOrVertexSH to save interpolator.
// The following funcions initialize
OUTPUT_LIGHTMAP_UV(v.lightmapUV, unity_LightmapST, o.lightmapUVOrVertexSH);
OUTPUT_SH(o.normal, o.lightmapUVOrVertexSH);
o.fogFactorAndVertexLight = VertexLightingAndFog(o.normal, o.posWS, o.clipPos.xyz);
#if defined(FOG_EXP)
o.fogFactorAndVertexLight.x = ComputeGlobalFogFactor(lwWorldPos);
#endif
o.fogFactorAndVertexLight.yzw = screenUV.xyz; // pre-displaced screenUVs
// Additional data
float3 viewPos = TransformWorldToView(o.posWS.xyz);
o.additionalData.x = length(viewPos / viewPos.z);// distance to surface
o.additionalData.y = length(GetCameraPositionWS().xyz - o.posWS); // local position in camera space
o.additionalData.z = wave.position.y / _MaxWaveHeight; // encode the normalized wave height into additional data
o.additionalData.w = wave.position.x + wave.position.z;
// distance blend
half distanceBlend = saturate(o.additionalData.y * 0.005);
o.normal = lerp(o.normal, half3(0, 1, 0), distanceBlend);
return o;
}
// Fragment for water
half4 WaterFragment(WaterVertexOutput IN) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(IN);
half3 screenUV = IN.shadowCoord.xyz / IN.shadowCoord.w;//screen UVs
half4 waterFX = SAMPLE_TEXTURE2D(_WaterFXMap, sampler_ScreenTextures_linear_clamp, IN.fogFactorAndVertexLight.yz);
half animT = frac(_GlobalTime) * 16; // amination value for caustics(16 frames)
// Detail waves
half t = _Time.x;
half2 detailBump = SAMPLE_TEXTURE2D_ARRAY(_SurfaceMap, sampler_SurfaceMap, IN.uv.zw * 0.25h, animT).xy;
IN.normal += (half3(detailBump.x, 0.5h, detailBump.y) * 2 - 1) * _BumpScale;
IN.normal += half3(waterFX.y, 0.5h, waterFX.z) * 2 - 1;
// Depth
float3 depth = WaterDepth(IN.posWS, (IN.posWS.xz * 0.002) + 0.5, IN.additionalData, screenUV.xy);// TODO - hardcoded shore depth UVs
// Distortion
half2 distortion = DistortionUVs(IN.normal);
distortion = screenUV.xy + distortion * clamp(depth.x, 0, 5);
float d = depth.x;
depth.xz = AdjustedDepth(distortion, IN.additionalData);
distortion = depth.x < 0 ? screenUV.xy : distortion;
depth.x = depth.x < 0 ? d : depth.x;
// Seabed UVs from depth
float4 H = float4(distortion*2.0-1.0, UNITY_REVERSED_Z == 1 ? depth.z : 1-depth.z, 1.0);
float4 D = mul(_InvViewProjection,H);
float2 seabedWS = D.xz/D.w;
// Caustics
half caustics = SAMPLE_TEXTURE2D_ARRAY(_SurfaceMap, sampler_SurfaceMap, (seabedWS * 0.3h + t) + IN.additionalData.w * 0.1h, animT).z * 0.25h; // caustics for sea floor, darkened to 25%
// Fresnel
half fresnelTerm = CalculateFresnelTerm(lerp(IN.normal, half3(0, 1, 0), 0.5), IN.viewDir.xyz);
// Shadows
half shadow = MainLightRealtimeShadowAttenuation(TransformWorldToShadowCoord(IN.posWS));
// Specular
half3 spec = Highlights(IN.posWS, 0.005, IN.normal, IN.viewDir) * shadow;
Light mainLight = GetMainLight();
half3 ambient = SampleSHPixel(IN.lightmapUVOrVertexSH, IN.normal) * (mainLight.color * mainLight.attenuation) * 0.5;
// Reflections
half3 reflection = SampleReflections(IN.normal, IN.viewDir.xyz, screenUV.xy, fresnelTerm, 0.0);
reflection = max(reflection, spec);
// Foam
half3 foamMap = SAMPLE_TEXTURE2D(_FoamMap, sampler_FoamMap, (IN.uv.zw * 0.1) + (detailBump.xy * 0.0025)).rgb; //r=thick, g=medium, b=light
float shoreMask = 1-depth.y;//shore foam
half foamMask = (IN.additionalData.z) * 0.5;
foamMask = saturate(max(max(foamMask, shoreMask), waterFX.r * 2));
half3 foamBlend = SAMPLE_TEXTURE2D(_AbsorptionScatteringRamp, sampler_AbsorptionScatteringRamp, half2(foamMask, 0.66)).rgb;
half foam = length(foamMap * foamBlend);
reflection *= 1 - foam;
// Refraction
half3 refraction = (Refraction(distortion) + caustics) * (1 - foam);
// Final Colouring
half depthMulti = 1 / _MaxDepth;
half3 color = refraction;
color *= Absorption((depth.x - 0.5) * depthMulti);
color += Scattering(depth.x * depthMulti) * ambient * saturate(1-length(reflection));// TODO - scattering from main light(maybe additional lights too depending on cost)
color *= 1 - foam;
// Foam lighting
foam *= shadow + 0.5;
// Do compositing
half3 comp = color + reflection + foam;
// Fog
float fogFactor = IN.fogFactorAndVertexLight.x;
ApplyFog(comp, fogFactor);
return half4(comp, 1);
//return half4(caustics, 0, 0, 1); // debug line
}
#endif // WATER_COMMON_INCLUDED

9
Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl.meta


fileFormatVersion: 2
guid: 8169b68b201d74e3597abae6c06c4264
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

43
Packages/com.verasl.water-system/Shaders/WaterInput.hlsl


#ifndef WATER_INPUT_INCLUDED
#define WATER_INPUT_INCLUDED
#include "LWRP/ShaderLibrary/Core.hlsl"
CBUFFER_START(MaterialProperties)
half _BumpScale;
half _MaxDepth;
half _MaxWaveHeight;
int _DebugPass;
half4 _depthCamZParams;
float4x4 _InvViewProjection;
CBUFFER_END
// Screen Effects textures
SAMPLER(sampler_ScreenTextures_linear_clamp);
#if defined(_REFLECTION_PLANARREFLECTION)
TEXTURE2D(_PlanarReflectionTexture);
#elif defined(_REFLECTION_CUBEMAP)
TEXTURECUBE(_CubemapTexture);
SAMPLER(sampler_CubemapTexture);
#endif
TEXTURE2D(_WaterFXMap);
TEXTURE2D(_CameraDepthTexture);
TEXTURE2D(_CameraOpaqueTexture);
TEXTURE2D(_WaterDepthMap); SAMPLER(sampler_WaterDepthMap_linear_clamp);
// Surface textures
TEXTURE2D(_AbsorptionScatteringRamp); SAMPLER(sampler_AbsorptionScatteringRamp);
TEXTURE2D_ARRAY(_SurfaceMap); SAMPLER(sampler_SurfaceMap);
TEXTURE2D(_FoamMap); SAMPLER(sampler_FoamMap);
// Must match Lightweigth ShaderGraph master node
struct SurfaceData
{
half3 absorption;
half3 scattering;
half3 normal;
half foam;
};
#endif // WATER_INPUT_INCLUDED

9
Packages/com.verasl.water-system/Shaders/WaterInput.hlsl.meta


fileFormatVersion: 2
guid: b63d1585d6c8e4834994e9494b1ac4fc
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

73
Packages/com.verasl.water-system/Shaders/WaterLighting.hlsl


#ifndef WATER_LIGHTING_INCLUDED
#define WATER_LIGHTING_INCLUDED
#include "LWRP/ShaderLibrary/Lighting.hlsl"
half CalculateFresnelTerm(half3 normalWS, half3 viewDirectionWS)
{
return Pow4(1.0 - saturate(dot(normalWS, viewDirectionWS)));//fresnel TODO - find a better place
}
///////////////////////////////////////////////////////////////////////////////
// Lighting Calculations //
///////////////////////////////////////////////////////////////////////////////
//diffuse
half4 VertexLightingAndFog(half3 normalWS, half3 posWS, half3 clipPos)
{
half3 vertexLight = VertexLighting(posWS, normalWS);
half fogFactor = ComputeFogFactor(clipPos.z);
return half4(fogFactor, vertexLight);
}
//specular
half3 Highlights(half3 positionWS, half roughness, half3 normalWS, half3 viewDirectionWS)
{
Light mainLight = GetMainLight();
half roughness2 = roughness * roughness;
half3 halfDir = SafeNormalize(mainLight.direction + viewDirectionWS);
half NoH = saturate(dot(normalize(normalWS), halfDir));
half LoH = saturate(dot(mainLight.direction, halfDir));
// GGX Distribution multiplied by combined approximation of Visibility and Fresnel
// See "Optimizing PBR for Mobile" from Siggraph 2015 moving mobile graphics course
// https://community.arm.com/events/1155
half d = NoH * NoH * (roughness2 - 1.h) + 1.0001h;
half LoH2 = LoH * LoH;
half specularTerm = roughness2 / ((d * d) * max(0.1h, LoH2) * (roughness + 0.5h) * 4);
// on mobiles (where half actually means something) denominator have risk of overflow
// clamp below was added specifically to "fix" that, but dx compiler (we convert bytecode to metal/gles)
// sees that specularTerm have only non-negative terms, so it skips max(0,..) in clamp (leaving only min(100,...))
#if defined (SHADER_API_MOBILE)
specularTerm = specularTerm - HALF_MIN;
specularTerm = clamp(specularTerm, 0.0, 5.0); // Prevent FP16 overflow on mobiles
#endif
return specularTerm * mainLight.color * mainLight.attenuation;
}
///////////////////////////////////////////////////////////////////////////////
// Reflection Modes //
///////////////////////////////////////////////////////////////////////////////
half3 SampleReflections(half3 normalWS, half3 viewDirectionWS, half2 screenUV, half fresnelTerm, half roughness)
{
half3 reflection = 0;
half2 refOffset = 0;
#if _REFLECTION_CUBEMAP
half3 reflectVector = reflect(-viewDirectionWS, normalWS);
reflection = SAMPLE_TEXTURECUBE(_CubemapTexture, sampler_CubemapTexture, reflectVector).rgb;
#elif _REFLECTION_PROBES
half3 reflectVector = reflect(-viewDirectionWS, normalWS);
reflection = GlossyEnvironmentReflection(reflectVector, 0, 1);
#elif _REFLECTION_PLANARREFLECTION
refOffset += (normalWS.xx * normalWS.zz) * half2(0.5, 2);
half rimFade = (1-fresnelTerm);//value to smooth out reflection distortion on glancing/distant angles
half2 reflectionUV = screenUV + refOffset * rimFade;
reflection += SAMPLE_TEXTURE2D_LOD(_PlanarReflectionTexture, sampler_ScreenTextures_linear_clamp, reflectionUV, 6 * roughness).rgb;//planar reflection
#endif
//do backup
return reflection * fresnelTerm;
}
#endif // WATER_LIGHTING_INCLUDED

9
Packages/com.verasl.water-system/Shaders/WaterLighting.hlsl.meta


fileFormatVersion: 2
guid: f1b7d55b20a1440b38c82e0092d37161
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

41
Packages/com.verasl.water-system/Shaders/WaterTessellated.shader


Shader "BoatAttack/WaterTessellated"
{
Properties
{
_TessellationEdgeLength ("Tessellation Edge Length", Range(5, 100)) = 50
_BumpScale("Detail Wave Amount", Range(0, 1)) = 0.2//fine detail multiplier
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent-100" "RenderPipeline" = "LightweightPipeline" }
LOD 300
ZWrite Off
Pass
{
Name "WaterShading"
HLSLPROGRAM
#pragma require tessellation tessHW
/////////////////SHADER FEATURES//////////////////
#pragma shader_feature _ _TESSELLATION
#define _TESSELLATION 1
#pragma shader_feature _REFLECTION_CUBEMAP _REFLECTION_PROBES _REFLECTION_PLANARREFLECTION
#pragma multi_compile _ FOG_LINEAR FOG_EXP2
////////////////////INCLUDES//////////////////////
#include "WaterCommon.hlsl"
#include "WaterTessellation.hlsl"
#pragma vertex TessellationVertex
#pragma hull Hull
#pragma domain Domain
#pragma fragment WaterFragment
ENDHLSL
}
}
fallback "BoatAttack/Water"
}

9
Packages/com.verasl.water-system/Shaders/WaterTessellated.shader.meta


fileFormatVersion: 2
guid: 4d4deeba0d8a64503964c2f653931109
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

128
Packages/com.verasl.water-system/Shaders/WaterTessellation.hlsl


#ifndef WATER_TESSELLATION_INCLUDED
#define WATER_TESSELLATION_INCLUDED
///////////////////////////////////////////////////////////////////////////////
// Structs //
///////////////////////////////////////////////////////////////////////////////
struct TessellationControlPoint
{
float4 vertex : INTERNALTESSPOS;
float4 texcoord : TEXCOORD0; // Geometric UVs stored in xy, and world(pre-waves) in zw
float3 posWS : TEXCOORD1; // world position of the vertices
float4 color : TEXCOORD2; // vertex color
//float2 preWaveSP : TEXCOORD2; // screen position of the verticies before wave distortion
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct HS_ConstantOutput
{
float TessFactor[3] : SV_TessFactor;
float InsideTessFactor : SV_InsideTessFactor;
};
///////////////////////////////////////////////////////////////////////////////
// Tessellation functions //
///////////////////////////////////////////////////////////////////////////////
half _TessellationEdgeLength;
float TessellationEdgeFactor (float3 p0, float3 p1)
{
float edgeLength = distance(p0, p1);
float3 edgeCenter = (p0 + p1) * 0.5;
float viewDistance = distance(edgeCenter, _WorldSpaceCameraPos);
return edgeLength * _ScreenParams.y / (_TessellationEdgeLength * viewDistance);
}
TessellationControlPoint TessellationVertex( WaterVertexInput v )
{
TessellationControlPoint o;
o.vertex = v.vertex;
o.posWS = TransformObjectToWorld(v.vertex.xyz);
o.texcoord.xy = v.texcoord;
o.texcoord.zw = o.posWS.xz;
o.color = v.color;
return o;
}
HS_ConstantOutput HSConstant( InputPatch<TessellationControlPoint, 3> Input )
{
float3 p0 = TransformObjectToWorld(Input[0].vertex.xyz);
float3 p1 = TransformObjectToWorld(Input[1].vertex.xyz);
float3 p2 = TransformObjectToWorld(Input[2].vertex.xyz);
HS_ConstantOutput o = (HS_ConstantOutput)0;
o.TessFactor[0] = TessellationEdgeFactor(p1, p2);
o.TessFactor[1] = TessellationEdgeFactor(p2, p0);
o.TessFactor[2] = TessellationEdgeFactor(p0, p1);
o.InsideTessFactor = (TessellationEdgeFactor(p1, p2) +
TessellationEdgeFactor(p2, p0) +
TessellationEdgeFactor(p0, p1)) * (1 / 3.0);
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("HSConstant")]
[outputcontrolpoints(3)]
TessellationControlPoint Hull( InputPatch<TessellationControlPoint, 3> Input, uint uCPID : SV_OutputControlPointID )
{
return Input[uCPID];
}
// Domain: replaces vert for tessellation version
[domain("tri")]
WaterVertexOutput Domain( HS_ConstantOutput HSConstantData, const OutputPatch<TessellationControlPoint, 3> Input, float3 BarycentricCoords : SV_DomainLocation)
{
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
WaterVertexOutput o = (WaterVertexOutput)0;
/////////////////////Tessellation////////////////////////
float fU = BarycentricCoords.x;
float fV = BarycentricCoords.y;
float fW = BarycentricCoords.z;
float4 vertex = Input[0].vertex * fU + Input[1].vertex * fV + Input[2].vertex * fW;
o.uv = Input[0].texcoord * fU + Input[1].texcoord * fV + Input[2].texcoord * fW;
o.posWS = Input[0].posWS * fU + Input[1].posWS * fV + Input[2].posWS * fW;
o.vertColor = Input[0].color * fU + Input[1].color * fV + Input[2].color * fW;
// initializes o.normal
o.normal = float3(0, 1, 0);
//Waves
WaveStruct wave;
SampleWaves(o.posWS, saturate(o.vertColor.r * 0.1), wave);
o.normal = normalize(wave.normal.xzy);
o.posWS += wave.position;
//o.uv.zw -= wave.position.xz;
o.clipPos = TransformWorldToHClip(o.posWS);
o.shadowCoord = ComputeScreenPos(o.clipPos);
o.viewDir = SafeNormalize(_WorldSpaceCameraPos - o.posWS);
// We either sample GI from lightmap or SH. lightmap UV and vertex SH coefficients
// are packed in lightmapUVOrVertexSH to save interpolator.
// The following funcions initialize
OUTPUT_LIGHTMAP_UV(v.lightmapUV, unity_LightmapST, o.lightmapUVOrVertexSH);
OUTPUT_SH(o.normal, o.lightmapUVOrVertexSH);
o.fogFactorAndVertexLight = VertexLightingAndFog(o.normal, o.posWS, o.clipPos);
// Additional data
float3 viewPos = TransformWorldToView(o.posWS.xyz);
o.additionalData.x = length(viewPos / viewPos.z);// distance to surface
length(GetCameraPositionWS().xyz - o.posWS);
o.additionalData.z = wave.position.y / _MaxWaveHeight; // encode the normalized wave height into additional data
o.additionalData.w = wave.position.x + wave.position.z;
return o;
}
#endif // WATER_TESSELLATION_INCLUDED

9
Packages/com.verasl.water-system/Shaders/WaterTessellation.hlsl.meta


fileFormatVersion: 2
guid: b43b1830f56c64692b92d59d34a90038
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.verasl.water-system/Textures.meta


fileFormatVersion: 2
guid: 7d239908403484cb08c27667c913706b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

195
Packages/com.verasl.water-system/Textures/DefaultFoamRamp.tif


II*��R9$(1$,2P��9d��X;I�@ h;i�,Xs�H �F`�'`�'Adobe Photoshop CC 2017 (Macintosh)2018:06:05 17:23:09<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<xmp:CreatorTool>Adobe Photoshop CC 2017 (Macintosh)</xmp:CreatorTool>
<xmp:CreateDate>2018-05-13T17:58:37+01:00</xmp:CreateDate>
<xmp:MetadataDate>2018-06-05T17:23:09+01:00</xmp:MetadataDate>
<xmp:ModifyDate>2018-06-05T17:23:09+01:00</xmp:ModifyDate>
<xmpMM:InstanceID>xmp.iid:62f01a27-8f23-4e2c-b982-750ee29e4842</xmpMM:InstanceID>
<xmpMM:DocumentID>adobe:docid:photoshop:2169e027-975d-117b-82c1-96f673dff669</xmpMM:DocumentID>
<xmpMM:OriginalDocumentID>xmp.did:5f87f304-d09c-406b-b000-74842713a8e9</xmpMM:OriginalDocumentID>
<xmpMM:History>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<stEvt:action>created</stEvt:action>
<stEvt:instanceID>xmp.iid:5f87f304-d09c-406b-b000-74842713a8e9</stEvt:instanceID>
<stEvt:when>2018-05-13T17:58:37+01:00</stEvt:when>
<stEvt:softwareAgent>Adobe Photoshop CC 2015 (Macintosh)</stEvt:softwareAgent>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stEvt:action>saved</stEvt:action>
<stEvt:instanceID>xmp.iid:f4815d68-1ad5-485b-b144-0c91c0131942</stEvt:instanceID>
<stEvt:when>2018-05-13T17:58:37+01:00</stEvt:when>
<stEvt:softwareAgent>Adobe Photoshop CC 2015 (Macintosh)</stEvt:softwareAgent>
<stEvt:changed>/</stEvt:changed>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stEvt:action>saved</stEvt:action>
<stEvt:instanceID>xmp.iid:62f01a27-8f23-4e2c-b982-750ee29e4842</stEvt:instanceID>
<stEvt:when>2018-06-05T17:23:09+01:00</stEvt:when>
<stEvt:softwareAgent>Adobe Photoshop CC 2017 (Macintosh)</stEvt:softwareAgent>
<stEvt:changed>/</stEvt:changed>
</rdf:li>
</rdf:Seq>
</xmpMM:History>
<dc:format>image/tiff</dc:format>
<photoshop:ColorMode>3</photoshop:ColorMode>
<photoshop:ICCProfile>sRGB IEC61966-2.1</photoshop:ICCProfile>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>Z%G8BIM%���}�Ǿ pv���N8BIM:� printOutputPstSboolInteenumInteClrmprintSixteenBitbool printerNameTEXTprintProofSetupObjc Proof Setup
proofSetupBltnenum builtinProof proofCMYK8BIM;-printOutputOptionsCptnboolClbrboolRgsMboolCrnCboolCntCboolLblsboolNgtvboolEmlDboolIntrboolBckgObjcRGBCRd doub@o�Grn doub@o�Bl doub@o�BrdTUntF#RltBld UntF#RltRsltUntF#Pxl@b�
vectorDataboolPgPsenumPgPsPgPCLeftUntF#RltTop UntF#RltScl UntF#Prc@YcropWhenPrintingboolcropRectBottomlong cropRectLeftlong cropRectRightlong cropRectToplong8BIM���8BIM&?�8BIM Z8BIM8BIM� 8BIM'
8BIM�H/fflff/ff���2Z5-8BIM�p��������������������������������������������������������������������������������������������8BIM@@8BIM8BIM5nullboundsObjcRct1Top longLeftlongBtomlongRghtlongslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum
ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlongurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong
leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?�8BIM8BIM �{ttx���� Adobe_CM��Adobed����   
        ��{"����?

 3!1AQa"q�2���B#$R�b34r��C%�S���cs5���&D�TdE£t6�U�e�����u��F'���������������Vfv��������7GWgw��������5!1AQaq"2����B#�R��3$b�r��CScs4�%���&5��D�T�dEU6te������u��F���������������Vfv��������'7GWgw������� ?����$��W��6Z�_*�K��:0ϫ�Ge�OeȤ���g{�U�{/5Ibs�\�ϫ��hQ�x�K�纴����(9xrK�Ϲt�-���C+ŒT%���=g*+ƒE����?��8BIM!]Adobe PhotoshopAdobe Photoshop CC 2017 HLinomntrRGB XYZ � 1acspMSFTIEC sRGB���-HP cprtP3desc�lwtpt�bkptrXYZgXYZ,bXYZ@dmndTpdmdd��vuedL�view�$lumi�meas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ �Q�XYZ XYZ o�8��XYZ b����XYZ $����descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view��_.��� \�XYZ L VPW�meas�sig CRT curv
#(-27;@EJOTY^chmrw|������������������������� %+28>ELRY`gnu|���������������� &/8AKT]gqz������������ !-8COZfr~���������� -;HUcq~��������� +:IXgw��������'7HYj{�������+=Oat������� 2FZn�������  % : O d y � � � � � �

'
=
T
j
� " 9 Q i � � � � � �  * C \ u � � � � � & @ Z t � � � � �.Id���� %A^z���� &Ca~����1Om����&Ed����#Cc����'Ij����4Vx���&Il����Ae����@e���� Ek���*Qw���;c���*R{���Gp���@j���>i���  A l � � �!!H!u!�!�!�"'"U"�"�"�#
#8#f#�#�#�$$M$|$�$�% %8%h%�%�%�&'&W&�&�&�''I'z'�'�( (?(q(�(�))8)k)�)�**5*h*�*�++6+i+�+�,,9,n,�,�- -A-v-�-�..L.�.�.�/$/Z/�/�/�050l0�0�11J1�1�1�2*2c2�2�3 3F33�3�4+4e4�4�55M5�5�5�676r6�6�7$7`7�7�88P8�8�99B99�9�:6:t:�:�;-;k;�;�<'<e<�<�="=a=�=�> >`>�>�?!?a?�?�@#@d@�@�A)AjA�A�B0BrB�B�C:C}C�DDGD�D�EEUE�E�F"FgF�F�G5G{G�HHKH�H�IIcI�I�J7J}J�K KSK�K�L*LrL�MMJM�M�N%NnN�OOIO�O�P'PqP�QQPQ�Q�R1R|R�SS_S�S�TBT�T�U(UuU�VV\V�V�WDW�W�X/X}X�YYiY�ZZVZ�Z�[E[�[�\5\�\�]']x]�^^l^�__a_�``W`�`�aOa�a�bIb�b�cCc�c�d@d�d�e=e�e�f=f�f�g=g�g�h?h�h�iCi�i�jHj�j�kOk�k�lWl�mm`m�nnkn�ooxo�p+p�p�q:q�q�rKr�ss]s�ttpt�u(u�u�v>v�v�wVw�xxnx�y*y�y�zFz�{{c{�|!|�|�}A}�~~b~�#���G���
�k�͂0�����W��������G����r�ׇ;����i�Ή3�����d�ʋ0�����c�ʍ1�����f�Ώ6����n�֑?����z���M��� �����_�ɖ4���
�u���L���$�����h�՛B��������d�Ҟ@��������i�ءG���&����v���V�ǥ8��������n���R�ĩ7�������u���\�ЭD���-�������u���`�ֲK�³8���%�������y���h���Y�ѹJ�º;���.���!������
�����z���p���g���_���X���Q���K���F���Aǿ�=ȼ�:ɹ�8ʷ�6˶�5̵�5͵�6ζ�7ϸ�9к�<Ѿ�?���D���I���N���U���\���d���l���v��ۀ�܊�ݖ�ޢ�)߯�6���D���S���c���s����� ������2���F���[���p��������(���@���X���r��������4���P���m��������8���W���w����)���K���m��x��{8�g�/�z�b!ǔ���D%�Ԅ"k��"jсtR9�$$1E)%�L�LHD:��P9������n������~����}0�]f��0w�1��3�%�%�Lo��93�Y
�5�L�9�JU�m ���W��\�i�g�/d�7b.1�^ӌ鵌ył�a9���g�t�e�����Ȝpb���<��pc�z0���>�w1��fN�c�d��^'��,cꝚ�dvFO��c&�3�����Д�9�L��O� #;�΁�l \h^.�vƞ<@R4�����C��ڋ�#�etI�
`��aUG�� �)g��eQ �)�ҳ5^�%�&�֜������z��N��4ꢽ�z{��c?m�/�
�v|��@�A�ౡ���~V�&�TS�)�Ӓ��\Q�z�6I�\Y7N=[�D3o�)c�P�3ۄ�:��Zh�5��!����e�S�x�yn/��y;���k�{�sk��o��x��¼����It�C;���ʾ�����3�v�}�5�]� ����=��Ϳ�D�s ���3UF;��)p!lK5�?�Luˉpz蜱)
�ͩ�F�z��Ѹ�Tg��"����{�yR{>�_*����$���F� ����~O_z��P����n~�Y�8�\M�r}�?��]��������R6]���lL��L������X-�V^��2�v�R��tq�;��磧*x�5w��s/c¼%<�C�Jƿ;n*]��-H_�����r�o�*͒o5 �W0hG�����y{W(Yw���=���&__յe~KV_�;�S�i؟��KK~p��|m����F��a�m�z9#m[��Qc��� m�^���Hl��%�X0e�i̤F����Y�����ҙS�d�Nܲ�_�;~���e��֫�������Z�1]+�u�#��l=�ȭ^/5<���C�PϲG���%���+LG\"���x���[kܱ%�cɢ�~�\�����Y���Q���w;{tO�0����]�m��~ʭZ�L�Ƽ�����e�ƺ�]��j=�_���1k�W�:��)�O���V sz�_!'����,���̪�=�-e=���F�~V�ɀT@��ccI����������ŕ��ʷ��\*(+U����X$;խ$\x^Z�}M��t�"i�ex���Io�F�7���GJ� �%&4O@�i�ߖC_��z� �)7�%;)7�2���:��G(='��)=�՞��ge���{aNʮMaz�F�^�����pk�M�!����[�yhy{"���V�x�;.����2?ǃEO�Y��b8�|Dqp��9�a��C$�!����sOq��r�$��Q~8����Np�3^�A0��������

108
Packages/com.verasl.water-system/Textures/DefaultFoamRamp.tif.meta


fileFormatVersion: 2
guid: 4098762bce32f44b9b7c56531d1a988e
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

167
Packages/com.verasl.water-system/Textures/PeakMap.tif


II*�@
�D"(1" 2B�T6VI��
�7i��Es�0�B�$'�$'Adobe Photoshop CC 2015 (Windows)2018:02:17 22:14:24<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c111 79.158325, 2015/09/10-01:10:20 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<xmp:CreatorTool>Adobe Photoshop CC 2015 (Windows)</xmp:CreatorTool>
<xmp:CreateDate>2018-02-17T22:01:33Z</xmp:CreateDate>
<xmp:MetadataDate>2018-02-17T22:14:24Z</xmp:MetadataDate>
<xmp:ModifyDate>2018-02-17T22:14:24Z</xmp:ModifyDate>
<dc:format>image/tiff</dc:format>
<xmpMM:InstanceID>xmp.iid:eb486fc1-55ec-e940-8587-81c16674b1be</xmpMM:InstanceID>
<xmpMM:DocumentID>xmp.did:eb486fc1-55ec-e940-8587-81c16674b1be</xmpMM:DocumentID>
<xmpMM:OriginalDocumentID>xmp.did:eb486fc1-55ec-e940-8587-81c16674b1be</xmpMM:OriginalDocumentID>
<xmpMM:History>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<stEvt:action>created</stEvt:action>
<stEvt:instanceID>xmp.iid:eb486fc1-55ec-e940-8587-81c16674b1be</stEvt:instanceID>
<stEvt:when>2018-02-17T22:01:33Z</stEvt:when>
<stEvt:softwareAgent>Adobe Photoshop CC 2015 (Windows)</stEvt:softwareAgent>
</rdf:li>
</rdf:Seq>
</xmpMM:History>
<photoshop:ColorMode>3</photoshop:ColorMode>
<photoshop:ICCProfile>Adobe RGB (1998)</photoshop:ICCProfile>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>8BIM%8BIM:� printOutputPstSboolInteenumInteClrmprintSixteenBitbool printerNameTEXTprintProofSetupObjc Proof Setup
proofSetupBltnenum builtinProof proofCMYK8BIM;-printOutputOptionsCptnboolClbrboolRgsMboolCrnCboolCntCboolLblsboolNgtvboolEmlDboolIntrboolBckgObjcRGBCRd doub@o�Grn doub@o�Bl doub@o�BrdTUntF#RltBld UntF#RltRsltUntF#Pxl@n
vectorDataboolPgPsenumPgPsPgPCLeftUntF#RltTop UntF#RltScl UntF#Prc@YcropWhenPrintingboolcropRectBottomlong cropRectLeftlong cropRectRightlong cropRectToplong8BIM���8BIM&?�8BIM Z8BIM8BIM� 8BIM'
8BIM�H/fflff/ff���2Z5-8BIM�p��������������������������������������������������������������������������������������������8BIM@@8BIM8BIM5@@nullboundsObjcRct1Top longLeftlongBtomlongRghtlong@slicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum
ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlong@urlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong
leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?�8BIM8BIM H<<,���� Adobe_CM��Adobed����   
        ��"����?

 3!1AQa"q�2���B#$R�b34r��C%�S���cs5���&D�TdE£t6�U�e�����u��F'���������������Vfv��������7GWgw��������5!1AQaq"2����B#�R��3$b�r��CScs4�%���&5��D�T�dEU6te������u��F���������������Vfv��������'7GWgw������� ?�<?�a�>�W �J}�����'��IxZI%��8BIM!]Adobe PhotoshopAdobe Photoshop CC 20150ADBEmntrRGB XYZ �acspAPPLnone���-ADBE
cprt�2desc0kwtpt�bkpt�rTRC�gTRC�bTRC�rXYZ�gXYZbXYZtextCopyright 1999 Adobe Systems IncorporateddescAdobe RGB (1998)XYZ �Q�XYZ curv3curv3curv3XYZ �O��XYZ 4��,�XYZ &1/��� P7p H�0�@ Ab1�+>#1�*;D�2�6K%U�2� B[-sf3pNk5 g3��Z{=a(4�j�E7)4��z�M$*5P��U+ +5����]N
,6���e m6����mk n7p��uj �7�p��} 08�� �Sq8�Q�@�9a++�Vs9�C;�4:q_K��:��{[�&�;�k� �;�ѻ{�B�<�ۋ�S�<�
��J�z=
+��5�;=��[���<>���,�}>�����O��?+#��O�?������ ����@�

99
Packages/com.verasl.water-system/Textures/PeakMap.tif.meta


fileFormatVersion: 2
guid: 73acf520ecbde384a992281db16d291c
labels:
- DoubleCheck
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 2
wrapV: 2
wrapW: 2
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.verasl.water-system/Textures/SurfaceSequence.meta


fileFormatVersion: 2
guid: ac449a7aac54248e496d456cbf1be212
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0001.png
文件差异内容过多而无法显示
查看文件

130
Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0001.png.meta


fileFormatVersion: 2
guid: 7f1ef94d4c92a4e1ea6503d4956998c5
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
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
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

1001
Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0002.png
文件差异内容过多而无法显示
查看文件

130
Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0002.png.meta


fileFormatVersion: 2
guid: c5bbe70ebb5ec4f6e909624f0b264efa
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
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
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

1001
Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0003.png
文件差异内容过多而无法显示
查看文件

130
Packages/com.verasl.water-system/Textures/SurfaceSequence/water_Final Color Output0003.png.meta


fileFormatVersion: 2
guid: 5a1ae4c6fbf414937add6da089b0b855
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
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
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存