2DUnlit.shader 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. Shader /*ase_name*/ "Hidden/Universal/2D Unlit" /*end*/
  2. {
  3. Properties
  4. {
  5. /*ase_props*/
  6. [HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
  7. [HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
  8. [HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
  9. }
  10. SubShader
  11. {
  12. /*ase_subshader_options:Name=Additional Options
  13. Option:Vertex Position:Absolute,Relative:Relative
  14. Absolute:SetDefine:ASE_ABSOLUTE_VERTEX_POS 1
  15. Absolute:SetPortName:Sprite Unlit:3,Vertex Position
  16. Relative:RemoveDefine:ASE_ABSOLUTE_VERTEX_POS 1
  17. Relative:SetPortName:Sprite Unlit:3,Vertex Offset
  18. Option:Debug Display:false,true:false
  19. true:SetDefine:pragma multi_compile _ DEBUG_DISPLAY
  20. false,disable:RemoveDefine:pragma multi_compile _ DEBUG_DISPLAY
  21. Option:External Alpha:false,true:false
  22. true:SetDefine:pragma multi_compile _ ETC1_EXTERNAL_ALPHA
  23. false,disable:RemoveDefine:pragma multi_compile _ ETC1_EXTERNAL_ALPHA
  24. */
  25. Tags
  26. {
  27. "RenderPipeline" = "UniversalPipeline"
  28. "RenderType" = "Transparent"
  29. "Queue" = "Transparent+0"
  30. }
  31. Cull Off
  32. HLSLINCLUDE
  33. #pragma target 2.0
  34. #pragma prefer_hlslcc gles
  35. #pragma exclude_renderers d3d9 // ensure rendering platforms toggle list is visible
  36. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  37. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl"
  38. ENDHLSL
  39. /*ase_pass*/
  40. Pass
  41. {
  42. Name "Sprite Unlit"
  43. Tags
  44. {
  45. "LightMode" = "Universal2D"
  46. }
  47. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  48. ZTest LEqual
  49. ZWrite Off
  50. Offset 0,0
  51. ColorMask RGBA
  52. /*ase_stencil*/
  53. HLSLPROGRAM
  54. #pragma vertex vert
  55. #pragma fragment frag
  56. #define _SURFACE_TYPE_TRANSPARENT 1
  57. #define ATTRIBUTES_NEED_NORMAL
  58. #define ATTRIBUTES_NEED_TANGENT
  59. #define ATTRIBUTES_NEED_TEXCOORD0
  60. #define ATTRIBUTES_NEED_COLOR
  61. #define VARYINGS_NEED_POSITION_WS
  62. #define VARYINGS_NEED_TEXCOORD0
  63. #define VARYINGS_NEED_COLOR
  64. #define FEATURES_GRAPH_VERTEX
  65. #define SHADERPASS SHADERPASS_SPRITEUNLIT
  66. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  67. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  68. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  69. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  70. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  71. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  72. /*ase_unity_cond_begin:>=20220316*/
  73. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  74. /*ase_unity_cond_end*/
  75. /*ase_unity_cond_begin:>=20220316*/
  76. #if ASE_SRP_VERSION >=140009
  77. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  78. #endif
  79. /*ase_unity_cond_end*/
  80. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  81. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  82. #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
  83. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
  84. /*ase_pragma*/
  85. /*ase_globals*/
  86. struct VertexInput
  87. {
  88. float4 positionOS : POSITION;
  89. float3 normal : NORMAL;
  90. float4 tangent : TANGENT;
  91. float4 uv0 : TEXCOORD0;
  92. float4 color : COLOR;
  93. /*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
  94. UNITY_VERTEX_INPUT_INSTANCE_ID
  95. };
  96. struct VertexOutput
  97. {
  98. float4 positionCS : SV_POSITION;
  99. float4 texCoord0 : TEXCOORD0;
  100. float4 color : TEXCOORD1;
  101. float3 positionWS : TEXCOORD2;
  102. /*ase_interp(3,):sp=sp;uv0=tc0;c=tc1*/
  103. UNITY_VERTEX_INPUT_INSTANCE_ID
  104. UNITY_VERTEX_OUTPUT_STEREO
  105. };
  106. #if ETC1_EXTERNAL_ALPHA
  107. TEXTURE2D(_AlphaTex); SAMPLER(sampler_AlphaTex);
  108. float _EnableAlphaTexture;
  109. #endif
  110. float4 _RendererColor;
  111. /*ase_funcs*/
  112. VertexOutput vert( VertexInput v /*ase_vert_input*/ )
  113. {
  114. VertexOutput o = (VertexOutput)0;
  115. UNITY_SETUP_INSTANCE_ID(v);
  116. UNITY_TRANSFER_INSTANCE_ID(v, o);
  117. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  118. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  119. #ifdef ASE_ABSOLUTE_VERTEX_POS
  120. float3 defaultVertexValue = v.positionOS.xyz;
  121. #else
  122. float3 defaultVertexValue = float3(0, 0, 0);
  123. #endif
  124. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;3;-1;_Vertex*/defaultVertexValue/*end*/;
  125. #ifdef ASE_ABSOLUTE_VERTEX_POS
  126. v.positionOS.xyz = vertexValue;
  127. #else
  128. v.positionOS.xyz += vertexValue;
  129. #endif
  130. v.normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_VNormal*/v.normal/*end*/;
  131. v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;5;-1;_VTangent*/v.tangent.xyz/*end*/;
  132. VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
  133. o.positionCS = vertexInput.positionCS;
  134. o.positionWS = vertexInput.positionWS;
  135. o.texCoord0 = v.uv0;
  136. o.color = v.color;
  137. return o;
  138. }
  139. half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_Target
  140. {
  141. UNITY_SETUP_INSTANCE_ID(IN);
  142. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
  143. /*ase_frag_code:IN=VertexOutput*/
  144. float4 Color = /*ase_frag_out:Color;Float4;1;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
  145. #if ETC1_EXTERNAL_ALPHA
  146. float4 alpha = SAMPLE_TEXTURE2D(_AlphaTex, sampler_AlphaTex, IN.texCoord0.xy);
  147. Color.a = lerp( Color.a, alpha.r, _EnableAlphaTexture);
  148. #endif
  149. #if defined(DEBUG_DISPLAY)
  150. SurfaceData2D surfaceData;
  151. InitializeSurfaceData(Color.rgb, Color.a, surfaceData);
  152. InputData2D inputData;
  153. InitializeInputData(IN.positionWS.xy, half2(IN.texCoord0.xy), inputData);
  154. half4 debugColor = 0;
  155. SETUP_DEBUG_DATA_2D(inputData, IN.positionWS);
  156. if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
  157. {
  158. return debugColor;
  159. }
  160. #endif
  161. Color *= IN.color * _RendererColor;
  162. return Color;
  163. }
  164. ENDHLSL
  165. }
  166. /*ase_pass*/
  167. Pass
  168. {
  169. /*ase_hide_pass:SyncP*/
  170. Name "Sprite Unlit Forward"
  171. Tags
  172. {
  173. "LightMode" = "UniversalForward"
  174. }
  175. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  176. ZTest LEqual
  177. ZWrite Off
  178. Offset 0,0
  179. ColorMask RGBA
  180. /*ase_stencil*/
  181. HLSLPROGRAM
  182. #pragma vertex vert
  183. #pragma fragment frag
  184. #define _SURFACE_TYPE_TRANSPARENT 1
  185. #define ATTRIBUTES_NEED_NORMAL
  186. #define ATTRIBUTES_NEED_TANGENT
  187. #define ATTRIBUTES_NEED_TEXCOORD0
  188. #define ATTRIBUTES_NEED_COLOR
  189. #define VARYINGS_NEED_POSITION_WS
  190. #define VARYINGS_NEED_TEXCOORD0
  191. #define VARYINGS_NEED_COLOR
  192. #define FEATURES_GRAPH_VERTEX
  193. #define SHADERPASS SHADERPASS_SPRITEFORWARD
  194. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  195. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  196. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  197. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  198. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  199. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  200. /*ase_unity_cond_begin:>=20220316*/
  201. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  202. /*ase_unity_cond_end*/
  203. /*ase_unity_cond_begin:>=20220316*/
  204. #if ASE_SRP_VERSION >=140009
  205. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  206. #endif
  207. /*ase_unity_cond_end*/
  208. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  209. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  210. #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
  211. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
  212. /*ase_pragma*/
  213. /*ase_globals*/
  214. struct VertexInput
  215. {
  216. float4 positionOS : POSITION;
  217. float3 normal : NORMAL;
  218. float4 tangent : TANGENT;
  219. float4 uv0 : TEXCOORD0;
  220. float4 color : COLOR;
  221. /*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
  222. UNITY_VERTEX_INPUT_INSTANCE_ID
  223. };
  224. struct VertexOutput
  225. {
  226. float4 positionCS : SV_POSITION;
  227. float4 texCoord0 : TEXCOORD0;
  228. float4 color : TEXCOORD1;
  229. float3 positionWS : TEXCOORD2;
  230. /*ase_interp(3,):sp=sp;uv0=tc0;c=tc1*/
  231. UNITY_VERTEX_INPUT_INSTANCE_ID
  232. UNITY_VERTEX_OUTPUT_STEREO
  233. };
  234. #if ETC1_EXTERNAL_ALPHA
  235. TEXTURE2D( _AlphaTex ); SAMPLER( sampler_AlphaTex );
  236. float _EnableAlphaTexture;
  237. #endif
  238. float4 _RendererColor;
  239. /*ase_funcs*/
  240. VertexOutput vert( VertexInput v /*ase_vert_input*/ )
  241. {
  242. VertexOutput o = (VertexOutput)0;
  243. UNITY_SETUP_INSTANCE_ID(v);
  244. UNITY_TRANSFER_INSTANCE_ID(v, o);
  245. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  246. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  247. #ifdef ASE_ABSOLUTE_VERTEX_POS
  248. float3 defaultVertexValue = v.positionOS.xyz;
  249. #else
  250. float3 defaultVertexValue = float3( 0, 0, 0 );
  251. #endif
  252. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;3;-1;_Vertex*/defaultVertexValue/*end*/;
  253. #ifdef ASE_ABSOLUTE_VERTEX_POS
  254. v.positionOS.xyz = vertexValue;
  255. #else
  256. v.positionOS.xyz += vertexValue;
  257. #endif
  258. v.normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_VNormal*/v.normal/*end*/;
  259. v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;5;-1;_VTangent*/v.tangent.xyz/*end*/;
  260. VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
  261. o.positionCS = vertexInput.positionCS;
  262. o.positionWS = vertexInput.positionWS;
  263. o.texCoord0 = v.uv0;
  264. o.color = v.color;
  265. return o;
  266. }
  267. half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_Target
  268. {
  269. UNITY_SETUP_INSTANCE_ID(IN);
  270. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
  271. /*ase_frag_code:IN=VertexOutput*/
  272. float4 Color = /*ase_frag_out:Color;Float4;1;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
  273. #if ETC1_EXTERNAL_ALPHA
  274. float4 alpha = SAMPLE_TEXTURE2D( _AlphaTex, sampler_AlphaTex, IN.texCoord0.xy );
  275. Color.a = lerp( Color.a, alpha.r, _EnableAlphaTexture );
  276. #endif
  277. #if defined(DEBUG_DISPLAY)
  278. SurfaceData2D surfaceData;
  279. InitializeSurfaceData(Color.rgb, Color.a, surfaceData);
  280. InputData2D inputData;
  281. InitializeInputData(IN.positionWS.xy, half2(IN.texCoord0.xy), inputData);
  282. half4 debugColor = 0;
  283. SETUP_DEBUG_DATA_2D(inputData, IN.positionWS);
  284. if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
  285. {
  286. return debugColor;
  287. }
  288. #endif
  289. Color *= IN.color * _RendererColor;
  290. return Color;
  291. }
  292. ENDHLSL
  293. }
  294. /*ase_pass*/
  295. Pass
  296. {
  297. /*ase_hide_pass*/
  298. Name "SceneSelectionPass"
  299. Tags
  300. {
  301. "LightMode" = "SceneSelectionPass"
  302. }
  303. Cull Off
  304. HLSLPROGRAM
  305. #pragma vertex vert
  306. #pragma fragment frag
  307. #define _SURFACE_TYPE_TRANSPARENT 1
  308. #define ATTRIBUTES_NEED_NORMAL
  309. #define ATTRIBUTES_NEED_TANGENT
  310. #define FEATURES_GRAPH_VERTEX
  311. #define SHADERPASS SHADERPASS_DEPTHONLY
  312. #define SCENESELECTIONPASS 1
  313. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  314. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  315. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  316. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  317. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  318. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  319. /*ase_unity_cond_begin:>=20220316*/
  320. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  321. /*ase_unity_cond_end*/
  322. /*ase_unity_cond_begin:>=20220316*/
  323. #if ASE_SRP_VERSION >=140009
  324. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  325. #endif
  326. /*ase_unity_cond_end*/
  327. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  328. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  329. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  330. /*ase_pragma*/
  331. /*ase_globals*/
  332. struct VertexInput
  333. {
  334. float3 positionOS : POSITION;
  335. float3 normal : NORMAL;
  336. float4 tangent : TANGENT;
  337. /*ase_vdata:p=p;n=n;t=t*/
  338. UNITY_VERTEX_INPUT_INSTANCE_ID
  339. };
  340. struct VertexOutput
  341. {
  342. float4 positionCS : SV_POSITION;
  343. /*ase_interp(0,):sp=sp*/
  344. UNITY_VERTEX_INPUT_INSTANCE_ID
  345. };
  346. int _ObjectId;
  347. int _PassValue;
  348. /*ase_funcs*/
  349. VertexOutput vert(VertexInput v /*ase_vert_input*/)
  350. {
  351. VertexOutput o = (VertexOutput)0;
  352. UNITY_SETUP_INSTANCE_ID(v);
  353. UNITY_TRANSFER_INSTANCE_ID(v, o);
  354. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  355. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  356. #ifdef ASE_ABSOLUTE_VERTEX_POS
  357. float3 defaultVertexValue = v.positionOS.xyz;
  358. #else
  359. float3 defaultVertexValue = float3(0, 0, 0);
  360. #endif
  361. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;1;-1;_Vertex*/defaultVertexValue/*end*/;
  362. #ifdef ASE_ABSOLUTE_VERTEX_POS
  363. v.positionOS.xyz = vertexValue;
  364. #else
  365. v.positionOS.xyz += vertexValue;
  366. #endif
  367. VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
  368. float3 positionWS = TransformObjectToWorld(v.positionOS);
  369. o.positionCS = TransformWorldToHClip(positionWS);
  370. return o;
  371. }
  372. half4 frag(VertexOutput IN/*ase_frag_input*/) : SV_TARGET
  373. {
  374. /*ase_frag_code:IN=VertexOutput*/
  375. float4 Color = /*ase_frag_out:Color;Float4;0;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
  376. half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
  377. return outColor;
  378. }
  379. ENDHLSL
  380. }
  381. /*ase_pass*/
  382. Pass
  383. {
  384. /*ase_hide_pass*/
  385. Name "ScenePickingPass"
  386. Tags
  387. {
  388. "LightMode" = "Picking"
  389. }
  390. Cull Off
  391. HLSLPROGRAM
  392. #pragma vertex vert
  393. #pragma fragment frag
  394. #define _SURFACE_TYPE_TRANSPARENT 1
  395. #define ATTRIBUTES_NEED_NORMAL
  396. #define ATTRIBUTES_NEED_TANGENT
  397. #define FEATURES_GRAPH_VERTEX
  398. #define SHADERPASS SHADERPASS_DEPTHONLY
  399. #define SCENEPICKINGPASS 1
  400. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  401. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  402. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  403. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  404. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  405. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  406. /*ase_unity_cond_begin:>=20220316*/
  407. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  408. /*ase_unity_cond_end*/
  409. /*ase_unity_cond_begin:>=20220316*/
  410. #if ASE_SRP_VERSION >=140009
  411. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  412. #endif
  413. /*ase_unity_cond_end*/
  414. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  415. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  416. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  417. /*ase_pragma*/
  418. /*ase_globals*/
  419. struct VertexInput
  420. {
  421. float3 positionOS : POSITION;
  422. float3 normal : NORMAL;
  423. float4 tangent : TANGENT;
  424. /*ase_vdata:p=p;n=n;t=t*/
  425. UNITY_VERTEX_INPUT_INSTANCE_ID
  426. };
  427. struct VertexOutput
  428. {
  429. float4 positionCS : SV_POSITION;
  430. /*ase_interp(0,):sp=sp*/
  431. UNITY_VERTEX_INPUT_INSTANCE_ID
  432. };
  433. float4 _SelectionID;
  434. /*ase_funcs*/
  435. VertexOutput vert(VertexInput v /*ase_vert_input*/ )
  436. {
  437. VertexOutput o = (VertexOutput)0;
  438. UNITY_SETUP_INSTANCE_ID(v);
  439. UNITY_TRANSFER_INSTANCE_ID(v, o);
  440. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  441. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  442. #ifdef ASE_ABSOLUTE_VERTEX_POS
  443. float3 defaultVertexValue = v.positionOS.xyz;
  444. #else
  445. float3 defaultVertexValue = float3(0, 0, 0);
  446. #endif
  447. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;1;-1;_Vertex*/defaultVertexValue/*end*/;
  448. #ifdef ASE_ABSOLUTE_VERTEX_POS
  449. v.positionOS.xyz = vertexValue;
  450. #else
  451. v.positionOS.xyz += vertexValue;
  452. #endif
  453. VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
  454. float3 positionWS = TransformObjectToWorld(v.positionOS);
  455. o.positionCS = TransformWorldToHClip(positionWS);
  456. return o;
  457. }
  458. half4 frag(VertexOutput IN /*ase_frag_input*/) : SV_TARGET
  459. {
  460. /*ase_frag_code:IN=VertexOutput*/
  461. float4 Color = /*ase_frag_out:Color;Float4;0;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
  462. half4 outColor = _SelectionID;
  463. return outColor;
  464. }
  465. ENDHLSL
  466. }
  467. /*ase_pass_end*/
  468. }
  469. CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
  470. FallBack "Hidden/Shader Graph/FallbackError"
  471. }