Cycles: add strength input for normal map node.

This commit is contained in:
Brecht Van Lommel
2012-11-08 16:35:20 +00:00
parent 4063db3f61
commit e73408f247
5 changed files with 27 additions and 8 deletions

View File

@@ -20,6 +20,7 @@
shader node_normal_map(
normal NormalIn = N,
float Strength = 1.0,
color Color = color(0.5, 0.5, 1.0),
string space = "Tangent",
string attr_name = "geom:tangent",
@@ -44,5 +45,8 @@ shader node_normal_map(
Normal = normalize(transform("object", "world", vector(mcolor)));
else if (space == "World")
Normal = normalize(vector(mcolor));
if (Strength != 1.0)
Normal = normalize(NormalIn + (Normal - NormalIn)*max(Strength, 0.0));
}