MeshChainMin.shader 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Shader "XRLineRenderer/MeshChain - Min Color"
  2. {
  3. Properties
  4. {
  5. _Color("Color Tint", COLOR) = (1,1,1,1)
  6. _lineSettings ("Line Thickness Settings", VECTOR) = (0, 1, .5, 1)
  7. _lineRadius("Line Radius Scale, Min, Max", VECTOR) = (1, 0, 100)
  8. // Local space or world space data
  9. [HideInInspector] _WorldData("__worlddata", Float) = 0.0
  10. // Depth effects line width
  11. [HideInInspector] _LineDepthScale("__linedepthscale", Float) = 1.0
  12. }
  13. SubShader
  14. {
  15. Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
  16. LOD 100
  17. Pass
  18. {
  19. // This version of the shader writes any pixel darker than the background
  20. // It uses the 'min' operation to keep line consistency
  21. Blend One One
  22. BlendOp Min
  23. Cull Off
  24. Lighting Off
  25. ZWrite Off
  26. Offset 0, -.1
  27. CGPROGRAM
  28. #pragma vertex vert
  29. #pragma fragment fragInvert
  30. #pragma multi_compile LINE_PERSPECTIVE_WIDTH LINE_FIXED_WIDTH
  31. #pragma multi_compile LINE_MODEL_SPACE LINE_WORLD_SPACE
  32. #include "UnityCG.cginc"
  33. #include "MeshChain.cginc"
  34. ENDCG
  35. }
  36. }
  37. FallBack "Diffuse"
  38. CustomEditor "Unity.XRTools.Rendering.MeshChainShaderGUI"
  39. }