Advertisement
Guest User

Untitled

a guest
Jun 25th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.91 KB | None | 0 0
  1. Shader /*ase_name*/ "Hidden/Universal/Simple Lit" /*end*/
  2. {
  3. Properties
  4. {
  5. /*ase_props*/
  6. }
  7.  
  8. SubShader
  9. {
  10. /*ase_subshader_options:Name=Additional Options
  11. Option:Surface:Opaque,Transparent:Opaque
  12. Opaque:SetPropertyOnSubShader:RenderType,Opaque
  13. Opaque:SetPropertyOnSubShader:RenderQueue,Geometry
  14. Opaque:SetPropertyOnPass:Forward:ZWrite,On
  15. Opaque:HideOption: Blend
  16. Transparent:SetPropertyOnSubShader:RenderType,Transparent
  17. Transparent:SetPropertyOnSubShader:RenderQueue,Transparent
  18. Transparent:SetPropertyOnPass:Forward:ZWrite,Off
  19. Transparent:ShowOption: Blend
  20. Option: Blend:Alpha,Premultiply,Additive,Multiply:Alpha
  21. Alpha:SetPropertyOnPass:Forward:BlendRGB,SrcAlpha,OneMinusSrcAlpha
  22. Premultiply:SetPropertyOnPass:Forward:BlendRGB,One,OneMinusSrcAlpha
  23. Additive:SetPropertyOnPass:Forward:BlendRGB,One,One
  24. Multiply:SetPropertyOnPass:Forward:BlendRGB,DstColor,Zero
  25. Alpha,Premultiply,Additive:SetPropertyOnPass:Forward:BlendAlpha,One,OneMinusSrcAlpha
  26. Multiply:SetPropertyOnPass:Forward:BlendAlpha,One,Zero
  27. Premultiply:SetDefine:_ALPHAPREMULTIPLY_ON 1
  28. Alpha,Additive,Multiply,disable:RemoveDefine:_ALPHAPREMULTIPLY_ON 1
  29. disable:SetPropertyOnPass:Forward:BlendRGB,One,Zero
  30. disable:SetPropertyOnPass:Forward:BlendAlpha,One,Zero
  31. Option:Two Sided:On,Cull Back,Cull Front:Cull Back
  32. On:SetPropertyOnSubShader:CullMode,Off
  33. Cull Back:SetPropertyOnSubShader:CullMode,Back
  34. Cull Front:SetPropertyOnSubShader:CullMode,Front
  35. Option:Specular:false,true:true
  36. true:SetDefine:_SPECULAR_COLOR 1
  37. false:RemoveDefine:_SPECULAR_COLOR 1
  38. Option:Cast Shadows:false,true:true
  39. true:IncludePass:ShadowCaster
  40. false,disable:ExcludePass:ShadowCaster
  41. Option:Receive Shadows:false,true:true
  42. true:RemoveDefine:_RECEIVE_SHADOWS_OFF 1
  43. false:SetDefine:_RECEIVE_SHADOWS_OFF 1
  44. Option:GPU Instancing:false,true:true
  45. true:SetDefine:pragma multi_compile_instancing
  46. false:RemoveDefine:pragma multi_compile_instancing
  47. Option:LOD CrossFade:false,true:true
  48. true:SetDefine:pragma multi_compile _ LOD_FADE_CROSSFADE
  49. false:RemoveDefine:pragma multi_compile _ LOD_FADE_CROSSFADE
  50. Option:Built-in Fog:false,true:true
  51. true:SetDefine:pragma multi_compile_fog
  52. false:RemoveDefine:pragma multi_compile_fog
  53. true:SetDefine:ASE_FOG 1
  54. false:RemoveDefine:ASE_FOG 1
  55. Option:Meta Pass:false,true:true
  56. true:IncludePass:Meta
  57. false,disable:ExcludePass:Meta
  58. Option:Vertex Position,InvertActionOnDeselection:Absolute,Relative:Relative
  59. Absolute:SetDefine:ASE_ABSOLUTE_VERTEX_POS 1
  60. Absolute:SetPortName:Forward:8,Vertex Position
  61. Relative:SetPortName:Forward:8,Vertex Offset
  62. Option:Alpha Clip:false,true:false
  63. false:RemoveDefine:_ALPHA_CLIP 1
  64. true:SetDefine:_ALPHA_CLIP 1
  65. */
  66. Tags
  67. {
  68. "RenderPipeline" = "UniversalPipeline"
  69. "RenderType"="Opaque"
  70. "Queue"="Geometry+0"
  71. }
  72.  
  73. Cull Back
  74. HLSLINCLUDE
  75. #pragma target 2.0
  76. ENDHLSL
  77.  
  78. /*ase_pass*/
  79. Pass
  80. {
  81. Name "Forward"
  82. Tags{"LightMode" = "UniversalForward"}
  83.  
  84. Blend One Zero
  85. ZWrite On
  86. ZTest LEqual
  87. Offset 0,0
  88. ColorMask RGBA
  89. /*ase_stencil*/
  90.  
  91. HLSLPROGRAM
  92. #pragma prefer_hlslcc gles
  93. #pragma exclude_renderers d3d11_9x
  94.  
  95. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
  96. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
  97. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  98. #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
  99. #pragma multi_compile _ _SHADOWS_SOFT
  100. #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
  101.  
  102. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  103. #pragma multi_compile _ LIGHTMAP_ON
  104.  
  105. #pragma vertex vert
  106. #pragma fragment frag
  107.  
  108.  
  109. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  110. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  111. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  112. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
  113. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  114.  
  115. /*ase_pragma*/
  116.  
  117. /*ase_globals*/
  118.  
  119. struct VertexInput
  120. {
  121. float4 vertex : POSITION;
  122. float3 ase_normal : NORMAL;
  123. float4 ase_tangent : TANGENT;
  124. float4 texcoord1 : TEXCOORD1;
  125. /*ase_vdata:p=p;n=n;t=t;uv1=tc1.xyzw*/
  126. UNITY_VERTEX_INPUT_INSTANCE_ID
  127. };
  128.  
  129. struct VertexOutput
  130. {
  131. float4 clipPos : SV_POSITION;
  132. DECLARE_LIGHTMAP_OR_SH( lightmapUV, vertexSH, 0 );
  133. half4 fogFactorAndVertexLight : TEXCOORD1;
  134. float4 shadowCoord : TEXCOORD2;
  135. float4 tSpace0 : TEXCOORD3;
  136. float4 tSpace1 : TEXCOORD4;
  137. float4 tSpace2 : TEXCOORD5;
  138. /*ase_interp(7,):sp=sp;wn.x=tc3.z;wn.y=tc4.z;wn.z=tc5.z;wt.x=tc3.x;wt.y=tc4.x;wt.z=tc5.x;wbt.x=tc3.y;wbt.y=tc4.y;wbt.z=tc5.y;wp.x=tc3.w;wp.y=tc4.w;wp.z=tc5.w*/
  139. UNITY_VERTEX_INPUT_INSTANCE_ID
  140. UNITY_VERTEX_OUTPUT_STEREO
  141. };
  142.  
  143. /*ase_funcs*/
  144.  
  145. VertexOutput vert ( VertexInput v /*ase_vert_input*/ )
  146. {
  147. VertexOutput o = (VertexOutput)0;
  148. UNITY_SETUP_INSTANCE_ID(v);
  149. UNITY_TRANSFER_INSTANCE_ID(v, o);
  150. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  151.  
  152. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  153. #ifdef ASE_ABSOLUTE_VERTEX_POS
  154. float3 defaultVertexValue = v.vertex.xyz;
  155. #else
  156. float3 defaultVertexValue = float3(0, 0, 0);
  157. #endif
  158. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;8;-1;_Vertex*/defaultVertexValue/*end*/;
  159. #ifdef ASE_ABSOLUTE_VERTEX_POS
  160. v.vertex.xyz = vertexValue;
  161. #else
  162. v.vertex.xyz += vertexValue;
  163. #endif
  164. v.ase_normal = /*ase_vert_out:Vertex Normal;Float3;10;-1;_Normal*/v.ase_normal/*end*/;
  165.  
  166. float3 lwWNormal = TransformObjectToWorldNormal(v.ase_normal);
  167. float3 lwWorldPos = TransformObjectToWorld(v.vertex.xyz);
  168. float3 lwWTangent = TransformObjectToWorldDir(v.ase_tangent.xyz);
  169. float3 lwWBinormal = normalize(cross(lwWNormal, lwWTangent) * v.ase_tangent.w);
  170. o.tSpace0 = float4(lwWTangent.x, lwWBinormal.x, lwWNormal.x, lwWorldPos.x);
  171. o.tSpace1 = float4(lwWTangent.y, lwWBinormal.y, lwWNormal.y, lwWorldPos.y);
  172. o.tSpace2 = float4(lwWTangent.z, lwWBinormal.z, lwWNormal.z, lwWorldPos.z);
  173.  
  174. VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz);
  175.  
  176. OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUV );
  177. OUTPUT_SH(lwWNormal, o.vertexSH );
  178.  
  179. half3 vertexLight = VertexLighting(vertexInput.positionWS, lwWNormal);
  180. #ifdef ASE_FOG
  181. half fogFactor = ComputeFogFactor( vertexInput.positionCS.z );
  182. #else
  183. half fogFactor = 0;
  184. #endif
  185. o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
  186. o.clipPos = vertexInput.positionCS;
  187.  
  188. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  189. o.shadowCoord = GetShadowCoord(vertexInput);
  190. #endif
  191.  
  192. return o;
  193. }
  194.  
  195. half4 frag ( VertexOutput IN /*ase_frag_input*/ ) : SV_Target
  196. {
  197. UNITY_SETUP_INSTANCE_ID(IN);
  198. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
  199.  
  200. /*ase_local_var:wn*/float3 WorldSpaceNormal = normalize(float3(IN.tSpace0.z,IN.tSpace1.z,IN.tSpace2.z));
  201. /*ase_local_var:wt*/float3 WorldSpaceTangent = float3(IN.tSpace0.x,IN.tSpace1.x,IN.tSpace2.x);
  202. /*ase_local_var:wbt*/float3 WorldSpaceBiTangent = float3(IN.tSpace0.y,IN.tSpace1.y,IN.tSpace2.y);
  203. /*ase_local_var:wp*/float3 WorldSpacePosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w);
  204. /*ase_local_var:wvd*/float3 WorldSpaceViewDirection = _WorldSpaceCameraPos.xyz - WorldSpacePosition;
  205.  
  206. #if SHADER_HINT_NICE_QUALITY
  207. WorldSpaceViewDirection = SafeNormalize( WorldSpaceViewDirection );
  208. #endif
  209.  
  210. /*ase_frag_code:IN=VertexOutput*/
  211. float3 Albedo = /*ase_frag_out:Albedo;Float3;0;-1;_Albedo*/float3(0.5, 0.5, 0.5)/*end*/;
  212. float3 Normal = /*ase_frag_out:Normal;Float3;1*/float3(0, 0, 1)/*end*/;
  213. float3 Emission = /*ase_frag_out:Emission;Float3;2;-1;_Emission*/0/*end*/;
  214. float4 SpecGloss = /*ase_frag_out:SpecGloss;Float4;3*/0/*end*/;
  215. float Smoothness = /*ase_frag_out:Smoothness;Float;4*/0.5/*end*/;
  216. float Alpha = /*ase_frag_out:Alpha;Float;5;-1;_Alpha*/1/*end*/;
  217. float AlphaClipThreshold = /*ase_frag_out:Alpha Clip Threshold;Float;6;-1;_AlphaClip*/0.5/*end*/;
  218. float Occlusion = /*ase_frag_out:Occlusion;Float*/1.0/*end*/;
  219.  
  220. InputData inputData = (InputData)0;
  221. inputData.positionWS = WorldSpacePosition;
  222.  
  223. #ifdef _NORMALMAP
  224. inputData.normalWS = normalize(TransformTangentToWorld(Normal, half3x3(WorldSpaceTangent, WorldSpaceBiTangent, WorldSpaceNormal)));
  225. #else
  226. #if !SHADER_HINT_NICE_QUALITY
  227. inputData.normalWS = WorldSpaceNormal;
  228. #else
  229. inputData.normalWS = normalize(WorldSpaceNormal);
  230. #endif
  231. #endif
  232.  
  233. inputData.viewDirectionWS = WorldSpaceViewDirection;
  234.  
  235. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  236. inputData.shadowCoord = IN.shadowCoord;
  237. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  238. inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
  239. #else
  240. inputData.shadowCoord = float4(0, 0, 0, 0);
  241. #endif
  242.  
  243.  
  244. #ifdef ASE_FOG
  245. inputData.fogCoord = IN.fogFactorAndVertexLight.x;
  246. #endif
  247.  
  248. inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw;
  249. inputData.bakedGI = SAMPLE_GI( IN.lightmapUV, IN.vertexSH, inputData.normalWS );
  250.  
  251. SurfaceData surface_data = (SurfaceData)0;
  252. surface_data.albedo = Albedo;
  253. surface_data.specular = SpecGloss.rgb;
  254. surface_data.smoothness = Smoothness;
  255. surface_data.normalTS = Normal;
  256. surface_data.emission = Emission;
  257. surface_data.alpha = Alpha;
  258. surface_data.occlusion = Occlusion;
  259.  
  260. half4 color = UniversalFragmentBlinnPhong(inputData, surface_data);
  261.  
  262. #ifdef ASE_FOG
  263. #ifdef TERRAIN_SPLAT_ADDPASS
  264. color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x );
  265. #else
  266. color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x);
  267. #endif
  268. #endif
  269.  
  270. #if _ALPHA_CLIP
  271. clip(Alpha - AlphaClipThreshold);
  272. #endif
  273.  
  274. #ifdef LOD_FADE_CROSSFADE
  275. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  276. #endif
  277.  
  278. return color;
  279. }
  280.  
  281. ENDHLSL
  282. }
  283.  
  284. /*ase_pass*/
  285. Pass
  286. {
  287. /*ase_hide_pass*/
  288. Name "ShadowCaster"
  289. Tags{"LightMode" = "ShadowCaster"}
  290.  
  291. ZWrite On
  292. ZTest LEqual
  293.  
  294. HLSLPROGRAM
  295. #pragma prefer_hlslcc gles
  296. #pragma exclude_renderers d3d11_9x
  297.  
  298. #pragma vertex ShadowPassVertex
  299. #pragma fragment ShadowPassFragment
  300.  
  301.  
  302. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  303. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  304. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  305. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  306.  
  307. /*ase_pragma*/
  308.  
  309. struct VertexInput
  310. {
  311. float4 vertex : POSITION;
  312. float3 ase_normal : NORMAL;
  313. /*ase_vdata:p=p;n=n*/
  314. UNITY_VERTEX_INPUT_INSTANCE_ID
  315. };
  316.  
  317. /*ase_globals*/
  318.  
  319. struct VertexOutput
  320. {
  321. float4 clipPos : SV_POSITION;
  322. /*ase_interp(7,):sp=sp*/
  323. UNITY_VERTEX_INPUT_INSTANCE_ID
  324. };
  325.  
  326. /*ase_funcs*/
  327.  
  328. float3 _LightDirection;
  329.  
  330. VertexOutput ShadowPassVertex( VertexInput v/*ase_vert_input*/ )
  331. {
  332. VertexOutput o;
  333. UNITY_SETUP_INSTANCE_ID(v);
  334. UNITY_TRANSFER_INSTANCE_ID(v, o);
  335.  
  336. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  337. #ifdef ASE_ABSOLUTE_VERTEX_POS
  338. float3 defaultVertexValue = v.vertex.xyz;
  339. #else
  340. float3 defaultVertexValue = float3(0, 0, 0);
  341. #endif
  342. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;2;-1;_Vertex*/defaultVertexValue/*end*/;
  343. #ifdef ASE_ABSOLUTE_VERTEX_POS
  344. v.vertex.xyz = vertexValue;
  345. #else
  346. v.vertex.xyz += vertexValue;
  347. #endif
  348.  
  349. v.ase_normal = /*ase_vert_out:Vertex Normal;Float3;3;-1;_Normal*/v.ase_normal/*end*/;
  350.  
  351. float3 positionWS = TransformObjectToWorld(v.vertex.xyz);
  352. float3 normalWS = TransformObjectToWorldDir(v.ase_normal);
  353.  
  354. float4 clipPos = TransformWorldToHClip( ApplyShadowBias( positionWS, normalWS, _LightDirection ) );
  355.  
  356. #if UNITY_REVERSED_Z
  357. clipPos.z = min(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);
  358. #else
  359. clipPos.z = max(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);
  360. #endif
  361. o.clipPos = clipPos;
  362.  
  363. return o;
  364. }
  365.  
  366. half4 ShadowPassFragment(VertexOutput IN /*ase_frag_input*/ ) : SV_TARGET
  367. {
  368. UNITY_SETUP_INSTANCE_ID( IN );
  369.  
  370. /*ase_frag_code:IN=VertexOutput*/
  371. float Alpha = /*ase_frag_out:Alpha;Float;0;-1;_Alpha*/1/*end*/;
  372. float AlphaClipThreshold = /*ase_frag_out:Alpha Clip Threshold;Float;1;-1;_AlphaClip*/0.5/*end*/;
  373.  
  374. #if _ALPHA_CLIP
  375. clip(Alpha - AlphaClipThreshold);
  376. #endif
  377.  
  378. #ifdef LOD_FADE_CROSSFADE
  379. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  380. #endif
  381. return 0;
  382. }
  383.  
  384. ENDHLSL
  385. }
  386.  
  387. /*ase_pass*/
  388. Pass
  389. {
  390. /*ase_hide_pass*/
  391. Name "DepthOnly"
  392. Tags{"LightMode" = "DepthOnly"}
  393.  
  394. ZWrite On
  395. ColorMask 0
  396.  
  397. HLSLPROGRAM
  398. #pragma prefer_hlslcc gles
  399. #pragma exclude_renderers d3d11_9x
  400.  
  401. #pragma vertex vert
  402. #pragma fragment frag
  403.  
  404.  
  405. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  406. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  407. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  408. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  409.  
  410. /*ase_pragma*/
  411.  
  412. /*ase_globals*/
  413.  
  414. struct VertexInput
  415. {
  416. float4 vertex : POSITION;
  417. float3 ase_normal : NORMAL;
  418. /*ase_vdata:p=p;n=n*/
  419. UNITY_VERTEX_INPUT_INSTANCE_ID
  420. };
  421.  
  422. struct VertexOutput
  423. {
  424. float4 clipPos : SV_POSITION;
  425. /*ase_interp(0,):sp=sp*/
  426. UNITY_VERTEX_INPUT_INSTANCE_ID
  427. UNITY_VERTEX_OUTPUT_STEREO
  428. };
  429.  
  430. /*ase_funcs*/
  431.  
  432. VertexOutput vert( VertexInput v /*ase_vert_input*/ )
  433. {
  434. VertexOutput o = (VertexOutput)0;
  435. UNITY_SETUP_INSTANCE_ID(v);
  436. UNITY_TRANSFER_INSTANCE_ID(v, o);
  437. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  438.  
  439. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  440. #ifdef ASE_ABSOLUTE_VERTEX_POS
  441. float3 defaultVertexValue = v.vertex.xyz;
  442. #else
  443. float3 defaultVertexValue = float3(0, 0, 0);
  444. #endif
  445. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;2;-1;_Vertex*/defaultVertexValue/*end*/;
  446. #ifdef ASE_ABSOLUTE_VERTEX_POS
  447. v.vertex.xyz = vertexValue;
  448. #else
  449. v.vertex.xyz += vertexValue;
  450. #endif
  451.  
  452. v.ase_normal = /*ase_vert_out:Vertex Normal;Float3;3;-1;_Normal*/v.ase_normal/*end*/;
  453.  
  454. o.clipPos = TransformObjectToHClip(v.vertex.xyz);
  455. return o;
  456. }
  457.  
  458. half4 frag(VertexOutput IN /*ase_frag_input*/ ) : SV_TARGET
  459. {
  460. UNITY_SETUP_INSTANCE_ID(IN);
  461. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  462.  
  463. /*ase_frag_code:IN=VertexOutput*/
  464. float Alpha = /*ase_frag_out:Alpha;Float;0;-1;_Alpha*/1/*end*/;
  465. float AlphaClipThreshold = /*ase_frag_out:Alpha Clip Threshold;Float;1;-1;_AlphaClip*/0.5/*end*/;
  466.  
  467. #if _ALPHA_CLIP
  468. clip(Alpha - AlphaClipThreshold);
  469. #endif
  470.  
  471. #ifdef LOD_FADE_CROSSFADE
  472. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  473. #endif
  474. return 0;
  475. }
  476. ENDHLSL
  477. }
  478.  
  479. /*ase_pass*/
  480. Pass
  481. {
  482. /*ase_hide_pass*/
  483. Name "Meta"
  484. Tags{"LightMode" = "Meta"}
  485.  
  486. Cull Off
  487.  
  488. HLSLPROGRAM
  489. #pragma prefer_hlslcc gles
  490. #pragma exclude_renderers d3d11_9x
  491.  
  492. #pragma vertex vert
  493. #pragma fragment frag
  494.  
  495.  
  496. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  497. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
  498. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  499. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  500.  
  501. /*ase_pragma*/
  502.  
  503. /*ase_globals*/
  504.  
  505. #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  506.  
  507. struct VertexInput
  508. {
  509. float4 vertex : POSITION;
  510. float3 ase_normal : NORMAL;
  511. float4 texcoord1 : TEXCOORD1;
  512. float4 texcoord2 : TEXCOORD2;
  513. /*ase_vdata:p=p;n=n;uv1=tc1;uv2=tc2*/
  514. UNITY_VERTEX_INPUT_INSTANCE_ID
  515. };
  516.  
  517. struct VertexOutput
  518. {
  519. float4 clipPos : SV_POSITION;
  520. /*ase_interp(0,):sp=sp;uv1=tc1*/
  521. UNITY_VERTEX_INPUT_INSTANCE_ID
  522. UNITY_VERTEX_OUTPUT_STEREO
  523. };
  524.  
  525. /*ase_funcs*/
  526.  
  527. VertexOutput vert( VertexInput v /*ase_vert_input*/ )
  528. {
  529. VertexOutput o = (VertexOutput)0;
  530. UNITY_SETUP_INSTANCE_ID(v);
  531. UNITY_TRANSFER_INSTANCE_ID(v, o);
  532. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  533.  
  534. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  535.  
  536. #ifdef ASE_ABSOLUTE_VERTEX_POS
  537. float3 defaultVertexValue = v.vertex.xyz;
  538. #else
  539. float3 defaultVertexValue = float3(0, 0, 0);
  540. #endif
  541. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;4;-1;_Vertex*/defaultVertexValue/*end*/;
  542. #ifdef ASE_ABSOLUTE_VERTEX_POS
  543. v.vertex.xyz = vertexValue;
  544. #else
  545. v.vertex.xyz += vertexValue;
  546. #endif
  547.  
  548. v.ase_normal = /*ase_vert_out:Vertex Normal;Float3;5;-1;_Normal*/v.ase_normal/*end*/;
  549.  
  550. o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST );
  551. return o;
  552. }
  553.  
  554. half4 frag(VertexOutput IN /*ase_frag_input*/ ) : SV_TARGET
  555. {
  556. UNITY_SETUP_INSTANCE_ID(IN);
  557. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  558.  
  559. /*ase_frag_code:IN=VertexOutput*/
  560.  
  561. float3 Albedo = /*ase_frag_out:Albedo;Float3;0;-1;_Albedo*/float3(0.5, 0.5, 0.5)/*end*/;
  562. float3 Emission = /*ase_frag_out:Emission;Float3;1;-1;_Emission*/0/*end*/;
  563. float Alpha = /*ase_frag_out:Alpha;Float;2;-1;_Alpha*/1/*end*/;
  564. float AlphaClipThreshold = /*ase_frag_out:Alpha Clip Threshold;Float;3;-1;_AlphaClip*/0.5/*end*/;
  565.  
  566. #if _ALPHA_CLIP
  567. clip(Alpha - AlphaClipThreshold);
  568. #endif
  569.  
  570. MetaInput metaInput = (MetaInput)0;
  571. metaInput.Albedo = Albedo;
  572. metaInput.Emission = Emission;
  573.  
  574. return MetaFragment(metaInput);
  575. }
  576. ENDHLSL
  577. }
  578.  
  579. /*ase_pass*/
  580. Pass
  581. {
  582. /*ase_hide_pass:SyncP*/
  583. Name "Universal2D"
  584. Tags{"LightMode" = "Universal2D"}
  585.  
  586. Blend One Zero
  587. ZWrite On
  588. ZTest LEqual
  589. Offset 0,0
  590. ColorMask RGBA
  591.  
  592. HLSLPROGRAM
  593. #pragma enable_d3d11_debug_symbols
  594. #pragma prefer_hlslcc gles
  595. #pragma exclude_renderers d3d11_9x
  596.  
  597. #pragma vertex vert
  598. #pragma fragment frag
  599.  
  600.  
  601. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  602. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  603. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  604. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
  605. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  606.  
  607. /*ase_pragma*/
  608.  
  609. /*ase_globals*/
  610.  
  611. #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  612.  
  613. struct VertexInput
  614. {
  615. float4 vertex : POSITION;
  616. float3 ase_normal : NORMAL;
  617. /*ase_vdata:p=p;n=n*/
  618. UNITY_VERTEX_INPUT_INSTANCE_ID
  619. };
  620.  
  621. struct VertexOutput
  622. {
  623. float4 clipPos : SV_POSITION;
  624. /*ase_interp(0,):sp=sp;uv1=tc1*/
  625. };
  626.  
  627. /*ase_funcs*/
  628.  
  629. VertexOutput vert( VertexInput v /*ase_vert_input*/ )
  630. {
  631. VertexOutput o = (VertexOutput)0;
  632.  
  633. /*ase_vert_code:v=VertexInput;o=VertexOutput*/
  634.  
  635. #ifdef ASE_ABSOLUTE_VERTEX_POS
  636. float3 defaultVertexValue = v.vertex.xyz;
  637. #else
  638. float3 defaultVertexValue = float3(0, 0, 0);
  639. #endif
  640. float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;3;-1;_Vertex*/defaultVertexValue/*end*/;
  641. #ifdef ASE_ABSOLUTE_VERTEX_POS
  642. v.vertex.xyz = vertexValue;
  643. #else
  644. v.vertex.xyz += vertexValue;
  645. #endif
  646.  
  647. v.ase_normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_Normal*/v.ase_normal/*end*/;
  648.  
  649. VertexPositionInputs vertexInput = GetVertexPositionInputs( v.vertex.xyz );
  650. o.clipPos = vertexInput.positionCS;
  651. return o;
  652. }
  653.  
  654. half4 frag(VertexOutput IN /*ase_frag_input*/ ) : SV_TARGET
  655. {
  656. /*ase_frag_code:IN=VertexOutput*/
  657.  
  658. float3 Albedo = /*ase_frag_out:Albedo;Float3;0;-1;_Albedo*/float3(0.5, 0.5, 0.5)/*end*/;
  659. float Alpha = /*ase_frag_out:Alpha;Float;1;-1;_Alpha*/1/*end*/;
  660. float AlphaClipThreshold = /*ase_frag_out:Alpha Clip Threshold;Float;2;-1;_AlphaClip*/0.5/*end*/;
  661.  
  662. half4 color = half4( Albedo, Alpha );
  663.  
  664. #if _ALPHA_CLIP
  665. clip(Alpha - AlphaClipThreshold);
  666. #endif
  667.  
  668. return color;
  669. }
  670. ENDHLSL
  671. }
  672. /*ase_pass_end*/
  673. }
  674. CustomEditor "UnityEditor.ShaderGraph.PBRMasterGUI"
  675. FallBack "Hidden/InternalErrorShader"
  676. }
  677.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement