TextureArray_DisplayNormal.shader 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "MTE/URP/TextureArray_DisplayNormal"
  4. {
  5. Properties
  6. {
  7. [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
  8. [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
  9. [ASEBegin]_Control0("Control0", 2D) = "white" {}
  10. _Control1("Control1", 2D) = "white" {}
  11. _Control2("Control2", 2D) = "white" {}
  12. _TextureArray1("TextureArray1", 2DArray) = "white" {}
  13. _UVScaleOffset("UVScaleOffset", Vector) = (0,0,0,0)
  14. [ASEEnd]_NormalIntensity("Normal Intensity", Range( 0.01 , 10)) = 1
  15. //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5
  16. //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
  17. //_TessMin( "Tess Min Distance", Float ) = 10
  18. //_TessMax( "Tess Max Distance", Float ) = 25
  19. //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16
  20. //_TessMaxDisp( "Tess Max Displacement", Float ) = 25
  21. }
  22. SubShader
  23. {
  24. LOD 0
  25. Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Opaque" "Queue"="Geometry" }
  26. Cull Back
  27. AlphaToMask Off
  28. HLSLINCLUDE
  29. #pragma target 3.0
  30. #pragma prefer_hlslcc gles
  31. #pragma exclude_renderers d3d11_9x
  32. #ifndef ASE_TESS_FUNCS
  33. #define ASE_TESS_FUNCS
  34. float4 FixedTess( float tessValue )
  35. {
  36. return tessValue;
  37. }
  38. float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
  39. {
  40. float3 wpos = mul(o2w,vertex).xyz;
  41. float dist = distance (wpos, cameraPos);
  42. float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
  43. return f;
  44. }
  45. float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
  46. {
  47. float4 tess;
  48. tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
  49. tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
  50. tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
  51. tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
  52. return tess;
  53. }
  54. float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
  55. {
  56. float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
  57. float len = distance(wpos0, wpos1);
  58. float f = max(len * scParams.y / (edgeLen * dist), 1.0);
  59. return f;
  60. }
  61. float DistanceFromPlane (float3 pos, float4 plane)
  62. {
  63. float d = dot (float4(pos,1.0f), plane);
  64. return d;
  65. }
  66. bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
  67. {
  68. float4 planeTest;
  69. planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  70. (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  71. (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
  72. planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  73. (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  74. (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
  75. planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  76. (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  77. (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
  78. planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  79. (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  80. (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
  81. return !all (planeTest);
  82. }
  83. float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
  84. {
  85. float3 f;
  86. f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
  87. f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
  88. f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
  89. return CalcTriEdgeTessFactors (f);
  90. }
  91. float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
  92. {
  93. float3 pos0 = mul(o2w,v0).xyz;
  94. float3 pos1 = mul(o2w,v1).xyz;
  95. float3 pos2 = mul(o2w,v2).xyz;
  96. float4 tess;
  97. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  98. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  99. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  100. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  101. return tess;
  102. }
  103. float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
  104. {
  105. float3 pos0 = mul(o2w,v0).xyz;
  106. float3 pos1 = mul(o2w,v1).xyz;
  107. float3 pos2 = mul(o2w,v2).xyz;
  108. float4 tess;
  109. if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
  110. {
  111. tess = 0.0f;
  112. }
  113. else
  114. {
  115. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  116. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  117. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  118. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  119. }
  120. return tess;
  121. }
  122. #endif //ASE_TESS_FUNCS
  123. ENDHLSL
  124. Pass
  125. {
  126. Name "Forward"
  127. Tags { "LightMode"="UniversalForward" }
  128. Blend One Zero, One Zero
  129. ZWrite On
  130. ZTest LEqual
  131. Offset 0 , 0
  132. ColorMask RGBA
  133. HLSLPROGRAM
  134. #pragma multi_compile_instancing
  135. #define ASE_SRP_VERSION 100500
  136. #pragma vertex vert
  137. #pragma fragment frag
  138. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  139. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  140. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  141. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
  142. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  143. #if ASE_SRP_VERSION <= 70108
  144. #define REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR
  145. #endif
  146. #include "../MTECommonPBR.hlsl"
  147. struct VertexInput
  148. {
  149. float4 vertex : POSITION;
  150. float3 ase_normal : NORMAL;
  151. float4 ase_texcoord : TEXCOORD0;
  152. UNITY_VERTEX_INPUT_INSTANCE_ID
  153. };
  154. struct VertexOutput
  155. {
  156. float4 clipPos : SV_POSITION;
  157. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  158. float3 worldPos : TEXCOORD0;
  159. #endif
  160. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  161. float4 shadowCoord : TEXCOORD1;
  162. #endif
  163. #ifdef ASE_FOG
  164. float fogFactor : TEXCOORD2;
  165. #endif
  166. float4 ase_texcoord3 : TEXCOORD3;
  167. UNITY_VERTEX_INPUT_INSTANCE_ID
  168. UNITY_VERTEX_OUTPUT_STEREO
  169. };
  170. CBUFFER_START(UnityPerMaterial)
  171. float4 _Control0_ST;
  172. float4 _Control1_ST;
  173. float4 _Control2_ST;
  174. float4 _UVScaleOffset;
  175. float _NormalIntensity;
  176. #ifdef TESSELLATION_ON
  177. float _TessPhongStrength;
  178. float _TessValue;
  179. float _TessMin;
  180. float _TessMax;
  181. float _TessEdgeLength;
  182. float _TessMaxDisp;
  183. #endif
  184. CBUFFER_END
  185. sampler2D _Control0;
  186. sampler2D _Control1;
  187. sampler2D _Control2;
  188. TEXTURE2D_ARRAY(_TextureArray1);
  189. SAMPLER(sampler_TextureArray1);
  190. float4 WeightedBlend4177( half4 Weight, float4 Layer1, float4 Layer2, float4 Layer3, float4 Layer4 )
  191. {
  192. return Layer1 * Weight.r + Layer2 * Weight.g + Layer3 * Weight.b + Layer4 * Weight.a;
  193. }
  194. inline float3 RestoreNormal213( float2 NormalXY, float Intensity )
  195. {
  196. return RestoreNormal(NormalXY, Intensity);
  197. }
  198. VertexOutput VertexFunction ( VertexInput v )
  199. {
  200. VertexOutput o = (VertexOutput)0;
  201. UNITY_SETUP_INSTANCE_ID(v);
  202. UNITY_TRANSFER_INSTANCE_ID(v, o);
  203. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  204. o.ase_texcoord3.xy = v.ase_texcoord.xy;
  205. //setting value to unused interpolator channels and avoid initialization warnings
  206. o.ase_texcoord3.zw = 0;
  207. #ifdef ASE_ABSOLUTE_VERTEX_POS
  208. float3 defaultVertexValue = v.vertex.xyz;
  209. #else
  210. float3 defaultVertexValue = float3(0, 0, 0);
  211. #endif
  212. float3 vertexValue = defaultVertexValue;
  213. #ifdef ASE_ABSOLUTE_VERTEX_POS
  214. v.vertex.xyz = vertexValue;
  215. #else
  216. v.vertex.xyz += vertexValue;
  217. #endif
  218. v.ase_normal = v.ase_normal;
  219. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  220. float4 positionCS = TransformWorldToHClip( positionWS );
  221. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  222. o.worldPos = positionWS;
  223. #endif
  224. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  225. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  226. vertexInput.positionWS = positionWS;
  227. vertexInput.positionCS = positionCS;
  228. o.shadowCoord = GetShadowCoord( vertexInput );
  229. #endif
  230. #ifdef ASE_FOG
  231. o.fogFactor = ComputeFogFactor( positionCS.z );
  232. #endif
  233. o.clipPos = positionCS;
  234. return o;
  235. }
  236. #if defined(TESSELLATION_ON)
  237. struct VertexControl
  238. {
  239. float4 vertex : INTERNALTESSPOS;
  240. float3 ase_normal : NORMAL;
  241. float4 ase_texcoord : TEXCOORD0;
  242. UNITY_VERTEX_INPUT_INSTANCE_ID
  243. };
  244. struct TessellationFactors
  245. {
  246. float edge[3] : SV_TessFactor;
  247. float inside : SV_InsideTessFactor;
  248. };
  249. VertexControl vert ( VertexInput v )
  250. {
  251. VertexControl o;
  252. UNITY_SETUP_INSTANCE_ID(v);
  253. UNITY_TRANSFER_INSTANCE_ID(v, o);
  254. o.vertex = v.vertex;
  255. o.ase_normal = v.ase_normal;
  256. o.ase_texcoord = v.ase_texcoord;
  257. return o;
  258. }
  259. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  260. {
  261. TessellationFactors o;
  262. float4 tf = 1;
  263. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  264. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  265. #if defined(ASE_FIXED_TESSELLATION)
  266. tf = FixedTess( tessValue );
  267. #elif defined(ASE_DISTANCE_TESSELLATION)
  268. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  269. #elif defined(ASE_LENGTH_TESSELLATION)
  270. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  271. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  272. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  273. #endif
  274. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  275. return o;
  276. }
  277. [domain("tri")]
  278. [partitioning("fractional_odd")]
  279. [outputtopology("triangle_cw")]
  280. [patchconstantfunc("TessellationFunction")]
  281. [outputcontrolpoints(3)]
  282. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  283. {
  284. return patch[id];
  285. }
  286. [domain("tri")]
  287. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  288. {
  289. VertexInput o = (VertexInput) 0;
  290. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  291. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  292. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  293. #if defined(ASE_PHONG_TESSELLATION)
  294. float3 pp[3];
  295. for (int i = 0; i < 3; ++i)
  296. 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));
  297. float phongStrength = _TessPhongStrength;
  298. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  299. #endif
  300. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  301. return VertexFunction(o);
  302. }
  303. #else
  304. VertexOutput vert ( VertexInput v )
  305. {
  306. return VertexFunction( v );
  307. }
  308. #endif
  309. half4 frag ( VertexOutput IN ) : SV_Target
  310. {
  311. UNITY_SETUP_INSTANCE_ID( IN );
  312. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  313. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  314. float3 WorldPosition = IN.worldPos;
  315. #endif
  316. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  317. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  318. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  319. ShadowCoords = IN.shadowCoord;
  320. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  321. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  322. #endif
  323. #endif
  324. float localGetMax4WeightLayers190 = ( 0.0 );
  325. float2 uv_Control0 = IN.ase_texcoord3.xy * _Control0_ST.xy + _Control0_ST.zw;
  326. float4 Control0190 = tex2D( _Control0, uv_Control0 );
  327. float2 uv_Control1 = IN.ase_texcoord3.xy * _Control1_ST.xy + _Control1_ST.zw;
  328. float4 Control1190 = tex2D( _Control1, uv_Control1 );
  329. float2 uv_Control2 = IN.ase_texcoord3.xy * _Control2_ST.xy + _Control2_ST.zw;
  330. float4 Control2190 = tex2D( _Control2, uv_Control2 );
  331. float4 Weights190 = float4( 1,0,0,0 );
  332. float4 Indices190 = float4( 1,0,0,0 );
  333. {
  334. Max4WeightLayer(Control0190, Control1190, Control2190, Weights190, Indices190);
  335. }
  336. float4 Weight177 = Weights190;
  337. float4 appendResult199 = (float4(_UVScaleOffset.x , _UVScaleOffset.y , 0.0 , 0.0));
  338. float4 appendResult200 = (float4(_UVScaleOffset.z , _UVScaleOffset.w , 0.0 , 0.0));
  339. float2 texCoord201 = IN.ase_texcoord3.xy * appendResult199.xy + appendResult200.xy;
  340. float2 TransformedUV202 = texCoord201;
  341. float4 break204 = Indices190;
  342. float4 Layer1177 = SAMPLE_TEXTURE2D_ARRAY( _TextureArray1, sampler_TextureArray1, TransformedUV202,break204.x );
  343. float4 Layer2177 = SAMPLE_TEXTURE2D_ARRAY( _TextureArray1, sampler_TextureArray1, TransformedUV202,break204.y );
  344. float4 Layer3177 = SAMPLE_TEXTURE2D_ARRAY( _TextureArray1, sampler_TextureArray1, TransformedUV202,break204.z );
  345. float4 Layer4177 = SAMPLE_TEXTURE2D_ARRAY( _TextureArray1, sampler_TextureArray1, TransformedUV202,break204.w );
  346. float4 localWeightedBlend4177 = WeightedBlend4177( Weight177 , Layer1177 , Layer2177 , Layer3177 , Layer4177 );
  347. float2 NormalXY213 = (localWeightedBlend4177).yz;
  348. float Intensity213 = _NormalIntensity;
  349. float3 localRestoreNormal213 = RestoreNormal213( NormalXY213 , Intensity213 );
  350. float3 BakedAlbedo = 0;
  351. float3 BakedEmission = 0;
  352. float3 Color = (localRestoreNormal213*0.5 + 0.5);
  353. float Alpha = 1;
  354. float AlphaClipThreshold = 0.5;
  355. float AlphaClipThresholdShadow = 0.5;
  356. #ifdef _ALPHATEST_ON
  357. clip( Alpha - AlphaClipThreshold );
  358. #endif
  359. #ifdef LOD_FADE_CROSSFADE
  360. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  361. #endif
  362. #ifdef ASE_FOG
  363. Color = MixFog( Color, IN.fogFactor );
  364. #endif
  365. return half4( Color, Alpha );
  366. }
  367. ENDHLSL
  368. }
  369. Pass
  370. {
  371. Name "ShadowCaster"
  372. Tags { "LightMode"="ShadowCaster" }
  373. ZWrite On
  374. ZTest LEqual
  375. AlphaToMask Off
  376. ColorMask 0
  377. HLSLPROGRAM
  378. #pragma multi_compile_instancing
  379. #define ASE_SRP_VERSION 100500
  380. #pragma vertex vert
  381. #pragma fragment frag
  382. #if ASE_SRP_VERSION >= 110000
  383. #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW
  384. #endif
  385. #define SHADERPASS SHADERPASS_SHADOWCASTER
  386. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  387. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  388. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  389. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  390. #include "../MTECommonPBR.hlsl"
  391. struct VertexInput
  392. {
  393. float4 vertex : POSITION;
  394. float3 ase_normal : NORMAL;
  395. UNITY_VERTEX_INPUT_INSTANCE_ID
  396. };
  397. struct VertexOutput
  398. {
  399. float4 clipPos : SV_POSITION;
  400. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  401. float3 worldPos : TEXCOORD0;
  402. #endif
  403. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  404. float4 shadowCoord : TEXCOORD1;
  405. #endif
  406. UNITY_VERTEX_INPUT_INSTANCE_ID
  407. UNITY_VERTEX_OUTPUT_STEREO
  408. };
  409. CBUFFER_START(UnityPerMaterial)
  410. float4 _Control0_ST;
  411. float4 _Control1_ST;
  412. float4 _Control2_ST;
  413. float4 _UVScaleOffset;
  414. float _NormalIntensity;
  415. #ifdef TESSELLATION_ON
  416. float _TessPhongStrength;
  417. float _TessValue;
  418. float _TessMin;
  419. float _TessMax;
  420. float _TessEdgeLength;
  421. float _TessMaxDisp;
  422. #endif
  423. CBUFFER_END
  424. float3 _LightDirection;
  425. #if ASE_SRP_VERSION >= 110000
  426. float3 _LightPosition;
  427. #endif
  428. VertexOutput VertexFunction( VertexInput v )
  429. {
  430. VertexOutput o;
  431. UNITY_SETUP_INSTANCE_ID(v);
  432. UNITY_TRANSFER_INSTANCE_ID(v, o);
  433. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
  434. #ifdef ASE_ABSOLUTE_VERTEX_POS
  435. float3 defaultVertexValue = v.vertex.xyz;
  436. #else
  437. float3 defaultVertexValue = float3(0, 0, 0);
  438. #endif
  439. float3 vertexValue = defaultVertexValue;
  440. #ifdef ASE_ABSOLUTE_VERTEX_POS
  441. v.vertex.xyz = vertexValue;
  442. #else
  443. v.vertex.xyz += vertexValue;
  444. #endif
  445. v.ase_normal = v.ase_normal;
  446. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  447. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  448. o.worldPos = positionWS;
  449. #endif
  450. float3 normalWS = TransformObjectToWorldDir( v.ase_normal );
  451. #if ASE_SRP_VERSION >= 110000
  452. #if _CASTING_PUNCTUAL_LIGHT_SHADOW
  453. float3 lightDirectionWS = normalize(_LightPosition - positionWS);
  454. #else
  455. float3 lightDirectionWS = _LightDirection;
  456. #endif
  457. float4 clipPos = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS));
  458. #if UNITY_REVERSED_Z
  459. clipPos.z = min(clipPos.z, UNITY_NEAR_CLIP_VALUE);
  460. #else
  461. clipPos.z = max(clipPos.z, UNITY_NEAR_CLIP_VALUE);
  462. #endif
  463. #else
  464. float4 clipPos = TransformWorldToHClip( ApplyShadowBias( positionWS, normalWS, _LightDirection ) );
  465. #if UNITY_REVERSED_Z
  466. clipPos.z = min(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);
  467. #else
  468. clipPos.z = max(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);
  469. #endif
  470. #endif
  471. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  472. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  473. vertexInput.positionWS = positionWS;
  474. vertexInput.positionCS = clipPos;
  475. o.shadowCoord = GetShadowCoord( vertexInput );
  476. #endif
  477. o.clipPos = clipPos;
  478. return o;
  479. }
  480. #if defined(TESSELLATION_ON)
  481. struct VertexControl
  482. {
  483. float4 vertex : INTERNALTESSPOS;
  484. float3 ase_normal : NORMAL;
  485. UNITY_VERTEX_INPUT_INSTANCE_ID
  486. };
  487. struct TessellationFactors
  488. {
  489. float edge[3] : SV_TessFactor;
  490. float inside : SV_InsideTessFactor;
  491. };
  492. VertexControl vert ( VertexInput v )
  493. {
  494. VertexControl o;
  495. UNITY_SETUP_INSTANCE_ID(v);
  496. UNITY_TRANSFER_INSTANCE_ID(v, o);
  497. o.vertex = v.vertex;
  498. o.ase_normal = v.ase_normal;
  499. return o;
  500. }
  501. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  502. {
  503. TessellationFactors o;
  504. float4 tf = 1;
  505. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  506. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  507. #if defined(ASE_FIXED_TESSELLATION)
  508. tf = FixedTess( tessValue );
  509. #elif defined(ASE_DISTANCE_TESSELLATION)
  510. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  511. #elif defined(ASE_LENGTH_TESSELLATION)
  512. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  513. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  514. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  515. #endif
  516. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  517. return o;
  518. }
  519. [domain("tri")]
  520. [partitioning("fractional_odd")]
  521. [outputtopology("triangle_cw")]
  522. [patchconstantfunc("TessellationFunction")]
  523. [outputcontrolpoints(3)]
  524. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  525. {
  526. return patch[id];
  527. }
  528. [domain("tri")]
  529. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  530. {
  531. VertexInput o = (VertexInput) 0;
  532. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  533. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  534. #if defined(ASE_PHONG_TESSELLATION)
  535. float3 pp[3];
  536. for (int i = 0; i < 3; ++i)
  537. 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));
  538. float phongStrength = _TessPhongStrength;
  539. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  540. #endif
  541. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  542. return VertexFunction(o);
  543. }
  544. #else
  545. VertexOutput vert ( VertexInput v )
  546. {
  547. return VertexFunction( v );
  548. }
  549. #endif
  550. half4 frag(VertexOutput IN ) : SV_TARGET
  551. {
  552. UNITY_SETUP_INSTANCE_ID( IN );
  553. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  554. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  555. float3 WorldPosition = IN.worldPos;
  556. #endif
  557. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  558. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  559. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  560. ShadowCoords = IN.shadowCoord;
  561. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  562. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  563. #endif
  564. #endif
  565. float Alpha = 1;
  566. float AlphaClipThreshold = 0.5;
  567. float AlphaClipThresholdShadow = 0.5;
  568. #ifdef _ALPHATEST_ON
  569. #ifdef _ALPHATEST_SHADOW_ON
  570. clip(Alpha - AlphaClipThresholdShadow);
  571. #else
  572. clip(Alpha - AlphaClipThreshold);
  573. #endif
  574. #endif
  575. #ifdef LOD_FADE_CROSSFADE
  576. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  577. #endif
  578. return 0;
  579. }
  580. ENDHLSL
  581. }
  582. Pass
  583. {
  584. Name "DepthOnly"
  585. Tags { "LightMode"="DepthOnly" }
  586. ZWrite On
  587. ColorMask 0
  588. AlphaToMask Off
  589. HLSLPROGRAM
  590. #pragma multi_compile_instancing
  591. #define ASE_SRP_VERSION 100500
  592. #pragma vertex vert
  593. #pragma fragment frag
  594. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  595. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  596. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  597. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  598. #include "../MTECommonPBR.hlsl"
  599. struct VertexInput
  600. {
  601. float4 vertex : POSITION;
  602. float3 ase_normal : NORMAL;
  603. UNITY_VERTEX_INPUT_INSTANCE_ID
  604. };
  605. struct VertexOutput
  606. {
  607. float4 clipPos : SV_POSITION;
  608. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  609. float3 worldPos : TEXCOORD0;
  610. #endif
  611. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  612. float4 shadowCoord : TEXCOORD1;
  613. #endif
  614. UNITY_VERTEX_INPUT_INSTANCE_ID
  615. UNITY_VERTEX_OUTPUT_STEREO
  616. };
  617. CBUFFER_START(UnityPerMaterial)
  618. float4 _Control0_ST;
  619. float4 _Control1_ST;
  620. float4 _Control2_ST;
  621. float4 _UVScaleOffset;
  622. float _NormalIntensity;
  623. #ifdef TESSELLATION_ON
  624. float _TessPhongStrength;
  625. float _TessValue;
  626. float _TessMin;
  627. float _TessMax;
  628. float _TessEdgeLength;
  629. float _TessMaxDisp;
  630. #endif
  631. CBUFFER_END
  632. VertexOutput VertexFunction( VertexInput v )
  633. {
  634. VertexOutput o = (VertexOutput)0;
  635. UNITY_SETUP_INSTANCE_ID(v);
  636. UNITY_TRANSFER_INSTANCE_ID(v, o);
  637. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  638. #ifdef ASE_ABSOLUTE_VERTEX_POS
  639. float3 defaultVertexValue = v.vertex.xyz;
  640. #else
  641. float3 defaultVertexValue = float3(0, 0, 0);
  642. #endif
  643. float3 vertexValue = defaultVertexValue;
  644. #ifdef ASE_ABSOLUTE_VERTEX_POS
  645. v.vertex.xyz = vertexValue;
  646. #else
  647. v.vertex.xyz += vertexValue;
  648. #endif
  649. v.ase_normal = v.ase_normal;
  650. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  651. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  652. o.worldPos = positionWS;
  653. #endif
  654. o.clipPos = TransformWorldToHClip( positionWS );
  655. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  656. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  657. vertexInput.positionWS = positionWS;
  658. vertexInput.positionCS = o.clipPos;
  659. o.shadowCoord = GetShadowCoord( vertexInput );
  660. #endif
  661. return o;
  662. }
  663. #if defined(TESSELLATION_ON)
  664. struct VertexControl
  665. {
  666. float4 vertex : INTERNALTESSPOS;
  667. float3 ase_normal : NORMAL;
  668. UNITY_VERTEX_INPUT_INSTANCE_ID
  669. };
  670. struct TessellationFactors
  671. {
  672. float edge[3] : SV_TessFactor;
  673. float inside : SV_InsideTessFactor;
  674. };
  675. VertexControl vert ( VertexInput v )
  676. {
  677. VertexControl o;
  678. UNITY_SETUP_INSTANCE_ID(v);
  679. UNITY_TRANSFER_INSTANCE_ID(v, o);
  680. o.vertex = v.vertex;
  681. o.ase_normal = v.ase_normal;
  682. return o;
  683. }
  684. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  685. {
  686. TessellationFactors o;
  687. float4 tf = 1;
  688. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  689. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  690. #if defined(ASE_FIXED_TESSELLATION)
  691. tf = FixedTess( tessValue );
  692. #elif defined(ASE_DISTANCE_TESSELLATION)
  693. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  694. #elif defined(ASE_LENGTH_TESSELLATION)
  695. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  696. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  697. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  698. #endif
  699. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  700. return o;
  701. }
  702. [domain("tri")]
  703. [partitioning("fractional_odd")]
  704. [outputtopology("triangle_cw")]
  705. [patchconstantfunc("TessellationFunction")]
  706. [outputcontrolpoints(3)]
  707. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  708. {
  709. return patch[id];
  710. }
  711. [domain("tri")]
  712. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  713. {
  714. VertexInput o = (VertexInput) 0;
  715. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  716. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  717. #if defined(ASE_PHONG_TESSELLATION)
  718. float3 pp[3];
  719. for (int i = 0; i < 3; ++i)
  720. 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));
  721. float phongStrength = _TessPhongStrength;
  722. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  723. #endif
  724. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  725. return VertexFunction(o);
  726. }
  727. #else
  728. VertexOutput vert ( VertexInput v )
  729. {
  730. return VertexFunction( v );
  731. }
  732. #endif
  733. half4 frag(VertexOutput IN ) : SV_TARGET
  734. {
  735. UNITY_SETUP_INSTANCE_ID(IN);
  736. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  737. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  738. float3 WorldPosition = IN.worldPos;
  739. #endif
  740. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  741. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  742. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  743. ShadowCoords = IN.shadowCoord;
  744. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  745. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  746. #endif
  747. #endif
  748. float Alpha = 1;
  749. float AlphaClipThreshold = 0.5;
  750. #ifdef _ALPHATEST_ON
  751. clip(Alpha - AlphaClipThreshold);
  752. #endif
  753. #ifdef LOD_FADE_CROSSFADE
  754. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  755. #endif
  756. return 0;
  757. }
  758. ENDHLSL
  759. }
  760. }
  761. CustomEditor "UnityEditor.ShaderGraph.PBRMasterGUI"
  762. Fallback "Hidden/InternalErrorShader"
  763. }
  764. /*ASEBEGIN
  765. Version=18927
  766. 638;167;1920;952;2955.161;1508.097;2.840473;True;False
  767. Node;AmplifyShaderEditor.CommentaryNode;173;-1943.514,-860.3578;Inherit;False;1213.657;671.5775;;10;190;189;188;187;186;185;184;183;182;181;Fetch max 4 weighted layers;1,1,1,1;0;0
  768. Node;AmplifyShaderEditor.CommentaryNode;175;-608.5155,-506.4463;Inherit;False;863.0828;860.0196;;7;209;208;207;206;205;204;203;Sample normal from TextureArray2D;1,1,1,1;0;0
  769. Node;AmplifyShaderEditor.ComponentMaskNode;212;685.6709,-658.9031;Inherit;False;False;True;True;False;1;0;FLOAT4;0,0,0,0;False;1;FLOAT2;0
  770. Node;AmplifyShaderEditor.SamplerNode;188;-1389.644,-807.842;Inherit;True;Property;_TextureSample4;Texture Sample 4;1;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;black;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
  771. Node;AmplifyShaderEditor.TextureCoordinatesNode;201;-1123.537,-35.61517;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
  772. Node;AmplifyShaderEditor.SamplerNode;189;-1377.538,-418.7803;Inherit;True;Property;_TextureSample0;Texture Sample 0;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;black;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
  773. Node;AmplifyShaderEditor.DynamicAppendNode;199;-1267.537,-83.61517;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  774. Node;AmplifyShaderEditor.CustomExpressionNode;177;500.8009,-654.9878;Float;False;return Layer1 * Weight.r + Layer2 * Weight.g + Layer3 * Weight.b + Layer4 * Weight.a@;4;Create;5;True;Weight;FLOAT4;0,0,0,0;In;float[5];Half;False;True;Layer1;FLOAT4;0,0,0,0;In;;Float;False;True;Layer2;FLOAT4;0,0,0,0;In;;Float;False;True;Layer3;FLOAT4;0,0,0,0;In;;Float;False;True;Layer4;FLOAT4;0,0,0,0;In;;Float;False;Weighted Blend 4;True;False;0;;False;5;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;2;FLOAT4;0,0,0,0;False;3;FLOAT4;0,0,0,0;False;4;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  775. Node;AmplifyShaderEditor.TextureCoordinatesNode;184;-1637.012,-742.8207;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
  776. Node;AmplifyShaderEditor.TexturePropertyNode;183;-1891.212,-810.3578;Float;True;Property;_Control0;Control0;0;0;Create;True;0;0;0;False;0;False;None;6c994aeec150fba4c9cae3c391c29d76;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
  777. Node;AmplifyShaderEditor.SamplerNode;209;-64.51556,133.5537;Inherit;True;Property;_TextureSample6;Texture Sample 6;6;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2DArray;8;0;SAMPLER2DARRAY;;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
  778. Node;AmplifyShaderEditor.TexturePropertyNode;181;-1888.212,-421.5202;Float;True;Property;_Control2;Control2;2;0;Create;True;0;0;0;False;0;False;None;b65270a08b78d544b9a083f29cd6ef0d;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
  779. Node;AmplifyShaderEditor.TextureCoordinatesNode;186;-1637.011,-355.9831;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
  780. Node;AmplifyShaderEditor.TextureCoordinatesNode;185;-1642.314,-560.3595;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
  781. Node;AmplifyShaderEditor.Vector4Node;198;-1491.537,-51.61517;Inherit;False;Property;_UVScaleOffset;UVScaleOffset;4;0;Create;True;0;0;0;False;0;False;0,0,0,0;5,5,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  782. Node;AmplifyShaderEditor.TexturePropertyNode;182;-1893.514,-625.8966;Float;True;Property;_Control1;Control1;1;0;Create;True;0;0;0;False;0;False;None;82d54f2d5e16173409ed7b4cdc1f02dd;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
  783. Node;AmplifyShaderEditor.SamplerNode;187;-1382.84,-623.1567;Inherit;True;Property;_ControlEx;ControlEx;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;black;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
  784. Node;AmplifyShaderEditor.DynamicAppendNode;200;-1267.537,60.38482;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  785. Node;AmplifyShaderEditor.ScaleAndOffsetNode;210;1126.792,-652.61;Inherit;False;3;0;FLOAT3;0,0,0;False;1;FLOAT;0.5;False;2;FLOAT;0.5;False;1;FLOAT3;0
  786. Node;AmplifyShaderEditor.BreakToComponentsNode;204;-576.5155,-202.4463;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,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
  787. Node;AmplifyShaderEditor.CustomExpressionNode;190;-983.8571,-677.1078;Inherit;False;Max4WeightLayer(Control0, Control1, Control2, Weights, Indices)@;7;Create;5;True;Control0;FLOAT4;1,0,0,0;In;;Inherit;False;True;Control1;FLOAT4;0,0,0,0;In;;Inherit;False;True;Control2;FLOAT4;0,0,0,0;In;;Inherit;False;True;Weights;FLOAT4;1,0,0,0;Out;;Half;False;True;Indices;FLOAT4;1,0,0,0;Out;;Half;False;GetMax4WeightLayers;False;False;0;;False;6;0;FLOAT;0;False;1;FLOAT4;1,0,0,0;False;2;FLOAT4;0,0,0,0;False;3;FLOAT4;0,0,0,0;False;4;FLOAT4;1,0,0,0;False;5;FLOAT4;1,0,0,0;False;3;FLOAT;0;FLOAT4;5;FLOAT4;6
  788. Node;AmplifyShaderEditor.SamplerNode;207;-64.51556,-458.4463;Inherit;True;Property;_Layer0;Layer0;3;0;Fetch;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2DArray;8;0;SAMPLER2DARRAY;;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
  789. Node;AmplifyShaderEditor.SamplerNode;208;-64.51556,-58.44634;Inherit;True;Property;_TextureSample5;Texture Sample 5;5;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2DArray;8;0;SAMPLER2DARRAY;;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
  790. Node;AmplifyShaderEditor.RegisterLocalVarNode;202;-910.537,-40.61517;Inherit;False;TransformedUV;-1;True;1;0;FLOAT2;0,0;False;1;FLOAT2;0
  791. Node;AmplifyShaderEditor.GetLocalVarNode;205;-560.5155,-42.44634;Inherit;False;202;TransformedUV;1;0;OBJECT;;False;1;FLOAT2;0
  792. Node;AmplifyShaderEditor.SamplerNode;206;-64.51556,-266.4463;Inherit;True;Property;_TextureSample1;Texture Sample 1;4;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2DArray;8;0;SAMPLER2DARRAY;;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
  793. Node;AmplifyShaderEditor.TexturePropertyNode;203;-576.5155,-394.4463;Inherit;True;Property;_TextureArray1;TextureArray1;3;0;Create;True;0;0;0;False;0;False;None;69fbb55c066467242be2b47974c2fa82;False;white;LockedToTexture2DArray;Texture2DArray;-1;0;2;SAMPLER2DARRAY;0;SAMPLERSTATE;1
  794. Node;AmplifyShaderEditor.RangedFloatNode;214;643.017,-427.3291;Inherit;False;Property;_NormalIntensity;Normal Intensity;5;0;Create;True;0;0;0;False;0;False;1;1;0.01;10;0;1;FLOAT;0
  795. Node;AmplifyShaderEditor.CustomExpressionNode;213;913.1638,-654.0051;Inherit;False;RestoreNormal(NormalXY, Intensity);3;Create;2;True;NormalXY;FLOAT2;0,0;In;;Inherit;False;True;Intensity;FLOAT;1;In;;Inherit;False;RestoreNormal;True;False;0;;False;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT3;0
  796. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;166;560.5684,-218.442;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;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
  797. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;168;683.9721,-229.2669;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;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
  798. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;170;683.9721,-229.2669;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;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
  799. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;169;683.9721,-229.2669;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;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
  800. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;167;1325.133,-654.0233;Float;False;True;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;3;MTE/URP/TextureArray_DisplayNormal;2992e84f91cbeb14eab234972e07ea9d;True;Forward;0;1;Forward;8;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;False;False;False;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;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;LightMode=UniversalForward;False;False;2;Include;;False;;Native;Include;../MTECommonPBR.hlsl;False;fa510ed2a5a3b2d4a9ef902d0fbdd6e2;Custom;Hidden/InternalErrorShader;0;0;Standard;22;Surface;0; Blend;0;Two Sided;1;Cast Shadows;1; Use Shadow Threshold;0;Receive Shadows;1;GPU Instancing;1;LOD CrossFade;0;Built-in Fog;0;DOTS Instancing;0;Meta Pass;0;Extra Pre Pass;0;Tessellation;0; Phong;0; Strength;0.5,False,-1; Type;0; Tess;16,False,-1; Min;10,False,-1; Max;25,False,-1; Edge Length;16,False,-1; Max Displacement;25,False,-1;Vertex Position,InvertActionOnDeselection;1;0;5;False;True;True;True;False;False;;False;0
  801. WireConnection;212;0;177;0
  802. WireConnection;188;0;183;0
  803. WireConnection;188;1;184;0
  804. WireConnection;201;0;199;0
  805. WireConnection;201;1;200;0
  806. WireConnection;189;0;181;0
  807. WireConnection;189;1;186;0
  808. WireConnection;199;0;198;1
  809. WireConnection;199;1;198;2
  810. WireConnection;177;0;190;5
  811. WireConnection;177;1;207;0
  812. WireConnection;177;2;206;0
  813. WireConnection;177;3;208;0
  814. WireConnection;177;4;209;0
  815. WireConnection;184;2;183;0
  816. WireConnection;209;0;203;0
  817. WireConnection;209;1;205;0
  818. WireConnection;209;6;204;3
  819. WireConnection;186;2;181;0
  820. WireConnection;185;2;182;0
  821. WireConnection;187;0;182;0
  822. WireConnection;187;1;185;0
  823. WireConnection;200;0;198;3
  824. WireConnection;200;1;198;4
  825. WireConnection;210;0;213;0
  826. WireConnection;204;0;190;6
  827. WireConnection;190;1;188;0
  828. WireConnection;190;2;187;0
  829. WireConnection;190;3;189;0
  830. WireConnection;207;0;203;0
  831. WireConnection;207;1;205;0
  832. WireConnection;207;6;204;0
  833. WireConnection;208;0;203;0
  834. WireConnection;208;1;205;0
  835. WireConnection;208;6;204;2
  836. WireConnection;202;0;201;0
  837. WireConnection;206;0;203;0
  838. WireConnection;206;1;205;0
  839. WireConnection;206;6;204;1
  840. WireConnection;213;0;212;0
  841. WireConnection;213;1;214;0
  842. WireConnection;167;2;210;0
  843. ASEEND*/
  844. //CHKSM=363B03681C62FB39BC904B4C4EE195F6C0BFC9BA