Explorar el Código

Minor updates to expose the prototype deferred pipeline to the Material Editor.
Depends on https://github.com/o3de/o3de/pull/13302

Signed-off-by: santorac <[email protected]>

santorac hace 2 años
padre
commit
a7c828d025

+ 13 - 0
Gem/Code/Source/AtomSampleViewerSystemComponent.cpp

@@ -121,6 +121,19 @@ namespace AtomSampleViewer
 
 
         AZ::TickBus::Handler::BusConnect();
         AZ::TickBus::Handler::BusConnect();
         CrySystemEventBus::Handler::BusConnect();
         CrySystemEventBus::Handler::BusConnect();
+
+        // Add customized pass classes
+        auto* passSystem = AZ::RPI::PassSystemInterface::Get();
+
+        // Load ASV's own pass templates mapping
+        // It can be loaded here and it doesn't need be added via OnReadyLoadTemplatesEvent::Handler
+        // since the first render pipeline is created after this point.
+        const char* asvPassTemplatesFile = "Passes/ASV/PassTemplates.azasset";
+        bool loaded = passSystem->LoadPassTemplateMappings(asvPassTemplatesFile);
+        if (!loaded)
+        {
+            AZ_Fatal("SampleComponentManager", "Failed to load AtomSampleViewer's pass templates at %s", asvPassTemplatesFile);
+        }
     }
     }
 
 
     void AtomSampleViewerSystemComponent::Deactivate()
     void AtomSampleViewerSystemComponent::Deactivate()

+ 0 - 11
Gem/Code/Source/SampleComponentManager.cpp

@@ -422,17 +422,6 @@ namespace AtomSampleViewer
         auto* passSystem = RPI::PassSystemInterface::Get();
         auto* passSystem = RPI::PassSystemInterface::Get();
         passSystem->AddPassCreator(Name("RHISamplePass"), &AtomSampleViewer::RHISamplePass::Create);
         passSystem->AddPassCreator(Name("RHISamplePass"), &AtomSampleViewer::RHISamplePass::Create);
 
 
-        // Load ASV's own pass templates mapping
-        // It can be loaded here and it doesn't need be added via OnReadyLoadTemplatesEvent::Handler
-        // since the first render pipeline is created after this point.
-        const char* asvPassTemplatesFile = "Passes/ASV/PassTemplates.azasset";
-        bool loaded = passSystem->LoadPassTemplateMappings(asvPassTemplatesFile);
-        if (!loaded)
-        {
-            AZ_Fatal("SampleComponentManager", "Failed to load AtomSampleViewer's pass templates at %s", asvPassTemplatesFile);
-            return;
-        }
-
         // Use scene and render pipeline for RHI samples as default scene and render pipeline
         // Use scene and render pipeline for RHI samples as default scene and render pipeline
         CreateSceneForRHISample();
         CreateSceneForRHISample();
 
 

+ 16 - 0
Passes/PrototypeDeferredPipeline/DeferredRenderPipeline.azasset

@@ -0,0 +1,16 @@
+{
+    "Type": "JsonSerialization",
+    "Version": 1,
+    "ClassName": "RenderPipelineDescriptor",
+    "ClassData": {
+        "Name": "DeferredPipeline",
+        "MainViewTag": "MainCamera",
+        "RootPassTemplate": "DeferredPipelineTemplate",
+        "AllowModification": true,
+        "RenderSettings": {
+            "MultisampleState": {
+                "samples": 4
+            }
+        }
+    }
+}