HairShortCutGeometryShading.pass 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. {
  2. "Type": "JsonSerialization",
  3. "Version": 1,
  4. "ClassName": "PassAsset",
  5. "ClassData": {
  6. "PassTemplate": {
  7. "Name": "HairShortCutGeometryShadingPassTemplate",
  8. "PassClass": "HairShortCutGeometryShadingPass",
  9. "Slots": [
  10. { // Temporary color buffer to store the gathered shaded hair color - MSAA
  11. "Name": "HairColorRenderTarget",
  12. "SlotType": "Output",
  13. "ScopeAttachmentUsage": "RenderTarget",
  14. "LoadStoreAction": {
  15. "LoadAction": "Clear",
  16. "ClearValue": { // reverse depth order: closer --> 1.0
  17. "Value": [ 0.0, 0.0, 0.0, 0.0 ]
  18. },
  19. "StoreAction": "Store"
  20. }
  21. },
  22. {
  23. // This RT is MSAA - is it cheaper to avoid doing this work and only do a copy at a separate pass?
  24. "Name": "RenderTargetInputOutput",
  25. "SlotType": "Input",
  26. "ScopeAttachmentUsage": "Shader"
  27. },
  28. { // Used to get the transform from screen space to world space.
  29. "Name": "DepthLinear",
  30. "SlotType": "Input",
  31. "ScopeAttachmentUsage": "Shader"
  32. },
  33. { // Used as the thickness accumulation to block TT (back) lobe lighting
  34. "Name": "AccumulatedInverseAlpha",
  35. "SlotType": "Input",
  36. "ScopeAttachmentUsage": "Shader",
  37. "ShaderInputName": "m_accumInvAlpha"
  38. },
  39. { // For comparing the depth to early disqualify but not to write
  40. "Name": "Depth",
  41. "SlotType": "Input",
  42. "ScopeAttachmentUsage": "DepthStencil"
  43. },
  44. {
  45. "Name": "SkinnedHairSharedBuffer",
  46. "ShaderInputName": "m_skinnedHairSharedBuffer",
  47. "SlotType": "Input",
  48. "ScopeAttachmentUsage": "Shader"
  49. },
  50. //------------- Shadowing Resources -------------
  51. {
  52. "Name": "DirectionalShadowmap",
  53. "ShaderInputName": "m_directionalLightShadowmap",
  54. "SlotType": "Input",
  55. "ScopeAttachmentUsage": "Shader",
  56. "ImageViewDesc": {
  57. "IsArray": 1
  58. }
  59. },
  60. {
  61. "Name": "DirectionalESM",
  62. "ShaderInputName": "m_directionalLightExponentialShadowmap",
  63. "SlotType": "Input",
  64. "ScopeAttachmentUsage": "Shader",
  65. "ImageViewDesc": {
  66. "IsArray": 1
  67. }
  68. },
  69. {
  70. "Name": "ProjectedShadowmap",
  71. "ShaderInputName": "m_projectedShadowmaps",
  72. "SlotType": "Input",
  73. "ScopeAttachmentUsage": "Shader",
  74. "ImageViewDesc": {
  75. "IsArray": 1
  76. }
  77. },
  78. {
  79. "Name": "ProjectedESM",
  80. "ShaderInputName": "m_projectedExponentialShadowmap",
  81. "SlotType": "Input",
  82. "ScopeAttachmentUsage": "Shader",
  83. "ImageViewDesc": {
  84. "IsArray": 1
  85. }
  86. },
  87. //------------- Lighting Resources -------------
  88. {
  89. "Name": "BRDFTextureInput",
  90. "ShaderInputName": "m_brdfMap",
  91. "SlotType": "Input",
  92. "ScopeAttachmentUsage": "Shader"
  93. },
  94. {
  95. "Name": "TileLightData",
  96. "SlotType": "Input",
  97. "ShaderInputName": "m_tileLightData",
  98. "ScopeAttachmentUsage": "Shader"
  99. },
  100. {
  101. "Name": "LightListRemapped",
  102. "SlotType": "Input",
  103. "ShaderInputName": "m_lightListRemapped",
  104. "ScopeAttachmentUsage": "Shader"
  105. }
  106. ],
  107. "ImageAttachments": [
  108. {
  109. // The shader hair color render target - important to have at a non-MSAA mode
  110. // so that no overwork is done on sampling.
  111. "Name": "HairColorImage",
  112. "SizeSource": {
  113. "Source": {
  114. "Pass": "Parent",
  115. "Attachment": "RenderTargetInputOutput"
  116. }
  117. },
  118. "ImageDescriptor": {
  119. "Format": "R16G16B16A16_FLOAT",
  120. "SharedQueueMask": "Graphics",
  121. "BindFlags": [
  122. "Color",
  123. "ShaderRead"
  124. ]
  125. }
  126. },
  127. {
  128. "Name": "BRDFTexture",
  129. "Lifetime": "Imported",
  130. "AssetRef": {
  131. "FilePath": "Textures/BRDFTexture.attimage"
  132. }
  133. }
  134. ],
  135. "Connections": [
  136. {
  137. "LocalSlot": "BRDFTextureInput",
  138. "AttachmentRef": {
  139. "Pass": "This",
  140. "Attachment": "BRDFTexture"
  141. }
  142. },
  143. {
  144. "LocalSlot": "HairColorRenderTarget",
  145. "AttachmentRef": {
  146. "Pass": "This",
  147. "Attachment": "HairColorImage"
  148. }
  149. }
  150. ],
  151. "PassData": {
  152. "$type": "RasterPassData",
  153. "DrawListTag": "HairGeometryShadingDrawList",
  154. "BindViewSrg": true,
  155. "PassSrgShaderAsset": {
  156. // Looking for it in the Shaders directory relative to the Assets directory
  157. "FilePath": "Shaders/HairShortCutGeometryShading.shader"
  158. }
  159. }
  160. }
  161. }
  162. }