Skip to content

Releases: pmndrs/react-three-fiber

v9.6.1

28 Apr 20:05

Choose a tag to compare

What's Changed

  • fix: Seamlessly transfer interactivity state when swapping instances (#3743) by @notrabs in #3744

Full Changelog: v9.6.0...v9.6.1

v9.6.0 - Sunset X

13 Apr 17:46
877c839

Choose a tag to compare

Ever tried using <shaderMaterial uniforms={{ time: { value: time } }} /> and ran into immediate issues with desync? No more.

The uniforms objects on ShaderMaterial and its derivatives now have a stable reference. Objects passed into uniforms will instead copy into it. This is the same as behavior for math structures that have copy such as position, rotation, quaternion, etc. and ends up simplifying using the raw JSX where utilities were often introduced before.

Why does this matter?

  1. Improves HMR. Even if you memoize the uniforms object it will still regenerate and desync Three. Now this won't happen. But also it makes compatibility with React compiler more complete with its auto-memoization.

  2. Allows for inline uniform props and even prop uniforms directly on the material piercing.

<shaderMaterial
  vertexShader={vertexShader}
  fragmentShader={fragmentShader}
  // The uniforms object has a stable reference so objects can be safely merged in
  uniforms={{ 
    uTime: { value: 0 }, 
    uColor: { value: new THREE.Color('hotpink') } 
  }}
  // Individual uniforms can also be safely updated with pierce notation
  uniforms-uColor-value={hovered ? 'royalblue' : 'hotpink'}
/>

Documentation can be found here: https://r3f.docs.pmnd.rs/api/objects#shader-material-uniforms

And an example can be found here: https://github.com/pmndrs/react-three-fiber/blob/master/example/src/demos/ShaderMaterial.tsx

What's Changed

New Contributors

Full Changelog: v9.5.0...v9.6.0

v10.0.0-alpha.1

17 Jan 22:13

Choose a tag to compare

v10.0.0-alpha.1 Pre-release
Pre-release

A New Era

R3F v10 has been a long time coming. We have talked over plans for years but late last year @DennisSmolek took the initiative do it all himself. We now have an alpha release, along with an alpha release of Drei 11. You can try it out today.

npm install @react-three/fiber@alpha

We were so excited to get this out we forgot to make a release for alpha.0 and alpha.1 is already upon us. But let's quickly get you caught up on what you can expect to be new.

  • R3F now supports the WebGLRenderer and WebGPURenderer. This means state.gl is now state.renderer.
  • There is a new scheduler, allowing for useFrame to have advanced scheduling and also allows for it to be used outside of <Canvas />. Read more here: Frame Loop Overview.
  • WebGPU and TSL is first-class, with new built-ins just for working with TSL: useUniforms, useNodes, useLocalNodes and usePostProcessing. Read more here: WebGPU Hook Overview.

And for a more in-depth introduction check out the migration guide.

Alpha 1

And now comes alpha.1 with bug fixes, documentation updates, and several important feature unlocks.

Rendering

  • Camera frustum access for in-frame spatial queries.
  • Visibility lifecycle events: Visible, Framed, and Occluded.
  • Cameras are now part of the scene graph. Children of a camera will render correctly, enabling camera-attached objects by default.
  • Renderer-independent render targets, similar to useFBO, without needing to branch on the active renderer.

Scheduler

  • The scheduler no longer depends on R3F and can run standalone.
  • Scheduler context can now be shared outside the R3F tree, allowing external UIs or systems to participate in the frame loop while correctly waiting on the root set.

Documentation

  • New v10 features documentation.
  • Updated developer documentation.
  • Migration guide expanded, including details on taking over the renderer.

As always, feedback welcome. Consider all features experimental and may be changed, removed or expanded at any time. Who know,s you could be the reason πŸ‘€. Happy building!

What's Changed

Full Changelog: v9.4.2...v10.0.0-alpha.1

v9.5.0

30 Dec 06:42
f51e57e

Choose a tag to compare

After a bit of research and development, R3F is now compatible with React 19.2, including the Activity feature!

Why did this take some effort, you might wonder? When React bumped to version 19.2.x, they also bumped the internal reconciler up a version which was not backwards compatible with 19.1.x. This put us in an awkward position of either making a breaking change in the middle of R3F v9, bump to another major just because of an internal detail from React or get creative. We chose to get creative and R3F is compatible with all versions of React between 19.0 and 19.2. The downside is we had to bundle the reconciler with R3F, but react-dom already does this so for now it is the best solution available.

Forcing breaking changes on libraries is likely not what the React teams intended so we will be working with them to try to avoid this in the future.

Happy coding.

What's Changed

Full Changelog: v9.4.2...v9.5.0

v9.4.2

29 Nov 09:54

Choose a tag to compare

What's Changed

  • docs: update installation guide with iOS simulator note by @rudin in #3572
  • fix: Expo SDK 54 compatibility through workaround by @alextoudic in #3599

New Contributors

Full Changelog: v9.4.1...v9.4.2

v9.4.1

29 Nov 09:43

Choose a tag to compare

What's Changed

  • fix: pass DevTools config through createReconciler to fix React DevTools by @AlaricBaraou in #3594

Full Changelog: v9.4.0...v9.4.1

v9.4.0

13 Oct 06:48

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v9.3.0...v9.4.0

v9.3.0

28 Jul 02:29

Choose a tag to compare

With this release we have two big fixes.

  1. flushSync now works properly. To prove it we added an example that allows you to React props and then take a screenshot of the R3F canvas with the latest state. This is a pretty advanced use case, but one people might be interested to explore for exporting videos or images using R3F.
  2. React Native support has been fixed for 0.79 and newer when combined with the same update to Drei: pmndrs/drei#2494. A big thanks to @thejustinwalsh for helping us with this one.

What's Changed

New Contributors

Full Changelog: v9.1.4...v9.3.0

v9.1.4

29 Jun 00:46

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v9.1.3...v9.1.4

v9.1.3

29 Jun 00:38

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v9.1.2...v9.1.3