Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/docs/content/docs/getting-started/expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ npx create-expo-app@latest -e with-webgpu

The template includes `react-native-webgpu`, Reanimated, and Metro settings compatible with Three.js WebGPU builds.

For a raw Three.js integration that imports `three/webgpu` directly, recent Expo and Metro versions can resolve that package export without a custom resolver. The template keeps additional Metro settings because it also redirects bare `three` imports and selects the standard React Three Fiber build. See the [Three.js integration guide](/docs/integrations/three-js) before copying those settings into an existing app.

For a walkthrough of the template, watch the video below.

<Video src="/videos/expo-template.mp4" />
Expand Down
8 changes: 5 additions & 3 deletions apps/docs/content/docs/integrations/three-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ Using the Three.js WebGPU backend, you can run the library on top of React Nativ

<WebGPUPlayground demo="three-js" height={280} />

## 1. Metro configuration
## 1. Import the WebGPU entry point

Three.js publishes separate WebGL and WebGPU entry points.
Metro must load `build/three.webgpu.js` when you import `three` or `three/webgpu`. See [Expo setup](/docs/getting-started/expo) for a complete Metro configuration:
With current Expo and Metro versions, importing `three/webgpu` resolves Three.js's WebGPU package export directly and does not require a custom Metro configuration.

Add a resolver override only when your setup needs one—for example, an older Metro version cannot resolve the package export, a monorepo resolves a different copy of Three.js, or a dependency imports bare `three` and must be redirected to the WebGPU build. The example app uses the following fallback because it covers those cases and React Three Fiber:

```js
// metro.config.js - resolveRequest excerpt
Expand All @@ -31,7 +33,7 @@ if (moduleName.startsWith("three/addons/")) {
}
```

Import from `three/webgpu`, not `three` (which would pull the WebGL build).
Start with an explicit import from `three/webgpu`, not `three` (which would pull the WebGL build without the optional redirect above). If that import resolves in your project, keep the default Metro configuration.

## 2. Create the renderer

Expand Down
Loading