Samplers inTransform/outTransform parameters allow linear transforms and swizzling of components but can not express addition or setting to specific components unless it is known that one other component is 1.
This comes up for example when splitting a RGBA image into an "opaque" color (R,G,B, 1) and a separate opacity (A, 0, 0, 0).
The latter can be achieved by using a outTransform with a fitting swizzling matrix
0 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
However the best we can do for the RGB part is
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 0
which results in (R, G, B, 0)
For completness the transforms should have FLOAT32_VEC4 parameters inOffset/outOffset with the combined transform becoming: transform*x + offset
Samplers
inTransform
/outTransform
parameters allow linear transforms and swizzling of components but can not express addition or setting to specific components unless it is known that one other component is 1.This comes up for example when splitting a RGBA image into an "opaque" color (R,G,B, 1) and a separate opacity (A, 0, 0, 0). The latter can be achieved by using a
outTransform
with a fitting swizzling matrixHowever the best we can do for the RGB part is
which results in (R, G, B, 0)
For completness the transforms should have
FLOAT32_VEC4
parametersinOffset
/outOffset
with the combined transform becoming:transform*x + offset