Code cleanup / Cycles:
* Simplify shaperadius() function a bit to avoid castings. * Style cleanup 1.f -> 1.0f, to follow rest of Cycles code.
This commit is contained in:
@@ -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 shaperadius(float shape, float root, float tip, float time)
|
||||||
{
|
{
|
||||||
float radius = 1.0f - time;
|
float radius = 1.0f - time;
|
||||||
|
|
||||||
if(shape != 0.0f) {
|
if(shape != 0.0f) {
|
||||||
if(shape < 0.0f)
|
if(shape < 0.0f)
|
||||||
radius = (float)pow(1.0f - time, 1.f + shape);
|
radius = powf(radius, 1.0f + shape);
|
||||||
else
|
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;
|
return (radius * (root - tip)) + tip;
|
||||||
}
|
}
|
||||||
|
@@ -1141,7 +1141,7 @@ __device void kernel_path_trace(KernelGlobals *kg,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
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 */
|
/* accumulate result in output buffer */
|
||||||
kernel_write_pass_float4(buffer, sample, L);
|
kernel_write_pass_float4(buffer, sample, L);
|
||||||
|
@@ -382,7 +382,7 @@ static float2 sky_spherical_coordinates(float3 dir)
|
|||||||
|
|
||||||
static float sky_perez_function(float lam[6], float theta, float gamma)
|
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)
|
static void sky_texture_precompute(KernelSunSky *ksunsky, float3 dir, float turbidity)
|
||||||
|
@@ -195,7 +195,7 @@ __device_inline Transform transform_rotate(float angle, float3 axis)
|
|||||||
{
|
{
|
||||||
float s = sinf(angle);
|
float s = sinf(angle);
|
||||||
float c = cosf(angle);
|
float c = cosf(angle);
|
||||||
float t = 1.f - c;
|
float t = 1.0f - c;
|
||||||
|
|
||||||
axis = normalize(axis);
|
axis = normalize(axis);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user