HairParentShortCutPass.pass 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. {
  2. "Type": "JsonSerialization",
  3. "Version": 1,
  4. "ClassName": "PassAsset",
  5. "ClassData": {
  6. "PassTemplate": {
  7. "Name": "HairParentShortCutPassTemplate",
  8. "PassClass": "ParentPass",
  9. "Slots": [
  10. {
  11. "Name": "RenderTargetInputOutput",
  12. "SlotType": "InputOutput",
  13. "ScopeAttachmentUsage": "RenderTarget"
  14. },
  15. {
  16. // used for copy from MSAA to regular RT
  17. "Name": "RenderTargetInputOnly",
  18. "SlotType": "Input",
  19. "ScopeAttachmentUsage": "Shader"
  20. },
  21. // This is the depth stencil buffer that is to be used by the fill pass
  22. // to early reject pixels by depth and in the resolve pass to write the
  23. // the hair depth
  24. {
  25. "Name": "Depth",
  26. "SlotType": "InputOutput",
  27. "ScopeAttachmentUsage": "DepthStencil"
  28. },
  29. // Used to set the size of the Head PPLL image buffer.
  30. {
  31. "Name": "DepthLinear",
  32. "SlotType": "InputOutput"
  33. },
  34. // Lights & Shadows resources
  35. {
  36. "Name": "DirectionalShadowmap",
  37. "SlotType": "Input"
  38. },
  39. {
  40. "Name": "DirectionalESM",
  41. "SlotType": "Input"
  42. },
  43. {
  44. "Name": "ProjectedShadowmap",
  45. "SlotType": "Input"
  46. },
  47. {
  48. "Name": "ProjectedESM",
  49. "SlotType": "Input"
  50. },
  51. {
  52. "Name": "TileLightData",
  53. "SlotType": "Input"
  54. },
  55. {
  56. "Name": "LightListRemapped",
  57. "SlotType": "Input"
  58. }
  59. ],
  60. "PassRequests": [
  61. {
  62. "Name": "HairGlobalShapeConstraintsComputePass",
  63. "TemplateName": "HairGlobalShapeConstraintsComputePassTemplate",
  64. "Enabled": true
  65. },
  66. {
  67. "Name": "HairCalculateStrandLevelDataComputePass",
  68. "TemplateName": "HairCalculateStrandLevelDataComputePassTemplate",
  69. "Enabled": true,
  70. "Connections": [
  71. {
  72. "LocalSlot": "SkinnedHairSharedBuffer",
  73. "AttachmentRef": {
  74. "Pass": "HairGlobalShapeConstraintsComputePass",
  75. "Attachment": "SkinnedHairSharedBuffer"
  76. }
  77. }
  78. ]
  79. },
  80. {
  81. "Name": "HairVelocityShockPropagationComputePass",
  82. "TemplateName": "HairVelocityShockPropagationComputePassTemplate",
  83. "Enabled": true,
  84. "Connections": [
  85. {
  86. "LocalSlot": "SkinnedHairSharedBuffer",
  87. "AttachmentRef": {
  88. "Pass": "HairCalculateStrandLevelDataComputePass",
  89. "Attachment": "SkinnedHairSharedBuffer"
  90. }
  91. }
  92. ]
  93. },
  94. {
  95. "Name": "HairLocalShapeConstraintsComputePass",
  96. "TemplateName": "HairLocalShapeConstraintsComputePassTemplate",
  97. "Enabled": true,
  98. "Connections": [
  99. {
  100. "LocalSlot": "SkinnedHairSharedBuffer",
  101. "AttachmentRef": {
  102. "Pass": "HairVelocityShockPropagationComputePass",
  103. "Attachment": "SkinnedHairSharedBuffer"
  104. }
  105. }
  106. ]
  107. },
  108. {
  109. "Name": "HairLengthConstraintsWindAndCollisionComputePass",
  110. "TemplateName": "HairLengthConstraintsWindAndCollisionComputePassTemplate",
  111. "Enabled": true,
  112. "Connections": [
  113. {
  114. "LocalSlot": "SkinnedHairSharedBuffer",
  115. "AttachmentRef": {
  116. "Pass": "HairLocalShapeConstraintsComputePass",
  117. "Attachment": "SkinnedHairSharedBuffer"
  118. }
  119. }
  120. ]
  121. },
  122. {
  123. "Name": "HairUpdateFollowHairComputePass",
  124. "TemplateName": "HairUpdateFollowHairComputePassTemplate",
  125. "Enabled": true,
  126. "Connections": [
  127. {
  128. "LocalSlot": "SkinnedHairSharedBuffer",
  129. "AttachmentRef": {
  130. "Pass": "HairLengthConstraintsWindAndCollisionComputePass",
  131. "Attachment": "SkinnedHairSharedBuffer"
  132. }
  133. }
  134. ]
  135. },
  136. // Render Target Copy from MS to Regular
  137. {
  138. "Name": "RenderTargetCopyPass",
  139. "TemplateName": "FullscreenCopyTemplate",
  140. "Connections": [
  141. {
  142. "LocalSlot": "Input",
  143. "AttachmentRef": {
  144. "Pass": "Parent",
  145. "Attachment": "RenderTargetInputOnly"
  146. }
  147. },
  148. {
  149. "LocalSlot": "Output",
  150. "AttachmentRef": {
  151. "Pass": "This",
  152. "Attachment": "Output"
  153. }
  154. }
  155. ],
  156. "ImageAttachments": [
  157. {
  158. "Name": "Output",
  159. "SizeSource": {
  160. "Source": {
  161. "Pass": "This",
  162. "Attachment": "Input"
  163. }
  164. },
  165. "FormatSource": {
  166. "Pass": "This",
  167. "Attachment": "Input"
  168. },
  169. "GenerateFullMipChain": false
  170. }
  171. ]
  172. },
  173. // Rendering Passes
  174. {
  175. "Name": "HairShortCutGeometryDepthAlphaPass",
  176. "TemplateName": "HairShortCutGeometryDepthAlphaPassTemplate",
  177. "Enabled": true,
  178. "Connections": [
  179. {
  180. "LocalSlot": "SkinnedHairSharedBuffer",
  181. "AttachmentRef": {
  182. "Pass": "HairUpdateFollowHairComputePass",
  183. "Attachment": "SkinnedHairSharedBuffer"
  184. }
  185. },
  186. {
  187. "LocalSlot": "Depth",
  188. "AttachmentRef": {
  189. "Pass": "Parent",
  190. "Attachment": "Depth"
  191. }
  192. },
  193. {
  194. "LocalSlot": "HairDepthsTextureArray",
  195. "AttachmentRef": {
  196. "Pass": "This",
  197. "Attachment": "HairDepthsTextureArray"
  198. }
  199. }
  200. ]
  201. },
  202. {
  203. "Name": "HairShortCutResolveDepthPass",
  204. "TemplateName": "HairShortCutResolveDepthPassTemplate",
  205. "Enabled": true,
  206. "Connections": [
  207. {
  208. "LocalSlot": "Depth",
  209. "AttachmentRef": {
  210. "Pass": "Parent",
  211. "Attachment": "Depth"
  212. }
  213. },
  214. {
  215. "LocalSlot": "HairDepthsTextureArray",
  216. "AttachmentRef": {
  217. "Pass": "HairShortCutGeometryDepthAlphaPass",
  218. "Attachment": "HairDepthsTextureArray"
  219. }
  220. }
  221. ]
  222. },
  223. {
  224. "Name": "HairShortCutGeometryShadingPass",
  225. "TemplateName": "HairShortCutGeometryShadingPassTemplate",
  226. "Enabled": true,
  227. "Connections": [
  228. {
  229. // The final render target - this is MSAA mode RT - would it be cheaper to
  230. // use non-MSAA and then copy?
  231. "LocalSlot": "RenderTargetInputOutput",
  232. "AttachmentRef": {
  233. "Pass": "Parent",
  234. "Attachment": "RenderTargetInputOutput"
  235. }
  236. },
  237. {
  238. "LocalSlot": "DepthLinear",
  239. "AttachmentRef": {
  240. "Pass": "Parent",
  241. "Attachment": "DepthLinear"
  242. }
  243. },
  244. {
  245. "LocalSlot": "AccumulatedInverseAlpha",
  246. "AttachmentRef": {
  247. "Pass": "HairShortCutGeometryDepthAlphaPass",
  248. "Attachment": "InverseAlphaRTOutput"
  249. }
  250. },
  251. {
  252. "LocalSlot": "Depth",
  253. "AttachmentRef": {
  254. "Pass": "Parent",
  255. "Attachment": "Depth"
  256. }
  257. },
  258. {
  259. "LocalSlot": "SkinnedHairSharedBuffer",
  260. "AttachmentRef": {
  261. "Pass": "HairUpdateFollowHairComputePass",
  262. "Attachment": "SkinnedHairSharedBuffer"
  263. }
  264. },
  265. // Shadows resources
  266. {
  267. "LocalSlot": "DirectionalShadowmap",
  268. "AttachmentRef": {
  269. "Pass": "Parent",
  270. "Attachment": "DirectionalShadowmap"
  271. }
  272. },
  273. {
  274. "LocalSlot": "DirectionalESM",
  275. "AttachmentRef": {
  276. "Pass": "Parent",
  277. "Attachment": "DirectionalESM"
  278. }
  279. },
  280. {
  281. "LocalSlot": "ProjectedShadowmap",
  282. "AttachmentRef": {
  283. "Pass": "Parent",
  284. "Attachment": "ProjectedShadowmap"
  285. }
  286. },
  287. {
  288. "LocalSlot": "ProjectedESM",
  289. "AttachmentRef": {
  290. "Pass": "Parent",
  291. "Attachment": "ProjectedESM"
  292. }
  293. },
  294. // Lights Resources
  295. {
  296. "LocalSlot": "TileLightData",
  297. "AttachmentRef": {
  298. "Pass": "Parent",
  299. "Attachment": "TileLightData"
  300. }
  301. },
  302. {
  303. "LocalSlot": "LightListRemapped",
  304. "AttachmentRef": {
  305. "Pass": "Parent",
  306. "Attachment": "LightListRemapped"
  307. }
  308. }
  309. ]
  310. },
  311. {
  312. "Name": "HairShortCutResolveColorPass",
  313. "TemplateName": "HairShortCutResolveColorPassTemplate",
  314. "Enabled": true,
  315. "Connections": [
  316. {
  317. // The final render target - this is MSAA mode RT - would it be cheaper to
  318. // use non-MSAA and then copy?
  319. "LocalSlot": "RenderTargetInputOutput",
  320. "AttachmentRef": {
  321. "Pass": "Parent",
  322. "Attachment": "RenderTargetInputOutput"
  323. }
  324. },
  325. {
  326. "LocalSlot": "AccumulatedInverseAlpha",
  327. "AttachmentRef": {
  328. "Pass": "HairShortCutGeometryDepthAlphaPass",
  329. "Attachment": "InverseAlphaRTOutput"
  330. }
  331. },
  332. {
  333. "LocalSlot": "HairColorTexture",
  334. "AttachmentRef": {
  335. "Pass": "HairShortCutGeometryShadingPass",
  336. "Attachment": "HairColorRenderTarget"
  337. }
  338. }
  339. ]
  340. },
  341. {
  342. // This pass copies the updated depth buffer (now contains hair depth) to linear depth texture
  343. // for downstream passes to use. This can be optimized even further by writing into the stencil
  344. // buffer pixels that were touched by HairPPLLResolvePass hence preventing depth update unless
  345. // it is hair.
  346. "Name": "DepthToDepthLinearPass",
  347. "TemplateName": "HairDepthToLinearTemplate",
  348. "Enabled": true,
  349. "Connections": [
  350. {
  351. "LocalSlot": "Input",
  352. "AttachmentRef": {
  353. "Pass": "HairShortCutResolveDepthPass",
  354. "Attachment": "Depth"
  355. }
  356. },
  357. {
  358. "LocalSlot": "Output",
  359. "AttachmentRef": {
  360. "Pass": "Parent",
  361. "Attachment": "DepthLinear"
  362. }
  363. }
  364. ]
  365. }
  366. ]
  367. }
  368. }
  369. }