HairParentPass.pass 14 KB

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