I am starting to learn about OpenGL and GLM and GLSL and I am getting a little confused. I will say in here what I have understood so far and my questions, so please feel free to correct me anytime.
So far I see that GLM extends the GLSL documentation providing more math functions, but since GLM is C++ based it will run on the CPU, on the other hand, GLSL runs directly in the GPU so I guess matrix math is a lot faster in GLSL since it can use the GPU's power to do all the math in parallel. So why to use GLM?
They're completely different things:
GLM isn't meant as a substitute or alternative to GLSL. It's meant to help with calculations that wouldn't make sense to do on the GPU — things like building a projection matrix to be used by your vertex shaders, or computing distances between points in 3D space.
They're two completely different things:
The reason GLM has OpenGL in its name is because it was built with graphics programming in their minds (in other words, made for OpenGL).
Short version: GLM is for your program, GLSL's math capabilities are for your shader.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With