If I had a Vertex Shader constant holding one float value, like:
Where: The first 3 numbers are actually red (255), next three are green (000), then the last three are blue (255).
... Could I separate those values and pass them to a vertex-variant register for the Fragment Shader? I'm thinking it would involve a combination of opcode operations such as: fractional, subtraction, and multiplications?
Perhaps there is a simpler way to pass all 3 color-channels in one register value and extract them back in separate channels (within a low-level language)?
- UPDATE -
Alright trying to clarify my question a bit. The flow of execution would be:
- In Flash (in my case), pass the value 0xff00ff (Magenta) to a free Vertex Constant register of FLOAT_1 (so it only uses one field of that register).
- In AGAL, the Vertex-Shader would decompile the field's value into 3 separate values (R, G, B, [A will be taken care of with another constant]).
- Still in the Vertex-Shader, pass those 3 separate values to a Variant that will be used by the Fragment Shader (example: mov v0.rgb, vt0.rgb).
- In the Fragment Shader, draw the interpolated color of the Variant.
Really, all I'm asking is happening in the Vertex-Shader. Then again, now that I know large numbers consisting of more than 7 digits won't work, a value of 0xFFFFFF won't fit! (16777215 = 8 digits = shit outta luck!).
Maybe it's just not worth the hassle. But if someone knows a work-around the limitation, that would be cool. (Heck... maybe it could be split into two fields instead?)