Skip to content

Ambient Occlusion (N8AO) not working on React Native #339

Closed as not planned

Description

@yannis-winzana

Hello, I have a problem using N8AO in my React Native project.

Describe the bug :
The N8AO ambient occlusion effect is not functioning properly when using react-postprocessing in a React Native environment. The effect appears to rendering incorrectly and completly freezing the canvas.

Environment :
"@react-three/postprocessing": "^2.19.1"
"react": "18.2.0",
"react-native": "0.74.5",
"@react-three/fiber": "^8.18.0"
"expo": "^51.0.0",
"expo-gl": "~14.0.2",
"three": "^0.168.0"
Platform: iOS
Device: iPad 3

Example code :

import { EffectComposer, N8AO, ToneMapping } from "@react-three/postprocessing";

<EffectComposer>
  <N8AO />
</EffectComposer>

Expected behavior :

The N8AO effect should render ambient occlusion shadows properly, enhancing the depth perception of 3D objects in the scene.

Additional Information

I have tested this on web and it's working fine.
I tried to test this with all most recent versions in a new projet and it's not working too but this time because of an error message throwed. Error: Exception in HostFunction: EXGL: renderbufferStorageMultisample() isn't implemented yet!, js engine: hermes
I've tried using SSAO and GTAO too, but they don't work either.

Steps to Reproduce :

Create a React Native project with @react-three/fiber
Install react-postprocessing
Add N8AO effect to EffectComposer
Observe that ambient occlusion is not visible

Would appreciate any guidance or workarounds for implementing ambient occlusion in React Native environments.

Thanking you in advance

Activity

  1. yannis-winzana commented on Sep 18, 2025

    @yannis-winzana
    Author

    any idea on this ?

  2. cubevis commented on Jan 1, 2026

    @cubevis

    Same issue

  3. kvvasuu commented on Jul 30, 2026

    @kvvasuu
    Member

    Old thread, but it's still open and worth closing out properly: this isn't a bug in N8AO (or SSAO/GTAO) - it's EffectComposer's default multisampling setting.

    EffectComposer defaults to multisampling={8}. On WebGL2 that means creating a multisampled render target, which requires gl.renderbufferStorageMultisample. expo-gl reports as a WebGL2 context but doesn't actually implement that method - so instead of silently not multisampling, it throws, and the exception takes the whole app down. Nothing specific to N8AO is involved; any effect running through the composer's default pipeline hits the same crash, which is why SSAO/GTAO break for you too.

    Fix: set multisampling={0} on the composer.

    <EffectComposer multisampling={0}>
      <N8AO />
    </EffectComposer>

    Confirmed with a repro: N8AO on Android emulator, same expo-gl/RN stack as this issue. multisampling={8} → crash on first frame. multisampling={0} → renders fine, AO visible at contact points, every time.
    Also tested with other effects - same result.

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