1#version 130 2 3//#define TEST_POST_110 4 5uniform mat3 colorTransform; 6varying vec3 Color; 7uniform mat4 m, n; 8 9#ifdef TEST_POST_110 10uniform mat4x3 um43; 11uniform mat3x4 un34; 12#else 13uniform mat4 um43; 14uniform mat4 un34; 15#endif 16 17varying vec4 v; 18 19#ifdef TEST_POST_110 20varying vec3 u; 21#else 22varying vec4 u; 23#endif 24 25void main() 26{ 27 gl_FragColor = vec4(un34[1]); 28 gl_FragColor += vec4(Color * colorTransform, 1.0); 29 30 if (m != n) 31 gl_FragColor += v; 32 else { 33 gl_FragColor += m * v; 34 gl_FragColor += v * (m - n); 35 } 36 37#ifdef TEST_POST_110 38 mat3x4 m34 = outerProduct(v, u); 39 m34 += mat4(v.x); 40 m34 += mat4(u, u.x, u, u.x, u, u.x, u.x); 41#else 42 mat4 m34 = mat4(v.x*u.x, v.x*u.y, v.x*u.z, v.x*u.w, 43 v.y*u.x, v.y*u.y, v.y*u.z, v.y*u.w, 44 v.z*u.x, v.z*u.y, v.z*u.z, v.z*u.w, 45 v.w*u.x, v.w*u.y, v.w*u.z, v.w*u.w); 46 m34 += mat4(v.x); 47 m34 += mat4(u, u.x, u, u.x, u, u.x, u.x); 48 49#endif 50 51 if (m34 == un34) 52 gl_FragColor += m34 * u; 53 else 54 gl_FragColor += (un34 * um43) * v; 55} 56