1uniform half4 colorGreen, colorRed; 2 3inline bool ifTest(half4 color) { 4 bool result = bool(color.g); 5 return result; 6} 7 8half4 main(float2 coords) { 9 if (ifTest(colorGreen)) 10 return colorGreen; 11 else 12 return colorRed; 13} 14