Enable ssao2 scene render notify error

Enable SSAO2 post-processing, prompt information when rendering the scene

code:

let ssaoRatio = {
                ssaoRatio: 1, // Ratio of the SSAO post-process, in a lower resolution
                blurRatio: 0.5, // Ratio of the combine post-process (combines the SSAO and the scene)
                combineRatio: 1,
            };

            ssao2 = new SSAO2RenderingPipeline("SSAO2RenderingPipeline", scene, ssaoRatio);
            // set 1,super jagged,set 4 resample;
            if (ssao2?._prePassRenderer) {
                ssao2._prePassRenderer.samples = 4;
            }
        }

        // Attach camera to the SSAO render pipeline  
        if (scene?.postProcessRenderPipelineManager?.attachCamerasToRenderPipeline) {
            scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(
                "SSAO2RenderingPipeline",
                [scene.activeCamera]
            );
        }

when scene.render
prompt this error

It does work for me in this PG:

Can you provide a repro in the Playground?

I created an example, press f12 to open the console, click the 1 and 3 keyboard key repeatedly, and if you click several times, an error will be reported. This problem is not raised by me before.
It is estimated that after this problem is solved, the code continues to execute to reproduce the problem I mentioned before.
1 or 3 repeat several times

The repeated alternation between 1 and 3 works. It fails if you hit the 1 (or 3) twice in a row, because the PG does not take this into account. A simple solution:

1 Like

Thank you for answering this question
At present, this problem has seriously affected our project development. Please add an if judgment to deal with the abnormal problem and ensure the normal loading of the scene.

When the full-screen reflective is used in combination with SSAO2, there will be false shadows
This problem can be reproduced by first turning on the full screen floodlight and then turning on SSAO2
There is currently no PG post-addition

Do you mean using SSR (“full-screen reflective”) and SSAO2 together does not work?

It does work in this PG:

If you can provide a repro in the Playground, it will be easier to help.

I can’t make a case for the above problem, because my problem appears in the project, and the operation is more complicated
I did a case of a similar operation, but the result was different from what I expected. You can see what is going on here.
I’ll try to make a case for this problem, looking forward to it


Modify the parameter scene does not change

first createSSAO2();
second createDefaultPipeline();
The result is different from the above

I made a new example

Call these codes manually in the console
let defaultPipeline = scene.postProcessRenderPipelineManager._renderPipelines[“DefaultRenderingPipeline”];
defaultPipeline.fxaaEnabled = true;

I’m going to have a look at it asap.

This PR will fix the problem:

1 Like

Thanks.