Managed to figure it out! Used an if statement to basically get 0,0 and 0-1 along the R channel (with texture/landscapelayer coord and a R mask) and then did the same for 1-0 and 1-1. And then combined them with a third IF along the green channel (if Mask g<1 then 0,0 +0,1) and if (mask g>1 then 1-0 + 1,1)