Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-12-04 07:18:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-04 07:18:08 +0400
commitc0078a987978348f200322764e06afbcc378b81f (patch)
tree50bc8bfc82ea30da6ed35f112c7975385f4ee488 /intern/cycles/kernel/shaders/node_image_texture.osl
parenteeece25d82b8e4485e0977dafd6de46f9ff2ba9f (diff)
osl style cleanup and update man-page.
Diffstat (limited to 'intern/cycles/kernel/shaders/node_image_texture.osl')
-rw-r--r--intern/cycles/kernel/shaders/node_image_texture.osl24
1 files changed, 12 insertions, 12 deletions
diff --git a/intern/cycles/kernel/shaders/node_image_texture.osl b/intern/cycles/kernel/shaders/node_image_texture.osl
index 53c4aeaeb5f..99074672a6a 100644
--- a/intern/cycles/kernel/shaders/node_image_texture.osl
+++ b/intern/cycles/kernel/shaders/node_image_texture.osl
@@ -68,26 +68,26 @@ shader node_image_texture(
vector weight = vector(0.0, 0.0, 0.0);
float blend = projection_blend;
- float limit = 0.5*(1.0 + 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) {
/* in case of blending, test for mixes between two textures */
- if (Nob[2] < (1.0 - limit)*(Nob[1] + Nob[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])) {
+ 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];
@@ -111,16 +111,16 @@ shader node_image_texture(
float tmp_alpha;
if (weight[0] > 0.0) {
- Color += weight[0]*image_texture_lookup(filename, color_space, p[1], p[2], tmp_alpha);
- Alpha += weight[0]*tmp_alpha;
+ Color += weight[0] * image_texture_lookup(filename, color_space, p[1], p[2], tmp_alpha);
+ Alpha += weight[0] * tmp_alpha;
}
if (weight[1] > 0.0) {
- Color += weight[1]*image_texture_lookup(filename, color_space, p[0], p[2], tmp_alpha);
- Alpha += weight[1]*tmp_alpha;
+ Color += weight[1] * image_texture_lookup(filename, color_space, p[0], p[2], tmp_alpha);
+ Alpha += weight[1] * tmp_alpha;
}
if (weight[2] > 0.0) {
- Color += weight[2]*image_texture_lookup(filename, color_space, p[1], p[0], tmp_alpha);
- Alpha += weight[2]*tmp_alpha;
+ Color += weight[2] * image_texture_lookup(filename, color_space, p[1], p[0], tmp_alpha);
+ Alpha += weight[2] * tmp_alpha;
}
}
}