浏览代码

Merge pull request #13 from Verasl/lw/api-review-v6

API review v6 changes
/main
GitHub 6 年前
当前提交
41727060
共有 15 个文件被更改,包括 160 次插入167 次删除
  1. 2
      Assets/Data/LightweightAsset.asset
  2. 2
      Assets/Objects/environment/Trees/Prefabs/Bush_Large_01.prefab
  3. 34
      Assets/Shaders/Graphs/PackedPBR.ShaderGraph
  4. 24
      Assets/Shaders/Graphs/RaceBoats.ShaderGraph
  5. 2
      Assets/Shaders/PackedPBR/InputSurfacePackedDialectric.hlsl
  6. 16
      Assets/Shaders/Vegetation/LWVegetationShader.shader
  7. 2
      Assets/Shaders/Vegetation/Vegetation.hlsl
  8. 142
      Assets/scenes/Island.unity
  9. 38
      Assets/scenes/Island_Profiles/PostVolumeGlobal Profile.asset
  10. 5
      Packages/com.verasl.water-system/Scripts/Data/WaterSettingsData.asset
  11. 30
      Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl
  12. 12
      Packages/com.verasl.water-system/Shaders/WaterFXShader.shader
  13. 2
      Packages/com.verasl.water-system/Shaders/WaterInput.hlsl
  14. 14
      Packages/com.verasl.water-system/Shaders/WaterLighting.hlsl
  15. 2
      ProjectSettings/ProjectVersion.txt

2
Assets/Data/LightweightAsset.asset


k_AssetVersion: 4
m_RequireDepthTexture: 1
m_RequireOpaqueTexture: 1
m_OpaqueDownsampling: 1
m_OpaqueDownsampling: 0
m_SupportsHDR: 1
m_MSAA: 4
m_RenderScale: 1

2
Assets/Objects/environment/Trees/Prefabs/Bush_Large_01.prefab


m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 68
m_StaticEditorFlags: 64
m_IsActive: 1
--- !u!4 &4366309025925484
Transform:

34
Assets/Shaders/Graphs/PackedPBR.ShaderGraph
文件差异内容过多而无法显示
查看文件

24
Assets/Shaders/Graphs/RaceBoats.ShaderGraph
文件差异内容过多而无法显示
查看文件

2
Assets/Shaders/PackedPBR/InputSurfacePackedDialectric.hlsl


#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/InputSurfaceCommon.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/SurfaceInput.hlsl"
CBUFFER_START(UnityPerMaterial)
float4 _MainTex_ST;

16
Assets/Shaders/Vegetation/LWVegetationShader.shader


inputData.positionWS = IN.posWS;
#ifdef _NORMALMAP
half3 viewDir = half3(IN.normal.w, IN.tangent.w, IN.binormal.w);
inputData.normalWS = TangentToWorldNormal(normalTS, IN.tangent.xyz, IN.binormal.xyz, IN.normal.xyz);
half3 viewDir = half3(IN.normal.w, IN.tangent.w, IN.bitangent.w);
inputData.normalWS = normalize(TransformTangentToWorld(normalTS, half3x3(IN.tangent.xyz, IN.bitangent.xyz, IN.normal.xyz)));
inputData.normalWS = FragmentNormalWS(IN.normal);
inputData.normalWS = TransformObjectToWorldNormal(IN.normal);
inputData.viewDirectionWS = FragmentViewDirWS(viewDir);
inputData.viewDirectionWS = viewDir;
#if defined(_MAIN_LIGHT_SHADOWS)
inputData.shadowCoord = IN.shadowCoord;
#else

//////////////////////////////////////////////////////////////////////////////////////////////////////
#endif
VertexPositionInputs vertexPosition = GetVertexPositionInputs(input.positionOS);
VertexTBN vertexTBN = GetVertexTBN(input.normalOS, input.tangentOS);
VertexNormalInputs vertexTBN = GetVertexNormalInputs(input.normalOS, input.tangentOS);
half3 viewDir = VertexViewDirWS(GetCameraPositionWS() - vertexPosition.positionWS);
half3 viewDir = GetCameraPositionWS() - vertexPosition.positionWS;
output.binormal = half4(vertexTBN.binormalWS, viewDir.z);
output.bitangent = half4(vertexTBN.bitangentWS, viewDir.z);
#else
output.normal = vertexTBN.normalWS;
output.viewDir = viewDir;

half4 color = LightweightFragmentPBR(inputData, surfaceData.albedo, surfaceData.metallic, surfaceData.specular, surfaceData.smoothness, surfaceData.occlusion, surfaceData.emission, surfaceData.alpha);
ApplyFog(color.rgb, inputData.fogCoord);
color.rgb = MixFog(color.rgb, inputData.fogCoord);
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
LODDitheringTransition(IN.clipPos, unity_LODFade.x);
#endif

2
Assets/Shaders/Vegetation/Vegetation.hlsl


#ifdef _NORMALMAP
half4 normal : TEXCOORD3; // xyz: normal, w: viewDir.x
half4 tangent : TEXCOORD4; // xyz: tangent, w: viewDir.y
half4 binormal : TEXCOORD5; // xyz: binormal, w: viewDir.z
half4 bitangent : TEXCOORD5; // xyz: binormal, w: viewDir.z
#else
half3 normal : TEXCOORD3;
half3 viewDir : TEXCOORD4;

142
Assets/scenes/Island.unity


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 153441711}
m_LocalRotation: {x: 0.027232004, y: -0.9254419, z: 0.17506817, w: 0.33491325}
m_LocalPosition: {x: -30.551498, y: 3.6019359, z: -57.88359}
m_LocalRotation: {x: 0.04048971, y: -0.87546855, z: 0.13453066, w: 0.4624035}
m_LocalPosition: {x: -27.666285, y: 3.3898504, z: -58.783054}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 636757618}

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &221112192
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &225456481
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &245251185
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &253523339
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &395521131
CanvasRenderer:
m_ObjectHideFlags: 0

m_Modifications:
- target: {fileID: 400000, guid: 074aa8ca109924e18baf19f3e26665b6, type: 3}
propertyPath: m_LocalPosition.x
value: -37.5
value: -31.25
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 074aa8ca109924e18baf19f3e26665b6, type: 3}
propertyPath: m_LocalPosition.y

propertyPath: m_LocalPosition.z
value: -50
value: -62.5
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 074aa8ca109924e18baf19f3e26665b6, type: 3}
propertyPath: m_LocalRotation.x

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &494018925
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &536684412
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &586584720
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &609608448
CanvasRenderer:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
computeOverride: 1
_rampTexture: {fileID: 926539263}
_rampTexture: {fileID: 1225488826}
_waves:
- amplitude: 0.30540264
direction: -166.8483

m_Name:
m_EditorClassIdentifier:
m_Path: {fileID: 1210977309}
m_PathPosition: 16.767363
m_PathPosition: 16.717361
m_PositionUnits: 0
m_PathOffset: {x: 0, y: 0, z: 0}
m_XDamping: 3

m_RollDamping: 0
m_AutoDolly:
m_Enabled: 1
m_PositionOffset: -0.05
m_PositionOffset: -0.1
m_SearchRadius: 3
m_SearchResolution: 5
--- !u!114 &636757620

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &792666628
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &810153609
CanvasRenderer:
m_ObjectHideFlags: 0

type: 3}
m_PrefabInstance: {fileID: 174313191}
m_PrefabAsset: {fileID: 0}
--- !u!28 &926539263
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: ffe1f6ffffcdf1fbffb8ecf8ffa4e7f4ff90e2f1ff7cdcedff67d7e9ff53d2e6ff3fcde2ff2ac8deff21c4dbff21c2d8ff20c0d5ff1fbdd3ff1ebbd0ff1db9cdff1cb6caff1bb4c7ff1ab2c4ff19afc1ff18adbeff17abbbff17a8b8ff16a6b5ff15a4b2ff14a1b0ff139fadff129daaff119aa7ff1098a4ff0f96a1ff0e949eff0d919bff0c8f98ff0c8d95ff0b8a92ff0a888fff09868dff08838aff078187ff067f84ff057d82ff057b81ff057a81ff057981ff057880ff057680ff05757fff05747fff04737fff04727eff04707eff046f7dff046e7dff046d7dff046b7cff046a7cff03697bff03687bff03667bff03657aff03647aff036379ff036179ff036079ff025f78ff025e78ff025d77ff025b77ff025a77ff025976ff025876ff025675ff025575ff015475ff015374ff015174ff015073ff014f73ff014e73ff014c72ff014b72ff004a71ff004971ff004871ff004670ff00456eff00436bff004169ff004066ff003e63ff003d61ff003b5eff00395cff003859ff003656ff003454ff003351ff00314eff002f4cff002e49ff002c47ff002b44ff002941ff00273fff00263cff00243aff002237ff002134ff001f32ff001d2fff001c2cff001a2aff001927ff001725ff001522ff00141fff00121dff00101aff000f18ff000d15ff000b12ff000a10ff00080dff00070aff000508ff000305ff000203ff000000ff010505ff020b09ff03100eff041612ff051b17ff06211bff072620ff092c24ff0a3129ff0b362dff0c3c32ff0d4136ff0e473bff0f4c3fff105244ff115748ff125d4dff136251ff146756ff156957ff156957ff156a58ff156a58ff166a58ff166b58ff166b59ff166c59ff176c59ff176c5aff176d5aff176d5aff186d5bff186e5bff186e5bff196f5cff196f5cff196f5cff19705cff1a705dff1a715dff1a715dff1a715eff1b725eff1b725eff1b725fff1b735fff1c735fff1c745fff1c7460ff1c7460ff1d7560ff1d7561ff1d7661ff1d7662ff1d7863ff1d7965ff1c7b66ff1c7c68ff1c7e6aff1b7f6bff1b816dff1b826eff1a8470ff1a8572ff198773ff198975ff198a76ff188c78ff188d7aff188f7bff17907dff17927eff179380ff169582ff169683ff169885ff159986ff159b88ff149c8aff149e8bff149f8dff13a18eff13a290ff13a492ff12a593ff12a795ff12a996ff11aa98ff11ac9aff11ad9bff10af9dff10b09eff0fb2a0ff0fb3a2ff0fb5a3ff0eb6a5ff0eb8a6ff0eb9a8ff0dbbaaff0dbcabff0dbeadff0cbfaeff0cc1b0ff0cc2b2ff0bc4b3ff0bc5b5ff0ac7b6ff0ac9b8ff0acab9ff09ccbbff09cdbdff09cfbeff08d0c0ff08d2c1ff08d3c3ff07d5c5ff07d6c6ff07d8c8ff06d9c9ff06dbcbff05dccdff05deceff05dfd0ff04e1d1ff04e2d3ff04e4d5ff03e5d6ff000000ff000001ff000001ff000002ff000003ff000004ff000005ff000006ff000007ff000008ff000009ff00000bff00000cff00000dff00000fff000011ff000012ff000013ff000015ff000017ff000019ff00001cff00001dff00001fff000021ff000024ff000026ff000029ff00002bff00002eff000031ff000034ff000037ff00003aff00003dff000040ff000043ff000047ff00004bff00004eff000052ff000056ff00005aff00005eff000063ff000067ff00006cff000070ff000075ff00007aff00007fff000084ff000089ff00008eff000094ff000099ff00009fff0000a4ff0000aaff0000afff0003b5ff0006bbff0009c1ff000dc7ff0010cdff0014d3ff0018d9ff001cdeff0021e4ff0025e9ff0029efff002ef4ff0033faff0038feff003efeff0043faff0049f7ff004ef3ff0054eeff005aebff0060e6ff0067e1ff006edcff0075d7ff007cd1ff0084cbff008cc5ff0094bfff009cb7ff00a5b0ff00ada8ff00b6a1ff00be99ff00c790ff04cf88ff0cd880ff14e177ff1ce96eff24f165ff2df85cff36ff54ff40fb4bff4af643ff53f13aff5deb32ff68e52aff72df23ff7dd81bff87d214ff91cb0dff9bc507ffa5be01ffaeb800ffb6b200ffbeae00ffc5a800ffcca300ffd29f00ffd89b00ffdd9800ffe39400ffe89000ffec8d00fff08b00fff48800fff68600fff98500fffc82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
m_StreamData:
offset: 0
size: 0
path:
--- !u!1001 &927230700
PrefabInstance:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &992348895
CanvasRenderer:
m_ObjectHideFlags: 0

width: 1
height: 1
near clip plane: 0.1
far clip plane: 5000
far clip plane: 500
field of view: 70
orthographic: 0
orthographic size: 10

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1017609894}
m_LocalRotation: {x: -0.052720413, y: -0.74486345, z: -0.05927614, w: 0.6624842}
m_LocalPosition: {x: -33.59, y: 1.85, z: -54.445614}
m_LocalRotation: {x: 0.04048971, y: -0.87546855, z: 0.13453066, w: 0.4624035}
m_LocalPosition: {x: -27.666285, y: 3.3898504, z: -58.783054}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 208737146}

m_Name:
m_EditorClassIdentifier:
m_settings:
m_ResolutionMultiplier: 2
m_ResolutionMultiplier: 1
m_ClipPlaneOffset: 0.25
m_ReflectLayers:
serializedVersion: 2

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1069649451
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1077473339
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1079184102
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1106515490
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1125367333
CanvasRenderer:
m_ObjectHideFlags: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1143740434}
m_LocalRotation: {x: -0.0019898042, y: 0.95963746, z: -0.0067909043, w: -0.28115118}
m_LocalRotation: {x: -0.0019885928, y: 0.9596876, z: -0.0067912587, w: -0.28098005}
m_LocalPosition: {x: 42, y: 2.51, z: 62.1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1152084043
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1153110732
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1211680450
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1213033641
CanvasRenderer:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cf92f64c366a83f42b7636e1086fec18, type: 3}
--- !u!28 &1225488826
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: ffe1f6ffffcdf1fbffb8ecf8ffa4e7f4ff90e2f1ff7cdcedff67d7e9ff53d2e6ff3fcde2ff2ac8deff21c4dbff21c2d8ff20c0d5ff1fbdd3ff1ebbd0ff1db9cdff1cb6caff1bb4c7ff1ab2c4ff19afc1ff18adbeff17abbbff17a8b8ff16a6b5ff15a4b2ff14a1b0ff139fadff129daaff119aa7ff1098a4ff0f96a1ff0e949eff0d919bff0c8f98ff0c8d95ff0b8a92ff0a888fff09868dff08838aff078187ff067f84ff057d82ff057b81ff057a81ff057981ff057880ff057680ff05757fff05747fff04737fff04727eff04707eff046f7dff046e7dff046d7dff046b7cff046a7cff03697bff03687bff03667bff03657aff03647aff036379ff036179ff036079ff025f78ff025e78ff025d77ff025b77ff025a77ff025976ff025876ff025675ff025575ff015475ff015374ff015174ff015073ff014f73ff014e73ff014c72ff014b72ff004a71ff004971ff004871ff004670ff00456eff00436bff004169ff004066ff003e63ff003d61ff003b5eff00395cff003859ff003656ff003454ff003351ff00314eff002f4cff002e49ff002c47ff002b44ff002941ff00273fff00263cff00243aff002237ff002134ff001f32ff001d2fff001c2cff001a2aff001927ff001725ff001522ff00141fff00121dff00101aff000f18ff000d15ff000b12ff000a10ff00080dff00070aff000508ff000305ff000203ff000000ff010505ff020b09ff03100eff041612ff051b17ff06211bff072620ff092c24ff0a3129ff0b362dff0c3c32ff0d4136ff0e473bff0f4c3fff105244ff115748ff125d4dff136251ff146756ff156957ff156957ff156a58ff156a58ff166a58ff166b58ff166b59ff166c59ff176c59ff176c5aff176d5aff176d5aff186d5bff186e5bff186e5bff196f5cff196f5cff196f5cff19705cff1a705dff1a715dff1a715dff1a715eff1b725eff1b725eff1b725fff1b735fff1c735fff1c745fff1c7460ff1c7460ff1d7560ff1d7561ff1d7661ff1d7662ff1d7863ff1d7965ff1c7b66ff1c7c68ff1c7e6aff1b7f6bff1b816dff1b826eff1a8470ff1a8572ff198773ff198975ff198a76ff188c78ff188d7aff188f7bff17907dff17927eff179380ff169582ff169683ff169885ff159986ff159b88ff149c8aff149e8bff149f8dff13a18eff13a290ff13a492ff12a593ff12a795ff12a996ff11aa98ff11ac9aff11ad9bff10af9dff10b09eff0fb2a0ff0fb3a2ff0fb5a3ff0eb6a5ff0eb8a6ff0eb9a8ff0dbbaaff0dbcabff0dbeadff0cbfaeff0cc1b0ff0cc2b2ff0bc4b3ff0bc5b5ff0ac7b6ff0ac9b8ff0acab9ff09ccbbff09cdbdff09cfbeff08d0c0ff08d2c1ff08d3c3ff07d5c5ff07d6c6ff07d8c8ff06d9c9ff06dbcbff05dccdff05deceff05dfd0ff04e1d1ff04e2d3ff04e4d5ff03e5d6ff000000ff000001ff000001ff000002ff000003ff000004ff000005ff000006ff000007ff000008ff000009ff00000bff00000cff00000dff00000fff000011ff000012ff000013ff000015ff000017ff000019ff00001cff00001dff00001fff000021ff000024ff000026ff000029ff00002bff00002eff000031ff000034ff000037ff00003aff00003dff000040ff000043ff000047ff00004bff00004eff000052ff000056ff00005aff00005eff000063ff000067ff00006cff000070ff000075ff00007aff00007fff000084ff000089ff00008eff000094ff000099ff00009fff0000a4ff0000aaff0000afff0003b5ff0006bbff0009c1ff000dc7ff0010cdff0014d3ff0018d9ff001cdeff0021e4ff0025e9ff0029efff002ef4ff0033faff0038feff003efeff0043faff0049f7ff004ef3ff0054eeff005aebff0060e6ff0067e1ff006edcff0075d7ff007cd1ff0084cbff008cc5ff0094bfff009cb7ff00a5b0ff00ada8ff00b6a1ff00be99ff00c790ff04cf88ff0cd880ff14e177ff1ce96eff24f165ff2df85cff36ff54ff40fb4bff4af643ff53f13aff5deb32ff68e52aff72df23ff7dd81bff87d214ff91cb0dff9bc507ffa5be01ffaeb800ffb6b200ffbeae00ffc5a800ffcca300ffd29f00ffd89b00ffdd9800ffe39400ffe89000ffec8d00fff08b00fff48800fff68600fff98500fffc82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
m_StreamData:
offset: 0
size: 0
path:
--- !u!1001 &1226253752
PrefabInstance:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1390333486
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1397625331
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1448888969
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1474963970
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1477516787
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1500053846
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1545390325
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1618939849
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1640132581
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1738545248
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1760473955
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1926880081
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &1949819815
CanvasRenderer:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &2003249933
CanvasRenderer:
m_ObjectHideFlags: 0

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &2061336192
Transform:
m_ObjectHideFlags: 0

m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &2120932247
CanvasRenderer:
m_ObjectHideFlags: 0

38
Assets/scenes/Island_Profiles/PostVolumeGlobal Profile.asset


- {fileID: 114726729492399870}
- {fileID: 114812438466178442}
- {fileID: 114451369704550768}
- {fileID: 114107991637653902}
--- !u!114 &114107991637653902
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b3f6f3f7c722b4544b97e3c75840aa33, type: 3}
m_Name: AutoExposure
m_EditorClassIdentifier:
active: 1
enabled:
overrideState: 1
value: 1
filtering:
overrideState: 0
value: {x: 50, y: 95}
minLuminance:
overrideState: 1
value: 0.4
maxLuminance:
overrideState: 1
value: 1
keyValue:
overrideState: 0
value: 1
eyeAdaptation:
overrideState: 0
value: 0
speedUp:
overrideState: 0
value: 2
speedDown:
overrideState: 0
value: 1
--- !u!114 &114213298802087806
MonoBehaviour:
m_ObjectHideFlags: 3

5
Packages/com.verasl.water-system/Scripts/Data/WaterSettingsData.asset


MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

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}

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


return outDepth;
}
half3 Refraction(half2 distortion)
half3 Refraction(half2 distortion, half mip)
half3 refrac = SAMPLE_TEXTURE2D(_CameraOpaqueTexture, sampler_ScreenTextures_linear_clamp, distortion);
half3 refrac = SAMPLE_TEXTURE2D_LOD(_CameraOpaqueTexture, sampler_CameraOpaqueTexture_linear, distortion, mip);
half2 DistortionUVs(float3 normalWS)
half2 DistortionUVs(half depth, float3 normalWS)
half2 distortion;
distortion.x = (normalWS.x + normalWS.z);
distortion.y = (normalWS.x + normalWS.z);
return distortion * 0.005;
//half2 distortion;
half3 viewNormal = mul(GetWorldToHClipMatrix(), -normalWS).xyz;
return viewNormal.xz * saturate((depth) * 0.005);
}
///////////////////////////////////////////////////////////////////////////////

o.posWS = TransformObjectToWorld(v.vertex.xyz);
o.uv.zw = o.posWS.xz;
o.vertColor = v.color;
o.vertColor.a = (noise((o.posWS.xz * 0.5) + _GlobalTime * 0.25) - 0.5) + 1;
o.vertColor.a = ((noise((o.posWS.xz * 0.5) + _GlobalTime) + noise((o.posWS.xz * 1) + _GlobalTime)) * 0.25 - 0.5) + 1;
half4 screenUV = ComputeScreenPos(TransformWorldToHClip(o.posWS));
screenUV.xyz /= screenUV.w;

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);
half2 distortion = DistortionUVs(depth.x, 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;

float2 seabedWS = D.xz/D.w;
// Caustics
half2 causticUV = (seabedWS * 0.3h + t + (IN.vertColor.a * 0.1)) + IN.additionalData.w * 0.1h;
half2 causticUV = (seabedWS * 0.3h + t + half2((IN.vertColor.a * 0.25), (1-IN.vertColor.a) * 0.25)) + IN.additionalData.w * 0.1h;
half caustics = SAMPLE_TEXTURE2D_ARRAY_LOD(_SurfaceMap, sampler_SurfaceMap, causticUV, animT, depth.x * 0.5).z * saturate(depth.x); // caustics for sea floor, darkened to 25%
// Fresnel

half3 ambient = SampleSHPixel(IN.lightmapUVOrVertexSH, IN.normal) * (mainLight.color * mainLight.distanceAttenuation);
// Foam
float2 foamMapUV = (IN.uv.zw * 0.1) + (detailBump.xy * 0.0025) + (IN.vertColor.a * 0.05) + _GlobalTime * 0.05;
float2 foamMapUV = (IN.uv.zw * 0.1) + (detailBump.xy * 0.0025) + half2(IN.vertColor.a * 0.1, (1-IN.vertColor.a) * 0.1) + _GlobalTime * 0.05;
half3 foamMap = SAMPLE_TEXTURE2D(_FoamMap, sampler_FoamMap, foamMapUV).rgb; //r=thick, g=medium, b=light
half shoreMask = pow(((1-depth.y + 9) * 0.1), 6);
half foamMask = (IN.additionalData.z);

reflection *= 1 - saturate(foam);
// Refraction
half3 refraction = Refraction(distortion);
half3 refraction = Refraction(distortion, depth.x * 0.25);
// Final Colouring
half depthMulti = 1 / _MaxDepth;

// Fog
float fogFactor = IN.fogFactorAndVertexLight.x;
ApplyFog(comp, fogFactor);
comp = MixFog(comp, fogFactor);
//return half4(foam, 1); // debug line
//return half4(refraction, 1); // debug line
}
#endif // WATER_COMMON_INCLUDED

12
Packages/com.verasl.water-system/Shaders/WaterFXShader.shader


float2 uv : TEXCOORD0;
half4 normal : TEXCOORD1; // xyz: normal, w: viewDir.x
half4 tangent : TEXCOORD2; // xyz: tangent, w: viewDir.y
half4 binormal : TEXCOORD3; // xyz: binormal, w: viewDir.z
half4 bitangent : TEXCOORD3; // xyz: binormal, w: viewDir.z
half4 color : TEXCOORD4;
float4 vertex : SV_POSITION;
};

Varyings output = (Varyings)0;
VertexPositionInputs vertexPosition = GetVertexPositionInputs(input.positionOS.xyz);
VertexTBN vertexTBN = GetVertexTBN(input.normalOS, input.tangentOS);
VertexNormalInputs vertexTBN = GetVertexNormalInputs(input.normalOS, input.tangentOS);
output.vertex = vertexPosition.positionCS;

half3 viewDir = VertexViewDirWS(GetCameraPositionWS() - vertexPosition.positionWS);
half3 viewDir = GetCameraPositionWS() - vertexPosition.positionWS;
output.binormal = half4(vertexTBN.binormalWS, viewDir.z);
output.bitangent = half4(vertexTBN.bitangentWS, viewDir.z);
return output;
}

half3 tNorm = half3(col.b, col.g, 1) * 2 - 1;
half3 viewDir = half3(input.normal.w, input.tangent.w, input.binormal.w);
half3 normalWS = TangentToWorldNormal(tNorm, input.tangent.xyz, input.binormal.xyz, input.normal.xyz);
half3 viewDir = half3(input.normal.w, input.tangent.w, input.bitangent.w);
half3 normalWS = TransformTangentToWorld(tNorm, half3x3(input.tangent.xyz, input.bitangent.xyz, input.normal.xyz));
normalWS = lerp(half3(0, 1, 0), normalWS, input.color.g);
half4 comp = half4(foamMask, normalWS.xz, disp);

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


#endif
TEXTURE2D(_WaterFXMap);
TEXTURE2D(_CameraDepthTexture);
TEXTURE2D(_CameraOpaqueTexture); SAMPLER(sampler_CameraOpaqueTexture);
TEXTURE2D(_CameraOpaqueTexture); SAMPLER(sampler_CameraOpaqueTexture_linear);
TEXTURE2D(_WaterDepthMap); SAMPLER(sampler_WaterDepthMap_linear_clamp);

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


half3 reflectVector = reflect(-viewDirectionWS, normalWS);
reflection = GlossyEnvironmentReflection(reflectVector, 0, 1);
#elif _REFLECTION_PLANARREFLECTION
refOffset += (normalWS.xx * normalWS.zz) * half2(0.2, 4);
half rimFade = (1-fresnelTerm);//value to smooth out reflection distortion on glancing/distant angles
half2 reflectionUV = screenUV + refOffset * rimFade;
// get the perspective projection
float2 p11_22 = float2(unity_CameraInvProjection._11, unity_CameraInvProjection._22) * 10;
// conver the uvs into view space by "undoing" projection
float3 viewDir = -(float3((screenUV * 2 - 1) / p11_22, -1));
//half3 viewDir = (mul((real3x3)GetWorldToViewMatrix(), -viewDirectionWS));
half3 viewNormal = mul(-normalWS, GetWorldToViewMatrix()).xyz;
half3 reflectVector = reflect(-viewDir, viewNormal);
half2 reflectionUV = screenUV + reflectVector * 0.05;
reflection += SAMPLE_TEXTURE2D_LOD(_PlanarReflectionTexture, sampler_ScreenTextures_linear_clamp, reflectionUV, 6 * roughness).rgb;//planar reflection
#endif
//do backup

2
ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2019.1.0a2
m_EditorVersion: 2018.3.0b4
正在加载...
取消
保存