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:
authorSv. Lockal <lockalsash@gmail.com>2014-01-14 22:55:02 +0400
committerSv. Lockal <lockalsash@gmail.com>2014-01-14 22:55:02 +0400
commit1c49eb0072845cfad74bc141a8a05f875ac40430 (patch)
tree874c9e4d061a3477e031aa98db10eda0c7d21fe9 /intern/cycles/kernel/svm/svm_mix.h
parent1908c31b06d8c23ec19ce5f95dc3eb6aa6b3d2f4 (diff)
Cycles, Code cleanup: simplify code for color linear interpolation and float math
Reviewed By: brecht Differential Revision: https://developer.blender.org/D215
Diffstat (limited to 'intern/cycles/kernel/svm/svm_mix.h')
-rw-r--r--intern/cycles/kernel/svm/svm_mix.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/intern/cycles/kernel/svm/svm_mix.h b/intern/cycles/kernel/svm/svm_mix.h
index 0eeb4cf9b05..4e834b7c500 100644
--- a/intern/cycles/kernel/svm/svm_mix.h
+++ b/intern/cycles/kernel/svm/svm_mix.h
@@ -247,24 +247,7 @@ ccl_device float3 svm_mix_soft(float t, float3 col1, float3 col2)
ccl_device float3 svm_mix_linear(float t, float3 col1, float3 col2)
{
- float3 outcol = col1;
-
- if(col2.x > 0.5f)
- outcol.x = col1.x + t*(2.0f*(col2.x - 0.5f));
- else
- outcol.x = col1.x + t*(2.0f*(col2.x) - 1.0f);
-
- if(col2.y > 0.5f)
- outcol.y = col1.y + t*(2.0f*(col2.y - 0.5f));
- else
- outcol.y = col1.y + t*(2.0f*(col2.y) - 1.0f);
-
- if(col2.z > 0.5f)
- outcol.z = col1.z + t*(2.0f*(col2.z - 0.5f));
- else
- outcol.z = col1.z + t*(2.0f*(col2.z) - 1.0f);
-
- return outcol;
+ return col1 + t*(2.0f*col2 + make_float3(-1.0f, -1.0f, -1.0f));
}
ccl_device float3 svm_mix_clamp(float3 col)