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