Skip to content

feat: add DepthPicking component and useDepthPicking hook - #372

Merged
kvvasuu merged 1 commit into
v4from
feat/depth-picking-pass
Aug 15, 2026
Merged

feat: add DepthPicking component and useDepthPicking hook#372
kvvasuu merged 1 commit into
v4from
feat/depth-picking-pass

Conversation

@kvvasuu

@kvvasuu kvvasuu commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Fixes #288

Summary

  • New <DepthPicking> component and useDepthPicking hook for reading world-space positions off the depth buffer, extracted from <Autofocus> into a standalone, reusable primitive. <Autofocus> now builds on both internally, same external behavior.
  • useDepthPicking auto-detects the composer's own camera when used inside its <EffectComposer>, with an explicit camera argument to override when called from outside that tree.
  • Split DepthPicking and N8AO into a new src/passes directory, since neither wraps a postprocessing Effect.

Test plan

  • yarn typecheck / yarn test / yarn eslint:ci / yarn build
  • Manually verified in a real browser: mouse-follow picking, click-to-pick, <Autofocus> (mouse + debug), self-occlusion (depthWrite), enableNormalPass + surrounding effects, and drei's <PerspectiveCamera>

Extracted from Autofocus into a standalone, reusable primitive for reading world-space positions off the depth buffer. Also splits DepthPicking and N8AO into a new src/passes directory, since neither wraps a postprocessing Effect.
@kvvasuu
kvvasuu merged commit 1fe2f27 into v4 Aug 15, 2026
@kvvasuu
kvvasuu deleted the feat/depth-picking-pass branch August 15, 2026 17:05
@jo-chemla

Copy link
Copy Markdown

Thanks for this one, great to hear!

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.

2 participants