DeferredOpaqueParent.pass 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. {
  2. "Type": "JsonSerialization",
  3. "Version": 1,
  4. "ClassName": "PassAsset",
  5. "ClassData": {
  6. "PassTemplate": {
  7. "Name": "DeferredOpaqueParentTemplate",
  8. "PassClass": "ParentPass",
  9. "Slots": [
  10. // Inputs...
  11. {
  12. "Name": "DirectionalShadowmap",
  13. "SlotType": "Input"
  14. },
  15. {
  16. "Name": "DirectionalESM",
  17. "SlotType": "Input"
  18. },
  19. {
  20. "Name": "ProjectedShadowmap",
  21. "SlotType": "Input"
  22. },
  23. {
  24. "Name": "ProjectedESM",
  25. "SlotType": "Input"
  26. },
  27. {
  28. "Name": "TileLightData",
  29. "SlotType": "Input"
  30. },
  31. {
  32. "Name": "LightListRemapped",
  33. "SlotType": "Input"
  34. },
  35. {
  36. "Name": "DepthLinear",
  37. "SlotType": "Input"
  38. },
  39. // Input/Outputs...
  40. {
  41. "Name": "DepthStencil",
  42. "SlotType": "InputOutput"
  43. },
  44. // Outputs...
  45. {
  46. "Name": "Output",
  47. "SlotType": "Output"
  48. },
  49. {
  50. "Name": "DiffuseProbeGridVisualization",
  51. "SlotType": "Output"
  52. },
  53. // SwapChain here is only used to reference the frame height and format
  54. {
  55. "Name": "PipelineOutput",
  56. "SlotType": "InputOutput"
  57. }
  58. ],
  59. "Connections": [
  60. {
  61. "LocalSlot": "Output",
  62. "AttachmentRef": {
  63. "Pass": "DiffuseSpecularMergePass",
  64. "Attachment": "Output"
  65. }
  66. }
  67. ],
  68. "PassRequests": [
  69. {
  70. "Name": "DeferredMaterial",
  71. "TemplateName": "DeferredMaterialPassTemplate",
  72. "Connections": [
  73. // Inputs...
  74. // Input/Outputs...
  75. {
  76. "LocalSlot": "DepthStencilInputOutput",
  77. "AttachmentRef": {
  78. "Pass": "Parent",
  79. "Attachment": "DepthStencil"
  80. }
  81. }
  82. ],
  83. "PassData": {
  84. "$type": "RasterPassData",
  85. "DrawListTag": "deferredMaterial",
  86. "PipelineViewTag": "MainCamera"
  87. // No PassSrgShaderAsset is needed here because the material pass only packs GBuffers, and doesn't need any per-pass resources
  88. }
  89. },
  90. {
  91. "Name": "DeferredLighting",
  92. "TemplateName": "DeferredLightingPassTemplate",
  93. "Connections": [
  94. // Inputs...
  95. {
  96. "LocalSlot": "DirectionalLightShadowmap",
  97. "AttachmentRef": {
  98. "Pass": "Parent",
  99. "Attachment": "DirectionalShadowmap"
  100. }
  101. },
  102. {
  103. "LocalSlot": "ExponentialShadowmapDirectional",
  104. "AttachmentRef": {
  105. "Pass": "Parent",
  106. "Attachment": "DirectionalESM"
  107. }
  108. },
  109. {
  110. "LocalSlot": "ProjectedShadowmap",
  111. "AttachmentRef": {
  112. "Pass": "Parent",
  113. "Attachment": "ProjectedShadowmap"
  114. }
  115. },
  116. {
  117. "LocalSlot": "ExponentialShadowmapProjected",
  118. "AttachmentRef": {
  119. "Pass": "Parent",
  120. "Attachment": "ProjectedESM"
  121. }
  122. },
  123. {
  124. "LocalSlot": "TileLightData",
  125. "AttachmentRef": {
  126. "Pass": "Parent",
  127. "Attachment": "TileLightData"
  128. }
  129. },
  130. {
  131. "LocalSlot": "LightListRemapped",
  132. "AttachmentRef": {
  133. "Pass": "Parent",
  134. "Attachment": "LightListRemapped"
  135. }
  136. },
  137. {
  138. "LocalSlot": "DepthStencil",
  139. "AttachmentRef": {
  140. "Pass": "Parent",
  141. "Attachment": "DepthStencil"
  142. }
  143. },
  144. {
  145. "LocalSlot": "InputDepthStencil",
  146. "AttachmentRef": {
  147. "Pass": "Parent",
  148. "Attachment": "DepthStencil"
  149. }
  150. },
  151. {
  152. "LocalSlot": "BaseColor",
  153. "AttachmentRef": {
  154. "Pass": "DeferredMaterial",
  155. "Attachment": "BaseColorOutput"
  156. }
  157. },
  158. {
  159. "LocalSlot": "RoughnessMetal",
  160. "AttachmentRef": {
  161. "Pass": "DeferredMaterial",
  162. "Attachment": "RoughnessMetalOutput"
  163. }
  164. },
  165. {
  166. "LocalSlot": "Normal",
  167. "AttachmentRef": {
  168. "Pass": "DeferredMaterial",
  169. "Attachment": "NormalOutput"
  170. }
  171. }
  172. ]
  173. },
  174. {
  175. "Name": "DiffuseGlobalFullscreenPass",
  176. "TemplateName": "DiffuseGlobalFullscreenPassTemplate",
  177. "Connections": [
  178. {
  179. "LocalSlot": "DiffuseInputOutput",
  180. "AttachmentRef": {
  181. "Pass": "DeferredLighting",
  182. "Attachment": "DiffuseOutput"
  183. }
  184. },
  185. {
  186. "LocalSlot": "AlbedoInput",
  187. "AttachmentRef": {
  188. "Pass": "DeferredLighting",
  189. "Attachment": "AlbedoOutput"
  190. }
  191. },
  192. {
  193. "LocalSlot": "NormalInput",
  194. "AttachmentRef": {
  195. "Pass": "DeferredMaterial",
  196. "Attachment": "NormalOutput"
  197. }
  198. },
  199. {
  200. "LocalSlot": "DepthStencilTextureInput",
  201. "AttachmentRef": {
  202. "Pass": "DeferredMaterial",
  203. "Attachment": "DepthStencilInputOutput"
  204. }
  205. },
  206. {
  207. "LocalSlot": "DepthStencilInputOutput",
  208. "AttachmentRef": {
  209. "Pass": "DeferredMaterial",
  210. "Attachment": "DepthStencilInputOutput"
  211. }
  212. }
  213. ]
  214. },
  215. {
  216. "Name": "ReflectionsPass",
  217. "TemplateName": "ReflectionsParentPassTemplate",
  218. "Enabled": true,
  219. "Connections": [
  220. {
  221. "LocalSlot": "NormalInput",
  222. "AttachmentRef": {
  223. "Pass": "DeferredMaterial",
  224. "Attachment": "NormalOutput"
  225. }
  226. },
  227. {
  228. "LocalSlot": "SpecularF0Input",
  229. "AttachmentRef": {
  230. "Pass": "DeferredLighting",
  231. "Attachment": "SpecularF0Output"
  232. }
  233. },
  234. {
  235. "LocalSlot": "AlbedoInput",
  236. "AttachmentRef": {
  237. "Pass": "DeferredLighting",
  238. "Attachment": "AlbedoOutput"
  239. }
  240. },
  241. {
  242. "LocalSlot": "DepthStencilInputOutput",
  243. "AttachmentRef": {
  244. "Pass": "DeferredMaterial",
  245. "Attachment": "DepthStencilInputOutput"
  246. }
  247. },
  248. {
  249. "LocalSlot": "DepthLinear",
  250. "AttachmentRef": {
  251. "Pass": "Parent",
  252. "Attachment": "DepthLinear"
  253. }
  254. },
  255. {
  256. "LocalSlot": "SpecularInputOutput",
  257. "AttachmentRef": {
  258. "Pass": "DeferredLighting",
  259. "Attachment": "SpecularOutput"
  260. }
  261. }
  262. ]
  263. },
  264. {
  265. "Name": "SkyBoxPass",
  266. "TemplateName": "SkyBoxTwoOutputsTemplate",
  267. "Enabled": true,
  268. "Connections": [
  269. {
  270. "LocalSlot": "SpecularInputOutput",
  271. "AttachmentRef": {
  272. "Pass": "ReflectionsPass",
  273. "Attachment": "SpecularInputOutput"
  274. }
  275. },
  276. {
  277. "LocalSlot": "ReflectionInputOutput",
  278. "AttachmentRef": {
  279. "Pass": "ReflectionsPass",
  280. "Attachment": "ReflectionOutput"
  281. }
  282. },
  283. {
  284. "LocalSlot": "SkyBoxDepth",
  285. "AttachmentRef": {
  286. "Pass": "ReflectionsPass",
  287. "Attachment": "DepthStencilInputOutput"
  288. }
  289. }
  290. ]
  291. },
  292. {
  293. "Name": "SkyAtmosphereParentPass",
  294. "TemplateName": "SkyAtmosphereParentTemplate",
  295. "Enabled": true,
  296. "Connections": [
  297. {
  298. "LocalSlot": "SpecularInputOutput",
  299. "AttachmentRef": {
  300. "Pass": "SkyBoxPass",
  301. "Attachment": "SpecularInputOutput"
  302. }
  303. },
  304. {
  305. "LocalSlot": "ReflectionInputOutput",
  306. "AttachmentRef": {
  307. "Pass": "SkyBoxPass",
  308. "Attachment": "ReflectionInputOutput"
  309. }
  310. },
  311. {
  312. "LocalSlot": "SkyBoxDepth",
  313. "AttachmentRef": {
  314. "Pass": "SkyBoxPass",
  315. "Attachment": "SkyBoxDepth"
  316. }
  317. },
  318. {
  319. "LocalSlot": "DirectionalShadowmap",
  320. "AttachmentRef": {
  321. "Pass": "Parent",
  322. "Attachment": "DirectionalShadowmap"
  323. }
  324. },
  325. {
  326. "LocalSlot": "DirectionalESM",
  327. "AttachmentRef": {
  328. "Pass": "Parent",
  329. "Attachment": "DirectionalESM"
  330. }
  331. }
  332. ]
  333. },
  334. {
  335. "Name": "ReflectionCompositePass",
  336. "TemplateName": "ReflectionCompositePassTemplate",
  337. "Connections": [
  338. {
  339. "LocalSlot": "ReflectionInput",
  340. "AttachmentRef": {
  341. "Pass": "SkyAtmosphereParentPass",
  342. "Attachment": "ReflectionInputOutput"
  343. }
  344. },
  345. {
  346. "LocalSlot": "SpecularInputOutput",
  347. "AttachmentRef": {
  348. "Pass": "SkyAtmosphereParentPass",
  349. "Attachment": "SpecularInputOutput"
  350. }
  351. },
  352. {
  353. "LocalSlot": "DepthStencilInputOutput",
  354. "AttachmentRef": {
  355. "Pass": "SkyBoxPass",
  356. "Attachment": "SkyBoxDepth"
  357. }
  358. }
  359. ],
  360. "PassData": {
  361. "$type": "FullscreenTrianglePassData",
  362. "ShaderAsset": {
  363. "FilePath": "Shaders/Reflections/ReflectionComposite.shader"
  364. },
  365. "StencilRef": 1, // See RenderCommon.h and ReflectionComposite.shader
  366. "PipelineViewTag": "MainCamera"
  367. }
  368. },
  369. {
  370. "Name": "MSAAResolveDiffusePass",
  371. "TemplateName": "MSAAResolveColorTemplate",
  372. "Connections": [
  373. {
  374. "LocalSlot": "Input",
  375. "AttachmentRef": {
  376. "Pass": "DiffuseGlobalFullscreenPass",
  377. "Attachment": "DiffuseInputOutput"
  378. }
  379. }
  380. ]
  381. },
  382. {
  383. "Name": "MSAAResolveSpecularPass",
  384. "TemplateName": "MSAAResolveCustomTemplate",
  385. "Connections": [
  386. {
  387. "LocalSlot": "Input",
  388. "AttachmentRef": {
  389. "Pass": "ReflectionCompositePass",
  390. "Attachment": "SpecularInputOutput"
  391. }
  392. }
  393. ],
  394. "PassData": {
  395. "$type": "FullscreenTrianglePassData",
  396. "ShaderAsset": {
  397. "FilePath": "Shaders/PostProcessing/MSAAResolveCustom.shader"
  398. },
  399. "PipelineViewTag": "MainCamera",
  400. "ShaderDataMappings": {
  401. "UintMappings": [
  402. {
  403. "Name": "enableNeighborClamping",
  404. "Value": 1
  405. }
  406. ],
  407. "FloatMappings": [
  408. {
  409. "Name": "maxNeighborContrast",
  410. "Value": 1.5
  411. }
  412. ]
  413. }
  414. }
  415. },
  416. // TODO(DeferredPOC): Try to hook up subsurface scattering again
  417. //{
  418. // "Name": "MSAAResolveScatterDistancePass",
  419. // "TemplateName": "MSAAResolveColorTemplate",
  420. // "Connections": [
  421. // {
  422. // "LocalSlot": "Input",
  423. // "AttachmentRef": {
  424. // "Pass": "ForwardSubsurface",
  425. // "Attachment": "ScatterDistanceOutput"
  426. // }
  427. // }
  428. // ]
  429. //},
  430. //{
  431. // "Name": "SubsurfaceScatteringPass",
  432. // "TemplateName": "SubsurfaceScatteringPassTemplate",
  433. // "Enabled": true,
  434. // "Connections": [
  435. // {
  436. // "LocalSlot": "InputDiffuse",
  437. // "AttachmentRef": {
  438. // "Pass": "MSAAResolveDiffusePass",
  439. // "Attachment": "Output"
  440. // }
  441. // },
  442. // {
  443. // "LocalSlot": "InputLinearDepth",
  444. // "AttachmentRef": {
  445. // "Pass": "Parent",
  446. // "Attachment": "DepthLinear"
  447. // }
  448. // },
  449. // {
  450. // "LocalSlot": "InputScatterDistance",
  451. // "AttachmentRef": {
  452. // "Pass": "MSAAResolveScatterDistancePass",
  453. // "Attachment": "Output"
  454. // }
  455. // }
  456. // ],
  457. // "PassData": {
  458. // "$type": "ComputePassData",
  459. // "ShaderAsset": {
  460. // "FilePath": "Shaders/PostProcessing/ScreenSpaceSubsurfaceScatteringCS.shader"
  461. // },
  462. // "FullscreenDispatch": true,
  463. // "PipelineViewTag": "MainCamera"
  464. // }
  465. //},
  466. {
  467. "Name": "Ssao",
  468. "TemplateName": "SsaoParentTemplate",
  469. "Connections": [
  470. {
  471. "LocalSlot": "Modulate",
  472. "AttachmentRef": {
  473. "Pass": "MSAAResolveDiffusePass",
  474. "Attachment": "Output"
  475. }
  476. // TODO(DeferredPOC): Try to hook up subsurface scattering again
  477. //"AttachmentRef": {
  478. // "Pass": "SubsurfaceScatteringPass",
  479. // "Attachment": "Output"
  480. //}
  481. }
  482. ]
  483. },
  484. {
  485. "Name": "DiffuseSpecularMergePass",
  486. "TemplateName": "DiffuseSpecularMergeTemplate",
  487. "Connections": [
  488. {
  489. "LocalSlot": "InputDiffuse",
  490. "AttachmentRef": {
  491. "Pass": "Ssao",
  492. "Attachment": "Output"
  493. }
  494. },
  495. {
  496. "LocalSlot": "InputSpecular",
  497. "AttachmentRef": {
  498. "Pass": "MSAAResolveSpecularPass",
  499. "Attachment": "Output"
  500. }
  501. }
  502. ]
  503. }
  504. ]
  505. }
  506. }
  507. }