o3de / o3de

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.
https://o3de.org
Other
7.67k stars 2.19k forks source link

EditorStatePassSystem pipeline error #14382

Open mcphedar opened 1 year ago

mcphedar commented 1 year ago

Assets required o3de-multiplayersample

Steps to reproduce Steps to reproduce the behavior:

  1. Set up a GDRi Skybox and Global Skylight (IBL)
  2. Add a Cubemap Capture component
  3. Capture the cubemap

Expected behavior No Errors

Actual behavior These errors show up in the console

[Warning] (PassSystem) - Do not add child passes outside of build phase

[Warning] (RenderPipeline) - Add pass to render pipeline failed: can't find reference pass [PostProcessPass] in render pipeline [EnvironmentCubeMapPipeline_{0FA01793-0DD2-4888-B893-4F2881E9E7C9}]

[Error] (EditorStatePassSystem) - Add editor mode feedback parent pass to render pipeline [EnvironmentCubeMapPipeline_{0FA01793-0DD2-4888-B893-4F2881E9E7C9}] failed

Found in Branch o3de-multiplayersample development

jonawals commented 1 year ago

We have looked into this issue and the problem is that the EMVF pass that attempts to attach itself to the PostProcess pass of any pipeline that gets is added. What we would need to do is either a) exclude the env map capture pipeline form EMVF or b) have EMVF only attach to specific pipelines.

@VickyAtAZ @amzn-tommy do you have any suggestions as the least brittle way of achieving the above?

galibzon commented 1 year ago

@VickyAtAZ to comment.

VickyAtAZ commented 1 year ago

@jonawals We had similar issue with LyShine passes. And what we did is to look for the reference pass first in the function and return if it doesn't exist. void LyShineFeatureProcessor::AddRenderPasses(AZ::RPI::RenderPipeline* renderPipeline)

So for the editor state pass system, you may add this code

  void EditorStatePassSystem::AddPassesToRenderPipeline(RPI::RenderPipeline* renderPipeline)
    {
        // Only add MainPassParentTemplateName if PostProcessPass exists
        if (!renderPipeline->FindFirstPass(AZ::Name("PostProcessPass")))
        {
            return;
        }
...