CommonSystemComponent.cpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <CommonSystemComponent.h>
  9. #include <Material/UseTextureFunctor.h>
  10. #include <Material/SubsurfaceTransmissionParameterFunctor.h>
  11. #include <Material/Transform2DFunctor.h>
  12. #include <Material/ConvertEmissiveUnitFunctor.h>
  13. #include <AzCore/Serialization/SerializeContext.h>
  14. #include <AzCore/Serialization/EditContext.h>
  15. #include <AzCore/Serialization/EditContextConstants.inl>
  16. #include <LookupTable/LookupTableAsset.h>
  17. #include <ReflectionProbe/ReflectionProbeFeatureProcessor.h>
  18. #include <SpecularReflections/SpecularReflectionsFeatureProcessor.h>
  19. #include <TransformService/TransformServiceFeatureProcessor.h>
  20. #include <CubeMapCapture/CubeMapCaptureFeatureProcessor.h>
  21. #include <ImageBasedLights/ImageBasedLightFeatureProcessor.h>
  22. #include <DisplayMapper/AcesOutputTransformLutPass.h>
  23. #include <DisplayMapper/AcesOutputTransformPass.h>
  24. #include <DisplayMapper/ApplyShaperLookupTablePass.h>
  25. #include <DisplayMapper/BakeAcesOutputTransformLutPass.h>
  26. #include <DisplayMapper/DisplayMapperPass.h>
  27. #include <DisplayMapper/DisplayMapperFullScreenPass.h>
  28. #include <DisplayMapper/OutputTransformPass.h>
  29. #include <Atom/Feature/DisplayMapper/DisplayMapperConfigurationDescriptor.h>
  30. #include <Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h>
  31. #include <Atom/Feature/LightingChannel/LightingChannelConfiguration.h>
  32. #include <Atom/Feature/RayTracing/RayTracingPass.h>
  33. #include <Atom/Feature/RayTracing/RayTracingPassData.h>
  34. #include <Atom/Feature/SplashScreen/SplashScreenSettings.h>
  35. #include <Atom/Feature/Utils/LightingPreset.h>
  36. #include <Atom/Feature/Utils/ModelPreset.h>
  37. #include <Atom/Feature/SkyBox/SkyBoxFogSettings.h>
  38. #include <AuxGeom/AuxGeomFeatureProcessor.h>
  39. #include <ColorGrading/LutGenerationPass.h>
  40. #include <Debug/RayTracingDebugFeatureProcessor.h>
  41. #include <Debug/RenderDebugFeatureProcessor.h>
  42. #include <Mesh/MeshFeatureProcessor.h>
  43. #include <Silhouette/SilhouetteFeatureProcessor.h>
  44. #include <Silhouette/SilhouetteCompositePass.h>
  45. #include <PostProcess/PostProcessFeatureProcessor.h>
  46. #include <PostProcessing/BlendColorGradingLutsPass.h>
  47. #include <PostProcessing/BloomParentPass.h>
  48. #include <PostProcessing/HDRColorGradingPass.h>
  49. #include <PostProcessing/DepthUpsamplePass.h>
  50. #include <PostProcessing/DepthOfFieldCompositePass.h>
  51. #include <PostProcessing/DepthOfFieldBokehBlurPass.h>
  52. #include <PostProcessing/DepthOfFieldMaskPass.h>
  53. #include <PostProcessing/DepthOfFieldParentPass.h>
  54. #include <PostProcessing/DepthOfFieldReadBackFocusDepthPass.h>
  55. #include <PostProcessing/DepthOfFieldWriteFocusDepthFromGpuPass.h>
  56. #include <PostProcessing/NewDepthOfFieldPasses.h>
  57. #include <PostProcessing/EyeAdaptationPass.h>
  58. #include <PostProcessing/LuminanceHistogramGeneratorPass.h>
  59. #include <PostProcessing/FastDepthAwareBlurPasses.h>
  60. #include <PostProcessing/LookModificationCompositePass.h>
  61. #include <PostProcessing/LookModificationTransformPass.h>
  62. #include <PostProcessing/SMAAFeatureProcessor.h>
  63. #include <PostProcessing/SMAAEdgeDetectionPass.h>
  64. #include <PostProcessing/SMAABlendingWeightCalculationPass.h>
  65. #include <PostProcessing/SMAANeighborhoodBlendingPass.h>
  66. #include <PostProcessing/SsaoPasses.h>
  67. #include <PostProcessing/SubsurfaceScatteringPass.h>
  68. #include <PostProcessing/TaaPass.h>
  69. #include <PostProcessing/BloomDownsamplePass.h>
  70. #include <PostProcessing/BloomBlurPass.h>
  71. #include <PostProcessing/BloomCompositePass.h>
  72. #include <PostProcessing/ChromaticAberrationPass.h>
  73. #include <PostProcessing/PaniniProjectionPass.h>
  74. #include <PostProcessing/FilmGrainPass.h>
  75. #include <PostProcessing/WhiteBalancePass.h>
  76. #include <PostProcessing/VignettePass.h>
  77. #include <RayTracing/RayTracingFeatureProcessor.h>
  78. #include <ScreenSpace/DeferredFogPass.h>
  79. #include <Shadows/ProjectedShadowFeatureProcessor.h>
  80. #include <SkyAtmosphere/SkyAtmosphereFeatureProcessor.h>
  81. #include <SkyAtmosphere/SkyAtmosphereParentPass.h>
  82. #include <SkyBox/SkyBoxFeatureProcessor.h>
  83. #include <SplashScreen/SplashScreenFeatureProcessor.h>
  84. #include <SplashScreen/SplashScreenPass.h>
  85. #include <Atom/RPI.Public/Pass/PassSystemInterface.h>
  86. #include <Checkerboard/CheckerboardPass.h>
  87. #include <Checkerboard/CheckerboardColorResolvePass.h>
  88. #include <CoreLights/LightCullingTilePreparePass.h>
  89. #include <CoreLights/LightCullingPass.h>
  90. #include <Shadows/FullscreenShadowPass.h>
  91. #include <CoreLights/LightCullingRemap.h>
  92. #include <Decals/DecalTextureArrayFeatureProcessor.h>
  93. #include <ImGui/ImGuiPass.h>
  94. #include <RayTracing/RayTracingAccelerationStructurePass.h>
  95. #include <ReflectionScreenSpace/ReflectionScreenSpacePass.h>
  96. #include <ReflectionScreenSpace/ReflectionScreenSpaceTracePass.h>
  97. #include <ReflectionScreenSpace/ReflectionScreenSpaceDownsampleDepthLinearPass.h>
  98. #include <ReflectionScreenSpace/ReflectionScreenSpaceDownsampleDepthLinearChildPass.h>
  99. #include <ReflectionScreenSpace/ReflectionScreenSpaceBlurPass.h>
  100. #include <ReflectionScreenSpace/ReflectionScreenSpaceBlurChildPass.h>
  101. #include <ReflectionScreenSpace/ReflectionScreenSpaceFilterPass.h>
  102. #include <ReflectionScreenSpace/ReflectionScreenSpaceCompositePass.h>
  103. #include <ReflectionScreenSpace/ReflectionCopyFrameBufferPass.h>
  104. #include <OcclusionCullingPlane/OcclusionCullingPlaneFeatureProcessor.h>
  105. #include <Mesh/ModelReloaderSystem.h>
  106. namespace AZ
  107. {
  108. namespace Render
  109. {
  110. CommonSystemComponent::CommonSystemComponent() = default;
  111. CommonSystemComponent::~CommonSystemComponent() = default;
  112. void CommonSystemComponent::Reflect(ReflectContext* context)
  113. {
  114. AuxGeomFeatureProcessor::Reflect(context);
  115. TransformServiceFeatureProcessor::Reflect(context);
  116. ProjectedShadowFeatureProcessor::Reflect(context);
  117. SkyAtmosphereFeatureProcessor::Reflect(context);
  118. SkyBoxFeatureProcessor::Reflect(context);
  119. SkyBoxFogSettings::Reflect(context);
  120. UseTextureFunctor::Reflect(context);
  121. SubsurfaceTransmissionParameterFunctor::Reflect(context);
  122. Transform2DFunctor::Reflect(context);
  123. MeshFeatureProcessor::Reflect(context);
  124. ImageBasedLightFeatureProcessor::Reflect(context);
  125. AcesDisplayMapperFeatureProcessor::Reflect(context);
  126. DisplayMapperConfigurationDescriptor::Reflect(context);
  127. DisplayMapperPassData::Reflect(context);
  128. ConvertEmissiveUnitFunctor::Reflect(context);
  129. LookupTableAsset::Reflect(context);
  130. ReflectionProbeFeatureProcessor::Reflect(context);
  131. SpecularReflectionsFeatureProcessor::Reflect(context);
  132. CubeMapCaptureFeatureProcessor::Reflect(context);
  133. DecalTextureArrayFeatureProcessor::Reflect(context);
  134. SMAAFeatureProcessor::Reflect(context);
  135. SilhouetteFeatureProcessor::Reflect(context);
  136. PostProcessFeatureProcessor::Reflect(context);
  137. ImGuiPassData::Reflect(context);
  138. RayTracingPassData::Reflect(context);
  139. TaaPassData::Reflect(context);
  140. RayTracingDebugFeatureProcessor::Reflect(context);
  141. RenderDebugFeatureProcessor::Reflect(context);
  142. SplashScreenFeatureProcessor::Reflect(context);
  143. SplashScreenSettings::Reflect(context);
  144. LightingPreset::Reflect(context);
  145. ModelPreset::Reflect(context);
  146. RayTracingFeatureProcessor::Reflect(context);
  147. OcclusionCullingPlaneFeatureProcessor::Reflect(context);
  148. LightingChannelConfiguration::Reflect(context);
  149. if (SerializeContext* serialize = azrtti_cast<SerializeContext*>(context))
  150. {
  151. serialize->Class<CommonSystemComponent, Component>()
  152. ->Version(0);
  153. if (AZ::EditContext* ec = serialize->GetEditContext())
  154. {
  155. ec->Class<CommonSystemComponent>("CommonSystemComponent", "System Component for common render features")
  156. ->ClassElement(Edit::ClassElements::EditorData, "")
  157. ->Attribute(Edit::Attributes::AutoExpand, true)
  158. ;
  159. }
  160. }
  161. }
  162. void CommonSystemComponent::GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided)
  163. {
  164. provided.push_back(AZ_CRC_CE("CommonService"));
  165. }
  166. void CommonSystemComponent::GetIncompatibleServices(ComponentDescriptor::DependencyArrayType& incompatible)
  167. {
  168. incompatible.push_back(AZ_CRC_CE("CommonService"));
  169. }
  170. void CommonSystemComponent::GetRequiredServices(ComponentDescriptor::DependencyArrayType& required)
  171. {
  172. required.push_back(AZ_CRC_CE("RPISystem"));
  173. }
  174. void CommonSystemComponent::GetDependentServices(ComponentDescriptor::DependencyArrayType& dependent)
  175. {
  176. AZ_UNUSED(dependent);
  177. }
  178. void CommonSystemComponent::Init()
  179. {
  180. }
  181. void CommonSystemComponent::Activate()
  182. {
  183. AZ::ApplicationTypeQuery appType;
  184. ComponentApplicationBus::Broadcast(&AZ::ComponentApplicationBus::Events::QueryApplicationType, appType);
  185. if (!appType.IsHeadless())
  186. {
  187. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<SkyAtmosphereFeatureProcessor, SkyAtmosphereFeatureProcessorInterface>();
  188. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<SkyBoxFeatureProcessor, SkyBoxFeatureProcessorInterface>();
  189. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<ImageBasedLightFeatureProcessor, ImageBasedLightFeatureProcessorInterface>();
  190. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<DecalTextureArrayFeatureProcessor, DecalFeatureProcessorInterface>();
  191. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<PostProcessFeatureProcessor, PostProcessFeatureProcessorInterface>();
  192. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<AcesDisplayMapperFeatureProcessor, DisplayMapperFeatureProcessorInterface>();
  193. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<ProjectedShadowFeatureProcessor, ProjectedShadowFeatureProcessorInterface>();
  194. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<RayTracingDebugFeatureProcessor, RayTracingDebugFeatureProcessorInterface>();
  195. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<RenderDebugFeatureProcessor, RenderDebugFeatureProcessorInterface>();
  196. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<ReflectionProbeFeatureProcessor, ReflectionProbeFeatureProcessorInterface>();
  197. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<SpecularReflectionsFeatureProcessor, SpecularReflectionsFeatureProcessorInterface>();
  198. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<CubeMapCaptureFeatureProcessor, CubeMapCaptureFeatureProcessorInterface>();
  199. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<SMAAFeatureProcessor>();
  200. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<RayTracingFeatureProcessor, RayTracingFeatureProcessorInterface>();
  201. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<OcclusionCullingPlaneFeatureProcessor, OcclusionCullingPlaneFeatureProcessorInterface>();
  202. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<SplashScreenFeatureProcessor>();
  203. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<SilhouetteFeatureProcessor>();
  204. }
  205. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<AuxGeomFeatureProcessor, RPI::AuxGeomFeatureProcessorInterface>();
  206. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<TransformServiceFeatureProcessor, TransformServiceFeatureProcessorInterface>();
  207. AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface<MeshFeatureProcessor, MeshFeatureProcessorInterface>();
  208. auto* passSystem = RPI::PassSystemInterface::Get();
  209. AZ_Assert(passSystem, "Cannot get the pass system.");
  210. // Add Sky Atmosphere Parent pass
  211. passSystem->AddPassCreator(Name("SkyAtmosphereParentPass"), &SkyAtmosphereParentPass::Create);
  212. // Add DisplayMapper pass
  213. passSystem->AddPassCreator(Name("AcesOutputTransformLutPass"), &AcesOutputTransformLutPass::Create);
  214. passSystem->AddPassCreator(Name("AcesOutputTransformPass"), &AcesOutputTransformPass::Create);
  215. passSystem->AddPassCreator(Name("ApplyShaperLookupTablePass"), &ApplyShaperLookupTablePass::Create);
  216. passSystem->AddPassCreator(Name("BakeAcesOutputTransformLutPass"), &BakeAcesOutputTransformLutPass::Create);
  217. passSystem->AddPassCreator(Name("DisplayMapperPass"), &DisplayMapperPass::Create);
  218. passSystem->AddPassCreator(Name("DisplayMapperFullScreenPass"), &DisplayMapperFullScreenPass::Create);
  219. passSystem->AddPassCreator(Name("OutputTransformPass"), &OutputTransformPass::Create);
  220. passSystem->AddPassCreator(Name("EyeAdaptationPass"), &EyeAdaptationPass::Create);
  221. passSystem->AddPassCreator(Name("ImGuiPass"), &ImGuiPass::Create);
  222. passSystem->AddPassCreator(Name("LightCullingPass"), &LightCullingPass::Create);
  223. passSystem->AddPassCreator(Name("LightCullingRemapPass"), &LightCullingRemap::Create);
  224. passSystem->AddPassCreator(Name("LightCullingTilePreparePass"), &LightCullingTilePreparePass::Create);
  225. passSystem->AddPassCreator(Name("BlendColorGradingLutsPass"), &BlendColorGradingLutsPass::Create);
  226. passSystem->AddPassCreator(Name("HDRColorGradingPass"), &HDRColorGradingPass::Create);
  227. passSystem->AddPassCreator(Name("FullscreenShadowPass"), &FullscreenShadowPass::Create);
  228. passSystem->AddPassCreator(Name("LookModificationCompositePass"), &LookModificationCompositePass::Create);
  229. passSystem->AddPassCreator(Name("LookModificationTransformPass"), &LookModificationPass::Create);
  230. passSystem->AddPassCreator(Name("LutGenerationPass"), &LutGenerationPass::Create);
  231. passSystem->AddPassCreator(Name("SMAAEdgeDetectionPass"), &SMAAEdgeDetectionPass::Create);
  232. passSystem->AddPassCreator(Name("SMAABlendingWeightCalculationPass"), &SMAABlendingWeightCalculationPass::Create);
  233. passSystem->AddPassCreator(Name("SMAANeighborhoodBlendingPass"), &SMAANeighborhoodBlendingPass::Create);
  234. // Add Depth Downsample/Upsample passes
  235. passSystem->AddPassCreator(Name("DepthUpsamplePass"), &DepthUpsamplePass::Create);
  236. // Add Taa Pass
  237. passSystem->AddPassCreator(Name("TaaPass"), &TaaPass::Create);
  238. // Add DepthOfField pass
  239. passSystem->AddPassCreator(Name("DepthOfFieldCompositePass"), &DepthOfFieldCompositePass::Create);
  240. passSystem->AddPassCreator(Name("DepthOfFieldBokehBlurPass"), &DepthOfFieldBokehBlurPass::Create);
  241. passSystem->AddPassCreator(Name("DepthOfFieldMaskPass"), &DepthOfFieldMaskPass::Create);
  242. passSystem->AddPassCreator(Name("DepthOfFieldParentPass"), &DepthOfFieldParentPass::Create);
  243. passSystem->AddPassCreator(Name("DepthOfFieldReadBackFocusDepthPass"), &DepthOfFieldReadBackFocusDepthPass::Create);
  244. passSystem->AddPassCreator(Name("DepthOfFieldWriteFocusDepthFromGpuPass"), &DepthOfFieldWriteFocusDepthFromGpuPass::Create);
  245. passSystem->AddPassCreator(Name("NewDepthOfFieldParentPass"), &NewDepthOfFieldParentPass::Create);
  246. passSystem->AddPassCreator(Name("NewDepthOfFieldTileReducePass"), &NewDepthOfFieldTileReducePass::Create);
  247. passSystem->AddPassCreator(Name("NewDepthOfFieldFilterPass"), &NewDepthOfFieldFilterPass::Create);
  248. // Add FastDepthAwareBlur passes
  249. passSystem->AddPassCreator(Name("FastDepthAwareBlurHorPass"), &FastDepthAwareBlurHorPass::Create);
  250. passSystem->AddPassCreator(Name("FastDepthAwareBlurVerPass"), &FastDepthAwareBlurVerPass::Create);
  251. // Add SSAO passes
  252. passSystem->AddPassCreator(Name("SsaoParentPass"), &SsaoParentPass::Create);
  253. passSystem->AddPassCreator(Name("SsaoComputePass"), &SsaoComputePass::Create);
  254. // Add Subsurface Scattering pass
  255. passSystem->AddPassCreator(Name("SubsurfaceScatteringPass"), &RPI::SubsurfaceScatteringPass::Create);
  256. // Add checkerboard rendering passes
  257. passSystem->AddPassCreator(Name("CheckerboardPass"), &Render::CheckerboardPass::Create);
  258. passSystem->AddPassCreator(Name("CheckerboardColorResolvePass"), &Render::CheckerboardColorResolvePass::Create);
  259. // Add bloom passes
  260. passSystem->AddPassCreator(Name("BloomParentPass"), &BloomParentPass::Create);
  261. passSystem->AddPassCreator(Name("BloomDownsamplePass"), &BloomDownsamplePass::Create);
  262. passSystem->AddPassCreator(Name("BloomBlurPass"), &BloomBlurPass::Create);
  263. passSystem->AddPassCreator(Name("BloomCompositePass"), &BloomCompositePass::Create);
  264. // Add Chromatic Aberration
  265. passSystem->AddPassCreator(Name("ChromaticAberrationPass"), &ChromaticAberrationPass::Create);
  266. // Add Panini Projection
  267. passSystem->AddPassCreator(Name("PaniniProjectionPass"), &PaniniProjectionPass::Create);
  268. // Add Film Grain
  269. passSystem->AddPassCreator(Name("FilmGrainPass"), &FilmGrainPass::Create);
  270. // Add White Balance pass
  271. passSystem->AddPassCreator(Name("WhiteBalancePass"), &WhiteBalancePass::Create);
  272. // Add Vignette
  273. passSystem->AddPassCreator(Name("VignettePass"), &VignettePass::Create);
  274. // Add Luminance Histogram pass
  275. passSystem->AddPassCreator(Name("LuminanceHistogramGeneratorPass"), &LuminanceHistogramGeneratorPass::Create);
  276. // Deferred Fog
  277. passSystem->AddPassCreator(Name("DeferredFogPass"), &DeferredFogPass::Create);
  278. // Add SilhouetteComposite pass
  279. passSystem->AddPassCreator(Name("SilhouetteCompositePass"), &SilhouetteCompositePass::Create);
  280. // Add Reflection passes
  281. passSystem->AddPassCreator(Name("ReflectionScreenSpacePass"), &Render::ReflectionScreenSpacePass::Create);
  282. passSystem->AddPassCreator(Name("ReflectionScreenSpaceTracePass"), &Render::ReflectionScreenSpaceTracePass::Create);
  283. passSystem->AddPassCreator(Name("ReflectionScreenSpaceDownsampleDepthLinearPass"), &Render::ReflectionScreenSpaceDownsampleDepthLinearPass::Create);
  284. passSystem->AddPassCreator(Name("ReflectionScreenSpaceDownsampleDepthLinearChildPass"), &Render::ReflectionScreenSpaceDownsampleDepthLinearChildPass::Create);
  285. passSystem->AddPassCreator(Name("ReflectionScreenSpaceBlurPass"), &Render::ReflectionScreenSpaceBlurPass::Create);
  286. passSystem->AddPassCreator(Name("ReflectionScreenSpaceBlurChildPass"), &Render::ReflectionScreenSpaceBlurChildPass::Create);
  287. passSystem->AddPassCreator(Name("ReflectionScreenSpaceFilterPass"), &Render::ReflectionScreenSpaceFilterPass::Create);
  288. passSystem->AddPassCreator(Name("ReflectionScreenSpaceCompositePass"), &Render::ReflectionScreenSpaceCompositePass::Create);
  289. passSystem->AddPassCreator(Name("ReflectionCopyFrameBufferPass"), &Render::ReflectionCopyFrameBufferPass::Create);
  290. // Add RayTracing passes
  291. passSystem->AddPassCreator(Name("RayTracingAccelerationStructurePass"), &Render::RayTracingAccelerationStructurePass::Create);
  292. passSystem->AddPassCreator(Name("RayTracingPass"), &Render::RayTracingPass::Create);
  293. // Add splash screen pass
  294. passSystem->AddPassCreator(Name("SplashScreenPass"), &Render::SplashScreenPass::Create);
  295. // setup handler for load pass template mappings
  296. m_loadTemplatesHandler = RPI::PassSystemInterface::OnReadyLoadTemplatesEvent::Handler([this]() { this->LoadPassTemplateMappings(); });
  297. RPI::PassSystemInterface::Get()->ConnectEvent(m_loadTemplatesHandler);
  298. m_modelReloaderSystem = AZStd::make_unique<ModelReloaderSystem>();
  299. }
  300. void CommonSystemComponent::Deactivate()
  301. {
  302. m_modelReloaderSystem.reset();
  303. m_loadTemplatesHandler.Disconnect();
  304. AZ::ApplicationTypeQuery appType;
  305. ComponentApplicationBus::Broadcast(&AZ::ComponentApplicationBus::Events::QueryApplicationType, appType);
  306. if (!appType.IsHeadless())
  307. {
  308. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<RayTracingFeatureProcessor>();
  309. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<SMAAFeatureProcessor>();
  310. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<ReflectionProbeFeatureProcessor>();
  311. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<SpecularReflectionsFeatureProcessor>();
  312. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<CubeMapCaptureFeatureProcessor>();
  313. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<ProjectedShadowFeatureProcessor>();
  314. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<AcesDisplayMapperFeatureProcessor>();
  315. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<PostProcessFeatureProcessor>();
  316. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<DecalTextureArrayFeatureProcessor>();
  317. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<ImageBasedLightFeatureProcessor>();
  318. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<SkyBoxFeatureProcessor>();
  319. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<SkyAtmosphereFeatureProcessor>();
  320. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<OcclusionCullingPlaneFeatureProcessor>();
  321. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<RayTracingDebugFeatureProcessor>();
  322. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<RenderDebugFeatureProcessor>();
  323. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<SplashScreenFeatureProcessor>();
  324. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<SilhouetteFeatureProcessor>();
  325. }
  326. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<MeshFeatureProcessor>();
  327. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<TransformServiceFeatureProcessor>();
  328. AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<AuxGeomFeatureProcessor>();
  329. }
  330. void CommonSystemComponent::LoadPassTemplateMappings()
  331. {
  332. const char* passTemplatesFile = "Passes/PassTemplates.azasset";
  333. RPI::PassSystemInterface::Get()->LoadPassTemplateMappings(passTemplatesFile);
  334. }
  335. } // namespace Render
  336. } // namespace AZ