I’m trying to mask a RGB texture with another RGB texture. I’m looking for some kind of combinder/shader operation that can do this. I want to do this in a single pass, and alpha testing will not work. I basically want to do this:
texture unit 1 = texture1(24bit RGB)
texture unit 2 = texture2(24bit RGB)
texture unit 3 = texture3(24bit RGB)
Well, I am basically interested in implementing a convolutional sum for smaller textures. GL supports 2d convolution but only in software for consumer based boards(imaging subset). The algorithm would be something like:
f(i,j) = SUM ( f(k,l)*g(f(k,l),table[i,j]) )
where g(a,b) => if(a==b) return 1,else return 0
The entire SUM would need mulitple passes but not the kernel(hopefully).
In tex3 I would store tex2-1. If the bitwise and succeded in tu1->tu2(tmp = tex1), tmp would be 1 in tu2->tu3. If failed, tmp would be negative, and clamped to 0. Or maybe I’m just dreaming.