I’m trying to use Math TOPs to offload computation to the GPU. In particular, I want to take multiple channels from a chop and subtract them from each other, (followed by a bunch of other ops).
So what I do is feed in a 4 channel CHOP into a Chop to Top, and set DataFormat
to be RGBA
I then create two math tops. In the first one, for combine channels input I select RG, and for Output R.
For the second one, for combine channel input I select BA, and output R.
The idea is that in the first math top I want to subtract G from R, and in the second math top A from B.
To debug this output I turn those tops back into chops using top to chop, selecting the r channel.
For some reason, both math tops have end up with the same values, which are not the same as if I just take the chop channels directly and subtract them from each other.
Here is a screenshot:
It’s not intuitive what channel input and channel output do on the Math TOP, and in my case it has unexpected behavior; I wish there was better documentation on this, or some sort of tutorial.
What is the proper way to do this?