[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56895] trunk/blender/intern/cycles: Code cleanup / Cycles:
Thomas Dinges
blender at dingto.org
Sat May 18 13:04:30 CEST 2013
Revision: 56895
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56895
Author: dingto
Date: 2013-05-18 11:04:29 +0000 (Sat, 18 May 2013)
Log Message:
-----------
Code cleanup / Cycles:
* Simplify shaperadius() function a bit to avoid castings.
* Style cleanup 1.f -> 1.0f, to follow rest of Cycles code.
Modified Paths:
--------------
trunk/blender/intern/cycles/blender/blender_curves.cpp
trunk/blender/intern/cycles/kernel/kernel_path.h
trunk/blender/intern/cycles/render/nodes.cpp
trunk/blender/intern/cycles/util/util_transform.h
Modified: trunk/blender/intern/cycles/blender/blender_curves.cpp
===================================================================
--- trunk/blender/intern/cycles/blender/blender_curves.cpp 2013-05-18 10:24:38 UTC (rev 56894)
+++ trunk/blender/intern/cycles/blender/blender_curves.cpp 2013-05-18 11:04:29 UTC (rev 56895)
@@ -115,11 +115,12 @@
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;
}
Modified: trunk/blender/intern/cycles/kernel/kernel_path.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_path.h 2013-05-18 10:24:38 UTC (rev 56894)
+++ trunk/blender/intern/cycles/kernel/kernel_path.h 2013-05-18 11:04:29 UTC (rev 56895)
@@ -1141,7 +1141,7 @@
#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);
Modified: trunk/blender/intern/cycles/render/nodes.cpp
===================================================================
--- trunk/blender/intern/cycles/render/nodes.cpp 2013-05-18 10:24:38 UTC (rev 56894)
+++ trunk/blender/intern/cycles/render/nodes.cpp 2013-05-18 11:04:29 UTC (rev 56895)
@@ -382,7 +382,7 @@
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)
Modified: trunk/blender/intern/cycles/util/util_transform.h
===================================================================
--- trunk/blender/intern/cycles/util/util_transform.h 2013-05-18 10:24:38 UTC (rev 56894)
+++ trunk/blender/intern/cycles/util/util_transform.h 2013-05-18 11:04:29 UTC (rev 56895)
@@ -195,7 +195,7 @@
{
float s = sinf(angle);
float c = cosf(angle);
- float t = 1.f - c;
+ float t = 1.0f - c;
axis = normalize(axis);
More information about the Bf-blender-cvs
mailing list