GLM 0.9.3.0 is finally released. Since the branch 0.9.2, the test bench and the Doxygen API documentation has been expended significantly leading to an even more reliable implementation and hopefully an even smoother development experience.

For the feature set, the GLSL noise functions are added, based on the implementation of webgl-noise. Some users might prefer the promoted GLM_GTC_noise extension also based on webgl-noise but with a different interface and three noise methods: Perlin noise, periodic noise and simplex noise.

2D simplex noise with GLM_GTC_noise

Additionally, the random number generation functions (GLM_GTC_random) which provides various interesting distributions as illustrated below. Also reaching GLM tool box, the new experimental extension GLM_GTX_constants provides a set of constants.

Spherical random distribution with GLM_GTC_random

Finally, swizzle operators are a challenging task to implement but thanks to the effort of many contributors, GLM 0.9.3.0 provides something interesting, but admittably not perfect. The new implementation is a great improvement considering the incompatibilities with some external libraries in GLM 0.9.2.7. GLM 0.9.3 provides two implemetanations, one for C++ 98 compilers and one for C++ 11 compilers providing an implemetnation closer to what GLSL does. Indeed the C++ 98 implementation is compatible with C++ 11 compilers.

Implementation for C++ 98 compilers:

#define GLM_SWIZZLE

#include <glm/glm.hpp>



void example_cpp98()

{

glm::vec4 a = glm::vec4(2, 0, 0, 0);

glm::vec4 b = glm::vec4(0, 2, 0, 0);

glm::vec3 c = vec4((a.zyx() + b.xyz()).xyz() * 0.5f, 1.0f);

glm::vec2 d = glm::normalize(glm::vec2(c.yz()));

a.xyzw() = d.xyxy();

}