WuhuIsland/Assets/SLZShaders/OpaqueHologram.shader
Jo 5eb961ae8a chore: add MarrowSDK plugin
Signed-off-by: Jo <johannesreckers2006@gmail.com>
2024-08-07 01:40:32 +02:00

3321 lines
No EOL
130 KiB
GLSL

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "SLZ/Hologram Depth fade"
{
Properties
{
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
[ASEBegin]_BaseMap("Base Map", 2D) = "white" {}
_DepthFader("Depth Fader", Float) = 0.15
[NoScaleOffset]_BumpMap("Bump Map", 2D) = "bump" {}
[HDR]_HologramEdgeColor("Hologram Edge Color", Color) = (0.2803489,0.5694646,0.9433962,0.09019608)
[NoScaleOffset]_MetallicGlossMap("Metallic, AO, Smoothness", 2D) = "white" {}
_Noise("Noise", Range( 0 , 1)) = 0.136
_ScanlineSize("ScanlineSize", Float) = 1.5
[ASEEnd][HDR]_EmissionColor("Emission tint", Color) = (1,1,1,1)
[HideInInspector]_QueueOffset("_QueueOffset", Float) = 0
[HideInInspector]_QueueControl("_QueueControl", Float) = -1
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
//_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5
//_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1
//_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5
//_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2
//_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9
//_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1
//_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5
//_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"="UniversalPipeline" "RenderType"="Opaque" "Queue"="Geometry+100" }
Cull Back
ZWrite On
ZTest LEqual
Offset 0,0
AlphaToMask Off
HLSLINCLUDE
#pragma target 5.0
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#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 DistanceFromPlane (float3 pos, float4 plane)
{
float d = dot (float4(pos,1.0f), plane);
return d;
}
bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
{
float4 planeTest;
planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
(( DistanceFromPlane(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"
Tags { "LightMode"="UniversalForward" }
Blend One Zero, One Zero
ColorMask RGBA
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1
#pragma multi_compile_fog
#define ASE_FOG 1
#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED
#define ASE_DEPTH_WRITE_ON
#define _DISABLE_LIGHTMAPS
#define _DISABLE_SSAO
#pragma multi_compile_instancing
#define _EMISSION
#define _NORMALMAP 1
#define ASE_SRP_VERSION 999999
#define ASE_USING_SAMPLING_MACROS 1
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PlatformCompiler.hlsl"
#pragma vertex vert
#pragma fragment frag
#define SHADERPASS SHADERPASS_FORWARD
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#define ASE_NEEDS_FRAG_SCREEN_POSITION
#define ASE_NEEDS_FRAG_WORLD_TANGENT
#define ASE_NEEDS_FRAG_WORLD_NORMAL
#define ASE_NEEDS_FRAG_WORLD_BITANGENT
#define ASE_NEEDS_FRAG_WORLD_VIEW_DIR
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DefaultLitVariants.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
#define ENABLE_TERRAIN_PERPIXEL_NORMAL
#endif
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
float4 ase_tangent : TANGENT;
float4 texcoord : TEXCOORD0;
float4 texcoord1 : TEXCOORD1;
float4 texcoord2 : TEXCOORD2;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
float4 lightmapUVOrVertexSH : TEXCOORD0;
half4 fogFactorAndVertexLight : TEXCOORD1;
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
float4 shadowCoord : TEXCOORD2;
#endif
float4 tSpace0 : TEXCOORD3;
float4 tSpace1 : TEXCOORD4;
float4 tSpace2 : TEXCOORD5;
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
float4 screenPos : TEXCOORD6;
#endif
#if defined(DYNAMICLIGHTMAP_ON)
float2 dynamicLightmapUV : TEXCOORD7;
#endif
float4 ase_texcoord8 : TEXCOORD8;
float4 ase_texcoord9 : TEXCOORD9;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _EmissionColor;
float4 _HologramEdgeColor;
float _Noise;
float _ScanlineSize;
float _DepthFader;
#ifdef _TRANSMISSION_ASE
float _TransmissionShadow;
#endif
#ifdef _TRANSLUCENCY_ASE
float _TransStrength;
float _TransNormal;
float _TransScattering;
float _TransDirect;
float _TransAmbient;
float _TransShadow;
#endif
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
TEXTURE2D(_BumpMap);
SAMPLER(sampler_BumpMap);
TEXTURE2D(_MetallicGlossMap);
inline float4 ASE_ComputeGrabScreenPos( float4 pos )
{
#if UNITY_UV_STARTS_AT_TOP
float scale = -1.0;
#else
float scale = 1.0;
#endif
float4 o = pos;
o.y = pos.w * 0.5f;
o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
return o;
}
inline float4 GetScreenNoiseRGBASlice27_g34( float2 screenUV, float offsetFrame )
{
return GetScreenNoiseRGBAOffset(screenUV, offsetFrame);
}
inline float3 MyCustomExpression( half4 In0 )
{
return UnpackNormal(In0);;
}
real3 ASESafeNormalize(float3 inVec)
{
real dp3 = max(FLT_MIN, dot(inVec, inVec));
return inVec* rsqrt( dp3);
}
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.ase_texcoord8.xy = v.texcoord.xy;
o.ase_texcoord9 = v.vertex;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord8.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.vertex.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
v.ase_normal = v.ase_normal;
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
float3 positionVS = TransformWorldToView( positionWS );
float4 positionCS = TransformWorldToHClip( positionWS );
VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent );
o.tSpace0 = float4( normalInput.normalWS, positionWS.x);
o.tSpace1 = float4( normalInput.tangentWS, positionWS.y);
o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z);
#if defined(LIGHTMAP_ON)
OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy );
#endif
#if defined(DYNAMICLIGHTMAP_ON)
o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
#endif
#if !defined(LIGHTMAP_ON)
OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz );
#endif
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) || defined(ASE_TERRAIN_INSTANCING)
o.lightmapUVOrVertexSH.zw = v.texcoord;
o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw;
#endif
half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS );
#ifdef ASE_FOG
half fogFactor = ComputeFogFactor( positionCS.z );
#else
half fogFactor = 0;
#endif
o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = positionCS;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
o.clipPos = positionCS;
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
o.screenPos = ComputeScreenPos(positionCS);
#endif
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
float4 ase_tangent : TANGENT;
float4 texcoord : TEXCOORD0;
float4 texcoord1 : TEXCOORD1;
float4 texcoord2 : TEXCOORD2;
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.vertex = v.vertex;
o.ase_normal = v.ase_normal;
o.ase_tangent = v.ase_tangent;
o.texcoord = v.texcoord;
o.texcoord1 = v.texcoord1;
o.texcoord2 = v.texcoord2;
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 defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#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.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z;
o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
float phongStrength = _TessPhongStrength;
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE)
#define ASE_SV_DEPTH SV_DepthLessEqual
#else
#define ASE_SV_DEPTH SV_Depth
#endif
half4 frag ( VertexOutput IN
#ifdef ASE_DEPTH_WRITE_ON
,out float outputDepth : ASE_SV_DEPTH
#endif
) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
#ifdef LOD_FADE_CROSSFADE
LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
#endif
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
#else
float3 WorldNormal = normalize( IN.tSpace0.xyz );
float3 WorldTangent = IN.tSpace1.xyz;
float3 WorldBiTangent = IN.tSpace2.xyz;
#endif
float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w);
float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
float4 ShadowCoords = float4( 0, 0, 0, 0 );
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
float4 ScreenPos = IN.screenPos;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#endif
WorldViewDirection = SafeNormalize( WorldViewDirection );
float2 texCoord26 = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
float4 tex2DNode7 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, texCoord26 );
float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ScreenPos );
float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
float2 screenUV27_g34 = (ase_grabScreenPosNorm).xy;
float offsetFrame27_g34 = 0.0;
float4 localGetScreenNoiseRGBASlice27_g34 = GetScreenNoiseRGBASlice27_g34( screenUV27_g34 , offsetFrame27_g34 );
float4 temp_output_198_0 = localGetScreenNoiseRGBASlice27_g34;
float4 temp_cast_0 = (0.5).xxxx;
float4 temp_output_78_0 = ( ( temp_output_198_0 - temp_cast_0 ) * _Noise );
float4 temp_output_91_0 = ( tex2DNode7 + temp_output_78_0 );
float4 In02_g33 = SAMPLE_TEXTURE2D( _BumpMap, sampler_BumpMap, texCoord26 );
float3 localMyCustomExpression2_g33 = MyCustomExpression( In02_g33 );
float3 temp_output_58_0 = localMyCustomExpression2_g33;
float3 tanToWorld0 = float3( WorldTangent.x, WorldBiTangent.x, WorldNormal.x );
float3 tanToWorld1 = float3( WorldTangent.y, WorldBiTangent.y, WorldNormal.y );
float3 tanToWorld2 = float3( WorldTangent.z, WorldBiTangent.z, WorldNormal.z );
float3 tanNormal56 = temp_output_58_0;
float3 worldNormal56 = float3(dot(tanToWorld0,tanNormal56), dot(tanToWorld1,tanNormal56), dot(tanToWorld2,tanNormal56));
float3 normalizeResult85 = ASESafeNormalize( WorldViewDirection );
float dotResult53 = dot( worldNormal56 , normalizeResult85 );
float temp_output_54_0 = ( 1.0 - dotResult53 );
float4 temp_output_87_0 = ( ( temp_output_54_0 * temp_output_54_0 * temp_output_54_0 ) * _HologramEdgeColor );
float4 temp_cast_4 = (0.5).xxxx;
float temp_output_65_0 = ( ( ase_grabScreenPosNorm.g * ( _ScreenParams.y / _ScanlineSize ) ) % 2.0 );
float4 temp_cast_6 = (0.5).xxxx;
float4 tex2DNode86 = SAMPLE_TEXTURE2D( _MetallicGlossMap, sampler_BaseMap, texCoord26 );
float lerpResult96 = lerp( temp_output_65_0 , 1.0 , saturate( ( dotResult53 - 0.2 ) ));
float4 unityObjectToClipPos145 = TransformWorldToHClip(TransformObjectToWorld(IN.ase_texcoord9.xyz));
float temp_output_14_0 = ( unityObjectToClipPos145.w + ( (temp_output_198_0).w * _DepthFader ) );
float lerpResult183 = lerp( ( ( (temp_output_198_0).w - 1.0 ) * 2.0 ) , 0.5 , ( _EmissionColor.a * tex2DNode7.a ));
float3 Albedo = temp_output_91_0.rgb;
float3 Normal = temp_output_58_0;
float3 Emission = ( _EmissionColor * ( ( temp_output_87_0 * _HologramEdgeColor.a ) + ( ( temp_output_87_0 + temp_output_78_0 ) * temp_output_65_0 * temp_output_91_0 ) ) ).rgb;
#if 0
float3 BakedEmission = _HologramEdgeColor.rgb;
#endif
float3 Specular = 0.5;
float Metallic = tex2DNode86.r;
float Smoothness = tex2DNode86.b;
float Occlusion = ( tex2DNode86.g * lerpResult96 );
float Alpha = 1;
float AlphaClipThreshold = 0.5;
float AlphaClipThresholdShadow = 0.5;
float3 BakedGI = 0;
float3 RefractionColor = 1;
float RefractionIndex = 1;
float3 Transmission = 1;
float3 Translucency = 1;
#ifdef ASE_DEPTH_WRITE_ON
float DepthValue = ( ( ( 1.0 - ( temp_output_14_0 * _ZBufferParams.w ) ) / ( temp_output_14_0 * _ZBufferParams.z ) ) * ceil( lerpResult183 ) );
#endif
#ifdef _CLEARCOAT
float CoatMask = 0;
float CoatSmoothness = 0;
#endif
#if defined(_FLUORESCENCE)
float4 Fluorescence = 0;
float4 Absorbance = 0;
#endif
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
clip(Alpha - AlphaClipThreshold);
#endif
InputData inputData = (InputData)0;
inputData.positionWS = WorldPosition;
inputData.viewDirectionWS = WorldViewDirection;
#ifdef _NORMALMAP
#if _NORMAL_DROPOFF_TS
inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal ));
#elif _NORMAL_DROPOFF_OS
inputData.normalWS = TransformObjectToWorldNormal(Normal);
#elif _NORMAL_DROPOFF_WS
inputData.normalWS = Normal;
#endif
inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
#else
inputData.normalWS = WorldNormal;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
inputData.shadowCoord = ShadowCoords;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
#else
inputData.shadowCoord = float4(0, 0, 0, 0);
#endif
#ifdef ASE_FOG
inputData.fogCoord = IN.fogFactorAndVertexLight.x;
#endif
inputData.vertexLighting = IN.fogFactorAndVertexLight.yzww; //TODO: Shuffle things in vertex streams so we get full RGBA color rather than RGBB here
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
float3 SH = SampleSH(inputData.normalWS.xyz);
#else
float3 SH = IN.lightmapUVOrVertexSH.xyz;
#endif
#if defined(DYNAMICLIGHTMAP_ON)
#ifdef LIGHTMAP_ON
float4 encodedGI = SAMPLE_GI_DIR(IN.lightmapUVOrVertexSH.xyz, IN.dynamicLightmapUV.xy, IN.vertexSH, inputData.normalWS, Smoothness, WorldViewDirection);
inputData.bakedGI = encodedGI.rgb;
float BakedSpecular = encodedGI.w;
#else
inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, IN.vertexSH , inputData.normalWS);
#endif
#else
#ifdef LIGHTMAP_ON
float4 encodedGI = SAMPLE_GI_DIR(IN.lightmapUVOrVertexSH.xy, IN.lightmapUVOrVertexSH.xyz, inputData.normalWS, Smoothness, WorldViewDirection);
inputData.bakedGI = encodedGI.rgb;
float BakedSpecular = encodedGI.w;
#else
inputData.bakedGI = SAMPLE_GI_DIR(IN.lightmapUVOrVertexSH.xy, IN.lightmapUVOrVertexSH.xyz, inputData.normalWS, Smoothness, WorldViewDirection);
#endif
#endif
#ifdef _ASE_BAKEDGI
inputData.bakedGI = BakedGI;
#endif
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos);
inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy);
#if defined(DEBUG_DISPLAY)
#if defined(DYNAMICLIGHTMAP_ON)
inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy;
#endif
#if defined(LIGHTMAP_ON)
inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy;
#else
inputData.vertexSH = SH;
#endif
#endif
SurfaceData surfaceData;
surfaceData.albedo = Albedo;
surfaceData.metallic = saturate(Metallic);
surfaceData.specular = Specular;
surfaceData.smoothness = saturate(Smoothness),
surfaceData.occlusion = Occlusion,
surfaceData.emission = Emission,
surfaceData.alpha = saturate(Alpha);
surfaceData.normalTS = Normal;
surfaceData.clearCoatMask = 0;
surfaceData.clearCoatSmoothness = 1;
#ifdef _CLEARCOAT
surfaceData.clearCoatMask = saturate(CoatMask);
surfaceData.clearCoatSmoothness = saturate(CoatSmoothness);
#endif
#if defined(_FLUORESCENCE)
surfaceData.fluorescence = Fluorescence;
surfaceData.absorbance = Absorbance;
#endif
#ifdef _DBUFFER
ApplyDecalToSurfaceData(IN.clipPos, surfaceData, inputData);
#endif
half4 color = UniversalFragmentPBR( inputData, surfaceData);
#ifdef LIGHTMAP_ON
float3 MetalSpec = lerp(kDieletricSpec.rgb, surfaceData.albedo , surfaceData.metallic);
color.rgb += BakedSpecular * surfaceData.occlusion * MetalSpec * inputData.bakedGI.rgb;
#endif
#ifdef _TRANSMISSION_ASE
{
float shadow = _TransmissionShadow;
Light mainLight = GetMainLight( inputData.shadowCoord );
float3 mainAtten = mainLight.color * mainLight.distanceAttenuation;
mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow );
half3 mainTransmission = max(0 , -dot(inputData.normalWS, mainLight.direction)) * mainAtten * Transmission;
color.rgb += Albedo * mainTransmission;
#ifdef _ADDITIONAL_LIGHTS
int transPixelLightCount = GetAdditionalLightsCount();
for (int i = 0; i < transPixelLightCount; ++i)
{
Light light = GetAdditionalLight(i, inputData.positionWS);
float3 atten = light.color * light.distanceAttenuation;
atten = lerp( atten, atten * light.shadowAttenuation, shadow );
half3 transmission = max(0 , -dot(inputData.normalWS, light.direction)) * atten * Transmission;
color.rgb += Albedo * transmission;
}
#endif
}
#endif
#ifdef _TRANSLUCENCY_ASE
{
float shadow = _TransShadow;
float normal = _TransNormal;
float scattering = _TransScattering;
float direct = _TransDirect;
float ambient = _TransAmbient;
float strength = _TransStrength;
Light mainLight = GetMainLight( inputData.shadowCoord );
float3 mainAtten = mainLight.color * mainLight.distanceAttenuation;
mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow );
half3 mainLightDir = mainLight.direction + inputData.normalWS * normal;
half mainVdotL = pow( saturate( dot( inputData.viewDirectionWS, -mainLightDir ) ), scattering );
half3 mainTranslucency = mainAtten * ( mainVdotL * direct + inputData.bakedGI * ambient ) * Translucency;
color.rgb += Albedo * mainTranslucency * strength;
#ifdef _ADDITIONAL_LIGHTS
int transPixelLightCount = GetAdditionalLightsCount();
for (int i = 0; i < transPixelLightCount; ++i)
{
Light light = GetAdditionalLight(i, inputData.positionWS);
float3 atten = light.color * light.distanceAttenuation;
atten = lerp( atten, atten * light.shadowAttenuation, shadow );
half3 lightDir = light.direction + inputData.normalWS * normal;
half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering );
half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency;
color.rgb += Albedo * translucency * strength;
}
#endif
}
#endif
#ifdef _REFRACTION_ASE
float4 projScreenPos = ScreenPos / ScreenPos.w;
float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) );
projScreenPos.xy += refractionOffset.xy;
float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor;
color.rgb = lerp( refraction, color.rgb, color.a );
color.a = 1;
#endif
#ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
color.rgb *= color.a;
#endif
#ifdef ASE_FOG
#ifdef TERRAIN_SPLAT_ADDPASS
color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x );
#else
color.rgb = MixFog(color.rgb, -inputData.viewDirectionWS, IN.fogFactorAndVertexLight.x);
#endif
#endif
color = Volumetrics( color, inputData.positionWS);
#ifdef ASE_DEPTH_WRITE_ON
outputDepth = DepthValue;
#endif
return color;
}
ENDHLSL
}
Pass
{
Name "ShadowCaster"
Tags { "LightMode"="ShadowCaster" }
ZWrite On
ZTest LEqual
AlphaToMask Off
ColorMask 0
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1
#pragma multi_compile_fog
#define ASE_FOG 1
#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED
#define ASE_DEPTH_WRITE_ON
#define _DISABLE_LIGHTMAPS
#define _DISABLE_SSAO
#pragma multi_compile_instancing
#define _EMISSION
#define _NORMALMAP 1
#define ASE_SRP_VERSION 999999
#define ASE_USING_SAMPLING_MACROS 1
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PlatformCompiler.hlsl"
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW
#define SHADERPASS SHADERPASS_SHADOWCASTER
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 worldPos : TEXCOORD0;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
float4 shadowCoord : TEXCOORD1;
#endif
float4 ase_texcoord2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_texcoord4 : TEXCOORD4;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _EmissionColor;
float4 _HologramEdgeColor;
float _Noise;
float _ScanlineSize;
float _DepthFader;
#ifdef _TRANSMISSION_ASE
float _TransmissionShadow;
#endif
#ifdef _TRANSLUCENCY_ASE
float _TransStrength;
float _TransNormal;
float _TransScattering;
float _TransDirect;
float _TransAmbient;
float _TransShadow;
#endif
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
inline float4 ASE_ComputeGrabScreenPos( float4 pos )
{
#if UNITY_UV_STARTS_AT_TOP
float scale = -1.0;
#else
float scale = 1.0;
#endif
float4 o = pos;
o.y = pos.w * 0.5f;
o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
return o;
}
inline float4 GetScreenNoiseRGBASlice27_g34( float2 screenUV, float offsetFrame )
{
return GetScreenNoiseRGBAOffset(screenUV, offsetFrame);
}
float3 _LightDirection;
float3 _LightPosition;
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
float4 ase_clipPos = TransformObjectToHClip((v.vertex).xyz);
float4 screenPos = ComputeScreenPos(ase_clipPos);
o.ase_texcoord3 = screenPos;
o.ase_texcoord2 = v.vertex;
o.ase_texcoord4.xy = v.ase_texcoord.xy;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord4.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.vertex.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
v.ase_normal = v.ase_normal;
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
float3 normalWS = TransformObjectToWorldDir(v.ase_normal);
#if _CASTING_PUNCTUAL_LIGHT_SHADOW
float3 lightDirectionWS = normalize(_LightPosition - positionWS);
#else
float3 lightDirectionWS = _LightDirection;
#endif
float2 vShadowOffsets = GetShadowOffsets( normalWS, lightDirectionWS );
positionWS.xyz -= vShadowOffsets.y * lightDirectionWS.xyz * .01;
float4 clipPos = TransformObjectToHClip( float4( mul( unity_WorldToObject, float4( positionWS.xyz, 1.0 ) ).xyz, 1.0 ) );
//float4 clipPos = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS));
#if UNITY_REVERSED_Z
clipPos.z = min(clipPos.z, UNITY_NEAR_CLIP_VALUE);
#else
clipPos.z = max(clipPos.z, UNITY_NEAR_CLIP_VALUE);
#endif
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
o.worldPos = positionWS;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = clipPos;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
o.clipPos = clipPos;
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
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.vertex = v.vertex;
o.ase_normal = v.ase_normal;
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 defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#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.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * 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.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
float phongStrength = _TessPhongStrength;
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE)
#define ASE_SV_DEPTH SV_DepthLessEqual
#else
#define ASE_SV_DEPTH SV_Depth
#endif
half4 frag( VertexOutput IN
#ifdef ASE_DEPTH_WRITE_ON
,out float outputDepth : ASE_SV_DEPTH
#endif
) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID( IN );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 WorldPosition = IN.worldPos;
#endif
float4 ShadowCoords = float4( 0, 0, 0, 0 );
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#endif
#endif
float4 unityObjectToClipPos145 = TransformWorldToHClip(TransformObjectToWorld(IN.ase_texcoord2.xyz));
float4 screenPos = IN.ase_texcoord3;
float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos );
float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
float2 screenUV27_g34 = (ase_grabScreenPosNorm).xy;
float offsetFrame27_g34 = 0.0;
float4 localGetScreenNoiseRGBASlice27_g34 = GetScreenNoiseRGBASlice27_g34( screenUV27_g34 , offsetFrame27_g34 );
float4 temp_output_198_0 = localGetScreenNoiseRGBASlice27_g34;
float temp_output_14_0 = ( unityObjectToClipPos145.w + ( (temp_output_198_0).w * _DepthFader ) );
float2 texCoord26 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
float4 tex2DNode7 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, texCoord26 );
float lerpResult183 = lerp( ( ( (temp_output_198_0).w - 1.0 ) * 2.0 ) , 0.5 , ( _EmissionColor.a * tex2DNode7.a ));
float Alpha = 1;
float AlphaClipThreshold = 0.5;
float AlphaClipThresholdShadow = 0.5;
#ifdef ASE_DEPTH_WRITE_ON
float DepthValue = ( ( ( 1.0 - ( temp_output_14_0 * _ZBufferParams.w ) ) / ( temp_output_14_0 * _ZBufferParams.z ) ) * ceil( lerpResult183 ) );
#endif
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
#ifdef _ALPHATEST_SHADOW_ON
clip(Alpha - AlphaClipThresholdShadow);
#else
clip(Alpha - AlphaClipThreshold);
#endif
#endif
#ifdef LOD_FADE_CROSSFADE
LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
#endif
#ifdef ASE_DEPTH_WRITE_ON
outputDepth = DepthValue;
#endif
return 0;
}
ENDHLSL
}
Pass
{
Name "DepthOnly"
Tags { "LightMode"="DepthOnly" }
ZWrite On
ColorMask 0
AlphaToMask Off
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1
#pragma multi_compile_fog
#define ASE_FOG 1
#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED
#define ASE_DEPTH_WRITE_ON
#define _DISABLE_LIGHTMAPS
#define _DISABLE_SSAO
#pragma multi_compile_instancing
#define _EMISSION
#define _NORMALMAP 1
#define ASE_SRP_VERSION 999999
#define ASE_USING_SAMPLING_MACROS 1
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PlatformCompiler.hlsl"
#pragma vertex vert
#pragma fragment frag
#define SHADERPASS SHADERPASS_DEPTHONLY
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 worldPos : TEXCOORD0;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
float4 shadowCoord : TEXCOORD1;
#endif
float4 ase_texcoord2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_texcoord4 : TEXCOORD4;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _EmissionColor;
float4 _HologramEdgeColor;
float _Noise;
float _ScanlineSize;
float _DepthFader;
#ifdef _TRANSMISSION_ASE
float _TransmissionShadow;
#endif
#ifdef _TRANSLUCENCY_ASE
float _TransStrength;
float _TransNormal;
float _TransScattering;
float _TransDirect;
float _TransAmbient;
float _TransShadow;
#endif
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
inline float4 ASE_ComputeGrabScreenPos( float4 pos )
{
#if UNITY_UV_STARTS_AT_TOP
float scale = -1.0;
#else
float scale = 1.0;
#endif
float4 o = pos;
o.y = pos.w * 0.5f;
o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
return o;
}
inline float4 GetScreenNoiseRGBASlice27_g34( float2 screenUV, float offsetFrame )
{
return GetScreenNoiseRGBAOffset(screenUV, offsetFrame);
}
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 ase_clipPos = TransformObjectToHClip((v.vertex).xyz);
float4 screenPos = ComputeScreenPos(ase_clipPos);
o.ase_texcoord3 = screenPos;
o.ase_texcoord2 = v.vertex;
o.ase_texcoord4.xy = v.ase_texcoord.xy;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord4.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.vertex.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
v.ase_normal = v.ase_normal;
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
float4 positionCS = TransformWorldToHClip( positionWS );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
o.worldPos = positionWS;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = positionCS;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
o.clipPos = positionCS;
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
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.vertex = v.vertex;
o.ase_normal = v.ase_normal;
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 defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#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.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * 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.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
float phongStrength = _TessPhongStrength;
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE)
#define ASE_SV_DEPTH SV_DepthLessEqual
#else
#define ASE_SV_DEPTH SV_Depth
#endif
half4 frag( VertexOutput IN
#ifdef ASE_DEPTH_WRITE_ON
,out float outputDepth : ASE_SV_DEPTH
#endif
) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 WorldPosition = IN.worldPos;
#endif
float4 ShadowCoords = float4( 0, 0, 0, 0 );
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#endif
#endif
float4 unityObjectToClipPos145 = TransformWorldToHClip(TransformObjectToWorld(IN.ase_texcoord2.xyz));
float4 screenPos = IN.ase_texcoord3;
float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos );
float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
float2 screenUV27_g34 = (ase_grabScreenPosNorm).xy;
float offsetFrame27_g34 = 0.0;
float4 localGetScreenNoiseRGBASlice27_g34 = GetScreenNoiseRGBASlice27_g34( screenUV27_g34 , offsetFrame27_g34 );
float4 temp_output_198_0 = localGetScreenNoiseRGBASlice27_g34;
float temp_output_14_0 = ( unityObjectToClipPos145.w + ( (temp_output_198_0).w * _DepthFader ) );
float2 texCoord26 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
float4 tex2DNode7 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, texCoord26 );
float lerpResult183 = lerp( ( ( (temp_output_198_0).w - 1.0 ) * 2.0 ) , 0.5 , ( _EmissionColor.a * tex2DNode7.a ));
float Alpha = 1;
float AlphaClipThreshold = 0.5;
#ifdef ASE_DEPTH_WRITE_ON
float DepthValue = ( ( ( 1.0 - ( temp_output_14_0 * _ZBufferParams.w ) ) / ( temp_output_14_0 * _ZBufferParams.z ) ) * ceil( lerpResult183 ) );
#endif
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
clip(Alpha - AlphaClipThreshold);
#endif
#ifdef LOD_FADE_CROSSFADE
LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
#endif
#ifdef ASE_DEPTH_WRITE_ON
outputDepth = DepthValue;
#endif
return 0;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
Name "BakedRaytrace"
Tags{ "LightMode" = "BakedRaytrace" }
HLSLPROGRAM
/*ase_pragma_before*/
#define SHADERPASS SHADERPASS_RAYTRACE
#include "UnityRaytracingMeshUtils.cginc"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#define _EMISSION
#pragma raytracing test
#pragma shader_feature_local __ _ALBEDOMULTIPLY_ON
#pragma shader_feature_local __ _EMISSION_ON
/*ase_pragma*/
struct RayPayload
{
float4 color;
float3 dir;
};
struct AttributeData
{
float2 barycentrics;
};
struct Vertex
{
float2 texcoord;
float3 normal;
};
Texture2D<float4> _BaseMap;
SamplerState sampler_BaseMap;
CBUFFER_START( UnityPerMaterial )
/*ase_srp_batcher*/
Texture2D<float4> _EmissionMap;
SamplerState sampler_EmissionMap;
float4 _EmissionColor;
float4 _BaseMap_ST;
float _BakedMutiplier = 1;
CBUFFER_END
/*ase_globals*/
/*ase_funcs*/
//https://coty.tips/raytracing-in-unity/
[shader("closesthit")]
void MyClosestHit(inout RayPayload payload,
AttributeData attributes : SV_IntersectionAttributes) {
payload.color = float4(0,0,0,1); //Intializing
payload.dir = float3(1,0,0);
// #if _EMISSION_ON
uint2 launchIdx = DispatchRaysIndex();
// ShadingData shade = getShadingData( PrimitiveIndex(), attribs );
uint primitiveIndex = PrimitiveIndex();
uint3 triangleIndicies = UnityRayTracingFetchTriangleIndices(primitiveIndex);
Vertex v0, v1, v2;
v0.texcoord = UnityRayTracingFetchVertexAttribute2(triangleIndicies.x, kVertexAttributeTexCoord0);
v1.texcoord = UnityRayTracingFetchVertexAttribute2(triangleIndicies.y, kVertexAttributeTexCoord0);
v2.texcoord = UnityRayTracingFetchVertexAttribute2(triangleIndicies.z, kVertexAttributeTexCoord0);
// v0.normal = UnityRayTracingFetchVertexAttribute3(triangleIndicies.x, kVertexAttributeNormal);
// v1.normal = UnityRayTracingFetchVertexAttribute3(triangleIndicies.y, kVertexAttributeNormal);
// v2.normal = UnityRayTracingFetchVertexAttribute3(triangleIndicies.z, kVertexAttributeNormal);
float3 barycentrics = float3(1.0 - attributes.barycentrics.x - attributes.barycentrics.y, attributes.barycentrics.x, attributes.barycentrics.y);
Vertex vInterpolated;
vInterpolated.texcoord = v0.texcoord * barycentrics.x + v1.texcoord * barycentrics.y + v2.texcoord * barycentrics.z;
//TODO: Extract normal direction to ignore the backside of emissive objects
//vInterpolated.normal = v0.normal * barycentrics.x + v1.normal * barycentrics.y + v2.normal * barycentrics.z;
// if ( dot(vInterpolated.normal, float3(1,0,0) < 0) ) payload.color = float4(0,10,0,1) ;
// else payload.color = float4(10,0,0,1) ;
//TODO: Figure out how to tie Amplify into using Texture2d and SamplerState instead of the bundled sampler2D. Forcing names for now.
//#if _ALBEDOMULTIPLY_ON
float4 albedo = float4(_BaseMap.SampleLevel(sampler_BaseMap, vInterpolated.texcoord.xy * _BaseMap_ST.xy + _BaseMap_ST.zw, 0 ).rgb , 1) ;
// #else
// float4 albedo = float4(1,1,1,1);
// #endif
payload.color = float4( (_EmissionMap.SampleLevel(sampler_EmissionMap, vInterpolated.texcoord * _BaseMap_ST.xy + _BaseMap_ST.zw,0) ).rgb * _EmissionColor.rgb * albedo.rgb * _BakedMutiplier , 1 );
// #else
// payload.color = float4(0,0,0,1);
// #endif
}
ENDHLSL
}
Pass
{
Name "Universal2D"
Tags { "LightMode"="Universal2D" }
Blend One Zero, One Zero
ColorMask RGBA
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1
#pragma multi_compile_fog
#define ASE_FOG 1
#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED
#define ASE_DEPTH_WRITE_ON
#define _DISABLE_LIGHTMAPS
#define _DISABLE_SSAO
#pragma multi_compile_instancing
#define _EMISSION
#define _NORMALMAP 1
#define ASE_SRP_VERSION 999999
#define ASE_USING_SAMPLING_MACROS 1
#pragma vertex vert
#pragma fragment frag
#define SHADERPASS SHADERPASS_2D
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 worldPos : TEXCOORD0;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
float4 shadowCoord : TEXCOORD1;
#endif
float4 ase_texcoord2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _EmissionColor;
float4 _HologramEdgeColor;
float _Noise;
float _ScanlineSize;
float _DepthFader;
#ifdef _TRANSMISSION_ASE
float _TransmissionShadow;
#endif
#ifdef _TRANSLUCENCY_ASE
float _TransStrength;
float _TransNormal;
float _TransScattering;
float _TransDirect;
float _TransAmbient;
float _TransShadow;
#endif
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
inline float4 ASE_ComputeGrabScreenPos( float4 pos )
{
#if UNITY_UV_STARTS_AT_TOP
float scale = -1.0;
#else
float scale = 1.0;
#endif
float4 o = pos;
o.y = pos.w * 0.5f;
o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
return o;
}
inline float4 GetScreenNoiseRGBASlice27_g34( float2 screenUV, float offsetFrame )
{
return GetScreenNoiseRGBAOffset(screenUV, offsetFrame);
}
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID( v );
UNITY_TRANSFER_INSTANCE_ID( v, o );
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
float4 ase_clipPos = TransformObjectToHClip((v.vertex).xyz);
float4 screenPos = ComputeScreenPos(ase_clipPos);
o.ase_texcoord3 = screenPos;
o.ase_texcoord2.xy = v.ase_texcoord.xy;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord2.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.vertex.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
v.ase_normal = v.ase_normal;
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
float4 positionCS = TransformWorldToHClip( positionWS );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
o.worldPos = positionWS;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = positionCS;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
o.clipPos = positionCS;
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
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.vertex = v.vertex;
o.ase_normal = v.ase_normal;
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 defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#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.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * 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.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
float phongStrength = _TessPhongStrength;
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
half4 frag(VertexOutput IN ) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID( IN );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 WorldPosition = IN.worldPos;
#endif
float4 ShadowCoords = float4( 0, 0, 0, 0 );
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#endif
#endif
float2 texCoord26 = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
float4 tex2DNode7 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, texCoord26 );
float4 screenPos = IN.ase_texcoord3;
float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos );
float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
float2 screenUV27_g34 = (ase_grabScreenPosNorm).xy;
float offsetFrame27_g34 = 0.0;
float4 localGetScreenNoiseRGBASlice27_g34 = GetScreenNoiseRGBASlice27_g34( screenUV27_g34 , offsetFrame27_g34 );
float4 temp_output_198_0 = localGetScreenNoiseRGBASlice27_g34;
float4 temp_cast_0 = (0.5).xxxx;
float4 temp_output_78_0 = ( ( temp_output_198_0 - temp_cast_0 ) * _Noise );
float4 temp_output_91_0 = ( tex2DNode7 + temp_output_78_0 );
float3 Albedo = temp_output_91_0.rgb;
float Alpha = 1;
float AlphaClipThreshold = 0.5;
half4 color = half4( Albedo, Alpha );
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
clip(Alpha - AlphaClipThreshold);
#endif
return color;
}
ENDHLSL
}
Pass
{
Name "DepthNormals"
Tags { "LightMode"="DepthNormals" }
ZWrite On
Blend One Zero
ZTest LEqual
ZWrite On
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1
#pragma multi_compile_fog
#define ASE_FOG 1
#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED
#define ASE_DEPTH_WRITE_ON
#define _DISABLE_LIGHTMAPS
#define _DISABLE_SSAO
#pragma multi_compile_instancing
#define _EMISSION
#define _NORMALMAP 1
#define ASE_SRP_VERSION 999999
#define ASE_USING_SAMPLING_MACROS 1
#pragma vertex vert
#pragma fragment frag
#define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
float4 ase_tangent : TANGENT;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 worldPos : TEXCOORD0;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
float4 shadowCoord : TEXCOORD1;
#endif
float3 worldNormal : TEXCOORD2;
float4 worldTangent : TEXCOORD3;
float4 ase_texcoord4 : TEXCOORD4;
float4 ase_texcoord5 : TEXCOORD5;
float4 ase_texcoord6 : TEXCOORD6;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _EmissionColor;
float4 _HologramEdgeColor;
float _Noise;
float _ScanlineSize;
float _DepthFader;
#ifdef _TRANSMISSION_ASE
float _TransmissionShadow;
#endif
#ifdef _TRANSLUCENCY_ASE
float _TransStrength;
float _TransNormal;
float _TransScattering;
float _TransDirect;
float _TransAmbient;
float _TransShadow;
#endif
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
TEXTURE2D(_BumpMap);
SAMPLER(sampler_BumpMap);
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
inline float3 MyCustomExpression( half4 In0 )
{
return UnpackNormal(In0);;
}
inline float4 ASE_ComputeGrabScreenPos( float4 pos )
{
#if UNITY_UV_STARTS_AT_TOP
float scale = -1.0;
#else
float scale = 1.0;
#endif
float4 o = pos;
o.y = pos.w * 0.5f;
o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
return o;
}
inline float4 GetScreenNoiseRGBASlice27_g34( float2 screenUV, float offsetFrame )
{
return GetScreenNoiseRGBAOffset(screenUV, offsetFrame);
}
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 ase_clipPos = TransformObjectToHClip((v.vertex).xyz);
float4 screenPos = ComputeScreenPos(ase_clipPos);
o.ase_texcoord6 = screenPos;
o.ase_texcoord4.xy = v.ase_texcoord.xy;
o.ase_texcoord5 = v.vertex;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord4.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.vertex.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
v.ase_normal = v.ase_normal;
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
float3 normalWS = TransformObjectToWorldNormal( v.ase_normal );
float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w);
float4 positionCS = TransformWorldToHClip( positionWS );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
o.worldPos = positionWS;
#endif
o.worldNormal = normalWS;
o.worldTangent = tangentWS;
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = positionCS;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
o.clipPos = positionCS;
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
float4 ase_tangent : TANGENT;
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.vertex = v.vertex;
o.ase_normal = v.ase_normal;
o.ase_tangent = v.ase_tangent;
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 defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#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.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * 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.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
float phongStrength = _TessPhongStrength;
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE)
#define ASE_SV_DEPTH SV_DepthLessEqual
#else
#define ASE_SV_DEPTH SV_Depth
#endif
half4 frag( VertexOutput IN
#ifdef ASE_DEPTH_WRITE_ON
,out float outputDepth : ASE_SV_DEPTH
#endif
) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 WorldPosition = IN.worldPos;
#endif
float4 ShadowCoords = float4( 0, 0, 0, 0 );
float3 WorldNormal = IN.worldNormal;
float4 WorldTangent = IN.worldTangent;
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#endif
#endif
float2 texCoord26 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
float4 In02_g33 = SAMPLE_TEXTURE2D( _BumpMap, sampler_BumpMap, texCoord26 );
float3 localMyCustomExpression2_g33 = MyCustomExpression( In02_g33 );
float3 temp_output_58_0 = localMyCustomExpression2_g33;
float4 unityObjectToClipPos145 = TransformWorldToHClip(TransformObjectToWorld(IN.ase_texcoord5.xyz));
float4 screenPos = IN.ase_texcoord6;
float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos );
float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
float2 screenUV27_g34 = (ase_grabScreenPosNorm).xy;
float offsetFrame27_g34 = 0.0;
float4 localGetScreenNoiseRGBASlice27_g34 = GetScreenNoiseRGBASlice27_g34( screenUV27_g34 , offsetFrame27_g34 );
float4 temp_output_198_0 = localGetScreenNoiseRGBASlice27_g34;
float temp_output_14_0 = ( unityObjectToClipPos145.w + ( (temp_output_198_0).w * _DepthFader ) );
float4 tex2DNode7 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, texCoord26 );
float lerpResult183 = lerp( ( ( (temp_output_198_0).w - 1.0 ) * 2.0 ) , 0.5 , ( _EmissionColor.a * tex2DNode7.a ));
float3 Normal = temp_output_58_0;
float Alpha = 1;
float AlphaClipThreshold = 0.5;
#ifdef ASE_DEPTH_WRITE_ON
float DepthValue = ( ( ( 1.0 - ( temp_output_14_0 * _ZBufferParams.w ) ) / ( temp_output_14_0 * _ZBufferParams.z ) ) * ceil( lerpResult183 ) );
#endif
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
clip(Alpha - AlphaClipThreshold);
#endif
#ifdef LOD_FADE_CROSSFADE
LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
#endif
#ifdef ASE_DEPTH_WRITE_ON
outputDepth = DepthValue;
#endif
#if defined(_GBUFFER_NORMALS_OCT)
float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal);
float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5);
half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS);
return half4(packedNormalWS, 0.0);
#else
#if defined(_NORMALMAP)
#if _NORMAL_DROPOFF_TS
float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale();
float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz);
float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz));
#elif _NORMAL_DROPOFF_OS
float3 normalWS = TransformObjectToWorldNormal(Normal);
#elif _NORMAL_DROPOFF_WS
float3 normalWS = Normal;
#endif
#else
float3 normalWS = WorldNormal;
#endif
return half4(EncodeWSNormalForNormalsTex(NormalizeNormalPerPixel(normalWS)), 0.0);
#endif
}
ENDHLSL
}
Pass
{
Name "GBuffer"
Tags { "LightMode"="None" }
Blend One Zero, One Zero
ColorMask RGBA
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1#pragma multi_compile_fog#define ASE_FOG 1#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED#define ASE_DEPTH_WRITE_ON#define _DISABLE_LIGHTMAPS#define _DISABLE_SSAO#pragma multi_compile_instancing#define _EMISSION#define _NORMALMAP 1#define ASE_SRP_VERSION 999999#define ASE_USING_SAMPLING_MACROS 1
#if FALSE
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE
//_MAIN_LIGHT_SHADOWS_SCREEN
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
#pragma multi_compile_fragment _ _SHADOWS_SOFT
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
//#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
#pragma multi_compile _ _GBUFFER_NORMALS_OCT
//#pragma multi_compile_fragment _ _LIGHT_LAYERS
#pragma multi_compile _ _RENDER_PASS_ENABLED
#pragma vertex vert
#pragma fragment frag
#define SHADERPASS SHADERPASS_GBUFFER
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl"
#if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
#define ENABLE_TERRAIN_PERPIXEL_NORMAL
#endif
#define ASE_NEEDS_FRAG_SCREEN_POSITION
#define ASE_NEEDS_FRAG_WORLD_TANGENT
#define ASE_NEEDS_FRAG_WORLD_NORMAL
#define ASE_NEEDS_FRAG_WORLD_BITANGENT
#define ASE_NEEDS_FRAG_WORLD_VIEW_DIR
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
float4 ase_tangent : TANGENT;
float4 texcoord : TEXCOORD0;
float4 texcoord1 : TEXCOORD1;
float4 texcoord2 : TEXCOORD2;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
float4 lightmapUVOrVertexSH : TEXCOORD0;
half4 fogFactorAndVertexLight : TEXCOORD1;
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
float4 shadowCoord : TEXCOORD2;
#endif
float4 tSpace0 : TEXCOORD3;
float4 tSpace1 : TEXCOORD4;
float4 tSpace2 : TEXCOORD5;
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
float4 screenPos : TEXCOORD6;
#endif
#if defined(DYNAMICLIGHTMAP_ON)
float2 dynamicLightmapUV : TEXCOORD7;
#endif
float4 ase_texcoord8 : TEXCOORD8;
float4 ase_texcoord9 : TEXCOORD9;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _EmissionColor;
float4 _HologramEdgeColor;
float _Noise;
float _ScanlineSize;
float _DepthFader;
#ifdef _TRANSMISSION_ASE
float _TransmissionShadow;
#endif
#ifdef _TRANSLUCENCY_ASE
float _TransStrength;
float _TransNormal;
float _TransScattering;
float _TransDirect;
float _TransAmbient;
float _TransShadow;
#endif
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
TEXTURE2D(_BumpMap);
SAMPLER(sampler_BumpMap);
TEXTURE2D(_MetallicGlossMap);
inline float4 ASE_ComputeGrabScreenPos( float4 pos )
{
#if UNITY_UV_STARTS_AT_TOP
float scale = -1.0;
#else
float scale = 1.0;
#endif
float4 o = pos;
o.y = pos.w * 0.5f;
o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
return o;
}
inline float4 GetScreenNoiseRGBASlice27_g34( float2 screenUV, float offsetFrame )
{
return GetScreenNoiseRGBAOffset(screenUV, offsetFrame);
}
inline float3 MyCustomExpression( half4 In0 )
{
return UnpackNormal(In0);;
}
real3 ASESafeNormalize(float3 inVec)
{
real dp3 = max(FLT_MIN, dot(inVec, inVec));
return inVec* rsqrt( dp3);
}
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.ase_texcoord8.xy = v.texcoord.xy;
o.ase_texcoord9 = v.vertex;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord8.zw = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.vertex.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
v.ase_normal = v.ase_normal;
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
float3 positionVS = TransformWorldToView( positionWS );
float4 positionCS = TransformWorldToHClip( positionWS );
VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent );
o.tSpace0 = float4( normalInput.normalWS, positionWS.x);
o.tSpace1 = float4( normalInput.tangentWS, positionWS.y);
o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z);
OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy );
#if defined(DYNAMICLIGHTMAP_ON)
o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
#endif
OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz );
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
o.lightmapUVOrVertexSH.zw = v.texcoord;
o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw;
#endif
half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS );
#ifdef ASE_FOG
half fogFactor = ComputeFogFactor( positionCS.z );
#else
half fogFactor = 0;
#endif
o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = positionCS;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
o.clipPos = positionCS;
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
o.screenPos = ComputeScreenPos(positionCS);
#endif
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
float4 ase_tangent : TANGENT;
float4 texcoord : TEXCOORD0;
float4 texcoord1 : TEXCOORD1;
float4 texcoord2 : TEXCOORD2;
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.vertex = v.vertex;
o.ase_normal = v.ase_normal;
o.ase_tangent = v.ase_tangent;
o.texcoord = v.texcoord;
o.texcoord1 = v.texcoord1;
o.texcoord2 = v.texcoord2;
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 defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#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.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z;
o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
float phongStrength = _TessPhongStrength;
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE)
#define ASE_SV_DEPTH SV_DepthLessEqual
#else
#define ASE_SV_DEPTH SV_Depth
#endif
FragmentOutput frag ( VertexOutput IN
#ifdef ASE_DEPTH_WRITE_ON
,out float outputDepth : ASE_SV_DEPTH
#endif
)
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
#ifdef LOD_FADE_CROSSFADE
LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
#endif
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
#else
float3 WorldNormal = normalize( IN.tSpace0.xyz );
float3 WorldTangent = IN.tSpace1.xyz;
float3 WorldBiTangent = IN.tSpace2.xyz;
#endif
float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w);
float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
float4 ShadowCoords = float4( 0, 0, 0, 0 );
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
float4 ScreenPos = IN.screenPos;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#else
ShadowCoords = float4(0, 0, 0, 0);
#endif
WorldViewDirection = SafeNormalize( WorldViewDirection );
float2 texCoord26 = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
float4 tex2DNode7 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, texCoord26 );
float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ScreenPos );
float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
float2 screenUV27_g34 = (ase_grabScreenPosNorm).xy;
float offsetFrame27_g34 = 0.0;
float4 localGetScreenNoiseRGBASlice27_g34 = GetScreenNoiseRGBASlice27_g34( screenUV27_g34 , offsetFrame27_g34 );
float4 temp_output_198_0 = localGetScreenNoiseRGBASlice27_g34;
float4 temp_cast_0 = (0.5).xxxx;
float4 temp_output_78_0 = ( ( temp_output_198_0 - temp_cast_0 ) * _Noise );
float4 temp_output_91_0 = ( tex2DNode7 + temp_output_78_0 );
float4 In02_g33 = SAMPLE_TEXTURE2D( _BumpMap, sampler_BumpMap, texCoord26 );
float3 localMyCustomExpression2_g33 = MyCustomExpression( In02_g33 );
float3 temp_output_58_0 = localMyCustomExpression2_g33;
float3 tanToWorld0 = float3( WorldTangent.x, WorldBiTangent.x, WorldNormal.x );
float3 tanToWorld1 = float3( WorldTangent.y, WorldBiTangent.y, WorldNormal.y );
float3 tanToWorld2 = float3( WorldTangent.z, WorldBiTangent.z, WorldNormal.z );
float3 tanNormal56 = temp_output_58_0;
float3 worldNormal56 = float3(dot(tanToWorld0,tanNormal56), dot(tanToWorld1,tanNormal56), dot(tanToWorld2,tanNormal56));
float3 normalizeResult85 = ASESafeNormalize( WorldViewDirection );
float dotResult53 = dot( worldNormal56 , normalizeResult85 );
float temp_output_54_0 = ( 1.0 - dotResult53 );
float4 temp_output_87_0 = ( ( temp_output_54_0 * temp_output_54_0 * temp_output_54_0 ) * _HologramEdgeColor );
float4 temp_cast_4 = (0.5).xxxx;
float temp_output_65_0 = ( ( ase_grabScreenPosNorm.g * ( _ScreenParams.y / _ScanlineSize ) ) % 2.0 );
float4 temp_cast_6 = (0.5).xxxx;
float4 tex2DNode86 = SAMPLE_TEXTURE2D( _MetallicGlossMap, sampler_BaseMap, texCoord26 );
float lerpResult96 = lerp( temp_output_65_0 , 1.0 , saturate( ( dotResult53 - 0.2 ) ));
float4 unityObjectToClipPos145 = TransformWorldToHClip(TransformObjectToWorld(IN.ase_texcoord9.xyz));
float temp_output_14_0 = ( unityObjectToClipPos145.w + ( (temp_output_198_0).w * _DepthFader ) );
float lerpResult183 = lerp( ( ( (temp_output_198_0).w - 1.0 ) * 2.0 ) , 0.5 , ( _EmissionColor.a * tex2DNode7.a ));
float3 Albedo = temp_output_91_0.rgb;
float3 Normal = temp_output_58_0;
float3 Emission = ( _EmissionColor * ( ( temp_output_87_0 * _HologramEdgeColor.a ) + ( ( temp_output_87_0 + temp_output_78_0 ) * temp_output_65_0 * temp_output_91_0 ) ) ).rgb;
float3 Specular = 0.5;
float Metallic = tex2DNode86.r;
float Smoothness = tex2DNode86.b;
float Occlusion = ( tex2DNode86.g * lerpResult96 );
float Alpha = 1;
float AlphaClipThreshold = 0.5;
float AlphaClipThresholdShadow = 0.5;
float3 BakedGI = 0;
float3 RefractionColor = 1;
float RefractionIndex = 1;
float3 Transmission = 1;
float3 Translucency = 1;
#ifdef ASE_DEPTH_WRITE_ON
float DepthValue = ( ( ( 1.0 - ( temp_output_14_0 * _ZBufferParams.w ) ) / ( temp_output_14_0 * _ZBufferParams.z ) ) * ceil( lerpResult183 ) );
#endif
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
clip(Alpha - AlphaClipThreshold);
#endif
InputData inputData = (InputData)0;
inputData.positionWS = WorldPosition;
inputData.positionCS = IN.clipPos;
inputData.shadowCoord = ShadowCoords;
#ifdef _NORMALMAP
#if _NORMAL_DROPOFF_TS
inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal ));
#elif _NORMAL_DROPOFF_OS
inputData.normalWS = TransformObjectToWorldNormal(Normal);
#elif _NORMAL_DROPOFF_WS
inputData.normalWS = Normal;
#endif
#else
inputData.normalWS = WorldNormal;
#endif
inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
inputData.viewDirectionWS = SafeNormalize( WorldViewDirection );
#ifdef ASE_FOG
inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x);
#endif
inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw;
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
float3 SH = SampleSH(inputData.normalWS.xyz);
#else
float3 SH = IN.lightmapUVOrVertexSH.xyz;
#endif
#ifdef _ASE_BAKEDGI
inputData.bakedGI = BakedGI;
#else
#if defined(DYNAMICLIGHTMAP_ON)
inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS);
#else
inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS );
#endif
#endif
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos);
inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy);
#if defined(DEBUG_DISPLAY)
#if defined(DYNAMICLIGHTMAP_ON)
inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy;
#endif
#if defined(LIGHTMAP_ON)
inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy;
#else
inputData.vertexSH = SH;
#endif
#endif
#ifdef _DBUFFER
ApplyDecal(IN.clipPos,
Albedo,
Specular,
inputData.normalWS,
Metallic,
Occlusion,
Smoothness);
#endif
BRDFData brdfData;
InitializeBRDFData
(Albedo, Metallic, Specular, Smoothness, Alpha, brdfData);
Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask);
half4 color;
MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask);
color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS);
color.a = Alpha;
#ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
color.rgb *= color.a;
#endif
#ifdef ASE_FOG
#ifdef TERRAIN_SPLAT_ADDPASS
color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x );
#else
color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x);
#endif
#endif
#ifdef ASE_DEPTH_WRITE_ON
outputDepth = DepthValue;
#endif
return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb);
}
#endif
ENDHLSL
}
Pass
{
Name "SceneSelectionPass"
Tags { "LightMode"="SceneSelectionPass" }
Cull Off
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1
#pragma multi_compile_fog
#define ASE_FOG 1
#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED
#define ASE_DEPTH_WRITE_ON
#define _DISABLE_LIGHTMAPS
#define _DISABLE_SSAO
#pragma multi_compile_instancing
#define _EMISSION
#define _NORMALMAP 1
#define ASE_SRP_VERSION 999999
#define ASE_USING_SAMPLING_MACROS 1
#pragma only_renderers d3d11 glcore gles gles3
#pragma vertex vert
#pragma fragment frag
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define SHADERPASS SHADERPASS_DEPTHONLY
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _EmissionColor;
float4 _HologramEdgeColor;
float _Noise;
float _ScanlineSize;
float _DepthFader;
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
int _ObjectId;
int _PassValue;
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
VertexOutput VertexFunction(VertexInput v )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.vertex.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
v.ase_normal = v.ase_normal;
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
o.clipPos = TransformWorldToHClip(positionWS);
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
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.vertex = v.vertex;
o.ase_normal = v.ase_normal;
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 defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#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.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
float phongStrength = _TessPhongStrength;
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
half4 frag(VertexOutput IN ) : SV_TARGET
{
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
surfaceDescription.Alpha = 1;
surfaceDescription.AlphaClipThreshold = 0.5;
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
float alphaClipThreshold = 0.01f;
#if ALPHA_CLIP_THRESHOLD
alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
#endif
clip(surfaceDescription.Alpha - alphaClipThreshold);
#endif
half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
return outColor;
}
ENDHLSL
}
Pass
{
Name "ScenePickingPass"
Tags { "LightMode"="Picking" }
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1
#pragma multi_compile_fog
#define ASE_FOG 1
#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED
#define ASE_DEPTH_WRITE_ON
#define _DISABLE_LIGHTMAPS
#define _DISABLE_SSAO
#pragma multi_compile_instancing
#define _EMISSION
#define _NORMALMAP 1
#define ASE_SRP_VERSION 999999
#define ASE_USING_SAMPLING_MACROS 1
#pragma only_renderers d3d11 glcore gles gles3
#pragma vertex vert
#pragma fragment frag
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define SHADERPASS SHADERPASS_DEPTHONLY
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _EmissionColor;
float4 _HologramEdgeColor;
float _Noise;
float _ScanlineSize;
float _DepthFader;
#ifdef TESSELLATION_ON
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
float4 _SelectionID;
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
VertexOutput VertexFunction(VertexInput v )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.vertex.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
v.ase_normal = v.ase_normal;
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
o.clipPos = TransformWorldToHClip(positionWS);
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
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.vertex = v.vertex;
o.ase_normal = v.ase_normal;
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 defined(ASE_FIXED_TESSELLATION)
tf = FixedTess( tessValue );
#elif defined(ASE_DISTANCE_TESSELLATION)
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#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.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
float phongStrength = _TessPhongStrength;
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
half4 frag(VertexOutput IN ) : SV_TARGET
{
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
surfaceDescription.Alpha = 1;
surfaceDescription.AlphaClipThreshold = 0.5;
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
float alphaClipThreshold = 0.01f;
#if ALPHA_CLIP_THRESHOLD
alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
#endif
clip(surfaceDescription.Alpha - alphaClipThreshold);
#endif
half4 outColor = 0;
outColor = _SelectionID;
return outColor;
}
ENDHLSL
}
}
CustomEditor "UnityEditor.ShaderGraphLitGUI"
Fallback "Hidden/InternalErrorShader"
}
/*ASEBEGIN
Version=18935
556;179;1410;1119;1050.238;1092.71;2.396823;True;True
Node;AmplifyShaderEditor.CommentaryNode;163;-1992.93,-206.9442;Inherit;False;2042.17;519.2178;Edge coloring;8;87;88;89;54;55;48;166;167;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;167;-1982.529,-157.5087;Inherit;False;630.5564;386.2253;Fresnel;4;52;85;56;53;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;166;-514.7498,-52.95169;Inherit;False;430.2299;317.7492;Add noise and multiply with albedo;2;79;47;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;158;-1517.855,1012.331;Inherit;False;1801.283;486.7962;Dither in clipspace;12;14;146;15;24;12;145;18;17;13;16;111;157;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;164;-405.1964,322.276;Inherit;False;844.462;231.924;scanline to AO;4;93;96;100;99;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;165;-488.244,-513.2033;Inherit;False;202;185;add noise to albedo;1;91;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;160;-2682.31,574.5032;Inherit;False;862.9883;541.9784;Scanline effect;6;68;72;147;71;70;65;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;159;-1255.509,652.848;Inherit;False;745.0706;268.9492;Color noise;4;98;78;80;81;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;178;524.7984,516.2952;Inherit;False;805.9341;539.0737;Emission tinting and psdo-alpha;8;189;183;190;154;153;152;187;199;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;161;-2238.849,-1251.15;Inherit;False;853.8884;739.2095;Basemaps;5;25;26;7;86;58;;1,1,1,1;0;0
Node;AmplifyShaderEditor.UnityObjToClipPosHlpNode;145;-1250.941,1280.038;Inherit;False;1;0;FLOAT3;0,0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;13;-429.0687,1283.933;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CeilOpNode;189;1005.857,856.962;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;68;-2228.937,698.0006;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleRemainderNode;65;-2054.322,699.1375;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;2;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;154;1180.531,867.2163;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;187;532.295,792.4898;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;17;-454.8657,1103.681;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;24;-1117.33,1128.118;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.WireNode;168;-1296,352;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;54;-1306.219,-41.01093;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;100;-355.1964,381.3237;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0.2;False;1;FLOAT;0
Node;AmplifyShaderEditor.LerpOp;183;812.5939,788.0898;Inherit;False;3;0;FLOAT;1;False;1;FLOAT;0.5;False;2;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;98;-954.3539,805.7972;Inherit;False;Property;_Noise;Noise;5;0;Create;True;0;0;0;False;0;False;0.136;0.189;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;78;-672.4381,702.848;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0.1603774;False;1;FLOAT4;0
Node;AmplifyShaderEditor.PosVertexDataNode;146;-1467.855,1283.397;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.ScreenParams;71;-2607.225,796.4866;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleSubtractOpNode;80;-1011.571,714.59;Inherit;False;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;199;678.2019,929.3956;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;190;673.8575,791.6624;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;2;False;1;FLOAT;0
Node;AmplifyShaderEditor.ZBufferParams;15;-946.0206,1316.128;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;55;-1110.801,-133.0509;Inherit;True;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;12;-1405.141,1191.881;Inherit;False;Property;_DepthFader;Depth Fader;1;0;Create;True;0;0;0;False;0;False;0.15;0.12;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;48;-976.2174,79.47351;Inherit;False;Property;_HologramEdgeColor;Hologram Edge Color;3;1;[HDR];Create;True;0;0;0;False;0;False;0.2803489,0.5694646,0.9433962,0.09019608;1.247059,0.11,0.01568628,0.1215686;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RelayNode;157;133.4281,1109.07;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;14;-810.8926,1088.93;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SwizzleNode;177;-648.2431,935.3859;Inherit;False;FLOAT;3;1;2;3;1;0;FLOAT4;0,0,0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;16;-612.344,1099.455;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;47;-320.5199,10.79749;Inherit;True;3;3;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SamplerNode;7;-1902.078,-1201.15;Inherit;True;Property;_BaseMap;Base Map;0;0;Create;True;0;0;0;False;0;False;-1;None;6c9c24b6a17e8cd4c910d81887b68ee3;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;81;-1201.432,797.887;Inherit;False;Constant;_Float2;Float 2;5;0;Create;True;0;0;0;False;0;False;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;86;-1896.889,-741.9405;Inherit;True;Property;_MetallicGlossMap;Metallic, AO, Smoothness;4;1;[NoScaleOffset];Create;False;0;0;0;False;0;False;7;None;8dd58822f420adc4ab213165112114cb;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;152;617.5811,584.4951;Inherit;False;Property;_EmissionColor;Emission tint;7;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SwizzleNode;111;-1380.493,1063.638;Inherit;False;FLOAT;3;1;2;3;1;0;FLOAT4;0,0,0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleDivideOpNode;18;-255.269,1104.374;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;88;-67.65933,-144.9931;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GrabScreenPosition;72;-2632.31,624.5032;Inherit;False;0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.NormalizeNode;85;-1759.143,42.52801;Inherit;False;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;153;946.339,586.6653;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;87;-757.3683,-73.28355;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;93;277.2657,372.276;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;58;-1602.96,-937.243;Inherit;False;UnpackNormal;-1;;33;e881a95dc12b33643ac7d663807711b1;0;1;1;FLOAT4;0,0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SimpleAddOpNode;91;-438.244,-463.2033;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ViewDirInputsCoordNode;52;-1934.612,28.5512;Inherit;False;World;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.SaturateNode;99;-195.3589,375.4217;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;198;-1661.449,811.9089;Inherit;False;Global Blue Noise Sample;-1;;34;bac712bbbce65c14c9d4cbc808f3d0e0;0;2;8;FLOAT2;0,0;False;10;FLOAT;0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.SimpleAddOpNode;79;-464.7497,-2.95169;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.LerpOp;96;14.39998,395.2;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;1;False;2;FLOAT;0.5;False;1;FLOAT;0
Node;AmplifyShaderEditor.WireNode;162;164.3546,-460.9641;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.WorldNormalVector;56;-1795.93,-107.5087;Inherit;False;False;1;0;FLOAT3;0,0,1;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.TextureCoordinatesNode;26;-2188.849,-1151.569;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.DotProductOpNode;53;-1586.973,-25.28336;Inherit;True;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;89;-568.7856,-147.8442;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;147;-2579.685,1000.482;Inherit;False;Property;_ScanlineSize;ScanlineSize;6;0;Create;True;0;0;0;False;0;False;1.5;1.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleDivideOpNode;70;-2371.177,768.7841;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;5;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;25;-1906.612,-973.0698;Inherit;True;Property;_BumpMap;Bump Map;2;1;[NoScaleOffset];Create;True;0;0;0;False;0;False;25;None;390800c9a68bb6d4a8f6080fcedf2590;True;0;True;bump;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.TemplateMultiPassMasterNode;109;896.9503,-56.88453;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;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=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;101;896.9503,-28.88453;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;103;896.9503,-56.88453;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;105;896.9503,-56.88453;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;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;104;896.9503,-56.88453;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;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=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;193;1141.95,41.11547;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=None;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;102;1141.95,-28.88453;Half;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;SLZ/Hologram Depth fade;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;23;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;True;0;False;-1;True;0;False;-1;True;False;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=100;True;7;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;48;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;1;637958567270329948;LOD CrossFade;0;637826276518736143;Built-in Fog;1;0;Lightmaps;0;637946548730332324;Volumetrics;1;0;Decals;0;0;Screen Space Occlusion;0;637952535710893479;Reflection Probe Blend/Projection;1;0;Light Layers;0;0;_FinalColorxAlpha;0;0;Meta Pass;0;637958566584180353;GBuffer Pass;0;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;1;637807274411999678; Early Z;0;637808158371656942;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;637807264233463339;Fluorescence;0;0;0;10;False;True;True;True;False;True;True;True;True;True;False;;True;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;106;896.9503,-56.88453;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;110;896.9503,-56.88453;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;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;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;107;896.9503,-56.88453;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;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;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;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;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.CommentaryNode;169;-1711.449,761.9089;Inherit;False;320;185;Noise from global texture;0;;1,1,1,1;0;0
WireConnection;145;0;146;0
WireConnection;13;0;14;0
WireConnection;13;1;15;3
WireConnection;189;0;183;0
WireConnection;68;0;72;2
WireConnection;68;1;70;0
WireConnection;65;0;68;0
WireConnection;154;0;157;0
WireConnection;154;1;189;0
WireConnection;187;0;177;0
WireConnection;17;0;16;0
WireConnection;24;0;111;0
WireConnection;24;1;12;0
WireConnection;168;0;53;0
WireConnection;54;0;53;0
WireConnection;100;0;168;0
WireConnection;183;0;190;0
WireConnection;183;2;199;0
WireConnection;78;0;80;0
WireConnection;78;1;98;0
WireConnection;80;0;198;0
WireConnection;80;1;81;0
WireConnection;199;0;152;4
WireConnection;199;1;7;4
WireConnection;190;0;187;0
WireConnection;55;0;54;0
WireConnection;55;1;54;0
WireConnection;55;2;54;0
WireConnection;157;0;18;0
WireConnection;14;0;145;4
WireConnection;14;1;24;0
WireConnection;177;0;198;0
WireConnection;16;0;14;0
WireConnection;16;1;15;4
WireConnection;47;0;79;0
WireConnection;47;1;65;0
WireConnection;47;2;91;0
WireConnection;7;1;26;0
WireConnection;86;1;26;0
WireConnection;111;0;198;0
WireConnection;18;0;17;0
WireConnection;18;1;13;0
WireConnection;88;0;89;0
WireConnection;88;1;47;0
WireConnection;85;0;52;0
WireConnection;153;0;152;0
WireConnection;153;1;88;0
WireConnection;87;0;55;0
WireConnection;87;1;48;0
WireConnection;93;0;162;0
WireConnection;93;1;96;0
WireConnection;58;1;25;0
WireConnection;91;0;7;0
WireConnection;91;1;78;0
WireConnection;99;0;100;0
WireConnection;79;0;87;0
WireConnection;79;1;78;0
WireConnection;96;0;65;0
WireConnection;96;2;99;0
WireConnection;162;0;86;2
WireConnection;56;0;58;0
WireConnection;53;0;56;0
WireConnection;53;1;85;0
WireConnection;89;0;87;0
WireConnection;89;1;48;4
WireConnection;70;0;71;2
WireConnection;70;1;147;0
WireConnection;25;1;26;0
WireConnection;102;0;91;0
WireConnection;102;1;58;0
WireConnection;102;2;153;0
WireConnection;102;20;48;0
WireConnection;102;3;86;1
WireConnection;102;4;86;3
WireConnection;102;5;93;0
WireConnection;102;17;154;0
ASEEND*/
//CHKSM=FE78AAD06BFDD32A6EA9B17ADF3196523570F138