升级水插件
This commit is contained in:
@@ -77,6 +77,7 @@ half3 Caustics
|
||||
);
|
||||
}
|
||||
|
||||
#if d_Crest_CausticsForceDistortion
|
||||
if (i_Underwater)
|
||||
{
|
||||
float2 surfacePosXZ = i_ScenePositionWS.xz;
|
||||
@@ -93,6 +94,7 @@ half3 Caustics
|
||||
cuv1.xy += 1.30 * causticN;
|
||||
cuv2.xy += 1.77 * causticN;
|
||||
}
|
||||
#endif
|
||||
|
||||
half causticsStrength = i_Strength;
|
||||
|
||||
|
||||
@@ -12,28 +12,43 @@ TEXTURE2D_FLOAT(_Crest_WaterLine);
|
||||
float _Crest_WaterLineTexel;
|
||||
float2 _Crest_WaterLineResolution;
|
||||
float2 _Crest_WaterLineSnappedPosition;
|
||||
bool _Crest_WaterLineFlatWater;
|
||||
|
||||
m_CrestNameSpace
|
||||
|
||||
float SampleWaterLineHeight(const float2 i_PositionWS)
|
||||
{
|
||||
const float2 uv = (i_PositionWS - _Crest_WaterLineSnappedPosition) / (_Crest_WaterLineTexel * _Crest_WaterLineResolution) + 0.5;
|
||||
return _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv, 0).r + g_Crest_WaterCenter.y;
|
||||
if (_Crest_WaterLineFlatWater)
|
||||
{
|
||||
return g_Crest_WaterCenter.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
const float2 uv = (i_PositionWS - _Crest_WaterLineSnappedPosition) / (_Crest_WaterLineTexel * _Crest_WaterLineResolution) + 0.5;
|
||||
return _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv, 0).r + g_Crest_WaterCenter.y;
|
||||
}
|
||||
}
|
||||
|
||||
half3 SampleWaterLineNormal(const float2 i_PositionWS, const float i_Height)
|
||||
{
|
||||
const float2 uv = (i_PositionWS - _Crest_WaterLineSnappedPosition) / (_Crest_WaterLineTexel * _Crest_WaterLineResolution) + 0.5;
|
||||
const float3 dd = float3(1.0 / _Crest_WaterLineResolution.xy, 0.0);
|
||||
const float xOffset = _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv + dd.xz, 0).r;
|
||||
const float zOffset = _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv + dd.zy, 0).r;
|
||||
if (_Crest_WaterLineFlatWater)
|
||||
{
|
||||
return half3(0, 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
const float2 uv = (i_PositionWS - _Crest_WaterLineSnappedPosition) / (_Crest_WaterLineTexel * _Crest_WaterLineResolution) + 0.5;
|
||||
const float3 dd = float3(1.0 / _Crest_WaterLineResolution.xy, 0.0);
|
||||
const float xOffset = _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv + dd.xz, 0).r;
|
||||
const float zOffset = _Crest_WaterLine.SampleLevel(_Crest_linear_clamp_sampler, uv + dd.zy, 0).r;
|
||||
|
||||
return normalize(half3
|
||||
(
|
||||
(xOffset - i_Height) / _Crest_WaterLineTexel,
|
||||
1.0,
|
||||
(zOffset - i_Height) / _Crest_WaterLineTexel
|
||||
));
|
||||
return normalize(half3
|
||||
(
|
||||
(xOffset - i_Height) / _Crest_WaterLineTexel,
|
||||
1.0,
|
||||
(zOffset - i_Height) / _Crest_WaterLineTexel
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
m_CrestNameSpaceEnd
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
// Crest Water System
|
||||
// Copyright © 2024 Wave Harmonic. All rights reserved.
|
||||
|
||||
#ifndef d_WaveHarmonic_Crest_Surface_Emission
|
||||
#define d_WaveHarmonic_Crest_Surface_Emission
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl"
|
||||
|
||||
m_CrestNameSpace
|
||||
|
||||
half3 FoamBioluminescence
|
||||
(
|
||||
const half i_FoamData,
|
||||
const half i_FoamMap,
|
||||
const half3 i_BioluminescenceColor,
|
||||
const half i_BioluminescenceIntensity,
|
||||
const half i_BioluminescenceGlowCoverage,
|
||||
const half i_BioluminescenceGlowIntensity,
|
||||
const bool i_BioluminescenceSparklesEnabled,
|
||||
const half i_BioluminescenceSparklesMap,
|
||||
const half i_BioluminescenceSparklesCoverage,
|
||||
const half i_BioluminescenceSparklesIntensity,
|
||||
const half i_BioluminescenceMaximumDepth,
|
||||
const half i_WaterDepth
|
||||
)
|
||||
{
|
||||
half3 emission = 0.0;
|
||||
|
||||
const half weight = 1.0 - saturate(i_WaterDepth / i_BioluminescenceMaximumDepth);
|
||||
|
||||
if (weight <= 0.0)
|
||||
{
|
||||
return emission;
|
||||
}
|
||||
|
||||
emission +=
|
||||
(i_BioluminescenceColor * i_FoamMap * i_BioluminescenceIntensity) +
|
||||
(i_BioluminescenceColor * saturate(i_FoamData - (1.0 - i_BioluminescenceGlowCoverage)) * i_BioluminescenceGlowIntensity);
|
||||
|
||||
if (i_BioluminescenceSparklesEnabled)
|
||||
{
|
||||
emission += (i_BioluminescenceColor * i_BioluminescenceSparklesMap * saturate(i_FoamData - (1.0 - i_BioluminescenceSparklesCoverage)) * i_BioluminescenceSparklesIntensity);
|
||||
}
|
||||
|
||||
emission *= weight;
|
||||
|
||||
return emission;
|
||||
}
|
||||
|
||||
m_CrestNameSpaceEnd
|
||||
|
||||
#endif // d_WaveHarmonic_Crest_Surface_Emission
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4707eb239a4b242d4ac074ac67b5544e
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
m_CrestNameSpace
|
||||
|
||||
half WhiteFoamTexture
|
||||
half2 WhiteFoamTexture
|
||||
(
|
||||
const TiledTexture i_Texture,
|
||||
const half i_Foam,
|
||||
@@ -25,7 +25,8 @@ half WhiteFoamTexture
|
||||
const float2 i_WorldXZ1,
|
||||
const float2 i_TexelOffset,
|
||||
const half i_LodAlpha,
|
||||
const Cascade i_CascadeData0
|
||||
const Cascade i_CascadeData0,
|
||||
const bool i_Sample2ndChannel = false
|
||||
)
|
||||
{
|
||||
const float2 uvOffset = i_TexelOffset + g_Crest_Time * i_Texture._speed / 32.0;
|
||||
@@ -33,19 +34,32 @@ half WhiteFoamTexture
|
||||
// material 'scale' slider into an intuitive range.
|
||||
const float scale = i_Texture._scale * i_CascadeData0._Scale / 10.0;
|
||||
|
||||
half ft = lerp
|
||||
(
|
||||
i_Texture.Sample((i_WorldXZ0 + uvOffset) / scale).r,
|
||||
i_Texture.Sample((i_WorldXZ1 + uvOffset) / (2.0 * scale)).r,
|
||||
i_LodAlpha
|
||||
);
|
||||
const half2 f0 = i_Texture.Sample((i_WorldXZ0 + uvOffset) / scale).rg;
|
||||
const half2 f1 = i_Texture.Sample((i_WorldXZ1 + uvOffset) / (2.0 * scale)).rg;
|
||||
|
||||
const half fr = lerp(f0.r, f1.r, i_LodAlpha);
|
||||
|
||||
// Black point fade.
|
||||
half result = saturate(1.0 - i_Foam);
|
||||
return smoothstep(result, result + i_Feather, ft);
|
||||
const half result = saturate(1.0 - i_Foam);
|
||||
|
||||
#if d_Crest_FoamBioluminescence
|
||||
if (i_Sample2ndChannel)
|
||||
{
|
||||
// Helps with exaggerating at LOD borders. Very specific to sparkles as they do not
|
||||
// overlap leaving a dead zone in the middle.
|
||||
const half fg = f0.g * min(0.5, 1.0 - i_LodAlpha) * 2.0 +
|
||||
f1.g * min(0.5, i_LodAlpha) * 2.0;
|
||||
|
||||
return smoothstep(result, result + i_Feather, half2(fr, fg));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
return half2(smoothstep(result, result + i_Feather, fr), 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
half MultiScaleFoamAlbedo
|
||||
half2 MultiScaleFoamAlbedo
|
||||
(
|
||||
const TiledTexture i_Texture,
|
||||
const half i_Feather,
|
||||
@@ -53,7 +67,8 @@ half MultiScaleFoamAlbedo
|
||||
const Cascade i_CascadeData0,
|
||||
const Cascade i_CascadeData1,
|
||||
const half i_LodAlpha,
|
||||
const float2 i_UndisplacedXZ
|
||||
const float2 i_UndisplacedXZ,
|
||||
const bool i_Sample2ndChannel
|
||||
)
|
||||
{
|
||||
float2 worldXZ0 = i_UndisplacedXZ;
|
||||
@@ -67,7 +82,7 @@ half MultiScaleFoamAlbedo
|
||||
worldXZ1 -= ShiftingOriginOffset(i_Texture, i_CascadeData1);
|
||||
#endif // CREST_SHIFTING_ORIGIN
|
||||
|
||||
return WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, (float2)0.0, i_LodAlpha, i_CascadeData0);
|
||||
return WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, (float2)0.0, i_LodAlpha, i_CascadeData0, i_Sample2ndChannel);
|
||||
}
|
||||
|
||||
half2 MultiScaleFoamNormal
|
||||
@@ -97,8 +112,8 @@ half2 MultiScaleFoamNormal
|
||||
|
||||
// 0.25 is magic number found through tweaking.
|
||||
const float2 dd = float2(0.25 * i_PixelZ * i_Texture._texel, 0.0);
|
||||
const half whiteFoam_x = WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, dd.xy, i_LodAlpha, i_CascadeData0);
|
||||
const half whiteFoam_z = WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, dd.yx, i_LodAlpha, i_CascadeData0);
|
||||
const half whiteFoam_x = WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, dd.xy, i_LodAlpha, i_CascadeData0).r;
|
||||
const half whiteFoam_z = WhiteFoamTexture(i_Texture, i_FoamData, i_Feather, worldXZ0, worldXZ1, dd.yx, i_LodAlpha, i_CascadeData0).r;
|
||||
|
||||
// Compute a foam normal - manually push in derivatives. If I used blend
|
||||
// smooths all the normals towards straight up when there is no foam.
|
||||
@@ -107,7 +122,7 @@ half2 MultiScaleFoamNormal
|
||||
return magicStrengthFactor * i_NormalStrength * half2(whiteFoam_x - i_FoamAlbedo, whiteFoam_z - i_FoamAlbedo) / dd.x;
|
||||
}
|
||||
|
||||
half MultiScaleFoamAlbedo
|
||||
half2 MultiScaleFoamAlbedo
|
||||
(
|
||||
const Flow i_Flow,
|
||||
const TiledTexture i_Texture,
|
||||
@@ -116,7 +131,8 @@ half MultiScaleFoamAlbedo
|
||||
const Cascade i_CascadeData0,
|
||||
const Cascade i_CascadeData1,
|
||||
const half i_LodAlpha,
|
||||
const float2 i_UndisplacedXZ
|
||||
const float2 i_UndisplacedXZ,
|
||||
const bool i_Sample2ndChannel
|
||||
)
|
||||
{
|
||||
return MultiScaleFoamAlbedo
|
||||
@@ -127,7 +143,8 @@ half MultiScaleFoamAlbedo
|
||||
i_CascadeData0,
|
||||
i_CascadeData1,
|
||||
i_LodAlpha,
|
||||
i_UndisplacedXZ - i_Flow._Flow * i_Flow._Offset0
|
||||
i_UndisplacedXZ - i_Flow._Flow * i_Flow._Offset0,
|
||||
i_Sample2ndChannel
|
||||
) * i_Flow._Weight0 + MultiScaleFoamAlbedo
|
||||
(
|
||||
i_Texture,
|
||||
@@ -136,7 +153,8 @@ half MultiScaleFoamAlbedo
|
||||
i_CascadeData0,
|
||||
i_CascadeData1,
|
||||
i_LodAlpha,
|
||||
i_UndisplacedXZ - i_Flow._Flow * i_Flow._Offset1
|
||||
i_UndisplacedXZ - i_Flow._Flow * i_Flow._Offset1,
|
||||
i_Sample2ndChannel
|
||||
) * i_Flow._Weight1;
|
||||
}
|
||||
|
||||
@@ -214,8 +232,10 @@ void ApplyFoamToSurface
|
||||
// as if it had transmission.
|
||||
// There is still ugliness around the edges. There will either be black or
|
||||
// incorrect reflections depending on the magic value.
|
||||
io_NormalWS.y *= i_Foam > 0.15 ? -1.0 : 1.0;
|
||||
io_NormalWS = i_Foam > 0.0 ? half3(0.0, 1.0, 0.0) : io_NormalWS;
|
||||
#if _SPECULAR_SETUP
|
||||
io_Specular = lerp(io_Specular, i_Specular, i_Foam);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,13 +23,31 @@ void SetUpFog(bool i_Underwater, float3 i_PositionWS, float i_Multiplier, float
|
||||
{
|
||||
s_IsUnderWater = i_Underwater;
|
||||
|
||||
// XR does not like early returns in URP.
|
||||
#if !defined(STEREO_INSTANCING_ON) && !defined(STEREO_MULTIVIEW_ON)
|
||||
if (!s_IsUnderWater)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (CREST_LEGACY_UNDERWATER != 1)
|
||||
s_PositionSS = i_PositionSS;
|
||||
s_PositionWS = i_PositionWS;
|
||||
s_ViewWS = i_ViewWS;
|
||||
s_FogDistance = i_FogDistance;
|
||||
s_DepthRaw = 0;
|
||||
s_FogMultiplier = i_Multiplier;
|
||||
ApplyUnderwaterEffect
|
||||
(
|
||||
0, // Not used (color)
|
||||
0, // TIR only
|
||||
0, // Caustics only
|
||||
i_FogDistance,
|
||||
i_ViewWS,
|
||||
i_PositionSS,
|
||||
i_PositionWS,
|
||||
false, // No caustics
|
||||
true, // TODO: implement
|
||||
false, // Do not apply lighting
|
||||
1.0, // TODO: implement
|
||||
s_VolumeOpacity,
|
||||
s_VolumeLighting
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define m_Properties \
|
||||
const float2 i_UndisplacedXZ, \
|
||||
const float i_LodAlpha, \
|
||||
float i_LodAlpha, \
|
||||
const half i_WaterLevelOffset, \
|
||||
const float2 i_WaterLevelDerivatives, \
|
||||
const half2 i_Flow, \
|
||||
@@ -19,13 +19,36 @@
|
||||
const float3 i_PositionWS, \
|
||||
const float3 i_PositionVS, \
|
||||
const float2 i_StaticLightMapUV, \
|
||||
out half3 o_Albedo, \
|
||||
out half3 o_NormalWS, \
|
||||
out half3 o_Specular, \
|
||||
out half3 o_Emission, \
|
||||
out half o_Smoothness, \
|
||||
out half o_Occlusion, \
|
||||
out half o_Alpha
|
||||
inout half3 o_Albedo, \
|
||||
inout half3 o_NormalWS, \
|
||||
inout half3 o_Specular, \
|
||||
inout half3 o_Emission, \
|
||||
inout half o_Smoothness, \
|
||||
inout half o_Occlusion, \
|
||||
inout half o_Alpha
|
||||
|
||||
#define m_Parameters \
|
||||
i_UndisplacedXZ, \
|
||||
i_LodAlpha, \
|
||||
i_WaterLevelOffset, \
|
||||
i_WaterLevelDerivatives, \
|
||||
i_Flow, \
|
||||
i_ViewDirectionWS, \
|
||||
i_Facing, \
|
||||
i_SceneColor, \
|
||||
i_SceneDepthRaw, \
|
||||
i_ScreenPosition, \
|
||||
i_ScreenPositionRaw, \
|
||||
i_PositionWS, \
|
||||
i_PositionVS, \
|
||||
i_StaticLightMapUV, \
|
||||
o_Albedo, \
|
||||
o_NormalWS, \
|
||||
o_Specular, \
|
||||
o_Emission, \
|
||||
o_Smoothness, \
|
||||
o_Occlusion, \
|
||||
o_Alpha
|
||||
|
||||
// Guard against Shader Graph preview.
|
||||
#ifndef SHADERGRAPH_PREVIEW
|
||||
@@ -33,6 +56,7 @@
|
||||
#define d_Crest_WaterSurface 1
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Keywords.hlsl"
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl"
|
||||
@@ -54,6 +78,7 @@
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Refraction.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Caustics.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/VolumeLighting.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Emission.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Fresnel.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Foam.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Alpha.hlsl"
|
||||
@@ -79,17 +104,18 @@ static const TiledTexture _Crest_CausticsTiledTexture =
|
||||
static const TiledTexture _Crest_CausticsDistortionTiledTexture =
|
||||
TiledTexture::Make(_Crest_CausticsDistortionTexture, sampler_Crest_CausticsDistortionTexture, _Crest_CausticsDistortionTexture_TexelSize, _Crest_CausticsDistortionScale, 1.0);
|
||||
|
||||
void Fragment(m_Properties)
|
||||
void Fragment
|
||||
(
|
||||
m_Properties,
|
||||
const uint i_LodIndex0,
|
||||
const uint i_LodIndex1,
|
||||
const float2 i_PositionSS,
|
||||
const bool i_Underwater,
|
||||
const float i_SceneZRaw,
|
||||
const float i_NegativeFog
|
||||
)
|
||||
{
|
||||
o_Albedo = 0.0;
|
||||
o_NormalWS = half3(0.0, 1.0, 0.0);
|
||||
o_Specular = 0.0;
|
||||
o_Emission = 0.0;
|
||||
o_Smoothness = 0.7;
|
||||
o_Occlusion = 1.0;
|
||||
o_Alpha = 1.0;
|
||||
|
||||
const float2 positionSS = i_ScreenPosition.xy * _ScreenSize.xy;
|
||||
float2 scenePositionSS = i_PositionSS;
|
||||
|
||||
// Editor only. There is no defined editor symbol.
|
||||
if (_Crest_DrawBoundaryXZ)
|
||||
@@ -105,47 +131,25 @@ void Fragment(m_Properties)
|
||||
}
|
||||
}
|
||||
|
||||
bool underwater = IsUnderWater(i_Facing, g_Crest_ForceUnderwater, positionSS);
|
||||
const uint slice0 = i_LodIndex0;
|
||||
const uint slice1 = i_LodIndex1;
|
||||
|
||||
// TODO: Should we use PosToSIs or check for overflow?
|
||||
float slice0 = _Crest_LodIndex;
|
||||
float slice1 = _Crest_LodIndex + 1;
|
||||
|
||||
#ifdef CREST_FLOW_ON
|
||||
#if d_Crest_FlowLod
|
||||
const Flow flow = Flow::Make(i_Flow, g_Crest_Time);
|
||||
#endif
|
||||
|
||||
const Cascade cascade0 = Cascade::Make(slice0);
|
||||
const Cascade cascade1 = Cascade::Make(slice1);
|
||||
|
||||
float sceneRawZ = i_SceneDepthRaw;
|
||||
float negativeFog = _ProjectionParams.y;
|
||||
const float sceneZ = Utility::CrestLinearEyeDepth(i_SceneZRaw);
|
||||
const float pixelZ = -i_PositionVS.z;
|
||||
|
||||
#if (CREST_PORTALS != 0)
|
||||
#ifndef CREST_SHADOWPASS
|
||||
#if _ALPHATEST_ON
|
||||
if (m_CrestPortal)
|
||||
{
|
||||
const float pixelRawZ = i_ScreenPositionRaw.z / i_ScreenPositionRaw.w;
|
||||
if (Portal::EvaluateSurface(i_ScreenPosition.xy, pixelRawZ, i_PositionWS, underwater, sceneRawZ, negativeFog))
|
||||
{
|
||||
o_Alpha = 0.0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
float sceneZ = Utility::CrestLinearEyeDepth(sceneRawZ);
|
||||
float pixelZ = -i_PositionVS.z;
|
||||
|
||||
const bool isLastLod = _Crest_LodIndex == (uint)g_Crest_LodCount - 1;
|
||||
const bool isLastLod = slice0 == (uint)g_Crest_LodCount - 1;
|
||||
const float weight0 = (1.0 - i_LodAlpha) * cascade0._Weight;
|
||||
const float weight1 = (1.0 - weight0) * cascade1._Weight;
|
||||
|
||||
// Data that fades towards the edge.
|
||||
half foam = 0.0; half _determinant = 0.0; half4 albedo = 0.0; half2 shadow = 0.0;
|
||||
half foam = 0.0; half _determinant = 0.0; half4 albedo = 0.0; half2 shadow = 0.0; half waterDepth = i_WaterLevelOffset; half shorelineDistance = 0.0;
|
||||
if (weight0 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
Cascade::MakeAnimatedWaves(slice0).SampleNormals(i_UndisplacedXZ, weight0, o_NormalWS.xz, _determinant);
|
||||
@@ -155,15 +159,28 @@ void Fragment(m_Properties)
|
||||
Cascade::MakeFoam(slice0).SampleFoam(i_UndisplacedXZ, weight0, foam);
|
||||
}
|
||||
|
||||
#if d_Crest_AlbedoLod
|
||||
if (_Crest_AlbedoEnabled)
|
||||
{
|
||||
Cascade::MakeAlbedo(slice0).SampleAlbedo(i_UndisplacedXZ, weight0, albedo);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if d_Crest_ShadowLod
|
||||
if (_Crest_ShadowsEnabled)
|
||||
{
|
||||
Cascade::MakeShadow(slice0).SampleShadow(i_PositionWS.xz, weight0, shadow);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if d_Crest_SimpleTransparency || d_Crest_FoamBioluminescence
|
||||
#if !d_Crest_SimpleTransparency
|
||||
if (_Crest_FoamEnabled && _Crest_FoamBioluminescenceEnabled)
|
||||
#endif
|
||||
{
|
||||
Cascade::MakeDepth(slice0).SampleSignedDepthFromSeaLevelAndDistance(i_PositionWS.xz, weight0, waterDepth, shorelineDistance);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (weight1 > m_CrestSampleLodThreshold)
|
||||
@@ -175,15 +192,28 @@ void Fragment(m_Properties)
|
||||
Cascade::MakeFoam(slice1).SampleFoam(i_UndisplacedXZ, weight1, foam);
|
||||
}
|
||||
|
||||
#if d_Crest_AlbedoLod
|
||||
if (_Crest_AlbedoEnabled)
|
||||
{
|
||||
Cascade::MakeAlbedo(slice1).SampleAlbedo(i_UndisplacedXZ, weight1, albedo);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if d_Crest_ShadowLod
|
||||
if (_Crest_ShadowsEnabled)
|
||||
{
|
||||
Cascade::MakeShadow(slice1).SampleShadow(i_PositionWS.xz, weight1, shadow);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if d_Crest_SimpleTransparency || d_Crest_FoamBioluminescence
|
||||
#if !d_Crest_SimpleTransparency
|
||||
if (_Crest_FoamEnabled && _Crest_FoamBioluminescenceEnabled)
|
||||
#endif
|
||||
{
|
||||
Cascade::MakeDepth(slice1).SampleSignedDepthFromSeaLevelAndDistance(i_PositionWS.xz, weight1, waterDepth, shorelineDistance);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Invert so shadows are black as we normally multiply this by lighting.
|
||||
@@ -191,99 +221,81 @@ void Fragment(m_Properties)
|
||||
|
||||
// Data that displays to the edge.
|
||||
// The default simulation value has been written to the border of the last slice.
|
||||
half3 absorption = 0.0; half3 scattering = 0.0;
|
||||
half3 absorption = _Crest_Absorption.xyz; half3 scattering = _Crest_Scattering.xyz;
|
||||
|
||||
#if d_Crest_AbsorptionLod || d_Crest_ScatteringLod
|
||||
{
|
||||
const float weight0 = (1.0 - (isLastLod ? 0.0 : i_LodAlpha)) * cascade0._Weight;
|
||||
const float weight1 = (1.0 - weight0) * cascade1._Weight;
|
||||
|
||||
#if d_Crest_ScatteringLod
|
||||
if (g_Crest_SampleScatteringSimulation)
|
||||
{
|
||||
scattering = 0.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if d_Crest_AbsorptionLod
|
||||
if (g_Crest_SampleAbsorptionSimulation)
|
||||
{
|
||||
absorption = 0.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (weight0 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
#if d_Crest_ScatteringLod
|
||||
if (g_Crest_SampleScatteringSimulation)
|
||||
{
|
||||
Cascade::MakeScattering(slice0).SampleScattering(i_UndisplacedXZ, weight0, scattering);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if d_Crest_AbsorptionLod
|
||||
if (g_Crest_SampleAbsorptionSimulation)
|
||||
{
|
||||
Cascade::MakeAbsorption(slice0).SampleAbsorption(i_UndisplacedXZ, weight0, absorption);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (weight1 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
#if d_Crest_ScatteringLod
|
||||
if (g_Crest_SampleScatteringSimulation)
|
||||
{
|
||||
Cascade::MakeScattering(slice1).SampleScattering(i_UndisplacedXZ, weight1, scattering);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if d_Crest_AbsorptionLod
|
||||
if (g_Crest_SampleAbsorptionSimulation)
|
||||
{
|
||||
Cascade::MakeAbsorption(slice1).SampleAbsorption(i_UndisplacedXZ, weight1, absorption);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_Crest_SampleScatteringSimulation)
|
||||
{
|
||||
scattering = _Crest_Scattering.xyz;
|
||||
}
|
||||
|
||||
if (!g_Crest_SampleAbsorptionSimulation)
|
||||
{
|
||||
absorption = _Crest_Absorption.xyz;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Determinant needs to be one when no waves.
|
||||
if (isLastLod)
|
||||
{
|
||||
_determinant += 1.0 - weight0;
|
||||
waterDepth = 10000.0;
|
||||
}
|
||||
|
||||
// Normal.
|
||||
{
|
||||
if (_Crest_NormalMapEnabled)
|
||||
{
|
||||
o_NormalWS.xz += SampleNormalMaps
|
||||
(
|
||||
#ifdef CREST_FLOW_ON
|
||||
flow,
|
||||
#if d_Transparent
|
||||
// Feather at intersection. Cannot be used for shadows since depth is not available.
|
||||
const float feather =
|
||||
#if d_Crest_SimpleTransparency
|
||||
saturate(waterDepth / 0.2);
|
||||
#else
|
||||
saturate((sceneZ - pixelZ) / 0.2);
|
||||
#endif
|
||||
#endif
|
||||
_Crest_NormalMapTiledTexture,
|
||||
_Crest_NormalMapStrength,
|
||||
i_UndisplacedXZ,
|
||||
i_LodAlpha,
|
||||
cascade0
|
||||
);
|
||||
}
|
||||
|
||||
o_NormalWS = normalize(o_NormalWS);
|
||||
|
||||
WaterNormal
|
||||
(
|
||||
i_WaterLevelDerivatives,
|
||||
i_ViewDirectionWS,
|
||||
_Crest_MinimumReflectionDirectionY,
|
||||
underwater,
|
||||
o_NormalWS
|
||||
);
|
||||
|
||||
o_NormalWS = normalize(o_NormalWS);
|
||||
|
||||
o_NormalWS.xz *= _Crest_NormalsStrengthOverall;
|
||||
o_NormalWS.y = lerp(1.0, o_NormalWS.y, _Crest_NormalsStrengthOverall);
|
||||
|
||||
if (underwater)
|
||||
{
|
||||
// Flip when underwater.
|
||||
o_NormalWS.xyz *= -1.0;
|
||||
}
|
||||
}
|
||||
|
||||
// Default for opaque render type.
|
||||
float sceneDistance = 1000.0;
|
||||
float3 scenePositionWS = 0.0;
|
||||
|
||||
const half3 ambientLight = AmbientLight();
|
||||
const half3 extinction = VolumeExtinction(absorption, scattering);
|
||||
|
||||
float3 lightIntensity = 0.0;
|
||||
half3 lightDirection = 0.0;
|
||||
@@ -295,24 +307,123 @@ void Fragment(m_Properties)
|
||||
lightDirection
|
||||
);
|
||||
|
||||
half3 additionalLight = AdditionalLighting(i_PositionWS, i_ScreenPositionRaw, i_StaticLightMapUV);
|
||||
const half3 ambientLight = AmbientLight();
|
||||
const half3 additionalLight = AdditionalLighting(i_PositionWS, i_ScreenPositionRaw, i_StaticLightMapUV);
|
||||
|
||||
// Normal.
|
||||
{
|
||||
WaterNormal
|
||||
(
|
||||
i_WaterLevelDerivatives,
|
||||
i_ViewDirectionWS,
|
||||
_Crest_MinimumReflectionDirectionY,
|
||||
i_Underwater,
|
||||
o_NormalWS
|
||||
);
|
||||
|
||||
#if d_Crest_NormalMap
|
||||
if (_Crest_NormalMapEnabled)
|
||||
{
|
||||
const half2 normalMap = SampleNormalMaps
|
||||
(
|
||||
#if d_Crest_FlowLod
|
||||
flow,
|
||||
#endif
|
||||
_Crest_NormalMapTiledTexture,
|
||||
_Crest_NormalMapStrength,
|
||||
i_UndisplacedXZ,
|
||||
i_LodAlpha,
|
||||
cascade0
|
||||
);
|
||||
|
||||
half normalMapStrength = _Crest_NormalMapStrength;
|
||||
|
||||
if (_Crest_NormalMapTurbulenceEnabled)
|
||||
{
|
||||
normalMapStrength = NormalMapTurbulence
|
||||
(
|
||||
o_NormalWS,
|
||||
normalMap,
|
||||
normalMapStrength,
|
||||
_Crest_NormalMapTurbulenceCoverage,
|
||||
_Crest_NormalMapTurbulenceStrength,
|
||||
i_ViewDirectionWS,
|
||||
_determinant,
|
||||
g_Crest_WaterCenter.y + i_WaterLevelOffset,
|
||||
pixelZ,
|
||||
lightDirection
|
||||
);
|
||||
}
|
||||
|
||||
o_NormalWS.xz += normalMap * normalMapStrength;
|
||||
}
|
||||
#endif // d_Crest_NormalMap
|
||||
|
||||
o_NormalWS = normalize(o_NormalWS);
|
||||
|
||||
WaterNormal
|
||||
(
|
||||
i_WaterLevelDerivatives,
|
||||
i_ViewDirectionWS,
|
||||
_Crest_MinimumReflectionDirectionY,
|
||||
i_Underwater,
|
||||
o_NormalWS
|
||||
);
|
||||
|
||||
o_NormalWS = normalize(o_NormalWS);
|
||||
|
||||
o_NormalWS.xz *= _Crest_NormalsStrengthOverall;
|
||||
o_NormalWS.y = lerp(1.0, o_NormalWS.y, _Crest_NormalsStrengthOverall);
|
||||
|
||||
if (i_Underwater)
|
||||
{
|
||||
// Flip when underwater.
|
||||
o_NormalWS.xyz *= -1.0;
|
||||
}
|
||||
}
|
||||
|
||||
// Default for opaque render type.
|
||||
float sceneDistance = 1000.0;
|
||||
float3 scenePositionWS = i_PositionWS;
|
||||
|
||||
#if d_Crest_SimpleTransparency
|
||||
sceneDistance = waterDepth;
|
||||
// Increase ray for grazing angles.
|
||||
sceneDistance += (1.0 - dot(i_ViewDirectionWS, o_NormalWS)) * waterDepth;
|
||||
scenePositionWS.y = i_PositionWS.y - waterDepth;
|
||||
// Cannot sample scene so go with average light.
|
||||
o_Emission = i_Underwater ? 0.0 : (0.5 * (lightIntensity + additionalLight + ambientLight) * INV_PI);
|
||||
#if CREST_HDRP
|
||||
o_Emission /= GetCurrentExposureMultiplier();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
bool caustics = !i_Underwater;
|
||||
|
||||
#if !d_Crest_SimpleTransparency
|
||||
#if d_Transparent
|
||||
#ifndef d_SkipRefraction
|
||||
bool caustics;
|
||||
RefractedScene
|
||||
(
|
||||
_Crest_RefractionStrength,
|
||||
1.000293, // air
|
||||
_Crest_RefractiveIndexOfWater,
|
||||
o_NormalWS,
|
||||
i_PositionWS,
|
||||
i_ScreenPosition.xy,
|
||||
i_ScreenPositionRaw,
|
||||
pixelZ,
|
||||
i_SceneColor,
|
||||
i_ViewDirectionWS,
|
||||
sceneZ,
|
||||
sceneRawZ,
|
||||
underwater,
|
||||
i_SceneZRaw,
|
||||
cascade0._Scale,
|
||||
i_LodAlpha,
|
||||
i_Underwater,
|
||||
_Crest_TotalInternalReflectionIntensity,
|
||||
o_Emission,
|
||||
sceneDistance,
|
||||
scenePositionWS,
|
||||
scenePositionSS,
|
||||
caustics
|
||||
);
|
||||
|
||||
@@ -329,45 +440,46 @@ void Fragment(m_Properties)
|
||||
#endif
|
||||
#endif // d_SkipRefraction
|
||||
#endif // d_Transparent
|
||||
|
||||
float refractedSeaLevel = g_Crest_WaterCenter.y;
|
||||
float3 refractedSurfacePosition = float3(0, refractedSeaLevel, 0);
|
||||
if (!underwater && slice1 < g_Crest_LodCount)
|
||||
{
|
||||
// Sample larger slice to avoid the first slice.
|
||||
float4 displacement = Cascade::MakeAnimatedWaves(slice1).Sample(scenePositionWS.xz);
|
||||
refractedSeaLevel = g_Crest_WaterCenter.y + displacement.w;
|
||||
refractedSurfacePosition = displacement.xyz;
|
||||
refractedSurfacePosition.y += refractedSeaLevel;
|
||||
}
|
||||
#endif // d_Crest_SimpleTransparency
|
||||
|
||||
// Out-scattering.
|
||||
if (!underwater)
|
||||
if (!i_Underwater)
|
||||
{
|
||||
// Account for average extinction of light as it travels down through volume. Assume flat water as anything else would be expensive.
|
||||
half3 extinction = absorption.xyz + scattering.xyz;
|
||||
o_Emission *= exp(-extinction * max(0.0, refractedSeaLevel - scenePositionWS.y));
|
||||
// Account for extinction of light as it travels down through volume.
|
||||
o_Emission *= exp(-extinction * max(0.0, i_PositionWS.y - scenePositionWS.y));
|
||||
}
|
||||
|
||||
#if d_Transparent
|
||||
#ifndef d_SkipRefraction
|
||||
// Caustics
|
||||
if (_Crest_CausticsEnabled && !underwater && caustics)
|
||||
if (_Crest_CausticsEnabled && !i_Underwater && caustics)
|
||||
{
|
||||
half lightOcclusion = PrimaryLightShadows(scenePositionWS, positionSS);
|
||||
half lightOcclusion = 1.0;
|
||||
#if !d_Crest_SimpleTransparency
|
||||
lightOcclusion = PrimaryLightShadows(scenePositionWS, scenePositionSS);
|
||||
#endif
|
||||
|
||||
#if d_Crest_SimpleTransparency
|
||||
if (_Crest_RefractionStrength > 0.0)
|
||||
{
|
||||
// Gives a parallax like effect.
|
||||
const half3 ray = refract(-i_ViewDirectionWS, o_NormalWS, 1.0 / _Crest_RefractiveIndexOfWater) * _Crest_RefractionStrength;
|
||||
scenePositionWS += ray * waterDepth * 2.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
half blur = 0.0;
|
||||
#ifdef CREST_FLOW_ON
|
||||
#if d_Crest_FlowLod
|
||||
blur = _Crest_CausticsMotionBlur;
|
||||
#endif
|
||||
|
||||
o_Emission *= Caustics
|
||||
(
|
||||
#ifdef CREST_FLOW_ON
|
||||
#if d_Crest_FlowLod
|
||||
flow,
|
||||
#endif
|
||||
scenePositionWS,
|
||||
refractedSurfacePosition.y,
|
||||
i_PositionWS.y,
|
||||
lightIntensity,
|
||||
lightDirection,
|
||||
lightOcclusion,
|
||||
@@ -380,7 +492,7 @@ void Fragment(m_Properties)
|
||||
_Crest_CausticsDistortionTiledTexture,
|
||||
_Crest_CausticsDistortionStrength,
|
||||
blur,
|
||||
underwater
|
||||
_Crest_CausticsForceDistortion
|
||||
);
|
||||
}
|
||||
#endif // d_SkipRefraction
|
||||
@@ -404,7 +516,6 @@ void Fragment(m_Properties)
|
||||
}
|
||||
|
||||
// Volume Lighting
|
||||
const half3 extinction = VolumeExtinction(absorption, scattering);
|
||||
const half3 volumeOpacity = VolumeOpacity(extinction, sceneDistance);
|
||||
const half3 volumeLight = VolumeLighting
|
||||
(
|
||||
@@ -431,7 +542,7 @@ void Fragment(m_Properties)
|
||||
(
|
||||
i_ViewDirectionWS,
|
||||
o_NormalWS,
|
||||
underwater,
|
||||
i_Underwater,
|
||||
1.0, // air
|
||||
_Crest_RefractiveIndexOfWater,
|
||||
_Crest_TotalInternalReflectionIntensity,
|
||||
@@ -439,7 +550,7 @@ void Fragment(m_Properties)
|
||||
reflected
|
||||
);
|
||||
|
||||
if (underwater)
|
||||
if (i_Underwater)
|
||||
{
|
||||
o_Emission *= transmitted;
|
||||
o_Emission += volumeLight * reflected;
|
||||
@@ -452,10 +563,12 @@ void Fragment(m_Properties)
|
||||
}
|
||||
}
|
||||
|
||||
#if _SPECULAR_SETUP
|
||||
// Specular
|
||||
{
|
||||
o_Specular = _Crest_Specular * reflected * shadow.y;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Smoothness
|
||||
{
|
||||
@@ -465,24 +578,27 @@ void Fragment(m_Properties)
|
||||
|
||||
// Occlusion
|
||||
{
|
||||
o_Occlusion = underwater ? _Crest_OcclusionUnderwater : _Crest_Occlusion;
|
||||
o_Occlusion = i_Underwater ? _Crest_OcclusionUnderwater : _Crest_Occlusion;
|
||||
}
|
||||
|
||||
// Planar Reflections
|
||||
#if d_Crest_PlanarReflections
|
||||
if (_Crest_PlanarReflectionsEnabled)
|
||||
{
|
||||
half4 reflection = PlanarReflection
|
||||
(
|
||||
_Crest_ReflectionTexture,
|
||||
sampler_Crest_ReflectionTexture,
|
||||
_Crest_ReflectionColorTexture,
|
||||
sampler_Crest_ReflectionColorTexture,
|
||||
_Crest_PlanarReflectionsIntensity,
|
||||
o_Smoothness,
|
||||
_Crest_PlanarReflectionsRoughness,
|
||||
_Crest_MinimumReflectionDirectionY,
|
||||
pixelZ,
|
||||
o_NormalWS,
|
||||
_Crest_PlanarReflectionsDistortion,
|
||||
i_ViewDirectionWS,
|
||||
i_ScreenPosition.xy,
|
||||
underwater
|
||||
i_Underwater
|
||||
);
|
||||
|
||||
half alpha = reflection.a;
|
||||
@@ -491,13 +607,14 @@ void Fragment(m_Properties)
|
||||
// Results are darker than Unity's.
|
||||
o_Occlusion *= 1.0 - alpha;
|
||||
}
|
||||
#endif // d_Crest_PlanarReflections
|
||||
|
||||
// Foam
|
||||
if (_Crest_FoamEnabled)
|
||||
{
|
||||
half albedo = MultiScaleFoamAlbedo
|
||||
half2 albedo = MultiScaleFoamAlbedo
|
||||
(
|
||||
#ifdef CREST_FLOW_ON
|
||||
#if d_Crest_FlowLod
|
||||
flow,
|
||||
#endif
|
||||
_Crest_FoamTiledTexture,
|
||||
@@ -506,19 +623,20 @@ void Fragment(m_Properties)
|
||||
cascade0,
|
||||
cascade1,
|
||||
i_LodAlpha,
|
||||
i_UndisplacedXZ
|
||||
i_UndisplacedXZ,
|
||||
_Crest_FoamBioluminescenceEnabled && _Crest_FoamBioluminescenceSparklesEnabled
|
||||
);
|
||||
|
||||
half2 normal = MultiScaleFoamNormal
|
||||
(
|
||||
#ifdef CREST_FLOW_ON
|
||||
#if d_Crest_FlowLod
|
||||
flow,
|
||||
#endif
|
||||
_Crest_FoamTiledTexture,
|
||||
_Crest_FoamFeather,
|
||||
_Crest_FoamNormalStrength,
|
||||
foam,
|
||||
albedo,
|
||||
albedo.x,
|
||||
cascade0,
|
||||
cascade1,
|
||||
i_LodAlpha,
|
||||
@@ -530,13 +648,13 @@ void Fragment(m_Properties)
|
||||
|
||||
ApplyFoamToSurface
|
||||
(
|
||||
albedo,
|
||||
albedo.x,
|
||||
normal,
|
||||
intensity,
|
||||
_Crest_Occlusion,
|
||||
_Crest_FoamSmoothness,
|
||||
_Crest_Specular,
|
||||
underwater,
|
||||
i_Underwater,
|
||||
o_Albedo,
|
||||
o_NormalWS,
|
||||
o_Emission,
|
||||
@@ -546,36 +664,71 @@ void Fragment(m_Properties)
|
||||
);
|
||||
|
||||
// We will use this for shadow casting.
|
||||
foam = albedo;
|
||||
const half foamData = foam;
|
||||
foam = albedo.r;
|
||||
|
||||
#if d_Crest_FoamBioluminescence
|
||||
if (_Crest_FoamBioluminescenceEnabled)
|
||||
{
|
||||
half3 emission = FoamBioluminescence
|
||||
(
|
||||
foamData,
|
||||
albedo.r,
|
||||
_Crest_FoamBioluminescenceColor.rgb,
|
||||
_Crest_FoamBioluminescenceIntensity,
|
||||
_Crest_FoamBioluminescenceGlowCoverage,
|
||||
_Crest_FoamBioluminescenceGlowIntensity,
|
||||
_Crest_FoamBioluminescenceSparklesEnabled,
|
||||
albedo.y,
|
||||
_Crest_FoamBioluminescenceSparklesCoverage,
|
||||
_Crest_FoamBioluminescenceSparklesIntensity,
|
||||
_Crest_FoamBioluminescenceMaximumDepth,
|
||||
waterDepth
|
||||
);
|
||||
|
||||
emission *= _Crest_FoamBioluminescenceSeaLevelOnly ? saturate(1.0 - abs(i_WaterLevelOffset)) : 1.0;
|
||||
|
||||
#if d_Transparent
|
||||
// Apply feathering to avoid hardening the edge.
|
||||
emission *= feather * feather * feather;
|
||||
#endif
|
||||
|
||||
o_Emission += emission;
|
||||
}
|
||||
#endif // d_Crest_FoamBioluminescence
|
||||
}
|
||||
|
||||
// Albedo
|
||||
#if d_Crest_AlbedoLod
|
||||
if (_Crest_AlbedoEnabled)
|
||||
{
|
||||
const float foamMask = _Crest_AlbedoIgnoreFoam ? (1.0 - saturate(foam)) : 1.0;
|
||||
o_Albedo = lerp(o_Albedo, albedo.rgb, albedo.a * foamMask);
|
||||
o_Emission *= 1.0 - albedo.a * foamMask;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if d_Crest_SimpleTransparency
|
||||
o_Alpha = i_Underwater
|
||||
? 1.0 - transmitted
|
||||
: max(max(length(volumeOpacity), _Crest_TransparencyMinimumAlpha), max(foam, albedo.a));
|
||||
#endif
|
||||
|
||||
// Alpha
|
||||
{
|
||||
#ifndef CREST_SHADOWPASS
|
||||
#if d_Transparent
|
||||
// Feather at intersection. Cannot be used for shadows since depth is not available.
|
||||
o_Alpha = saturate((sceneZ - pixelZ) / 0.2);
|
||||
o_Alpha = min(o_Alpha, feather);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// This keyword works for all RPs despite BIRP having prefixes in serialised data.
|
||||
#if _ALPHATEST_ON
|
||||
#if d_Crest_AlphaTest
|
||||
#if CREST_SHADOWPASS
|
||||
o_Alpha = max(foam, albedo.a) - _Crest_ShadowCasterThreshold;
|
||||
o_Alpha = min(o_Alpha, max(foam, albedo.a) - _Crest_ShadowCasterThreshold);
|
||||
#endif
|
||||
|
||||
// Add 0.5 bias for LOD blending and texel resolution correction. This will help to
|
||||
// tighten and smooth clipped edges.
|
||||
o_Alpha -= ClipSurface(i_PositionWS.xz) > 0.5 ? 2.0 : 0.0;
|
||||
#endif // _ALPHATEST_ON
|
||||
#endif // d_Crest_AlphaTest
|
||||
|
||||
// Specular in HDRP is still affected outside the 0-1 alpha range.
|
||||
o_Alpha = min(o_Alpha, 1.0);
|
||||
@@ -583,22 +736,107 @@ void Fragment(m_Properties)
|
||||
|
||||
SetUpFog
|
||||
(
|
||||
underwater,
|
||||
i_Underwater,
|
||||
i_PositionWS,
|
||||
1.0, // N/A: multiplier for fog nodes
|
||||
sceneDistance - negativeFog,
|
||||
pixelZ - i_NegativeFog,
|
||||
i_ViewDirectionWS,
|
||||
positionSS
|
||||
i_PositionSS
|
||||
);
|
||||
}
|
||||
|
||||
// IMPORTANT!
|
||||
// Do not branch on o_Alpha, as it is not robust. Rendering will break on stereo
|
||||
// rendering in the form of losing additional lighting and/or broken reflection
|
||||
// probe sampling. This is an issue with the shader compiler it seems.
|
||||
void Fragment(m_Properties)
|
||||
{
|
||||
const float2 positionSS = i_ScreenPosition.xy * _ScreenSize.xy;
|
||||
|
||||
bool underwater = IsUnderWater(i_Facing, g_Crest_ForceUnderwater, positionSS);
|
||||
float sceneRawZ = i_SceneDepthRaw;
|
||||
float negativeFog = _ProjectionParams.y;
|
||||
|
||||
#if d_Crest_AlphaTest
|
||||
#if !d_Crest_SimpleTransparency
|
||||
#ifndef CREST_SHADOWPASS
|
||||
#if (CREST_PORTALS != 0)
|
||||
if (m_CrestPortal)
|
||||
{
|
||||
const float pixelRawZ = i_ScreenPositionRaw.z / i_ScreenPositionRaw.w;
|
||||
o_Alpha = Portal::EvaluateSurface(i_ScreenPosition.xy, pixelRawZ, i_PositionWS, underwater, sceneRawZ, negativeFog) ? -1.0 : 1.0;
|
||||
#ifndef SHADER_API_WEBGPU
|
||||
clip(o_Alpha);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
uint slice0;
|
||||
uint slice1;
|
||||
float alpha;
|
||||
|
||||
#if d_Crest_AlphaTest || d_Crest_CustomMesh
|
||||
PosToSliceIndices(i_PositionWS.xz, 0.0, g_Crest_LodCount - 1.0, g_Crest_WaterScale, slice0, slice1, alpha);
|
||||
#endif
|
||||
|
||||
#if d_Crest_AlphaTest
|
||||
{
|
||||
const Cascade cascade0 = Cascade::Make(slice0);
|
||||
const Cascade cascade1 = Cascade::Make(slice1);
|
||||
const float weight0 = (1.0 - alpha) * cascade0._Weight;
|
||||
const float weight1 = (1.0 - weight0) * cascade1._Weight;
|
||||
|
||||
float clipSurface = 0.0;
|
||||
if (weight0 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
Cascade::MakeClip(slice0).SampleClip(i_PositionWS.xz, weight0, clipSurface);
|
||||
}
|
||||
if (weight1 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
Cascade::MakeClip(slice1).SampleClip(i_PositionWS.xz, weight1, clipSurface);
|
||||
}
|
||||
|
||||
// Add 0.5 bias for LOD blending and texel resolution correction. This will help to
|
||||
// tighten and smooth clipped edges.
|
||||
o_Alpha -= clipSurface > 0.5 ? 2.0 : 0.0;
|
||||
|
||||
#ifndef SHADER_API_WEBGPU
|
||||
clip(o_Alpha);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
#if !d_Crest_CustomMesh
|
||||
slice0 = _Crest_LodIndex;
|
||||
slice1 = _Crest_LodIndex + 1;
|
||||
alpha = i_LodAlpha;
|
||||
#endif
|
||||
|
||||
i_LodAlpha = alpha;
|
||||
|
||||
Fragment
|
||||
(
|
||||
m_Parameters,
|
||||
slice0,
|
||||
slice1,
|
||||
positionSS,
|
||||
underwater,
|
||||
sceneRawZ,
|
||||
negativeFog
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
m_CrestNameSpaceEnd
|
||||
|
||||
#endif // SHADERGRAPH_PREVIEW
|
||||
|
||||
void Fragment_float(m_Properties)
|
||||
{
|
||||
#if SHADERGRAPH_PREVIEW
|
||||
o_Albedo = 0.0;
|
||||
o_NormalWS = half3(0.0, 1.0, 0.0);
|
||||
o_Specular = 0.0;
|
||||
@@ -606,32 +844,10 @@ void Fragment_float(m_Properties)
|
||||
o_Smoothness = 0.7;
|
||||
o_Occlusion = 1.0;
|
||||
o_Alpha = 1.0;
|
||||
#else // SHADERGRAPH_PREVIEW
|
||||
m_Crest::Fragment
|
||||
(
|
||||
i_UndisplacedXZ,
|
||||
i_LodAlpha,
|
||||
i_WaterLevelOffset,
|
||||
i_WaterLevelDerivatives,
|
||||
i_Flow,
|
||||
i_ViewDirectionWS,
|
||||
i_Facing,
|
||||
i_SceneColor,
|
||||
i_SceneDepthRaw,
|
||||
i_ScreenPosition,
|
||||
i_ScreenPositionRaw,
|
||||
i_PositionWS,
|
||||
i_PositionVS,
|
||||
i_StaticLightMapUV,
|
||||
o_Albedo,
|
||||
o_NormalWS,
|
||||
o_Specular,
|
||||
o_Emission,
|
||||
o_Smoothness,
|
||||
o_Occlusion,
|
||||
o_Alpha
|
||||
);
|
||||
#endif // SHADERGRAPH_PREVIEW
|
||||
|
||||
#if !SHADERGRAPH_PREVIEW
|
||||
m_Crest::Fragment(m_Parameters);
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef m_Properties
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
// These are per cascade, set per chunk instance.
|
||||
CBUFFER_START(CrestChunkGeometryData)
|
||||
float _Crest_ChunkMeshScaleAlpha;
|
||||
float _Crest_ChunkMeshScaleAlphaSource;
|
||||
float _Crest_ChunkGeometryGridWidth;
|
||||
float _Crest_ChunkGeometryGridWidthSource;
|
||||
CBUFFER_END
|
||||
|
||||
m_CrestNameSpace
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// Crest Water System
|
||||
// Copyright © 2024 Wave Harmonic. All rights reserved.
|
||||
|
||||
#ifndef d_WaveHarmonic_Crest_SurfaceKeywords
|
||||
#define d_WaveHarmonic_Crest_SurfaceKeywords
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Keywords.hlsl"
|
||||
|
||||
#define d_Crest_AlphaTest defined(_ALPHATEST_ON)
|
||||
#define d_Crest_MotionVectors defined(_TRANSPARENT_WRITES_MOTION_VEC)
|
||||
|
||||
#define d_Crest_CustomMesh defined(_CREST_CUSTOM_MESH)
|
||||
|
||||
#define d_Crest_CausticsForceDistortion CREST_CAUSTICS_FORCE_DISTORTION
|
||||
#define d_Crest_FoamBioluminescence CREST_FOAM_BIOLUMINESCENCE
|
||||
#define d_Crest_NormalMap CREST_NORMAL_MAPS
|
||||
#define d_Crest_SimpleTransparency CREST_SIMPLE_TRANSPARENCY
|
||||
#define d_Crest_PlanarReflections CREST_PLANAR_REFLECTIONS
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d4fdd4ba0e96485c93d748132deef6a
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -5,6 +5,7 @@
|
||||
#define CREST_WATER_NORMAL_H
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Constants.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Texture.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Flow.hlsl"
|
||||
@@ -13,12 +14,43 @@
|
||||
#include "Packages/com.waveharmonic.crest.shifting-origin/Runtime/Shaders/ShiftingOrigin.hlsl"
|
||||
#endif
|
||||
|
||||
#if _CREST_CUSTOM_MESH
|
||||
float4 _Crest_NormalMapParameters[MAX_LOD_COUNT];
|
||||
#define _Crest_ChunkNormalMapParameters _Crest_NormalMapParameters[i_CascadeData._IndexI]
|
||||
#else
|
||||
// These are per cascade, set per chunk instance.
|
||||
float _Crest_ChunkFarNormalsWeight;
|
||||
float2 _Crest_ChunkNormalScrollSpeed;
|
||||
#define _Crest_ChunkNormalMapParameters float3(_Crest_ChunkNormalScrollSpeed, _Crest_ChunkFarNormalsWeight)
|
||||
#endif
|
||||
|
||||
m_CrestNameSpace
|
||||
|
||||
// Limit how close to horizontal reflection ray can get, useful to avoid unsightly below-horizon reflections.
|
||||
half3 ApplyMinimumReflectionDirectionY
|
||||
(
|
||||
const half i_MinimumReflectionDirectionY,
|
||||
const half3 i_ViewDirectionWS,
|
||||
const half3 i_NormalWS
|
||||
)
|
||||
{
|
||||
half3 normal = i_NormalWS;
|
||||
|
||||
float3 refl = reflect(-i_ViewDirectionWS, normal);
|
||||
if (refl.y < i_MinimumReflectionDirectionY)
|
||||
{
|
||||
// Find the normal that keeps the reflection direction above the horizon. Compute
|
||||
// the reflection dir that does work, normalize it, and then normal is half vector
|
||||
// between this good reflection direction and view direction.
|
||||
float3 FL = refl;
|
||||
FL.y = i_MinimumReflectionDirectionY;
|
||||
FL = normalize(FL);
|
||||
normal = normalize(FL + i_ViewDirectionWS);
|
||||
}
|
||||
|
||||
return normal;
|
||||
}
|
||||
|
||||
half2 SampleNormalMaps
|
||||
(
|
||||
const TiledTexture i_NormalMap,
|
||||
@@ -35,20 +67,24 @@ half2 SampleNormalMaps
|
||||
worldXZUndisplaced -= ShiftingOriginOffset(i_NormalMap, i_CascadeData);
|
||||
#endif
|
||||
|
||||
const float3 parameters = _Crest_ChunkNormalMapParameters.xyz;
|
||||
const float2 speed = parameters.xy;
|
||||
const float farWeight = parameters.z;
|
||||
|
||||
const float2 v0 = float2(0.94, 0.34), v1 = float2(-0.85, -0.53);
|
||||
float scale = i_NormalMap._scale * i_CascadeData._Scale / 10.0;
|
||||
const float spdmulL = _Crest_ChunkNormalScrollSpeed.x * i_NormalMap._speed;
|
||||
const float spdmulL = speed.x * i_NormalMap._speed;
|
||||
half2 norm =
|
||||
UnpackNormal(i_NormalMap.Sample((worldXZUndisplaced + v0 * g_Crest_Time * spdmulL) / scale)).xy +
|
||||
UnpackNormal(i_NormalMap.Sample((worldXZUndisplaced + v1 * g_Crest_Time * spdmulL) / scale)).xy;
|
||||
|
||||
// blend in next higher scale of normals to obtain continuity
|
||||
const half nblend = i_LodAlpha * _Crest_ChunkFarNormalsWeight;
|
||||
const half nblend = i_LodAlpha * farWeight;
|
||||
if (nblend > 0.001)
|
||||
{
|
||||
// next lod level
|
||||
scale *= 2.0;
|
||||
const float spdmulH = _Crest_ChunkNormalScrollSpeed.y * i_NormalMap._speed;
|
||||
const float spdmulH = speed.y * i_NormalMap._speed;
|
||||
norm = lerp(norm,
|
||||
UnpackNormal(i_NormalMap.Sample((worldXZUndisplaced + v0 * g_Crest_Time * spdmulH) / scale)).xy +
|
||||
UnpackNormal(i_NormalMap.Sample((worldXZUndisplaced + v1 * g_Crest_Time * spdmulH) / scale)).xy,
|
||||
@@ -56,7 +92,7 @@ half2 SampleNormalMaps
|
||||
}
|
||||
|
||||
// approximate combine of normals. would be better if normals applied in local frame.
|
||||
return i_Strength * norm;
|
||||
return norm;
|
||||
}
|
||||
|
||||
half2 SampleNormalMaps
|
||||
@@ -86,6 +122,41 @@ half2 SampleNormalMaps
|
||||
) * i_Flow._Weight1;
|
||||
}
|
||||
|
||||
half NormalMapTurbulence
|
||||
(
|
||||
const half3 i_NormalWS,
|
||||
const half2 i_NormalMap,
|
||||
const half i_NormalMapStrength,
|
||||
const half i_Coverage,
|
||||
const half i_Strength,
|
||||
const half3 i_ViewDirectionWS,
|
||||
const half i_Determinant,
|
||||
const half i_WaterLevel,
|
||||
const float i_PixelZ,
|
||||
const half3 i_PrimaryLightDirection
|
||||
)
|
||||
{
|
||||
half strength = i_NormalMapStrength;
|
||||
|
||||
if (saturate(i_Coverage - i_Determinant) > 0)
|
||||
{
|
||||
// Add boosted normal map.
|
||||
half3 normal = i_NormalWS;
|
||||
normal.xz += i_NormalMap * i_Strength;
|
||||
normal = normalize(normal);
|
||||
|
||||
// Increase normal map strength only if "sparkle".
|
||||
if (dot(normal, normalize(i_ViewDirectionWS + i_PrimaryLightDirection)) >= 0.99)
|
||||
{
|
||||
// Height (100m) & distance (2m) cull. Looks odd up close and degrades up high.
|
||||
const half cull = max(saturate(abs(_WorldSpaceCameraPos.y - i_WaterLevel) * 0.01), 1.0 - saturate(i_PixelZ * 0.5));
|
||||
strength = lerp(i_Strength, strength, cull);
|
||||
}
|
||||
}
|
||||
|
||||
return strength;
|
||||
}
|
||||
|
||||
void WaterNormal
|
||||
(
|
||||
const float2 i_WaterLevelDerivatives,
|
||||
@@ -106,22 +177,11 @@ void WaterNormal
|
||||
return;
|
||||
}
|
||||
|
||||
// Limit how close to horizontal reflection ray can get, useful to avoid unsightly below-horizon reflections.
|
||||
{
|
||||
float3 refl = reflect(-i_ViewDirectionWS, io_NormalWS);
|
||||
if (refl.y < i_MinimumReflectionDirectionY)
|
||||
{
|
||||
// Find the normal that keeps the reflection direction above the horizon. Compute
|
||||
// the reflection dir that does work, normalize it, and then normal is half vector
|
||||
// between this good reflection direction and view direction.
|
||||
float3 FL = refl;
|
||||
FL.y = i_MinimumReflectionDirectionY;
|
||||
FL = normalize(FL);
|
||||
io_NormalWS = normalize(FL + i_ViewDirectionWS);
|
||||
}
|
||||
}
|
||||
io_NormalWS = ApplyMinimumReflectionDirectionY(i_MinimumReflectionDirectionY, i_ViewDirectionWS, io_NormalWS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_CrestNameSpaceEnd
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,10 +6,16 @@
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Utility.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Helpers.hlsl"
|
||||
|
||||
float _Crest_ReflectionOverscan;
|
||||
float4 _Crest_ReflectionPositionNormal[2];
|
||||
Texture2DArray _Crest_ReflectionTexture;
|
||||
SamplerState sampler_Crest_ReflectionTexture;
|
||||
float4x4 _Crest_ReflectionMatrixIVP[2];
|
||||
float4x4 _Crest_ReflectionMatrixV[2];
|
||||
Texture2DArray _Crest_ReflectionColorTexture;
|
||||
SamplerState sampler_Crest_ReflectionColorTexture;
|
||||
Texture2DArray _Crest_ReflectionDepthTexture;
|
||||
SamplerState sampler_Crest_ReflectionDepthTexture;
|
||||
|
||||
m_CrestNameSpace
|
||||
|
||||
@@ -20,6 +26,8 @@ half4 PlanarReflection
|
||||
const half i_Intensity,
|
||||
const half i_Smoothness,
|
||||
const half i_Roughness,
|
||||
const half i_MinimumReflectionDirectionY,
|
||||
const float i_SurfaceDepth,
|
||||
const half3 i_NormalWS,
|
||||
const half i_NormalStrength,
|
||||
const half3 i_ViewDirectionWS,
|
||||
@@ -27,10 +35,18 @@ half4 PlanarReflection
|
||||
const bool i_Underwater
|
||||
)
|
||||
{
|
||||
const uint slice = i_Underwater ? 1 : 0;
|
||||
|
||||
half3 planeNormal = half3(0.0, i_Underwater ? -1.0 : 1.0, 0.0);
|
||||
half3 reflected = reflect(-i_ViewDirectionWS, lerp(planeNormal, i_NormalWS, i_NormalStrength));
|
||||
reflected.y = -reflected.y;
|
||||
|
||||
// Limit how close to horizontal reflection ray can get, useful to avoid unsightly below-horizon reflections.
|
||||
if (!i_Underwater)
|
||||
{
|
||||
reflected = ApplyMinimumReflectionDirectionY(i_MinimumReflectionDirectionY, i_ViewDirectionWS, reflected);
|
||||
}
|
||||
|
||||
float4 positionCS = mul(UNITY_MATRIX_VP, half4(reflected, 0.0));
|
||||
#if UNITY_UV_STARTS_AT_TOP
|
||||
positionCS.y = -positionCS.y;
|
||||
@@ -38,19 +54,39 @@ half4 PlanarReflection
|
||||
|
||||
float2 positionNDC = positionCS.xy * rcp(positionCS.w) * 0.5 + 0.5;
|
||||
|
||||
// Overscan.
|
||||
positionNDC.xy -= 0.5;
|
||||
positionNDC.xy *= _Crest_ReflectionOverscan;
|
||||
positionNDC.xy += 0.5;
|
||||
|
||||
// Cancel out distortion if out of bounds. We could make this nicer by doing an edge fade but the improvement is
|
||||
// barely noticeable. Edge fade requires recalculating the above a second time.
|
||||
if (i_Underwater)
|
||||
{
|
||||
float4 positionAndNormal = _Crest_ReflectionPositionNormal[i_Underwater];
|
||||
const float4 positionAndNormal = _Crest_ReflectionPositionNormal[slice];
|
||||
if (dot(positionNDC - positionAndNormal.xy, positionAndNormal.zw) < 0.0)
|
||||
{
|
||||
positionNDC = lerp(i_PositionNDC, positionNDC, 0.25);
|
||||
float2 ndc = i_PositionNDC;
|
||||
ndc.xy -= 0.5;
|
||||
ndc.xy *= _Crest_ReflectionOverscan;
|
||||
ndc.xy += 0.5;
|
||||
|
||||
positionNDC = lerp(ndc, positionNDC, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
const half roughness = PerceptualSmoothnessToPerceptualRoughness(i_Smoothness);
|
||||
const half level = PerceptualRoughnessToMipmapLevel(roughness, i_Roughness);
|
||||
half4 reflection = i_ReflectionsTexture.SampleLevel(sampler_Crest_ReflectionTexture, float3(positionNDC, i_Underwater), level);
|
||||
half4 reflection;
|
||||
|
||||
if (_Crest_PlanarReflectionsApplySmoothness)
|
||||
{
|
||||
const half roughness = PerceptualSmoothnessToPerceptualRoughness(i_Smoothness);
|
||||
half level = PerceptualRoughnessToMipmapLevel(roughness, i_Roughness);
|
||||
reflection = i_ReflectionsTexture.SampleLevel(sampler_Crest_ReflectionColorTexture, float3(positionNDC, i_Underwater), level);
|
||||
}
|
||||
else
|
||||
{
|
||||
reflection = i_ReflectionsTexture.SampleLevel(sampler_Crest_point_clamp, float3(positionNDC, i_Underwater), 0.0);
|
||||
}
|
||||
|
||||
// If more than four layers are used on the terrain, they will appear black if HDR
|
||||
// is enabled on the planar reflection camera. Alpha is probably a negative value.
|
||||
@@ -58,6 +94,21 @@ half4 PlanarReflection
|
||||
|
||||
reflection.a *= i_Intensity;
|
||||
|
||||
// Mitigate leaks.
|
||||
{
|
||||
// TODO: calculate linear depth from device depth directly. First attempt failed.
|
||||
// Most effective when surface is smooth due to mip-maps. Surprisingly effective
|
||||
// even when rough.
|
||||
const float rRawDepth = _Crest_ReflectionDepthTexture.SampleLevel(sampler_Crest_ReflectionDepthTexture, float3(positionNDC, i_Underwater), 0).r;
|
||||
const float3 rPositionWS = Utility::SafeComputeWorldSpacePosition(positionNDC, rRawDepth, _Crest_ReflectionMatrixIVP[slice]);
|
||||
const float rDepth = LinearEyeDepth(rPositionWS, _Crest_ReflectionMatrixV[slice]);
|
||||
|
||||
if (rRawDepth > 0.0 && rDepth <= i_SurfaceDepth)
|
||||
{
|
||||
reflection.a = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
return reflection;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#ifndef CREST_WATER_REFRACTION_H
|
||||
#define CREST_WATER_REFRACTION_H
|
||||
|
||||
#if !d_Crest_SimpleTransparency
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl"
|
||||
@@ -18,91 +20,144 @@
|
||||
#define FoveatedRemapLinearToNonUniform(uv) uv
|
||||
#endif
|
||||
|
||||
#if (UNITY_VERSION < 60000000) || !defined(CREST_URP)
|
||||
float4 _CameraDepthTexture_TexelSize;
|
||||
#endif
|
||||
|
||||
m_CrestNameSpace
|
||||
|
||||
float2 GetRefractionCoordinates(const half3 i_View, const half3 i_Normal, const float3 i_Position, const half i_IOR, const half i_Strength)
|
||||
{
|
||||
float3 position = i_Position;
|
||||
|
||||
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
|
||||
position -= _WorldSpaceCameraPos;
|
||||
#endif
|
||||
|
||||
const half3 ray = refract(-i_View, i_Normal, i_IOR) * i_Strength;
|
||||
float2 uv = ComputeNormalizedDeviceCoordinates(position + ray, UNITY_MATRIX_VP);
|
||||
|
||||
#if CREST_HDRP
|
||||
// Prevent artifacts at edge. Maybe because depth is an atlas for HDRP.
|
||||
uv = clamp(uv, _CameraDepthTexture_TexelSize.xy, 1.0 - _CameraDepthTexture_TexelSize.xy);
|
||||
#endif
|
||||
|
||||
return FoveatedRemapLinearToNonUniform(uv);
|
||||
}
|
||||
|
||||
// We take the unrefracted scene colour as input because having a Scene Colour node in the graph
|
||||
// appears to be necessary to ensure the scene colours are bound?
|
||||
void RefractedScene
|
||||
(
|
||||
const half i_RefractionStrength,
|
||||
const half i_AirIOR,
|
||||
const half i_WaterIOR,
|
||||
const half3 i_NormalWS,
|
||||
const float3 i_PositionWS,
|
||||
const float2 i_PositionNDC,
|
||||
const float4 i_ScreenPositionRaw,
|
||||
const float i_PixelZ,
|
||||
const half3 i_SceneColorUnrefracted,
|
||||
const half3 i_View,
|
||||
const float i_SceneZ,
|
||||
const float i_SceneZRaw,
|
||||
const float i_Scale,
|
||||
const float i_LodAlpha,
|
||||
const bool i_Underwater,
|
||||
const half i_TotalInternalReflectionIntensity,
|
||||
out half3 o_SceneColor,
|
||||
out float o_SceneDistance,
|
||||
out float3 o_ScenePositionWS,
|
||||
out float2 o_PositionSS,
|
||||
out bool o_Caustics
|
||||
)
|
||||
{
|
||||
float2 positionNDC = i_PositionNDC;
|
||||
float sceneDepthRaw = i_SceneZRaw;
|
||||
|
||||
o_Caustics = true;
|
||||
|
||||
// View ray intersects geometry surface either above or below water surface.
|
||||
float2 refractOffset = i_RefractionStrength * i_NormalWS.xz;
|
||||
if (!i_Underwater)
|
||||
half strength = i_RefractionStrength;
|
||||
|
||||
const half _AirToWaterRatio = i_AirIOR / i_WaterIOR;
|
||||
const half _WaterToAirRatio = i_WaterIOR / i_AirIOR;
|
||||
|
||||
// If no TIR, then use same IOR.
|
||||
const bool isA2WR = !i_Underwater || i_TotalInternalReflectionIntensity < 1.0;
|
||||
|
||||
const half eta = isA2WR ? _AirToWaterRatio : _WaterToAirRatio;
|
||||
|
||||
half3 normal = i_NormalWS;
|
||||
|
||||
// Exchanges accuracy for less artifacts.
|
||||
if (isA2WR)
|
||||
{
|
||||
// We're above the water, so behind interface is depth fog.
|
||||
refractOffset *= min(1.0, 0.5 * (i_SceneZ - i_PixelZ)) / i_SceneZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
// When looking up through water, full strength ends up being quite intense so reduce it a bunch.
|
||||
refractOffset *= 0.3;
|
||||
half multiplier = 0.0;
|
||||
|
||||
if (i_Underwater)
|
||||
{
|
||||
multiplier = 1.0;
|
||||
// Max fade when water is 5m deep.
|
||||
multiplier = saturate(g_Crest_WaterDepthAtViewer * 0.2);
|
||||
// Max fade by displacement.
|
||||
multiplier *= saturate(g_Crest_MaximumVerticalDisplacement - 1.0);
|
||||
// Fade towards screen edge where off screen samples happen. + n is fade start.
|
||||
multiplier *= saturate((dot(i_PositionNDC - 0.5, -g_Crest_HorizonNormal) + 0.5) * 2.0);
|
||||
}
|
||||
|
||||
normal.y *= multiplier;
|
||||
}
|
||||
|
||||
// Blend at the edge of the screen to avoid artifacts.
|
||||
refractOffset *= 1.0 - EdgeBlendingFactor(positionNDC, i_PixelZ);
|
||||
// Since we lose detail at a distance, boosting refraction helps visually.
|
||||
strength *= lerp(i_Scale, i_Scale * 2.0, i_LodAlpha) * 0.25;
|
||||
|
||||
const float2 positionNDCRefracted = FoveatedRemapLinearToNonUniform(positionNDC + refractOffset);
|
||||
float sceneDepthRawRefracted = SHADERGRAPH_SAMPLE_SCENE_DEPTH(positionNDCRefracted);
|
||||
// Restrict to a reasonable maximum.
|
||||
strength = min(strength, i_RefractionStrength * 4.0);
|
||||
|
||||
float2 uv = GetRefractionCoordinates(i_View, normal, i_PositionWS, eta, strength);
|
||||
|
||||
o_PositionSS = min(uv * _ScreenSize.xy, _ScreenSize.xy - 1.0);
|
||||
|
||||
#if CREST_BIRP
|
||||
float deviceDepth = LoadSceneDepth(o_PositionSS);
|
||||
#else
|
||||
float deviceDepth = SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv);
|
||||
#endif
|
||||
|
||||
#if (CREST_PORTALS != 0)
|
||||
#if _ALPHATEST_ON
|
||||
// Portals
|
||||
Portal::EvaluateRefraction(positionNDCRefracted, i_SceneZRaw, i_Underwater, sceneDepthRawRefracted, o_Caustics);
|
||||
Portal::EvaluateRefraction(uv, i_SceneZRaw, i_Underwater, deviceDepth, o_Caustics);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
float linearDepth = Utility::CrestLinearEyeDepth(deviceDepth);
|
||||
float depthDifference = linearDepth - i_PixelZ;
|
||||
|
||||
const float sceneZRefract = Utility::CrestLinearEyeDepth(sceneDepthRawRefracted);
|
||||
normal *= saturate(depthDifference);
|
||||
|
||||
// Depth fog & caustics - only if view ray starts from above water.
|
||||
// Compute depth fog alpha based on refracted position if it landed on an
|
||||
// underwater surface, or on unrefracted depth otherwise.
|
||||
if (sceneZRefract > i_PixelZ)
|
||||
{
|
||||
// Refracted.
|
||||
o_SceneDistance = sceneZRefract - i_PixelZ;
|
||||
o_SceneColor = SHADERGRAPH_SAMPLE_SCENE_COLOR(positionNDCRefracted);
|
||||
uv = GetRefractionCoordinates(i_View, normal, i_PositionWS, eta, strength);
|
||||
|
||||
positionNDC = positionNDCRefracted;
|
||||
sceneDepthRaw = sceneDepthRawRefracted;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unrefracted.
|
||||
// It seems that when MSAA is enabled this can sometimes be negative.
|
||||
o_SceneDistance = max(i_SceneZ - i_PixelZ, 0.0);
|
||||
o_SceneColor = i_SceneColorUnrefracted;
|
||||
o_PositionSS = min(uv * _ScreenSize.xy, _ScreenSize.xy - 1.0);
|
||||
|
||||
// NOTE: Causes refraction artifact with caustics. Cannot remember exactly why this was added.
|
||||
// o_Caustics = false;
|
||||
positionNDC = FoveatedRemapLinearToNonUniform(positionNDC);
|
||||
}
|
||||
#if CREST_BIRP
|
||||
deviceDepth = LoadSceneDepth(o_PositionSS);
|
||||
#else
|
||||
deviceDepth = SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv);
|
||||
#endif
|
||||
|
||||
if (i_Underwater)
|
||||
{
|
||||
// Depth fog is handled by underwater shader.
|
||||
o_SceneDistance = i_PixelZ;
|
||||
}
|
||||
linearDepth = Utility::CrestLinearEyeDepth(deviceDepth);
|
||||
// It seems that when MSAA is enabled this can sometimes be negative.
|
||||
depthDifference = max(linearDepth - i_PixelZ, 0.0);
|
||||
|
||||
o_ScenePositionWS = ComputeWorldSpacePosition(positionNDC, sceneDepthRaw, UNITY_MATRIX_I_VP);
|
||||
#if CREST_BIRP
|
||||
// Sampling artifacts which manifest as a fine outline around refractions. Always
|
||||
// affects BIRP unless we use Load. Does not affect URP unless downsampling or MSAA
|
||||
// is used, but Load exposes us to RT scaling. Best to use Sample with HDRP too.
|
||||
o_SceneColor = LoadSceneColor(o_PositionSS).rgb;
|
||||
#else
|
||||
// Sampling artifacts if downsampling or MSAA used. Load does not help. And we get
|
||||
// outlines around all objects irrespective of refraction.
|
||||
o_SceneColor = SHADERGRAPH_SAMPLE_SCENE_COLOR(uv).rgb;
|
||||
#endif
|
||||
|
||||
o_SceneDistance = depthDifference;
|
||||
o_ScenePositionWS = ComputeWorldSpacePosition(uv, deviceDepth, UNITY_MATRIX_I_VP);
|
||||
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
|
||||
o_ScenePositionWS += _WorldSpaceCameraPos;
|
||||
#endif
|
||||
@@ -111,3 +166,4 @@ void RefractedScene
|
||||
m_CrestNameSpaceEnd
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -58,4 +58,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(CREST_HDRP) && (SHADERPASS == SHADERPASS_MOTION_VECTORS)
|
||||
#define _TRANSPARENT_WRITES_MOTION_VEC
|
||||
#endif
|
||||
|
||||
#endif // CREST_SHADERGRAPH_CONSTANTS_H
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef SHADERGRAPH_PREVIEW
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Shim.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Surface/Keywords.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Macros.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Globals.hlsl"
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/InputsDriven.hlsl"
|
||||
@@ -29,13 +30,7 @@
|
||||
|
||||
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl"
|
||||
|
||||
#ifndef CREST_HDRP
|
||||
#if (SHADERPASS == SHADERPASS_MOTION_VECTORS)
|
||||
#define _TRANSPARENT_WRITES_MOTION_VEC 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if _TRANSPARENT_WRITES_MOTION_VEC
|
||||
#if d_Crest_MotionVectors
|
||||
#define m_Slice clamp((int)_Crest_LodIndex + (isMotionVectors ? g_Crest_LodChange : 0), 0, g_Crest_LodCount)
|
||||
#define m_Make(slice) Make(slice, isMotionVectors)
|
||||
#else
|
||||
@@ -50,12 +45,14 @@ void Vertex(m_Properties)
|
||||
// This will get called twice.
|
||||
// With current and previous time respectively.
|
||||
|
||||
o_UndisplacedXZ = 0.0;
|
||||
o_PositionWS = i_PositionWS;
|
||||
o_UndisplacedXZ = i_PositionWS.xz;
|
||||
o_LodAlpha = 0.0;
|
||||
o_WaterLevelOffset = 0.0;
|
||||
o_WaterLevelDerivatives = 0.0;
|
||||
o_Flow = 0.0;
|
||||
|
||||
#if !d_Crest_CustomMesh
|
||||
const bool isMotionVectors = i_Time < _Time.y;
|
||||
|
||||
const float slice0 = m_Slice;
|
||||
@@ -63,8 +60,6 @@ void Vertex(m_Properties)
|
||||
const Cascade cascade0 = Cascade::m_Make(slice0);
|
||||
const Cascade cascade1 = Cascade::m_Make(slice1);
|
||||
|
||||
o_PositionWS = i_PositionWS;
|
||||
|
||||
// Vertex snapping and LOD transition.
|
||||
SnapAndTransitionVertLayout
|
||||
(
|
||||
@@ -99,48 +94,48 @@ void Vertex(m_Properties)
|
||||
// Data that needs to be sampled at the undisplaced position.
|
||||
if (weight0 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
#if _TRANSPARENT_WRITES_MOTION_VEC
|
||||
#if d_Crest_MotionVectors
|
||||
if (isMotionVectors)
|
||||
{
|
||||
Cascade::MakeAnimatedWavesSource(slice0).SampleDisplacement(o_UndisplacedXZ, weight0, o_PositionWS, o_WaterLevelDerivatives);
|
||||
Cascade::MakeAnimatedWavesSource(slice0).SampleDisplacement(o_UndisplacedXZ, weight0, o_PositionWS, o_WaterLevelDerivatives, o_WaterLevelOffset);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Cascade::MakeAnimatedWaves(slice0).SampleDisplacement(o_UndisplacedXZ, weight0, o_PositionWS, o_WaterLevelDerivatives);
|
||||
Cascade::MakeAnimatedWaves(slice0).SampleDisplacement(o_UndisplacedXZ, weight0, o_PositionWS, o_WaterLevelDerivatives, o_WaterLevelOffset);
|
||||
}
|
||||
}
|
||||
|
||||
if (weight1 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
#if _TRANSPARENT_WRITES_MOTION_VEC
|
||||
#if d_Crest_MotionVectors
|
||||
if (isMotionVectors)
|
||||
{
|
||||
Cascade::MakeAnimatedWavesSource(slice1).SampleDisplacement(o_UndisplacedXZ, weight1, o_PositionWS, o_WaterLevelDerivatives);
|
||||
Cascade::MakeAnimatedWavesSource(slice1).SampleDisplacement(o_UndisplacedXZ, weight1, o_PositionWS, o_WaterLevelDerivatives, o_WaterLevelOffset);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Cascade::MakeAnimatedWaves(slice1).SampleDisplacement(o_UndisplacedXZ, weight1, o_PositionWS, o_WaterLevelDerivatives);
|
||||
Cascade::MakeAnimatedWaves(slice1).SampleDisplacement(o_UndisplacedXZ, weight1, o_PositionWS, o_WaterLevelDerivatives, o_WaterLevelOffset);
|
||||
}
|
||||
}
|
||||
|
||||
// Data that needs to be sampled at the displaced position.
|
||||
if (weight0 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
#if CREST_FLOW_ON
|
||||
#if d_Crest_FlowLod
|
||||
Cascade::MakeFlow(slice0).SampleFlow(o_UndisplacedXZ, weight0, o_Flow);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (weight1 > m_CrestSampleLodThreshold)
|
||||
{
|
||||
#if CREST_FLOW_ON
|
||||
#if d_Crest_FlowLod
|
||||
Cascade::MakeFlow(slice1).SampleFlow(o_UndisplacedXZ, weight1, o_Flow);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if _TRANSPARENT_WRITES_MOTION_VEC
|
||||
#if d_Crest_MotionVectors
|
||||
if (isMotionVectors)
|
||||
{
|
||||
o_PositionWS.xz -= g_Crest_WaterCenter.xz;
|
||||
@@ -149,6 +144,7 @@ void Vertex(m_Properties)
|
||||
o_PositionWS.xz += g_Crest_WaterCenterDelta;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
m_CrestNameSpaceEnd
|
||||
|
||||
@@ -179,11 +179,62 @@
|
||||
},
|
||||
{
|
||||
"m_Id": "e4a54526c6204b5badd66e158dcf0b1d"
|
||||
},
|
||||
{
|
||||
"m_Id": "eb89085b4d7c46c7bf82f63a3b43a0c6"
|
||||
},
|
||||
{
|
||||
"m_Id": "a12a11f74d174f1d8a63d18ee8743b25"
|
||||
},
|
||||
{
|
||||
"m_Id": "9f311e65704646e48b52019d389d3cd0"
|
||||
},
|
||||
{
|
||||
"m_Id": "d209a2766f5546688fe4bc92416cd548"
|
||||
},
|
||||
{
|
||||
"m_Id": "8ec616eaa4964d38b92b904775e34f7e"
|
||||
},
|
||||
{
|
||||
"m_Id": "feb1793feb264a239de366d730977489"
|
||||
},
|
||||
{
|
||||
"m_Id": "cc11871fc2f74ea2821e2c9f78d3d58e"
|
||||
},
|
||||
{
|
||||
"m_Id": "a485464528a74269852b53d441f1f0a8"
|
||||
},
|
||||
{
|
||||
"m_Id": "bc35f605d4fc49869c24479f827fbfa8"
|
||||
},
|
||||
{
|
||||
"m_Id": "dd752976323845b0aad610adb0672e38"
|
||||
},
|
||||
{
|
||||
"m_Id": "8c45cfde06fb4d5ca12db7bcfa8f6316"
|
||||
},
|
||||
{
|
||||
"m_Id": "30ad385314c946f5a3cbd7adefe9c270"
|
||||
},
|
||||
{
|
||||
"m_Id": "c06c8782d1b742d189925deba54c21bc"
|
||||
},
|
||||
{
|
||||
"m_Id": "38e9cee298f8483e8ca80e75574c2175"
|
||||
},
|
||||
{
|
||||
"m_Id": "4a21e5afa49f40d38aef98a49226fa6e"
|
||||
},
|
||||
{
|
||||
"m_Id": "a6704108884e487799aa5f653566e56b"
|
||||
}
|
||||
],
|
||||
"m_Keywords": [
|
||||
{
|
||||
"m_Id": "b91141f3e4cf4131ab732e6ae5828231"
|
||||
},
|
||||
{
|
||||
"m_Id": "ada9e52f38cd4e66a4e97c1fd2a5bd65"
|
||||
}
|
||||
],
|
||||
"m_Dropdowns": [],
|
||||
@@ -203,6 +254,12 @@
|
||||
{
|
||||
"m_Id": "9475b0c108bc456eb09f35111542022b"
|
||||
},
|
||||
{
|
||||
"m_Id": "72dfddd5562c42e4bf73f41a47cd4863"
|
||||
},
|
||||
{
|
||||
"m_Id": "0c1d5d0d16af4922b19d366983ea194e"
|
||||
},
|
||||
{
|
||||
"m_Id": "330cb63ecb704ddebac4935cb0b85ab7"
|
||||
},
|
||||
@@ -212,6 +269,9 @@
|
||||
{
|
||||
"m_Id": "76dfbf9d02da4e2b9a7cffa11a17b81d"
|
||||
},
|
||||
{
|
||||
"m_Id": "475b6b25b79b44d19bf94d0af92bc9a1"
|
||||
},
|
||||
{
|
||||
"m_Id": "76a4c02b522d4e1d84eca095e84b1f30"
|
||||
},
|
||||
@@ -220,6 +280,9 @@
|
||||
},
|
||||
{
|
||||
"m_Id": "d65753c4eac547c5a73c35da6956d9e2"
|
||||
},
|
||||
{
|
||||
"m_Id": "9125a3c8387e4d38987cc5707394b95b"
|
||||
}
|
||||
],
|
||||
"m_Nodes": [
|
||||
@@ -850,15 +913,15 @@
|
||||
{
|
||||
"m_Id": "b7891fe7e5a34f03adebd8a45505c5fc"
|
||||
},
|
||||
{
|
||||
"m_Id": "8e8aee51883445f1b08bfbec696cb18d"
|
||||
},
|
||||
{
|
||||
"m_Id": "e207931e020242bba83058a59f3fb07d"
|
||||
},
|
||||
{
|
||||
"m_Id": "01717f91918a4191a16ca9eb0a394f85"
|
||||
},
|
||||
{
|
||||
"m_Id": "8e8aee51883445f1b08bfbec696cb18d"
|
||||
},
|
||||
{
|
||||
"m_Id": "641a42645cc2483bb33d553093357479"
|
||||
},
|
||||
@@ -1210,6 +1273,30 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
"m_ObjectId": "0c1d5d0d16af4922b19d366983ea194e",
|
||||
"m_Name": "Reflections (Planar)",
|
||||
"m_ChildObjectList": [
|
||||
{
|
||||
"m_Id": "d6af4ca8280b4d56b6f2bf1c8b7a0bbd"
|
||||
},
|
||||
{
|
||||
"m_Id": "2d31998b356d41179aa5291dcedc7850"
|
||||
},
|
||||
{
|
||||
"m_Id": "eb89085b4d7c46c7bf82f63a3b43a0c6"
|
||||
},
|
||||
{
|
||||
"m_Id": "0d81099c729342968bf4ee002d378dcf"
|
||||
},
|
||||
{
|
||||
"m_Id": "e632a014145542d8a0f6bad7aac6cb63"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
@@ -1884,6 +1971,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty",
|
||||
"m_ObjectId": "30ad385314c946f5a3cbd7adefe9c270",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "23c5d086-28d3-4f64-a7c7-b7bec078341f"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Enabled",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Enabled",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Enabled",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceEnabled",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": false
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
@@ -1892,12 +2002,6 @@
|
||||
"m_ChildObjectList": [
|
||||
{
|
||||
"m_Id": "14f5135a4bf8f5868cb55001b6472657"
|
||||
},
|
||||
{
|
||||
"m_Id": "bbd2579dfd7f38879fab18706b09b5fb"
|
||||
},
|
||||
{
|
||||
"m_Id": "d33c23a144f9400888ebc0b17741ceea"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1923,6 +2027,34 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "38e9cee298f8483e8ca80e75574c2175",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "eb0230f0-4d3b-4348-b7af-d0c613693fbe"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Intensity",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Intensity",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Intensity",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceIntensity",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 1.0,
|
||||
"m_FloatType": 0,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
@@ -1961,6 +2093,15 @@
|
||||
},
|
||||
{
|
||||
"m_Id": "e608dd8f43794f5d8b3995446b21467f"
|
||||
},
|
||||
{
|
||||
"m_Id": "a12a11f74d174f1d8a63d18ee8743b25"
|
||||
},
|
||||
{
|
||||
"m_Id": "9f311e65704646e48b52019d389d3cd0"
|
||||
},
|
||||
{
|
||||
"m_Id": "d209a2766f5546688fe4bc92416cd548"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2238,6 +2379,45 @@
|
||||
"m_PositionSource": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
"m_ObjectId": "475b6b25b79b44d19bf94d0af92bc9a1",
|
||||
"m_Name": "Bioluminescence",
|
||||
"m_ChildObjectList": [
|
||||
{
|
||||
"m_Id": "30ad385314c946f5a3cbd7adefe9c270"
|
||||
},
|
||||
{
|
||||
"m_Id": "feb1793feb264a239de366d730977489"
|
||||
},
|
||||
{
|
||||
"m_Id": "38e9cee298f8483e8ca80e75574c2175"
|
||||
},
|
||||
{
|
||||
"m_Id": "8c45cfde06fb4d5ca12db7bcfa8f6316"
|
||||
},
|
||||
{
|
||||
"m_Id": "4a21e5afa49f40d38aef98a49226fa6e"
|
||||
},
|
||||
{
|
||||
"m_Id": "cc11871fc2f74ea2821e2c9f78d3d58e"
|
||||
},
|
||||
{
|
||||
"m_Id": "c06c8782d1b742d189925deba54c21bc"
|
||||
},
|
||||
{
|
||||
"m_Id": "dd752976323845b0aad610adb0672e38"
|
||||
},
|
||||
{
|
||||
"m_Id": "a485464528a74269852b53d441f1f0a8"
|
||||
},
|
||||
{
|
||||
"m_Id": "bc35f605d4fc49869c24479f827fbfa8"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
|
||||
@@ -2284,6 +2464,29 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty",
|
||||
"m_ObjectId": "4a21e5afa49f40d38aef98a49226fa6e",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "b17934e1-f74e-4c4b-8313-3f5274067918"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Sea Level Only",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Sea Level Only",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Sea_Level_Only",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceSeaLevelOnly",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": true
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
@@ -3368,7 +3571,7 @@
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 0.03,
|
||||
"m_Value": 0.0,
|
||||
"m_FloatType": 1,
|
||||
"m_RangeValues": {
|
||||
"x": -1.0,
|
||||
@@ -3399,6 +3602,24 @@
|
||||
"m_Value": false
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
"m_ObjectId": "72dfddd5562c42e4bf73f41a47cd4863",
|
||||
"m_Name": "Reflections (Underwater)",
|
||||
"m_ChildObjectList": [
|
||||
{
|
||||
"m_Id": "21db17a76f094b19ba523148b6f7aa41"
|
||||
},
|
||||
{
|
||||
"m_Id": "bbd2579dfd7f38879fab18706b09b5fb"
|
||||
},
|
||||
{
|
||||
"m_Id": "d33c23a144f9400888ebc0b17741ceea"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
@@ -3444,6 +3665,9 @@
|
||||
{
|
||||
"m_Id": "91e9a577d315a3848dfb1f48a6743f9c"
|
||||
},
|
||||
{
|
||||
"m_Id": "a6704108884e487799aa5f653566e56b"
|
||||
},
|
||||
{
|
||||
"m_Id": "4b09daebd022cf89bc77ad473c95586c"
|
||||
},
|
||||
@@ -3996,6 +4220,34 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "8c45cfde06fb4d5ca12db7bcfa8f6316",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "c201c2da-d89e-4a7b-bc1f-358cac6ea74e"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Maximum Depth",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Maximum Depth",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Maximum_Depth",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceMaximumDepth",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": Infinity,
|
||||
"m_FloatType": 0,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
|
||||
@@ -4053,6 +4305,34 @@
|
||||
"m_SerializedDescriptor": "SurfaceDescription.Metallic"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "8ec616eaa4964d38b92b904775e34f7e",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "025be3df-ddb1-4553-894c-4cbcafe64fda"
|
||||
},
|
||||
"m_Name": "Transparency Minimum Alpha",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Transparency Minimum Alpha",
|
||||
"m_DefaultReferenceName": "_Transparency_Minimum_Alpha",
|
||||
"m_OverrideReferenceName": "_Crest_TransparencyMinimumAlpha",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 0.95,
|
||||
"m_FloatType": 1,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
@@ -4108,6 +4388,18 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
"m_ObjectId": "9125a3c8387e4d38987cc5707394b95b",
|
||||
"m_Name": "Simple Transparency",
|
||||
"m_ChildObjectList": [
|
||||
{
|
||||
"m_Id": "8ec616eaa4964d38b92b904775e34f7e"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
|
||||
@@ -4243,9 +4535,6 @@
|
||||
{
|
||||
"m_Id": "c700bce5ef10cf8e9e5b69ba043d383b"
|
||||
},
|
||||
{
|
||||
"m_Id": "21db17a76f094b19ba523148b6f7aa41"
|
||||
},
|
||||
{
|
||||
"m_Id": "7b2f0f23d232ab88bcacd3e88392015a"
|
||||
},
|
||||
@@ -4260,18 +4549,6 @@
|
||||
},
|
||||
{
|
||||
"m_Id": "71f6994de656018baa684da1128e623c"
|
||||
},
|
||||
{
|
||||
"m_Id": "d6af4ca8280b4d56b6f2bf1c8b7a0bbd"
|
||||
},
|
||||
{
|
||||
"m_Id": "2d31998b356d41179aa5291dcedc7850"
|
||||
},
|
||||
{
|
||||
"m_Id": "0d81099c729342968bf4ee002d378dcf"
|
||||
},
|
||||
{
|
||||
"m_Id": "e632a014145542d8a0f6bad7aac6cb63"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4447,6 +4724,34 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "9f311e65704646e48b52019d389d3cd0",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "04aa688a-8387-4eda-bda1-edead599c4f0"
|
||||
},
|
||||
"m_Name": "Normal Map Turbulence Strength",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Normal Map Turbulence Strength",
|
||||
"m_DefaultReferenceName": "_Normal_Map_Turbulence_Strength",
|
||||
"m_OverrideReferenceName": "_Crest_NormalMapTurbulenceStrength",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 0.6,
|
||||
"m_FloatType": 1,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
|
||||
@@ -4477,6 +4782,29 @@
|
||||
"m_DefaultType": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty",
|
||||
"m_ObjectId": "a12a11f74d174f1d8a63d18ee8743b25",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "709317fe-af13-425b-90cf-63507779f13c"
|
||||
},
|
||||
"m_Name": "Normal Map Turbulence Enabled",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Normal Map Turbulence Enabled",
|
||||
"m_DefaultReferenceName": "_Normal_Map_Turbulence_Enabled",
|
||||
"m_OverrideReferenceName": "_Crest_NormalMapTurbulenceEnabled",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": true
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
@@ -4602,6 +4930,34 @@
|
||||
"m_FunctionBody": "Enter function body here..."
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "a485464528a74269852b53d441f1f0a8",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "dbd6fa2d-e2ba-4ea9-b67c-e21877462ec6"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Sparkles Intensity",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Sparkles Intensity",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Sparkles_Intensity",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceSparklesIntensity",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 500.0,
|
||||
"m_FloatType": 0,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 2,
|
||||
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget",
|
||||
@@ -4670,6 +5026,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty",
|
||||
"m_ObjectId": "a6704108884e487799aa5f653566e56b",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "c4fdecae-cdbb-4529-8ad0-3ef2226477a5"
|
||||
},
|
||||
"m_Name": "Caustics Force Distortion",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Caustics Force Distortion",
|
||||
"m_DefaultReferenceName": "_Caustics_Force_Distortion",
|
||||
"m_OverrideReferenceName": "_Crest_CausticsForceDistortion",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": false
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ViewDirectionNode",
|
||||
@@ -4809,6 +5188,9 @@
|
||||
},
|
||||
{
|
||||
"m_Id": "aa75e7087fa330809fdc753edcd8995b"
|
||||
},
|
||||
{
|
||||
"m_Id": "ada9e52f38cd4e66a4e97c1fd2a5bd65"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4879,6 +5261,31 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ShaderKeyword",
|
||||
"m_ObjectId": "ada9e52f38cd4e66a4e97c1fd2a5bd65",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "787edb3a-324f-493b-b3da-febad061005c"
|
||||
},
|
||||
"m_Name": "Custom Mesh",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Custom Mesh",
|
||||
"m_DefaultReferenceName": "_CUSTOM_MESH",
|
||||
"m_OverrideReferenceName": "_CREST_CUSTOM_MESH",
|
||||
"m_GeneratePropertyBlock": false,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_KeywordType": 0,
|
||||
"m_KeywordDefinition": 1,
|
||||
"m_KeywordScope": 0,
|
||||
"m_KeywordStages": 63,
|
||||
"m_Entries": [],
|
||||
"m_Value": 0,
|
||||
"m_IsEditable": true
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
|
||||
@@ -5043,7 +5450,7 @@
|
||||
"m_DefaultRefNameVersion": 0,
|
||||
"m_RefNameGeneratedByDisplayName": "",
|
||||
"m_DefaultReferenceName": "BOOLEAN_547DED44_ON",
|
||||
"m_OverrideReferenceName": "CREST_FLOW_ON",
|
||||
"m_OverrideReferenceName": "_CREST_FLOW_LOD",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
@@ -5140,6 +5547,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "bc35f605d4fc49869c24479f827fbfa8",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "be221cdb-d9a6-46a9-8e5c-899bb77b9ba5"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Sparkles Coverage",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Sparkles Coverage",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Sparkles_Coverage",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceSparklesCoverage",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 0.5,
|
||||
"m_FloatType": 1,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty",
|
||||
@@ -5191,6 +5626,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "c06c8782d1b742d189925deba54c21bc",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "ed5634bc-281c-4def-8a6e-9956331f4a20"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Glow Coverage",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Glow Coverage",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Glow_Coverage",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceGlowCoverage",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 0.4,
|
||||
"m_FloatType": 1,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
|
||||
@@ -5344,6 +5807,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "cc11871fc2f74ea2821e2c9f78d3d58e",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "db78df35-c8ae-45f7-b19b-6873133e270d"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Glow Intensity",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Glow Intensity",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Glow_Intensity",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceGlowIntensity",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 0.7,
|
||||
"m_FloatType": 1,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ObjectNode",
|
||||
@@ -5506,6 +5997,34 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "d209a2766f5546688fe4bc92416cd548",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "187a910c-bd28-405b-b1e4-f495ca40e9f9"
|
||||
},
|
||||
"m_Name": "Normal Map Turbulence Coverage",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Normal Map Turbulence Coverage",
|
||||
"m_DefaultReferenceName": "_Normal_Map_Turbulence_Coverage",
|
||||
"m_OverrideReferenceName": "_Crest_NormalMapTurbulenceCoverage",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 0.8999999761581421,
|
||||
"m_FloatType": 1,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
@@ -5838,6 +6357,29 @@
|
||||
"m_DefaultValue": true
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty",
|
||||
"m_ObjectId": "dd752976323845b0aad610adb0672e38",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "4f72390b-2958-4755-9633-fdce875f1c0e"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Sparkles Enabled",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Sparkles Enabled",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Sparkles_Enabled",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceSparklesEnabled",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": true
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
@@ -6033,6 +6575,29 @@
|
||||
"m_Space": 2
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty",
|
||||
"m_ObjectId": "eb89085b4d7c46c7bf82f63a3b43a0c6",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "bdc2d1fe-238b-4105-83e0-87f8ef392283"
|
||||
},
|
||||
"m_Name": "Planar Reflections Apply Smoothness",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Planar Reflections Apply Smoothness",
|
||||
"m_DefaultReferenceName": "_Planar_Reflections_Apply_Smoothness",
|
||||
"m_OverrideReferenceName": "_Crest_PlanarReflectionsApplySmoothness",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": false
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
|
||||
@@ -6345,6 +6910,36 @@
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 3,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty",
|
||||
"m_ObjectId": "feb1793feb264a239de366d730977489",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "87224bff-8cf6-4adb-83d2-8ec6ed30c979"
|
||||
},
|
||||
"m_Name": "Foam Bioluminescence Color",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Foam Bioluminescence Color",
|
||||
"m_DefaultReferenceName": "_Foam_Bioluminescence_Color",
|
||||
"m_OverrideReferenceName": "_Crest_FoamBioluminescenceColor",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": {
|
||||
"r": 0.0,
|
||||
"g": 1.55,
|
||||
"b": 6.0,
|
||||
"a": 1.0
|
||||
},
|
||||
"isMainColor": false,
|
||||
"m_ColorMode": 1
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
|
||||
Reference in New Issue
Block a user