Closed
Description
<N8AO> builds its N8AOPostPass from useThree()'s camera and scene instead of EffectComposerContext. When <EffectComposer camera={...} scene={...}> uses a camera or scene other than the canvas defaults, the composer renders depth from one camera while N8AO reconstructs positions with the other, so the ambient occlusion is misplaced. Changing the composer's camera prop does not update N8AO either.
Other effects (LensFlare, Outline, SelectiveBloom, GodRays, DepthOfField) and useDepthPicking already read the camera from EffectComposerContext.
Reproduction
const ref = createRef()
<EffectComposer camera={otherCamera} scene={otherScene}>
<N8AO ref={ref} />
</EffectComposer>
// ref.current.camera is the default canvas camera, not otherCameraExpected
N8AO uses the camera and scene that the EffectComposer renders with.
Version
@react-three/postprocessing 3.2.0 (current master).
Metadata
Metadata
Assignees
Labels
No labels
Activity
kvvasuu commentedon Oct 19, 2026
Fixed in #396. Thank you.