Add shader context to Three.js selections - #604
Draft
aidenybai wants to merge 5 commits into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
ShaderMaterialandRawShaderMaterialcontext in Three.js selection previews.mesh,points, orlineas the selection target so projected bounds and React Three Fiber source lookup continue to work.Start React Grabcontrol to the particle page and exercise that manual activation path in the browser test.Why
Three.js raycasting identifies the rendered
Object3D, but React Grab previously omitted its attached shader material. As a result, agents received the object/component context without the shader code responsible for its appearance.This adds the missing shader context while keeping existing selection behavior stable. GPU-only vertex displacement still requires the object's standard custom
raycastimplementation or selectable proxy geometry because the CPU raycaster cannot infer arbitrary GLSL transforms.The standalone canvas originally depended on the global keyboard activation gesture, while its automated test activated React Grab directly through the API. The on-page control now makes the tested flow identical to the manual flow. The page also opts out of automatic parent-instance reuse before initializing a local instance, which keeps it functional inside embedded browser hosts.
Validation
nr buildE2E_ENVIRONMENT=vite-plus-development nr --filter react-grab test -- e2e/three-js-selection.spec.ts(166 unit tests and 5 focused Playwright tests, including same-origin embedding)nr lintnr typechecknr formatgit diff --check