diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-02-17 03:47:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-02-17 18:26:24 +0300 |
commit | 68dd7617d705dd255b29b99074afa107ce38031e (patch) | |
tree | 1e253ab76b87e7f22a09db2f1137db3a1b8ecb6c /intern/cycles/kernel/kernel_projection.h | |
parent | 8119f0aad21c3ce88e82d68ed20cd5a8edc99703 (diff) |
Cycles: add utility functions for zero float2/float3/float4/transform
Ref D8237, T78710
Diffstat (limited to 'intern/cycles/kernel/kernel_projection.h')
-rw-r--r-- | intern/cycles/kernel/kernel_projection.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/kernel/kernel_projection.h b/intern/cycles/kernel/kernel_projection.h index f74ced45fd5..387af54cf27 100644 --- a/intern/cycles/kernel/kernel_projection.h +++ b/intern/cycles/kernel/kernel_projection.h @@ -56,7 +56,7 @@ ccl_device float3 spherical_to_direction(float theta, float phi) ccl_device float2 direction_to_equirectangular_range(float3 dir, float4 range) { if (is_zero(dir)) - return make_float2(0.0f, 0.0f); + return zero_float2(); float u = (atan2f(dir.y, dir.x) - range.y) / range.x; float v = (acosf(dir.z / len(dir)) - range.w) / range.z; @@ -103,7 +103,7 @@ ccl_device float3 fisheye_to_direction(float u, float v, float fov) float r = sqrtf(u * u + v * v); if (r > 1.0f) - return make_float3(0.0f, 0.0f, 0.0f); + return zero_float3(); float phi = safe_acosf((r != 0.0f) ? u / r : 0.0f); float theta = r * fov * 0.5f; @@ -136,7 +136,7 @@ fisheye_equisolid_to_direction(float u, float v, float lens, float fov, float wi float r = sqrtf(u * u + v * v); if (r > rmax) - return make_float3(0.0f, 0.0f, 0.0f); + return zero_float3(); float phi = safe_acosf((r != 0.0f) ? u / r : 0.0f); float theta = 2.0f * asinf(r / (2.0f * lens)); @@ -158,7 +158,7 @@ ccl_device float3 mirrorball_to_direction(float u, float v) dir.z = 2.0f * v - 1.0f; if (dir.x * dir.x + dir.z * dir.z > 1.0f) - return make_float3(0.0f, 0.0f, 0.0f); + return zero_float3(); dir.y = -sqrtf(max(1.0f - dir.x * dir.x - dir.z * dir.z, 0.0f)); |