[Bf-blender-cvs] [8cea610] master: Fix compiler error in Cycles Beckmann sampling precomputation: strict compiler flags don't allow implicit double -> float casting.

Lukas Tönne noreply at git.blender.org
Mon Jun 23 09:57:04 CEST 2014


Commit: 8cea610e74f4041388cd0a926de08abcea9d4092
Author: Lukas Tönne
Date:   Mon Jun 23 09:47:52 2014 +0200
https://developer.blender.org/rB8cea610e74f4041388cd0a926de08abcea9d4092

Fix compiler error in Cycles Beckmann sampling precomputation: strict
compiler flags don't allow implicit double -> float casting.

Code was added in rB8fbd71e.

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

M	intern/cycles/render/shader.cpp

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

diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index 87107ae..b968580 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -68,13 +68,13 @@ static void beckmann_table_rows(float *table, int row_from, int row_to)
 			slope_x[index_slope_x] = -beckmann_table_slope_max() + 2.0f * beckmann_table_slope_max() * index_slope_x/(DATA_TMP_SIZE - 1.0f);
 
 			/* dot product with incident vector */
-			float dot_product = fmaxf(0.0f, -slope_x[index_slope_x]*sin_theta + cos_theta);
+			float dot_product = fmaxf(0.0f, -(float)slope_x[index_slope_x]*sin_theta + cos_theta);
 			/* marginalize P22_{omega_i}(x_slope, 1, 1), Eq. (10) */
 			float P22_omega_i = 0.0f;
 
 			for(int j = 0; j < 100; ++j) {
 				float slope_y = -beckmann_table_slope_max() + 2.0f * beckmann_table_slope_max() * j * (1.0f/99.0f);
-				P22_omega_i += dot_product * beckmann_table_P22(slope_x[index_slope_x], slope_y);
+				P22_omega_i += dot_product * beckmann_table_P22((float)slope_x[index_slope_x], slope_y);
 			}
 
 			/* CDF of P22_{omega_i}(x_slope, 1, 1), Eq. (10) */




More information about the Bf-blender-cvs mailing list