Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LensFlareDataDriven.shader 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. Shader "Hidden/Universal Render Pipeline/LensFlareDataDriven"
  2. {
  3. SubShader
  4. {
  5. Tags{ "RenderPipeline" = "UniversalPipeline" }
  6. // Additive
  7. Pass
  8. {
  9. Name "LensFlareAdditive"
  10. Tags { "Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
  11. LOD 100
  12. Blend One One
  13. ZWrite Off
  14. Cull Off
  15. ZTest Always
  16. HLSLPROGRAM
  17. #pragma target 3.0
  18. #pragma vertex vert
  19. #pragma fragment frag
  20. #pragma multi_compile_fragment _ FLARE_INVERSE_SDF
  21. #pragma multi_compile_vertex _ FLARE_OPENGL3_OR_OPENGLCORE
  22. #pragma multi_compile _ FLARE_HAS_OCCLUSION
  23. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  24. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  25. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
  26. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
  27. #include "Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Common.hlsl"
  28. #define FLARE_ADDITIVE_BLEND
  29. #include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
  30. ENDHLSL
  31. }
  32. // Screen
  33. Pass
  34. {
  35. Name "LensFlareScreen"
  36. Tags { "Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
  37. LOD 100
  38. Blend One OneMinusSrcColor
  39. BlendOp Max
  40. ZWrite Off
  41. Cull Off
  42. ZTest Always
  43. HLSLPROGRAM
  44. #pragma target 3.0
  45. #pragma vertex vert
  46. #pragma fragment frag
  47. #pragma multi_compile_fragment _ FLARE_INVERSE_SDF
  48. #pragma multi_compile_vertex _ FLARE_OPENGL3_OR_OPENGLCORE
  49. #pragma multi_compile _ FLARE_HAS_OCCLUSION
  50. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  51. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  52. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
  53. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
  54. #include "Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Common.hlsl"
  55. #define FLARE_SCREEN_BLEND
  56. #include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
  57. ENDHLSL
  58. }
  59. // Premultiply
  60. Pass
  61. {
  62. Name "LensFlarePremultiply"
  63. Tags { "Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
  64. LOD 100
  65. Blend One OneMinusSrcAlpha
  66. ColorMask RGB
  67. ZWrite Off
  68. Cull Off
  69. ZTest Always
  70. HLSLPROGRAM
  71. #pragma target 3.0
  72. #pragma vertex vert
  73. #pragma fragment frag
  74. #pragma multi_compile_fragment _ FLARE_INVERSE_SDF
  75. #pragma multi_compile_vertex _ FLARE_OPENGL3_OR_OPENGLCORE
  76. #pragma multi_compile _ FLARE_HAS_OCCLUSION
  77. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  78. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  79. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
  80. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
  81. #include "Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Common.hlsl"
  82. #define FLARE_PREMULTIPLIED_BLEND
  83. #include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
  84. ENDHLSL
  85. }
  86. // Lerp
  87. Pass
  88. {
  89. Name "LensFlareLerp"
  90. Tags { "Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
  91. LOD 100
  92. Blend SrcAlpha OneMinusSrcAlpha
  93. ColorMask RGB
  94. ZWrite Off
  95. Cull Off
  96. ZTest Always
  97. HLSLPROGRAM
  98. #pragma target 3.0
  99. #pragma vertex vert
  100. #pragma fragment frag
  101. #pragma multi_compile_fragment _ FLARE_INVERSE_SDF
  102. #pragma multi_compile_vertex _ FLARE_OPENGL3_OR_OPENGLCORE
  103. #pragma multi_compile _ FLARE_HAS_OCCLUSION
  104. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  105. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  106. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
  107. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
  108. #include "Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Common.hlsl"
  109. #define FLARE_LERP_BLEND
  110. #include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
  111. ENDHLSL
  112. }
  113. // OcclusionOnly
  114. Pass
  115. {
  116. Name "LensFlareOcclusion"
  117. Blend Off
  118. Cull Off
  119. ZWrite Off
  120. ZTest Always
  121. HLSLPROGRAM
  122. #pragma target 3.0
  123. #pragma vertex vertOcclusion
  124. #pragma fragment fragOcclusion
  125. #pragma exclude_renderers gles
  126. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  127. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
  128. #define FLARE_COMPUTE_OCCLUSION
  129. #include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
  130. ENDHLSL
  131. }
  132. }
  133. }