浏览代码

Merge pull request #10 from Verasl/lw/api-review-v4

Lw/api review v4
/main
GitHub 6 年前
当前提交
d58b7d71
共有 29 个文件被更改,包括 265 次插入679 次删除
  1. 11
      Assets/Data/LightweightAsset.asset
  2. 28
      Assets/Objects/boats/Prefabs/_Boat.prefab
  3. 2
      Assets/Shaders/Blocker.shader
  4. 2
      Assets/Shaders/Graphs/PackedPBR.ShaderGraph
  5. 34
      Assets/Shaders/Graphs/RaceBoats.ShaderGraph
  6. 6
      Assets/Shaders/PackedPBR/InputSurfacePackedDialectric.hlsl
  7. 8
      Assets/Shaders/PackedPBR/LightweightPackedDialectric.shader
  8. 6
      Assets/Shaders/Vegetation/InputSurfaceVegetation.hlsl
  9. 107
      Assets/Shaders/Vegetation/LWVegetationShader.shader
  10. 38
      Assets/Shaders/Vegetation/ShadowPassVegetation.hlsl
  11. 12
      Assets/Shaders/Vegetation/Vegetation.hlsl
  12. 94
      Assets/scenes/Island.unity
  13. 14
      GeneratedShader.shader
  14. 3
      Packages/com.verasl.water-system/Editor/WaterSystem.editor.asmdef
  15. 15
      Packages/com.verasl.water-system/Scripts/BuoyantObject.cs
  16. 16
      Packages/com.verasl.water-system/Scripts/GerstnerWavesJobs.cs
  17. 2
      Packages/com.verasl.water-system/Scripts/Water.cs
  18. 3
      Packages/com.verasl.water-system/Scripts/WaterSystem.Runtime.asmdef
  19. 2
      Packages/com.verasl.water-system/Shaders/InfiniteWater.shader
  20. 16
      Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl
  21. 59
      Packages/com.verasl.water-system/Shaders/WaterFXShader.shader
  22. 2
      Packages/com.verasl.water-system/Shaders/WaterInput.hlsl
  23. 4
      Packages/com.verasl.water-system/Shaders/WaterLighting.hlsl
  24. 3
      Packages/com.verasl.water-system/package.json
  25. 3
      Packages/manifest.json
  26. 17
      ProjectSettings/ProjectSettings.asset
  27. 10
      UberShader.shader
  28. 427
      Assets/Objects/environment/Cliffs/Env_Rocks_tmp.fbx.meta

11
Assets/Data/LightweightAsset.asset


m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
m_Name: LightweightAsset
m_EditorClassIdentifier:
m_DirectionalShadowsSupported: 1
m_PunctualLightsSupport: 2
m_LocalShadowsSupported: 0
m_SoftShadowsSupported: 1
m_MixedLightingSupported: 1
m_SupportsVertexLight: 0
m_RequireDepthTexture: 1
m_RequireSoftParticles: 0
m_RequireOpaqueTexture: 1

m_RenderScale: 1.15
m_SupportsDynamicBatching: 1
m_DirectionalShadowsSupported: 1
m_LocalShadowsSupported: 0
m_SoftShadowsSupported: 1
m_ResourcesAsset: {fileID: 11400000, guid: aac5a08c32552a14c89394b703f1978a, type: 2}
m_SavedXRConfig:
renderScale: 1.15

showDeviceView: 1
gameViewRenderMode: 3
m_ShadowType: 2

28
Assets/Objects/boats/Prefabs/_Boat.prefab


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1025780610191132}
serializedVersion: 5
serializedVersion: 6
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
looping: 1

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1073097268604762}
serializedVersion: 5
serializedVersion: 6
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
looping: 1

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1371637880153344}
serializedVersion: 5
serializedVersion: 6
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
looping: 1

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1489463026464572}
serializedVersion: 5
serializedVersion: 6
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
looping: 1

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1500772317517024}
serializedVersion: 5
serializedVersion: 6
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
looping: 1

m_AngularDrag: 0.1
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 2
m_Interpolate: 1
m_CollisionDetection: 0
m_CollisionDetection: 2
--- !u!64 &64258884862185400
MeshCollider:
m_ObjectHideFlags: 0

lines: []
- origin: {x: 0.17, y: 0, z: 0.84}
lines: []
_wakePrefab: {fileID: 1446377775785148, guid: dd07c82db50e943ca8314f2c407ea841, type: 3}
_wakePrefab: {fileID: 1446377775785148, guid: dd07c82db50e943ca8314f2c407ea841,
type: 3}
_genDistance: 2.5
_maxAge: 5
--- !u!1 &1852268228170652

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1852268228170652}
serializedVersion: 5
serializedVersion: 6
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
looping: 1

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1857863317272600}
serializedVersion: 5
serializedVersion: 6
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
looping: 1

2
Assets/Shaders/Blocker.shader


#pragma vertex vert
#pragma fragment frag
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
float4 vert (float4 vertex : POSITION) : SV_POSITION
{

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

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

6
Assets/Shaders/PackedPBR/InputSurfacePackedDialectric.hlsl


#ifndef LIGHTWEIGHT_INPUT_PACKED_DIALECTRIC_INCLUDED
#define LIGHTWEIGHT_INPUT_PACKED_DIALECTRIC_INCLUDED
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "CoreRP/ShaderLibrary/CommonMaterial.hlsl"
#include "LWRP/ShaderLibrary/InputSurfaceCommon.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"
CBUFFER_START(UnityPerMaterial)
float4 _MainTex_ST;

8
Assets/Shaders/PackedPBR/LightweightPackedDialectric.shader


#pragma fragment LitPassFragment
#include "InputSurfacePackedDialectric.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassLit.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/LightweightPassLit.hlsl"
ENDHLSL
}

#pragma fragment ShadowPassFragment
#include "InputSurfacePackedDialectric.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassShadow.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/LightweightPassShadow.hlsl"
ENDHLSL
}

#pragma multi_compile_instancing
#include "InputSurfacePackedDialectric.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassDepthOnly.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/LightweightPassDepthOnly.hlsl"
ENDHLSL
}

#pragma shader_feature EDITOR_VISUALIZATION
#include "InputSurfacePackedDialectric.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassMetaPBR.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/LightweightPassMetaPBR.hlsl"
ENDHLSL
}

6
Assets/Shaders/Vegetation/InputSurfaceVegetation.hlsl


#ifndef INPUT_SURFACE_VEGETATION_INCLUDED
#define INPUT_SURFACE_VEGETATION_INCLUDED
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "CoreRP/ShaderLibrary/CommonMaterial.hlsl"
#include "LWRP/ShaderLibrary/InputSurfaceCommon.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"
CBUFFER_START(UnityPerMaterial)
float4 _MainTex_ST;

107
Assets/Shaders/Vegetation/LWVegetationShader.shader


// -------------------------------------
// Lightweight Pipeline keywords
#pragma multi_compile _ _ADDITIONAL_LIGHTS
#pragma multi_compile _ _VERTEX_LIGHTS
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
#pragma multi_compile _ _SHADOWS_ENABLED
#pragma multi_compile _ _LOCAL_SHADOWS_ENABLED
#pragma multi_compile _ _DIRECTIONAL_SHADOWS
#pragma multi_compile _ _DIRECTIONAL_SHADOWS_CASCADE
#pragma multi_compile _ _PUNCTUAL_LIGHTS_VERTEX _PUNCTUAL_LIGHTS
#pragma multi_compile _ _PUNCTUAL_LIGHT_SHADOWS
#pragma multi_compile _ _SHADOWS_CASCADE
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
// -------------------------------------
// Unity defined keywords

// It also includes matrix/space conversion functions and fog.
// Lighting.hlsl will include the light functions/data to abstract light constants. You should use GetMainLight and GetLight functions
// that initialize Light struct. Lighting.hlsl also include GI, Light BDRF functions. It also includes Shadows.
//#include "LWRP/ShaderLibrary/Core.hlsl"
//#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
// Not required but included here for simplicity. This defines all material related constants for the Standard surface shader like _Color, _MainTex, and so on.
// These are specific to this shader. You should define your own constants.
#include "InputSurfaceVegetation.hlsl"

#endif
inputData.viewDirectionWS = FragmentViewDirWS(viewDir);
#ifdef _SHADOWS_ENABLED
#if defined(_DIRECTIONAL_SHADOWS)
inputData.shadowCoord = IN.shadowCoord;
#else
inputData.shadowCoord = float4(0, 0, 0, 0);

}
//vert
VegetationVertexOutput VegetationVertex(VegetationVertexInput v)
VegetationVertexOutput VegetationVertex(VegetationVertexInput input)
VegetationVertexOutput o = (VegetationVertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
VegetationVertexOutput output = (VegetationVertexOutput)0;
o.uv.xy = v.texcoord;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float3 posWS = TransformObjectToWorld(v.position.xyz);
o.clipPos = TransformWorldToHClip(posWS);
output.uv.xy = input.texcoord;
v.position.xyz = VegetationDeformation(v.position.xyz, objectOrigin, v.normal, v.color.x, v.color.z, v.color.y);
input.positionOS = VegetationDeformation(input.positionOS, objectOrigin, input.normalOS, input.color.x, input.color.z, input.color.y);
posWS = TransformObjectToWorld(v.position.xyz);
o.clipPos = TransformWorldToHClip(posWS);
half3 viewDir = VertexViewDirWS(GetCameraPositionWS() - posWS);
VertexPosition vertexPosition = GetVertexPosition(input.positionOS);
VertexTBN vertexTBN = GetVertexTBN(input.normalOS, input.tangentOS);
half3 vertexLight = VertexLighting(vertexPosition.worldSpace, output.normal.xyz);
half fogFactor = ComputeFogFactor(vertexPosition.hclipSpace.z);
half3 viewDir = VertexViewDirWS(GetCameraPositionWS() - vertexPosition.worldSpace);
output.clipPos = vertexPosition.hclipSpace;
#ifdef _NORMALMAP
o.normal.w = viewDir.x;
o.tangent.w = viewDir.y;
o.binormal.w = viewDir.z;
#else
o.viewDir = viewDir;
#endif
// initializes o.normal and if _NORMALMAP also o.tangent and o.binormal
OUTPUT_NORMAL(v, o);
#ifdef _NORMALMAP
output.normal = half4(vertexTBN.normalWS, viewDir.x);
output.tangent = half4(vertexTBN.tangentWS, viewDir.y);
output.binormal = half4(vertexTBN.binormalWS, viewDir.z);
#else
output.normal = vertexTBN.normalWS;
output.viewDir = viewDir;
#endif
OUTPUT_LIGHTMAP_UV(v.lightmapUV, unity_LightmapST, o.lightmapUV);
OUTPUT_SH(o.normal.xyz, o.vertexSH);
OUTPUT_LIGHTMAP_UV(input.lightmapUV, unity_LightmapST, output.lightmapUV);
OUTPUT_SH(output.normal.xyz, output.vertexSH);
output.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
half3 vertexLight = VertexLighting(o.posWS, o.normal.xyz);
#if defined(FOG_EXP)
half fogFactor = ComputeGlobalFogFactor(posWS);
#else
half fogFactor = ComputeFogFactor(o.clipPos.z);
#if defined(_DIRECTIONAL_SHADOWS) && !defined(_RECEIVE_SHADOWS_OFF)
output.shadowCoord = GetShadowCoord(vertexPosition);
o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
#ifdef _SHADOWS_ENABLED
#if SHADOWS_SCREEN
o.shadowCoord = ComputeShadowCoord(o.clipPos);
#else
o.shadowCoord = TransformWorldToShadowCoord(posWS);
#endif
#endif
output.occlusion = input.color.a;
o.occlusion = v.color.a;
return o;
return output;
}
//frag

// -------------------------------------
// Material Keywords
#define _ALPHATEST_ON 1
#pragma shader_feature _VERTEXANIMATION
//--------------------------------------
// GPU Instancing

#pragma fragment ShadowPassVegetationFragment
#include "Vegetation.hlsl"
#include "InputSurfaceVegetation.hlsl"
#include "ShadowPassVegetation.hlsl"

#pragma multi_compile _ LOD_FADE_CROSSFADE
#include "InputSurfaceVegetation.hlsl"
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
VegetationVertexOutput DepthOnlyVertex(VegetationVertexInput v)
VegetationVertexOutput DepthOnlyVertex(VegetationVertexInput input)
VegetationVertexOutput o = (VegetationVertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
VegetationVertexOutput output = (VegetationVertexOutput)0;
UNITY_SETUP_INSTANCE_ID(input);
#if _VERTEXANIMATION
/////////////////////////////////////vegetation stuff//////////////////////////////////////////////////

v.position.xyz = VegetationDeformation(v.position.xyz, objectOrigin, v.normal, v.color.x, v.color.z, v.color.y);
input.positionOS = VegetationDeformation(input.positionOS, objectOrigin, input.normalOS, input.color.x, input.color.z, input.color.y);
VertexPosition vertexPosition = GetVertexPosition(input.positionOS);
o.uv.xy = v.texcoord;
o.clipPos = TransformObjectToHClip(v.position.xyz);
return o;
output.uv.xy = input.texcoord;
output.clipPos = vertexPosition.hclipSpace;
return output;
}
half4 DepthOnlyFragment(VegetationVertexOutput IN) : SV_TARGET

#pragma shader_feature _SPECGLOSSMAP
#include "InputSurfaceVegetation.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassMetaPBR.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/LightweightPassMetaPBR.hlsl"
ENDHLSL
}

38
Assets/Shaders/Vegetation/ShadowPassVegetation.hlsl


#ifndef SHADOW_PASS_VEGETATION_INCLUDED
#define SHADOW_PASS_VEGETATION_INCLUDED
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
// x: global clip space bias, y: normal world space bias
float4 _ShadowBias;

{
float4 position : POSITION;
float3 normal : NORMAL;
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
half3 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};

float4 clipPos : SV_POSITION;
};
float4 GetShadowPositionHClip(VertexInput v)
float4 GetShadowPositionHClip(VertexInput input)
float3 positionWS = TransformObjectToWorld(v.position.xyz);
float3 normalWS = TransformObjectToWorldDir(v.normal);
VertexPosition vertexPosition = GetVertexPosition(input.positionOS);
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);
positionWS = normalWS * scale.xxx + positionWS;
float3 positionWS = normalWS * scale.xxx + vertexPosition.worldSpace;
float4 clipPos = TransformWorldToHClip(positionWS);
// _ShadowBias.x sign depens on if platform has reversed z buffer

return clipPos;
}
VertexOutput ShadowPassVegetationVertex(VertexInput v)
VertexOutput ShadowPassVegetationVertex(VertexInput input)
VertexOutput o;
UNITY_SETUP_INSTANCE_ID(v);
o.uv = v.texcoord;
o.clipPos = GetShadowPositionHClip(v);
return o;
VertexOutput output;
UNITY_SETUP_INSTANCE_ID(input);
#if _VERTEXANIMATION
/////////////////////////////////////vegetation stuff//////////////////////////////////////////////////
float3 objectOrigin = UNITY_ACCESS_INSTANCED_PROP(Props, _Position).xyz;
input.positionOS.xyz = VegetationDeformation(input.positionOS, objectOrigin, input.normalOS, input.color.x, input.color.z, input.color.y);
//////////////////////////////////////////////////////////////////////////////////////////////////////
#endif
output.uv = input.texcoord;
output.clipPos = GetShadowPositionHClip(input);
return output;
}
half4 ShadowPassVegetationFragment(VertexOutput IN) : SV_TARGET

12
Assets/Shaders/Vegetation/Vegetation.hlsl


#include "LWRP/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Lighting.hlsl"
float4 position : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
float4 color : COLOR;
half4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};

half4 fogFactorAndVertexLight : TEXCOORD6; // x: fogFactor, yzw: vertex light
#ifdef _SHADOWS_ENABLED
#ifdef _DIRECTIONAL_SHADOWS
float4 shadowCoord : TEXCOORD7;
#endif

94
Assets/scenes/Island.unity


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 153441711}
m_LocalRotation: {x: 0.027335119, y: -0.9252545, z: 0.17501126, w: 0.33545187}
m_LocalRotation: {x: 0.027335458, y: -0.9252539, z: 0.17501108, w: 0.33545363}
m_LocalPosition: {x: -30.551498, y: 3.6019359, z: -57.88359}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

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

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

m_Name:
m_EditorClassIdentifier:
computeOverride: 1
_rampTexture: {fileID: 1043443325}
_rampTexture: {fileID: 1757511939}
_waves:
- amplitude: 0.30540264
direction: -166.8483

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1017609894}
m_LocalRotation: {x: 0.027335119, y: -0.9252545, z: 0.17501126, w: 0.33545187}
m_LocalRotation: {x: 0.027335458, y: -0.9252539, z: 0.17501108, w: 0.33545363}
m_LocalPosition: {x: -30.551498, y: 3.6019359, z: -57.88359}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1037858265}
m_CullTransparentMesh: 0
--- !u!28 &1043443325
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: ffcfffffffb6fafaff9cf5f5ff83f0f0ff69ebebff50e6e6ff36e1e1ff22ddddff21dadaff21d7d7ff20d4d5ff1fd1d2ff1ececfff1dcccdff1cc9caff1bc6c7ff1bc3c4ff1ac0c2ff19bdbfff18bbbcff17b8baff16b5b7ff15b2b4ff15afb2ff14acafff13aaacff12a7a9ff11a4a7ff10a1a4ff0f9ea1ff0f9b9fff0e999cff0d9699ff0c9397ff0b9094ff0a8d91ff098a8eff09878cff088589ff078286ff067f84ff057d82ff057b81ff057a81ff057981ff057880ff057680ff05757fff05747fff04737fff04727eff04707eff046f7dff046e7dff046d7dff046b7cff046a7cff03697bff03687bff03667bff03657aff03647aff036379ff036179ff036079ff025f78ff025e78ff025d77ff025b77ff025a77ff025976ff025876ff025675ff025575ff015475ff015374ff015174ff015073ff014f73ff014e73ff014c72ff014b72ff004a71ff004971ff004871ff004670ff00456eff00436bff004169ff004066ff003e63ff003d61ff003b5eff00395cff003859ff003656ff003454ff003351ff00314eff002f4cff002e49ff002c47ff002b44ff002941ff00273fff00263cff00243aff002237ff002134ff001f32ff001d2fff001c2cff001a2aff001927ff001725ff001522ff00141fff00121dff00101aff000f18ff000d15ff000b12ff000a10ff00080dff00070aff000508ff000305ff000203ff000000ff010505ff020b09ff03100eff041612ff051b17ff06211bff072620ff092c24ff0a3129ff0b362dff0c3c32ff0d4136ff0e473bff0f4c3fff105244ff115748ff125d4dff136251ff146756ff156957ff156957ff156a58ff156a58ff166a58ff166b58ff166b59ff166c59ff176c59ff176c5aff176d5aff176d5aff186d5bff186e5bff186e5bff196f5cff196f5cff196f5cff19705cff1a705dff1a715dff1a715dff1a715eff1b725eff1b725eff1b725fff1b735fff1c735fff1c745fff1c7460ff1c7460ff1d7560ff1d7561ff1d7661ff1d7662ff1d7863ff1d7965ff1c7b66ff1c7c68ff1c7e6aff1b7f6bff1b816dff1b826eff1a8470ff1a8572ff198773ff198975ff198a76ff188c78ff188d7aff188f7bff17907dff17927eff179380ff169582ff169683ff169885ff159986ff159b88ff149c8aff149e8bff149f8dff13a18eff13a290ff13a492ff12a593ff12a795ff12a996ff11aa98ff11ac9aff11ad9bff10af9dff10b09eff0fb2a0ff0fb3a2ff0fb5a3ff0eb6a5ff0eb8a6ff0eb9a8ff0dbbaaff0dbcabff0dbeadff0cbfaeff0cc1b0ff0cc2b2ff0bc4b3ff0bc5b5ff0ac7b6ff0ac9b8ff0acab9ff09ccbbff09cdbdff09cfbeff08d0c0ff08d2c1ff08d3c3ff07d5c5ff07d6c6ff07d8c8ff06d9c9ff06dbcbff05dccdff05deceff05dfd0ff04e1d1ff04e2d3ff04e4d5ff03e5d6ff000000ff000001ff000001ff000002ff000003ff000004ff000005ff000006ff000007ff000008ff000009ff00000bff00000cff00000dff00000fff000011ff000012ff000013ff000015ff000017ff000019ff00001cff00001dff00001fff000021ff000024ff000026ff000029ff00002bff00002eff000031ff000034ff000037ff00003aff00003dff000040ff000043ff000047ff00004bff00004eff000052ff000056ff00005aff00005eff000063ff000067ff00006cff000070ff000075ff00007aff00007fff000084ff000089ff00008eff000094ff000099ff00009fff0000a4ff0000aaff0000afff0003b5ff0006bbff0009c1ff000dc7ff0010cdff0014d3ff0018d9ff001cdeff0021e4ff0025e9ff0029efff002ef4ff0033faff0038feff003efeff0043faff0049f7ff004ef3ff0054eeff005aebff0060e6ff0067e1ff006edcff0075d7ff007cd1ff0084cbff008cc5ff0094bfff009cb7ff00a5b0ff00ada8ff00b6a1ff00be99ff00c790ff04cf88ff0cd880ff14e177ff1ce96eff24f165ff2df85cff36ff54ff40fb4bff4af643ff53f13aff5deb32ff68e52aff72df23ff7dd81bff87d214ff91cb0dff9bc507ffa5be01ffaeb800ffb6b200ffbeae00ffc5a800ffcca300ffd29f00ffd89b00ffdd9800ffe39400ffe89000ffec8d00fff08b00fff48800fff68600fff98500fffc82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
m_StreamData:
offset: 0
size: 0
path:
--- !u!1001 &1046596217
PrefabInstance:
m_ObjectHideFlags: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1143740434}
m_LocalRotation: {x: -0.0019885907, y: 0.95968765, z: -0.0067912596, w: -0.28097975}
m_LocalRotation: {x: -0.0019885874, y: 0.9596878, z: -0.0067912606, w: -0.28097922}
m_LocalPosition: {x: 42, y: 2.51, z: 62.1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 372c59520c69cff4498f2d5d0e7b6c7c, type: 3}
--- !u!28 &1757511939
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: ffcfffffffb6fafaff9cf5f5ff83f0f0ff69ebebff50e6e6ff36e1e1ff22ddddff21dadaff21d7d7ff20d4d5ff1fd1d2ff1ececfff1dcccdff1cc9caff1bc6c7ff1bc3c4ff1ac0c2ff19bdbfff18bbbcff17b8baff16b5b7ff15b2b4ff15afb2ff14acafff13aaacff12a7a9ff11a4a7ff10a1a4ff0f9ea1ff0f9b9fff0e999cff0d9699ff0c9397ff0b9094ff0a8d91ff098a8eff09878cff088589ff078286ff067f84ff057d82ff057b81ff057a81ff057981ff057880ff057680ff05757fff05747fff04737fff04727eff04707eff046f7dff046e7dff046d7dff046b7cff046a7cff03697bff03687bff03667bff03657aff03647aff036379ff036179ff036079ff025f78ff025e78ff025d77ff025b77ff025a77ff025976ff025876ff025675ff025575ff015475ff015374ff015174ff015073ff014f73ff014e73ff014c72ff014b72ff004a71ff004971ff004871ff004670ff00456eff00436bff004169ff004066ff003e63ff003d61ff003b5eff00395cff003859ff003656ff003454ff003351ff00314eff002f4cff002e49ff002c47ff002b44ff002941ff00273fff00263cff00243aff002237ff002134ff001f32ff001d2fff001c2cff001a2aff001927ff001725ff001522ff00141fff00121dff00101aff000f18ff000d15ff000b12ff000a10ff00080dff00070aff000508ff000305ff000203ff000000ff010505ff020b09ff03100eff041612ff051b17ff06211bff072620ff092c24ff0a3129ff0b362dff0c3c32ff0d4136ff0e473bff0f4c3fff105244ff115748ff125d4dff136251ff146756ff156957ff156957ff156a58ff156a58ff166a58ff166b58ff166b59ff166c59ff176c59ff176c5aff176d5aff176d5aff186d5bff186e5bff186e5bff196f5cff196f5cff196f5cff19705cff1a705dff1a715dff1a715dff1a715eff1b725eff1b725eff1b725fff1b735fff1c735fff1c745fff1c7460ff1c7460ff1d7560ff1d7561ff1d7661ff1d7662ff1d7863ff1d7965ff1c7b66ff1c7c68ff1c7e6aff1b7f6bff1b816dff1b826eff1a8470ff1a8572ff198773ff198975ff198a76ff188c78ff188d7aff188f7bff17907dff17927eff179380ff169582ff169683ff169885ff159986ff159b88ff149c8aff149e8bff149f8dff13a18eff13a290ff13a492ff12a593ff12a795ff12a996ff11aa98ff11ac9aff11ad9bff10af9dff10b09eff0fb2a0ff0fb3a2ff0fb5a3ff0eb6a5ff0eb8a6ff0eb9a8ff0dbbaaff0dbcabff0dbeadff0cbfaeff0cc1b0ff0cc2b2ff0bc4b3ff0bc5b5ff0ac7b6ff0ac9b8ff0acab9ff09ccbbff09cdbdff09cfbeff08d0c0ff08d2c1ff08d3c3ff07d5c5ff07d6c6ff07d8c8ff06d9c9ff06dbcbff05dccdff05deceff05dfd0ff04e1d1ff04e2d3ff04e4d5ff03e5d6ff000000ff000001ff000001ff000002ff000003ff000004ff000005ff000006ff000007ff000008ff000009ff00000bff00000cff00000dff00000fff000011ff000012ff000013ff000015ff000017ff000019ff00001cff00001dff00001fff000021ff000024ff000026ff000029ff00002bff00002eff000031ff000034ff000037ff00003aff00003dff000040ff000043ff000047ff00004bff00004eff000052ff000056ff00005aff00005eff000063ff000067ff00006cff000070ff000075ff00007aff00007fff000084ff000089ff00008eff000094ff000099ff00009fff0000a4ff0000aaff0000afff0003b5ff0006bbff0009c1ff000dc7ff0010cdff0014d3ff0018d9ff001cdeff0021e4ff0025e9ff0029efff002ef4ff0033faff0038feff003efeff0043faff0049f7ff004ef3ff0054eeff005aebff0060e6ff0067e1ff006edcff0075d7ff007cd1ff0084cbff008cc5ff0094bfff009cb7ff00a5b0ff00ada8ff00b6a1ff00be99ff00c790ff04cf88ff0cd880ff14e177ff1ce96eff24f165ff2df85cff36ff54ff40fb4bff4af643ff53f13aff5deb32ff68e52aff72df23ff7dd81bff87d214ff91cb0dff9bc507ffa5be01ffaeb800ffb6b200ffbeae00ffc5a800ffcca300ffd29f00ffd89b00ffdd9800ffe39400ffe89000ffec8d00fff08b00fff48800fff68600fff98500fffc82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
m_StreamData:
offset: 0
size: 0
path:
--- !u!1001 &1757670560
PrefabInstance:
m_ObjectHideFlags: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1768035350}
m_LocalRotation: {x: 0.0016203898, y: 0.998335, z: -0.035774864, w: 0.04521867}
m_LocalRotation: {x: 0.0016203917, y: 0.998335, z: -0.035774883, w: 0.045218702}
m_LocalPosition: {x: -44.930405, y: 6.7507715, z: 30.635294}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

14
GeneratedShader.shader


#define _NORMALMAP 1
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "LWRP/ShaderLibrary/Lighting.hlsl"
#include "CoreRP/ShaderLibrary/Color.hlsl"
#include "CoreRP/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "ShaderGraphLibrary/Functions.hlsl"
TEXTURE2D(Texture_CA4EFDF0); SAMPLER(samplerTexture_CA4EFDF0);

#pragma vertex ShadowPassVertex
#pragma fragment ShadowPassFragment
#include "LWRP/ShaderLibrary/LightweightPassShadow.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/LightweightPassShadow.hlsl"
ENDHLSL
}

#pragma vertex vert
#pragma fragment frag
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
float4 vert(float4 pos : POSITION) : SV_POSITION
{

#pragma shader_feature _SPECGLOSSMAP
#include "LWRP/ShaderLibrary/LightweightPassMeta.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/LightweightPassMeta.hlsl"
ENDHLSL
}
}

3
Packages/com.verasl.water-system/Editor/WaterSystem.editor.asmdef


{
"name": "WaterSystem.Editor",
"references": [
"WaterSystem"
"WaterSystem",
"Unity.Burst.Editor"
],
"optionalUnityReferences": [],
"includePlatforms": [

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


void Update()
{
}
private void FixedUpdate()
{
//// previously from update ////
for(var i = 0; i < samplePoints.Length; i++)
{
samplePoints[i] = transform.TransformPoint(voxels[i]);

// do the voxel non-physical
}
}
}
private void FixedUpdate()
{
///////////////////////////////
float submergedAmount = 0f;
if(_buoyancyType == BuoyancyType.PhysicalVoxel)

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


using System.Collections.Generic;
using Unity.Collections;
using Unity.Jobs;
using Unity.Burst;
using Unity.Mathematics;
using WaterSystem.Data;

}
// Gerstner Height C# Job
[BurstCompile]
public struct HeightJob : IJobParallelFor
{
[ReadOnly]

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);
float w = 6.28318f / wavelength; // 2pi over wavelength(hardcoded)
float wSpeed = math.sqrt(9.8f * w); // frequency of the wave based off wavelength
float peak = 0.8f; // peak value, 1 is the sharpest peaks
float qi = peak / (amplitude * w * waveData.Length);
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;
float2 windDirInput = new float2(math.sin(direction), math.cos(direction)) * (1 - waveData[wave].onmiDir); // calculate wind direction - TODO - currently radians
float2 windOmniInput = (pos - omniPos) * waveData[wave].onmiDir;
windDir += windDirInput;
windDir += windOmniInput;

if (normal == 1)
{
////////////////////////////normal output calculations/////////////////////////
half wa = w * amplitude;
float wa = w * amplitude;
// normal vector
float3 norm = new float3(-(windDir.xy * wa * cosCalc),
1 - (qi * wa * sinCalc));

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


}
}
private void LateUpdate() {
private void FixedUpdate() {
if(Application.isPlaying)
GerstnerWavesJobs.UpdateHeights();
}

3
Packages/com.verasl.water-system/Scripts/WaterSystem.Runtime.asmdef


"references": [
"Unity.Mathematics",
"Unity.RenderPipelines.Lightweight.Runtime",
"Unity.RenderPipelines.Core.Runtime"
"Unity.RenderPipelines.Core.Runtime",
"Unity.Burst"
],
"optionalUnityReferences": [],
"includePlatforms": [],

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


// make fog work
#pragma multi_compile_fog
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "WaterInput.hlsl"
#include "CommonUtilities.hlsl"
#include "WaterLighting.hlsl"

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


#define WATER_COMMON_INCLUDED
#define _SHADOWS_SOFT
#define _SHADOWS_ENABLED
#define _DIRECTIONAL_SHADOWS
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "WaterInput.hlsl"
#include "CommonUtilities.hlsl"
#include "GerstnerWaves.hlsl"

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, z = normalized wave height
half4 vertColor : TEXCOORD7;
float4 additionalData : TEXCOORD6; // x = distance to surface, y = distance to surface, z = normalized wave height
float4 vertColor : TEXCOORD7;
half4 shadowCoord : TEXCOORD8; // for ssshadows
float4 clipPos : SV_POSITION;

half fresnelTerm = CalculateFresnelTerm(lerp(IN.normal, half3(0, 1, 0), 0.5), IN.viewDir.xyz);
// Shadows
half shadow = MainLightRealtimeShadowAttenuation(TransformWorldToShadowCoord(IN.posWS));
half shadow = MainLightRealtimeShadow(TransformWorldToShadowCoord(IN.posWS));
half3 ambient = SampleSHPixel(IN.lightmapUVOrVertexSH, IN.normal) * (mainLight.color * mainLight.attenuation) * 0.5;
half3 ambient = SampleSHPixel(IN.lightmapUVOrVertexSH, IN.normal) * (mainLight.color * mainLight.distanceAttenuation) * 0.5;
// Reflections
half3 reflection = SampleReflections(IN.normal, IN.viewDir.xyz, screenUV.xy, fresnelTerm, 0.0);

half depthMulti = 1 / _MaxDepth;
half3 color = (refraction + caustics) * (1 - foam);
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 += Scattering(depth.x * depthMulti) * ambient * (shadow * 0.5 + 0.5) * saturate(1-length(reflection));// TODO - scattering from main light(maybe additional lights too depending on cost)
color *= 1 - foam;
// Foam lighting

float fogFactor = IN.fogFactorAndVertexLight.x;
ApplyFog(comp, fogFactor);
return half4(comp, 1);
//return half4(waterFX.r, 0, 0, 1); // debug line
//return half4(shadow.r, 0, 0, 1); // debug line
}
#endif // WATER_COMMON_INCLUDED

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


Name "WaterFX"
Tags{"LightMode" = "WaterFX"}
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma vertex WaterFXVertex
#pragma fragment WaterFXFragment
#define _NORMALMAP 1
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
struct appdata
struct Attributes
float4 vertex : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
struct v2f
struct Varyings
{
float2 uv : TEXCOORD0;
half4 normal : TEXCOORD1; // xyz: normal, w: viewDir.x

sampler2D _MainTex;
v2f vert (appdata v)
Varyings WaterFXVertex (Attributes input)
v2f o;
half3 posWS = TransformObjectToWorld(v.vertex.xyz);
o.vertex = TransformWorldToHClip(posWS);
o.uv = v.uv;
Varyings output = (Varyings)0;
VertexPosition vertexPosition = GetVertexPosition(input.positionOS.xyz);
VertexTBN vertexTBN = GetVertexTBN(input.normalOS, input.tangentOS);
output.vertex = vertexPosition.hclipSpace;
output.uv = input.uv;
o.color = v.color;
output.color = input.color;
half3 viewDir = VertexViewDirWS(GetCameraPositionWS() - posWS);
o.normal.w = viewDir.x;
o.tangent.w = viewDir.y;
o.binormal.w = viewDir.z;
half3 viewDir = VertexViewDirWS(GetCameraPositionWS() - vertexPosition.worldSpace);
OUTPUT_NORMAL(v, o);
output.normal = half4(vertexTBN.normalWS, viewDir.x);
output.tangent = half4(vertexTBN.tangentWS, viewDir.y);
output.binormal = half4(vertexTBN.binormalWS, viewDir.z);
return o;
return output;
half4 frag (v2f i) : SV_Target
half4 WaterFXFragment (Varyings input) : SV_Target
half4 col = tex2D(_MainTex, i.uv);
half4 col = tex2D(_MainTex, input.uv);
half foamMask = col.r * i.color.r;
half foamMask = col.r * input.color.r;
disp *= i.color.a;
disp *= input.color.a;
half3 viewDir = half3(i.normal.w, i.tangent.w, i.binormal.w);
half3 normalWS = TangentToWorldNormal(tNorm, i.tangent.xyz, i.binormal.xyz, i.normal.xyz);
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);
normalWS = lerp(half3(0, 1, 0), normalWS, i.color.g);
normalWS = lerp(half3(0, 1, 0), normalWS, input.color.g);
half4 comp = half4(foamMask, normalWS.xz, disp);
#ifdef _INVERT_ON

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


#ifndef WATER_INPUT_INCLUDED
#define WATER_INPUT_INCLUDED
#include "LWRP/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
CBUFFER_START(MaterialProperties)
half _BumpScale;

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


#ifndef WATER_LIGHTING_INCLUDED
#define WATER_LIGHTING_INCLUDED
#include "LWRP/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Lighting.hlsl"
half CalculateFresnelTerm(half3 normalWS, half3 viewDirectionWS)
{

specularTerm = specularTerm - HALF_MIN;
specularTerm = clamp(specularTerm, 0.0, 5.0); // Prevent FP16 overflow on mobiles
#endif
return specularTerm * mainLight.color * mainLight.attenuation;
return specularTerm * mainLight.color * mainLight.distanceAttenuation;
}
///////////////////////////////////////////////////////////////////////////////

3
Packages/com.verasl.water-system/package.json


{
"name": "com.verasl.water-system",
"description": "A water system for LWRP.",
"version": "1.0.0-preview",
"version": "1.0.1-preview",
"com.unity.burst": "0.2.4-preview.30",
"com.unity.render-pipelines.lightweight": "3.3.0-preview",
"com.unity.render-pipelines.core": "3.3.0-preview"
}

3
Packages/manifest.json


"dependencies": {
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.0.9",
"com.unity.burst": "0.2.4-preview.30",
"com.unity.mathematics": "0.0.12-preview.11",
"com.unity.mathematics": "0.0.12-preview.17",
"com.unity.package-manager-ui": "2.0.0-preview.7",
"com.unity.purchasing": "2.0.1",
"com.unity.render-pipelines.core": "file:../../../../SRP/ScriptableRenderPipeline/Assets/com.unity.render-pipelines.core",

17
ProjectSettings/ProjectSettings.asset


width: 1
height: 1
m_SplashScreenLogos:
- logo: {fileID: 10404, guid: 0000000000000000e000000000000000, type: 0}
- logo: {fileID: 0}
duration: 2
m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0}

StripUnusedMeshComponents: 0
VertexChannelCompressionMask: 4054
iPhoneSdkVersion: 988
iOSTargetOSVersionString: 8.0
iOSTargetOSVersionString: 9.0
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 9.0

27: UNITY_POST_PROCESSING_STACK_V2
28: UNITY_POST_PROCESSING_STACK_V2
platformArchitecture: {}
scriptingBackend: {}
scriptingBackend:
Standalone: 1
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}

apiCompatibilityLevelPerPlatform: {}
gcMaxTimeSlice: 0
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform:
Standalone: 3
iOS: 3
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: BoatAttack

metroDefaultTileSize: 1
metroTileForegroundText: 2
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628,
a: 1}
metroSplashScreenUseBackgroundColor: 0
platformCapabilities: {}
metroTargetDeviceFamilies: {}

luminVersion:
m_VersionCode: 1
m_VersionName:
luminPrivilege: []
facebookSdkVersion: 7.9.4
facebookAppId:
facebookCookies: 1

10
UberShader.shader


}
HLSLINCLUDE
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "CoreRP/ShaderLibrary/Common.hlsl"
#include "CoreRP/ShaderLibrary/Packing.hlsl"
#include "CoreRP/ShaderLibrary/Color.hlsl"
#include "CoreRP/ShaderLibrary/UnityInstancing.hlsl"
#include "CoreRP/ShaderLibrary/EntityLighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl"
#include "ShaderGraphLibrary/ShaderVariables.hlsl"
#include "ShaderGraphLibrary/ShaderVariablesFunctions.hlsl"
#include "ShaderGraphLibrary/Functions.hlsl"

427
Assets/Objects/environment/Cliffs/Env_Rocks_tmp.fbx.meta


fileFormatVersion: 2
guid: db51d03bff0384ed0911c6ad5677322f
ModelImporter:
serializedVersion: 23
fileIDToRecycleName:
100000: Cliff_Full_01_LOD0
100002: Cliff_Full_01_LOD1
100004: Cliff_Full_01_LOD2
100006: Cliff_Full_02_LOD0
100008: Cliff_Full_02_LOD1
100010: Cliff_Full_02_LOD2
100012: Cliff_Full_03_LOD0
100014: Cliff_Full_03_LOD1
100016: Cliff_Full_03_LOD2
100018: Cliff_Wall_01_LOD0
100020: Cliff_Wall_01_LOD1
100022: Cliff_Wall_01_LOD2
100024: Cliff_Wall_02_LOD0
100026: Cliff_Wall_02_LOD1
100028: Cliff_Wall_02_LOD2
100030: Cliff_Wall_03_LOD0
100032: Cliff_Wall_03_LOD1
100034: Cliff_Wall_03_LOD2
100036: Cliffs
100038: //RootNode
100040: Hero_Cave_LOD0
100042: Hero_Cave_LOD1
100044: Hero_Cave_LOD2
100046: Hero_CaveEntrance_LOD0
100048: Hero_CaveEntrance_LOD1
100050: Hero_CaveEntrance_LOD2
100052: Hero_CaveExit_LOD0
100054: Hero_CaveExit_LOD1
100056: Hero_CaveExit_LOD2
100058: Hero_Mountain_LOD0
100060: Hero_Mountain_LOD1
100062: Hero_Mountain_LOD2
100064: Hero_Tower_LOD0
100066: Hero_Tower_LOD1
100068: Hero_Tower_LOD2
100070: HeroCave
100072: HeroLarge
100074: Rock_Large_01_LOD0
100076: Rock_Large_01_LOD1
100078: Rock_Large_01_LOD2
100080: Rock_Large_02_LOD0
100082: Rock_Large_02_LOD1
100084: Rock_Large_02_LOD2
100086: Rock_Medium_01_LOD0
100088: Rock_Medium_01_LOD1
100090: Rock_Medium_01_LOD2
100092: Rock_Medium_02_LOD0
100094: Rock_Medium_02_LOD1
100096: Rock_Medium_02_LOD2
100098: Rock_Medium_03_LOD0
100100: Rock_Medium_03_LOD1
100102: Rock_Medium_03_LOD2
100104: Rock_Medium_04_LOD0
100106: Rock_Medium_04_LOD1
100108: Rock_Medium_04_LOD2
100110: Rock_Small_01_LOD0
100112: Rock_Small_01_LOD1
100114: Rock_Small_01_LOD2
100116: Rock_Small_02_LOD0
100118: Rock_Small_02_LOD1
100120: Rock_Small_02_LOD2
100122: Rock_Small_03_LOD0
100124: Rock_Small_03_LOD1
100126: Rock_Small_03_LOD2
100128: Rock_Small_04_LOD0
100130: Rock_Small_04_LOD1
100132: Rock_Small_04_LOD2
100134: Rocks
400000: Cliff_Full_01_LOD0
400002: Cliff_Full_01_LOD1
400004: Cliff_Full_01_LOD2
400006: Cliff_Full_02_LOD0
400008: Cliff_Full_02_LOD1
400010: Cliff_Full_02_LOD2
400012: Cliff_Full_03_LOD0
400014: Cliff_Full_03_LOD1
400016: Cliff_Full_03_LOD2
400018: Cliff_Wall_01_LOD0
400020: Cliff_Wall_01_LOD1
400022: Cliff_Wall_01_LOD2
400024: Cliff_Wall_02_LOD0
400026: Cliff_Wall_02_LOD1
400028: Cliff_Wall_02_LOD2
400030: Cliff_Wall_03_LOD0
400032: Cliff_Wall_03_LOD1
400034: Cliff_Wall_03_LOD2
400036: Cliffs
400038: //RootNode
400040: Hero_Cave_LOD0
400042: Hero_Cave_LOD1
400044: Hero_Cave_LOD2
400046: Hero_CaveEntrance_LOD0
400048: Hero_CaveEntrance_LOD1
400050: Hero_CaveEntrance_LOD2
400052: Hero_CaveExit_LOD0
400054: Hero_CaveExit_LOD1
400056: Hero_CaveExit_LOD2
400058: Hero_Mountain_LOD0
400060: Hero_Mountain_LOD1
400062: Hero_Mountain_LOD2
400064: Hero_Tower_LOD0
400066: Hero_Tower_LOD1
400068: Hero_Tower_LOD2
400070: HeroCave
400072: HeroLarge
400074: Rock_Large_01_LOD0
400076: Rock_Large_01_LOD1
400078: Rock_Large_01_LOD2
400080: Rock_Large_02_LOD0
400082: Rock_Large_02_LOD1
400084: Rock_Large_02_LOD2
400086: Rock_Medium_01_LOD0
400088: Rock_Medium_01_LOD1
400090: Rock_Medium_01_LOD2
400092: Rock_Medium_02_LOD0
400094: Rock_Medium_02_LOD1
400096: Rock_Medium_02_LOD2
400098: Rock_Medium_03_LOD0
400100: Rock_Medium_03_LOD1
400102: Rock_Medium_03_LOD2
400104: Rock_Medium_04_LOD0
400106: Rock_Medium_04_LOD1
400108: Rock_Medium_04_LOD2
400110: Rock_Small_01_LOD0
400112: Rock_Small_01_LOD1
400114: Rock_Small_01_LOD2
400116: Rock_Small_02_LOD0
400118: Rock_Small_02_LOD1
400120: Rock_Small_02_LOD2
400122: Rock_Small_03_LOD0
400124: Rock_Small_03_LOD1
400126: Rock_Small_03_LOD2
400128: Rock_Small_04_LOD0
400130: Rock_Small_04_LOD1
400132: Rock_Small_04_LOD2
400134: Rocks
2100000: Env_Cliffs
2100002: Env_Rocks
2100004: Env_HeroLarge
2100006: Env_HeroCave
2300000: Cliff_Full_01_LOD0
2300002: Cliff_Full_01_LOD1
2300004: Cliff_Full_01_LOD2
2300006: Cliff_Full_02_LOD0
2300008: Cliff_Full_02_LOD1
2300010: Cliff_Full_02_LOD2
2300012: Cliff_Full_03_LOD0
2300014: Cliff_Full_03_LOD1
2300016: Cliff_Full_03_LOD2
2300018: Cliff_Wall_01_LOD0
2300020: Cliff_Wall_01_LOD1
2300022: Cliff_Wall_01_LOD2
2300024: Cliff_Wall_02_LOD0
2300026: Cliff_Wall_02_LOD1
2300028: Cliff_Wall_02_LOD2
2300030: Cliff_Wall_03_LOD0
2300032: Cliff_Wall_03_LOD1
2300034: Cliff_Wall_03_LOD2
2300036: Hero_Cave_LOD0
2300038: Hero_Cave_LOD1
2300040: Hero_Cave_LOD2
2300042: Hero_CaveEntrance_LOD0
2300044: Hero_CaveEntrance_LOD1
2300046: Hero_CaveEntrance_LOD2
2300048: Hero_CaveExit_LOD0
2300050: Hero_CaveExit_LOD1
2300052: Hero_CaveExit_LOD2
2300054: Hero_Mountain_LOD0
2300056: Hero_Mountain_LOD1
2300058: Hero_Mountain_LOD2
2300060: Hero_Tower_LOD0
2300062: Hero_Tower_LOD1
2300064: Hero_Tower_LOD2
2300066: Rock_Large_01_LOD0
2300068: Rock_Large_01_LOD1
2300070: Rock_Large_01_LOD2
2300072: Rock_Large_02_LOD0
2300074: Rock_Large_02_LOD1
2300076: Rock_Large_02_LOD2
2300078: Rock_Medium_01_LOD0
2300080: Rock_Medium_01_LOD1
2300082: Rock_Medium_01_LOD2
2300084: Rock_Medium_02_LOD0
2300086: Rock_Medium_02_LOD1
2300088: Rock_Medium_02_LOD2
2300090: Rock_Medium_03_LOD0
2300092: Rock_Medium_03_LOD1
2300094: Rock_Medium_03_LOD2
2300096: Rock_Medium_04_LOD0
2300098: Rock_Medium_04_LOD1
2300100: Rock_Medium_04_LOD2
2300102: Rock_Small_01_LOD0
2300104: Rock_Small_01_LOD1
2300106: Rock_Small_01_LOD2
2300108: Rock_Small_02_LOD0
2300110: Rock_Small_02_LOD1
2300112: Rock_Small_02_LOD2
2300114: Rock_Small_03_LOD0
2300116: Rock_Small_03_LOD1
2300118: Rock_Small_03_LOD2
2300120: Rock_Small_04_LOD0
2300122: Rock_Small_04_LOD1
2300124: Rock_Small_04_LOD2
3300000: Cliff_Full_01_LOD0
3300002: Cliff_Full_01_LOD1
3300004: Cliff_Full_01_LOD2
3300006: Cliff_Full_02_LOD0
3300008: Cliff_Full_02_LOD1
3300010: Cliff_Full_02_LOD2
3300012: Cliff_Full_03_LOD0
3300014: Cliff_Full_03_LOD1
3300016: Cliff_Full_03_LOD2
3300018: Cliff_Wall_01_LOD0
3300020: Cliff_Wall_01_LOD1
3300022: Cliff_Wall_01_LOD2
3300024: Cliff_Wall_02_LOD0
3300026: Cliff_Wall_02_LOD1
3300028: Cliff_Wall_02_LOD2
3300030: Cliff_Wall_03_LOD0
3300032: Cliff_Wall_03_LOD1
3300034: Cliff_Wall_03_LOD2
3300036: Hero_Cave_LOD0
3300038: Hero_Cave_LOD1
3300040: Hero_Cave_LOD2
3300042: Hero_CaveEntrance_LOD0
3300044: Hero_CaveEntrance_LOD1
3300046: Hero_CaveEntrance_LOD2
3300048: Hero_CaveExit_LOD0
3300050: Hero_CaveExit_LOD1
3300052: Hero_CaveExit_LOD2
3300054: Hero_Mountain_LOD0
3300056: Hero_Mountain_LOD1
3300058: Hero_Mountain_LOD2
3300060: Hero_Tower_LOD0
3300062: Hero_Tower_LOD1
3300064: Hero_Tower_LOD2
3300066: Rock_Large_01_LOD0
3300068: Rock_Large_01_LOD1
3300070: Rock_Large_01_LOD2
3300072: Rock_Large_02_LOD0
3300074: Rock_Large_02_LOD1
3300076: Rock_Large_02_LOD2
3300078: Rock_Medium_01_LOD0
3300080: Rock_Medium_01_LOD1
3300082: Rock_Medium_01_LOD2
3300084: Rock_Medium_02_LOD0
3300086: Rock_Medium_02_LOD1
3300088: Rock_Medium_02_LOD2
3300090: Rock_Medium_03_LOD0
3300092: Rock_Medium_03_LOD1
3300094: Rock_Medium_03_LOD2
3300096: Rock_Medium_04_LOD0
3300098: Rock_Medium_04_LOD1
3300100: Rock_Medium_04_LOD2
3300102: Rock_Small_01_LOD0
3300104: Rock_Small_01_LOD1
3300106: Rock_Small_01_LOD2
3300108: Rock_Small_02_LOD0
3300110: Rock_Small_02_LOD1
3300112: Rock_Small_02_LOD2
3300114: Rock_Small_03_LOD0
3300116: Rock_Small_03_LOD1
3300118: Rock_Small_03_LOD2
3300120: Rock_Small_04_LOD0
3300122: Rock_Small_04_LOD1
3300124: Rock_Small_04_LOD2
4300000: Cliff_Full_01_LOD2
4300002: Cliff_Full_02_LOD2
4300004: Cliff_Full_03_LOD2
4300006: Cliff_Wall_01_LOD2
4300008: Cliff_Wall_02_LOD2
4300010: Cliff_Wall_03_LOD2
4300012: Cliff_Full_01_LOD1
4300014: Cliff_Full_02_LOD1
4300016: Cliff_Full_03_LOD1
4300018: Cliff_Wall_01_LOD1
4300020: Cliff_Wall_02_LOD1
4300022: Cliff_Wall_03_LOD1
4300024: Cliff_Full_01_LOD0
4300026: Cliff_Full_02_LOD0
4300028: Cliff_Full_03_LOD0
4300030: Cliff_Wall_01_LOD0
4300032: Cliff_Wall_02_LOD0
4300034: Cliff_Wall_03_LOD0
4300036: Rock_Small_04_LOD1
4300038: Rock_Large_01_LOD1
4300040: Rock_Large_02_LOD1
4300042: Rock_Medium_01_LOD1
4300044: Rock_Medium_02_LOD1
4300046: Rock_Medium_03_LOD1
4300048: Rock_Medium_04_LOD1
4300050: Rock_Small_01_LOD1
4300052: Rock_Small_02_LOD1
4300054: Rock_Small_03_LOD1
4300056: Rock_Small_04_LOD2
4300058: Rock_Large_01_LOD2
4300060: Rock_Large_02_LOD2
4300062: Rock_Medium_01_LOD2
4300064: Rock_Medium_02_LOD2
4300066: Rock_Medium_03_LOD2
4300068: Rock_Medium_04_LOD2
4300070: Rock_Small_01_LOD2
4300072: Rock_Small_02_LOD2
4300074: Rock_Small_03_LOD2
4300076: Rock_Small_04_LOD0
4300078: Rock_Large_01_LOD0
4300080: Rock_Large_02_LOD0
4300082: Rock_Medium_01_LOD0
4300084: Rock_Medium_02_LOD0
4300086: Rock_Medium_03_LOD0
4300088: Rock_Medium_04_LOD0
4300090: Rock_Small_01_LOD0
4300092: Rock_Small_02_LOD0
4300094: Rock_Small_03_LOD0
4300096: Hero_Mountain_LOD1
4300098: Hero_Tower_LOD1
4300100: Hero_Tower_LOD2
4300102: Hero_Mountain_LOD2
4300104: Hero_Tower_LOD0
4300106: Hero_Mountain_LOD0
4300108: Hero_CaveEntrance_LOD1
4300110: Hero_Cave_LOD1
4300112: Hero_CaveExit_LOD1
4300114: Hero_CaveEntrance_LOD2
4300116: Hero_Cave_LOD2
4300118: Hero_CaveExit_LOD2
4300120: Hero_Cave_LOD0
4300122: Hero_CaveExit_LOD0
4300124: Hero_CaveEntrance_LOD0
7400000: Take 001
9500000: //RootNode
20500000: //RootNode
2186277476908879412: ImportLogs
externalObjects: {}
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
useSRGBMaterialColor: 1
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
previousCalculatedGlobalScale: 0.01
hasPreviousCalculatedGlobalScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
importAnimation: 1
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:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 2
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

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

正在加载...
取消
保存