I am trying to upload a vector to the shader but it's not working and I can found why.
Here is the code:
mov ft0.rgb, fc0.rgbb
tex ft1, v1.rggg, fs0 <2d, linear, nomip, repeat>
mov ft0.a, ft1.aaaa
mov oc, ft0
Where fc0 is the vector I am trying to upload:
With this function I call before drawTriangles and present:
Engine.context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 0, Vector.<Number>([value1, value2, value3]));
I've debugged the scene with [Adobe Scout] and apparently fc0 has no value.
If I substitue the last ft0 for ft1 it works since I am rendering only the texture.
Vectors must have 4 elements, even if the variable our want to use has only x or r component.
Matrices must have 16 elements even if the variable you want to use is a 3x3 Matrix.
Not sure this is documented anywhere though...