1#version 400 2 3uniform bl { 4 uniform mat4 m4; 5 uniform mat3 m3; 6} bName; 7 8in vec3 v3; 9 10vec3 xf(mat3 m, vec3 v) 11{ 12 return v * m; 13} 14 15mat3 Mat3(mat4 m) 16{ 17 return mat3(m[0].xyz, m[1].xyz, m[2].xyz); 18} 19 20vec3 mxv(mat4 m4, vec3 v) 21{ 22 return v * Mat3(m4); 23} 24 25void main() 26{ 27 gl_Position = vec4(mxv(bName.m4, v3) + xf(bName.m3, v3), 1.0); 28} 29