ParticlesUnlit.shader 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. Shader "Universal Render Pipeline/Particles/Unlit"
  2. {
  3. Properties
  4. {
  5. _BaseMap("Base Map", 2D) = "white" {}
  6. _BaseColor("Base Color", Color) = (1,1,1,1)
  7. _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
  8. _BumpMap("Normal Map", 2D) = "bump" {}
  9. _EmissionColor("Color", Color) = (0,0,0)
  10. _EmissionMap("Emission", 2D) = "white" {}
  11. // -------------------------------------
  12. // Particle specific
  13. _SoftParticlesNearFadeDistance("Soft Particles Near Fade", Float) = 0.0
  14. _SoftParticlesFarFadeDistance("Soft Particles Far Fade", Float) = 1.0
  15. _CameraNearFadeDistance("Camera Near Fade", Float) = 1.0
  16. _CameraFarFadeDistance("Camera Far Fade", Float) = 2.0
  17. _DistortionBlend("Distortion Blend", Float) = 0.5
  18. _DistortionStrength("Distortion Strength", Float) = 1.0
  19. // -------------------------------------
  20. // Hidden properties - Generic
  21. [HideInInspector] _Surface("__surface", Float) = 0.0
  22. [HideInInspector] _Blend("__mode", Float) = 0.0
  23. [HideInInspector] _AlphaClip("__clip", Float) = 0.0
  24. [HideInInspector] _BlendOp("__blendop", Float) = 0.0
  25. [HideInInspector] _SrcBlend("__src", Float) = 1.0
  26. [HideInInspector] _DstBlend("__dst", Float) = 0.0
  27. [HideInInspector] _ZWrite("__zw", Float) = 1.0
  28. [HideInInspector] _Cull("__cull", Float) = 2.0
  29. // Particle specific
  30. [HideInInspector] _ColorMode("_ColorMode", Float) = 0.0
  31. [HideInInspector] _BaseColorAddSubDiff("_ColorMode", Vector) = (0,0,0,0)
  32. [ToggleOff] _FlipbookBlending("__flipbookblending", Float) = 0.0
  33. [HideInInspector] _SoftParticlesEnabled("__softparticlesenabled", Float) = 0.0
  34. [HideInInspector] _CameraFadingEnabled("__camerafadingenabled", Float) = 0.0
  35. [HideInInspector] _SoftParticleFadeParams("__softparticlefadeparams", Vector) = (0,0,0,0)
  36. [HideInInspector] _CameraFadeParams("__camerafadeparams", Vector) = (0,0,0,0)
  37. [HideInInspector] _DistortionEnabled("__distortionenabled", Float) = 0.0
  38. [HideInInspector] _DistortionStrengthScaled("Distortion Strength Scaled", Float) = 0.1
  39. // Editmode props
  40. [HideInInspector] _QueueOffset("Queue offset", Float) = 0.0
  41. // ObsoleteProperties
  42. [HideInInspector] _FlipbookMode("flipbook", Float) = 0
  43. [HideInInspector] _Mode("mode", Float) = 0
  44. [HideInInspector] _Color("color", Color) = (1,1,1,1)
  45. }
  46. SubShader
  47. {
  48. Tags{"RenderType" = "Opaque" "IgnoreProjector" = "True" "PreviewType" = "Plane" "PerformanceChecks" = "False" "RenderPipeline" = "UniversalPipeline"}
  49. // ------------------------------------------------------------------
  50. // Forward pass.
  51. Pass
  52. {
  53. // Lightmode matches the ShaderPassName set in UniversalRenderPipeline.cs. SRPDefaultUnlit and passes with
  54. // no LightMode tag are also rendered by Universal Render Pipeline
  55. Name "ForwardLit"
  56. BlendOp[_BlendOp]
  57. Blend[_SrcBlend][_DstBlend]
  58. ZWrite[_ZWrite]
  59. Cull[_Cull]
  60. ColorMask RGB
  61. HLSLPROGRAM
  62. // Required to compile gles 2.0 with standard SRP library
  63. // All shaders must be compiled with HLSLcc and currently only gles is not using HLSLcc by default
  64. #pragma prefer_hlslcc gles
  65. #pragma exclude_renderers d3d11_9x
  66. #pragma target 2.0
  67. // -------------------------------------
  68. // Material Keywords
  69. #pragma shader_feature _NORMALMAP
  70. #pragma shader_feature _EMISSION
  71. // -------------------------------------
  72. // Particle Keywords
  73. #pragma shader_feature _ _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
  74. #pragma shader_feature _ALPHATEST_ON
  75. #pragma shader_feature _ _COLOROVERLAY_ON _COLORCOLOR_ON _COLORADDSUBDIFF_ON
  76. #pragma shader_feature _FLIPBOOKBLENDING_ON
  77. #pragma shader_feature _SOFTPARTICLES_ON
  78. #pragma shader_feature _FADING_ON
  79. #pragma shader_feature _DISTORTION_ON
  80. // -------------------------------------
  81. // Unity defined keywords
  82. #pragma multi_compile_fog
  83. #pragma vertex vertParticleUnlit
  84. #pragma fragment fragParticleUnlit
  85. #include "Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitInput.hlsl"
  86. #include "Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitForwardPass.hlsl"
  87. ENDHLSL
  88. }
  89. }
  90. CustomEditor "UnityEditor.Rendering.Universal.ShaderGUI.ParticlesUnlitShader"
  91. }