From 75e36650e35d556fa9959ac0c9e1831a070fb2ef Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 18 May 2013 11:04:29 +0000 Subject: Code cleanup / Cycles: * Simplify shaperadius() function a bit to avoid castings. * Style cleanup 1.f -> 1.0f, to follow rest of Cycles code. --- intern/cycles/blender/blender_curves.cpp | 5 +++-- intern/cycles/kernel/kernel_path.h | 2 +- intern/cycles/render/nodes.cpp | 2 +- intern/cycles/util/util_transform.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'intern') diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index df00c8fd92e..56d78fb5c26 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -115,11 +115,12 @@ void curveinterp_v3_v3v3v3v3(float3 *p, float3 *v1, float3 *v2, float3 *v3, floa float shaperadius(float shape, float root, float tip, float time) { float radius = 1.0f - time; + if(shape != 0.0f) { if(shape < 0.0f) - radius = (float)pow(1.0f - time, 1.f + shape); + radius = powf(radius, 1.0f + shape); else - radius = (float)pow(1.0f - time, 1.f / (1.f - shape)); + radius = powf(radius, 1.0f / (1.0f - shape)); } return (radius * (root - tip)) + tip; } diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index b5a179d0b20..040f50273be 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -1141,7 +1141,7 @@ __device void kernel_path_trace(KernelGlobals *kg, #endif } else - L = make_float4(0.f, 0.f, 0.f, 0.f); + L = make_float4(0.0f, 0.0f, 0.0f, 0.0f); /* accumulate result in output buffer */ kernel_write_pass_float4(buffer, sample, L); diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index d7ac379739d..7435616ffc0 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -382,7 +382,7 @@ static float2 sky_spherical_coordinates(float3 dir) static float sky_perez_function(float lam[6], float theta, float gamma) { - return (1.f + lam[0]*expf(lam[1]/cosf(theta))) * (1.f + lam[2]*expf(lam[3]*gamma) + lam[4]*cosf(gamma)*cosf(gamma)); + return (1.0f + lam[0]*expf(lam[1]/cosf(theta))) * (1.0f + lam[2]*expf(lam[3]*gamma) + lam[4]*cosf(gamma)*cosf(gamma)); } static void sky_texture_precompute(KernelSunSky *ksunsky, float3 dir, float turbidity) diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h index 33761827dd7..66801e90b56 100644 --- a/intern/cycles/util/util_transform.h +++ b/intern/cycles/util/util_transform.h @@ -195,7 +195,7 @@ __device_inline Transform transform_rotate(float angle, float3 axis) { float s = sinf(angle); float c = cosf(angle); - float t = 1.f - c; + float t = 1.0f - c; axis = normalize(axis); -- cgit v1.2.3