DeferredOpaqueParent.pass 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  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": "SpecularInputOutput",
  250. "AttachmentRef": {
  251. "Pass": "DeferredLighting",
  252. "Attachment": "SpecularOutput"
  253. }
  254. }
  255. ]
  256. },
  257. {
  258. "Name": "SkyBoxPass",
  259. "TemplateName": "SkyBoxTwoOutputsTemplate",
  260. "Enabled": true,
  261. "Connections": [
  262. {
  263. "LocalSlot": "SpecularInputOutput",
  264. "AttachmentRef": {
  265. "Pass": "ReflectionsPass",
  266. "Attachment": "SpecularInputOutput"
  267. }
  268. },
  269. {
  270. "LocalSlot": "ReflectionInputOutput",
  271. "AttachmentRef": {
  272. "Pass": "ReflectionsPass",
  273. "Attachment": "ReflectionOutput"
  274. }
  275. },
  276. {
  277. "LocalSlot": "SkyBoxDepth",
  278. "AttachmentRef": {
  279. "Pass": "ReflectionsPass",
  280. "Attachment": "DepthStencilInputOutput"
  281. }
  282. }
  283. ]
  284. },
  285. {
  286. "Name": "SkyAtmosphereParentPass",
  287. "TemplateName": "SkyAtmosphereParentTemplate",
  288. "Enabled": true,
  289. "Connections": [
  290. {
  291. "LocalSlot": "SpecularInputOutput",
  292. "AttachmentRef": {
  293. "Pass": "SkyBoxPass",
  294. "Attachment": "SpecularInputOutput"
  295. }
  296. },
  297. {
  298. "LocalSlot": "ReflectionInputOutput",
  299. "AttachmentRef": {
  300. "Pass": "SkyBoxPass",
  301. "Attachment": "ReflectionInputOutput"
  302. }
  303. },
  304. {
  305. "LocalSlot": "SkyBoxDepth",
  306. "AttachmentRef": {
  307. "Pass": "SkyBoxPass",
  308. "Attachment": "SkyBoxDepth"
  309. }
  310. },
  311. {
  312. "LocalSlot": "DirectionalShadowmap",
  313. "AttachmentRef": {
  314. "Pass": "Parent",
  315. "Attachment": "DirectionalShadowmap"
  316. }
  317. },
  318. {
  319. "LocalSlot": "DirectionalESM",
  320. "AttachmentRef": {
  321. "Pass": "Parent",
  322. "Attachment": "DirectionalESM"
  323. }
  324. }
  325. ]
  326. },
  327. {
  328. "Name": "ReflectionCompositePass",
  329. "TemplateName": "ReflectionCompositePassTemplate",
  330. "Connections": [
  331. {
  332. "LocalSlot": "ReflectionInput",
  333. "AttachmentRef": {
  334. "Pass": "SkyAtmosphereParentPass",
  335. "Attachment": "ReflectionInputOutput"
  336. }
  337. },
  338. {
  339. "LocalSlot": "SpecularInputOutput",
  340. "AttachmentRef": {
  341. "Pass": "SkyAtmosphereParentPass",
  342. "Attachment": "SpecularInputOutput"
  343. }
  344. },
  345. {
  346. "LocalSlot": "DepthStencilInputOutput",
  347. "AttachmentRef": {
  348. "Pass": "SkyBoxPass",
  349. "Attachment": "SkyBoxDepth"
  350. }
  351. }
  352. ],
  353. "PassData": {
  354. "$type": "FullscreenTrianglePassData",
  355. "ShaderAsset": {
  356. "FilePath": "Shaders/Reflections/ReflectionComposite.shader"
  357. },
  358. "StencilRef": 1, // See RenderCommon.h and ReflectionComposite.shader
  359. "PipelineViewTag": "MainCamera"
  360. }
  361. },
  362. {
  363. "Name": "MSAAResolveDiffusePass",
  364. "TemplateName": "MSAAResolveColorTemplate",
  365. "Connections": [
  366. {
  367. "LocalSlot": "Input",
  368. "AttachmentRef": {
  369. "Pass": "DiffuseGlobalFullscreenPass",
  370. "Attachment": "DiffuseInputOutput"
  371. }
  372. }
  373. ]
  374. },
  375. {
  376. "Name": "MSAAResolveSpecularPass",
  377. "TemplateName": "MSAAResolveCustomTemplate",
  378. "Connections": [
  379. {
  380. "LocalSlot": "Input",
  381. "AttachmentRef": {
  382. "Pass": "ReflectionCompositePass",
  383. "Attachment": "SpecularInputOutput"
  384. }
  385. }
  386. ],
  387. "PassData": {
  388. "$type": "FullscreenTrianglePassData",
  389. "ShaderAsset": {
  390. "FilePath": "Shaders/PostProcessing/MSAAResolveCustom.shader"
  391. },
  392. "PipelineViewTag": "MainCamera",
  393. "ShaderDataMappings": {
  394. "UintMappings": [
  395. {
  396. "Name": "enableNeighborClamping",
  397. "Value": 1
  398. }
  399. ],
  400. "FloatMappings": [
  401. {
  402. "Name": "maxNeighborContrast",
  403. "Value": 1.5
  404. }
  405. ]
  406. }
  407. }
  408. },
  409. // TODO(DeferredPOC): Try to hook up subsurface scattering again
  410. //{
  411. // "Name": "MSAAResolveScatterDistancePass",
  412. // "TemplateName": "MSAAResolveColorTemplate",
  413. // "Connections": [
  414. // {
  415. // "LocalSlot": "Input",
  416. // "AttachmentRef": {
  417. // "Pass": "ForwardSubsurface",
  418. // "Attachment": "ScatterDistanceOutput"
  419. // }
  420. // }
  421. // ]
  422. //},
  423. //{
  424. // "Name": "SubsurfaceScatteringPass",
  425. // "TemplateName": "SubsurfaceScatteringPassTemplate",
  426. // "Enabled": true,
  427. // "Connections": [
  428. // {
  429. // "LocalSlot": "InputDiffuse",
  430. // "AttachmentRef": {
  431. // "Pass": "MSAAResolveDiffusePass",
  432. // "Attachment": "Output"
  433. // }
  434. // },
  435. // {
  436. // "LocalSlot": "InputLinearDepth",
  437. // "AttachmentRef": {
  438. // "Pass": "Parent",
  439. // "Attachment": "DepthLinear"
  440. // }
  441. // },
  442. // {
  443. // "LocalSlot": "InputScatterDistance",
  444. // "AttachmentRef": {
  445. // "Pass": "MSAAResolveScatterDistancePass",
  446. // "Attachment": "Output"
  447. // }
  448. // }
  449. // ],
  450. // "PassData": {
  451. // "$type": "ComputePassData",
  452. // "ShaderAsset": {
  453. // "FilePath": "Shaders/PostProcessing/ScreenSpaceSubsurfaceScatteringCS.shader"
  454. // },
  455. // "Make Fullscreen Pass": true,
  456. // "PipelineViewTag": "MainCamera"
  457. // }
  458. //},
  459. {
  460. "Name": "Ssao",
  461. "TemplateName": "SsaoParentTemplate",
  462. "Connections": [
  463. {
  464. "LocalSlot": "Modulate",
  465. "AttachmentRef": {
  466. "Pass": "MSAAResolveDiffusePass",
  467. "Attachment": "Output"
  468. }
  469. // TODO(DeferredPOC): Try to hook up subsurface scattering again
  470. //"AttachmentRef": {
  471. // "Pass": "SubsurfaceScatteringPass",
  472. // "Attachment": "Output"
  473. //}
  474. }
  475. ]
  476. },
  477. {
  478. "Name": "DiffuseSpecularMergePass",
  479. "TemplateName": "DiffuseSpecularMergeTemplate",
  480. "Connections": [
  481. {
  482. "LocalSlot": "InputDiffuse",
  483. "AttachmentRef": {
  484. "Pass": "Ssao",
  485. "Attachment": "Output"
  486. }
  487. },
  488. {
  489. "LocalSlot": "InputSpecular",
  490. "AttachmentRef": {
  491. "Pass": "MSAAResolveSpecularPass",
  492. "Attachment": "Output"
  493. }
  494. }
  495. ]
  496. }
  497. ]
  498. }
  499. }
  500. }