浏览代码

Added shore slide

Lowered cull distance for gliders and wind surfers
/main
Andre McGrail 6 年前
当前提交
98b7659d
共有 6 个文件被更改,包括 59 次插入56 次删除
  1. 2
      Assets/Objects/props/props/Prefabs/Props_Paraglider.prefab
  2. 2
      Assets/Objects/props/props/Prefabs/Windsurfer.prefab
  3. 90
      Assets/scenes/Island.unity
  4. 2
      Packages/com.verasl.water-system/Scripts/Data/WaterSurfaceData.asset
  5. 9
      Packages/com.verasl.water-system/Shaders/GerstnerWaves.hlsl
  6. 10
      Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl

2
Assets/Objects/props/props/Prefabs/Props_Paraglider.prefab


fadeTransitionWidth: 0
renderers:
- renderer: {fileID: 3785919012848208596}
- screenRelativeHeight: 0.039565362
- screenRelativeHeight: 0.0059053754
fadeTransitionWidth: 0
renderers:
- renderer: {fileID: 7219647019306317399}

2
Assets/Objects/props/props/Prefabs/Windsurfer.prefab


fadeTransitionWidth: 0
renderers:
- renderer: {fileID: 5752799900009478651}
- screenRelativeHeight: 0.03515354
- screenRelativeHeight: 0.005220988
fadeTransitionWidth: 0
renderers:
- renderer: {fileID: 8974694563192370115}

90
Assets/scenes/Island.unity


m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 3
m_BakeResolution: 2.8
m_AtlasSize: 2048
m_AO: 1
m_AOMaxDistance: 4

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

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

m_Name:
m_EditorClassIdentifier:
computeOverride: 1
_rampTexture: {fileID: 2105609847}
_rampTexture: {fileID: 969390860}
_waves:
- amplitude: 5.0900435
direction: -166.8483

m_Father: {fileID: 826222984}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!28 &969390860
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 &970352385
GameObject:
m_ObjectHideFlags: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1072933540}
m_LocalRotation: {x: 0.024982633, y: -0.7803083, z: 0.031235151, w: 0.6241148}
m_LocalRotation: {x: 0.024982626, y: -0.78030825, z: 0.031235136, w: 0.6241149}
m_LocalPosition: {x: -50.76289, y: 2.2, z: -53.19036}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

m_CorrespondingSourceObject: {fileID: 4422286388676066, guid: e77c5d66f9ece49a9aaf971f1cab072d, type: 3}
m_PrefabInstance: {fileID: 2104050947}
m_PrefabAsset: {fileID: 0}
--- !u!28 &2105609847
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 &2107163027
PrefabInstance:
m_ObjectHideFlags: 0

2
Packages/com.verasl.water-system/Scripts/Data/WaterSurfaceData.asset


randomSeed: 891
_basicWaveSettings:
numWaves: 6
amplitude: 10
amplitude: 0.8
direction: -176
wavelength: 8
_foamSettings:

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


waveOut.position = 0;
waveOut.normal = 0;
half waveCountMulti = 1.0 / _WaveCount;
half3 opacityMask = saturate(half3(3, 1, 3) * opacity);
UNITY_LOOP
for(uint i = 0; i < _WaveCount; i++)

waveCountMulti,
_WaveDataBuffer[i].amplitude * opacity,
_WaveDataBuffer[i].amplitude,
_WaveDataBuffer[i].direction,
_WaveDataBuffer[i].wavelength,
_WaveDataBuffer[i].omni,

waveCountMulti,
waveData[i].x * opacity,
waveData[i].x,
waveData[i].y,
waveData[i].z,
waveData[i].w,

waveOut.position += waves[i].position; // add the position
waveOut.normal += waves[i].normal; // add the normal
waveOut.position += waves[i].position * opacityMask; // add the position
waveOut.normal += waves[i].normal * opacityMask; // add the normal
}
}

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


screenUV.xyz /= screenUV.w;
// shallows mask
half waterDepth = UNITY_REVERSED_Z + SAMPLE_DEPTH_TEXTURE_LOD(_WaterDepthMap, sampler_WaterDepthMap_linear_clamp, (o.posWS.xz * 0.002) + 0.5, 0).r;
half waterDepth = UNITY_REVERSED_Z + SAMPLE_DEPTH_TEXTURE_LOD(_WaterDepthMap, sampler_WaterDepthMap_linear_clamp, (o.posWS.xz * 0.002) + 0.5, 1).r * _ProjectionParams.x;
waterDepth = ((waterDepth * _depthCamZParams.y) - 4 - _depthCamZParams.x);
o.posWS.y += saturate((1 - waterDepth) * 0.6 - 0.5);
SampleWaves(o.posWS, saturate((waterDepth - 3)) + 0.01, wave);
SampleWaves(o.posWS, saturate((waterDepth * 0.25)) + 0.1, wave);
o.normal = normalize(wave.normal.xzy);
o.posWS += wave.position;

// 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
float shoreMask = 1-depth.y - 0.15;//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;

float fogFactor = IN.fogFactorAndVertexLight.x;
ApplyFog(comp, fogFactor);
return half4(comp, 1);
//return half4(caustics, 0, 0, 1); // debug line
//return half4(IN.vertColor.a, 0, 0, 1); // debug line
}
#endif // WATER_COMMON_INCLUDED
正在加载...
取消
保存