Skip to content

MeshPortalMaterial incompatible with React Native #2525

@jorgenbuilder

Description

@jorgenbuilder
  • three version: 0.179.1
  • @react-three/fiber version: 9.3.0
  • @react-three/drei version: 10.7.4
  • node version: 20.17.0
  • npm (or yarn) version: 11.5.2

Problem description:

Attempting to use <MeshPortalMaterial /> in an Expo / React Native app breaks and throws the following error:

Error: Exception in HostFunction: EXGL: renderbufferStorageMultisample() isn't implemented yet!, js engine: hermes

This seems to occur because expo-gl does not implement multisampling? By recreating an isolated example, I can see that setting samples: 0 on the underlying frame buffer object resolves this error, i.e.:

const rt = useFBO(512, 512, {
  samples: 0,
});
// Works!

const rt = useFBO(512, 512, {
  samples: 2,
  depthBuffer: true,
});
// Error: renderbufferStorageMultisample() isn't implemented yet!

Relevant code:

I have not included a sandbox because the error behaviour relies on the expo bundler.

Suggested solution:

Update @react-three/drei/native so that it disables multisampling instead of simply returning the core module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnativeIssues and Items related to react-native. NOTE: Native doesn't play well with 3d.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions