VLBGeneratedShader.shader 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Shader "Hidden/VLB_BuiltIn_SinglePass"
  2. {
  3. Properties
  4. {
  5. _ConeSlopeCosSin("Cone Slope Cos Sin", Vector) = (0,0,0,0)
  6. _ConeRadius("Cone Radius", Vector) = (0,0,0,0)
  7. _ConeApexOffsetZ("Cone Apex Offset Z", Float) = 0
  8. _ColorFlat("Color", Color) = (1,1,1,1)
  9. _AlphaInside("Alpha Inside", Range(0,1)) = 1
  10. _AlphaOutside("Alpha Outside", Range(0,1)) = 1
  11. _DistanceFallOff("Distance Fall Off", Vector) = (0,1,1,0)
  12. _DistanceCamClipping("Camera Clipping Distance", Float) = 0.5
  13. _FadeOutFactor("FadeOutFactor", Float) = 1
  14. _AttenuationLerpLinearQuad("Lerp between attenuation linear and quad", Float) = 0.5
  15. _DepthBlendDistance("Depth Blend Distance", Float) = 2
  16. _FresnelPow("Fresnel Pow", Range(0,15)) = 1
  17. _GlareFrontal("Glare Frontal", Range(0,1)) = 0.5
  18. _GlareBehind("Glare from Behind", Range(0,1)) = 0.5
  19. _DrawCap("Draw Cap", Float) = 1
  20. _NoiseVelocityAndScale("Noise Velocity And Scale", Vector) = (0,0,0,0)
  21. _NoiseParam("Noise Param", Vector) = (0,0,0,0)
  22. _CameraParams("Camera Params", Vector) = (0,0,0,0)
  23. _BlendSrcFactor("BlendSrcFactor", Int) = 1 // One
  24. _BlendDstFactor("BlendDstFactor", Int) = 1 // One
  25. _DynamicOcclusionClippingPlaneWS("Dynamic Occlusion Clipping Plane WS", Vector) = (0,0,0,0)
  26. _DynamicOcclusionClippingPlaneProps("Dynamic Occlusion Clipping Plane Props", Float) = 0.25
  27. _DynamicOcclusionDepthTexture("DynamicOcclusionDepthTexture", 2D) = "white" {}
  28. _DynamicOcclusionDepthProps("DynamicOcclusionDepthProps", Float) = 0.25
  29. _LocalForwardDirection("LocalForwardDirection", Vector) = (0,0,1)
  30. _TiltVector("TiltVector", Vector) = (0,0,0,0)
  31. _AdditionalClippingPlaneWS("AdditionalClippingPlaneWS", Vector) = (0,0,0,0)
  32. }
  33. Category
  34. {
  35. Tags
  36. {
  37. "Queue" = "Transparent"
  38. "RenderType" = "Transparent"
  39. "IgnoreProjector" = "True"
  40. "DisableBatching" = "True" // disable dynamic batching which doesn't work neither with multiple materials nor material property blocks
  41. }
  42. Blend[_BlendSrcFactor][_BlendDstFactor]
  43. ZWrite Off
  44. SubShader
  45. {
  46. Pass
  47. {
  48. Cull Front
  49. CGPROGRAM
  50. #if !defined(SHADER_API_METAL) // Removed shader model spec for Metal support https://github.com/keijiro/Cloner/commit/1120493ca2df265d450de3ec1b38a1d388468964
  51. #pragma target 3.0
  52. #endif
  53. #pragma vertex vert
  54. #pragma fragment frag
  55. #pragma multi_compile_fog
  56. #pragma multi_compile_local __ VLB_ALPHA_AS_BLACK
  57. #pragma multi_compile_local __ VLB_NOISE_3D
  58. #pragma multi_compile_local __ VLB_DEPTH_BLEND
  59. #pragma multi_compile_local __ VLB_COLOR_GRADIENT_MATRIX_HIGH
  60. #pragma multi_compile_local __ VLB_OCCLUSION_CLIPPING_PLANE VLB_OCCLUSION_DEPTH_TEXTURE
  61. #pragma multi_compile_local __ VLB_MESH_SKEWING
  62. #pragma multi_compile_local __ VLB_SHADER_ACCURACY_HIGH
  63. #define VLB_PASS_OUTSIDEBEAM_FROM_VS_TO_FS 1
  64. #include "UnityCG.cginc"
  65. #include "ShaderDefines.cginc"
  66. #include "ShaderProperties.cginc"
  67. #include "ShaderSpecificBuiltin.cginc"
  68. #include "VolumetricLightBeamShared.cginc"
  69. v2f vert(vlb_appdata v) { return vertShared(v, v.texcoord.y); }
  70. half4 frag(v2f i) : SV_Target { return fragShared(i, i.cameraPosObjectSpace_outsideBeam.w); }
  71. ENDCG
  72. }
  73. }
  74. }
  75. }