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

clear and preload function for useEnvironment #2076

Closed
AaronClaes opened this issue Aug 28, 2024 · 1 comment · Fixed by #2079
Closed

clear and preload function for useEnvironment #2076

AaronClaes opened this issue Aug 28, 2024 · 1 comment · Fixed by #2079
Labels
enhancement New feature or request released

Comments

@AaronClaes
Copy link
Contributor

Describe the feature you'd like:

Since useEnvironment is based on useLoader it should be possible to provide a preload and clearing function.
At the moment, it would be quite a bit of trouble to preload or clear environment files because some logic is involved in selecting the correct loader based on the file extension.

Suggested implementation:

Similar to the other hooks based on useLoader:

useEnvironment.clear(...)
useEnvironment.preload(...)

I worked out a first version in a Drei fork and it works great so far, I will open a PR soon.
The only limitation at the moment would be that you cannot preload gainmaps, because that loader requires the renderer to be set.
This should not be an issue as long as it is documented.

Copy link

github-actions bot commented Sep 3, 2024

🎉 This issue has been resolved in version 9.112.0 🎉

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
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant