PDA

View Full Version : Using glsl classes outside of shader files



Ottaz
10-08-2010, 12:14 PM
Is there a way to use glsl classes like vec3 and vec2 etc, within the source program code or is it exclusive to the shader files?

I'm trying to avoid having to write my own vector class complete with normalization, dot and cross product methods etc etc...

Jacek Nowak
10-08-2010, 01:00 PM
Use GLM. It's a 3d math library with syntax based on GLSL specification, so you can use stuff like vec2, vec3, mat4, normalize in C++ code just like you would use them in GLSL (I assume you use C++).

marshats
10-08-2010, 06:28 PM
Just in case here's the glm (http://glm.g-truc.net/) link