From 68dd7617d705dd255b29b99074afa107ce38031e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 17 Feb 2021 01:47:18 +0100 Subject: Cycles: add utility functions for zero float2/float3/float4/transform Ref D8237, T78710 --- intern/cycles/kernel/kernel_projection.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'intern/cycles/kernel/kernel_projection.h') 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)); -- cgit v1.2.3