diff options
author | Thomas Dinges <blender@dingto.org> | 2013-06-14 18:29:00 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-06-14 18:29:00 +0400 |
commit | 88b30ccb8cc2552ec6ca118cdcab4f75d5fb19b5 (patch) | |
tree | 54b965dcf2bc40d8d39549b2890f84b01433cf22 /intern/cycles | |
parent | cc3476b07eacae29ab34c2f2bdbca8af63b10e78 (diff) |
Cycles:
* Style cleanup for M_PI constants.
* Move Wireframe node into __EXTRA_NODES__ define
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/kernel_montecarlo.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_projection.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_texture.h | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/kernel/kernel_montecarlo.h b/intern/cycles/kernel/kernel_montecarlo.h index f608429da36..7d5e4cd9df5 100644 --- a/intern/cycles/kernel/kernel_montecarlo.h +++ b/intern/cycles/kernel/kernel_montecarlo.h @@ -39,7 +39,7 @@ CCL_NAMESPACE_BEGIN /// [-1,1] uniformly distributed over a unit sphere. __device void to_unit_disk(float *x, float *y) { - float phi = 2.0f * M_PI_F * (*x); + float phi = M_2PI_F * (*x); float r = sqrtf(*y); *x = r * cosf(phi); diff --git a/intern/cycles/kernel/kernel_projection.h b/intern/cycles/kernel/kernel_projection.h index 6516b9e4d82..d9520de7956 100644 --- a/intern/cycles/kernel/kernel_projection.h +++ b/intern/cycles/kernel/kernel_projection.h @@ -57,7 +57,7 @@ __device float3 spherical_to_direction(float theta, float phi) __device float2 direction_to_equirectangular(float3 dir) { - float u = -atan2f(dir.y, dir.x)/(2.0f*M_PI_F) + 0.5f; + float u = -atan2f(dir.y, dir.x)/(M_2PI_F) + 0.5f; float v = atan2f(dir.z, hypotf(dir.x, dir.y))/M_PI_F + 0.5f; return make_float2(u, v); diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h index 7f0bb3163a1..e5df880b596 100644 --- a/intern/cycles/kernel/svm/svm.h +++ b/intern/cycles/kernel/svm/svm.h @@ -359,10 +359,10 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT case NODE_LAYER_WEIGHT: svm_node_layer_weight(sd, stack, node); break; +#ifdef __EXTRA_NODES__ case NODE_WIREFRAME: svm_node_wireframe(kg, sd, stack, node.y, node.z, node.w); break; -#ifdef __EXTRA_NODES__ case NODE_WAVELENGTH: svm_node_wavelength(sd, stack, node.y, node.z); break; diff --git a/intern/cycles/kernel/svm/svm_texture.h b/intern/cycles/kernel/svm/svm_texture.h index ba5b772b3a1..3347b623506 100644 --- a/intern/cycles/kernel/svm/svm_texture.h +++ b/intern/cycles/kernel/svm/svm_texture.h @@ -185,7 +185,7 @@ __device float noise_wave(NodeWaveBasis wave, float a) return 0.5f + 0.5f * sinf(a); } else if(wave == NODE_WAVE_SAW) { - float b = 2.0f*M_PI_F; + float b = M_2PI_F; int n = float_to_int(a / b); a -= n*b; if(a < 0.0f) a += b; @@ -193,7 +193,7 @@ __device float noise_wave(NodeWaveBasis wave, float a) return a / b; } else if(wave == NODE_WAVE_TRI) { - float b = 2.0f*M_PI_F; + float b = M_2PI_F; float rmax = 1.0f; return rmax - 2.0f*fabsf(floorf((a*(1.0f/b))+0.5f) - (a*(1.0f/b))); |