2856 lines
127 KiB
GLSL
2856 lines
127 KiB
GLSL
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "Vefects/SH_Vefects_VFX_Fire_Flames"
|
|
{
|
|
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" {}
|
|
_ColorGradientMask("Color Gradient Mask", 2D) = "white" {}
|
|
_DistortionMaskTexture("Distortion Mask Texture", 2D) = "white" {}
|
|
_Mask_Texture("Mask_Texture", 2D) = "white" {}
|
|
_TextureSample2("Texture Sample 2", 2D) = "white" {}
|
|
_ColorBottom("Color Bottom", Color) = (1,0.3666667,0,0)
|
|
_ColorTop("Color Top", Color) = (1,0.6666667,0,0)
|
|
_NoiseDistortion_Texture("NoiseDistortion_Texture", 2D) = "white" {}
|
|
_Noise_01_Scale("Noise_01_Scale", Vector) = (0.8,0.8,0,0)
|
|
_Noise_02_Scale("Noise_02_Scale", Vector) = (1,1,0,0)
|
|
_CameraOffset("CameraOffset", Float) = 0
|
|
_NoiseDistortion_Scale("NoiseDistortion_Scale", Vector) = (1,1,0,0)
|
|
_Noise_01_Speed("Noise_01_Speed", Vector) = (0.5,0.5,0,0)
|
|
_Noise_02_Speed("Noise_02_Speed", Vector) = (-0.2,0.4,0,0)
|
|
_Mask_Scale("Mask_Scale", Vector) = (1,1,0,0)
|
|
_Mask_Offset("Mask_Offset", Vector) = (0,0,0,0)
|
|
_NoiseDistortion_Speed("NoiseDistortion_Speed", Vector) = (-0.3,-0.3,0,0)
|
|
_Mask_Multiply("Mask_Multiply", Float) = 1
|
|
_Noises_Multiply("Noises_Multiply", Float) = 5
|
|
_Mask_Power("Mask_Power", Float) = 1
|
|
_Noises_Power("Noises_Power", Float) = 1
|
|
_DistortionAmount("Distortion Amount", Float) = 1
|
|
_DistortionMaskIntensity("Distortion Mask Intensity", Float) = 1
|
|
_NoisesOpacityBoost("Noises Opacity Boost", Float) = 1
|
|
_DepthFade("Depth Fade", Float) = 1
|
|
_EmissiveIntensity("Emissive Intensity", Float) = 1
|
|
_WindSpeed("Wind Speed", Float) = 1
|
|
[ASEEnd]_Dissolve("Dissolve", Float) = 0
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
|
|
[HideInInspector]_RenderQueueType("Render Queue Type", Float) = 5
|
|
[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) = 1
|
|
[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;
|
|
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;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START( UnityPerMaterial )
|
|
float4 _ColorBottom;
|
|
float4 _ColorTop;
|
|
float4 _ColorGradientMask_ST;
|
|
float2 _NoiseDistortion_Speed;
|
|
float2 _NoiseDistortion_Scale;
|
|
float2 _Mask_Scale;
|
|
float2 _Mask_Offset;
|
|
float2 _Noise_02_Scale;
|
|
float2 _Noise_01_Speed;
|
|
float2 _Noise_01_Scale;
|
|
float2 _Noise_02_Speed;
|
|
float _CameraOffset;
|
|
float _EmissiveIntensity;
|
|
float _NoisesOpacityBoost;
|
|
float _Noises_Multiply;
|
|
float _Noises_Power;
|
|
float _Mask_Power;
|
|
float _Dissolve;
|
|
float _DistortionMaskIntensity;
|
|
float _DistortionAmount;
|
|
float _WindSpeed;
|
|
float _Mask_Multiply;
|
|
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 _ColorGradientMask;
|
|
sampler2D _Mask_Texture;
|
|
sampler2D _DistortionMaskTexture;
|
|
sampler2D _NoiseDistortion_Texture;
|
|
sampler2D _Noise_01_Texture;
|
|
sampler2D _Noise_02_Texture;
|
|
sampler2D _TextureSample2;
|
|
|
|
|
|
#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 );
|
|
float3 CameraOffset280 = ( ( ase_worldPos - _WorldSpaceCameraPos ) * float3( ( ( texCoord251 + _CameraOffset ) * float2( 0.01,0 ) ) , 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_texcoord1.xy = inputMesh.ase_texcoord.xy;
|
|
|
|
//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 = CameraOffset280;
|
|
#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;
|
|
|
|
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;
|
|
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;
|
|
#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;
|
|
float2 uv_ColorGradientMask = packedInput.ase_texcoord1.xy * _ColorGradientMask_ST.xy + _ColorGradientMask_ST.zw;
|
|
float4 lerpResult285 = lerp( _ColorBottom , _ColorTop , tex2D( _ColorGradientMask, uv_ColorGradientMask ).r);
|
|
float2 texCoord278 = packedInput.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
|
|
float2 texCoord30 = packedInput.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner79 = ( windSpeed200 * _NoiseDistortion_Speed + ( texCoord30 * _NoiseDistortion_Scale ));
|
|
float Distortion64 = ( ( tex2D( _NoiseDistortion_Texture, panner79 ).r * 0.1 ) * _DistortionAmount );
|
|
float2 texCoord216 = packedInput.ase_texcoord1.xy * _Mask_Scale + _Mask_Offset;
|
|
float2 texCoord26 = packedInput.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner78 = ( windSpeed200 * _Noise_01_Speed + ( texCoord26 * _Noise_01_Scale ));
|
|
float2 texCoord58 = packedInput.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner80 = ( windSpeed200 * _Noise_02_Speed + ( texCoord58 * _Noise_02_Scale ));
|
|
float noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( panner78 + Distortion64 ) ).r * tex2D( _Noise_02_Texture, ( panner80 + Distortion64 ) ).r ) , _Noises_Power ) * _Noises_Multiply ) );
|
|
float2 texCoord294 = packedInput.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float temp_output_288_0 = ( saturate( ( pow( tex2D( _Mask_Texture, ( ( tex2D( _DistortionMaskTexture, texCoord278 ).r * ( Distortion64 * _DistortionMaskIntensity ) ) + texCoord216 ) ).r , _Mask_Power ) * _Mask_Multiply ) ) - ( ( noises205 * _NoisesOpacityBoost ) * tex2D( _TextureSample2, texCoord294 ).r ) );
|
|
float4 temp_output_10_0 = ( ( packedInput.ase_color * lerpResult285 ) * temp_output_288_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 * _EmissiveIntensity ).rgb;
|
|
surfaceDescription.Alpha = saturate( ( ( ( temp_output_288_0 - _Dissolve ) * saturate( distanceDepth137 ) ) * packedInput.ase_color.a ) );
|
|
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_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 positionCS : SV_Position;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START( UnityPerMaterial )
|
|
float4 _ColorBottom;
|
|
float4 _ColorTop;
|
|
float4 _ColorGradientMask_ST;
|
|
float2 _NoiseDistortion_Speed;
|
|
float2 _NoiseDistortion_Scale;
|
|
float2 _Mask_Scale;
|
|
float2 _Mask_Offset;
|
|
float2 _Noise_02_Scale;
|
|
float2 _Noise_01_Speed;
|
|
float2 _Noise_01_Scale;
|
|
float2 _Noise_02_Speed;
|
|
float _CameraOffset;
|
|
float _EmissiveIntensity;
|
|
float _NoisesOpacityBoost;
|
|
float _Noises_Multiply;
|
|
float _Noises_Power;
|
|
float _Mask_Power;
|
|
float _Dissolve;
|
|
float _DistortionMaskIntensity;
|
|
float _DistortionAmount;
|
|
float _WindSpeed;
|
|
float _Mask_Multiply;
|
|
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 _Mask_Texture;
|
|
sampler2D _DistortionMaskTexture;
|
|
sampler2D _NoiseDistortion_Texture;
|
|
sampler2D _Noise_01_Texture;
|
|
sampler2D _Noise_02_Texture;
|
|
sampler2D _TextureSample2;
|
|
|
|
|
|
#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 );
|
|
float3 CameraOffset280 = ( ( ase_worldPos - _WorldSpaceCameraPos ) * float3( ( ( texCoord251 + _CameraOffset ) * float2( 0.01,0 ) ) , 0.0 ) );
|
|
|
|
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
|
|
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
|
|
o.ase_texcoord1 = screenPos;
|
|
|
|
o.ase_texcoord.xy = inputMesh.ase_texcoord.xy;
|
|
o.ase_color = inputMesh.ase_color;
|
|
|
|
//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 = CameraOffset280;
|
|
#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_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
|
|
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_texcoord = v.ase_texcoord;
|
|
o.ase_color = v.ase_color;
|
|
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_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * 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;
|
|
float2 texCoord278 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
|
|
float2 texCoord30 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner79 = ( windSpeed200 * _NoiseDistortion_Speed + ( texCoord30 * _NoiseDistortion_Scale ));
|
|
float Distortion64 = ( ( tex2D( _NoiseDistortion_Texture, panner79 ).r * 0.1 ) * _DistortionAmount );
|
|
float2 texCoord216 = packedInput.ase_texcoord.xy * _Mask_Scale + _Mask_Offset;
|
|
float2 texCoord26 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner78 = ( windSpeed200 * _Noise_01_Speed + ( texCoord26 * _Noise_01_Scale ));
|
|
float2 texCoord58 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner80 = ( windSpeed200 * _Noise_02_Speed + ( texCoord58 * _Noise_02_Scale ));
|
|
float noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( panner78 + Distortion64 ) ).r * tex2D( _Noise_02_Texture, ( panner80 + Distortion64 ) ).r ) , _Noises_Power ) * _Noises_Multiply ) );
|
|
float2 texCoord294 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float temp_output_288_0 = ( saturate( ( pow( tex2D( _Mask_Texture, ( ( tex2D( _DistortionMaskTexture, texCoord278 ).r * ( Distortion64 * _DistortionMaskIntensity ) ) + texCoord216 ) ).r , _Mask_Power ) * _Mask_Multiply ) ) - ( ( noises205 * _NoisesOpacityBoost ) * tex2D( _TextureSample2, texCoord294 ).r ) );
|
|
float4 screenPos = packedInput.ase_texcoord1;
|
|
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( ( ( ( temp_output_288_0 - _Dissolve ) * saturate( distanceDepth137 ) ) * packedInput.ase_color.a ) );
|
|
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 _ColorBottom;
|
|
float4 _ColorTop;
|
|
float4 _ColorGradientMask_ST;
|
|
float2 _NoiseDistortion_Speed;
|
|
float2 _NoiseDistortion_Scale;
|
|
float2 _Mask_Scale;
|
|
float2 _Mask_Offset;
|
|
float2 _Noise_02_Scale;
|
|
float2 _Noise_01_Speed;
|
|
float2 _Noise_01_Scale;
|
|
float2 _Noise_02_Speed;
|
|
float _CameraOffset;
|
|
float _EmissiveIntensity;
|
|
float _NoisesOpacityBoost;
|
|
float _Noises_Multiply;
|
|
float _Noises_Power;
|
|
float _Mask_Power;
|
|
float _Dissolve;
|
|
float _DistortionMaskIntensity;
|
|
float _DistortionAmount;
|
|
float _WindSpeed;
|
|
float _Mask_Multiply;
|
|
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 _ColorGradientMask;
|
|
sampler2D _Mask_Texture;
|
|
sampler2D _DistortionMaskTexture;
|
|
sampler2D _NoiseDistortion_Texture;
|
|
sampler2D _Noise_01_Texture;
|
|
sampler2D _Noise_02_Texture;
|
|
sampler2D _TextureSample2;
|
|
|
|
|
|
#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;
|
|
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 );
|
|
float3 CameraOffset280 = ( ( ase_worldPos - _WorldSpaceCameraPos ) * float3( ( ( texCoord251 + _CameraOffset ) * float2( 0.01,0 ) ) , 0.0 ) );
|
|
|
|
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
|
|
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
|
|
o.ase_texcoord1 = screenPos;
|
|
|
|
o.ase_color = inputMesh.ase_color;
|
|
o.ase_texcoord.xy = inputMesh.ase_texcoord.xy;
|
|
|
|
//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 = CameraOffset280;
|
|
#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;
|
|
float2 uv_ColorGradientMask = packedInput.ase_texcoord.xy * _ColorGradientMask_ST.xy + _ColorGradientMask_ST.zw;
|
|
float4 lerpResult285 = lerp( _ColorBottom , _ColorTop , tex2D( _ColorGradientMask, uv_ColorGradientMask ).r);
|
|
float2 texCoord278 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
|
|
float2 texCoord30 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner79 = ( windSpeed200 * _NoiseDistortion_Speed + ( texCoord30 * _NoiseDistortion_Scale ));
|
|
float Distortion64 = ( ( tex2D( _NoiseDistortion_Texture, panner79 ).r * 0.1 ) * _DistortionAmount );
|
|
float2 texCoord216 = packedInput.ase_texcoord.xy * _Mask_Scale + _Mask_Offset;
|
|
float2 texCoord26 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner78 = ( windSpeed200 * _Noise_01_Speed + ( texCoord26 * _Noise_01_Scale ));
|
|
float2 texCoord58 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner80 = ( windSpeed200 * _Noise_02_Speed + ( texCoord58 * _Noise_02_Scale ));
|
|
float noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( panner78 + Distortion64 ) ).r * tex2D( _Noise_02_Texture, ( panner80 + Distortion64 ) ).r ) , _Noises_Power ) * _Noises_Multiply ) );
|
|
float2 texCoord294 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float temp_output_288_0 = ( saturate( ( pow( tex2D( _Mask_Texture, ( ( tex2D( _DistortionMaskTexture, texCoord278 ).r * ( Distortion64 * _DistortionMaskIntensity ) ) + texCoord216 ) ).r , _Mask_Power ) * _Mask_Multiply ) ) - ( ( noises205 * _NoisesOpacityBoost ) * tex2D( _TextureSample2, texCoord294 ).r ) );
|
|
float4 temp_output_10_0 = ( ( packedInput.ase_color * lerpResult285 ) * temp_output_288_0 );
|
|
|
|
float4 screenPos = packedInput.ase_texcoord1;
|
|
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 * _EmissiveIntensity ).rgb;
|
|
surfaceDescription.Alpha = saturate( ( ( ( temp_output_288_0 - _Dissolve ) * saturate( distanceDepth137 ) ) * packedInput.ase_color.a ) );
|
|
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 _ColorBottom;
|
|
float4 _ColorTop;
|
|
float4 _ColorGradientMask_ST;
|
|
float2 _NoiseDistortion_Speed;
|
|
float2 _NoiseDistortion_Scale;
|
|
float2 _Mask_Scale;
|
|
float2 _Mask_Offset;
|
|
float2 _Noise_02_Scale;
|
|
float2 _Noise_01_Speed;
|
|
float2 _Noise_01_Scale;
|
|
float2 _Noise_02_Speed;
|
|
float _CameraOffset;
|
|
float _EmissiveIntensity;
|
|
float _NoisesOpacityBoost;
|
|
float _Noises_Multiply;
|
|
float _Noises_Power;
|
|
float _Mask_Power;
|
|
float _Dissolve;
|
|
float _DistortionMaskIntensity;
|
|
float _DistortionAmount;
|
|
float _WindSpeed;
|
|
float _Mask_Multiply;
|
|
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 _Mask_Texture;
|
|
sampler2D _DistortionMaskTexture;
|
|
sampler2D _NoiseDistortion_Texture;
|
|
sampler2D _Noise_01_Texture;
|
|
sampler2D _Noise_02_Texture;
|
|
sampler2D _TextureSample2;
|
|
|
|
|
|
#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_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 positionCS : SV_Position;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
float4 ase_color : COLOR;
|
|
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 );
|
|
float3 CameraOffset280 = ( ( ase_worldPos - _WorldSpaceCameraPos ) * float3( ( ( texCoord251 + _CameraOffset ) * float2( 0.01,0 ) ) , 0.0 ) );
|
|
|
|
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
|
|
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
|
|
o.ase_texcoord1 = screenPos;
|
|
|
|
o.ase_texcoord.xy = inputMesh.ase_texcoord.xy;
|
|
o.ase_color = inputMesh.ase_color;
|
|
|
|
//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 = CameraOffset280;
|
|
#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_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
|
|
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_texcoord = v.ase_texcoord;
|
|
o.ase_color = v.ase_color;
|
|
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_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * 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;
|
|
float2 texCoord278 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
|
|
float2 texCoord30 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner79 = ( windSpeed200 * _NoiseDistortion_Speed + ( texCoord30 * _NoiseDistortion_Scale ));
|
|
float Distortion64 = ( ( tex2D( _NoiseDistortion_Texture, panner79 ).r * 0.1 ) * _DistortionAmount );
|
|
float2 texCoord216 = packedInput.ase_texcoord.xy * _Mask_Scale + _Mask_Offset;
|
|
float2 texCoord26 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner78 = ( windSpeed200 * _Noise_01_Speed + ( texCoord26 * _Noise_01_Scale ));
|
|
float2 texCoord58 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner80 = ( windSpeed200 * _Noise_02_Speed + ( texCoord58 * _Noise_02_Scale ));
|
|
float noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( panner78 + Distortion64 ) ).r * tex2D( _Noise_02_Texture, ( panner80 + Distortion64 ) ).r ) , _Noises_Power ) * _Noises_Multiply ) );
|
|
float2 texCoord294 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float temp_output_288_0 = ( saturate( ( pow( tex2D( _Mask_Texture, ( ( tex2D( _DistortionMaskTexture, texCoord278 ).r * ( Distortion64 * _DistortionMaskIntensity ) ) + texCoord216 ) ).r , _Mask_Power ) * _Mask_Multiply ) ) - ( ( noises205 * _NoisesOpacityBoost ) * tex2D( _TextureSample2, texCoord294 ).r ) );
|
|
float4 screenPos = packedInput.ase_texcoord1;
|
|
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( ( ( ( temp_output_288_0 - _Dissolve ) * saturate( distanceDepth137 ) ) * packedInput.ase_color.a ) );
|
|
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 _ColorBottom;
|
|
float4 _ColorTop;
|
|
float4 _ColorGradientMask_ST;
|
|
float2 _NoiseDistortion_Speed;
|
|
float2 _NoiseDistortion_Scale;
|
|
float2 _Mask_Scale;
|
|
float2 _Mask_Offset;
|
|
float2 _Noise_02_Scale;
|
|
float2 _Noise_01_Speed;
|
|
float2 _Noise_01_Scale;
|
|
float2 _Noise_02_Speed;
|
|
float _CameraOffset;
|
|
float _EmissiveIntensity;
|
|
float _NoisesOpacityBoost;
|
|
float _Noises_Multiply;
|
|
float _Noises_Power;
|
|
float _Mask_Power;
|
|
float _Dissolve;
|
|
float _DistortionMaskIntensity;
|
|
float _DistortionAmount;
|
|
float _WindSpeed;
|
|
float _Mask_Multiply;
|
|
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 _Mask_Texture;
|
|
sampler2D _DistortionMaskTexture;
|
|
sampler2D _NoiseDistortion_Texture;
|
|
sampler2D _Noise_01_Texture;
|
|
sampler2D _Noise_02_Texture;
|
|
sampler2D _TextureSample2;
|
|
|
|
|
|
#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_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 positionCS : SV_Position;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
float4 ase_color : COLOR;
|
|
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 );
|
|
float3 CameraOffset280 = ( ( ase_worldPos - _WorldSpaceCameraPos ) * float3( ( ( texCoord251 + _CameraOffset ) * float2( 0.01,0 ) ) , 0.0 ) );
|
|
|
|
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
|
|
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
|
|
o.ase_texcoord1 = screenPos;
|
|
|
|
o.ase_texcoord.xy = inputMesh.ase_texcoord.xy;
|
|
o.ase_color = inputMesh.ase_color;
|
|
|
|
//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 = CameraOffset280;
|
|
#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_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
|
|
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_texcoord = v.ase_texcoord;
|
|
o.ase_color = v.ase_color;
|
|
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_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * 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;
|
|
float2 texCoord278 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
|
|
float2 texCoord30 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner79 = ( windSpeed200 * _NoiseDistortion_Speed + ( texCoord30 * _NoiseDistortion_Scale ));
|
|
float Distortion64 = ( ( tex2D( _NoiseDistortion_Texture, panner79 ).r * 0.1 ) * _DistortionAmount );
|
|
float2 texCoord216 = packedInput.ase_texcoord.xy * _Mask_Scale + _Mask_Offset;
|
|
float2 texCoord26 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner78 = ( windSpeed200 * _Noise_01_Speed + ( texCoord26 * _Noise_01_Scale ));
|
|
float2 texCoord58 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner80 = ( windSpeed200 * _Noise_02_Speed + ( texCoord58 * _Noise_02_Scale ));
|
|
float noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( panner78 + Distortion64 ) ).r * tex2D( _Noise_02_Texture, ( panner80 + Distortion64 ) ).r ) , _Noises_Power ) * _Noises_Multiply ) );
|
|
float2 texCoord294 = packedInput.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float temp_output_288_0 = ( saturate( ( pow( tex2D( _Mask_Texture, ( ( tex2D( _DistortionMaskTexture, texCoord278 ).r * ( Distortion64 * _DistortionMaskIntensity ) ) + texCoord216 ) ).r , _Mask_Power ) * _Mask_Multiply ) ) - ( ( noises205 * _NoisesOpacityBoost ) * tex2D( _TextureSample2, texCoord294 ).r ) );
|
|
float4 screenPos = packedInput.ase_texcoord1;
|
|
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( ( ( ( temp_output_288_0 - _Dissolve ) * saturate( distanceDepth137 ) ) * packedInput.ase_color.a ) );
|
|
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 _ColorBottom;
|
|
float4 _ColorTop;
|
|
float4 _ColorGradientMask_ST;
|
|
float2 _NoiseDistortion_Speed;
|
|
float2 _NoiseDistortion_Scale;
|
|
float2 _Mask_Scale;
|
|
float2 _Mask_Offset;
|
|
float2 _Noise_02_Scale;
|
|
float2 _Noise_01_Speed;
|
|
float2 _Noise_01_Scale;
|
|
float2 _Noise_02_Speed;
|
|
float _CameraOffset;
|
|
float _EmissiveIntensity;
|
|
float _NoisesOpacityBoost;
|
|
float _Noises_Multiply;
|
|
float _Noises_Power;
|
|
float _Mask_Power;
|
|
float _Dissolve;
|
|
float _DistortionMaskIntensity;
|
|
float _DistortionAmount;
|
|
float _WindSpeed;
|
|
float _Mask_Multiply;
|
|
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 _Mask_Texture;
|
|
sampler2D _DistortionMaskTexture;
|
|
sampler2D _NoiseDistortion_Texture;
|
|
sampler2D _Noise_01_Texture;
|
|
sampler2D _Noise_02_Texture;
|
|
sampler2D _TextureSample2;
|
|
|
|
|
|
#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_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 vmeshPositionCS : SV_Position;
|
|
float3 vmeshInterp00 : TEXCOORD0;
|
|
float3 vpassInterpolators0 : TEXCOORD1; //interpolators0
|
|
float3 vpassInterpolators1 : TEXCOORD2; //interpolators1
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
float4 ase_texcoord4 : TEXCOORD4;
|
|
float4 ase_color : COLOR;
|
|
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 );
|
|
float3 CameraOffset280 = ( ( ase_worldPos - _WorldSpaceCameraPos ) * float3( ( ( texCoord251 + _CameraOffset ) * float2( 0.01,0 ) ) , 0.0 ) );
|
|
|
|
float4 ase_clipPos = TransformWorldToHClip( TransformObjectToWorld(inputMesh.positionOS));
|
|
float4 screenPos = ComputeScreenPos( ase_clipPos , _ProjectionParams.x );
|
|
o.ase_texcoord4 = screenPos;
|
|
|
|
o.ase_texcoord3.xy = inputMesh.ase_texcoord.xy;
|
|
o.ase_color = inputMesh.ase_color;
|
|
|
|
//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 = CameraOffset280;
|
|
|
|
#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_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
|
|
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_texcoord = v.ase_texcoord;
|
|
o.ase_color = v.ase_color;
|
|
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_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * 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;
|
|
float2 texCoord278 = packedInput.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float windSpeed200 = ( _WindSpeed * _TimeParameters.x );
|
|
float2 texCoord30 = packedInput.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner79 = ( windSpeed200 * _NoiseDistortion_Speed + ( texCoord30 * _NoiseDistortion_Scale ));
|
|
float Distortion64 = ( ( tex2D( _NoiseDistortion_Texture, panner79 ).r * 0.1 ) * _DistortionAmount );
|
|
float2 texCoord216 = packedInput.ase_texcoord3.xy * _Mask_Scale + _Mask_Offset;
|
|
float2 texCoord26 = packedInput.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner78 = ( windSpeed200 * _Noise_01_Speed + ( texCoord26 * _Noise_01_Scale ));
|
|
float2 texCoord58 = packedInput.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 panner80 = ( windSpeed200 * _Noise_02_Speed + ( texCoord58 * _Noise_02_Scale ));
|
|
float noises205 = saturate( ( pow( ( tex2D( _Noise_01_Texture, ( panner78 + Distortion64 ) ).r * tex2D( _Noise_02_Texture, ( panner80 + Distortion64 ) ).r ) , _Noises_Power ) * _Noises_Multiply ) );
|
|
float2 texCoord294 = packedInput.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0.4 );
|
|
float temp_output_288_0 = ( saturate( ( pow( tex2D( _Mask_Texture, ( ( tex2D( _DistortionMaskTexture, texCoord278 ).r * ( Distortion64 * _DistortionMaskIntensity ) ) + texCoord216 ) ).r , _Mask_Power ) * _Mask_Multiply ) ) - ( ( noises205 * _NoisesOpacityBoost ) * tex2D( _TextureSample2, texCoord294 ).r ) );
|
|
float4 screenPos = packedInput.ase_texcoord4;
|
|
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( ( ( ( temp_output_288_0 - _Dissolve ) * saturate( distanceDepth137 ) ) * packedInput.ase_color.a ) );
|
|
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
|
|
651;593;2546;1105;637.9704;345.371;1;True;True
|
|
Node;AmplifyShaderEditor.CommentaryNode;296;-7897.352,-1687.733;Inherit;False;786;417;Register Wind Speed;4;198;199;197;200;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;197;-7847.352,-1637.733;Inherit;False;Property;_WindSpeed;Wind Speed;27;0;Create;True;0;0;0;False;0;False;1;-2;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleTimeNode;198;-7847.352,-1381.733;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;77;-4678.076,-2074.111;Inherit;False;2502.5;663.612;Heat Haze;12;50;64;44;52;43;45;79;32;204;30;31;301;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;199;-7591.352,-1637.733;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;31;-4480,-1792;Inherit;False;Property;_NoiseDistortion_Scale;NoiseDistortion_Scale;12;0;Create;True;0;0;0;False;0;False;1,1;2,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.RegisterLocalVarNode;200;-7335.352,-1637.733;Inherit;False;windSpeed;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;30;-4480,-1920;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;-3584,-1664;Inherit;False;200;windSpeed;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;32;-3968,-1792;Inherit;False;Property;_NoiseDistortion_Speed;NoiseDistortion_Speed;17;0;Create;True;0;0;0;False;0;False;-0.3,-0.3;0.3,0.6;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;301;-4224,-1920;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.PannerNode;79;-3584,-1920;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;45;-2944,-1792;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.SamplerNode;43;-3328,-1920;Inherit;True;Property;_NoiseDistortion_Texture;NoiseDistortion_Texture;8;0;Create;True;0;0;0;False;0;False;-1;None;78f9606de07f24a4f9ff540cc0087f36;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.CommentaryNode;210;-7892.875,-1147.271;Inherit;False;2997.113;1074.221;Noises;25;299;242;243;205;55;71;61;241;245;62;24;60;202;69;80;59;298;58;203;78;29;25;297;26;54;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;52;-2688,-1792;Inherit;False;Property;_DistortionAmount;Distortion Amount;22;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;44;-2944,-1920;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0.1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;50;-2688,-1920;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;58;-7808,-512;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.Vector2Node;59;-7808,-384;Inherit;False;Property;_Noise_02_Scale;Noise_02_Scale;10;0;Create;True;0;0;0;False;0;False;1,1;2,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;26;-7808,-1024;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.Vector2Node;25;-7808,-896;Inherit;False;Property;_Noise_01_Scale;Noise_01_Scale;9;0;Create;True;0;0;0;False;0;False;0.8,0.8;2,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;298;-7552,-512;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;202;-7168,-256;Inherit;False;200;windSpeed;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;60;-7424,-384;Inherit;False;Property;_Noise_02_Speed;Noise_02_Speed;14;0;Create;True;0;0;0;False;0;False;-0.2,0.4;0.25,0.25;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;297;-7552,-1024;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.Vector2Node;29;-7424,-896;Inherit;False;Property;_Noise_01_Speed;Noise_01_Speed;13;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.RegisterLocalVarNode;64;-2432,-1920;Inherit;False;Distortion;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;203;-7168,-768;Inherit;False;200;windSpeed;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.PannerNode;80;-7168,-512;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;71;-6912,-256;Inherit;False;64;Distortion;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.PannerNode;78;-7168,-1024;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;69;-6912,-768;Inherit;False;64;Distortion;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;61;-6912,-512;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;54;-6912,-1024;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SamplerNode;55;-6656,-512;Inherit;True;Property;_Noise_02_Texture;Noise_02_Texture;1;0;Create;True;0;0;0;False;0;False;-1;None;4c7b88daf72dcdb4d85c35517cee3224;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.CommentaryNode;303;-4530,-946;Inherit;False;980;550;Distortion Mask;6;279;278;277;272;273;274;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.SamplerNode;24;-6656,-1024;Inherit;True;Property;_Noise_01_Texture;Noise_01_Texture;0;0;Create;True;0;0;0;False;0;False;-1;None;f1b6b10620016be45b38159cac55e09b;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.TextureCoordinatesNode;278;-4480,-896;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0.4;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;62;-6272,-1024;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;273;-4480,-512;Inherit;False;Property;_DistortionMaskIntensity;Distortion Mask Intensity;23;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;272;-4480,-640;Inherit;False;64;Distortion;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;313;-4530,206;Inherit;False;2391;470;Flame Mask;10;217;271;216;219;304;227;221;223;222;214;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;242;-6016,-896;Inherit;False;Property;_Noises_Power;Noises_Power;21;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;217;-4480,256;Inherit;False;Property;_Mask_Scale;Mask_Scale;15;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SamplerNode;277;-4096,-896;Inherit;True;Property;_DistortionMaskTexture;Distortion Mask 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;274;-3968,-640;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;243;-5760,-896;Inherit;False;Property;_Noises_Multiply;Noises_Multiply;19;0;Create;True;0;0;0;False;0;False;5;3.3;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.PowerNode;299;-6016,-1024;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;219;-4480,512;Inherit;False;Property;_Mask_Offset;Mask_Offset;16;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;279;-3712,-896;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;245;-5760,-1024;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;216;-4096,256;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.SimpleAddOpNode;271;-3584,256;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SaturateNode;241;-5504,-1024;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RegisterLocalVarNode;205;-5248,-1024;Inherit;False;noises;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;314;-3378,846;Inherit;False;2717;536;Erosion;9;237;270;288;289;291;290;293;292;294;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;222;-2944,384;Inherit;False;Property;_Mask_Power;Mask_Power;20;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;214;-3328,256;Inherit;True;Property;_Mask_Texture;Mask_Texture;4;0;Create;True;0;0;0;False;0;False;-1;None;52a074a757c62bc448f9ef266ee7db81;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.PowerNode;304;-2944,256;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;221;-2560,384;Inherit;False;Property;_Mask_Multiply;Mask_Multiply;18;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;290;-3328,1024;Inherit;False;Property;_NoisesOpacityBoost;Noises Opacity Boost;24;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;294;-3328,1152;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0.4;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;289;-3328,896;Inherit;False;205;noises;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;302;-690,1870;Inherit;False;1170;806;Camera Offset;9;254;256;253;257;280;252;251;250;255;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;223;-2560,256;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;291;-2816,896;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;292;-2816,1152;Inherit;True;Property;_TextureSample2;Texture Sample 2;5;0;Create;True;0;0;0;False;0;False;-1;None;e4032b025693bfb47ae0e50da323b3b1;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.CommentaryNode;311;-178,830;Inherit;False;596;694;Depth Fade;4;135;137;310;138;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;293;-2304,896;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SaturateNode;227;-2304,256;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;250;-640,2560;Inherit;False;Property;_CameraOffset;CameraOffset;11;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;251;-640,2432;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;138;-128,1408;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.WorldSpaceCameraPos;253;-640,2176;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
|
|
Node;AmplifyShaderEditor.WorldPosInputsNode;254;-640,1920;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;252;-384,2429.268;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.DepthFade;137;-128,1280;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;270;-1152,1024;Inherit;False;Property;_Dissolve;Dissolve;28;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode;288;-1792,896;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;315;-1458,-818;Inherit;False;2580;1190;Color;9;10;240;236;283;287;260;285;307;306;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;255;-128,2432;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0.01,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode;237;-896,896;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SaturateNode;310;128,1280;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode;256;-256,1920;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;257;0,1920;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT2;0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;312;846,846;Inherit;False;471;185;Particle System Opacity;2;308;309;;0,0,0,1;0;0
|
|
Node;AmplifyShaderEditor.VertexColorNode;306;-896,-768;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;135;256,880;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;308;896,896;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RegisterLocalVarNode;280;256,1920;Inherit;False;CameraOffset;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SamplerNode;283;-1408,128;Inherit;True;Property;_ColorGradientMask;Color Gradient Mask;2;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.ColorNode;287;-1408,-384;Inherit;False;Property;_ColorBottom;Color Bottom;6;0;Create;True;0;0;0;False;0;False;1,0.3666667,0,0;1,0.3666666,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;281;2048,384;Inherit;False;280;CameraOffset;1;0;OBJECT;;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;307;-512,-768;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;190.8025,-7.698912;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;236;896,128;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ColorNode;260;-1408,-128;Inherit;False;Property;_ColorTop;Color Top;7;0;Create;True;0;0;0;False;0;False;1,0.6666667,0,0;1,0.6666667,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.LerpOp;285;-1024,-384;Inherit;True;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;240;896,256;Inherit;False;Property;_EmissiveIntensity;Emissive Intensity;26;0;Create;True;0;0;0;False;0;False;1;55;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SaturateNode;309;1152,896;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;154;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;13;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;153;2304,0;Float;False;True;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;11;Vefects/SH_Vefects_VFX_Fire_Flames;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;1; 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;156;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;13;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;158;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;13;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;13;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;157;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;13;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;159;1345.189,-12.06397;Float;False;False;-1;2;Rendering.HighDefinition.HDUnlitGUI;0;13;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;301;0;30;0
|
|
WireConnection;301;1;31;0
|
|
WireConnection;79;0;301;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;298;0;58;0
|
|
WireConnection;298;1;59;0
|
|
WireConnection;297;0;26;0
|
|
WireConnection;297;1;25;0
|
|
WireConnection;64;0;50;0
|
|
WireConnection;80;0;298;0
|
|
WireConnection;80;2;60;0
|
|
WireConnection;80;1;202;0
|
|
WireConnection;78;0;297;0
|
|
WireConnection;78;2;29;0
|
|
WireConnection;78;1;203;0
|
|
WireConnection;61;0;80;0
|
|
WireConnection;61;1;71;0
|
|
WireConnection;54;0;78;0
|
|
WireConnection;54;1;69;0
|
|
WireConnection;55;1;61;0
|
|
WireConnection;24;1;54;0
|
|
WireConnection;62;0;24;1
|
|
WireConnection;62;1;55;1
|
|
WireConnection;277;1;278;0
|
|
WireConnection;274;0;272;0
|
|
WireConnection;274;1;273;0
|
|
WireConnection;299;0;62;0
|
|
WireConnection;299;1;242;0
|
|
WireConnection;279;0;277;1
|
|
WireConnection;279;1;274;0
|
|
WireConnection;245;0;299;0
|
|
WireConnection;245;1;243;0
|
|
WireConnection;216;0;217;0
|
|
WireConnection;216;1;219;0
|
|
WireConnection;271;0;279;0
|
|
WireConnection;271;1;216;0
|
|
WireConnection;241;0;245;0
|
|
WireConnection;205;0;241;0
|
|
WireConnection;214;1;271;0
|
|
WireConnection;304;0;214;1
|
|
WireConnection;304;1;222;0
|
|
WireConnection;223;0;304;0
|
|
WireConnection;223;1;221;0
|
|
WireConnection;291;0;289;0
|
|
WireConnection;291;1;290;0
|
|
WireConnection;292;1;294;0
|
|
WireConnection;293;0;291;0
|
|
WireConnection;293;1;292;1
|
|
WireConnection;227;0;223;0
|
|
WireConnection;252;0;251;0
|
|
WireConnection;252;1;250;0
|
|
WireConnection;137;0;138;0
|
|
WireConnection;288;0;227;0
|
|
WireConnection;288;1;293;0
|
|
WireConnection;255;0;252;0
|
|
WireConnection;237;0;288;0
|
|
WireConnection;237;1;270;0
|
|
WireConnection;310;0;137;0
|
|
WireConnection;256;0;254;0
|
|
WireConnection;256;1;253;0
|
|
WireConnection;257;0;256;0
|
|
WireConnection;257;1;255;0
|
|
WireConnection;135;0;237;0
|
|
WireConnection;135;1;310;0
|
|
WireConnection;308;0;135;0
|
|
WireConnection;308;1;306;4
|
|
WireConnection;280;0;257;0
|
|
WireConnection;307;0;306;0
|
|
WireConnection;307;1;285;0
|
|
WireConnection;10;0;307;0
|
|
WireConnection;10;1;288;0
|
|
WireConnection;236;0;10;0
|
|
WireConnection;236;1;240;0
|
|
WireConnection;285;0;287;0
|
|
WireConnection;285;1;260;0
|
|
WireConnection;285;2;283;1
|
|
WireConnection;309;0;308;0
|
|
WireConnection;153;0;10;0
|
|
WireConnection;153;1;236;0
|
|
WireConnection;153;2;309;0
|
|
WireConnection;153;6;281;0
|
|
ASEEND*/
|
|
//CHKSM=44DD1A871720C45F441B27FE976969BFF8B2BDBB |