HairShortCutGeometryDepthAlpha.pass 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {
  2. "Type": "JsonSerialization",
  3. "Version": 1,
  4. "ClassName": "PassAsset",
  5. "ClassData": {
  6. "PassTemplate": {
  7. "Name": "HairShortCutGeometryDepthAlphaPassTemplate",
  8. "PassClass": "HairShortCutGeometryDepthAlphaPass",
  9. "Slots": [
  10. {
  11. "Name": "SkinnedHairSharedBuffer",
  12. "ShaderInputName": "m_skinnedHairSharedBuffer",
  13. "SlotType": "Input",
  14. "ScopeAttachmentUsage": "Shader"
  15. },
  16. { // DepthStencil for early disqualifying the pixel based on depth. No write.
  17. "Name": "Depth",
  18. "SlotType": "Input",
  19. "ScopeAttachmentUsage": "DepthStencil"
  20. },
  21. {
  22. // the regular render target is blended using inverse alpha to reduce the
  23. // incoming color contribution based on the hair thickness and alpha.
  24. "Name": "InverseAlphaRTOutput",
  25. "SlotType": "Output",
  26. "ScopeAttachmentUsage": "RenderTarget",
  27. "LoadStoreAction": {
  28. "LoadAction": "Clear",
  29. "ClearValue": {
  30. "Value": [ 1.0, 1.0, 1.0, 1.0 ]
  31. },
  32. "StoreAction": "Store"
  33. }
  34. },
  35. {
  36. "Name": "HairDepthsTextureArray",
  37. "SlotType": "Output",
  38. "ScopeAttachmentUsage": "Shader",
  39. "ShaderInputName": "m_RWFragmentDepthsTexture",
  40. "LoadStoreAction": {
  41. "LoadAction": "Clear",
  42. "ClearValue": { // reverse depth order: closer --> 1.0
  43. "Value": [ 0.0, 0.0, 0.0, 0.0 ]
  44. },
  45. "StoreAction": "Store"
  46. }
  47. }
  48. ],
  49. "ImageAttachments": [
  50. {
  51. // This buffer is used as the render target and should be at non-MSAA screen resolution
  52. // to make sure no overwork is done.
  53. "Name": "InverseAlphaRTImage",
  54. "SizeSource": {
  55. "Source": {
  56. "Pass": "Parent",
  57. "Attachment": "DepthLinear"
  58. }
  59. },
  60. "ImageDescriptor": {
  61. "Format": "R32_FLOAT",
  62. "SharedQueueMask": "Graphics",
  63. "BindFlags": [
  64. "Color",
  65. "ShaderRead"
  66. ]
  67. }
  68. },
  69. {
  70. "Name": "HairDepthsTextureArray",
  71. "SizeSource": {
  72. "Source": {
  73. "Pass": "Parent",
  74. "Attachment": "DepthLinear"
  75. }
  76. },
  77. "ImageDescriptor": {
  78. "Format": "R32_UINT",
  79. "ArraySize": "3",
  80. "SharedQueueMask": "Graphics",
  81. "BindFlags": [
  82. "ShaderReadWrite",
  83. "ShaderWrite",
  84. "ShaderRead"
  85. ]
  86. }
  87. }
  88. ],
  89. "Connections": [
  90. {
  91. "LocalSlot": "InverseAlphaRTOutput",
  92. "AttachmentRef": {
  93. "Pass": "This",
  94. "Attachment": "InverseAlphaRTImage"
  95. }
  96. }
  97. ],
  98. "PassData": {
  99. "$type": "RasterPassData",
  100. "DrawListTag": "HairGeometryDepthAlphaDrawList",
  101. "BindViewSrg": true,
  102. "PassSrgShaderAsset": {
  103. // Looking for it in the Shaders directory relative to the Assets directory
  104. "FilePath": "Shaders/HairShortCutGeometryDepthAlpha.shader"
  105. }
  106. }
  107. }
  108. }
  109. }