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

3426 lines
No EOL
133 KiB
GLSL

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "SLZ/Nullman"
{
Properties
{
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
[HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
[ASEBegin]_BaseMap("_BaseMap", 2D) = "white" {}
[NoScaleOffset]g_tBRDFMap("BRDF map", 2D) = "white" {}
[NoScaleOffset]_WireColor("WireColor", 2D) = "white" {}
_WireScale("Wire Scale", Float) = 3
_Refraction("Refraction", Range( 0.5 , 1)) = 0.884
_Smoothness("Smoothness", Range( 0 , 1)) = 0
_Metallic("Metallic", Range( 0 , 1)) = 0
[HDR]_Emission("Emission", Color) = (1,1,1,1)
[NoScaleOffset][SingleLineTexture]_HitRamp("Hit Ramp", 2D) = "black" {}
[HideInInspector]_NumberOfHits("_NumberOfHits", Int) = 0
_Cubemap("Cubemap", CUBE) = "white" {}
[ASEEnd][Toggle]_CustomCubemap("Custom Cubemap", Float) = 1
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[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" }
Cull Back
ZWrite On
ZTest LEqual
Offset 0 , 0
AlphaToMask Off
HLSLINCLUDE
#pragma target 3.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 _DISABLE_LIGHTMAPS
#define _EMISSION
#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_WORLD_NORMAL
#define ASE_NEEDS_FRAG_WORLD_VIEW_DIR
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.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)
half4x4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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);
TEXTURECUBE(_Cubemap);
SAMPLER(sampler_Cubemap);
TEXTURE2D(_WireColor);
SAMPLER(sampler_WireColor);
half2 PosespaceImpacts_A( float3 Posespace )
{
return GetClosestImpactUV( Posespace, EllipsoidPosArray , _NumberOfHits );
}
half2 SampleHitTex( half2 ImpactsUV )
{
return SampleHitTexture(ImpactsUV);
}
float3 MyCustomExpression( float3 viewDirectionWS, float blur )
{
return DecodeHDREnvironment(SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0 , viewDirectionWS, blur*UNITY_SPECCUBE_LOD_STEPS), unity_SpecCube0_HDR);
}
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.xyz = v.texcoord.xyz;
o.ase_texcoord9.xyz = v.texcoord1.xyz;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord8.w = 0;
o.ase_texcoord9.w = 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 );
float3 normalizedWorldNormal = normalize( WorldNormal );
float dotResult13 = dot( normalizedWorldNormal , WorldViewDirection );
float temp_output_89_0 = saturate( dotResult13 );
float2 uv_BaseMap = IN.ase_texcoord8.xyz.xy * _BaseMap_ST.xy + _BaseMap_ST.zw;
float4 tex2DNode8 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, uv_BaseMap );
float4 temp_output_14_0 = ( temp_output_89_0 * temp_output_89_0 * tex2DNode8 );
float3 texCoord31 = IN.ase_texcoord9.xyz;
texCoord31.xy = IN.ase_texcoord9.xyz.xy * float2( 1,1 ) + float2( 0,0 );
half3 Posespace29 = texCoord31;
half2 localPosespaceImpacts_A29 = PosespaceImpacts_A( Posespace29 );
half2 ImpactsUV137 = localPosespaceImpacts_A29;
half2 localSampleHitTex137 = SampleHitTex( ImpactsUV137 );
float temp_output_144_0 = min( (localSampleHitTex137).y , ( 1.0 - floor( (localPosespaceImpacts_A29).x ) ) );
float3 temp_output_66_0 = refract( -WorldViewDirection , normalizedWorldNormal , _Refraction );
float3 viewDirectionWS58 = temp_output_66_0;
float temp_output_65_0 = ( 1.0 - temp_output_89_0 );
float blur58 = temp_output_65_0;
float3 localMyCustomExpression58 = MyCustomExpression( viewDirectionWS58 , blur58 );
float3 texCoord5 = IN.ase_texcoord9.xyz;
texCoord5.xy = IN.ase_texcoord9.xyz.xy * float2( 1,1 ) + float2( 0,0 );
float4 tex2DNode7 = SAMPLE_TEXTURE2D( _WireColor, sampler_WireColor, ( texCoord5 * _WireScale ).xy );
float4 blendOpSrc129 = tex2DNode8;
float4 blendOpDest129 = tex2DNode7;
float4 lerpBlendMode129 = lerp(blendOpDest129,abs( blendOpSrc129 - blendOpDest129 ),saturate( (0.0 + (temp_output_65_0 - 0.48) * (1.0 - 0.0) / (1.0 - 0.48)) ));
float temp_output_145_0 = ( 1.0 - temp_output_144_0 );
float4 lerpResult160 = lerp( (( _CustomCubemap )?( SAMPLE_TEXTURECUBE_LOD( _Cubemap, sampler_Cubemap, temp_output_66_0, temp_output_65_0 ) ):( float4( localMyCustomExpression58 , 0.0 ) )) , ( ( lerpBlendMode129 + ( (( _CustomCubemap )?( SAMPLE_TEXTURECUBE_LOD( _Cubemap, sampler_Cubemap, temp_output_66_0, temp_output_65_0 ) ):( float4( localMyCustomExpression58 , 0.0 ) )) * temp_output_14_0 ) ) * temp_output_145_0 * _Emission ) , min( temp_output_145_0 , tex2DNode7.a ));
float3 Albedo = temp_output_14_0.rgb;
float3 Normal = float3(0, 0, 1);
float3 Emission = ( float4( ( localSampleHitTex137 * temp_output_144_0 ), 0.0 , 0.0 ) + lerpResult160 ).rgb;
#if 0
float3 BakedEmission = 0;
#endif
float3 Specular = 0.5;
float Metallic = _Metallic;
float Smoothness = _Smoothness;
float Occlusion = temp_output_145_0;
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 = 0;
#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 _DISABLE_LIGHTMAPS
#define _EMISSION
#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"
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
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
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
half4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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
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 );
#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;
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
#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
float Alpha = 1;
float AlphaClipThreshold = 0.5;
float AlphaClipThresholdShadow = 0.5;
#ifdef ASE_DEPTH_WRITE_ON
float DepthValue = 0;
#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 _DISABLE_LIGHTMAPS
#define _EMISSION
#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"
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
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
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
half4x4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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
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);
#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;
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
#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
float Alpha = 1;
float AlphaClipThreshold = 0.5;
#ifdef ASE_DEPTH_WRITE_ON
float DepthValue = 0;
#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
}
Pass
{
Name "Meta"
Tags { "LightMode"="Meta" }
Cull Off
HLSLPROGRAM
#define _NORMAL_DROPOFF_TS 1
#pragma multi_compile_fog
#define ASE_FOG 1
#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED
#define _DISABLE_LIGHTMAPS
#define _EMISSION
#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 shader_feature _ EDITOR_VISUALIZATION
#define SHADERPASS SHADERPASS_META
#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/ShaderLibrary/MetaInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#define ASE_NEEDS_VERT_NORMAL
#define ASE_NEEDS_FRAG_WORLD_POSITION
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
float4 texcoord0 : TEXCOORD0;
float4 texcoord1 : TEXCOORD1;
float4 texcoord2 : TEXCOORD2;
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
#ifdef EDITOR_VISUALIZATION
float4 VizUV : TEXCOORD2;
float4 LightCoord : TEXCOORD3;
#endif
float4 ase_texcoord4 : TEXCOORD4;
float4 ase_texcoord5 : TEXCOORD5;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
half4x4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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);
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);
float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal);
o.ase_texcoord4.xyz = ase_worldNormal;
o.ase_texcoord5.xy = v.texcoord0.xy;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord4.w = 0;
o.ase_texcoord5.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 );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
o.worldPos = positionWS;
#endif
o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST );
#ifdef EDITOR_VISUALIZATION
float2 VizUV = 0;
float4 LightCoord = 0;
UnityEditorVizData(v.vertex.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord);
o.VizUV = float4(VizUV, 0, 0);
o.LightCoord = LightCoord;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = o.clipPos;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
return o;
}
#if defined(TESSELLATION_ON)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 ase_normal : NORMAL;
float4 texcoord0 : 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.texcoord0 = v.texcoord0;
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.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * 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
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
float3 ase_worldNormal = IN.ase_texcoord4.xyz;
float3 normalizedWorldNormal = normalize( ase_worldNormal );
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition );
ase_worldViewDir = SafeNormalize( ase_worldViewDir );
float dotResult13 = dot( normalizedWorldNormal , ase_worldViewDir );
float temp_output_89_0 = saturate( dotResult13 );
float2 uv_BaseMap = IN.ase_texcoord5.xy * _BaseMap_ST.xy + _BaseMap_ST.zw;
float4 tex2DNode8 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, uv_BaseMap );
float4 temp_output_14_0 = ( temp_output_89_0 * temp_output_89_0 * tex2DNode8 );
float3 Albedo = temp_output_14_0.rgb;
float3 Emission = 0;
float Alpha = 1;
float AlphaClipThreshold = 0.5;
#if defined(_ALPHATEST_ON) && !defined(ASE_TERRAIN)
clip(Alpha - AlphaClipThreshold);
#endif
MetaInput metaInput = (MetaInput)0;
metaInput.Albedo = Albedo;
metaInput.Emission = Emission;
#ifdef EDITOR_VISUALIZATION
metaInput.VizUV = IN.VizUV.xy;
metaInput.LightCoord = IN.LightCoord;
#endif
return MetaFragment(metaInput);
}
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 _DISABLE_LIGHTMAPS
#define _EMISSION
#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"
#define ASE_NEEDS_VERT_NORMAL
#define ASE_NEEDS_FRAG_WORLD_POSITION
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.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)
half4x4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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);
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 );
float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal);
o.ase_texcoord2.xyz = ase_worldNormal;
o.ase_texcoord3.xy = v.ase_texcoord.xy;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord2.w = 0;
o.ase_texcoord3.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
float3 ase_worldNormal = IN.ase_texcoord2.xyz;
float3 normalizedWorldNormal = normalize( ase_worldNormal );
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition );
ase_worldViewDir = SafeNormalize( ase_worldViewDir );
float dotResult13 = dot( normalizedWorldNormal , ase_worldViewDir );
float temp_output_89_0 = saturate( dotResult13 );
float2 uv_BaseMap = IN.ase_texcoord3.xy * _BaseMap_ST.xy + _BaseMap_ST.zw;
float4 tex2DNode8 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, uv_BaseMap );
float4 temp_output_14_0 = ( temp_output_89_0 * temp_output_89_0 * tex2DNode8 );
float3 Albedo = temp_output_14_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 _DISABLE_LIGHTMAPS
#define _EMISSION
#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"
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.hlsl"
struct VertexInput
{
float4 vertex : POSITION;
float3 ase_normal : NORMAL;
float4 ase_tangent : TANGENT;
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;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
half4x4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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
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);
#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;
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;
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;
#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
float3 Normal = float3(0, 0, 1);
float Alpha = 1;
float AlphaClipThreshold = 0.5;
#ifdef ASE_DEPTH_WRITE_ON
float DepthValue = 0;
#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"="UniversalGBuffer" }
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 _DISABLE_LIGHTMAPS#define _EMISSION#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_WORLD_NORMAL
#define ASE_NEEDS_FRAG_WORLD_VIEW_DIR
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.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)
half4x4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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);
TEXTURECUBE(_Cubemap);
SAMPLER(sampler_Cubemap);
TEXTURE2D(_WireColor);
SAMPLER(sampler_WireColor);
half2 PosespaceImpacts_A( float3 Posespace )
{
return GetClosestImpactUV( Posespace, EllipsoidPosArray , _NumberOfHits );
}
half2 SampleHitTex( half2 ImpactsUV )
{
return SampleHitTexture(ImpactsUV);
}
float3 MyCustomExpression( float3 viewDirectionWS, float blur )
{
return DecodeHDREnvironment(SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0 , viewDirectionWS, blur*UNITY_SPECCUBE_LOD_STEPS), unity_SpecCube0_HDR);
}
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.xyz = v.texcoord.xyz;
o.ase_texcoord9.xyz = v.texcoord1.xyz;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord8.w = 0;
o.ase_texcoord9.w = 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 );
float3 normalizedWorldNormal = normalize( WorldNormal );
float dotResult13 = dot( normalizedWorldNormal , WorldViewDirection );
float temp_output_89_0 = saturate( dotResult13 );
float2 uv_BaseMap = IN.ase_texcoord8.xyz.xy * _BaseMap_ST.xy + _BaseMap_ST.zw;
float4 tex2DNode8 = SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, uv_BaseMap );
float4 temp_output_14_0 = ( temp_output_89_0 * temp_output_89_0 * tex2DNode8 );
float3 texCoord31 = IN.ase_texcoord9.xyz;
texCoord31.xy = IN.ase_texcoord9.xyz.xy * float2( 1,1 ) + float2( 0,0 );
half3 Posespace29 = texCoord31;
half2 localPosespaceImpacts_A29 = PosespaceImpacts_A( Posespace29 );
half2 ImpactsUV137 = localPosespaceImpacts_A29;
half2 localSampleHitTex137 = SampleHitTex( ImpactsUV137 );
float temp_output_144_0 = min( (localSampleHitTex137).y , ( 1.0 - floor( (localPosespaceImpacts_A29).x ) ) );
float3 temp_output_66_0 = refract( -WorldViewDirection , normalizedWorldNormal , _Refraction );
float3 viewDirectionWS58 = temp_output_66_0;
float temp_output_65_0 = ( 1.0 - temp_output_89_0 );
float blur58 = temp_output_65_0;
float3 localMyCustomExpression58 = MyCustomExpression( viewDirectionWS58 , blur58 );
float3 texCoord5 = IN.ase_texcoord9.xyz;
texCoord5.xy = IN.ase_texcoord9.xyz.xy * float2( 1,1 ) + float2( 0,0 );
float4 tex2DNode7 = SAMPLE_TEXTURE2D( _WireColor, sampler_WireColor, ( texCoord5 * _WireScale ).xy );
float4 blendOpSrc129 = tex2DNode8;
float4 blendOpDest129 = tex2DNode7;
float4 lerpBlendMode129 = lerp(blendOpDest129,abs( blendOpSrc129 - blendOpDest129 ),saturate( (0.0 + (temp_output_65_0 - 0.48) * (1.0 - 0.0) / (1.0 - 0.48)) ));
float temp_output_145_0 = ( 1.0 - temp_output_144_0 );
float4 lerpResult160 = lerp( (( _CustomCubemap )?( SAMPLE_TEXTURECUBE_LOD( _Cubemap, sampler_Cubemap, temp_output_66_0, temp_output_65_0 ) ):( float4( localMyCustomExpression58 , 0.0 ) )) , ( ( lerpBlendMode129 + ( (( _CustomCubemap )?( SAMPLE_TEXTURECUBE_LOD( _Cubemap, sampler_Cubemap, temp_output_66_0, temp_output_65_0 ) ):( float4( localMyCustomExpression58 , 0.0 ) )) * temp_output_14_0 ) ) * temp_output_145_0 * _Emission ) , min( temp_output_145_0 , tex2DNode7.a ));
float3 Albedo = temp_output_14_0.rgb;
float3 Normal = float3(0, 0, 1);
float3 Emission = ( float4( ( localSampleHitTex137 * temp_output_144_0 ), 0.0 , 0.0 ) + lerpResult160 ).rgb;
float3 Specular = 0.5;
float Metallic = _Metallic;
float Smoothness = _Smoothness;
float Occlusion = temp_output_145_0;
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 = 0;
#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 _DISABLE_LIGHTMAPS
#define _EMISSION
#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"
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.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)
half4x4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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 _DISABLE_LIGHTMAPS
#define _EMISSION
#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"
#pragma shader_feature_local_fragment _BRDFMAP
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.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)
half4x4 EllipsoidPosArray[HitMatrixCount];
float4 _BaseMap_ST;
float4 _Emission;
int _NumberOfHits;
float _CustomCubemap;
float _Refraction;
float _WireScale;
float _Metallic;
float _Smoothness;
#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
2377;282;1920;719;920.551;1386.058;1;True;True
Node;AmplifyShaderEditor.CommentaryNode;26;-831.1582,-1271.949;Inherit;False;1130.562;520.1016;Posspace impacts;8;141;139;137;29;31;146;149;154;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;140;-250.5171,-867.0173;Inherit;False;527.1998;186.4003;Clip;3;144;143;142;;1,1,1,1;0;0
Node;AmplifyShaderEditor.SimpleMinOpNode;165;841.048,-143.3738;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.PowerNode;131;-566.3386,-757.3566;Inherit;False;True;2;0;FLOAT;0;False;1;FLOAT;5;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;145;133.857,-646.8608;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;19;-429.9197,844.2775;Inherit;False;Constant;_Float0;Float 0;4;0;Create;True;0;0;0;False;0;False;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.Matrix4X4Node;154;-808.881,-1025.135;Inherit;False;Property;EllipsoidPosArray[HitMatrixCount];EllipsoidPosArray;12;0;Create;False;0;0;0;True;0;False;1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1;0;1;FLOAT4x4;0
Node;AmplifyShaderEditor.RangedFloatNode;16;-246.9198,844.2775;Inherit;False;Property;_DisplacementAmount;Displacement Amount;5;0;Create;True;0;0;0;False;0;False;0;0.004;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;87;-1090.788,52.81657;Inherit;False;Property;_WireScale;Wire Scale;3;0;Create;True;0;0;0;False;0;False;3;2.3;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;90;-718.9076,-50.80401;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.LerpOp;160;751.3168,-256.9434;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.TexturePropertyNode;146;80.82147,-1235.564;Inherit;True;Property;_HitRamp;Hit Ramp;10;2;[NoScaleOffset];[SingleLineTexture];Fetch;True;0;0;0;True;0;False;None;76fcc1011f697434db1b4dd61a9f40df;False;black;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.FloorOpNode;142;-200.5166,-791.617;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RelayNode;115;362.0261,-524.0076;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;31;-757.2919,-1179.52;Inherit;False;1;-1;3;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;79;669.2932,-745.8077;Inherit;False;Property;_Smoothness;Smoothness;7;0;Create;True;0;0;0;False;0;False;0;0.854;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;68;-1445.744,-547.5814;Inherit;False;Property;_Refraction;Refraction;6;0;Create;True;0;0;0;False;0;False;0.884;0.981;0.5;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;135;1397.647,105.2692;Inherit;True;Property;g_tBRDFMap;BRDF map;1;1;[NoScaleOffset];Fetch;False;0;0;0;True;0;False;None;de79bcbe6f99c48da9238822c4300e8f;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.BlendOpsNode;129;-38.41203,30.29977;Inherit;True;Difference;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;1;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;123;464.7832,-647.4188;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.BreakToComponentsNode;138;258.4911,-978.3395;Inherit;False;FLOAT;1;0;FLOAT;0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
Node;AmplifyShaderEditor.WorldNormalVector;35;-1472.088,-1092.346;Inherit;False;True;1;0;FLOAT3;0,0,1;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.ToggleSwitchNode;161;-521.785,-316.5437;Inherit;False;Property;_CustomCubemap;Custom Cubemap;14;0;Create;True;0;0;0;False;0;False;1;True;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ViewDirInputsCoordNode;12;-1462.103,-767.708;Inherit;False;World;True;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.IntNode;149;-727.9803,-885.525;Inherit;False;Property;_NumberOfHits;_NumberOfHits;11;1;[HideInInspector];Create;True;0;0;0;True;0;False;0;0;False;0;1;INT;0
Node;AmplifyShaderEditor.SwizzleNode;141;-224.691,-986.3836;Inherit;False;FLOAT;0;1;2;3;1;0;FLOAT2;0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CustomExpressionNode;58;-805.3964,-429.2491;Inherit;False;return DecodeHDREnvironment(SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0 , viewDirectionWS, blur*UNITY_SPECCUBE_LOD_STEPS), unity_SpecCube0_HDR)@;3;Create;2;True;viewDirectionWS;FLOAT3;0,0,0;In;;Inherit;False;True;blur;FLOAT;0;In;;Inherit;False;My Custom Expression;False;False;0;;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.RefractOpVec;66;-1090.668,-636.2891;Inherit;False;3;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.OneMinusNode;143;-56.51789,-793.217;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.NegateNode;70;-1248.481,-668.7733;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.WorldNormalVector;81;-1290.717,-947.2798;Inherit;False;True;1;0;FLOAT3;0,0,1;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.DotProductOpNode;13;-1054.969,-801.1615;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;166;426.9427,-783.6636;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TFHCRemapNode;132;-439.6486,-633.1974;Inherit;True;5;0;FLOAT;0;False;1;FLOAT;0.48;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerStateNode;109;-403.2362,-741.7126;Inherit;False;4;1;0;1;-1;None;1;0;SAMPLER2D;;False;1;SAMPLERSTATE;0
Node;AmplifyShaderEditor.NormalVertexDataNode;71;-1468.606,-932.2385;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.CustomExpressionNode;29;-400.6082,-1077.482;Half;False;return GetClosestImpactUV( Posespace, EllipsoidPosArray , _NumberOfHits )@;2;Create;1;True;Posespace;FLOAT3;0,0,0;In;;Float;False;PosespaceImpacts_A;False;False;0;7b6b6173356a02044990adfdcb567f25;False;1;0;FLOAT3;0,0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.OneMinusNode;65;-840.4833,-712.3312;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;24;-938.399,502.4214;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.OneMinusNode;122;93.36023,-192.3652;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;-864.9715,125.062;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;3;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SamplerNode;15;-740.3387,746.6892;Inherit;True;Property;_DisplacementMap;DisplacementMap;4;1;[NoScaleOffset];Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SaturateNode;89;-824.1046,-775.8494;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;80;669.2932,-823.8077;Inherit;False;Property;_Metallic;Metallic;8;0;Create;True;0;0;0;False;0;False;0;0.562;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;7;-492.0483,58.95336;Inherit;True;Property;_WireColor;WireColor;2;1;[NoScaleOffset];Create;True;0;0;0;False;0;False;-1;07e40fb4bdc07784493f741d9447821a;a22f1ecdacadc2b40aeebd97493732ad;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.SaturateNode;133;-159.6486,-489.1974;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;8;-502.8986,-120.0093;Inherit;True;Property;_BaseMap;_BaseMap;0;0;Create;True;0;0;0;False;0;False;-1;e298abdcd2d10894fba4930f7890c1fc;76e0dfed0d3b7914983be74f711467f6;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleAddOpNode;21;22.01736,742.7548;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.PosVertexDataNode;20;-205.5099,599.1859;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;78;113.4936,-106.5526;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;5;-1364.524,347.8478;Inherit;False;1;-1;3;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;157;-859.325,-300.5988;Inherit;True;Property;_Cubemap;Cubemap;13;0;Create;True;0;0;0;False;0;False;-1;None;115f13f0a868a454e9cdcee7cf7dba60;True;0;False;white;LockedToCube;False;Object;-1;MipLevel;Cube;8;0;SAMPLERCUBE;;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;3;FLOAT3;0,0,0;False;4;FLOAT3;0,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.SimpleMinOpNode;144;124.6821,-817.0174;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;18;-351.9198,752.2774;Inherit;False;2;0;COLOR;0.5,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;17;-158.9197,753.2774;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;134;292.5822,280.2836;Inherit;False;Property;_Emission;Emission;9;1;[HDR];Create;True;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;113;-80.55261,-575.9805;Inherit;False;FLOAT;0;1;2;3;1;0;FLOAT2;0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleTimeNode;22;-1206.77,524.5335;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;9;316.6104,55.69166;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.TFHCRemapNode;53;-1750.74,-94.97852;Inherit;True;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0.3;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SwizzleNode;139;-8.460827,-961.1543;Inherit;False;FLOAT;3;1;2;3;1;0;FLOAT2;0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;114;495.3173,-15.92235;Inherit;False;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.CustomExpressionNode;137;-128.6731,-1065.85;Half;False;return SampleHitTexture(ImpactsUV)@;2;Create;1;True;ImpactsUV;FLOAT2;0,0;In;;Inherit;False;SampleHitTex;False;False;0;7b6b6173356a02044990adfdcb567f25;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.WorldPosInputsNode;51;731.1708,483.9148;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.SimpleAddOpNode;116;953.6899,-310.2614;Inherit;False;2;2;0;FLOAT2;0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SaturateNode;85;-1383.562,-46.49241;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StaticSwitch;136;1423.192,7.304076;Inherit;False;Property;BRDFMAP1;Enable BRDF map;0;0;Create;False;0;0;0;True;0;False;0;0;0;False;_BRDFMAP;Toggle;2;Key0;Key1;Create;True;False;Fragment;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;14;-166.6766,-262.7515;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;102;980.6183,-516.1838;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;105;980.6183,-516.1838;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.TemplateMultiPassMasterNode;103;980.6183,-516.1838;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;100;1279.686,-514.3459;Half;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;SLZ/Nullman;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;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=UniversalForward;False;False;2;Include;;False;;Native;Include;Packages/com.unity.render-pipelines.universal/ShaderLibrary/PosespaceImpacts.hlsl;False;;Custom;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;0;637871337383113979;LOD CrossFade;0;637836073116476184;Built-in Fog;1;0;Lightmaps;0;637946547281780365;Volumetrics;1;0;Decals;0;637871337399645676;Screen Space Occlusion;1;0;Reflection Probe Blend/Projection;1;0;Light Layers;0;637871337407115445;_FinalColorxAlpha;0;0;Meta Pass;1;0;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;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;Fluorescence;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;True;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;104;980.6183,-516.1838;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;101;980.6183,-516.1838;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;108;980.6183,-516.1838;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;980.6183,-516.1838;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;99;980.6183,-527.7669;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;106;980.6183,-516.1838;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;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=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
WireConnection;165;0;145;0
WireConnection;165;1;7;4
WireConnection;131;0;65;0
WireConnection;145;0;144;0
WireConnection;160;0;161;0
WireConnection;160;1;114;0
WireConnection;160;2;165;0
WireConnection;142;0;141;0
WireConnection;115;0;145;0
WireConnection;129;0;8;0
WireConnection;129;1;7;0
WireConnection;129;2;133;0
WireConnection;123;0;137;0
WireConnection;123;1;144;0
WireConnection;161;0;58;0
WireConnection;161;1;157;0
WireConnection;141;0;29;0
WireConnection;58;0;66;0
WireConnection;58;1;65;0
WireConnection;66;0;70;0
WireConnection;66;1;81;0
WireConnection;66;2;68;0
WireConnection;143;0;142;0
WireConnection;70;0;12;0
WireConnection;13;0;81;0
WireConnection;13;1;12;0
WireConnection;132;0;65;0
WireConnection;29;0;31;0
WireConnection;65;0;89;0
WireConnection;24;0;5;0
WireConnection;24;1;22;0
WireConnection;10;0;5;0
WireConnection;10;1;87;0
WireConnection;15;1;24;0
WireConnection;89;0;13;0
WireConnection;7;1;10;0
WireConnection;133;0;132;0
WireConnection;21;0;20;0
WireConnection;21;1;17;0
WireConnection;78;0;161;0
WireConnection;78;1;14;0
WireConnection;157;1;66;0
WireConnection;157;2;65;0
WireConnection;144;0;139;0
WireConnection;144;1;143;0
WireConnection;18;0;15;0
WireConnection;18;1;19;0
WireConnection;17;0;18;0
WireConnection;17;1;16;0
WireConnection;113;0;29;0
WireConnection;9;0;129;0
WireConnection;9;1;78;0
WireConnection;53;0;89;0
WireConnection;139;0;137;0
WireConnection;114;0;9;0
WireConnection;114;1;115;0
WireConnection;114;2;134;0
WireConnection;137;0;29;0
WireConnection;116;0;123;0
WireConnection;116;1;160;0
WireConnection;85;0;53;0
WireConnection;14;0;89;0
WireConnection;14;1;89;0
WireConnection;14;2;8;0
WireConnection;100;0;14;0
WireConnection;100;2;116;0
WireConnection;100;3;80;0
WireConnection;100;4;79;0
WireConnection;100;5;115;0
ASEEND*/
//CHKSM=B89AE597CED47D4D90D5FDEE67FCFACD2DDB7E0B