Integer socket support in Cycles. Int values are already supported natively in OSL...
[blender.git] / intern / cycles / kernel / osl / nodes / node_convert_from_color.osl
index c55b0f811ffdddb871590fbbf0d4a36f203987b9..2884c772414418edb0eb96643250d45c29448879 100644 (file)
 shader node_convert_from_color(
        color Color = color(0.0, 0.0, 0.0),
        output float Val = 0.0,
+       output int ValInt = 0,
        output vector Vector = vector(0.0, 0.0, 0.0),
        output point Point = point(0.0, 0.0, 0.0),
        output normal Normal = normal(0.0, 0.0, 0.0))
 {
        Val = Color[0] * 0.2126 + Color[1] * 0.7152 + Color[2] * 0.0722;
+       ValInt = (int)(Color[0]*0.2126 + Color[1]*0.7152 + Color[2]*0.0722);
        Vector = vector(Color[0], Color[1], Color[2]);
        Point = point(Color[0], Color[1], Color[2]);
        Normal = normal(Color[0], Color[1], Color[2]);