-
-
Notifications
You must be signed in to change notification settings - Fork 579
Choice of a linear algebra library #165
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
Comments
Hey! Both glam an nalgebra sound good for this purpose. Here are some additional info:
So I think that if your priority is ease of use, lightweightness, and already-existing integration with rust-gpu, pick glam. Also no matter the library you choose, keep in mind that conversion between |
Thank you @sebcrozet very much for such a quick and comprehensive reply! This will make the process already much easier. |
Hi there! I think glam fits well with some of your goals such as small sub dependencies, small build size, small compile time, a simple API and light-weightness goals. These things have always been a focus of the library. glam has explicit support for SIMD, but only SSE2 on x86 at the moment (as that is all that is stable in Rust) although I intend to add other architectures such as wasm m128 support at some stage. As @sebcrozet points out glam's SIMD support is to accelerate scalar math, not AoSoA, so you don't get the full potential benefits of SIMD. The example of using SIMD for Vec2 + Vec2 above isn't correct however, that's just regular f32 math in glam (there was no benefit in performance for Vec2 to use SIMD). I can't speak to sufficient features, that depends on what you need. nalgebra is definitely more feature rich than glam and @sebcrozet also develops the parry and rapier crates on top of nalgebra. While glam isn't 1.0 yet I don't expect to add a lot more features to it, it has a narrow focus of common functionality needed in games generally. glam is a personal time project for me but the scope is small enough that I don't see future maintenance being an issue. While I couldn't commit to expanding the feature set greatly (e.g. intersection) some community crates may appear. For example bevy are building some simple primitives and intersection tests, potentially those could be made standalone once they have matured. rust-gpu is currently being built on glam however it is their long term goal to be math library agnostic. I don't think there should be any limitation with either library using rayon or targetting wasm. Hope that helps! |
Thank you both for the in-depth answers, it was very helpful! We ended up deciding on glam for its overall simplicity, but if we end up needing the increased features of nalgebra in the future, we may reevaluate. |
Moving forward, we will need some kind of math library for Graphite.
Graphite is a 2D raster and vector graphics editor.
We have gathered a few criteria that seemed important to us:
There will be more things that we didn't think of, but this should give a general direction.
But feel free to ask further questions about the requirements.
We have been primarily looking at glam (@bitshifter) and nalgebra (@sebcrozet).
It would be great if you could give us further insight to help with the decision.
The text was updated successfully, but these errors were encountered: