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]
);
}
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:
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
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
Call these codes manually in the console
let defaultPipeline = scene.postProcessRenderPipelineManager._renderPipelines[“DefaultRenderingPipeline”];
defaultPipeline.fxaaEnabled = true;