4D and GLSL, are there any support for matrix 5x5?

glsl, opengl

Solution

No, glsl only has 2-, 3-, and 4-vectors and equivalent matrices (https://www.opengl.org/wiki/Data_Type_%28GLSL%29#Matrices). If you want 5x5 matrices sent to the shader you can do this by defining structs of floats or doubles yourself and passing them as uniforms, or if you need a lot, share them as a buffer of floats and read them in groups of 25. Keep in mind though that you'll also need to implement any math functions you need for these types yourself.

Problem

I want to transform and project on screen 4D graphics with GLSL vertex shader. Does it have matrix 5x5 and 5D vectors support or extensions for it? And if not, how to properly send 5x5 matrices and etc to shader?

Original source