rabidus-test/Assets/Vefects/Free Fire HDRP/Shaders/SH_Vefects_VFX_Particles_Er...

2905 lines
128 KiB
GLSL

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Vefects/SH_Vefects_VFX_Particles_Erosion"
{
Properties
{
[HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
[ASEBegin]_Noise_01_Texture("Noise_01_Texture", 2D) = "white" {}
_Noise_02_Texture("Noise_02_Texture", 2D) = "white" {}
_MaskTexture("Mask Texture", 2D) = "white" {}
_MaskMoveTexture("Mask Move Texture", 2D) = "white" {}
_Color("Color", Color) = (1,1,1,0)
_NoiseDistortionTexture("Noise Distortion Texture", 2D) = "white" {}
_Noise01Scale("Noise 01 Scale", Vector) = (0.8,0.8,0,0)
_Noise02Scale("Noise 02 Scale", Vector) = (1,1,0,0)
_CameraOffset("Camera Offset", Float) = 0
_NoiseDistortionScale("Noise Distortion Scale", Vector) = (1,1,0,0)
_Noise01Speed("Noise 01 Speed", Vector) = (0.5,0.5,0,0)
_Noise02Speed("Noise 02 Speed", Vector) = (-0.2,0.4,0,0)
_MaskMoveScale("Mask Move Scale", Vector) = (1,1,0,0)
_MaskScale("Mask Scale", Vector) = (1,1,0,0)
_MaskOffset("Mask Offset", Vector) = (0,0,0,0)
_NoiseDistortionSpeed("Noise Distortion Speed", Vector) = (0.2,0.25,0,0)
_MaskMultiply("Mask Multiply", Float) = 1
_MaskMoveMultiply("Mask Move Multiply", Float) = 1
_NoisesMultiply("Noises Multiply", Float) = 1
_MaskPower("Mask Power", Float) = 1
_NoisesPower("Noises Power", Float) = 1
_MaskMovePower("Mask Move Power", Float) = 1
_Distortion("Distortion", Float) = 1
_DistortionIntensity("Distortion Intensity", Float) = 0
_OpacityBoost("Opacity Boost", Float) = 5
_DepthFade("Depth Fade", Float) = 1
_EmissionIntensity("Emission Intensity", Float) = 1
_WindSpeed("Wind Speed", Float) = 1
_MaskSpeed("Mask Speed", Float) = 0
[ASEEnd]_Dissolve("Dissolve", Float) = 0
[HideInInspector]_RenderQueueType("Render Queue Type", Float) = 1
[HideInInspector][ToggleUI]_AddPrecomputedVelocity("Add Precomputed Velocity", Float) = 1
//[HideInInspector]_ShadowMatteFilter("Shadow Matte Filter", Float) = 2
[HideInInspector]_StencilRef("Stencil Ref", Int) = 0
[HideInInspector]_StencilWriteMask("StencilWrite Mask", Int) = 6
[HideInInspector]_StencilRefDepth("StencilRefDepth", Int) = 0
[HideInInspector]_StencilWriteMaskDepth("_StencilWriteMaskDepth", Int) = 8
[HideInInspector]_StencilRefMV("_StencilRefMV", Int) = 32
[HideInInspector]_StencilWriteMaskMV("_StencilWriteMaskMV", Int) = 40
[HideInInspector]_StencilRefDistortionVec("_StencilRefDistortionVec", Int) = 4
[HideInInspector]_StencilWriteMaskDistortionVec("_StencilWriteMaskDistortionVec", Int) = 4
[HideInInspector]_StencilWriteMaskGBuffer("_StencilWriteMaskGBuffer", Int) = 14
[HideInInspector]_StencilRefGBuffer("_StencilRefGBuffer", Int) = 2
[HideInInspector]_ZTestGBuffer("_ZTestGBuffer", Int) = 4
[HideInInspector][ToggleUI]_RequireSplitLighting("_RequireSplitLighting", Float) = 0
[HideInInspector][ToggleUI]_ReceivesSSR("_ReceivesSSR", Float) = 0
[HideInInspector]_SurfaceType("_SurfaceType", Float) = 0
[HideInInspector]_BlendMode("_BlendMode", Float) = 0
[HideInInspector]_SrcBlend("_SrcBlend", Float) = 1
[HideInInspector]_DstBlend("_DstBlend", Float) = 0
[HideInInspector]_AlphaSrcBlend("Vec_AlphaSrcBlendtor1", Float) = 1
[HideInInspector]_AlphaDstBlend("_AlphaDstBlend", Float) = 0
[HideInInspector][ToggleUI]_ZWrite("_ZWrite", Float) = 1
[HideInInspector][ToggleUI]_TransparentZWrite("_TransparentZWrite", Float) = 1
[HideInInspector]_CullMode("Cull Mode", Float) = 2
[HideInInspector]_TransparentSortPriority("_TransparentSortPriority", Int) = 0
[HideInInspector][ToggleUI]_EnableFogOnTransparent("_EnableFogOnTransparent", Float) = 1
[HideInInspector]_CullModeForward("_CullModeForward", Float) = 2
[HideInInspector][Enum(Front, 1, Back, 2)]_TransparentCullMode("_TransparentCullMode", Float) = 2
[HideInInspector]_ZTestDepthEqualForOpaque("_ZTestDepthEqualForOpaque", Int) = 4
[HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)]_ZTestTransparent("_ZTestTransparent", Float) = 4
[HideInInspector][ToggleUI]_TransparentBackfaceEnable("_TransparentBackfaceEnable", Float) = 0
[HideInInspector][ToggleUI]_AlphaCutoffEnable("_AlphaCutoffEnable", Float) = 0
[HideInInspector][ToggleUI]_UseShadowThreshold("_UseShadowThreshold", Float) = 0
[HideInInspector][ToggleUI]_DoubleSidedEnable("_DoubleSidedEnable", Float) = 0
[HideInInspector][Enum(Flip, 0, Mirror, 1, None, 2)]_DoubleSidedNormalMode("_DoubleSidedNormalMode", Float) = 2
[HideInInspector]_DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)
[HideInInspector]_DistortionEnable("_DistortionEnable",Float) = 0
[HideInInspector]_DistortionOnly("_DistortionOnly",Float) = 0
//_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5
//_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
//_TessMin( "Tess Min Distance", Float ) = 10
//_TessMax( "Tess Max Distance", Float ) = 25
//_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16
//_TessMaxDisp( "Tess Max Displacement", Float ) = 25
}
SubShader
{
LOD 0
Tags { "RenderPipeline"="HDRenderPipeline" "RenderType"="TransparentCutout" "Queue"="Transparent" }
HLSLINCLUDE
#pragma target 4.5
#pragma only_renderers d3d11 metal vulkan xboxone xboxseries playstation switch
#pragma instancing_options renderinglayer
#ifndef ASE_TESS_FUNCS
#define ASE_TESS_FUNCS
float4 FixedTess( float tessValue )
{
return tessValue;
}
float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
{
float3 wpos = mul(o2w,vertex).xyz;
float dist = distance (wpos, cameraPos);
float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
return f;
}
float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
{
float4 tess;
tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
return tess;
}
float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
{
float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
float len = distance(wpos0, wpos1);
float f = max(len * scParams.y / (edgeLen * dist), 1.0);
return f;
}
float DistanceFromPlaneASE (float3 pos, float4 plane)
{
return dot (float4(pos,1.0f), plane);
}
bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
{
float4 planeTest;
planeTest.x = (( DistanceFromPlaneASE(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlaneASE(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlaneASE(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
planeTest.y = (( DistanceFromPlaneASE(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlaneASE(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlaneASE(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
planeTest.z = (( DistanceFromPlaneASE(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlaneASE(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlaneASE(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
planeTest.w = (( DistanceFromPlaneASE(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlaneASE(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlaneASE(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
return !all (planeTest);
}
float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
{
float3 f;
f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
return CalcTriEdgeTessFactors (f);
}
float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
{
float3 pos0 = mul(o2w,v0).xyz;
float3 pos1 = mul(o2w,v1).xyz;
float3 pos2 = mul(o2w,v2).xyz;
float4 tess;
tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
tess.w = (tess.x + tess.y + tess.z) / 3.0f;
return tess;
}
float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
{
float3 pos0 = mul(o2w,v0).xyz;
float3 pos1 = mul(o2w,v1).xyz;
float3 pos2 = mul(o2w,v2).xyz;
float4 tess;
if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
{
tess = 0.0f;
}
else
{
tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
tess.w = (tess.x + tess.y + tess.z) / 3.0f;
}
return tess;
}
#endif //ASE_TESS_FUNCS
ENDHLSL
Pass
{
Name "Forward Unlit"
Tags { "LightMode"="ForwardOnly" }
Blend [_SrcBlend] [_DstBlend], [_AlphaSrcBlend] [_AlphaDstBlend]
Cull [_CullMode]
ZTest [_ZTestTransparent]
ZWrite [_ZWrite]
Stencil
{
Ref [_StencilRef]
WriteMask [_StencilWriteMask]
Comp Always
Pass Replace
Fail Keep
ZFail Keep
}
HLSLPROGRAM
#pragma multi_compile_instancing
#define HAVE_MESH_MODIFICATION 1
#define ASE_SRP_VERSION 100501
#define SHADERPASS SHADERPASS_FORWARD_UNLIT
#pragma multi_compile _ DEBUG_DISPLAY
#pragma shader_feature _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local _ENABLE_FOG_ON_TRANSPARENT
#pragma vertex Vert
#pragma fragment Frag
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl"
#if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT
#define LIGHTLOOP_DISABLE_TILE_AND_CLUSTER
#define HAS_LIGHTLOOP
#define SHADOW_OPTIMIZE_REGISTER_USAGE 1
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowContext.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/HDShadow.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/PunctualLightCommon.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/HDShadowLoop.hlsl"
#endif
#define ASE_NEEDS_FRAG_COLOR
struct VertexInput
{
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_Position;
float3 positionRWS : TEXCOORD0;
float4 ase_color : COLOR;
float4 ase_texcoord1 : TEXCOORD1;
float4 ase_texcoord2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START( UnityPerMaterial )
float4 _Color;
float2 _MaskMoveScale;
float2 _NoiseDistortionSpeed;
float2 _NoiseDistortionScale;
float2 _MaskScale;
float2 _MaskOffset;
float2 _Noise02Scale;
float2 _Noise02Speed;
float2 _Noise01Scale;
float2 _Noise01Speed;
float _OpacityBoost;
float _EmissionIntensity;
float _NoisesMultiply;
float _NoisesPower;
float _CameraOffset;
float _MaskMovePower;
float _Dissolve;
float _MaskMultiply;
float _MaskPower;
float _MaskSpeed;
float _DistortionIntensity;
float _Distortion;
float _WindSpeed;
float _MaskMoveMultiply;
float _DepthFade;
float4 _EmissionColor;
float _RenderQueueType;
#ifdef _ADD_PRECOMPUTED_VELOCITY
float _AddPrecomputedVelocity;
#endif
#ifdef _ENABLE_SHADOW_MATTE
float _ShadowMatteFilter;
#endif
float _StencilRef;
float _StencilWriteMask;
float _StencilRefDepth;
float _StencilWriteMaskDepth;
float _StencilRefMV;
float _StencilWriteMaskMV;
float _StencilRefDistortionVec;
float _StencilWriteMaskDistortionVec;
float _StencilWriteMaskGBuffer;
float _StencilRefGBuffer;
float _ZTestGBuffer;
float _RequireSplitLighting;
float _ReceivesSSR;
float _SurfaceType;
float _BlendMode;
float _SrcBlend;
float _DstBlend;
float _AlphaSrcBlend;
float _AlphaDstBlend;
float _ZWrite;
float _TransparentZWrite;
float _CullMode;
float _TransparentSortPriority;
float _EnableFogOnTransparent;
float _CullModeForward;
float _TransparentCullMode;
float _ZTestDepthEqualForOpaque;
float _ZTestTransparent;
float _TransparentBackfaceEnable;
float _AlphaCutoffEnable;
float _AlphaCutoff;
float _UseShadowThreshold;
float _DoubleSidedEnable;
float _DoubleSidedNormalMode;
float4 _DoubleSidedConstants;
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _MaskTexture;
sampler2D _NoiseDistortionTexture;
sampler2D _MaskMoveTexture;
sampler2D _Noise_01_Texture;
sampler2D _Noise_02_Texture;
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
struct SurfaceDescription
{
float3 Color;
float3 Emission;
float4 ShadowTint;
float Alpha;
float AlphaClipThreshold;
};
void BuildSurfaceData(FragInputs fragInputs, SurfaceDescription surfaceDescription, float3 V, out SurfaceData surfaceData)
{
ZERO_INITIALIZE(SurfaceData, surfaceData);
surfaceData.color = surfaceDescription.Color;
}
void GetSurfaceAndBuiltinData(SurfaceDescription surfaceDescription , FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData)
{
#if _ALPHATEST_ON
DoAlphaTest ( surfaceDescription.Alpha, surfaceDescription.AlphaClipThreshold );
#endif
BuildSurfaceData(fragInputs, surfaceDescription, V, surfaceData);
#if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT
HDShadowContext shadowContext = InitShadowContext();
float shadow;
float3 shadow3;
posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, UNITY_MATRIX_V);
float3 normalWS = normalize(fragInputs.tangentToWorld[1]);
uint renderingLayers = _EnableLightLayers ? asuint(unity_RenderingLayer.x) : DEFAULT_LIGHT_LAYERS;
ShadowLoopMin(shadowContext, posInput, normalWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3);
shadow = dot(shadow3, float3(1.0f/3.0f, 1.0f/3.0f, 1.0f/3.0f));
float4 shadowColor = (1 - shadow)*surfaceDescription.ShadowTint.rgba;
float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha);
#ifdef _SURFACE_TYPE_TRANSPARENT
surfaceData.color = lerp(shadowColor.rgb*surfaceData.color, lerp(lerp(shadowColor.rgb, surfaceData.color, 1 - surfaceDescription.ShadowTint.a), surfaceData.color, shadow), surfaceDescription.Alpha);
#else
surfaceData.color = lerp(lerp(shadowColor.rgb, surfaceData.color, 1 - surfaceDescription.ShadowTint.a), surfaceData.color, shadow);
#endif
localAlpha = ApplyBlendMode(surfaceData.color, localAlpha).a;
surfaceDescription.Alpha = localAlpha;
#endif
ZERO_INITIALIZE(BuiltinData, builtinData);
builtinData.opacity = surfaceDescription.Alpha;
builtinData.emissiveColor = surfaceDescription.Emission;
}
VertexOutput VertexFunction( VertexInput inputMesh )
{
VertexOutput o;
UNITY_SETUP_INSTANCE_ID(inputMesh);
UNITY_TRANSFER_INSTANCE_ID(inputMesh, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
float3 ase_worldPos = GetAbsolutePositionWS( TransformObjectToWorld( (inputMesh.positionOS).xyz ) );
float2 texCoord251 = inputMesh.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
o.ase_texcoord3 = screenPos;
o.ase_color = inputMesh.ase_color;
o.ase_texcoord1.xy = inputMesh.ase_texcoord.xy;
o.ase_texcoord2 = inputMesh.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = inputMesh.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = ( ( ase_worldPos - _WorldSpaceCameraPos ) * ( ( _CameraOffset + texCoord251.y ) * 0.01 ) );
#ifdef ASE_ABSOLUTE_VERTEX_POS
inputMesh.positionOS.xyz = vertexValue;
#else
inputMesh.positionOS.xyz += vertexValue;
#endif
inputMesh.normalOS = inputMesh.normalOS;
float3 positionRWS = TransformObjectToWorld(inputMesh.positionOS);
o.positionCS = TransformWorldToHClip(positionRWS);
o.positionRWS = positionRWS;
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float3 positionOS : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl Vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.positionOS = v.positionOS;
o.normalOS = v.normalOS;
o.ase_texcoord3 = v.ase_texcoord3;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
float4 tf = 1;
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
float3 cameraPos = 0;
#else
float3 cameraPos = _WorldSpaceCameraPos;
#endif
#if defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), cameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, GetObjectToWorldMatrix(), cameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), cameraPos, _ScreenParams, _FrustumPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_texcoord3 = patch[0].ase_texcoord3 * bary.x + patch[1].ase_texcoord3 * bary.y + patch[2].ase_texcoord3 * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput Vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
float4 Frag( VertexOutput packedInput ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID( packedInput );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( packedInput );
FragInputs input;
ZERO_INITIALIZE(FragInputs, input);
input.tangentToWorld = k_identity3x3;
float3 positionRWS = packedInput.positionRWS;
input.positionSS = packedInput.positionCS;
input.positionRWS = positionRWS;
PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS);
float3 V = GetWorldSpaceNormalizeViewDir( input.positionRWS );
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
float2 texCoord30 = packedInput.ase_texcoord1.xy * _NoiseDistortionScale + float2( 0,0 );
float2 panner79 = ( windSpeed200 * _NoiseDistortionSpeed + texCoord30);
float Distortion64 = ( ( tex2D( _NoiseDistortionTexture, panner79 ).r * 0.1 ) * _Distortion );
float2 appendResult264 = (float2(_MaskSpeed , 0.0));
float2 texCoord216 = packedInput.ase_texcoord1.xy * _MaskScale + _MaskOffset;
float2 panner266 = ( windSpeed200 * appendResult264 + texCoord216);
float2 texCoord212 = packedInput.ase_texcoord1.xy * _MaskMoveScale + float2( 0,0 );
float2 appendResult226 = (float2(packedInput.ase_texcoord2.z , packedInput.ase_texcoord2.w));
float2 texCoord26 = packedInput.ase_texcoord1.xy * _Noise01Scale + float2( 0,0 );
float2 panner78 = ( windSpeed200 * _Noise01Speed + texCoord26);
float2 texCoord58 = packedInput.ase_texcoord1.xy * _Noise02Scale + float2( 0,0 );
float2 panner80 = ( windSpeed200 * _Noise02Speed + texCoord58);
float Noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( Distortion64 + panner78 ) ).r * tex2D( _Noise_02_Texture, ( Distortion64 + panner80 ) ).r ) , _NoisesPower ) * _NoisesMultiply ) );
float temp_output_207_0 = ( saturate( ( saturate( ( pow( tex2D( _MaskTexture, ( ( Distortion64 * _DistortionIntensity ) + panner266 ) ).r , _MaskPower ) * _MaskMultiply ) ) * saturate( ( pow( tex2D( _MaskMoveTexture, ( texCoord212 + appendResult226 ) ).r , _MaskMovePower ) * _MaskMoveMultiply ) ) ) ) * Noises205 );
float4 temp_output_10_0 = ( ( _Color * packedInput.ase_color ) * temp_output_207_0 );
float4 screenPos = packedInput.ase_texcoord3;
float4 ase_screenPosNorm = screenPos / screenPos.w;
ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
float screenDepth137 = LinearEyeDepth(SampleCameraDepth( ase_screenPosNorm.xy ),_ZBufferParams);
float distanceDepth137 = abs( ( screenDepth137 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DepthFade ) );
surfaceDescription.Color = temp_output_10_0.rgb;
surfaceDescription.Emission = ( temp_output_10_0 * _EmissionIntensity ).rgb;
surfaceDescription.Alpha = saturate( ( packedInput.ase_color.a * saturate( ( ( saturate( ( temp_output_207_0 * _OpacityBoost ) ) - ( packedInput.ase_texcoord2.x + _Dissolve ) ) * saturate( distanceDepth137 ) ) ) ) );
surfaceDescription.AlphaClipThreshold = _AlphaCutoff;
surfaceDescription.ShadowTint = float4( 0, 0 ,0 ,1 );
float2 Distortion = float2 ( 0, 0 );
float DistortionBlur = 0;
SurfaceData surfaceData;
BuiltinData builtinData;
GetSurfaceAndBuiltinData(surfaceDescription, input, V, posInput, surfaceData, builtinData);
BSDFData bsdfData = ConvertSurfaceDataToBSDFData( input.positionSS.xy, surfaceData );
float4 outColor = ApplyBlendMode( bsdfData.color + builtinData.emissiveColor * GetCurrentExposureMultiplier(), builtinData.opacity );
outColor = EvaluateAtmosphericScattering( posInput, V, outColor );
#ifdef DEBUG_DISPLAY
int bufferSize = int(_DebugViewMaterialArray[0].x);
for (int index = 1; index <= bufferSize; index++)
{
int indexMaterialProperty = int(_DebugViewMaterialArray[index].x);
if (indexMaterialProperty != 0)
{
float3 result = float3(1.0, 0.0, 1.0);
bool needLinearToSRGB = false;
GetPropertiesDataDebug(indexMaterialProperty, result, needLinearToSRGB);
GetVaryingsDataDebug(indexMaterialProperty, input, result, needLinearToSRGB);
GetBuiltinDataDebug(indexMaterialProperty, builtinData, posInput, result, needLinearToSRGB);
GetSurfaceDataDebug(indexMaterialProperty, surfaceData, result, needLinearToSRGB);
GetBSDFDataDebug(indexMaterialProperty, bsdfData, result, needLinearToSRGB);
if (!needLinearToSRGB)
result = SRGBToLinear(max(0, result));
outColor = float4(result, 1.0);
}
}
if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_TRANSPARENCY_OVERDRAW)
{
float4 result = _DebugTransparencyOverdrawWeight * float4(TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_A);
outColor = result;
}
#endif
return outColor;
}
ENDHLSL
}
Pass
{
Name "ShadowCaster"
Tags { "LightMode"="ShadowCaster" }
Cull [_CullMode]
ZWrite On
ZClip [_ZClip]
ColorMask 0
HLSLPROGRAM
#pragma multi_compile_instancing
#define HAVE_MESH_MODIFICATION 1
#define ASE_SRP_VERSION 100501
#define SHADERPASS SHADERPASS_SHADOWS
#pragma shader_feature _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local _ENABLE_FOG_ON_TRANSPARENT
#pragma vertex Vert
#pragma fragment Frag
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl"
struct VertexInput
{
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_Position;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
float4 ase_texcoord2 : TEXCOORD2;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START( UnityPerMaterial )
float4 _Color;
float2 _MaskMoveScale;
float2 _NoiseDistortionSpeed;
float2 _NoiseDistortionScale;
float2 _MaskScale;
float2 _MaskOffset;
float2 _Noise02Scale;
float2 _Noise02Speed;
float2 _Noise01Scale;
float2 _Noise01Speed;
float _OpacityBoost;
float _EmissionIntensity;
float _NoisesMultiply;
float _NoisesPower;
float _CameraOffset;
float _MaskMovePower;
float _Dissolve;
float _MaskMultiply;
float _MaskPower;
float _MaskSpeed;
float _DistortionIntensity;
float _Distortion;
float _WindSpeed;
float _MaskMoveMultiply;
float _DepthFade;
float4 _EmissionColor;
float _RenderQueueType;
#ifdef _ADD_PRECOMPUTED_VELOCITY
float _AddPrecomputedVelocity;
#endif
#ifdef _ENABLE_SHADOW_MATTE
float _ShadowMatteFilter;
#endif
float _StencilRef;
float _StencilWriteMask;
float _StencilRefDepth;
float _StencilWriteMaskDepth;
float _StencilRefMV;
float _StencilWriteMaskMV;
float _StencilRefDistortionVec;
float _StencilWriteMaskDistortionVec;
float _StencilWriteMaskGBuffer;
float _StencilRefGBuffer;
float _ZTestGBuffer;
float _RequireSplitLighting;
float _ReceivesSSR;
float _SurfaceType;
float _BlendMode;
float _SrcBlend;
float _DstBlend;
float _AlphaSrcBlend;
float _AlphaDstBlend;
float _ZWrite;
float _TransparentZWrite;
float _CullMode;
float _TransparentSortPriority;
float _EnableFogOnTransparent;
float _CullModeForward;
float _TransparentCullMode;
float _ZTestDepthEqualForOpaque;
float _ZTestTransparent;
float _TransparentBackfaceEnable;
float _AlphaCutoffEnable;
float _AlphaCutoff;
float _UseShadowThreshold;
float _DoubleSidedEnable;
float _DoubleSidedNormalMode;
float4 _DoubleSidedConstants;
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _MaskTexture;
sampler2D _NoiseDistortionTexture;
sampler2D _MaskMoveTexture;
sampler2D _Noise_01_Texture;
sampler2D _Noise_02_Texture;
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
void BuildSurfaceData(FragInputs fragInputs, SurfaceDescription surfaceDescription, float3 V, out SurfaceData surfaceData)
{
ZERO_INITIALIZE(SurfaceData, surfaceData);
}
void GetSurfaceAndBuiltinData(SurfaceDescription surfaceDescription, FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData)
{
#if _ALPHATEST_ON
DoAlphaTest(surfaceDescription.Alpha, surfaceDescription.AlphaClipThreshold);
#endif
BuildSurfaceData(fragInputs, surfaceDescription, V, surfaceData);
ZERO_INITIALIZE (BuiltinData, builtinData);
builtinData.opacity = surfaceDescription.Alpha;
}
VertexOutput VertexFunction( VertexInput inputMesh )
{
VertexOutput o;
UNITY_SETUP_INSTANCE_ID(inputMesh);
UNITY_TRANSFER_INSTANCE_ID(inputMesh, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
float3 ase_worldPos = GetAbsolutePositionWS( TransformObjectToWorld( (inputMesh.positionOS).xyz ) );
float2 texCoord251 = inputMesh.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
o.ase_texcoord2 = screenPos;
o.ase_color = inputMesh.ase_color;
o.ase_texcoord.xy = inputMesh.ase_texcoord.xy;
o.ase_texcoord1 = inputMesh.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = inputMesh.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = ( ( ase_worldPos - _WorldSpaceCameraPos ) * ( ( _CameraOffset + texCoord251.y ) * 0.01 ) );
#ifdef ASE_ABSOLUTE_VERTEX_POS
inputMesh.positionOS.xyz = vertexValue;
#else
inputMesh.positionOS.xyz += vertexValue;
#endif
inputMesh.normalOS = inputMesh.normalOS ;
float3 positionRWS = TransformObjectToWorld(inputMesh.positionOS);
o.positionCS = TransformWorldToHClip(positionRWS);
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float3 positionOS : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl Vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.positionOS = v.positionOS;
o.normalOS = v.normalOS;
o.ase_texcoord3 = v.ase_texcoord3;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
float4 tf = 1;
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
float3 cameraPos = 0;
#else
float3 cameraPos = _WorldSpaceCameraPos;
#endif
#if defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), cameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, GetObjectToWorldMatrix(), cameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), cameraPos, _ScreenParams, _FrustumPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_texcoord3 = patch[0].ase_texcoord3 * bary.x + patch[1].ase_texcoord3 * bary.y + patch[2].ase_texcoord3 * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput Vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
void Frag( VertexOutput packedInput
#ifdef WRITE_NORMAL_BUFFER
, out float4 outNormalBuffer : SV_Target0
#ifdef WRITE_MSAA_DEPTH
, out float1 depthColor : SV_Target1
#endif
#elif defined(WRITE_MSAA_DEPTH)
, out float4 outNormalBuffer : SV_Target0
, out float1 depthColor : SV_Target1
#elif defined(SCENESELECTIONPASS)
, out float4 outColor : SV_Target0
#endif
#ifdef _DEPTHOFFSET_ON
, out float outputDepth : SV_Depth
#endif
)
{
UNITY_SETUP_INSTANCE_ID( packedInput );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( packedInput );
FragInputs input;
ZERO_INITIALIZE(FragInputs, input);
input.tangentToWorld = k_identity3x3;
input.positionSS = packedInput.positionCS;
PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS);
float3 V = float3( 1.0, 1.0, 1.0 );
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
float2 texCoord30 = packedInput.ase_texcoord.xy * _NoiseDistortionScale + float2( 0,0 );
float2 panner79 = ( windSpeed200 * _NoiseDistortionSpeed + texCoord30);
float Distortion64 = ( ( tex2D( _NoiseDistortionTexture, panner79 ).r * 0.1 ) * _Distortion );
float2 appendResult264 = (float2(_MaskSpeed , 0.0));
float2 texCoord216 = packedInput.ase_texcoord.xy * _MaskScale + _MaskOffset;
float2 panner266 = ( windSpeed200 * appendResult264 + texCoord216);
float2 texCoord212 = packedInput.ase_texcoord.xy * _MaskMoveScale + float2( 0,0 );
float2 appendResult226 = (float2(packedInput.ase_texcoord1.z , packedInput.ase_texcoord1.w));
float2 texCoord26 = packedInput.ase_texcoord.xy * _Noise01Scale + float2( 0,0 );
float2 panner78 = ( windSpeed200 * _Noise01Speed + texCoord26);
float2 texCoord58 = packedInput.ase_texcoord.xy * _Noise02Scale + float2( 0,0 );
float2 panner80 = ( windSpeed200 * _Noise02Speed + texCoord58);
float Noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( Distortion64 + panner78 ) ).r * tex2D( _Noise_02_Texture, ( Distortion64 + panner80 ) ).r ) , _NoisesPower ) * _NoisesMultiply ) );
float temp_output_207_0 = ( saturate( ( saturate( ( pow( tex2D( _MaskTexture, ( ( Distortion64 * _DistortionIntensity ) + panner266 ) ).r , _MaskPower ) * _MaskMultiply ) ) * saturate( ( pow( tex2D( _MaskMoveTexture, ( texCoord212 + appendResult226 ) ).r , _MaskMovePower ) * _MaskMoveMultiply ) ) ) ) * Noises205 );
float4 screenPos = packedInput.ase_texcoord2;
float4 ase_screenPosNorm = screenPos / screenPos.w;
ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
float screenDepth137 = LinearEyeDepth(SampleCameraDepth( ase_screenPosNorm.xy ),_ZBufferParams);
float distanceDepth137 = abs( ( screenDepth137 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DepthFade ) );
surfaceDescription.Alpha = saturate( ( packedInput.ase_color.a * saturate( ( ( saturate( ( temp_output_207_0 * _OpacityBoost ) ) - ( packedInput.ase_texcoord1.x + _Dissolve ) ) * saturate( distanceDepth137 ) ) ) ) );
surfaceDescription.AlphaClipThreshold = _AlphaCutoff;
SurfaceData surfaceData;
BuiltinData builtinData;
GetSurfaceAndBuiltinData(surfaceDescription,input, V, posInput, surfaceData, builtinData);
#ifdef _DEPTHOFFSET_ON
outputDepth = posInput.deviceDepth;
#endif
#ifdef WRITE_NORMAL_BUFFER
EncodeIntoNormalBuffer( ConvertSurfaceDataToNormalData( surfaceData ), posInput.positionSS, outNormalBuffer );
#ifdef WRITE_MSAA_DEPTH
depthColor = packedInput.positionCS.z;
#endif
#elif defined(WRITE_MSAA_DEPTH)
outNormalBuffer = float4( 0.0, 0.0, 0.0, 1.0 );
depthColor = packedInput.positionCS.z;
#elif defined(SCENESELECTIONPASS)
outColor = float4( _ObjectId, _PassValue, 1.0, 1.0 );
#endif
}
ENDHLSL
}
Pass
{
Name "META"
Tags { "LightMode"="Meta" }
Cull Off
HLSLPROGRAM
#pragma multi_compile_instancing
#define HAVE_MESH_MODIFICATION 1
#define ASE_SRP_VERSION 100501
#define SHADERPASS SHADERPASS_LIGHT_TRANSPORT
#pragma shader_feature _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local _ENABLE_FOG_ON_TRANSPARENT
#pragma vertex Vert
#pragma fragment Frag
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl"
CBUFFER_START( UnityPerMaterial )
float4 _Color;
float2 _MaskMoveScale;
float2 _NoiseDistortionSpeed;
float2 _NoiseDistortionScale;
float2 _MaskScale;
float2 _MaskOffset;
float2 _Noise02Scale;
float2 _Noise02Speed;
float2 _Noise01Scale;
float2 _Noise01Speed;
float _OpacityBoost;
float _EmissionIntensity;
float _NoisesMultiply;
float _NoisesPower;
float _CameraOffset;
float _MaskMovePower;
float _Dissolve;
float _MaskMultiply;
float _MaskPower;
float _MaskSpeed;
float _DistortionIntensity;
float _Distortion;
float _WindSpeed;
float _MaskMoveMultiply;
float _DepthFade;
float4 _EmissionColor;
float _RenderQueueType;
#ifdef _ADD_PRECOMPUTED_VELOCITY
float _AddPrecomputedVelocity;
#endif
#ifdef _ENABLE_SHADOW_MATTE
float _ShadowMatteFilter;
#endif
float _StencilRef;
float _StencilWriteMask;
float _StencilRefDepth;
float _StencilWriteMaskDepth;
float _StencilRefMV;
float _StencilWriteMaskMV;
float _StencilRefDistortionVec;
float _StencilWriteMaskDistortionVec;
float _StencilWriteMaskGBuffer;
float _StencilRefGBuffer;
float _ZTestGBuffer;
float _RequireSplitLighting;
float _ReceivesSSR;
float _SurfaceType;
float _BlendMode;
float _SrcBlend;
float _DstBlend;
float _AlphaSrcBlend;
float _AlphaDstBlend;
float _ZWrite;
float _TransparentZWrite;
float _CullMode;
float _TransparentSortPriority;
float _EnableFogOnTransparent;
float _CullModeForward;
float _TransparentCullMode;
float _ZTestDepthEqualForOpaque;
float _ZTestTransparent;
float _TransparentBackfaceEnable;
float _AlphaCutoffEnable;
float _AlphaCutoff;
float _UseShadowThreshold;
float _DoubleSidedEnable;
float _DoubleSidedNormalMode;
float4 _DoubleSidedConstants;
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
CBUFFER_START( UnityMetaPass )
bool4 unity_MetaVertexControl;
bool4 unity_MetaFragmentControl;
CBUFFER_END
float unity_OneOverOutputBoost;
float unity_MaxOutputValue;
sampler2D _MaskTexture;
sampler2D _NoiseDistortionTexture;
sampler2D _MaskMoveTexture;
sampler2D _Noise_01_Texture;
sampler2D _Noise_02_Texture;
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
#define ASE_NEEDS_FRAG_COLOR
struct VertexInput
{
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 uv1 : TEXCOORD1;
float4 uv2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_Position;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
float4 ase_texcoord2 : TEXCOORD2;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct SurfaceDescription
{
float3 Color;
float3 Emission;
float Alpha;
float AlphaClipThreshold;
};
void BuildSurfaceData( FragInputs fragInputs, SurfaceDescription surfaceDescription, float3 V, out SurfaceData surfaceData )
{
ZERO_INITIALIZE( SurfaceData, surfaceData );
surfaceData.color = surfaceDescription.Color;
}
void GetSurfaceAndBuiltinData( SurfaceDescription surfaceDescription, FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData )
{
#if _ALPHATEST_ON
DoAlphaTest( surfaceDescription.Alpha, surfaceDescription.AlphaClipThreshold );
#endif
BuildSurfaceData( fragInputs, surfaceDescription, V, surfaceData );
ZERO_INITIALIZE( BuiltinData, builtinData );
builtinData.opacity = surfaceDescription.Alpha;
builtinData.emissiveColor = surfaceDescription.Emission;
}
VertexOutput VertexFunction( VertexInput inputMesh )
{
VertexOutput o;
UNITY_SETUP_INSTANCE_ID( inputMesh );
UNITY_TRANSFER_INSTANCE_ID( inputMesh, o );
float3 ase_worldPos = GetAbsolutePositionWS( TransformObjectToWorld( (inputMesh.positionOS).xyz ) );
float2 texCoord251 = inputMesh.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
o.ase_texcoord2 = screenPos;
o.ase_color = inputMesh.ase_color;
o.ase_texcoord.xy = inputMesh.ase_texcoord.xy;
o.ase_texcoord1 = inputMesh.uv1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = inputMesh.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = ( ( ase_worldPos - _WorldSpaceCameraPos ) * ( ( _CameraOffset + texCoord251.y ) * 0.01 ) );
#ifdef ASE_ABSOLUTE_VERTEX_POS
inputMesh.positionOS.xyz = vertexValue;
#else
inputMesh.positionOS.xyz += vertexValue;
#endif
inputMesh.normalOS = inputMesh.normalOS ;
float2 uv = float2( 0.0, 0.0 );
if( unity_MetaVertexControl.x )
{
uv = inputMesh.uv1.xy * unity_LightmapST.xy + unity_LightmapST.zw;
}
else if( unity_MetaVertexControl.y )
{
uv = inputMesh.uv2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
}
o.positionCS = float4( uv * 2.0 - 1.0, inputMesh.positionOS.z > 0 ? 1.0e-4 : 0.0, 1.0 );
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float3 positionOS : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 uv1 : TEXCOORD1;
float4 uv2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl Vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.positionOS = v.positionOS;
o.normalOS = v.normalOS;
o.uv1 = v.uv1;
o.uv2 = v.uv2;
o.ase_texcoord3 = v.ase_texcoord3;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
float4 tf = 1;
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
float3 cameraPos = 0;
#else
float3 cameraPos = _WorldSpaceCameraPos;
#endif
#if defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), cameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, GetObjectToWorldMatrix(), cameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), cameraPos, _ScreenParams, _FrustumPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.uv1 = patch[0].uv1 * bary.x + patch[1].uv1 * bary.y + patch[2].uv1 * bary.z;
o.uv2 = patch[0].uv2 * bary.x + patch[1].uv2 * bary.y + patch[2].uv2 * bary.z;
o.ase_texcoord3 = patch[0].ase_texcoord3 * bary.x + patch[1].ase_texcoord3 * bary.y + patch[2].ase_texcoord3 * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput Vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
float4 Frag( VertexOutput packedInput ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID( packedInput );
FragInputs input;
ZERO_INITIALIZE( FragInputs, input );
input.tangentToWorld = k_identity3x3;
input.positionSS = packedInput.positionCS;
PositionInputs posInput = GetPositionInput( input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS );
float3 V = float3( 1.0, 1.0, 1.0 );
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
float2 texCoord30 = packedInput.ase_texcoord.xy * _NoiseDistortionScale + float2( 0,0 );
float2 panner79 = ( windSpeed200 * _NoiseDistortionSpeed + texCoord30);
float Distortion64 = ( ( tex2D( _NoiseDistortionTexture, panner79 ).r * 0.1 ) * _Distortion );
float2 appendResult264 = (float2(_MaskSpeed , 0.0));
float2 texCoord216 = packedInput.ase_texcoord.xy * _MaskScale + _MaskOffset;
float2 panner266 = ( windSpeed200 * appendResult264 + texCoord216);
float2 texCoord212 = packedInput.ase_texcoord.xy * _MaskMoveScale + float2( 0,0 );
float2 appendResult226 = (float2(packedInput.ase_texcoord1.z , packedInput.ase_texcoord1.w));
float2 texCoord26 = packedInput.ase_texcoord.xy * _Noise01Scale + float2( 0,0 );
float2 panner78 = ( windSpeed200 * _Noise01Speed + texCoord26);
float2 texCoord58 = packedInput.ase_texcoord.xy * _Noise02Scale + float2( 0,0 );
float2 panner80 = ( windSpeed200 * _Noise02Speed + texCoord58);
float Noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( Distortion64 + panner78 ) ).r * tex2D( _Noise_02_Texture, ( Distortion64 + panner80 ) ).r ) , _NoisesPower ) * _NoisesMultiply ) );
float temp_output_207_0 = ( saturate( ( saturate( ( pow( tex2D( _MaskTexture, ( ( Distortion64 * _DistortionIntensity ) + panner266 ) ).r , _MaskPower ) * _MaskMultiply ) ) * saturate( ( pow( tex2D( _MaskMoveTexture, ( texCoord212 + appendResult226 ) ).r , _MaskMovePower ) * _MaskMoveMultiply ) ) ) ) * Noises205 );
float4 temp_output_10_0 = ( ( _Color * packedInput.ase_color ) * temp_output_207_0 );
float4 screenPos = packedInput.ase_texcoord2;
float4 ase_screenPosNorm = screenPos / screenPos.w;
ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
float screenDepth137 = LinearEyeDepth(SampleCameraDepth( ase_screenPosNorm.xy ),_ZBufferParams);
float distanceDepth137 = abs( ( screenDepth137 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DepthFade ) );
surfaceDescription.Color = temp_output_10_0.rgb;
surfaceDescription.Emission = ( temp_output_10_0 * _EmissionIntensity ).rgb;
surfaceDescription.Alpha = saturate( ( packedInput.ase_color.a * saturate( ( ( saturate( ( temp_output_207_0 * _OpacityBoost ) ) - ( packedInput.ase_texcoord1.x + _Dissolve ) ) * saturate( distanceDepth137 ) ) ) ) );
surfaceDescription.AlphaClipThreshold = _AlphaCutoff;
SurfaceData surfaceData;
BuiltinData builtinData;
GetSurfaceAndBuiltinData( surfaceDescription,input, V, posInput, surfaceData, builtinData );
BSDFData bsdfData = ConvertSurfaceDataToBSDFData( input.positionSS.xy, surfaceData );
LightTransportData lightTransportData = GetLightTransportData( surfaceData, builtinData, bsdfData );
float4 res = float4( 0.0, 0.0, 0.0, 1.0 );
if( unity_MetaFragmentControl.x )
{
res.rgb = clamp( pow( abs( lightTransportData.diffuseColor ), saturate( unity_OneOverOutputBoost ) ), 0, unity_MaxOutputValue );
}
if( unity_MetaFragmentControl.y )
{
res.rgb = lightTransportData.emissiveColor;
}
return res;
}
ENDHLSL
}
Pass
{
Name "SceneSelectionPass"
Tags { "LightMode"="SceneSelectionPass" }
Cull [_CullMode]
ZWrite On
ColorMask 0
HLSLPROGRAM
#pragma multi_compile_instancing
#define HAVE_MESH_MODIFICATION 1
#define ASE_SRP_VERSION 100501
#define SHADERPASS SHADERPASS_DEPTH_ONLY
#define SCENESELECTIONPASS
#pragma editor_sync_compilation
#pragma shader_feature _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local _ENABLE_FOG_ON_TRANSPARENT
#pragma vertex Vert
#pragma fragment Frag
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl"
int _ObjectId;
int _PassValue;
CBUFFER_START( UnityPerMaterial )
float4 _Color;
float2 _MaskMoveScale;
float2 _NoiseDistortionSpeed;
float2 _NoiseDistortionScale;
float2 _MaskScale;
float2 _MaskOffset;
float2 _Noise02Scale;
float2 _Noise02Speed;
float2 _Noise01Scale;
float2 _Noise01Speed;
float _OpacityBoost;
float _EmissionIntensity;
float _NoisesMultiply;
float _NoisesPower;
float _CameraOffset;
float _MaskMovePower;
float _Dissolve;
float _MaskMultiply;
float _MaskPower;
float _MaskSpeed;
float _DistortionIntensity;
float _Distortion;
float _WindSpeed;
float _MaskMoveMultiply;
float _DepthFade;
float4 _EmissionColor;
float _RenderQueueType;
#ifdef _ADD_PRECOMPUTED_VELOCITY
float _AddPrecomputedVelocity;
#endif
#ifdef _ENABLE_SHADOW_MATTE
float _ShadowMatteFilter;
#endif
float _StencilRef;
float _StencilWriteMask;
float _StencilRefDepth;
float _StencilWriteMaskDepth;
float _StencilRefMV;
float _StencilWriteMaskMV;
float _StencilRefDistortionVec;
float _StencilWriteMaskDistortionVec;
float _StencilWriteMaskGBuffer;
float _StencilRefGBuffer;
float _ZTestGBuffer;
float _RequireSplitLighting;
float _ReceivesSSR;
float _SurfaceType;
float _BlendMode;
float _SrcBlend;
float _DstBlend;
float _AlphaSrcBlend;
float _AlphaDstBlend;
float _ZWrite;
float _TransparentZWrite;
float _CullMode;
float _TransparentSortPriority;
float _EnableFogOnTransparent;
float _CullModeForward;
float _TransparentCullMode;
float _ZTestDepthEqualForOpaque;
float _ZTestTransparent;
float _TransparentBackfaceEnable;
float _AlphaCutoffEnable;
float _AlphaCutoff;
float _UseShadowThreshold;
float _DoubleSidedEnable;
float _DoubleSidedNormalMode;
float4 _DoubleSidedConstants;
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _MaskTexture;
sampler2D _NoiseDistortionTexture;
sampler2D _MaskMoveTexture;
sampler2D _Noise_01_Texture;
sampler2D _Noise_02_Texture;
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
struct VertexInput
{
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_Position;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
float4 ase_texcoord2 : TEXCOORD2;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
void BuildSurfaceData(FragInputs fragInputs, SurfaceDescription surfaceDescription, float3 V, out SurfaceData surfaceData)
{
ZERO_INITIALIZE(SurfaceData, surfaceData);
}
void GetSurfaceAndBuiltinData(SurfaceDescription surfaceDescription, FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData)
{
#if _ALPHATEST_ON
DoAlphaTest ( surfaceDescription.Alpha, surfaceDescription.AlphaClipThreshold );
#endif
BuildSurfaceData(fragInputs, surfaceDescription, V, surfaceData);
ZERO_INITIALIZE(BuiltinData, builtinData);
builtinData.opacity = surfaceDescription.Alpha;
}
VertexOutput VertexFunction( VertexInput inputMesh )
{
VertexOutput o;
UNITY_SETUP_INSTANCE_ID(inputMesh);
UNITY_TRANSFER_INSTANCE_ID(inputMesh, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
float3 ase_worldPos = GetAbsolutePositionWS( TransformObjectToWorld( (inputMesh.positionOS).xyz ) );
float2 texCoord251 = inputMesh.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
o.ase_texcoord2 = screenPos;
o.ase_color = inputMesh.ase_color;
o.ase_texcoord.xy = inputMesh.ase_texcoord.xy;
o.ase_texcoord1 = inputMesh.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = inputMesh.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = ( ( ase_worldPos - _WorldSpaceCameraPos ) * ( ( _CameraOffset + texCoord251.y ) * 0.01 ) );
#ifdef ASE_ABSOLUTE_VERTEX_POS
inputMesh.positionOS.xyz = vertexValue;
#else
inputMesh.positionOS.xyz += vertexValue;
#endif
inputMesh.normalOS = inputMesh.normalOS ;
float3 positionRWS = TransformObjectToWorld(inputMesh.positionOS);
o.positionCS = TransformWorldToHClip(positionRWS);
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float3 positionOS : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl Vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.positionOS = v.positionOS;
o.normalOS = v.normalOS;
o.ase_texcoord3 = v.ase_texcoord3;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
float4 tf = 1;
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
float3 cameraPos = 0;
#else
float3 cameraPos = _WorldSpaceCameraPos;
#endif
#if defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), cameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, GetObjectToWorldMatrix(), cameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), cameraPos, _ScreenParams, _FrustumPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_texcoord3 = patch[0].ase_texcoord3 * bary.x + patch[1].ase_texcoord3 * bary.y + patch[2].ase_texcoord3 * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput Vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
void Frag( VertexOutput packedInput
, out float4 outColor : SV_Target0
#ifdef _DEPTHOFFSET_ON
, out float outputDepth : SV_Depth
#endif
)
{
UNITY_SETUP_INSTANCE_ID( packedInput );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( packedInput );
FragInputs input;
ZERO_INITIALIZE(FragInputs, input);
input.tangentToWorld = k_identity3x3;
input.positionSS = packedInput.positionCS;
PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS);
float3 V = float3( 1.0, 1.0, 1.0 );
SurfaceData surfaceData;
BuiltinData builtinData;
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
float2 texCoord30 = packedInput.ase_texcoord.xy * _NoiseDistortionScale + float2( 0,0 );
float2 panner79 = ( windSpeed200 * _NoiseDistortionSpeed + texCoord30);
float Distortion64 = ( ( tex2D( _NoiseDistortionTexture, panner79 ).r * 0.1 ) * _Distortion );
float2 appendResult264 = (float2(_MaskSpeed , 0.0));
float2 texCoord216 = packedInput.ase_texcoord.xy * _MaskScale + _MaskOffset;
float2 panner266 = ( windSpeed200 * appendResult264 + texCoord216);
float2 texCoord212 = packedInput.ase_texcoord.xy * _MaskMoveScale + float2( 0,0 );
float2 appendResult226 = (float2(packedInput.ase_texcoord1.z , packedInput.ase_texcoord1.w));
float2 texCoord26 = packedInput.ase_texcoord.xy * _Noise01Scale + float2( 0,0 );
float2 panner78 = ( windSpeed200 * _Noise01Speed + texCoord26);
float2 texCoord58 = packedInput.ase_texcoord.xy * _Noise02Scale + float2( 0,0 );
float2 panner80 = ( windSpeed200 * _Noise02Speed + texCoord58);
float Noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( Distortion64 + panner78 ) ).r * tex2D( _Noise_02_Texture, ( Distortion64 + panner80 ) ).r ) , _NoisesPower ) * _NoisesMultiply ) );
float temp_output_207_0 = ( saturate( ( saturate( ( pow( tex2D( _MaskTexture, ( ( Distortion64 * _DistortionIntensity ) + panner266 ) ).r , _MaskPower ) * _MaskMultiply ) ) * saturate( ( pow( tex2D( _MaskMoveTexture, ( texCoord212 + appendResult226 ) ).r , _MaskMovePower ) * _MaskMoveMultiply ) ) ) ) * Noises205 );
float4 screenPos = packedInput.ase_texcoord2;
float4 ase_screenPosNorm = screenPos / screenPos.w;
ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
float screenDepth137 = LinearEyeDepth(SampleCameraDepth( ase_screenPosNorm.xy ),_ZBufferParams);
float distanceDepth137 = abs( ( screenDepth137 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DepthFade ) );
surfaceDescription.Alpha = saturate( ( packedInput.ase_color.a * saturate( ( ( saturate( ( temp_output_207_0 * _OpacityBoost ) ) - ( packedInput.ase_texcoord1.x + _Dissolve ) ) * saturate( distanceDepth137 ) ) ) ) );
surfaceDescription.AlphaClipThreshold = _AlphaCutoff;
GetSurfaceAndBuiltinData(surfaceDescription, input, V, posInput, surfaceData, builtinData);
#ifdef _DEPTHOFFSET_ON
outputDepth = posInput.deviceDepth;
#endif
outColor = float4( _ObjectId, _PassValue, 1.0, 1.0 );
}
ENDHLSL
}
Pass
{
Name "DepthForwardOnly"
Tags { "LightMode"="DepthForwardOnly" }
Cull [_CullMode]
ZWrite On
Stencil
{
Ref [_StencilRefDepth]
WriteMask [_StencilWriteMaskDepth]
Comp Always
Pass Replace
Fail Keep
ZFail Keep
}
ColorMask 0 0
HLSLPROGRAM
#pragma multi_compile_instancing
#define HAVE_MESH_MODIFICATION 1
#define ASE_SRP_VERSION 100501
#define SHADERPASS SHADERPASS_DEPTH_ONLY
#pragma multi_compile _ WRITE_MSAA_DEPTH
#pragma shader_feature _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local _ENABLE_FOG_ON_TRANSPARENT
#pragma vertex Vert
#pragma fragment Frag
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl"
CBUFFER_START( UnityPerMaterial )
float4 _Color;
float2 _MaskMoveScale;
float2 _NoiseDistortionSpeed;
float2 _NoiseDistortionScale;
float2 _MaskScale;
float2 _MaskOffset;
float2 _Noise02Scale;
float2 _Noise02Speed;
float2 _Noise01Scale;
float2 _Noise01Speed;
float _OpacityBoost;
float _EmissionIntensity;
float _NoisesMultiply;
float _NoisesPower;
float _CameraOffset;
float _MaskMovePower;
float _Dissolve;
float _MaskMultiply;
float _MaskPower;
float _MaskSpeed;
float _DistortionIntensity;
float _Distortion;
float _WindSpeed;
float _MaskMoveMultiply;
float _DepthFade;
float4 _EmissionColor;
float _RenderQueueType;
#ifdef _ADD_PRECOMPUTED_VELOCITY
float _AddPrecomputedVelocity;
#endif
#ifdef _ENABLE_SHADOW_MATTE
float _ShadowMatteFilter;
#endif
float _StencilRef;
float _StencilWriteMask;
float _StencilRefDepth;
float _StencilWriteMaskDepth;
float _StencilRefMV;
float _StencilWriteMaskMV;
float _StencilRefDistortionVec;
float _StencilWriteMaskDistortionVec;
float _StencilWriteMaskGBuffer;
float _StencilRefGBuffer;
float _ZTestGBuffer;
float _RequireSplitLighting;
float _ReceivesSSR;
float _SurfaceType;
float _BlendMode;
float _SrcBlend;
float _DstBlend;
float _AlphaSrcBlend;
float _AlphaDstBlend;
float _ZWrite;
float _TransparentZWrite;
float _CullMode;
float _TransparentSortPriority;
float _EnableFogOnTransparent;
float _CullModeForward;
float _TransparentCullMode;
float _ZTestDepthEqualForOpaque;
float _ZTestTransparent;
float _TransparentBackfaceEnable;
float _AlphaCutoffEnable;
float _AlphaCutoff;
float _UseShadowThreshold;
float _DoubleSidedEnable;
float _DoubleSidedNormalMode;
float4 _DoubleSidedConstants;
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _MaskTexture;
sampler2D _NoiseDistortionTexture;
sampler2D _MaskMoveTexture;
sampler2D _Noise_01_Texture;
sampler2D _Noise_02_Texture;
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
struct VertexInput
{
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_Position;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
float4 ase_texcoord2 : TEXCOORD2;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
void BuildSurfaceData(FragInputs fragInputs, SurfaceDescription surfaceDescription, float3 V, out SurfaceData surfaceData)
{
ZERO_INITIALIZE(SurfaceData, surfaceData);
}
void GetSurfaceAndBuiltinData(SurfaceDescription surfaceDescription, FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData)
{
#if _ALPHATEST_ON
DoAlphaTest ( surfaceDescription.Alpha, surfaceDescription.AlphaClipThreshold );
#endif
BuildSurfaceData(fragInputs, surfaceDescription, V, surfaceData);
ZERO_INITIALIZE(BuiltinData, builtinData);
builtinData.opacity = surfaceDescription.Alpha;
}
VertexOutput VertexFunction( VertexInput inputMesh )
{
VertexOutput o;
UNITY_SETUP_INSTANCE_ID(inputMesh);
UNITY_TRANSFER_INSTANCE_ID(inputMesh, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
float3 ase_worldPos = GetAbsolutePositionWS( TransformObjectToWorld( (inputMesh.positionOS).xyz ) );
float2 texCoord251 = inputMesh.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
o.ase_texcoord2 = screenPos;
o.ase_color = inputMesh.ase_color;
o.ase_texcoord.xy = inputMesh.ase_texcoord.xy;
o.ase_texcoord1 = inputMesh.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = inputMesh.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = ( ( ase_worldPos - _WorldSpaceCameraPos ) * ( ( _CameraOffset + texCoord251.y ) * 0.01 ) );
#ifdef ASE_ABSOLUTE_VERTEX_POS
inputMesh.positionOS.xyz = vertexValue;
#else
inputMesh.positionOS.xyz += vertexValue;
#endif
inputMesh.normalOS = inputMesh.normalOS ;
float3 positionRWS = TransformObjectToWorld(inputMesh.positionOS);
o.positionCS = TransformWorldToHClip(positionRWS);
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float3 positionOS : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl Vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.positionOS = v.positionOS;
o.normalOS = v.normalOS;
o.ase_texcoord3 = v.ase_texcoord3;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
float4 tf = 1;
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
float3 cameraPos = 0;
#else
float3 cameraPos = _WorldSpaceCameraPos;
#endif
#if defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), cameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, GetObjectToWorldMatrix(), cameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), cameraPos, _ScreenParams, _FrustumPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_texcoord3 = patch[0].ase_texcoord3 * bary.x + patch[1].ase_texcoord3 * bary.y + patch[2].ase_texcoord3 * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput Vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
void Frag( VertexOutput packedInput
#ifdef WRITE_NORMAL_BUFFER
, out float4 outNormalBuffer : SV_Target0
#ifdef WRITE_MSAA_DEPTH
, out float1 depthColor : SV_Target1
#endif
#elif defined(WRITE_MSAA_DEPTH)
, out float4 outNormalBuffer : SV_Target0
, out float1 depthColor : SV_Target1
#elif defined(SCENESELECTIONPASS)
, out float4 outColor : SV_Target0
#endif
#ifdef _DEPTHOFFSET_ON
, out float outputDepth : SV_Depth
#endif
)
{
UNITY_SETUP_INSTANCE_ID( packedInput );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( packedInput );
FragInputs input;
ZERO_INITIALIZE(FragInputs, input);
input.tangentToWorld = k_identity3x3;
input.positionSS = packedInput.positionCS;
PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS);
float3 V = float3( 1.0, 1.0, 1.0 );
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
float2 texCoord30 = packedInput.ase_texcoord.xy * _NoiseDistortionScale + float2( 0,0 );
float2 panner79 = ( windSpeed200 * _NoiseDistortionSpeed + texCoord30);
float Distortion64 = ( ( tex2D( _NoiseDistortionTexture, panner79 ).r * 0.1 ) * _Distortion );
float2 appendResult264 = (float2(_MaskSpeed , 0.0));
float2 texCoord216 = packedInput.ase_texcoord.xy * _MaskScale + _MaskOffset;
float2 panner266 = ( windSpeed200 * appendResult264 + texCoord216);
float2 texCoord212 = packedInput.ase_texcoord.xy * _MaskMoveScale + float2( 0,0 );
float2 appendResult226 = (float2(packedInput.ase_texcoord1.z , packedInput.ase_texcoord1.w));
float2 texCoord26 = packedInput.ase_texcoord.xy * _Noise01Scale + float2( 0,0 );
float2 panner78 = ( windSpeed200 * _Noise01Speed + texCoord26);
float2 texCoord58 = packedInput.ase_texcoord.xy * _Noise02Scale + float2( 0,0 );
float2 panner80 = ( windSpeed200 * _Noise02Speed + texCoord58);
float Noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( Distortion64 + panner78 ) ).r * tex2D( _Noise_02_Texture, ( Distortion64 + panner80 ) ).r ) , _NoisesPower ) * _NoisesMultiply ) );
float temp_output_207_0 = ( saturate( ( saturate( ( pow( tex2D( _MaskTexture, ( ( Distortion64 * _DistortionIntensity ) + panner266 ) ).r , _MaskPower ) * _MaskMultiply ) ) * saturate( ( pow( tex2D( _MaskMoveTexture, ( texCoord212 + appendResult226 ) ).r , _MaskMovePower ) * _MaskMoveMultiply ) ) ) ) * Noises205 );
float4 screenPos = packedInput.ase_texcoord2;
float4 ase_screenPosNorm = screenPos / screenPos.w;
ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
float screenDepth137 = LinearEyeDepth(SampleCameraDepth( ase_screenPosNorm.xy ),_ZBufferParams);
float distanceDepth137 = abs( ( screenDepth137 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DepthFade ) );
surfaceDescription.Alpha = saturate( ( packedInput.ase_color.a * saturate( ( ( saturate( ( temp_output_207_0 * _OpacityBoost ) ) - ( packedInput.ase_texcoord1.x + _Dissolve ) ) * saturate( distanceDepth137 ) ) ) ) );
surfaceDescription.AlphaClipThreshold = _AlphaCutoff;
SurfaceData surfaceData;
BuiltinData builtinData;
GetSurfaceAndBuiltinData(surfaceDescription, input, V, posInput, surfaceData, builtinData);
#ifdef _DEPTHOFFSET_ON
outputDepth = posInput.deviceDepth;
#endif
#ifdef WRITE_NORMAL_BUFFER
EncodeIntoNormalBuffer( ConvertSurfaceDataToNormalData( surfaceData ), posInput.positionSS, outNormalBuffer );
#ifdef WRITE_MSAA_DEPTH
depthColor = packedInput.positionCS.z;
#endif
#elif defined(WRITE_MSAA_DEPTH)
outNormalBuffer = float4( 0.0, 0.0, 0.0, 1.0 );
depthColor = packedInput.positionCS.z;
#elif defined(SCENESELECTIONPASS)
outColor = float4( _ObjectId, _PassValue, 1.0, 1.0 );
#endif
}
ENDHLSL
}
Pass
{
Name "Motion Vectors"
Tags { "LightMode"="MotionVectors" }
Cull [_CullMode]
ZWrite On
Stencil
{
Ref [_StencilRefMV]
WriteMask [_StencilWriteMaskMV]
Comp Always
Pass Replace
Fail Keep
ZFail Keep
}
HLSLPROGRAM
#pragma multi_compile_instancing
#define HAVE_MESH_MODIFICATION 1
#define ASE_SRP_VERSION 100501
#define SHADERPASS SHADERPASS_MOTION_VECTORS
#pragma multi_compile _ WRITE_MSAA_DEPTH
#pragma shader_feature _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local _ENABLE_FOG_ON_TRANSPARENT
#pragma vertex Vert
#pragma fragment Frag
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl"
CBUFFER_START( UnityPerMaterial )
float4 _Color;
float2 _MaskMoveScale;
float2 _NoiseDistortionSpeed;
float2 _NoiseDistortionScale;
float2 _MaskScale;
float2 _MaskOffset;
float2 _Noise02Scale;
float2 _Noise02Speed;
float2 _Noise01Scale;
float2 _Noise01Speed;
float _OpacityBoost;
float _EmissionIntensity;
float _NoisesMultiply;
float _NoisesPower;
float _CameraOffset;
float _MaskMovePower;
float _Dissolve;
float _MaskMultiply;
float _MaskPower;
float _MaskSpeed;
float _DistortionIntensity;
float _Distortion;
float _WindSpeed;
float _MaskMoveMultiply;
float _DepthFade;
float4 _EmissionColor;
float _RenderQueueType;
#ifdef _ADD_PRECOMPUTED_VELOCITY
float _AddPrecomputedVelocity;
#endif
#ifdef _ENABLE_SHADOW_MATTE
float _ShadowMatteFilter;
#endif
float _StencilRef;
float _StencilWriteMask;
float _StencilRefDepth;
float _StencilWriteMaskDepth;
float _StencilRefMV;
float _StencilWriteMaskMV;
float _StencilRefDistortionVec;
float _StencilWriteMaskDistortionVec;
float _StencilWriteMaskGBuffer;
float _StencilRefGBuffer;
float _ZTestGBuffer;
float _RequireSplitLighting;
float _ReceivesSSR;
float _SurfaceType;
float _BlendMode;
float _SrcBlend;
float _DstBlend;
float _AlphaSrcBlend;
float _AlphaDstBlend;
float _ZWrite;
float _TransparentZWrite;
float _CullMode;
float _TransparentSortPriority;
float _EnableFogOnTransparent;
float _CullModeForward;
float _TransparentCullMode;
float _ZTestDepthEqualForOpaque;
float _ZTestTransparent;
float _TransparentBackfaceEnable;
float _AlphaCutoffEnable;
float _AlphaCutoff;
float _UseShadowThreshold;
float _DoubleSidedEnable;
float _DoubleSidedNormalMode;
float4 _DoubleSidedConstants;
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _MaskTexture;
sampler2D _NoiseDistortionTexture;
sampler2D _MaskMoveTexture;
sampler2D _Noise_01_Texture;
sampler2D _Noise_02_Texture;
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
struct VertexInput
{
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float3 previousPositionOS : TEXCOORD4;
#if defined (_ADD_PRECOMPUTED_VELOCITY)
float3 precomputedVelocity : TEXCOORD5;
#endif
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 vmeshPositionCS : SV_Position;
float3 vmeshInterp00 : TEXCOORD0;
float3 vpassInterpolators0 : TEXCOORD1; //interpolators0
float3 vpassInterpolators1 : TEXCOORD2; //interpolators1
float4 ase_color : COLOR;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_texcoord4 : TEXCOORD4;
float4 ase_texcoord5 : TEXCOORD5;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
void BuildSurfaceData(FragInputs fragInputs, SurfaceDescription surfaceDescription, float3 V, out SurfaceData surfaceData)
{
ZERO_INITIALIZE(SurfaceData, surfaceData);
}
void GetSurfaceAndBuiltinData(SurfaceDescription surfaceDescription, FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData)
{
#if _ALPHATEST_ON
DoAlphaTest ( surfaceDescription.Alpha, surfaceDescription.AlphaClipThreshold );
#endif
BuildSurfaceData(fragInputs, surfaceDescription, V, surfaceData);
ZERO_INITIALIZE(BuiltinData, builtinData);
builtinData.opacity = surfaceDescription.Alpha;
}
VertexInput ApplyMeshModification(VertexInput inputMesh, float3 timeParameters, inout VertexOutput o )
{
_TimeParameters.xyz = timeParameters;
float3 ase_worldPos = GetAbsolutePositionWS( TransformObjectToWorld( (inputMesh.positionOS).xyz ) );
float2 texCoord251 = inputMesh.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
o.ase_texcoord5 = screenPos;
o.ase_color = inputMesh.ase_color;
o.ase_texcoord3.xy = inputMesh.ase_texcoord.xy;
o.ase_texcoord4 = inputMesh.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord3.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = inputMesh.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = ( ( ase_worldPos - _WorldSpaceCameraPos ) * ( ( _CameraOffset + texCoord251.y ) * 0.01 ) );
#ifdef ASE_ABSOLUTE_VERTEX_POS
inputMesh.positionOS.xyz = vertexValue;
#else
inputMesh.positionOS.xyz += vertexValue;
#endif
inputMesh.normalOS = inputMesh.normalOS ;
return inputMesh;
}
VertexOutput VertexFunction(VertexInput inputMesh)
{
VertexOutput o = (VertexOutput)0;
VertexInput defaultMesh = inputMesh;
UNITY_SETUP_INSTANCE_ID(inputMesh);
UNITY_TRANSFER_INSTANCE_ID(inputMesh, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
inputMesh = ApplyMeshModification( inputMesh, _TimeParameters.xyz, o);
float3 positionRWS = TransformObjectToWorld(inputMesh.positionOS);
float3 normalWS = TransformObjectToWorldNormal(inputMesh.normalOS);
float3 VMESHpositionRWS = positionRWS;
float4 VMESHpositionCS = TransformWorldToHClip(positionRWS);
//#if defined(UNITY_REVERSED_Z)
// VMESHpositionCS.z -= unity_MotionVectorsParams.z * VMESHpositionCS.w;
//#else
// VMESHpositionCS.z += unity_MotionVectorsParams.z * VMESHpositionCS.w;
//#endif
float4 VPASSpreviousPositionCS;
float4 VPASSpositionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(VMESHpositionRWS, 1.0));
bool forceNoMotion = unity_MotionVectorsParams.y == 0.0;
if (forceNoMotion)
{
VPASSpreviousPositionCS = float4(0.0, 0.0, 0.0, 1.0);
}
else
{
bool hasDeformation = unity_MotionVectorsParams.x > 0.0;
float3 effectivePositionOS = (hasDeformation ? inputMesh.previousPositionOS : defaultMesh.positionOS);
#if defined(_ADD_PRECOMPUTED_VELOCITY)
effectivePositionOS -= inputMesh.precomputedVelocity;
#endif
#if defined(HAVE_MESH_MODIFICATION)
VertexInput previousMesh = defaultMesh;
previousMesh.positionOS = effectivePositionOS ;
VertexOutput test = (VertexOutput)0;
float3 curTime = _TimeParameters.xyz;
previousMesh = ApplyMeshModification(previousMesh, _LastTimeParameters.xyz, test);
_TimeParameters.xyz = curTime;
float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.positionOS);
#else
float3 previousPositionRWS = TransformPreviousObjectToWorld(effectivePositionOS);
#endif
#ifdef ATTRIBUTES_NEED_NORMAL
float3 normalWS = TransformPreviousObjectToWorldNormal(defaultMesh.normalOS);
#else
float3 normalWS = float3(0.0, 0.0, 0.0);
#endif
#if defined(HAVE_VERTEX_MODIFICATION)
//ApplyVertexModification(inputMesh, normalWS, previousPositionRWS, _LastTimeParameters.xyz);
#endif
VPASSpreviousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0));
}
o.vmeshPositionCS = VMESHpositionCS;
o.vmeshInterp00.xyz = VMESHpositionRWS;
o.vpassInterpolators0 = float3(VPASSpositionCS.xyw);
o.vpassInterpolators1 = float3(VPASSpreviousPositionCS.xyw);
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float3 positionOS : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float3 previousPositionOS : TEXCOORD4;
#if defined (_ADD_PRECOMPUTED_VELOCITY)
float3 precomputedVelocity : TEXCOORD5;
#endif
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl Vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.positionOS = v.positionOS;
o.normalOS = v.normalOS;
o.previousPositionOS = v.previousPositionOS;
#if defined (_ADD_PRECOMPUTED_VELOCITY)
o.precomputedVelocity = v.precomputedVelocity;
#endif
o.ase_texcoord3 = v.ase_texcoord3;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
float4 tf = 1;
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
float3 cameraPos = 0;
#else
float3 cameraPos = _WorldSpaceCameraPos;
#endif
#if defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), cameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, GetObjectToWorldMatrix(), cameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(float4(v[0].positionOS,1), float4(v[1].positionOS,1), float4(v[2].positionOS,1), edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), cameraPos, _ScreenParams, _FrustumPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.previousPositionOS = patch[0].previousPositionOS * bary.x + patch[1].previousPositionOS * bary.y + patch[2].previousPositionOS * bary.z;
#if defined (_ADD_PRECOMPUTED_VELOCITY)
o.precomputedVelocity = patch[0].precomputedVelocity * bary.x + patch[1].precomputedVelocity * bary.y + patch[2].precomputedVelocity * bary.z;
#endif
o.ase_texcoord3 = patch[0].ase_texcoord3 * bary.x + patch[1].ase_texcoord3 * bary.y + patch[2].ase_texcoord3 * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput Vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
void Frag( VertexOutput packedInput
, out float4 outMotionVector : SV_Target0
#ifdef WRITE_NORMAL_BUFFER
, out float4 outNormalBuffer : SV_Target1
#ifdef WRITE_MSAA_DEPTH
, out float1 depthColor : SV_Target2
#endif
#elif defined(WRITE_MSAA_DEPTH)
, out float4 outNormalBuffer : SV_Target1
, out float1 depthColor : SV_Target2
#endif
#ifdef _DEPTHOFFSET_ON
, out float outputDepth : SV_Depth
#endif
)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( packedInput );
UNITY_SETUP_INSTANCE_ID( packedInput );
FragInputs input;
ZERO_INITIALIZE(FragInputs, input);
input.tangentToWorld = k_identity3x3;
input.positionSS = packedInput.vmeshPositionCS;
input.positionRWS = packedInput.vmeshInterp00.xyz;
PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS);
float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS);
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
float2 texCoord30 = packedInput.ase_texcoord3.xy * _NoiseDistortionScale + float2( 0,0 );
float2 panner79 = ( windSpeed200 * _NoiseDistortionSpeed + texCoord30);
float Distortion64 = ( ( tex2D( _NoiseDistortionTexture, panner79 ).r * 0.1 ) * _Distortion );
float2 appendResult264 = (float2(_MaskSpeed , 0.0));
float2 texCoord216 = packedInput.ase_texcoord3.xy * _MaskScale + _MaskOffset;
float2 panner266 = ( windSpeed200 * appendResult264 + texCoord216);
float2 texCoord212 = packedInput.ase_texcoord3.xy * _MaskMoveScale + float2( 0,0 );
float2 appendResult226 = (float2(packedInput.ase_texcoord4.z , packedInput.ase_texcoord4.w));
float2 texCoord26 = packedInput.ase_texcoord3.xy * _Noise01Scale + float2( 0,0 );
float2 panner78 = ( windSpeed200 * _Noise01Speed + texCoord26);
float2 texCoord58 = packedInput.ase_texcoord3.xy * _Noise02Scale + float2( 0,0 );
float2 panner80 = ( windSpeed200 * _Noise02Speed + texCoord58);
float Noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( Distortion64 + panner78 ) ).r * tex2D( _Noise_02_Texture, ( Distortion64 + panner80 ) ).r ) , _NoisesPower ) * _NoisesMultiply ) );
float temp_output_207_0 = ( saturate( ( saturate( ( pow( tex2D( _MaskTexture, ( ( Distortion64 * _DistortionIntensity ) + panner266 ) ).r , _MaskPower ) * _MaskMultiply ) ) * saturate( ( pow( tex2D( _MaskMoveTexture, ( texCoord212 + appendResult226 ) ).r , _MaskMovePower ) * _MaskMoveMultiply ) ) ) ) * Noises205 );
float4 screenPos = packedInput.ase_texcoord5;
float4 ase_screenPosNorm = screenPos / screenPos.w;
ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
float screenDepth137 = LinearEyeDepth(SampleCameraDepth( ase_screenPosNorm.xy ),_ZBufferParams);
float distanceDepth137 = abs( ( screenDepth137 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DepthFade ) );
surfaceDescription.Alpha = saturate( ( packedInput.ase_color.a * saturate( ( ( saturate( ( temp_output_207_0 * _OpacityBoost ) ) - ( packedInput.ase_texcoord4.x + _Dissolve ) ) * saturate( distanceDepth137 ) ) ) ) );
surfaceDescription.AlphaClipThreshold = _AlphaCutoff;
SurfaceData surfaceData;
BuiltinData builtinData;
GetSurfaceAndBuiltinData(surfaceDescription, input, V, posInput, surfaceData, builtinData);
float4 VPASSpositionCS = float4(packedInput.vpassInterpolators0.xy, 0.0, packedInput.vpassInterpolators0.z);
float4 VPASSpreviousPositionCS = float4(packedInput.vpassInterpolators1.xy, 0.0, packedInput.vpassInterpolators1.z);
#ifdef _DEPTHOFFSET_ON
VPASSpositionCS.w += builtinData.depthOffset;
VPASSpreviousPositionCS.w += builtinData.depthOffset;
#endif
float2 motionVector = CalculateMotionVector( VPASSpositionCS, VPASSpreviousPositionCS );
EncodeMotionVector( motionVector * 0.5, outMotionVector );
bool forceNoMotion = unity_MotionVectorsParams.y == 0.0;
if( forceNoMotion )
outMotionVector = float4( 2.0, 0.0, 0.0, 0.0 );
#ifdef WRITE_NORMAL_BUFFER
EncodeIntoNormalBuffer( ConvertSurfaceDataToNormalData( surfaceData ), posInput.positionSS, outNormalBuffer );
#ifdef WRITE_MSAA_DEPTH
depthColor = packedInput.vmeshPositionCS.z;
#endif
#elif defined(WRITE_MSAA_DEPTH)
outNormalBuffer = float4( 0.0, 0.0, 0.0, 1.0 );
depthColor = packedInput.vmeshPositionCS.z;
#endif
#ifdef _DEPTHOFFSET_ON
outputDepth = posInput.deviceDepth;
#endif
}
ENDHLSL
}
}
CustomEditor "Rendering.HighDefinition.HDUnlitGUI"
Fallback "Hidden/InternalErrorShader"
}
/*ASEBEGIN
Version=18921
379;625;2546;1105;445.5669;496.4704;1.360224;True;True
Node;AmplifyShaderEditor.CommentaryNode;281;-3883.451,-1781.938;Inherit;False;786;289;Wind Speed;4;197;199;200;198;;0,0,0,1;0;0
Node;AmplifyShaderEditor.RangedFloatNode;197;-3833.451,-1731.938;Inherit;False;Property;_WindSpeed;Wind Speed;27;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleTimeNode;198;-3833.451,-1603.939;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;199;-3577.451,-1731.938;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;77;-3869.485,-1140.933;Inherit;False;2184.752;611.1584;Distortion;11;64;32;31;30;45;44;50;43;52;79;204;;0,0,0,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;200;-3321.451,-1731.938;Inherit;False;windSpeed;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;31;-3832.676,-1041.406;Inherit;False;Property;_NoiseDistortionScale;Noise Distortion Scale;9;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.TextureCoordinatesNode;30;-3578.215,-1062.098;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;204;-3557.685,-781.188;Inherit;False;200;windSpeed;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;32;-3610.241,-905.1642;Inherit;False;Property;_NoiseDistortionSpeed;Noise Distortion Speed;15;0;Create;True;0;0;0;False;0;False;0.2,0.25;0.2,0.25;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.PannerNode;79;-3325.074,-1061.148;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SamplerNode;43;-3139.226,-1090.933;Inherit;True;Property;_NoiseDistortionTexture;Noise Distortion Texture;5;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;45;-2850.273,-931.5964;Inherit;False;Constant;_Float0;Float 0;8;0;Create;True;0;0;0;False;0;False;0.1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;52;-2649.515,-924.5201;Inherit;False;Property;_Distortion;Distortion;22;0;Create;True;0;0;0;False;0;False;1;1.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;44;-2707.083,-1058.478;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0.1;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;210;-7019.084,-1172.157;Inherit;False;2458.886;1220.625;Noises;23;205;241;245;243;62;242;55;24;54;61;78;71;80;69;202;60;26;29;203;58;25;59;282;;0,0,0,1;0;0
Node;AmplifyShaderEditor.Vector2Node;25;-6957.598,-1025.96;Inherit;False;Property;_Noise01Scale;Noise 01 Scale;6;0;Create;True;0;0;0;False;0;False;0.8,0.8;3,3;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.Vector2Node;59;-6800.541,-387.4911;Inherit;False;Property;_Noise02Scale;Noise 02 Scale;7;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;50;-2474.515,-1059.181;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;202;-6500.976,-61.63034;Inherit;False;200;windSpeed;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;26;-6747.494,-1044.93;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;203;-6726.481,-676.5518;Inherit;False;200;windSpeed;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;219;-5504,1408;Inherit;False;Property;_MaskOffset;Mask Offset;14;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.RegisterLocalVarNode;64;-2230.502,-1065.448;Inherit;False;Distortion;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;60;-6555.771,-228.1528;Inherit;False;Property;_Noise02Speed;Noise 02 Speed;11;0;Create;True;0;0;0;False;0;False;-0.2,0.4;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.Vector2Node;217;-5504,1280;Inherit;False;Property;_MaskScale;Mask Scale;13;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.Vector2Node;29;-6729.519,-856.5219;Inherit;False;Property;_Noise01Speed;Noise 01 Speed;10;0;Create;True;0;0;0;False;0;False;0.5,0.5;0.5,0.5;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.TextureCoordinatesNode;58;-6585.835,-406.4763;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;265;-5248,1408;Inherit;False;Property;_MaskSpeed;Mask Speed;28;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;239;-5504,1792;Inherit;False;Property;_MaskMoveScale;Mask Move Scale;12;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.GetLocalVarNode;71;-6310.012,-493.8325;Inherit;False;64;Distortion;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;216;-5248,1280;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0.28,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;273;-5504,896;Inherit;False;Property;_DistortionIntensity;Distortion Intensity;23;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;272;-5504,768;Inherit;False;64;Distortion;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;267;-4864,1408;Inherit;False;200;windSpeed;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.PannerNode;80;-6327.127,-402.6078;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.DynamicAppendNode;264;-5248,1536;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.PannerNode;78;-6497.082,-997.5993;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TexCoordVertexDataNode;213;-5504,2048;Inherit;False;1;4;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;69;-6213.771,-1119.859;Inherit;False;64;Distortion;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;274;-5120,768;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.PannerNode;266;-4864,1280;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;212;-5248,1792;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleAddOpNode;54;-6014.026,-1024.589;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.DynamicAppendNode;226;-5248,2048;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleAddOpNode;61;-6121.987,-431.0781;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SamplerNode;24;-5859.776,-855.4482;Inherit;True;Property;_Noise_01_Texture;Noise_01_Texture;0;0;Create;True;0;0;0;False;0;False;-1;None;18fec5444868e3a4ea8d35621cf36657;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleAddOpNode;211;-4608,1792;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleAddOpNode;271;-4608,1280;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SamplerNode;55;-5895.251,-463.06;Inherit;True;Property;_Noise_02_Texture;Noise_02_Texture;1;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;214;-4480,1280;Inherit;True;Property;_MaskTexture;Mask Texture;2;0;Create;True;0;0;0;False;0;False;-1;None;b9f0879f436c46149a1181e72f0b7848;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;206;-4480,1792;Inherit;True;Property;_MaskMoveTexture;Mask Move Texture;3;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;62;-5524.486,-632.6779;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;229;-4096,1920;Inherit;False;Property;_MaskMovePower;Mask Move Power;21;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;242;-5510.76,-413.9599;Inherit;False;Property;_NoisesPower;Noises Power;20;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;222;-4096,1408;Inherit;False;Property;_MaskPower;Mask Power;19;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.PowerNode;283;-4096,1280;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;221;-3840,1408;Inherit;False;Property;_MaskMultiply;Mask Multiply;16;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;243;-5293.606,-405.6702;Inherit;False;Property;_NoisesMultiply;Noises Multiply;18;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;228;-3840,1920;Inherit;False;Property;_MaskMoveMultiply;Mask Move Multiply;17;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.PowerNode;282;-5297.383,-630.7112;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.PowerNode;284;-4096,1792;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;245;-5122.913,-636.1801;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;231;-3840,1792;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;223;-3840,1280;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;241;-4949.154,-633.8939;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;227;-3584,1280;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;232;-3584,1792;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;215;-3328,1536;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;205;-4798.302,-640.9857;Inherit;False;Noises;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;208;-2560,512;Inherit;False;205;Noises;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;285;-3200,1536;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;76;-1552,1152;Inherit;False;Property;_OpacityBoost;Opacity Boost;24;0;Create;True;0;0;0;False;0;False;5;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;280;-306,846;Inherit;False;855;550;Depth Fade;5;277;135;138;137;279;;0,0,0,1;0;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;207;-2560,640;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;270;-896,1408;Inherit;False;Property;_Dissolve;Dissolve;29;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;138;-256,1280;Inherit;False;Property;_DepthFade;Depth Fade;25;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;75;-1536,896;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TexCoordVertexDataNode;134;-1152,1280;Inherit;False;1;4;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleAddOpNode;269;-896,1280;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.DepthFade;137;-256,1152;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;262;-1280,896;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;237;-768,896;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;279;0,1152;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;276;78,1870;Inherit;False;980;849;Camera Offset;8;251;250;252;253;254;255;256;257;;0,0,0,1;0;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;135;128,896;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;251;128,2560;Inherit;False;3;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;250;128,2432;Inherit;False;Property;_CameraOffset;Camera Offset;8;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;252;512,2432;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;277;384,896;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.VertexColorNode;8;-640,-384;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.WorldPosInputsNode;254;128,1920;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.WorldSpaceCameraPos;253;128,2176;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;255;896,2432;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0.01;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;12;640,384;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;256;512,1920;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.RangedFloatNode;240;640,128;Inherit;False;Property;_EmissionIntensity;Emission Intensity;26;0;Create;True;0;0;0;False;0;False;1;42;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;261;-128,-640;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;260;-640,-640;Inherit;False;Property;_Color;Color;4;0;Create;True;0;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;257;896,1920;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SaturateNode;278;896,384;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;236;640,0;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;384,-640;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;153;1240.997,-3.856106;Float;False;True;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;11;Vefects/SH_Vefects_VFX_Particles_Erosion;7f5cb9c3ea6481f469fdd856555439ef;True;Forward Unlit;0;0;Forward Unlit;9;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;3;RenderPipeline=HDRenderPipeline;RenderType=TransparentCutout=RenderType;Queue=Transparent=Queue=0;True;5;True;7;d3d11;metal;vulkan;xboxone;xboxseries;playstation;switch;0;False;True;1;0;True;-20;0;True;-21;1;0;True;-22;0;True;-23;False;False;False;False;False;False;False;False;False;False;False;False;True;0;True;-26;False;False;False;False;False;False;False;False;False;True;True;0;True;-5;255;False;-1;255;True;-6;7;False;-1;3;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;0;True;-24;True;0;True;-32;False;True;1;LightMode=ForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;29;Surface Type;0; Rendering Pass ;0; Rendering Pass;1; Blending Mode;0; Receive Fog;1; Distortion;0; Distortion Mode;0; Distortion Only;1; Depth Write;1; Cull Mode;0; Depth Test;4;Double-Sided;0;Alpha Clipping;0;Motion Vectors;1; Add Precomputed Velocity;0;Shadow Matte;0;Cast Shadows;1;DOTS Instancing;0;GPU Instancing;1;Tessellation;0; Phong;0; Strength;0.5,False,-1; Type;0; Tess;16,False,-1; Min;10,False,-1; Max;25,False,-1; Edge Length;16,False,-1; Max Displacement;25,False,-1;Vertex Position,InvertActionOnDeselection;1;0;7;True;True;True;True;True;True;False;False;;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;158;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;11;New Amplify Shader;7f5cb9c3ea6481f469fdd856555439ef;True;Motion Vectors;0;5;Motion Vectors;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;3;RenderPipeline=HDRenderPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;7;d3d11;metal;vulkan;xboxone;xboxseries;playstation;switch;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;0;True;-26;False;False;False;False;False;False;False;False;False;True;True;0;True;-9;255;False;-1;255;True;-10;7;False;-1;3;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;False;False;True;1;LightMode=MotionVectors;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;155;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;11;New Amplify Shader;7f5cb9c3ea6481f469fdd856555439ef;True;META;0;2;META;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;3;RenderPipeline=HDRenderPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;7;d3d11;metal;vulkan;xboxone;xboxseries;playstation;switch;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;156;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;11;New Amplify Shader;7f5cb9c3ea6481f469fdd856555439ef;True;SceneSelectionPass;0;3;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;3;RenderPipeline=HDRenderPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;7;d3d11;metal;vulkan;xboxone;xboxseries;playstation;switch;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;0;True;-26;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=SceneSelectionPass;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;157;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;11;New Amplify Shader;7f5cb9c3ea6481f469fdd856555439ef;True;DepthForwardOnly;0;4;DepthForwardOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;3;RenderPipeline=HDRenderPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;7;d3d11;metal;vulkan;xboxone;xboxseries;playstation;switch;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;0;True;-26;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;True;True;0;True;-7;255;False;-1;255;True;-8;7;False;-1;3;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;False;False;True;1;LightMode=DepthForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;154;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;11;New Amplify Shader;7f5cb9c3ea6481f469fdd856555439ef;True;ShadowCaster;0;1;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;3;RenderPipeline=HDRenderPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;7;d3d11;metal;vulkan;xboxone;xboxseries;playstation;switch;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;0;True;-26;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;159;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;11;New Amplify Shader;7f5cb9c3ea6481f469fdd856555439ef;True;DistortionVectors;0;6;DistortionVectors;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;3;RenderPipeline=HDRenderPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;7;d3d11;metal;vulkan;xboxone;xboxseries;playstation;switch;0;False;True;4;1;False;-1;1;False;-1;4;1;False;-1;1;False;-1;True;1;False;-1;1;False;-1;False;False;False;False;False;False;False;False;False;False;False;True;0;True;-26;False;False;False;False;False;False;False;False;False;True;True;0;True;-11;255;False;-1;255;True;-12;7;False;-1;3;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;2;False;-1;True;3;False;-1;False;True;1;LightMode=DistortionVectors;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
WireConnection;199;0;197;0
WireConnection;199;1;198;0
WireConnection;200;0;199;0
WireConnection;30;0;31;0
WireConnection;79;0;30;0
WireConnection;79;2;32;0
WireConnection;79;1;204;0
WireConnection;43;1;79;0
WireConnection;44;0;43;1
WireConnection;44;1;45;0
WireConnection;50;0;44;0
WireConnection;50;1;52;0
WireConnection;26;0;25;0
WireConnection;64;0;50;0
WireConnection;58;0;59;0
WireConnection;216;0;217;0
WireConnection;216;1;219;0
WireConnection;80;0;58;0
WireConnection;80;2;60;0
WireConnection;80;1;202;0
WireConnection;264;0;265;0
WireConnection;78;0;26;0
WireConnection;78;2;29;0
WireConnection;78;1;203;0
WireConnection;274;0;272;0
WireConnection;274;1;273;0
WireConnection;266;0;216;0
WireConnection;266;2;264;0
WireConnection;266;1;267;0
WireConnection;212;0;239;0
WireConnection;54;0;69;0
WireConnection;54;1;78;0
WireConnection;226;0;213;3
WireConnection;226;1;213;4
WireConnection;61;0;71;0
WireConnection;61;1;80;0
WireConnection;24;1;54;0
WireConnection;211;0;212;0
WireConnection;211;1;226;0
WireConnection;271;0;274;0
WireConnection;271;1;266;0
WireConnection;55;1;61;0
WireConnection;214;1;271;0
WireConnection;206;1;211;0
WireConnection;62;0;24;1
WireConnection;62;1;55;1
WireConnection;283;0;214;1
WireConnection;283;1;222;0
WireConnection;282;0;62;0
WireConnection;282;1;242;0
WireConnection;284;0;206;1
WireConnection;284;1;229;0
WireConnection;245;0;282;0
WireConnection;245;1;243;0
WireConnection;231;0;284;0
WireConnection;231;1;228;0
WireConnection;223;0;283;0
WireConnection;223;1;221;0
WireConnection;241;0;245;0
WireConnection;227;0;223;0
WireConnection;232;0;231;0
WireConnection;215;0;227;0
WireConnection;215;1;232;0
WireConnection;205;0;241;0
WireConnection;285;0;215;0
WireConnection;207;0;285;0
WireConnection;207;1;208;0
WireConnection;75;0;207;0
WireConnection;75;1;76;0
WireConnection;269;0;134;1
WireConnection;269;1;270;0
WireConnection;137;0;138;0
WireConnection;262;0;75;0
WireConnection;237;0;262;0
WireConnection;237;1;269;0
WireConnection;279;0;137;0
WireConnection;135;0;237;0
WireConnection;135;1;279;0
WireConnection;252;0;250;0
WireConnection;252;1;251;2
WireConnection;277;0;135;0
WireConnection;255;0;252;0
WireConnection;12;0;8;4
WireConnection;12;1;277;0
WireConnection;256;0;254;0
WireConnection;256;1;253;0
WireConnection;261;0;260;0
WireConnection;261;1;8;0
WireConnection;257;0;256;0
WireConnection;257;1;255;0
WireConnection;278;0;12;0
WireConnection;236;0;10;0
WireConnection;236;1;240;0
WireConnection;10;0;261;0
WireConnection;10;1;207;0
WireConnection;153;0;10;0
WireConnection;153;1;236;0
WireConnection;153;2;278;0
WireConnection;153;6;257;0
ASEEND*/
//CHKSM=64AD6BC2F0283AA66E18FBE45C2772F638E7E472