Chromatic aberrations doesn't work when created before cameras

Hey guys, found an issue with chromatic aberrations from default pipeline

chromatic aberrations doesn’t work when pipeline was created BEFORE cameras. I assume that
when pipeline is created scene.cameras parameter is empty and chromatic aberrations don’t see cameras even if they are added after

spent a lot of time to understand why everything is working except aberrations, so i think it should be fixed to prevent losing time from others

btw depthOfField throws exception when there is no cameras

I think chromatic aberrations should throw exception too

Thanks

it is a good point. Wanna do a PR to get that in ?

Sure, but it will take time:)

I investigated problem more precisely

During investigation i found that there is not only chromatic aberrations doesn’t work without cameras but also grain, bloom (and maybe others)
It’s strange that those effects are created without cameras in pipeline constructor
image

as i understand cameras are attached during
image
method

So i think we need to throw exception during constructor of default pipeline (and i think other pipelines too) where cameras initialized from parameter or scene.cameras
image
i think after this line we chould check that cameras is not empty
if (!this.cameras.length) {
// eslint-disable-next-line no-throw-literal
throw “No camera available for default pipeline effects”;
}

the problem that i’m not sure this check should be in other pipelines
for example for SSAO2RenderingPipeline cameras also optional
image
it doesn’t have check for scene.cameras and just tries to use cameras
image
i tried to use this pipeline and it looks like it doesn’t work regardless of cameras exist or not:)

as i understand it should have some predefined posteffects but there is no changes in scene

so i think someone more qualified should check other pipelines and ensure that this cameras check should be there or not

Thanks