|
Blender
V2.93
|
#include <cmath>#include <float.h>#include <math.h>#include <stdio.h>#include "util/util_types.h"#include "util/util_math_int2.h"#include "util/util_math_int3.h"#include "util/util_math_int4.h"#include "util/util_math_float2.h"#include "util/util_math_float3.h"#include "util/util_math_float4.h"#include "util/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_LN2_F (0.6931471805599453f) /* ln(2) */ |
| #define | M_LN10_F (2.3025850929940457f) /* ln(10) */ |
| #define M_1_2PI_F (0.1591549430918953f) /* 1/(2*pi) */ |
Definition at line 58 of file util_math.h.
| #define M_1_PI_F (0.3183098861837067f) /* 1/pi */ |
Definition at line 52 of file util_math.h.
| #define M_2_PI_F (0.6366197723675813f) /* 2/pi */ |
Definition at line 55 of file util_math.h.
| #define M_2PI_F (6.2831853071795864f) /* 2*pi */ |
Definition at line 69 of file util_math.h.
| #define M_4PI_F (12.566370614359172f) /* 4*pi */ |
Definition at line 72 of file util_math.h.
| #define M_LN10_F (2.3025850929940457f) /* ln(10) */ |
Definition at line 83 of file util_math.h.
| #define M_LN2_F (0.6931471805599453f) /* ln(2) */ |
Definition at line 80 of file util_math.h.
| #define M_LN_2PI_F (1.8378770664093454f) /* ln(2*pi) */ |
Definition at line 64 of file util_math.h.
| #define M_PI_2_F (1.5707963267948966f) /* pi/2 */ |
Definition at line 46 of file util_math.h.
| #define M_PI_4_F (0.7853981633974830f) /* pi/4 */ |
Definition at line 49 of file util_math.h.
| #define M_PI_F (3.1415926535897932f) /* pi */ |
Definition at line 43 of file util_math.h.
| #define M_SQRT2_F (1.4142135623730950f) /* sqrt(2) */ |
Definition at line 77 of file util_math.h.
| #define M_SQRT_PI_8_F (0.6266570686577501f) /* sqrt(pi/8) */ |
Definition at line 61 of file util_math.h.
| ccl_device_inline int4 __float4_as_int4 | ( | float4 | f | ) |
Definition at line 242 of file util_math.h.
References __float_as_int(), and make_int4.
| ccl_device_inline int __float_as_int | ( | float | f | ) |
Definition at line 202 of file util_math.h.
Referenced by __float4_as_int4(), SVMCompiler::add_node(), BVH(), compare_floats(), CurvesNode::compile(), PrincipledBsdfNode::compile(), VolumeNode::compile(), BsdfNode::compile(), GeometryManager::displace(), fast_safe_powf(), kernel_ies_interp(), BVH2::pack_aligned_node(), BVHReference::prim_index(), BVHReference::prim_object(), ray_triangle_intersect(), shade_background_pixels(), 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 222 of file util_math.h.
Referenced by bvh_aligned_node_intersect(), bvh_node_intersect(), bvh_unaligned_node_intersect(), fast_atan2f(), fast_exp2f(), fast_log2f(), fast_logb(), float_to_half(), hash_float2_to_float(), hash_float3_to_float(), hash_float4_to_float(), hash_float_to_float(), isfinite_safe(), isnan_safe(), ray_offset(), and svm_node_tex_sky().
| ccl_device_inline float4 __int4_as_float4 | ( | int4 | i | ) |
Definition at line 252 of file util_math.h.
References __int_as_float(), make_float4, int4::w, int4::x, int4::y, and int4::z.
| ccl_device_inline float __int_as_float | ( | int | i | ) |
Definition at line 212 of file util_math.h.
Referenced by __int4_as_float4(), BVHRange::BVHRange(), BVHReference::BVHReference(), LightManager::device_update_ies(), fast_safe_powf(), IESFile::pack(), Hair::pack_curves(), BVH2::pack_leaf(), BVH2::pack_unaligned_node(), BVH2::refit_node(), BVHRange::set_start(), stack_store_int(), 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 232 of file util_math.h.
Referenced by fast_exp2f(), fast_log2f(), fetch_node_float(), kernel_background_evaluate(), kernel_displace_evaluate(), BVH2::pack_leaf(), pmj_sample_1D(), pmj_sample_2D(), ray_offset(), read_node_float(), BVH2::refit_node(), scene_intersect(), 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 172 of file util_math.h.
Referenced by BM_mesh_intersect_edges().
| ccl_device_inline uint as_uint | ( | float | f | ) |
Definition at line 192 of file util_math.h.
| ccl_device_inline uint as_uint | ( | int | i | ) |
Definition at line 182 of file util_math.h.
Referenced by emit_attribute_map_entry().
| ccl_device_inline float beta | ( | float | x, |
| float | y | ||
| ) |
Definition at line 666 of file util_math.h.
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::executePixelSampled(), 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(), and volume_preservation().
| ccl_device float bits_to_01 | ( | uint | bits | ) |
Definition at line 680 of file util_math.h.
References float().
| ccl_device_inline int ceil_to_int | ( | float | f | ) |
Definition at line 342 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 288 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 283 of file util_math.h.
References Freestyle::a, max(), and min().
Referenced by bsdf_ashikhmin_shirley_setup(), bsdf_hair_reflection_setup(), bsdf_hair_transmission_setup(), bsdf_microfacet_multi_ggx_common_setup(), bsdf_microfacet_multi_ggx_glass_fresnel_setup(), bsdf_microfacet_multi_ggx_glass_setup(), BVHSpatialSplit::BVHSpatialSplit(), MapRangeSmoothstepFunction::call(), MapRangeSmootherstepFunction::call(), Freestyle::CalligraphicShader::CalligraphicShader(), BoundBox2D::clamp(), ClampNode::constant_fold(), RGBRampNode::constant_fold(), blender::compositor::BlurNode::convertToOperations(), create_mesh(), SceneParams::curve_subdivisions(), eevee_lightbake_render_probe_sample(), eevee_lightbake_render_world_sample(), EEVEE_lightbake_update_world_quick(), MapRangeNode::expand(), fast_exp2f(), fast_log2f(), fast_logb(), float_ramp_lookup(), ConstantFolder::fold_mix(), fractal_noise(), fractal_noise_1d(), fractal_noise_2d(), fractal_noise_3d(), fractal_noise_4d(), BVHObjectBinning::get_bin(), kernel_filter_nlm_calc_difference(), light_distribution_sample(), DenoiseTask::load_input_pixels(), ConstantFolder::make_constant_clamp(), Session::map_neighbor_tiles(), DenoiseTask::map_neighboring_tiles(), blender::nodes::map_range_float(), blender::nodes::map_smootherstep(), blender::nodes::map_smoothstep(), mf_ggx_transmission_albedo(), NODE_DEFINE(), ObtainCacheParticleData(), quat_interpolate(), rect_light_sample(), rgb_ramp_lookup(), RVIsolateHighlights_float(), safe_acosf(), safe_asinf(), sample_trimmed_logistic(), saturate(), schlick_fresnel(), blender::bke::set_material_index(), sh_node_map_range_expand_in_mf_network(), sky_texture_precompute_hosek(), smootherstep(), BVHSpatialSplit::split_curve_primitive(), BVHSpatialSplit::split_triangle_primitive(), subsurface_random_walk(), svm_image_texture_wrap_clamp(), svm_node_clamp(), svm_node_closure_bsdf(), svm_node_layer_weight(), svm_node_tex_musgrave(), svm_node_tex_voronoi(), ConstantFolder::try_bypass_or_make_constant(), IK_QSphericalSegment::UpdateAngle(), IK_QRevoluteSegment::UpdateAngle(), IK_QSwingSegment::UpdateAngle(), IK_QElbowSegment::UpdateAngle(), IK_QTranslateSegment::UpdateAngle(), and CCL_NAMESPACE_BEGIN::TextureInterpolator< T >::wrap_clamp().
| ccl_device_inline float compare_floats | ( | float | a, |
| float | b, | ||
| float | abs_diff, | ||
| int | ulp_diff | ||
| ) |
Definition at line 777 of file util_math.h.
References __float_as_int(), Freestyle::a, abs(), and fabsf.
| ccl_device float compatible_powf | ( | float | x, |
| float | y | ||
| ) |
Definition at line 606 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 389 of file util_math.h.
References signf().
| ccl_device_inline uint count_leading_zeros | ( | uint | x | ) |
Definition at line 685 of file util_math.h.
References x.
Referenced by cmj_w_mask(), count_trailing_zeros(), and find_first_set().
| ccl_device_inline uint count_trailing_zeros | ( | uint | x | ) |
Definition at line 703 of file util_math.h.
References count_leading_zeros(), and x.
Referenced by cmj_fast_div_pow2().
Definition at line 431 of file util_math.h.
References Freestyle::a, Freestyle::c, and x.
Referenced by interpolate_ies_vertical(), and kernel_ies_interp().
| ccl_device_inline float ensure_finite | ( | float | v | ) |
Definition at line 277 of file util_math.h.
References isfinite_safe(), and v.
Referenced by snoise_1d(), snoise_2d(), snoise_3d(), and snoise_4d().
| ccl_device_inline uint find_first_set | ( | uint | x | ) |
Definition at line 721 of file util_math.h.
References count_leading_zeros(), and x.
| ccl_device_inline float3 float2_to_float3 | ( | const float2 | a | ) |
Definition at line 410 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 420 of file util_math.h.
References Freestyle::a, and make_float4.
Referenced by Hair::apply_transform(), BVHObjectBinning::BVHObjectBinning(), TextureMapping::compile(), CurvesNode::compile(), CurveSegmentMotionCV(), ShaderManager::device_update_common(), GeometryManager::device_update_mesh(), ParticleSystemManager::device_update_particles(), export_hair_motion_validate_attribute(), ExportCurveSegmentsMotion(), Mesh::pack_primitives(), and BVH2::pack_triangle().
| ccl_device_inline float3 float4_to_float3 | ( | const float4 | a | ) |
Definition at line 415 of file util_math.h.
References Freestyle::a, and make_float3.
Referenced by Hair::apply_transform(), Hair::Curve::bounds_grow(), bsdf_principled_hair_eval(), bsdf_principled_hair_sample(), camera_sample_orthographic(), camera_sample_perspective(), GeometryManager::displace(), film_get_pass_result(), ShaderManager::init_xyz_transforms(), linear_rgb_to_gray(), motion_triangle_normals_for_step(), motion_triangle_verts_for_step(), particle_angular_velocity(), particle_location(), particle_velocity(), patch_eval_float3(), set_attribute_float4(), set_default_value(), sky_radiance_nishita(), subd_triangle_attribute_float3(), 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(), triangle_attribute_float3(), triangle_dPdudv(), triangle_intersect(), triangle_normal(), triangle_point_normal(), triangle_smooth_normal(), triangle_vertices(), and xyz_to_rgb().
| ccl_device_inline int float_to_int | ( | float | f | ) |
Definition at line 321 of file util_math.h.
Referenced by ceil_to_int(), fast_rint(), float_ramp_lookup(), floor_to_int(), 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(), quick_floor_to_int(), 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 326 of file util_math.h.
References float_to_int(), and floorf.
Referenced by svm_brick().
| ccl_device_inline float floorfrac | ( | float | x, |
| int * | i | ||
| ) |
Definition at line 336 of file util_math.h.
References quick_floor_to_int(), 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 425 of file util_math.h.
References Freestyle::a, 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 270 of file util_math.h.
References __float_as_uint(), and x.
Referenced by bsdf_principled_hair_eval(), ensure_finite(), ensure_finite3(), ensure_finite4(), isfinite3_safe(), isfinite4_safe(), path_radiance_clamp_and_sum(), scene_intersect_valid(), and subsurface_random_walk().
| ccl_device_inline bool isnan_safe | ( | float | f | ) |
Definition at line 264 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 457 of file util_math.h.
References A, Freestyle::a, B, and t.
| ccl_device_inline void make_orthonormals | ( | const float3 | N, |
| float3 * | a, | ||
| float3 * | b | ||
| ) |
Definition at line 477 of file util_math.h.
References Freestyle::a, cross(), fabsf, make_float3, N, and 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(), direction_from_cosine(), disk_light_sample(), henyey_greenstrein_sample(), sample_cos_hemisphere(), sample_uniform_cone(), sample_uniform_hemisphere(), and subsurface_scatter_disk().
| ccl_device_inline float2 map_to_sphere | ( | const float3 | co | ) |
Definition at line 751 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 132 of file util_math.h.
References Freestyle::a.
| ccl_device_inline float max | ( | float | a, |
| float | b | ||
| ) |
Definition at line 122 of file util_math.h.
References Freestyle::a.
| ccl_device_inline int max | ( | int | a, |
| int | b | ||
| ) |
Definition at line 112 of file util_math.h.
References Freestyle::a.
Referenced by clamp(), max4(), safe_sqrtf(), and wrapf().
| ccl_device_inline T max4 | ( | const T & | a, |
| const T & | b, | ||
| const T & | c, | ||
| const T & | d | ||
| ) |
Definition at line 153 of file util_math.h.
References Freestyle::a, Freestyle::c, and max().
Referenced by bvh_aligned_node_intersect(), and bvh_unaligned_node_intersect_child().
Definition at line 164 of file util_math.h.
References Freestyle::a, Freestyle::c, and max().
| ccl_device_inline double min | ( | double | a, |
| double | b | ||
| ) |
Definition at line 137 of file util_math.h.
References Freestyle::a.
| ccl_device_inline float min | ( | float | a, |
| float | b | ||
| ) |
Definition at line 127 of file util_math.h.
References Freestyle::a.
| ccl_device_inline int min | ( | int | a, |
| int | b | ||
| ) |
Definition at line 117 of file util_math.h.
References Freestyle::a.
| ccl_device_inline T min4 | ( | const T & | a, |
| const T & | b, | ||
| const T & | c, | ||
| const T & | d | ||
| ) |
Definition at line 148 of file util_math.h.
References Freestyle::a, Freestyle::c, and min().
Referenced by bvh_aligned_node_intersect(), and bvh_unaligned_node_intersect_child().
Definition at line 159 of file util_math.h.
References Freestyle::a, Freestyle::c, and min().
| ccl_device_inline float mix | ( | float | a, |
| float | b, | ||
| float | t | ||
| ) |
Definition at line 293 of file util_math.h.
References Freestyle::a, and t.
| ccl_device_inline int mod | ( | int | x, |
| int | m | ||
| ) |
Definition at line 405 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 wm_eventemulation().
| ccl_device_inline float nonzerof | ( | float | f, |
| float | eps | ||
| ) |
Definition at line 380 of file util_math.h.
| ccl_device_inline float pingpongf | ( | float | a, |
| float | b | ||
| ) |
Definition at line 359 of file util_math.h.
References Freestyle::a, fabsf, and fractf().
| ccl_device_inline float pow20 | ( | float | a | ) |
Definition at line 656 of file util_math.h.
References Freestyle::a, and sqr().
| ccl_device_inline float pow22 | ( | float | a | ) |
Definition at line 661 of file util_math.h.
References Freestyle::a, and sqr().
| ccl_device_inline float precise_angle | ( | float3 | a, |
| float3 | b | ||
| ) |
Definition at line 795 of file util_math.h.
References Freestyle::a, atan2f, and len.
Referenced by sky_radiance_nishita().
| ccl_device_inline int quick_floor_to_int | ( | float | x | ) |
Definition at line 331 of file util_math.h.
References float_to_int(), and x.
Referenced by floorfrac(), and quick_floor_to_int3().
| ccl_device_inline float3 rotate_around_axis | ( | float3 | p, |
| float3 | axis, | ||
| float | angle | ||
| ) |
Definition at line 563 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 601 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_spherical(), fisheye_equisolid_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 596 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 633 of file util_math.h.
References Freestyle::a.
Referenced by bump_shadowing_term(), MapRangeFunction::call(), MapRangeSteppedFunction::call(), MapRangeSmoothstepFunction::call(), MapRangeSmootherstepFunction::call(), hair_attenuation(), blender::nodes::map_linear(), blender::nodes::map_smootherstep(), blender::nodes::map_smoothstep(), blender::nodes::map_stepped(), safe_logf(), smootherstep(), svm_math(), svm_node_tex_voronoi(), trimmed_logistic(), blender::nodes::try_dispatch_float_math_fl3_fl3_to_fl3(), and blender::nodes::try_dispatch_float_math_fl_fl_to_fl().
| ccl_device_inline float3 safe_divide_color | ( | float3 | a, |
| float3 | b | ||
| ) |
Definition at line 514 of file util_math.h.
References Freestyle::a, make_float3, float3::x, x, float3::y, y, float3::z, and z.
Referenced by hair_attenuation(), kernel_volume_distance_pdf(), kernel_volume_distance_sample(), path_radiance_sum_indirect(), subsurface_color_bump_blur(), and subsurface_random_walk_coefficients().
| ccl_device_inline float3 safe_divide_even_color | ( | float3 | a, |
| float3 | b | ||
| ) |
Definition at line 525 of file util_math.h.
References Freestyle::a, if(), make_float3, float3::x, x, float3::y, y, float3::z, and z.
Referenced by film_get_pass_result(), and RenderBuffers::get_pass_rect().
| ccl_device_inline float3 safe_invert_color | ( | float3 | a | ) |
Definition at line 503 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 638 of file util_math.h.
References Freestyle::a, 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 646 of file util_math.h.
References Freestyle::a, and fmodf.
| ccl_device float safe_powf | ( | float | a, |
| float | b | ||
| ) |
Definition at line 625 of file util_math.h.
References Freestyle::a, 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 586 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(), bssrdf_cubic_sample(), bssrdf_gaussian_sample(), bssrdf_none_sample(), cos_from_sin(), direction_from_cosine(), ensure_valid_reflection(), henyey_greenstrein_sample(), kernel_volume_equiangular_pdf(), kernel_volume_equiangular_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 saturate | ( | float | a | ) |
Definition at line 315 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(), bssrdf_cubic_quintic_root_find(), bssrdf_setup(), film_float_to_byte(), film_map(), ConstantFolder::fold_mix(), RenderBuffers::get_denoising_pass_rect(), RenderBuffers::get_pass_rect(), 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(), saturate3(), 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 375 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 364 of file util_math.h.
References Freestyle::a, fabsf, fmaxf, and fminf.
| ccl_device_inline float smoothstep | ( | float | edge0, |
| float | edge1, | ||
| float | x | ||
| ) |
Definition at line 298 of file util_math.h.
Referenced by sh_node_map_range_expand_in_mf_network(), svm_node_map_range(), voronoi_smooth_f1_1d(), voronoi_smooth_f1_2d(), voronoi_smooth_f1_3d(), and voronoi_smooth_f1_4d().
| ccl_device_inline float smoothstepf | ( | float | f | ) |
Definition at line 399 of file util_math.h.
Referenced by spot_light_attenuation(), and svm_brick().
| ccl_device_inline float sqr | ( | float | a | ) |
Definition at line 651 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(), computeBindWeights(), ensure_valid_reflection(), filter_get_feature_scales_sse(), hair_alpha_angles(), hair_attenuation(), kernel_filter_detect_outliers(), kernel_filter_nlm_calc_difference(), light_spread_attenuation(), logistic(), OVERLAY_light_cache_populate(), phase_mie(), phase_rayleigh(), pow20(), pow22(), sample_uniform_cone(), SKY_nishita_skymodel_precompute_texture(), sky_radiance_nishita(), subsurface_random_walk_remap(), subsurface_scatter_disk(), surface_intersection(), svm_node_closure_bsdf(), and svm_node_principled_volume().
| ccl_device_inline float triangle_area | ( | const float3 & | v1, |
| const float3 & | v2, | ||
| const float3 & | v3 | ||
| ) |
Definition at line 467 of file util_math.h.
References cross(), len, v1, and v2.
Referenced by LightManager::device_update_distribution(), QuadDice::quad_area(), triangle_light_pdf(), and triangle_light_sample().
| ccl_device_inline float wrapf | ( | float | value, |
| float | max, | ||
| float | min | ||
| ) |
Definition at line 353 of file util_math.h.
| ccl_device_inline float xor_signmask | ( | float | x, |
| int | y | ||
| ) |
Definition at line 675 of file util_math.h.
References __float_as_int(), __int_as_float(), x, and y.
Referenced by isect_ray_tri_watertight_v3(), and ray_triangle_intersect().