ForwardPass.pass 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {
  2. "Type": "JsonSerialization",
  3. "Version": 1,
  4. "ClassName": "PassAsset",
  5. "ClassData": {
  6. "PassTemplate": {
  7. "Name": "ForwardPassExampleTemplate",
  8. "PassClass": "RasterPass",
  9. "Slots": [
  10. // Inputs...
  11. {
  12. "Name": "BRDFTextureInput",
  13. "ShaderInputName": "m_brdfMap",
  14. "SlotType": "Input",
  15. "ScopeAttachmentUsage": "Shader"
  16. },
  17. // Outputs...
  18. {
  19. "Name": "DepthOutput",
  20. "SlotType": "Output",
  21. "ScopeAttachmentUsage": "DepthStencil",
  22. // Specifying the AspectFlags is very important
  23. // when using Subpasses because it avoids Validation errors.
  24. "ImageViewDesc": {
  25. "AspectFlags": [
  26. "Depth"
  27. ]
  28. },
  29. "LoadStoreAction": {
  30. "ClearValue": {
  31. "Type": "DepthStencil"
  32. },
  33. "LoadAction": "Clear",
  34. "LoadActionStencil": "DontCare",
  35. // Very important to Store the tile back to memory when using independent passes.
  36. "StoreAction": "Store",
  37. "StoreActionStencil": "DontCare"
  38. }
  39. },
  40. {
  41. "Name": "LightingOutput",
  42. "SlotType": "Output",
  43. "ScopeAttachmentUsage": "RenderTarget",
  44. "LoadStoreAction": {
  45. "ClearValue": {
  46. "Value": [
  47. 0.0,
  48. 0.0,
  49. 0.0,
  50. 0.0
  51. ]
  52. },
  53. "LoadAction": "Clear",
  54. "StoreAction": "Store"
  55. }
  56. }
  57. ],
  58. "ImageAttachments": [
  59. {
  60. "Name": "DepthAttachment",
  61. "SizeSource": {
  62. "Source": {
  63. "Pass": "Parent",
  64. "Attachment": "PipelineOutput"
  65. }
  66. },
  67. "ImageDescriptor": {
  68. "Format": "D32_FLOAT_S8X24_UINT",
  69. "SharedQueueMask": "Graphics"
  70. }
  71. },
  72. {
  73. "Name": "BRDFTexture",
  74. "Lifetime": "Imported",
  75. "AssetRef": {
  76. "FilePath": "Textures/BRDFTexture.attimage"
  77. }
  78. }
  79. ],
  80. "Connections": [
  81. {
  82. "LocalSlot": "DepthOutput",
  83. "AttachmentRef": {
  84. "Pass": "This",
  85. "Attachment": "DepthAttachment"
  86. }
  87. },
  88. {
  89. "LocalSlot": "LightingOutput",
  90. "AttachmentRef": {
  91. "Pass": "Parent",
  92. "Attachment": "PipelineOutput"
  93. }
  94. },
  95. {
  96. "LocalSlot": "BRDFTextureInput",
  97. "AttachmentRef": {
  98. "Pass": "This",
  99. "Attachment": "BRDFTexture"
  100. }
  101. }
  102. ]
  103. }
  104. }
  105. }