0:54 'un34' ( uniform 4X4 matrix of float)
0:54 'um43' ( uniform 4X4 matrix of float)
0:54 'v' ( smooth in 4-component vector of float)
+0:56 Sequence
+0:56 move second child to first child ( temp 4X2 matrix of float)
+0:56 'm42' ( temp 4X2 matrix of float)
+0:56 Constant:
+0:56 42.000000
+0:56 0.000000
+0:56 0.000000
+0:56 42.000000
+0:56 0.000000
+0:56 0.000000
+0:56 0.000000
+0:56 0.000000
+0:57 Test condition and select ( temp void)
+0:57 Condition
+0:57 Compare Equal ( temp bool)
+0:57 'm42' ( temp 4X2 matrix of float)
+0:57 Constant:
+0:57 42.000000
+0:57 0.000000
+0:57 0.000000
+0:57 42.000000
+0:57 0.000000
+0:57 0.000000
+0:57 0.000000
+0:57 0.000000
+0:57 true case
+0:58 Sequence
+0:58 add second child into first child ( temp 4-component vector of float)
+0:58 'gl_FragColor' ( fragColor 4-component vector of float FragColor)
+0:58 'v' ( smooth in 4-component vector of float)
0:? Linker Objects
0:? 'colorTransform' ( uniform 3X3 matrix of float)
0:? 'Color' ( smooth in 3-component vector of float)
0:54 'un34' ( uniform 4X4 matrix of float)
0:54 'um43' ( uniform 4X4 matrix of float)
0:54 'v' ( smooth in 4-component vector of float)
+0:56 Sequence
+0:56 move second child to first child ( temp 4X2 matrix of float)
+0:56 'm42' ( temp 4X2 matrix of float)
+0:56 Constant:
+0:56 42.000000
+0:56 0.000000
+0:56 0.000000
+0:56 42.000000
+0:56 0.000000
+0:56 0.000000
+0:56 0.000000
+0:56 0.000000
+0:57 Test condition and select ( temp void)
+0:57 Condition
+0:57 Compare Equal ( temp bool)
+0:57 'm42' ( temp 4X2 matrix of float)
+0:57 Constant:
+0:57 42.000000
+0:57 0.000000
+0:57 0.000000
+0:57 42.000000
+0:57 0.000000
+0:57 0.000000
+0:57 0.000000
+0:57 0.000000
+0:57 true case
+0:58 Sequence
+0:58 add second child into first child ( temp 4-component vector of float)
+0:58 'gl_FragColor' ( fragColor 4-component vector of float FragColor)
+0:58 'v' ( smooth in 4-component vector of float)
0:? Linker Objects
0:? 'colorTransform' ( uniform 3X3 matrix of float)
0:? 'Color' ( smooth in 3-component vector of float)
-#version 130\r
-\r
-//#define TEST_POST_110\r
-\r
-uniform mat3 colorTransform;\r
-varying vec3 Color;\r
-uniform mat4 m, n;\r
-\r
-#ifdef TEST_POST_110\r
-uniform mat4x3 um43;\r
-uniform mat3x4 un34;\r
-#else\r
-uniform mat4 um43;\r
-uniform mat4 un34;\r
-#endif\r
-\r
-varying vec4 v;\r
-\r
-#ifdef TEST_POST_110\r
-varying vec3 u;\r
-#else\r
-varying vec4 u;\r
-#endif\r
-\r
-void main()\r
-{\r
- gl_FragColor = vec4(un34[1]);\r
- gl_FragColor += vec4(Color * colorTransform, 1.0);\r
-\r
- if (m != n)\r
- gl_FragColor += v;\r
- else {\r
- gl_FragColor += m * v;\r
- gl_FragColor += v * (m - n);\r
- }\r
- \r
-#ifdef TEST_POST_110\r
- mat3x4 m34 = outerProduct(v, u);\r
- m34 += mat4(v.x);\r
- m34 += mat4(u, u.x, u, u.x, u, u.x, u.x);\r
-#else\r
- mat4 m34 = mat4(v.x*u.x, v.x*u.y, v.x*u.z, v.x*u.w, \r
- v.y*u.x, v.y*u.y, v.y*u.z, v.y*u.w, \r
- v.z*u.x, v.z*u.y, v.z*u.z, v.z*u.w, \r
- v.w*u.x, v.w*u.y, v.w*u.z, v.w*u.w);\r
- m34 += mat4(v.x);\r
- m34 += mat4(u, u.x, u, u.x, u, u.x, u.x);\r
-\r
-#endif\r
-\r
- if (m34 == un34)\r
- gl_FragColor += m34 * u;\r
- else\r
- gl_FragColor += (un34 * um43) * v;\r
-}\r
+#version 130
+
+//#define TEST_POST_110
+
+uniform mat3 colorTransform;
+varying vec3 Color;
+uniform mat4 m, n;
+
+#ifdef TEST_POST_110
+uniform mat4x3 um43;
+uniform mat3x4 un34;
+#else
+uniform mat4 um43;
+uniform mat4 un34;
+#endif
+
+varying vec4 v;
+
+#ifdef TEST_POST_110
+varying vec3 u;
+#else
+varying vec4 u;
+#endif
+
+void main()
+{
+ gl_FragColor = vec4(un34[1]);
+ gl_FragColor += vec4(Color * colorTransform, 1.0);
+
+ if (m != n)
+ gl_FragColor += v;
+ else {
+ gl_FragColor += m * v;
+ gl_FragColor += v * (m - n);
+ }
+
+#ifdef TEST_POST_110
+ mat3x4 m34 = outerProduct(v, u);
+ m34 += mat4(v.x);
+ m34 += mat4(u, u.x, u, u.x, u, u.x, u.x);
+#else
+ mat4 m34 = mat4(v.x*u.x, v.x*u.y, v.x*u.z, v.x*u.w,
+ v.y*u.x, v.y*u.y, v.y*u.z, v.y*u.w,
+ v.z*u.x, v.z*u.y, v.z*u.z, v.z*u.w,
+ v.w*u.x, v.w*u.y, v.w*u.z, v.w*u.w);
+ m34 += mat4(v.x);
+ m34 += mat4(u, u.x, u, u.x, u, u.x, u.x);
+
+#endif
+
+ if (m34 == un34)
+ gl_FragColor += m34 * u;
+ else
+ gl_FragColor += (un34 * um43) * v;
+
+ mat4x2 m42 = mat4x2(42);
+ if (m42 == mat4x2(42, 0, 0, 42, 0, 0, 0, 0)) {
+ gl_FragColor += v;
+ }
+}
}
} else {
// matrix from vector or scalar
- int count = 0;
- const int startIndex = index;
int nodeComps = node->getType().computeNumComponents();
- for (int i = startIndex; i < endIndex; i++) {
- if (i >= instanceSize)
- return;
- if (nodeComps == 1) {
- // If there is a single scalar parameter to a matrix
- // constructor, it is used to initialize all the
- // components on the matrix's diagonal, with the
- // remaining components initialized to 0.0.
- if (i == startIndex || (i - startIndex) % (matrixRows + 1) == 0 )
- leftUnionArray[i] = rightUnionArray[count];
- else
- leftUnionArray[i].setDConst(0.0);
- } else {
+ if (nodeComps == 1) {
+ for (int c = 0; c < matrixCols; ++c) {
+ for (int r = 0; r < matrixRows; ++r) {
+ if (r == c)
+ leftUnionArray[index] = rightUnionArray[0];
+ else
+ leftUnionArray[index].setDConst(0.0);
+ index++;
+ }
+ }
+ } else {
+ int count = 0;
+ for (int i = index; i < endIndex; i++) {
+ if (i >= instanceSize)
+ return;
+
// construct the matrix in column-major order, from
// the components provided, in order
leftUnionArray[i] = rightUnionArray[count];
- }
-
- index++;
- if (nodeComps > 1)
+ index++;
count++;
+ }
}
}
}