Blender
V3.3
|
#include <cmath>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include "util/types.h"
#include "util/math_int2.h"
#include "util/math_int3.h"
#include "util/math_int4.h"
#include "util/math_float2.h"
#include "util/math_float3.h"
#include "util/math_float4.h"
#include "util/math_float8.h"
#include "util/rect.h"
Go to the source code of this file.
Macros | |
#define | M_PI_F (3.1415926535897932f) /* pi */ |
#define | M_PI_2_F (1.5707963267948966f) /* pi/2 */ |
#define | M_PI_4_F (0.7853981633974830f) /* pi/4 */ |
#define | M_1_PI_F (0.3183098861837067f) /* 1/pi */ |
#define | M_2_PI_F (0.6366197723675813f) /* 2/pi */ |
#define | M_1_2PI_F (0.1591549430918953f) /* 1/(2*pi) */ |
#define | M_SQRT_PI_8_F (0.6266570686577501f) /* sqrt(pi/8) */ |
#define | M_LN_2PI_F (1.8378770664093454f) /* ln(2*pi) */ |
#define | M_2PI_F (6.2831853071795864f) /* 2*pi */ |
#define | M_4PI_F (12.566370614359172f) /* 4*pi */ |
#define | M_SQRT2_F (1.4142135623730950f) /* sqrt(2) */ |
#define | M_SQRT3_F (1.7320508075688772f) /* sqrt(3) */ |
#define | M_LN2_F (0.6931471805599453f) /* ln(2) */ |
#define | M_LN10_F (2.3025850929940457f) /* ln(10) */ |
#define | __has_builtin(v) 0 |
Definition at line 945 of file util/math.h.
#define M_1_2PI_F (0.1591549430918953f) /* 1/(2*pi) */ |
Definition at line 49 of file util/math.h.
#define M_1_PI_F (0.3183098861837067f) /* 1/pi */ |
Definition at line 43 of file util/math.h.
#define M_2_PI_F (0.6366197723675813f) /* 2/pi */ |
Definition at line 46 of file util/math.h.
#define M_2PI_F (6.2831853071795864f) /* 2*pi */ |
Definition at line 60 of file util/math.h.
#define M_4PI_F (12.566370614359172f) /* 4*pi */ |
Definition at line 63 of file util/math.h.
#define M_LN10_F (2.3025850929940457f) /* ln(10) */ |
Definition at line 77 of file util/math.h.
#define M_LN2_F (0.6931471805599453f) /* ln(2) */ |
Definition at line 74 of file util/math.h.
#define M_LN_2PI_F (1.8378770664093454f) /* ln(2*pi) */ |
Definition at line 55 of file util/math.h.
#define M_PI_2_F (1.5707963267948966f) /* pi/2 */ |
Definition at line 37 of file util/math.h.
#define M_PI_4_F (0.7853981633974830f) /* pi/4 */ |
Definition at line 40 of file util/math.h.
#define M_PI_F (3.1415926535897932f) /* pi */ |
Definition at line 34 of file util/math.h.
Definition at line 68 of file util/math.h.
Definition at line 71 of file util/math.h.
Definition at line 52 of file util/math.h.
ccl_device_inline int4 __float4_as_int4 | ( | float4 | f | ) |
Definition at line 284 of file util/math.h.
References __float_as_int(), and make_int4.
Referenced by fast_exp2f4().
ccl_device_inline int __float_as_int | ( | float | f | ) |
Definition at line 243 of file util/math.h.
Referenced by __float4_as_int4(), SVMCompiler::add_node(), BVH(), compare_floats(), CurvesNode::compile(), PrincipledBsdfNode::compile(), VolumeNode::compile(), BsdfNode::compile(), fast_safe_powf(), float_to_half_display(), kernel_curve_shadow_transparency_evaluate(), kernel_ies_interp(), BVH2::pack_aligned_node(), BVHReference::prim_index(), BVHReference::prim_object(), ray_offset(), BVHRange::size(), SVMCompiler::stack_assign(), stack_load_int(), BVHRange::start(), and xor_signmask().
ccl_device_inline uint __float_as_uint | ( | float | f | ) |
Definition at line 263 of file util/math.h.
Referenced by __anyhit__kernel_optix_shadow_all_hit(), __closesthit__kernel_optix_hit(), __miss__kernel_optix_miss(), bvh_aligned_node_intersect(), bvh_node_intersect(), bvh_unaligned_node_intersect(), fast_atan2f(), fast_exp2f(), fast_log2f(), fast_logb(), film_get_pass_pixel_sample_count(), float_to_half_image(), hash_float2_to_float(), hash_float3_to_float(), hash_float4_to_float(), hash_float_to_float(), integrator_init_from_bake(), intersection_t_offset(), isfinite_safe(), isnan_safe(), kernel_adaptive_sampling_convergence_check(), and svm_node_tex_sky().
ccl_device_inline float4 __int4_as_float4 | ( | int4 | i | ) |
Definition at line 294 of file util/math.h.
References __int_as_float(), make_float4, int4::w, int4::x, int4::y, and int4::z.
Referenced by fast_exp2f4().
ccl_device_inline float __int_as_float | ( | int | i | ) |
Definition at line 253 of file util/math.h.
Referenced by __int4_as_float4(), BVHRange::BVHRange(), BVHReference::BVHReference(), LightManager::device_update_ies(), fast_safe_powf(), fill_shader_input(), half_to_float_image(), IESFile::pack(), BVH2::pack_leaf(), BVH2::pack_unaligned_node(), ray_offset(), BVH2::refit_node(), BVHRange::set_start(), stack_store_int(), svm_node_curve(), svm_node_curves(), svm_node_normal(), svm_node_tex_brick(), svm_node_tex_image_box(), and xor_signmask().
ccl_device_inline float __uint_as_float | ( | uint | i | ) |
Definition at line 273 of file util/math.h.
Referenced by __anyhit__kernel_optix_shadow_all_hit(), __anyhit__kernel_optix_visibility_test(), fast_exp2f(), fast_log2f(), fetch_float(), fetch_node_float(), intersection_t_offset(), BVH2::pack_leaf(), read_node_float(), BVH2::refit_node(), stack_load_float_default(), svm_node_closure_bsdf(), svm_node_closure_set_weight(), svm_node_closure_volume(), svm_node_fresnel(), svm_node_layer_weight(), svm_node_principled_volume(), svm_node_value_f(), and svm_node_value_v().
ccl_device_inline int abs | ( | int | x | ) |
ccl_device_inline int as_int | ( | uint | i | ) |
Definition at line 212 of file util/math.h.
Referenced by BM_mesh_intersect_edges().
ccl_device_inline uint as_uint | ( | float | f | ) |
Definition at line 232 of file util/math.h.
ccl_device_inline uint as_uint | ( | int | i | ) |
Definition at line 222 of file util/math.h.
Referenced by emit_attribute_map_entry().
ccl_device_inline float beta | ( | float | x, |
float | y | ||
) |
Definition at line 775 of file util/math.h.
References expf, lgammaf, x, and y.
Referenced by Freestyle::OGF::NormalCycle::accumulate_dihedral_angle(), BKE_lnor_space_custom_data_to_normal(), BKE_lnor_space_custom_normal_to_data(), BKE_lnor_space_define(), Eigen::internal::constrained_conjugate_gradient(), cubic_subdiv(), dBoxBox2(), dLineClosestApproach(), blender::compositor::ChromaMatteOperation::execute_pixel_sampled(), KDL::Rotation::GetEulerZYZ(), Freestyle::SilhouetteGeomEngine::ImageToWorldParameter(), KDL::LinComb(), KDL::LinCombR(), mf_eval(), libmv::Dogleg< Function, Jacobian, Solver >::minimize(), p_abf_matrix_invert(), posrandom(), random(), rotateDifferentialCoordinates(), SCULPT_do_surface_smooth_brush_displace_task_cb_ex(), SCULPT_surface_smooth_displace_step(), btConjugateGradient< MatrixX >::solve(), btConjugateResidual< MatrixX >::solve(), btDeformableBodySolver::solveDeformableConstraints(), libmv::Dogleg< Function, Jacobian, Solver >::SolveDoglegDirection(), solveSingleIteration(), triangle_light_pdf(), triangle_light_sample(), blender::compositor::ChromaMatteOperation::update_memory_buffer_partial(), and volume_preservation().
ccl_device float bits_to_01 | ( | uint | bits | ) |
Definition at line 785 of file util/math.h.
References float().
ccl_device_inline int ceil_to_int | ( | float | f | ) |
Definition at line 427 of file util/math.h.
References ceilf, and float_to_int().
ccl_device_inline float clamp | ( | float | a, |
float | mn, | ||
float | mx | ||
) |
Definition at line 372 of file util/math.h.
References Freestyle::a, max(), and min().
ccl_device_inline int clamp | ( | int | a, |
int | mn, | ||
int | mx | ||
) |
Definition at line 367 of file util/math.h.
References Freestyle::a, max(), and min().
Referenced by safe_acosf(), safe_asinf(), and saturatef().
ccl_device_inline bool compare_floats | ( | float | a, |
float | b, | ||
float | abs_diff, | ||
int | ulp_diff | ||
) |
Definition at line 909 of file util/math.h.
References __float_as_int(), Freestyle::a, abs(), usdtokens::b(), and fabsf.
ccl_device float compatible_powf | ( | float | x, |
float | y | ||
) |
Definition at line 701 of file util/math.h.
References fmodf, powf, x, and y.
Referenced by safe_powf().
ccl_device_inline float compatible_signf | ( | float | f | ) |
Definition at line 474 of file util/math.h.
References signf().
ccl_device_inline uint count_leading_zeros | ( | uint | x | ) |
Definition at line 813 of file util/math.h.
References x.
Referenced by find_first_set(), next_power_of_two(), and prev_power_of_two().
ccl_device_inline uint count_trailing_zeros | ( | uint | x | ) |
Definition at line 833 of file util/math.h.
References x.
Definition at line 521 of file util/math.h.
References Freestyle::a, usdtokens::b(), Freestyle::c, and x.
Referenced by interpolate_ies_vertical(), and kernel_ies_interp().
ccl_device_inline float ensure_finite | ( | float | v | ) |
Definition at line 361 of file util/math.h.
References isfinite_safe(), and v.
Referenced by kernel_accum_clamp(), kernel_background_evaluate(), kernel_displace_evaluate(), read_shader_output(), snoise_1d(), snoise_2d(), snoise_3d(), and snoise_4d().
ccl_device_inline uint find_first_set | ( | uint | x | ) |
Definition at line 853 of file util/math.h.
References count_leading_zeros(), and x.
ccl_device_inline float3 float2_to_float3 | ( | const float2 | a | ) |
Definition at line 495 of file util/math.h.
References Freestyle::a, and make_float3.
Referenced by primitive_motion_vector().
ccl_device_inline float4 float3_to_float4 | ( | const float3 | a | ) |
Definition at line 505 of file util/math.h.
References Freestyle::a, and make_float4.
Referenced by Hair::apply_transform(), PointCloud::apply_transform(), BVHObjectBinning::BVHObjectBinning(), TextureMapping::compile(), CurvesNode::compile(), CurveSegmentMotionCV(), ShaderManager::device_update_common(), ParticleSystemManager::device_update_particles(), export_hair_curves_motion(), export_hair_motion_validate_attribute(), ExportCurveSegmentsMotion(), hair_point_as_float4(), and transform_inverse_impl().
ccl_device_inline float4 float3_to_float4 | ( | const float3 | a, |
const float | w | ||
) |
Definition at line 510 of file util/math.h.
References Freestyle::a, make_float4, and w().
ccl_device_inline float3 float4_to_float3 | ( | const float4 | a | ) |
Definition at line 500 of file util/math.h.
References Freestyle::a, and make_float3.
Referenced by Hair::apply_transform(), PointCloud::apply_transform(), PointCloud::Point::bounds_grow(), Hair::Curve::bounds_grow(), bsdf_principled_hair_eval(), bsdf_principled_hair_sample(), camera_sample_orthographic(), camera_sample_perspective(), ShaderManager::init_xyz_transforms(), linear_rgb_to_gray(), particle_angular_velocity(), particle_location(), particle_velocity(), primitive_motion_vector(), rec709_to_rgb(), set_attribute_float4(), set_default_value(), shader_setup_from_curve(), sky_radiance_nishita(), svm_node_attr(), svm_node_attr_bump_dx(), svm_node_attr_bump_dy(), svm_node_min_max(), svm_node_rgb_ramp(), svm_node_vertex_color(), svm_node_vertex_color_bump_dx(), svm_node_vertex_color_bump_dy(), transform_uniform_scale(), and xyz_to_rgb().
ccl_device_inline int float_to_int | ( | float | f | ) |
Definition at line 410 of file util/math.h.
Referenced by ceil_to_int(), fast_rint(), float_ramp_lookup(), floor_to_int(), floorfrac(), CCL_NAMESPACE_BEGIN::frac(), fractal_noise_1d(), fractal_noise_2d(), fractal_noise_3d(), fractal_noise_4d(), lookup_table_read(), lookup_table_read_2D(), noise_musgrave_fBm_1d(), noise_musgrave_fBm_2d(), noise_musgrave_fBm_3d(), noise_musgrave_fBm_4d(), noise_musgrave_hetero_terrain_1d(), noise_musgrave_hetero_terrain_2d(), noise_musgrave_hetero_terrain_3d(), noise_musgrave_hetero_terrain_4d(), noise_musgrave_hybrid_multi_fractal_1d(), noise_musgrave_hybrid_multi_fractal_2d(), noise_musgrave_hybrid_multi_fractal_3d(), noise_musgrave_hybrid_multi_fractal_4d(), noise_musgrave_multi_fractal_1d(), noise_musgrave_multi_fractal_2d(), noise_musgrave_multi_fractal_3d(), noise_musgrave_multi_fractal_4d(), noise_musgrave_ridged_multi_fractal_1d(), noise_musgrave_ridged_multi_fractal_2d(), noise_musgrave_ridged_multi_fractal_3d(), noise_musgrave_ridged_multi_fractal_4d(), rgb_ramp_lookup(), safe_powf(), svm_checker(), svm_image_texture_frac(), svm_node_convert(), and svm_node_wavelength().
ccl_device_inline int floor_to_int | ( | float | f | ) |
Definition at line 415 of file util/math.h.
References float_to_int(), and floorf.
Referenced by HdCyclesDelegate::GetRenderStats(), and svm_brick().
ccl_device_inline float floorfrac | ( | float | x, |
ccl_private int * | i | ||
) |
Definition at line 420 of file util/math.h.
References float_to_int(), floorf, and x.
Referenced by perlin_1d(), perlin_2d(), perlin_3d(), and perlin_4d().
ccl_device_inline float fractf | ( | float | x | ) |
ccl_device_inline float inverse_lerp | ( | float | a, |
float | b, | ||
float | x | ||
) |
Definition at line 515 of file util/math.h.
References Freestyle::a, usdtokens::b(), and x.
Referenced by kernel_ies_interp().
ccl_device_inline float inversesqrtf | ( | float | f | ) |
ccl_device_inline bool isfinite_safe | ( | float | f | ) |
Definition at line 353 of file util/math.h.
References __float_as_uint(), and x.
Referenced by bsdf_alloc(), bsdf_principled_hair_eval(), bsdf_principled_hair_sample(), ensure_finite(), intersection_ray_valid(), intersection_t_offset(), kernel_accum_clamp(), kernel_background_evaluate(), kernel_displace_evaluate(), subsurface_random_walk(), transform_decomposed_isfinite_safe(), transform_isfinite_safe(), and Mesh::Triangle::valid().
ccl_device_inline bool isnan_safe | ( | float | f | ) |
Definition at line 347 of file util/math.h.
References __float_as_uint(), and x.
CCL_NAMESPACE_END CCL_NAMESPACE_BEGIN A lerp | ( | const A & | a, |
const A & | b, | ||
const B & | t | ||
) |
Definition at line 548 of file util/math.h.
References A, Freestyle::a, B, usdtokens::b(), and t.
ccl_device_inline void make_orthonormals | ( | const float3 | N, |
ccl_private float3 * | a, | ||
ccl_private float3 * | b | ||
) |
Definition at line 566 of file util/math.h.
References Freestyle::a, usdtokens::b(), blender::math::cross(), fabsf, make_float3, N, and blender::math::normalize().
Referenced by bsdf_ashikhmin_shirley_sample(), bsdf_microfacet_beckmann_sample(), bsdf_microfacet_ggx_sample(), bsdf_microfacet_multi_ggx_eval_reflect(), bsdf_microfacet_multi_ggx_glass_eval_reflect(), bsdf_microfacet_multi_ggx_glass_eval_transmit(), bsdf_microfacet_multi_ggx_glass_sample(), bsdf_microfacet_multi_ggx_sample(), differential_incoming_compact(), differential_transfer_compact(), direction_from_cosine(), disk_light_sample(), henyey_greenstrein_sample(), sample_cos_hemisphere(), sample_uniform_cone(), sample_uniform_hemisphere(), subsurface_disk(), and svm_node_enter_bump_eval().
ccl_device_inline float2 map_to_sphere | ( | const float3 | co | ) |
Definition at line 883 of file util/math.h.
References atan2f, l, len, M_PI_F, make_float2, safe_acosf(), UNLIKELY, v, float3::x, float3::y, and float3::z.
ccl_device_inline float2 map_to_tube | ( | const float3 | co | ) |
ccl_device_inline double max | ( | double | a, |
double | b | ||
) |
Definition at line 172 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline float max | ( | float | a, |
float | b | ||
) |
Definition at line 162 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline int max | ( | int | a, |
int | b | ||
) |
Definition at line 113 of file util/math.h.
References Freestyle::a, and usdtokens::b().
Referenced by clamp(), max4(), safe_sqrtf(), and wrapf().
ccl_device_inline std::enable_if_t<std::is_same_v<T, size_t>, T> max | ( | T | a, |
T | b | ||
) |
Definition at line 151 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline uint32_t max | ( | uint32_t | a, |
uint32_t | b | ||
) |
Definition at line 123 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline uint64_t max | ( | uint64_t | a, |
uint64_t | b | ||
) |
Definition at line 133 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline T max4 | ( | const T & | a, |
const T & | b, | ||
const T & | c, | ||
const T & | d | ||
) |
Definition at line 193 of file util/math.h.
References Freestyle::a, usdtokens::b(), Freestyle::c, and max().
Referenced by bvh_aligned_node_intersect(), and bvh_unaligned_node_intersect_child().
Definition at line 204 of file util/math.h.
References Freestyle::a, usdtokens::b(), Freestyle::c, and max().
ccl_device_inline double min | ( | double | a, |
double | b | ||
) |
Definition at line 177 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline float min | ( | float | a, |
float | b | ||
) |
Definition at line 167 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline int min | ( | int | a, |
int | b | ||
) |
Definition at line 118 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline std::enable_if_t<std::is_same_v<T, size_t>, T> min | ( | T | a, |
T | b | ||
) |
Definition at line 157 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline uint32_t min | ( | uint32_t | a, |
uint32_t | b | ||
) |
Definition at line 128 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline uint64_t min | ( | uint64_t | a, |
uint64_t | b | ||
) |
Definition at line 138 of file util/math.h.
References Freestyle::a, and usdtokens::b().
ccl_device_inline T min4 | ( | const T & | a, |
const T & | b, | ||
const T & | c, | ||
const T & | d | ||
) |
Definition at line 188 of file util/math.h.
References Freestyle::a, usdtokens::b(), Freestyle::c, and min().
Referenced by bvh_aligned_node_intersect(), and bvh_unaligned_node_intersect_child().
Definition at line 199 of file util/math.h.
References Freestyle::a, usdtokens::b(), Freestyle::c, and min().
ccl_device_inline float mix | ( | float | a, |
float | b, | ||
float | t | ||
) |
Definition at line 377 of file util/math.h.
References Freestyle::a, usdtokens::b(), and t.
ccl_device_inline int mod | ( | int | x, |
int | m | ||
) |
Definition at line 490 of file util/math.h.
References x.
Referenced by bc_get_assigned_armature(), BKE_gpencil_modifier_blend_read_lib(), BKE_modifier_blend_read_lib(), bli_load_symbols(), bli_windows_get_module_name(), BPY_app_icons_module(), BPY_app_timers_module(), bpy_import_test(), BPy_init_modules(), BPY_modules_update(), bpy_pydriver_create_dict(), BPY_python_start(), BPyInit_bmesh(), BPyInit_gpu(), BPyInit_idprop(), BPyInit_imbuf(), CCL_python_module_init(), create_edge_from_corner(), create_split_edge_from_corner(), edit_modifier_poll_generic(), GHOST_SystemSDL::getModifierKeys(), gpencil_edit_modifier_poll_generic(), object_subdivision_type(), obrel_armature_find(), Mesh::pack_patches(), padding(), psys_apply_child_modifiers(), PyC_FileAndNum(), PyC_NameSpace_ImportArray(), PyC_RunString_AsNumber(), PyInit_mathutils(), RNA_property_overridable_get(), sculpt_boundary_falloff_factor_init(), DiagSplit::split_ngon(), subd_triangle_patch_corners(), Mesh::tessellate(), and blender::nodes::try_dispatch_float_math_fl3_fl3_to_fl3().
ccl_device_inline uint next_power_of_two | ( | uint | x | ) |
Definition at line 933 of file util/math.h.
References count_leading_zeros(), and x.
Referenced by round_num_samples_to_power_of_2(), round_up_to_power_of_two(), and TEST().
ccl_device_inline float nonzerof | ( | float | f, |
float | eps | ||
) |
Definition at line 465 of file util/math.h.
ccl_device_inline float pingpongf | ( | float | a, |
float | b | ||
) |
Definition at line 444 of file util/math.h.
References Freestyle::a, usdtokens::b(), fabsf, and fractf().
ccl_device_inline uint pointer_pack_to_uint_0 | ( | T * | ptr | ) |
Definition at line 316 of file util/math.h.
References ptr.
ccl_device_inline uint pointer_pack_to_uint_1 | ( | T * | ptr | ) |
Definition at line 321 of file util/math.h.
References ptr.
ccl_device_inline T* pointer_unpack_from_uint | ( | const uint | a, |
const uint | b | ||
) |
Definition at line 326 of file util/math.h.
References Freestyle::a, usdtokens::b(), and T.
ccl_device_inline uint popcount | ( | uint | x | ) |
Definition at line 794 of file util/math.h.
References x.
Referenced by gpu_parallel_active_index_array_impl(), if(), and sample_is_even().
ccl_device_inline float pow20 | ( | float | a | ) |
Definition at line 751 of file util/math.h.
References Freestyle::a, and sqr().
ccl_device_inline float pow22 | ( | float | a | ) |
Definition at line 756 of file util/math.h.
References Freestyle::a, and sqr().
ccl_device_inline float precise_angle | ( | float3 | a, |
float3 | b | ||
) |
Definition at line 927 of file util/math.h.
References Freestyle::a, atan2f, usdtokens::b(), and len.
Referenced by sky_radiance_nishita().
ccl_device_inline uint prev_power_of_two | ( | uint | x | ) |
Definition at line 939 of file util/math.h.
References count_leading_zeros(), and x.
Referenced by round_down_to_power_of_two(), and TEST().
ccl_device_inline uint32_t reverse_integer_bits | ( | uint32_t | x | ) |
Definition at line 949 of file util/math.h.
References x.
Referenced by nested_uniform_scramble(), and TEST().
ccl_device_inline float3 rotate_around_axis | ( | float3 | p, |
float3 | axis, | ||
float | angle | ||
) |
Definition at line 654 of file util/math.h.
References angle(), cosf, r, sinf, float3::x, float3::y, and float3::z.
Referenced by svm_node_closure_bsdf(), and svm_node_vector_rotate().
ccl_device float safe_acosf | ( | float | a | ) |
Definition at line 696 of file util/math.h.
References Freestyle::a, acosf, clamp(), and CLAMP.
Referenced by attr_create_pointiness(), bsdf_diffuse_toon_eval_reflect(), bsdf_glossy_toon_eval_reflect(), direction_to_fisheye_equisolid(), direction_to_fisheye_lens_polynomial(), direction_to_spherical(), fisheye_equisolid_to_direction(), fisheye_lens_polynomial_to_direction(), fisheye_to_direction(), map_to_sphere(), rect_light_sample(), sky_angle_between(), svm_math(), svm_node_ies(), and blender::nodes::try_dispatch_float_math_fl_to_fl().
ccl_device float safe_asinf | ( | float | a | ) |
Definition at line 691 of file util/math.h.
References Freestyle::a, asinf, clamp(), and CLAMP.
Referenced by bsdf_hair_reflection_sample(), bsdf_principled_hair_eval(), bsdf_principled_hair_sample(), spherical_stereo_transform(), svm_math(), and blender::nodes::try_dispatch_float_math_fl_to_fl().
ccl_device float safe_divide | ( | float | a, |
float | b | ||
) |
Definition at line 728 of file util/math.h.
References Freestyle::a, and usdtokens::b().
Referenced by safe_logf().
ccl_device_inline float3 safe_divide_color | ( | float3 | a, |
float3 | b | ||
) |
Definition at line 605 of file util/math.h.
References Freestyle::a, usdtokens::b(), make_float3, x, y, and z.
Referenced by hair_attenuation(), and subsurface_random_walk_coefficients().
ccl_device_inline float3 safe_divide_even_color | ( | float3 | a, |
float3 | b | ||
) |
Definition at line 616 of file util/math.h.
References Freestyle::a, usdtokens::b(), if(), make_float3, x, y, and z.
Referenced by film_get_pass_pixel_light_path().
ccl_device_inline float3 safe_invert_color | ( | float3 | a | ) |
Definition at line 594 of file util/math.h.
References Freestyle::a, make_float3, x, y, and z.
ccl_device float safe_logf | ( | float | a, |
float | b | ||
) |
Definition at line 733 of file util/math.h.
References Freestyle::a, usdtokens::b(), logf, safe_divide(), and UNLIKELY.
Referenced by svm_math(), TEST(), and blender::nodes::try_dispatch_float_math_fl_fl_to_fl().
ccl_device float safe_modulo | ( | float | a, |
float | b | ||
) |
Definition at line 741 of file util/math.h.
References Freestyle::a, usdtokens::b(), and fmodf.
ccl_device float safe_powf | ( | float | a, |
float | b | ||
) |
Definition at line 720 of file util/math.h.
References Freestyle::a, usdtokens::b(), compatible_powf(), float_to_int(), powf, and UNLIKELY.
Referenced by single_peaked_henyey_greenstein(), svm_math(), TEST(), and blender::nodes::try_dispatch_float_math_fl_fl_to_fl().
ccl_device_inline float safe_sqrtf | ( | float | f | ) |
Definition at line 677 of file util/math.h.
References Freestyle::a, max(), MAX2, and sqrtf.
Referenced by beckmann_table_rows(), bsdf_beckmann_aniso_G1(), bsdf_beckmann_G1(), bsdf_microfacet_ggx_eval_reflect(), bsdf_microfacet_ggx_eval_transmit(), bsdf_microfacet_ggx_sample(), bssrdf_burley_sample(), cos_from_sin(), direction_from_cosine(), ensure_valid_reflection(), henyey_greenstrein_sample(), light_spread_attenuation(), mf_sample_phase_glass(), mf_sampleP22_11(), microfacet_ggx_sample_slopes(), microfacet_sample_stretched(), sample_uniform_cone(), shader_bsdf_average_roughness(), sky_radiance_nishita(), svm_math(), svm_node_closure_bsdf(), triangle_light_sample(), and blender::nodes::try_dispatch_float_math_fl_to_fl().
ccl_device_inline float saturatef | ( | float | a | ) |
Definition at line 404 of file util/math.h.
References Freestyle::a, and clamp().
Referenced by bsdf_diffuse_toon_setup(), bsdf_glossy_toon_setup(), bsdf_microfacet_beckmann_refraction_setup(), bsdf_microfacet_beckmann_setup(), bsdf_microfacet_ggx_clearcoat_setup(), bsdf_microfacet_ggx_fresnel_setup(), bsdf_microfacet_ggx_refraction_setup(), bsdf_microfacet_ggx_setup(), bsdf_oren_nayar_setup(), film_calculate_shadow_catcher_matte_with_shadow(), film_get_pass_pixel_mist(), film_transparency_to_alpha(), float_ramp_lookup(), ConstantFolder::fold_mix(), kernel_write_data_passes(), lookup_table_read(), lookup_table_read_2D(), ConstantFolder::make_constant_clamp(), mf_C1(), mf_ggx_albedo(), mf_ggx_transmission_albedo(), mf_invC1(), noise_musgrave_ridged_multi_fractal_1d(), noise_musgrave_ridged_multi_fractal_2d(), noise_musgrave_ridged_multi_fractal_3d(), noise_musgrave_ridged_multi_fractal_4d(), rgb_ramp_lookup(), saturate(), svm_brick(), svm_mix(), svm_node_closure_bsdf(), svm_node_hsv(), svm_node_mix_closure(), svm_node_tex_gradient(), and svm_node_tex_image_box().
ccl_device_inline float signf | ( | float | f | ) |
Definition at line 460 of file util/math.h.
Referenced by BKE_texture_mapping_init(), compatible_signf(), TextureMapping::compute_transform(), computeBindWeights(), constraintSizeLim(), nonzerof(), shrinkwrap_snap_with_side(), svm_node_set_bump(), and volume_henyey_greenstein_setup().
ccl_device_inline float smoothminf | ( | float | a, |
float | b, | ||
float | k | ||
) |
Definition at line 449 of file util/math.h.
References Freestyle::a, usdtokens::b(), fabsf, fmaxf, and fminf.
ccl_device_inline float smoothstep | ( | float | edge0, |
float | edge1, | ||
float | x | ||
) |
Definition at line 382 of file util/math.h.
ccl_device_inline float smoothstepf | ( | float | f | ) |
Definition at line 484 of file util/math.h.
Referenced by spot_light_attenuation(), and svm_brick().
ccl_device_inline float sqr | ( | float | a | ) |
Definition at line 746 of file util/math.h.
References Freestyle::a.
Referenced by atmosphere_intersection(), bessel_I0(), bsdf_get_roughness_squared(), bsdf_principled_hair_eval(), bsdf_principled_hair_sample(), bump_shadowing_term(), color_highlight_compress(), computeBindWeights(), ensure_valid_reflection(), hair_alpha_angles(), hair_attenuation(), light_spread_attenuation(), logistic(), OVERLAY_light_cache_populate(), phase_mie(), phase_rayleigh(), pow20(), pow22(), ray_disk_intersect(), sample_uniform_cone(), SKY_nishita_skymodel_precompute_texture(), sky_radiance_nishita(), subsurface_disk(), surface_intersection(), svm_node_closure_bsdf(), and svm_node_principled_volume().
ccl_device_inline float triangle_area | ( | ccl_private const float3 & | v1, |
ccl_private const float3 & | v2, | ||
ccl_private const float3 & | v3 | ||
) |
Definition at line 557 of file util/math.h.
References blender::math::cross(), len, v1, and v2.
Referenced by LightManager::device_update_distribution(), QuadDice::quad_area(), triangle_light_pdf(), and triangle_light_sample().
ccl_device_inline uint uint16_pack_to_uint | ( | const uint | a, |
const uint | b | ||
) |
Definition at line 331 of file util/math.h.
References Freestyle::a, and usdtokens::b().
Referenced by __anyhit__kernel_optix_shadow_all_hit().
ccl_device_inline uint uint16_unpack_from_uint_0 | ( | const uint | i | ) |
Definition at line 336 of file util/math.h.
Referenced by __anyhit__kernel_optix_shadow_all_hit().
ccl_device_inline uint uint16_unpack_from_uint_1 | ( | const uint | i | ) |
Definition at line 341 of file util/math.h.
Referenced by __anyhit__kernel_optix_shadow_all_hit().
ccl_device_inline float wrapf | ( | float | value, |
float | max, | ||
float | min | ||
) |
Definition at line 438 of file util/math.h.
ccl_device_inline float xor_signmask | ( | float | x, |
int | y | ||
) |
Definition at line 780 of file util/math.h.
References __float_as_int(), __int_as_float(), x, and y.
Referenced by isect_ray_tri_watertight_v3().