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(MeshRefractionMaterial): work across unique meshes #1454

Merged
merged 2 commits into from
May 20, 2023

Conversation

CodyJasonBennett
Copy link
Member

@CodyJasonBennett CodyJasonBennett commented May 20, 2023

Ensures MeshRefractionMaterial is reusable between unique meshes. Before, it was order dependent.

https://codesandbox.io/s/k6uiie

Torus Last Diamond Last
image image

@vercel
Copy link

vercel bot commented May 20, 2023

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 May 20, 2023 5:34pm

@codesandbox-ci
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.

Latest deployment of this branch, based on commit df2467a:

Sandbox Source
elastic-maxwell-cueg27 Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration
Diamond-Ring (forked) PR

Comment on lines -73 to +74
new MeshBVH(geometry.toNonIndexed(), { lazyGeneration: false, strategy: SAH })
new MeshBVH(geometry.clone().toNonIndexed(), { lazyGeneration: false, strategy: SAH })
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary since toNonIndexed is destructive and will deopt rendering. We aren't using barycentric coords or anything.

@CodyJasonBennett CodyJasonBennett merged commit 833d3cb into master May 20, 2023
5 checks passed
@CodyJasonBennett CodyJasonBennett deleted the CodyJasonBennett-fix-refraction-geometry branch May 20, 2023 17:37
@github-actions
Copy link

🎉 This PR is included in version 9.68.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant