Skip to content

N8AO ignores the EffectComposer camera and scene props #395

Closed

Description

@RaphaelFakhri

<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 otherCamera

Expected

N8AO uses the camera and scene that the EffectComposer renders with.

Version

@react-three/postprocessing 3.2.0 (current master).

Activity

  1. kvvasuu commented on Oct 19, 2026

    @kvvasuu
    Collaborator

    Fixed in #396. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions