diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-23 15:47:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-23 15:47:23 +0400 |
commit | 9c58865d201372ddd615f1f9b36d37cbc6937b98 (patch) | |
tree | 3da4fe35629767650f03a46c9585e29de072cd33 /intern | |
parent | b518197db7fd63f878c4360312c47f15b61f780a (diff) |
code cleanup: remove $Id's that crept back in, also osl style edits
Diffstat (limited to 'intern')
5 files changed, 28 insertions, 28 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_convert_from_normal.osl b/intern/cycles/kernel/osl/nodes/node_convert_from_normal.osl index 419e93e1518..32ef430d93b 100644 --- a/intern/cycles/kernel/osl/nodes/node_convert_from_normal.osl +++ b/intern/cycles/kernel/osl/nodes/node_convert_from_normal.osl @@ -27,7 +27,7 @@ shader node_convert_from_normal( output point Point = point(0.0, 0.0, 0.0)) { Val = (Normal[0] + Normal[1] + Normal[2]) * (1.0 / 3.0); - ValInt = (int)((Normal[0] + Normal[1] + Normal[2])*(1.0/3.0)); + ValInt = (int)((Normal[0] + Normal[1] + Normal[2]) * (1.0 / 3.0)); Vector = vector(Normal[0], Normal[1], Normal[2]); Color = color(Normal[0], Normal[1], Normal[2]); Point = point(Normal[0], Normal[1], Normal[2]); diff --git a/intern/cycles/kernel/osl/nodes/node_convert_from_point.osl b/intern/cycles/kernel/osl/nodes/node_convert_from_point.osl index cedd200f088..a9435c8abf4 100644 --- a/intern/cycles/kernel/osl/nodes/node_convert_from_point.osl +++ b/intern/cycles/kernel/osl/nodes/node_convert_from_point.osl @@ -27,7 +27,7 @@ shader node_convert_from_point( 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)); + 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]); diff --git a/intern/cycles/kernel/osl/nodes/node_convert_from_vector.osl b/intern/cycles/kernel/osl/nodes/node_convert_from_vector.osl index a9f43a40074..4516f92c753 100644 --- a/intern/cycles/kernel/osl/nodes/node_convert_from_vector.osl +++ b/intern/cycles/kernel/osl/nodes/node_convert_from_vector.osl @@ -27,7 +27,7 @@ shader node_convert_from_vector( 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)); + 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]); diff --git a/intern/cycles/kernel/osl/nodes/node_image_texture.osl b/intern/cycles/kernel/osl/nodes/node_image_texture.osl index 2ca7e682a35..6393605e6b5 100644 --- a/intern/cycles/kernel/osl/nodes/node_image_texture.osl +++ b/intern/cycles/kernel/osl/nodes/node_image_texture.osl @@ -23,7 +23,7 @@ color image_texture_lookup(string filename, string color_space, float u, float v { color rgb = (color)texture(filename, u, 1.0 - v, "wrap", "periodic", "alpha", Alpha); - if(color_space == "sRGB") + if (color_space == "sRGB") rgb = color_srgb_to_scene_linear(rgb); return rgb; @@ -38,10 +38,10 @@ shader node_image_texture( output color Color = color(0.0, 0.0, 0.0), output float Alpha = 1.0) { - if(projection == "Flat") { + if (projection == "Flat") { Color = image_texture_lookup(filename, color_space, Vector[0], Vector[1], Alpha); } - else if(projection == "Box") { + else if (projection == "Box") { /* object space normal */ vector Nob = transform("world", "object", N); @@ -57,44 +57,44 @@ shader node_image_texture( * the Nxyz values are the barycentric coordinates in an equilateral * triangle, which in case of blending, in the middle has a smaller * equilateral triangle where 3 textures blend. this divides things into - * 7 zones, with an if() test for each zone */ + * 7 zones, with an if () test for each zone */ vector weight = vector(0.0, 0.0, 0.0); float blend = projection_blend; float limit = 0.5*(1.0 + blend); /* first test for corners with single texture */ - if(Nob[0] > limit*(Nob[0] + Nob[1]) && Nob[0] > limit*(Nob[0] + Nob[2])) { + if (Nob[0] > limit*(Nob[0] + Nob[1]) && Nob[0] > limit*(Nob[0] + Nob[2])) { weight[0] = 1.0; } - else if(Nob[1] > limit*(Nob[0] + Nob[1]) && Nob[1] > limit*(Nob[1] + Nob[2])) { + else if (Nob[1] > limit*(Nob[0] + Nob[1]) && Nob[1] > limit*(Nob[1] + Nob[2])) { weight[1] = 1.0; } - else if(Nob[2] > limit*(Nob[0] + Nob[2]) && Nob[2] > limit*(Nob[1] + Nob[2])) { + else if (Nob[2] > limit*(Nob[0] + Nob[2]) && Nob[2] > limit*(Nob[1] + Nob[2])) { weight[2] = 1.0; } - else if(blend > 0.0) { + else if (blend > 0.0) { /* in case of blending, test for mixes between two textures */ - if(Nob[2] < (1.0 - limit)*(Nob[1] + Nob[0])) { - weight[0] = Nob[0]/(Nob[0] + Nob[1]); - weight[0] = clamp((weight[0] - 0.5*(1.0 - blend))/blend, 0.0, 1.0); + if (Nob[2] < (1.0 - limit)*(Nob[1] + Nob[0])) { + weight[0] = Nob[0] / (Nob[0] + Nob[1]); + weight[0] = clamp((weight[0] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0); weight[1] = 1.0 - weight[0]; } - else if(Nob[0] < (1.0 - limit)*(Nob[1] + Nob[2])) { - weight[1] = Nob[1]/(Nob[1] + Nob[2]); - weight[1] = clamp((weight[1] - 0.5*(1.0 - blend))/blend, 0.0, 1.0); + else if (Nob[0] < (1.0 - limit)*(Nob[1] + Nob[2])) { + weight[1] = Nob[1] / (Nob[1] + Nob[2]); + weight[1] = clamp((weight[1] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0); weight[2] = 1.0 - weight[1]; } - else if(Nob[1] < (1.0 - limit)*(Nob[0] + Nob[2])) { - weight[0] = Nob[0]/(Nob[0] + Nob[2]); - weight[0] = clamp((weight[0] - 0.5*(1.0 - blend))/blend, 0.0, 1.0); + else if (Nob[1] < (1.0 - limit) * (Nob[0] + Nob[2])) { + weight[0] = Nob[0] / (Nob[0] + Nob[2]); + weight[0] = clamp((weight[0] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0); weight[2] = 1.0 - weight[0]; } else { /* last case, we have a mix between three */ - weight[0] = ((2.0 - limit)*Nob[0] + (limit - 1.0))/(2.0*limit - 1.0); - weight[1] = ((2.0 - limit)*Nob[1] + (limit - 1.0))/(2.0*limit - 1.0); - weight[2] = ((2.0 - limit)*Nob[2] + (limit - 1.0))/(2.0*limit - 1.0); + weight[0] = ((2.0 - limit) * Nob[0] + (limit - 1.0)) / (2.0 * limit - 1.0); + weight[1] = ((2.0 - limit) * Nob[1] + (limit - 1.0)) / (2.0 * limit - 1.0); + weight[2] = ((2.0 - limit) * Nob[2] + (limit - 1.0)) / (2.0 * limit - 1.0); } } @@ -103,15 +103,15 @@ shader node_image_texture( float tmp_alpha; - if(weight[0] > 0.0) { + if (weight[0] > 0.0) { Color += weight[0]*image_texture_lookup(filename, color_space, Vector[1], Vector[2], tmp_alpha); Alpha += weight[0]*tmp_alpha; } - if(weight[1] > 0.0) { + if (weight[1] > 0.0) { Color += weight[1]*image_texture_lookup(filename, color_space, Vector[0], Vector[2], tmp_alpha); Alpha += weight[1]*tmp_alpha; } - if(weight[2] > 0.0) { + if (weight[2] > 0.0) { Color += weight[2]*image_texture_lookup(filename, color_space, Vector[1], Vector[0], tmp_alpha); Alpha += weight[2]*tmp_alpha; } diff --git a/intern/cycles/kernel/osl/nodes/node_light_falloff.osl b/intern/cycles/kernel/osl/nodes/node_light_falloff.osl index fd68594a1d8..3877b6d5bdc 100644 --- a/intern/cycles/kernel/osl/nodes/node_light_falloff.osl +++ b/intern/cycles/kernel/osl/nodes/node_light_falloff.osl @@ -29,9 +29,9 @@ shader node_light_falloff( float strength = Strength; getattribute("std::ray_length", ray_length); - if(Smooth > 0.0) { + if (Smooth > 0.0) { float squared = ray_length*ray_length; - strength *= squared/(Smooth + squared); + strength *= squared / (Smooth + squared); } /* Quadratic */ |