SubpixelMorphologicalAntialiasing.shader 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. Shader "Hidden/Universal Render Pipeline/SubpixelMorphologicalAntialiasing"
  2. {
  3. Properties
  4. {
  5. [HideInInspector] _StencilRef ("_StencilRef", Int) = 64
  6. [HideInInspector] _StencilMask ("_StencilMask", Int) = 64
  7. }
  8. HLSLINCLUDE
  9. #pragma multi_compile_local _SMAA_PRESET_LOW _SMAA_PRESET_MEDIUM _SMAA_PRESET_HIGH
  10. #pragma exclude_renderers gles
  11. ENDHLSL
  12. SubShader
  13. {
  14. Cull Off ZWrite Off ZTest Always
  15. // Edge detection
  16. Pass
  17. {
  18. Stencil
  19. {
  20. WriteMask [_StencilMask]
  21. Ref [_StencilRef]
  22. Comp Always
  23. Pass Replace
  24. }
  25. HLSLPROGRAM
  26. #pragma vertex VertEdge
  27. #pragma fragment FragEdge
  28. #include "SubpixelMorphologicalAntialiasingBridge.hlsl"
  29. ENDHLSL
  30. }
  31. // Blend Weights Calculation
  32. Pass
  33. {
  34. Stencil
  35. {
  36. WriteMask [_StencilMask]
  37. ReadMask [_StencilMask]
  38. Ref [_StencilRef]
  39. Comp Equal
  40. Pass Replace
  41. }
  42. HLSLPROGRAM
  43. #pragma vertex VertBlend
  44. #pragma fragment FragBlend
  45. #include "SubpixelMorphologicalAntialiasingBridge.hlsl"
  46. ENDHLSL
  47. }
  48. // Neighborhood Blending
  49. Pass
  50. {
  51. HLSLPROGRAM
  52. #pragma vertex VertNeighbor
  53. #pragma fragment FragNeighbor
  54. #include "SubpixelMorphologicalAntialiasingBridge.hlsl"
  55. ENDHLSL
  56. }
  57. }
  58. }