Skip to content

Upgrade three 0.165.0 -> 0.181.2 - #166

Open
abernier wants to merge 1 commit into
mainfrom
three-181
Open

Upgrade three 0.165.0 -> 0.181.2#166
abernier wants to merge 1 commit into
mainfrom
three-181

Conversation

@abernier

@abernier abernier commented Aug 10, 2026

Copy link
Copy Markdown
Member

Bumps three 0.165.0 → 0.181.2 (and @types/three^0.181.0), which also unpins postprocessing.

Why 0.181.2 and not 0.185.1

r182 moved directional and spot shadow maps to sampler2DShadow (hardware PCF) instead of an RGBA-packed sampler2D. drei 10.7.8's <SoftShadows> still overrides shadowmap_pars_fragment with a PCSS block built on unpackRGBAToDepth(texture2D(shadowMap, ...)), and injects its return PCSS(...) at the first #if defined( SHADOWMAP_TYPE_PCF ) — which since r182 is the uniform declaration, not the getShadow body.

On 0.185.1 the fragment shader fails to compile:

demo 0.165 0.185.1 0.181.2
the-three-graces ok renders nothing ok
gltf-animations-tied-to-scroll ok renders nothing ok
soft-shadows ok loses its penumbra ok
room-with-soft-shadows ok loses its penumbra ok

drei fixes this only on the 11.0.0-alpha line, whose peers are three >= 0.182 and @react-three/fiber >= 10.0.0-0 — so it needs a fiber 10 alpha, not just a drei bump. .syncpackrc.json's pin label records the ceiling.

What r166–r181 removed along the way

  • WebGLMultipleRenderTargets (gone in r172) → WebGLRenderTarget's count option, whose attachments live on .textures. The vendored realism-effects bundles get a shim for the old constructor and their array-style .texture reads become .textures.
  • WebGLRenderer#copyFramebufferToTexture swapped its first two arguments in r166 (texture first, position second). realism-effects still passed the old order — this is what crashed ssgi-spheres-with-rapier-physics on load, and it built cleanly the whole time.
  • BufferAttribute#updateRangeaddUpdateRange() / updateRanges (nextjs-prism's Beam).
  • Texture#image is now typed unknown (racing-game's Heightmap).
  • Vector3#set()'s z became optional, so Parameters<Vector3['set']> no longer extends ReadonlyArray<number> — which drops the tuple branch of react-spring's animated scale prop. gltf-animations-re-used springs a scalar and passes scale={[s, s, 1]}.

postprocessing 6.37+ needs three >= 0.174, so the workspace override holding the transitive copy at 6.36.6 is gone and the direct dependency moves to 6.39.4 (peer: >= 0.168 < 0.186).

Verification

  • All 158 examples build (tsc + vite).
  • Every built demo was loaded headless and diffed against a baseline run of main: no new console or page errors. Remaining visual deltas sit inside the harness's own run-to-run noise, measured separately by running the same build twice — ?saycheese is not time-deterministic.

Notes

  • stage-presets-gltfjsx is already broken on main (blank canvas). This PR changes where it fails, not whether: #include <lightmap_fragment> before, composer.depthTexture being undefined after.
  • pnpm lint:examples fails on main too — 83 warnings against --max-warnings 81, unchanged by this PR. The pre-commit and pre-push hooks were bypassed for that reason; the cap needs raising or two hooks fixing, separately from this change.

🤖 Generated with Claude Code

r182 is where this stops: three moved directional and spot shadow maps
to sampler2DShadow (hardware PCF) instead of an RGBA-packed sampler2D,
and drei 10.7.8's <SoftShadows> still overrides shadowmap_pars_fragment
with a PCSS block built on unpackRGBAToDepth(texture2D(shadowMap, ...)).
It also injects its `return PCSS(...)` at the first
`#if defined( SHADOWMAP_TYPE_PCF )`, which since r182 is the uniform
declaration rather than the getShadow body. On 0.185 the fragment shader
fails to compile: the-three-graces and gltf-animations-tied-to-scroll
render nothing, soft-shadows and room-with-soft-shadows lose their
penumbra. drei fixes this only on the 11.0.0-alpha line, which needs
@react-three/fiber 10.

Everything r166-r181 removed along the way:

- WebGLMultipleRenderTargets (gone in r172) -> WebGLRenderTarget's
  `count` option, whose attachments live on `.textures`. The vendored
  realism-effects bundles get a shim for the old constructor, and their
  array-style `.texture` reads become `.textures`.
- WebGLRenderer#copyFramebufferToTexture swapped its first two arguments
  in r166 (texture first, position second) -- realism-effects was still
  passing them the old way, which crashed the ssgi demo on load.
- BufferAttribute#updateRange -> addUpdateRange()/updateRanges.
- Texture#image is typed `unknown`, and Vector3#set()'s z became
  optional -- which drops the tuple branch of react-spring's animated
  `scale` prop, so gltf-animations-re-used springs a scalar instead.

postprocessing is unpinned along with it: 6.37+ needs three >= 0.174, so
the workspace override that held the transitive copy at 6.36.6 is gone
and the direct dependency moves to 6.39.4 (peer: >= 0.168 < 0.186).

Verified: all 158 examples build, and each one loads headless with no
console or page errors beyond the ones main already has.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant