Integer socket support in Cycles. Int values are already supported natively in OSL...
[blender.git] / intern / cycles / kernel / osl / nodes / node_convert_from_vector.osl
index 19ef9331c0c51d5e3e195756385d546756ce3cff..a9f43a40074e1f8fc035d886ad0508e6ed7b107c 100644 (file)
 shader node_convert_from_vector(
        vector Vector = vector(0.0, 0.0, 0.0),
        output float Val = 0.0,
+       output int ValInt = 0,
        output color Color = color(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 = (Vector[0] + Vector[1] + Vector[2]) * (1.0 / 3.0);
+       ValInt = (int)((Normal[0] + Normal[1] + Normal[2])*(1.0/3.0));
        Color = color(Vector[0], Vector[1], Vector[2]);
        Point = point(Vector[0], Vector[1], Vector[2]);
        Normal = normal(Vector[0], Vector[1], Vector[2]);