10000 Check for presence of UniformsLib/Utils instead of importing them from three/src by mrxz · Pull Request #5668 · aframevr/aframe · GitHub
[go: up one dir, main page]

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

Check for presence of UniformsLib/Utils instead of importing them from three/src #5668

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

mrxz
Copy link
Contributor
@mrxz mrxz commented Feb 19, 2025

Description:
To support the WebGPURenderer of three.js, some modifications were made to msdf.js and sdf.js (#5655). By importing from three/src/ directly a different copy is being included into the bundle. This extended to various Color/Matrix/Vector classes as well. Functionally this didn't cause any problems AFAICT, but it did bloat the bundle size (~19kiB to the minified build).

This PR replaces the imports with a check if they exist instead. This does mean that the fog uniforms are missing when using the WebGPURenderer, but these shaders currently don't work with WebGPURenderer anyway and even if they did, fog is handled differently when using it.

Changes proposed:

  • Check if UniformsUtils/UniformsLib exist instead of importing them from three/src/

@vincentfretin
Copy link
Contributor

Thank you for checking that.

@dmarcos dmarcos merged commit a66e6d2 into aframevr:master Feb 19, 2025
3 checks passed
@dmarcos
Copy link
Member
dmarcos commented Feb 19, 2025

Thanks!

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.

3 participants
0