[Bf-blender-cvs] [97422ea] master: Cleanup: Simplify brick texture code a bit.

Thomas Dinges noreply at git.blender.org
Mon Feb 23 16:49:59 CET 2015


Commit: 97422ea64ff0d0f017c51394a9239fc43041e2f6
Author: Thomas Dinges
Date:   Mon Feb 23 16:49:17 2015 +0100
Branches: master
https://developer.blender.org/rB97422ea64ff0d0f017c51394a9239fc43041e2f6

Cleanup: Simplify brick texture code a bit.

===================================================================

M	intern/cycles/kernel/shaders/node_brick_texture.osl
M	intern/cycles/kernel/svm/svm_brick.h

===================================================================

diff --git a/intern/cycles/kernel/shaders/node_brick_texture.osl b/intern/cycles/kernel/shaders/node_brick_texture.osl
index 0b4993e..e26e8db 100644
--- a/intern/cycles/kernel/shaders/node_brick_texture.osl
+++ b/intern/cycles/kernel/shaders/node_brick_texture.osl
@@ -87,10 +87,7 @@ shader node_brick_texture(
 		
 	if (Fac != 1.0) {
 		float facm = 1.0 - tint;
-
-		Col[0] = facm * (Color1[0]) + tint * Color2[0];
-		Col[1] = facm * (Color1[1]) + tint * Color2[1];
-		Col[2] = facm * (Color1[2]) + tint * Color2[2];
+		Col = facm * Color1 + tint * Color2;
 	}
 	
 	Color = (Fac == 1.0) ? Mortar : Col;
diff --git a/intern/cycles/kernel/svm/svm_brick.h b/intern/cycles/kernel/svm/svm_brick.h
index a46392c..33a2a5c 100644
--- a/intern/cycles/kernel/svm/svm_brick.h
+++ b/intern/cycles/kernel/svm/svm_brick.h
@@ -95,10 +95,7 @@ ccl_device void svm_node_tex_brick(KernelGlobals *kg, ShaderData *sd, float *sta
 	
 	if(f != 1.0f) {
 		float facm = 1.0f - tint;
-
-		color1.x = facm * (color1.x) + tint * color2.x;
-		color1.y = facm * (color1.y) + tint * color2.y;
-		color1.z = facm * (color1.z) + tint * color2.z;
+		color1 = facm * color1 + tint * color2;
 	}
 
 	if(stack_valid(color_offset))




More information about the Bf-blender-cvs mailing list