so if I add ssao2 via the inspector and tweak the numbers , all looks good.
Then when trying to add that same ssao via code now , using all the same numbers … it doesnt look the same , far to weak … almost not there.
The only number not visible now to me are the ratios eg :
var 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,
};
I tried omiting this argument but then it bombs
my full ssao2 function if you interested :
function setSSAO2(state) {
if (state === true) {
if (SSAO2RenderingPipeline.IsSupported) {
// Create SSAO and configure all properties (for the example)
var 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,
};
SSAOPipeline = new SSAO2RenderingPipeline("ssao", scene, ssaoRatio);
SSAOPipeline.radius = 0.2;
SSAOPipeline.totalStrength = 1;
SSAOPipeline.base = 0;
SSAOPipeline.expensiveBlur = true;
SSAOPipeline.samples = 16;
SSAOPipeline.maxZ = 100;
SSAOPipeline.minZAspect = 0.2;
// Attach camera to the SSAO render pipeline
scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline("ssao", camera);
scene.postProcessRenderPipelineManager.enableEffectInPipeline(
"ssao",
SSAOPipeline.SSAOCombineRenderEffect,
camera
);
//fix for ssao affecting transparent objects
scene.enableGeometryBufferRenderer().renderTransparentMeshes = false;
}
} else {
if (SSAOPipeline !== null && SSAOPipeline !== undefined) {
SSAOPipeline.dispose();
}
}
}