A header-only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications.
GLM (OpenGL Mathematics) is a header-only C++ mathematics library specifically designed for graphics software. It provides GLSL-like vector, matrix, and quaternion operations, solving the need for a consistent and familiar math API in C++ graphics programming. It extends GLSL features with additional utilities for transformations, noise, and data packing.
Graphics programmers, game developers, and anyone writing C++ software that requires linear algebra for rendering, simulations, or image processing, especially those already familiar with GLSL.
Developers choose GLM for its strict GLSL compliance, which reduces cognitive load when switching between shader and application code. Its header-only design, lack of dependencies, and extensive feature set make it a lightweight yet powerful alternative to rolling custom math libraries.
OpenGL Mathematics (GLM)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Mirrors OpenGL Shading Language exactly in naming and behavior, allowing seamless code sharing between C++ and shaders, as highlighted in the README's philosophy.
No compilation required; simply include headers for easy integration into any C++ project without build system modifications, per the README.
Has no external dependencies and supports major compilers (GCC, Clang, VC++, CUDA), ensuring wide compatibility across C++17 and legacy environments.
Goes beyond core GLSL with extensions for matrix transformations, quaternions, noise, and data packing, useful for graphics and physics simulations.
Numerous preprocessor defines (e.g., GLM_FORCE_INTRINSICS) and experimental extensions, as mentioned in the manual, can make setup and maintenance cumbersome.
SIMD optimizations are not enabled by default and require specific flags, with release notes citing fixes for issues like NEON support, indicating potential instability.
Regular deprecations (e.g., removal of GLM_SWIZZLE) and upcoming C++17 requirements, noted in release notes, can disrupt existing codebases and increase migration effort.