Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: portal material visible default to false #1914

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justabayet
Copy link

Why

Issue: performance issue with many MeshPortalMaterial. MeshPortalMaterial visible variable is never set to false without specific interactions.

MeshPortalMaterial is using a variable visible which decides if the texture needs to be updated or not. This variable value is true by default and is updated using useIntersect.

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 set visible to true when the portal is on sight, and then back to false when it's not on sight anymore.

What

Set visible to false by default.

Checklist

  • Ready to be merged

Copy link

vercel bot commented Apr 10, 2024

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

Copy link

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.

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.

None yet

1 participant