Problem with RGBA channel masking function

Same issue again, you are passing a float3 to the material function whilst it should be float4.