Open justabayet opened 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
drei | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 10, 2024 5:42pm |
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Why
Issue: performance issue with many MeshPortalMaterial. MeshPortalMaterial
visible
variable is never set tofalse
without specific interactions.MeshPortalMaterial is using a variable
visible
which decides if the texture needs to be updated or not. This variable value istrue
by default and is updated usinguseIntersect
.When a scene uses many MeshPortalMaterial they are all getting updated on each frame, until the camera moves around to look at the portals and then look away. This triggers the
useIntersect
hook which setvisible
totrue
when the portal is on sight, and then back tofalse
when it's not on sight anymore.What
Set
visible
tofalse
by default.Checklist