Code refactor: add separate RGB to BW node and rename some sockets.

This commit is contained in:
Brecht Van Lommel
2016-05-29 12:24:47 +02:00
parent eac7ed8d04
commit 9bd2820aaf
23 changed files with 199 additions and 148 deletions

View File

@@ -17,18 +17,18 @@
#include "stdosl.h"
shader node_convert_from_point(
point Point = point(0.0, 0.0, 0.0),
output string String = "",
output float Val = 0.0,
output int ValInt = 0,
output vector Vector = vector(0.0, 0.0, 0.0),
output color Color = 0.0,
output normal Normal = normal(0.0, 0.0, 0.0))
point value_point = point(0.0, 0.0, 0.0),
output string value_string = "",
output float value_float = 0.0,
output int value_int = 0,
output vector value_vector = vector(0.0, 0.0, 0.0),
output color value_color = 0.0,
output normal value_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]);
value_float = (value_point[0] + value_point[1] + value_point[2]) * (1.0 / 3.0);
value_int = (int)((value_normal[0] + value_normal[1] + value_normal[2]) * (1.0 / 3.0));
value_vector = vector(value_point[0], value_point[1], value_point[2]);
value_color = color(value_point[0], value_point[1], value_point[2]);
value_normal = normal(value_point[0], value_point[1], value_point[2]);
}