浏览代码

Small updates

/main
André McGrail 6 年前
当前提交
699942a9
共有 8 个文件被更改,包括 79 次插入78 次删除
  1. 1
      Assets/Data/BoatDemoRenderer.asset
  2. 8
      Assets/Data/LightweightAsset.asset
  3. 92
      Assets/scenes/Island.unity
  4. 33
      Packages/com.verasl.water-system/Scripts/Data/WaterSurfaceData.asset
  5. 9
      Packages/com.verasl.water-system/Scripts/Water.cs
  6. 4
      Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl
  7. 2
      Packages/com.verasl.water-system/Shaders/WaterLighting.hlsl
  8. 8
      Assets/Plugins.meta

1
Assets/Data/BoatDemoRenderer.asset


m_RendererFeatures:
- {fileID: -5007552800156170450}
- {fileID: 7749027049794126836}
- {fileID: 0}
m_BlitShader: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}
m_CopyDepthShader: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
m_ScreenSpaceShadowShader: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd,

8
Assets/Data/LightweightAsset.asset


m_RendererType: 0
m_RendererData: {fileID: 11400000, guid: fa301df1a78cf4a9ebe2a3139dc8be8f, type: 2}
m_RequireDepthTexture: 0
m_RequireOpaqueTexture: 0
m_OpaqueDownsampling: 1
m_RequireOpaqueTexture: 1
m_OpaqueDownsampling: 0
m_MSAA: 4
m_MSAA: 2
m_RenderScale: 1
m_MainLightRenderingMode: 1
m_MainLightShadowsSupported: 1

m_ShadowDepthBias: 0.75
m_ShadowNormalBias: 0.75
m_SoftShadowsSupported: 1
m_UseSRPBatcher: 0
m_UseSRPBatcher: 1
m_SupportsDynamicBatching: 0
m_MixedLightingSupported: 0
m_ShadowType: 1

92
Assets/scenes/Island.unity


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 153441711}
m_LocalRotation: {x: 0.04562374, y: -0.8740315, z: 0.14433417, w: 0.46168736}
m_LocalRotation: {x: 0.045735955, y: -0.8737093, z: 0.14425422, w: 0.4623105}
m_LocalPosition: {x: -27.64817, y: 3.388555, z: -58.78851}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

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

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

m_Name:
m_EditorClassIdentifier:
computeOverride: 1
_rampTexture: {fileID: 735613844}
_rampTexture: {fileID: 918767923}
_waves:
- amplitude: 0.30540264
direction: -166.8483

type: 3}
m_PrefabInstance: {fileID: 735505656}
m_PrefabAsset: {fileID: 0}
--- !u!28 &735613844
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: ffffffffffeffdffffdffbffffd0f9ffffc0f7ffffb0f5ffffa0f3ffff90f1ffff81efffff71eeffff61ecffff51eaffff41e8ffff32e6ffff2ee2fbff2cdef7ff2bdbf2ff29d7eeff28d3e9ff26cfe4ff25cce0ff23c8dbff22c4d7ff20c0d2ff1fbcceff1db9c9ff1cb5c5ff1ab1c0ff19adbcff17a9b7ff16a6b2ff14a2aeff139ea9ff119aa5ff1096a0ff0e939cff0d8f97ff0b8b93ff0a878eff088389ff078085ff057d82ff057b81ff057a81ff057981ff057880ff057680ff05757fff05747fff04737fff04727eff04707eff046f7dff046e7dff046d7dff046b7cff046a7cff03697bff03687bff03667bff03657aff03647aff036379ff036179ff036079ff025f78ff025e78ff025d77ff025b77ff025a77ff025976ff025876ff025675ff025575ff015475ff015374ff015174ff015073ff014f73ff014e73ff014c72ff014b72ff004a71ff004971ff004871ff004670ff00456eff00436bff004169ff004066ff003e63ff003d61ff003b5eff00395cff003859ff003656ff003454ff003351ff00314eff002f4cff002e49ff002c47ff002b44ff002941ff00273fff00263cff00243aff002237ff002134ff001f32ff001d2fff001c2cff001a2aff001927ff001725ff001522ff00141fff00121dff00101aff000f18ff000d15ff000b12ff000a10ff00080dff00070aff000508ff000305ff000203ff000000ff010403ff020807ff020c0aff03110eff041511ff051915ff061d18ff06211bff07251fff082922ff092e26ff0a3229ff0b362dff0b3a30ff0c3e34ff0d4237ff0e463aff0f4b3eff0f4f41ff105345ff115748ff125b4cff135f4fff136352ff146856ff156957ff156957ff156a58ff166a58ff166b58ff166b59ff176c59ff176c5aff176d5aff186d5aff186e5bff186e5bff186f5bff196f5cff196f5cff19705dff1a705dff1a715dff1a715eff1b725eff1b725eff1b735fff1c735fff1c745fff1c7460ff1d7560ff1d7561ff1d7661ff1d7662ff1d7863ff1d7965ff1c7b66ff1c7c68ff1c7e6aff1b7f6bff1b816dff1b826eff1a8470ff1a8572ff198773ff198975ff198a76ff188c78ff188d7aff188f7bff17907dff17927eff179380ff169582ff169683ff169885ff159986ff159b88ff149c8aff149e8bff149f8dff13a18eff13a290ff13a492ff12a593ff12a795ff12a996ff11aa98ff11ac9aff11ad9bff10af9dff10b09eff0fb2a0ff0fb3a2ff0fb5a3ff0eb6a5ff0eb8a6ff0eb9a8ff0dbbaaff0dbcabff0dbeadff0cbfaeff0cc1b0ff0cc2b2ff0bc4b3ff0bc5b5ff0ac7b6ff0ac9b8ff0acab9ff09ccbbff09cdbdff09cfbeff08d0c0ff08d2c1ff08d3c3ff07d5c5ff07d6c6ff07d8c8ff06d9c9ff06dbcbff05dccdff05deceff05dfd0ff04e1d1ff04e2d3ff04e4d5ff03e5d6ff000000ff000001ff000001ff000002ff000003ff000004ff000005ff000006ff000007ff000008ff000009ff00000bff00000cff00000dff00000fff000011ff000012ff000013ff000015ff000017ff000019ff00001cff00001dff00001fff000021ff000024ff000026ff000029ff00002bff00002eff000031ff000034ff000037ff00003aff00003dff000040ff000043ff000047ff00004bff00004eff000052ff000056ff00005aff00005eff000063ff000067ff00006cff000070ff000075ff00007aff00007fff000084ff000089ff00008eff000094ff000099ff00009fff0000a4ff0000aaff0000afff0003b5ff0006bbff0009c1ff000dc7ff0010cdff0014d3ff0018d9ff001cdeff0021e4ff0025e9ff0029efff002ef4ff0033faff0038feff003efeff0043faff0049f7ff004ef3ff0054eeff005aebff0060e6ff0067e1ff006edcff0075d7ff007cd1ff0084cbff008cc5ff0094bfff009cb7ff00a5b0ff00ada8ff00b6a1ff00be99ff00c790ff04cf88ff0cd880ff14e177ff1ce96eff24f165ff2df85cff36ff54ff40fb4bff4af643ff53f13aff5deb32ff68e52aff72df23ff7dd81bff87d214ff91cb0dff9bc507ffa5be01ffaeb800ffb6b200ffbeae00ffc5a800ffcca300ffd29f00ffd89b00ffdd9800ffe39400ffe89000ffec8d00fff08b00fff48800fff68600fff98500fffc82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
m_StreamData:
offset: 0
size: 0
path:
--- !u!4 &735623501 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4892398858798392, guid: 372c59520c69cff4498f2d5d0e7b6c7c,

type: 3}
m_PrefabInstance: {fileID: 914255252}
m_PrefabAsset: {fileID: 0}
--- !u!28 &918767923
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: ffffffffffeffdffffdffbffffd0f9ffffc0f7ffffb0f5ffffa0f3ffff90f1ffff81efffff71eeffff61ecffff51eaffff41e8ffff32e6ffff2ee2fbff2cdef7ff2bdbf2ff29d7eeff28d3e9ff26cfe4ff25cce0ff23c8dbff22c4d7ff20c0d2ff1fbcceff1db9c9ff1cb5c5ff1ab1c0ff19adbcff17a9b7ff16a6b2ff14a2aeff139ea9ff119aa5ff1096a0ff0e939cff0d8f97ff0b8b93ff0a878eff088389ff078085ff057d82ff057b81ff057a81ff057981ff057880ff057680ff05757fff05747fff04737fff04727eff04707eff046f7dff046e7dff046d7dff046b7cff046a7cff03697bff03687bff03667bff03657aff03647aff036379ff036179ff036079ff025f78ff025e78ff025d77ff025b77ff025a77ff025976ff025876ff025675ff025575ff015475ff015374ff015174ff015073ff014f73ff014e73ff014c72ff014b72ff004a71ff004971ff004871ff004670ff00456eff00436bff004169ff004066ff003e63ff003d61ff003b5eff00395cff003859ff003656ff003454ff003351ff00314eff002f4cff002e49ff002c47ff002b44ff002941ff00273fff00263cff00243aff002237ff002134ff001f32ff001d2fff001c2cff001a2aff001927ff001725ff001522ff00141fff00121dff00101aff000f18ff000d15ff000b12ff000a10ff00080dff00070aff000508ff000305ff000203ff000000ff010403ff020807ff020c0aff03110eff041511ff051915ff061d18ff06211bff07251fff082922ff092e26ff0a3229ff0b362dff0b3a30ff0c3e34ff0d4237ff0e463aff0f4b3eff0f4f41ff105345ff115748ff125b4cff135f4fff136352ff146856ff156957ff156957ff156a58ff166a58ff166b58ff166b59ff176c59ff176c5aff176d5aff186d5aff186e5bff186e5bff186f5bff196f5cff196f5cff19705dff1a705dff1a715dff1a715eff1b725eff1b725eff1b735fff1c735fff1c745fff1c7460ff1d7560ff1d7561ff1d7661ff1d7662ff1d7863ff1d7965ff1c7b66ff1c7c68ff1c7e6aff1b7f6bff1b816dff1b826eff1a8470ff1a8572ff198773ff198975ff198a76ff188c78ff188d7aff188f7bff17907dff17927eff179380ff169582ff169683ff169885ff159986ff159b88ff149c8aff149e8bff149f8dff13a18eff13a290ff13a492ff12a593ff12a795ff12a996ff11aa98ff11ac9aff11ad9bff10af9dff10b09eff0fb2a0ff0fb3a2ff0fb5a3ff0eb6a5ff0eb8a6ff0eb9a8ff0dbbaaff0dbcabff0dbeadff0cbfaeff0cc1b0ff0cc2b2ff0bc4b3ff0bc5b5ff0ac7b6ff0ac9b8ff0acab9ff09ccbbff09cdbdff09cfbeff08d0c0ff08d2c1ff08d3c3ff07d5c5ff07d6c6ff07d8c8ff06d9c9ff06dbcbff05dccdff05deceff05dfd0ff04e1d1ff04e2d3ff04e4d5ff03e5d6ff000000ff000001ff000001ff000002ff000003ff000004ff000005ff000006ff000007ff000008ff000009ff00000bff00000cff00000dff00000fff000011ff000012ff000013ff000015ff000017ff000019ff00001cff00001dff00001fff000021ff000024ff000026ff000029ff00002bff00002eff000031ff000034ff000037ff00003aff00003dff000040ff000043ff000047ff00004bff00004eff000052ff000056ff00005aff00005eff000063ff000067ff00006cff000070ff000075ff00007aff00007fff000084ff000089ff00008eff000094ff000099ff00009fff0000a4ff0000aaff0000afff0003b5ff0006bbff0009c1ff000dc7ff0010cdff0014d3ff0018d9ff001cdeff0021e4ff0025e9ff0029efff002ef4ff0033faff0038feff003efeff0043faff0049f7ff004ef3ff0054eeff005aebff0060e6ff0067e1ff006edcff0075d7ff007cd1ff0084cbff008cc5ff0094bfff009cb7ff00a5b0ff00ada8ff00b6a1ff00be99ff00c790ff04cf88ff0cd880ff14e177ff1ce96eff24f165ff2df85cff36ff54ff40fb4bff4af643ff53f13aff5deb32ff68e52aff72df23ff7dd81bff87d214ff91cb0dff9bc507ffa5be01ffaeb800ffb6b200ffbeae00ffc5a800ffcca300ffd29f00ffd89b00ffdd9800ffe39400ffe89000ffec8d00fff08b00fff48800fff68600fff98500fffc82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
m_StreamData:
offset: 0
size: 0
path:
--- !u!1001 &918859443
PrefabInstance:
m_ObjectHideFlags: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1143740434}
m_LocalRotation: {x: -0.0022337162, y: 0.9596541, z: -0.0076257265, w: -0.28107116}
m_LocalRotation: {x: -0.0022320594, y: 0.9597151, z: -0.007626212, w: -0.28086248}
m_LocalPosition: {x: 42, y: 2.51, z: 62.1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1768035350}
m_LocalRotation: {x: 0.0016830743, y: 0.99828374, z: -0.0371164, w: 0.045268018}
m_LocalRotation: {x: 0.0016830746, y: 0.99828374, z: -0.03711638, w: 0.04526805}
m_LocalPosition: {x: -44.940704, y: 6.7491255, z: 30.639654}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

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


m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_GeneratorAsset: {fileID: 0}
m_Script: {fileID: 11500000, guid: b17284ebf5e80436eb6089f8c7459dab, type: 3}
m_Name: WaterSurfaceData
m_EditorClassIdentifier:

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}
key2: {r: 0.124154516, g: 0.5849056, b: 0.4761891, a: 0}
key3: {r: 0, g: 0.4642104, b: 0.49, a: 0}
ctime1: 12914
ctime2: 27525
ctime1: 9808
ctime2: 24097
ctime3: 65535
ctime4: 0
ctime5: 0

- amplitude: 1
direction: -6.03
wavelength: 10
origin: {x: -146.4, y: 326.2}
origin:
x: -146.4
y: 326.2
origin: {x: 0, y: 0}
origin:
x: 0
y: 0
origin: {x: -63.14, y: 931.6}
origin:
x: -63.14
y: 931.6
origin: {x: -72.74, y: -16.01}
origin:
x: -72.74
y: -16.01
origin: {x: -50.43, y: 0}
origin:
x: -50.43
y: 0
origin: {x: 0, y: 0}
origin:
x: 0
y: 0
onmiDir: 0
_customWaves: 0
randomSeed: 891

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


namespace WaterSystem
{
[ExecuteInEditMode]
[ExecuteAlways]
public class Water : MonoBehaviour
{
// Singleton

void Update()
{
if(Application.isPlaying)
{
waterTime = Time.time;
Shader.SetGlobalFloat("_GlobalTime", waterTime);
}
waterTime = Time.time;
Shader.SetGlobalFloat("_GlobalTime", waterTime);
}
private void LateUpdate() {

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


depth.x = depth.x < 0 ? d : depth.x;
// Fresnel
half fresnelTerm = CalculateFresnelTerm(lerp(IN.normal, half3(0, 1, 0), 0.5), IN.viewDir.xyz);
half fresnelTerm = CalculateFresnelTerm(IN.normal, IN.viewDir.xyz);
// Shadows
half shadow = MainLightRealtimeShadow(TransformWorldToShadowCoord(IN.posWS));

float fogFactor = IN.fogFactorNoise.x;
comp = MixFog(comp, fogFactor);
return half4(comp, 1);
//return half4(shadow.xxx, 1); // debug line
//return half4(reflection, 1); // debug line
}
#endif // WATER_COMMON_INCLUDED

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


half CalculateFresnelTerm(half3 normalWS, half3 viewDirectionWS)
{
return Pow4(1.0 - saturate(dot(normalWS, viewDirectionWS)));//fresnel TODO - find a better place
return pow(1.0 - saturate(dot(normalWS, viewDirectionWS)), 5);//fresnel TODO - find a better place
}
///////////////////////////////////////////////////////////////////////////////

8
Assets/Plugins.meta


fileFormatVersion: 2
guid: 35aca3e7c15774b0c901e45418b1513d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存