|
Blender V4.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_int8.h"#include "util/math_float2.h"#include "util/math_float4.h"#include "util/math_float8.h"#include "util/math_float3.h"#include "util/rect.h"Go to the source code of this file.
Macros | |
| #define | __has_builtin(v) 0 |
Definition at line 1012 of file util/math.h.
| ccl_device_inline int4 __float4_as_int4 | ( | float4 | f | ) |
Definition at line 296 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 255 of file util/math.h.
| ccl_device_inline uint __float_as_uint | ( | float | f | ) |
Definition at line 275 of file util/math.h.
| ccl_device_inline float4 __int4_as_float4 | ( | int4 | i | ) |
Definition at line 306 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 265 of file util/math.h.
| ccl_device_inline float __uint_as_float | ( | uint | i | ) |
Definition at line 285 of file util/math.h.
| ccl_device_inline int abs | ( | int | x | ) |
Definition at line 120 of file util/math.h.
References x.
Referenced by actionzone_modal(), annotation_draw_apply_event(), area_join_update_data(), area_move_apply_do(), area_snap_calc_location(), area_split_factor(), BKE_fcurve_delete_key(), BKE_gpencil_layer_frame_get(), BKE_mask_spline_project_co(), blend_color_difference_byte(), blf_glyph_calc_rect_test(), BLI_listbase_link_move(), BLI_str_format_integer_unit(), blo_do_versions_280(), blo_do_versions_300(), bm_loop_build(), bm_loop_path_build_step(), brush_scale_size_exec(), blender::build_sequential(), blender::nodes::node_shader_tex_checker_cc::NodeTexChecker::call(), compare_floats(), compare_floats(), compare_rgb_uchar(), slim::compute_least_squares_scaling(), createTransActionData(), distance(), draw_horizontal_scale_indicators(), DRW_select_buffer_find_nearest_to_point(), ED_preview_draw(), ed_preview_draw_rect(), ED_region_generic_tools_region_snap_size(), ED_region_snap_size_test(), establish_track_initialization_order(), file_smoothscroll_invoke(), find_nearest_seq(), flushTransSeq(), blender::nodes::node_fn_compare_cc::get_multi_function(), Freestyle::GaussianFilter::getSmoothedPixel(), gpencil_layer_final_tint_and_alpha_get(), grease_pencil_layer_final_tint_and_alpha_get(), hsl_to_rgb(), image_buf_fill_checker_slice(), len_manhattan_v2_int(), GHOST_Wintab::mapWintabToSysCoordinates(), blender::color::mix_difference(), modf_to_index(), mouse_select_knot(), moviecache_getitempriority(), nla_draw_strip_curves(), node_mix_diff(), pingpong(), GHOST_SystemWin32::processWheelEvent(), Freestyle::AppView::rabs(), region_scale_modal(), region_visible_rect_calc(), screen_area_trim(), screen_areas_can_align(), screen_geom_area_map_find_active_scredge(), select_adjacent_cp(), select_nth_bezt(), select_nth_bp(), seq_frame_snap_update_best(), seq_retiming_transition_is_linear(), SEQ_retiming_transition_key_frame_set(), SEQ_time_find_next_prev_edit(), blender::ed::object::set_constraint_nth_target(), GHOST_DisplayManagerX11::setCurrentDisplaySetting(), setCustomPointsFromDirection(), setNearestAxis2d(), smoothmin(), blender::ed::greasepencil::snap_8_angles(), blender::ed::greasepencil::snap_diagonals_box(), snapNode(), svm_checker(), svm_image_texture_wrap_mirror(), blender::bke::tests::test_vec_roll_to_mat3_orthogonal(), GHOST_Wintab::testCoordinates(), blender::gpu::tests::texture_create_upload_read_with_bias(), thumb_create_ex(), blender::math::to_axis_angle(), transdata_get_track_shuffle_offset(), transform_snap_nla_calc(), transform_snap_sequencer_calc_preview(), transform_snap_sequencer_calc_timeline(), blender::nodes::try_dispatch_float_math_fl3_to_fl3(), ui_but_drag_init(), ui_but_dragedit_update_mval(), ui_do_but_COLORBAND(), ui_do_but_NUM(), ui_do_but_SLI(), ui_do_button(), ui_numedit_but_NUM(), ui_pan_to_scroll(), blender::compositor::ConvertDepthToRadiusOperation::update_memory_buffer_partial(), blender::compositor::KuwaharaAnisotropicOperation::update_memory_buffer_partial(), vert_pair_adjacent_in_orig_face(), view2d_scroll_delta_y_snap_page_size(), view2d_totRect_set_resize(), voronoi_distance(), voronoi_distance(), voronoi_distance(), voronoi_distance(), voronoi_distance_to_edge(), voronoi_n_sphere_radius(), wm_autosave_location(), WM_event_drag_test_with_delta(), wm_gesture_straightline_do_angle_snap(), and CCL_NAMESPACE_BEGIN::TextureInterpolator< TexT, OutT >::wrap_mirror().
| ccl_device_inline int as_int | ( | uint | i | ) |
Definition at line 224 of file util/math.h.
Referenced by BM_mesh_intersect_edges().
| ccl_device_inline uint as_uint | ( | float | f | ) |
Definition at line 244 of file util/math.h.
| ccl_device_inline uint as_uint | ( | int | i | ) |
Definition at line 234 of file util/math.h.
Referenced by emit_attribute_map_entry().
| ccl_device_inline float beta | ( | float | x, |
| float | y ) |
Definition at line 833 of file util/math.h.
Referenced by Freestyle::OGF::NormalCycle::accumulate_dihedral_angle(), blender::ed::sculpt_paint::filter::calc_surface_smooth_filter(), Eigen::internal::constrained_conjugate_gradient(), blender::bke::mesh::corner_fan_space_define(), blender::bke::mesh::corner_space_custom_data_to_normal(), blender::bke::mesh::corner_space_custom_normal_to_data(), cubic_subdiv(), dBoxBox2(), dLineClosestApproach(), KDL::Rotation::GetEulerZYZ(), Freestyle::SilhouetteGeomEngine::ImageToWorldParameter(), KDL::LinComb(), KDL::LinComb(), KDL::LinComb(), KDL::LinCombR(), KDL::LinCombR(), KDL::LinCombR(), libmv::Dogleg< Function, Jacobian, Solver >::minimize(), blender::geometry::p_abf_matrix_invert(), posrandom(), random(), rotateDifferentialCoordinates(), btConjugateGradient< MatrixX >::solve(), btConjugateResidual< MatrixX >::solve(), btDeformableBodySolver::solveDeformableConstraints(), libmv::Dogleg< Function, Jacobian, Solver >::SolveDoglegDirection(), solveSingleIteration(), blender::ed::sculpt_paint::smooth::surface_smooth_displace_step(), blender::compositor::ChromaMatteOperation::update_memory_buffer_partial(), volume_preservation(), and volume_preservation().
| ccl_device float bits_to_01 | ( | uint | bits | ) |
Definition at line 843 of file util/math.h.
References float.
| ccl_device_inline int ceil_to_int | ( | float | f | ) |
Definition at line 441 of file util/math.h.
References ceilf, and float_to_int().
Referenced by RenderScheduler::calculate_resolution_divider_for_time().
| ccl_device_inline float clamp | ( | float | a, |
| float | mn, | ||
| float | mx ) |
Definition at line 384 of file util/math.h.
| ccl_device_inline int clamp | ( | int | a, |
| int | mn, | ||
| int | mx ) |
Definition at line 379 of file util/math.h.
Referenced by area_light_rect_sample(), background_map_pdf(), bake_offset_towards_center(), bsdf_ashikhmin_shirley_setup(), bsdf_hair_reflection_setup(), bsdf_hair_transmission_setup(), bsdf_sheen_setup(), bsdf_toon_setup_common(), bssrdf_setup(), BVHSpatialSplit::BVHSpatialSplit(), Freestyle::CalligraphicShader::CalligraphicShader(), ClampNode::constant_fold(), MixColorNode::constant_fold(), MixFloatNode::constant_fold(), MixVectorNode::constant_fold(), RGBRampNode::constant_fold(), create_mesh(), SceneParams::curve_subdivisions(), cycles_precompute(), blender::gpu::MTLContext::ensure_depth_stencil_state(), fast_exp2f(), fast_exp2f4(), fast_log2f(), fast_logb(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), float_ramp_lookup(), float_ramp_lookup(), BVHObjectBinning::get_bin(), BlenderSync::get_session_params(), SkyTextureNode::get_sun_average_radiance(), guiding_record_bssrdf_bounce(), guiding_record_surface_bounce(), hsl_to_rgb(), hsl_to_rgb(), interpolate_curve_points(), ior_from_F0(), kernel_curve_shadow_transparency_evaluate(), light_distribution_sample(), light_tree_emitter_importance(), light_tree_node_importance(), node_mix_clamp(), ObtainCacheParticleData(), quat_interpolate(), rgb_ramp_lookup(), rgb_ramp_lookup(), rgb_ramp_lookup(), rgb_ramp_lookup(), safe_acosf(), safe_asinf(), sample_trimmed_logistic(), saturatef(), schlick_fresnel(), blender::nodes::node_shader_mix_rgb_cc::sh_node_mix_rgb_build_multi_function(), shadow_ray_offset(), sky_texture_precompute_hosek(), smootherstep(), BVHSpatialSplit::split_curve_primitive(), BVHSpatialSplit::split_triangle_primitive(), svm_image_texture_wrap_clamp(), svm_node_clamp(), svm_node_closure_bsdf(), svm_node_layer_weight(), svm_node_tex_gabor(), svm_node_tex_noise(), svm_node_tex_voronoi(), svm_node_vector_map_range(), blender::compositor::KuwaharaAnisotropicOperation::update_memory_buffer_partial(), and CCL_NAMESPACE_BEGIN::TextureInterpolator< TexT, OutT >::wrap_clamp().
| ccl_device_inline bool compare_floats | ( | float | a, |
| float | b, | ||
| float | abs_diff, | ||
| int | ulp_diff ) |
Definition at line 970 of file util/math.h.
References __float_as_int, abs(), b, and fabsf.
| ccl_device_inline float compatible_atan2 | ( | const float | y, |
| const float | x ) |
| ccl_device float compatible_powf | ( | float | x, |
| float | y ) |
| ccl_device_inline float compatible_signf | ( | float | f | ) |
Definition at line 498 of file util/math.h.
References signf().
| ccl_device_inline float cos_from_sin | ( | const float | s | ) |
Definition at line 792 of file util/math.h.
References safe_sqrtf(), and sqr().
Referenced by bsdf_hair_chiang_albedo(), bsdf_hair_chiang_eval(), bsdf_hair_chiang_sample(), bsdf_hair_huang_albedo(), bsdf_hair_huang_sample(), hair_alpha_angles(), point_light_tree_parameters(), and spot_light_tree_parameters().
| ccl_device_inline uint count_leading_zeros | ( | uint | x | ) |
Definition at line 874 of file util/math.h.
Referenced by find_first_set(), hash_shuffle_uint(), next_power_of_two(), prev_power_of_two(), and sobol_burley().
| ccl_device_inline uint count_trailing_zeros | ( | uint | x | ) |
Definition at line 894 of file util/math.h.
Definition at line 556 of file util/math.h.
References b.
Referenced by interpolate_ies_vertical(), and kernel_ies_interp().
| ccl_device_inline float ensure_finite | ( | float | v | ) |
Definition at line 373 of file util/math.h.
References isfinite_safe(), and v.
Referenced by film_clamp_light(), kernel_background_evaluate(), kernel_displace_evaluate(), and read_shader_output().
| ccl_device_inline uint find_first_set | ( | uint | x | ) |
Definition at line 914 of file util/math.h.
References count_leading_zeros().
| ccl_device_inline float3 float2_to_float3 | ( | const float2 | a | ) |
Definition at line 525 of file util/math.h.
References make_float3().
Referenced by camera_sample_orthographic(), camera_sample_perspective(), and primitive_motion_vector().
| ccl_device_inline float2 float3_to_float2 | ( | const float3 | a | ) |
Definition at line 530 of file util/math.h.
References make_float2().
Referenced by bsdf_microfacet_sample(), bsdf_sample(), light_sample(), ray_infinite_cylinder_intersect(), and svm_node_tex_voronoi().
| ccl_device_inline float4 float3_to_float4 | ( | const float3 | a | ) |
Definition at line 540 of file util/math.h.
References make_float4().
Referenced by Hair::apply_transform(), PointCloud::apply_transform(), BVHObjectBinning::BVHObjectBinning(), CurvesNode::compile(), TextureMapping::compile(), CurveSegmentMotionCV(), ShaderManager::device_update_common(), ParticleSystemManager::device_update_particles(), export_hair_curves_motion(), export_hair_motion_validate_attribute(), ExportCurveSegmentsMotion(), make_transform(), ray_aabb_intersect(), svm_node_tex_voronoi(), transform_inverse_impl(), and voronoi_position().
| ccl_device_inline float4 float3_to_float4 | ( | const float3 | a, |
| const float | w ) |
Definition at line 545 of file util/math.h.
References make_float4(), and w().
| ccl_device_inline float3 float4_to_float3 | ( | const float4 | a | ) |
Definition at line 535 of file util/math.h.
References make_float3().
Referenced by Hair::apply_transform(), PointCloud::apply_transform(), background_sun_pdf(), background_sun_sample(), Hair::Curve::bounds_grow(), Hair::Curve::bounds_grow(), PointCloud::Point::bounds_grow(), camera_sample_orthographic(), camera_sample_perspective(), Hair::compute_bounds(), PointCloud::compute_bounds(), cycles_precompute(), distant_light_uv(), fresnel_iridescence(), 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_attribute_float4(), set_default_value(), 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_tex_voronoi(), 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 424 of file util/math.h.
Referenced by background_map_pdf(), ceil_to_int(), fast_rint(), float_ramp_lookup(), float_ramp_lookup(), floor_to_int(), floorfrac(), CCL_NAMESPACE_BEGIN::frac(), frac(), lookup_table_read(), lookup_table_read_2D(), lookup_table_read_3D(), noise_fbm(), noise_fbm(), noise_fbm(), noise_fbm(), noise_hetero_terrain(), noise_hetero_terrain(), noise_hetero_terrain(), noise_hetero_terrain(), noise_hybrid_multi_fractal(), noise_hybrid_multi_fractal(), noise_hybrid_multi_fractal(), noise_hybrid_multi_fractal(), noise_multi_fractal(), noise_multi_fractal(), noise_multi_fractal(), noise_multi_fractal(), noise_ridged_multi_fractal(), noise_ridged_multi_fractal(), noise_ridged_multi_fractal(), noise_ridged_multi_fractal(), rgb_ramp_lookup(), rgb_ramp_lookup(), safe_powf(), svm_checker(), svm_image_texture_frac(), svm_math_wavelength_color_xyz(), and svm_node_convert().
| ccl_device_inline int floor_to_int | ( | float | f | ) |
Definition at line 429 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 434 of file util/math.h.
References float_to_int(), and floorf.
Referenced by perlin_1d(), perlin_2d(), perlin_3d(), and perlin_4d().
| ccl_device_inline float fractf | ( | float | x | ) |
| ccl_device_inline bool intervals_intersect | ( | ccl_private float2 * | first, |
| const float2 | second ) |
Definition at line 1055 of file util/math.h.
References fmaxf, fminf, float2::x, and float2::y.
Referenced by ray_cone_intersect(), and ray_infinite_cylinder_intersect().
| ccl_device_inline float inverse_lerp | ( | float | a, |
| float | b, | ||
| float | x ) |
Definition at line 550 of file util/math.h.
References b.
Referenced by background_map_sample(), bsdf_microfacet_setup_fresnel_generalized_schlick(), direction_to_central_cylindrical(), interpolate_fresnel_color(), kernel_ies_interp(), and microfacet_fresnel().
| ccl_device_inline float inversesqrtf | ( | float | f | ) |
Definition at line 711 of file util/math.h.
References sqrtf.
Referenced by bsdf_lambda_from_sqr_alpha_tan_n(), compute_v(), LightManager::device_update_lights(), microfacet_ggx_sample_vndf(), ray_cone_intersect(), sphg_dir(), svm_math(), and LightTreeMeasure::transform().
| ccl_device_inline bool isfinite_safe | ( | float | f | ) |
Definition at line 365 of file util/math.h.
References __float_as_uint.
Referenced by bsdf_alloc(), bsdf_hair_chiang_eval(), bsdf_hair_chiang_sample(), bsdf_hair_huang_eval_residual(), ensure_finite(), film_clamp_light(), BoundBox::grow_safe(), intersection_ray_valid(), intersection_t_offset(), kernel_background_evaluate(), kernel_displace_evaluate(), longitudinal_scattering(), scene_intersect_valid(), transform_decomposed_isfinite_safe(), transform_isfinite_safe(), and Mesh::Triangle::valid().
| ccl_device_inline bool isnan_safe | ( | float | f | ) |
Definition at line 359 of file util/math.h.
References __float_as_uint.
Referenced by bsdf_hair_huang_eval(), and fresnel_dielectric_polarized().
| ccl_device_inline void make_orthonormals | ( | const float3 | N, |
| ccl_private float3 * | a, | ||
| ccl_private float3 * | b ) |
Definition at line 593 of file util/math.h.
References b, cross(), fabsf, make_float3(), N, and normalize().
Referenced by bsdf_ashikhmin_shirley_sample(), bsdf_microfacet_sample(), differential_from_compact(), disk_light_sample(), make_orthonormals_safe_tangent(), merge(), phase_sample_direction(), sample_cos_hemisphere(), sample_uniform_cone(), sample_uniform_hemisphere(), and sample_wh().
| ccl_device_inline float2 map_to_sphere | ( | const float3 | co | ) |
Definition at line 944 of file util/math.h.
References atan2f, dot(), l, make_float2(), safe_acosf(), sqrtf, 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 184 of file util/math.h.
References b.
| ccl_device_inline float max | ( | float | a, |
| float | b ) |
Definition at line 174 of file util/math.h.
References b.
| ccl_device_inline int max | ( | int | a, |
| int | b ) |
Definition at line 125 of file util/math.h.
References b.
| ccl_device_inline std::enable_if_t< std::is_same_v< T, size_t >, T > max | ( | T | a, |
| T | b ) |
Definition at line 163 of file util/math.h.
References b.
| ccl_device_inline uint32_t max | ( | uint32_t | a, |
| uint32_t | b ) |
Definition at line 135 of file util/math.h.
References b.
| ccl_device_inline uint64_t max | ( | uint64_t | a, |
| uint64_t | b ) |
Definition at line 145 of file util/math.h.
References b.
| ccl_device_inline T max4 | ( | const T & | a, |
| const T & | b, | ||
| const T & | c, | ||
| const T & | d ) |
Definition at line 205 of file util/math.h.
Referenced by bvh_aligned_node_intersect(), and bvh_unaligned_node_intersect_child().
Definition at line 216 of file util/math.h.
| ccl_device_inline double min | ( | double | a, |
| double | b ) |
Definition at line 189 of file util/math.h.
References b.
| ccl_device_inline float min | ( | float | a, |
| float | b ) |
Definition at line 179 of file util/math.h.
References b.
| ccl_device_inline int min | ( | int | a, |
| int | b ) |
Definition at line 130 of file util/math.h.
References b.
| ccl_device_inline std::enable_if_t< std::is_same_v< T, size_t >, T > min | ( | T | a, |
| T | b ) |
Definition at line 169 of file util/math.h.
References b.
| ccl_device_inline uint32_t min | ( | uint32_t | a, |
| uint32_t | b ) |
Definition at line 140 of file util/math.h.
References b.
| ccl_device_inline uint64_t min | ( | uint64_t | a, |
| uint64_t | b ) |
Definition at line 150 of file util/math.h.
References b.
| ccl_device_inline T min4 | ( | const T & | a, |
| const T & | b, | ||
| const T & | c, | ||
| const T & | d ) |
Definition at line 200 of file util/math.h.
Referenced by bvh_aligned_node_intersect(), and bvh_unaligned_node_intersect_child().
Definition at line 211 of file util/math.h.
| ccl_device_inline float mix | ( | float | a, |
| float | b, | ||
| float | t ) |
Definition at line 389 of file util/math.h.
References b.
| ccl_device_inline int mod | ( | int | x, |
| int | m ) |
Definition at line 520 of file util/math.h.
Referenced by bc_get_assigned_armature(), 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_hydra(), BPyInit_idprop(), BPyInit_imbuf(), blender::ed::sculpt_paint::boundary::calc_boundary_falloff(), CCL_python_module_init(), create_edge_from_corner(), create_split_edge_from_corner(), blender::io::SubdivModifierDisabler::disable_modifiers(), blender::ed::object::edit_modifier_poll_generic(), blender::io::usd::get_armature_modifier(), blender::io::usd::get_armature_modifier_obj(), GHOST_SystemSDL::getModifierKeys(), object_subdivision_type(), obrel_armature_find(), Mesh::pack_patches(), padding(), PyC_FileAndNum(), PyC_NameSpace_ImportArray(), pyc_run_string_as_py_object(), PyInit_mathutils(), RNA_property_overridable_get(), DiagSplit::split_ngon(), subd_triangle_patch_corners(), Mesh::tessellate(), blender::nodes::try_dispatch_float_math_fl3_fl3_to_fl3(), UI_context_copy_to_selected_list(), and ui_context_fcurve_modifiers_via_fcurve().
| ccl_device_inline uint next_power_of_two | ( | uint | x | ) |
Definition at line 1000 of file util/math.h.
References count_leading_zeros().
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 479 of file util/math.h.
| ccl_device_inline float one_minus_cos | ( | const float | angle | ) |
Definition at line 803 of file util/math.h.
Referenced by background_sun_sample(), bsdf_diffuse_toon_eval(), bsdf_diffuse_toon_sample(), bsdf_glossy_toon_eval(), bsdf_glossy_toon_sample(), pdf_uniform_cone(), and point_light_sample().
| ccl_device_inline float pingpongf | ( | float | a, |
| float | b ) |
Definition at line 458 of file util/math.h.
| ccl_device_inline uint pointer_pack_to_uint_0 | ( | T * | ptr | ) |
Definition at line 328 of file util/math.h.
References ptr.
| ccl_device_inline uint pointer_pack_to_uint_1 | ( | T * | ptr | ) |
Definition at line 333 of file util/math.h.
References ptr.
| ccl_device_inline T * pointer_unpack_from_uint | ( | const uint | a, |
| const uint | b ) |
Definition at line 338 of file util/math.h.
References b.
Referenced by get_payload_ptr_0(), and get_payload_ptr_2().
| ccl_device_inline uint popcount | ( | uint | x | ) |
Definition at line 855 of file util/math.h.
References x.
Referenced by gpu_parallel_active_index_array_impl(), light_tree_cluster_select_emitter(), and sample_is_class_A().
| ccl_device_inline float pow20 | ( | float | a | ) |
Definition at line 809 of file util/math.h.
References sqr().
| ccl_device_inline float pow22 | ( | float | a | ) |
Definition at line 814 of file util/math.h.
References sqr().
| ccl_device_inline float precise_angle | ( | float3 | a, |
| float3 | b ) |
Definition at line 988 of file util/math.h.
References atan2f, b, and len.
Referenced by pdf_uniform_cone(), and sky_radiance_nishita().
| ccl_device_inline uint prev_power_of_two | ( | uint | x | ) |
Definition at line 1006 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 1016 of file util/math.h.
References x.
Referenced by nested_uniform_scramble(), nested_uniform_scramble_base4(), sobol_burley(), sobol_burley_sample_1D(), sobol_burley_sample_2D(), sobol_burley_sample_3D(), sobol_burley_sample_4D(), and TEST().
| ccl_device_inline float3 rotate_around_axis | ( | float3 | p, |
| float3 | axis, | ||
| float | angle ) |
Definition at line 683 of file util/math.h.
References cosf, sinf, float3::x, float3::y, and float3::z.
Referenced by area_light_spread_clamp_light(), svm_node_closure_bsdf(), and svm_node_vector_rotate().
| ccl_device float safe_acosf | ( | float | a | ) |
Definition at line 725 of file util/math.h.
References acosf, CLAMP, and clamp().
Referenced by angle_normalized_qt(), angle_signed_normalized_qt(), attr_create_pointiness(), basic_rotate(), bm_mesh_calc_uvs_sphere_face(), boid_body(), bsdf_diffuse_toon_eval(), bsdf_glossy_toon_eval(), bsdf_oren_nayar_G(), cache_key_incremental_rotation(), calc_bevel_sin_cos(), direction_to_fisheye_equisolid(), direction_to_fisheye_lens_polynomial(), direction_to_spherical(), do_guides(), dvar_eval_rotDiff(), effector_falloff(), fisheye_equisolid_to_direction(), fisheye_lens_polynomial_to_direction(), fisheye_to_direction(), map_to_sphere(), mat3_to_quat_legacy(), merge(), modify_mesh(), pow_qt_fl_normalized(), blender::ed::curves::primitive_random_sphere(), proj_paint_state_cavity_init(), psys_thread_create_path(), Quaternion_angle_get(), quaternion_to_angles(), sky_angle_between(), svm_math(), svm_node_ies(), tri_to_quat_ex(), triangle_light_sample(), blender::nodes::try_dispatch_float_math_fl_to_fl(), vec_to_quat(), and Vector_angle().
| ccl_device float safe_asinf | ( | float | a | ) |
Definition at line 720 of file util/math.h.
References asinf, CLAMP, and clamp().
Referenced by angle_normalized_v2v2(), angle_normalized_v3v3(), area_light_rect_sample(), bsdf_hair_chiang_eval(), bsdf_hair_chiang_sample(), bsdf_hair_reflection_sample(), quaternion_to_angles(), 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 758 of file util/math.h.
References b.
Referenced by bsdf_eval_pass_diffuse_weight(), bsdf_eval_pass_glossy_weight(), bsdf_hair_huang_albedo(), bsdf_microfacet_eval(), blender::nodes::node_shader_map_range_cc::build_float_linear(), blender::nodes::node_shader_map_range_cc::build_float_stepped(), bump_shadowing_term(), fractal_voronoi_x_fx(), gizmo_calc_rect_view_scale(), gizmo_spot_blend_prop_matrix_set(), hair_attenuation(), relaxation_iteration_uv(), safe_logf(), blender::nodes::node_shader_map_range_cc::sh_node_map_range_build_multi_function(), smootherstep(), svm_mapping(), svm_math(), svm_node_vector_map_range(), svm_vector_math(), transform_decompose(), trimmed_logistic(), blender::nodes::try_dispatch_float_math_fl3_fl3_to_fl3(), blender::nodes::try_dispatch_float_math_fl_fl_to_fl(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property(), and vfont_to_curve().
| ccl_device_inline Spectrum safe_divide_color | ( | Spectrum | a, |
| Spectrum | b ) |
Definition at line 632 of file util/math.h.
References b, FOREACH_SPECTRUM_CHANNEL, and GET_SPECTRUM_CHANNEL.
Referenced by closure_layering_weight(), guiding_record_bssrdf_weight(), and guiding_record_direct_light().
| ccl_device_inline float3 safe_divide_even_color | ( | float3 | a, |
| float3 | b ) |
Definition at line 643 of file util/math.h.
References b, make_float3(), float3::x, x, y, and z().
Referenced by film_get_pass_pixel_light_path().
| ccl_device float safe_floored_modulo | ( | float | a, |
| float | b ) |
Definition at line 777 of file util/math.h.
| ccl_device_inline Spectrum safe_invert_color | ( | Spectrum | a | ) |
Definition at line 621 of file util/math.h.
References FOREACH_SPECTRUM_CHANNEL, and GET_SPECTRUM_CHANNEL.
| ccl_device float safe_logf | ( | float | a, |
| float | b ) |
Definition at line 763 of file util/math.h.
References 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 772 of file util/math.h.
| ccl_device float safe_powf | ( | float | a, |
| float | b ) |
Definition at line 749 of file util/math.h.
References b, compatible_powf(), float_to_int(), powf, and UNLIKELY.
Referenced by 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 706 of file util/math.h.
References max, max_ff(), and sqrtf.
Referenced by blo_do_versions_300(), boid_body(), boid_brain(), bsdf_sheen_sample(), bssrdf_burley_sample(), cos_from_sin(), cos_theta(), ensure_valid_specular_reflection(), fresnel_dielectric_polarized(), guiding_record_surface_bounce(), light_tree_cos_bound_subtended_angle(), microfacet_ggx_sample_vndf(), phase_henyey_greenstein(), point_light_sample(), sample_cos_hemisphere(), blender::eevee::Sampling::sample_hemisphere(), blender::eevee::Sampling::sample_sphere(), sample_uniform_cone(), sample_uniform_hemisphere(), sin_from_cos(), sin_sqr_to_one_minus_cos(), sky_radiance_nishita(), solve_quadratic(), spot_light_sample(), svm_math(), and blender::nodes::try_dispatch_float_math_fl_to_fl().
| ccl_device_inline float saturatef | ( | float | a | ) |
Definition at line 418 of file util/math.h.
References clamp().
| ccl_device_inline float signf | ( | float | f | ) |
Definition at line 474 of file util/math.h.
Referenced by BKE_texture_mapping_init(), blender::ed::sculpt_paint::auto_mask::calc_cavity_factor(), compatible_signf(), TextureMapping::compute_transform(), computeBindWeights(), constraintSizeLim(), gizmo_cage2d_modal(), gizmo_cage3d_modal(), microfacet_beckmann_sample_vndf(), nonzerof(), shrinkwrap_snap_with_side(), sphg_dir(), svm_node_set_bump(), volume_draine_setup(), and volume_henyey_greenstein_setup().
| ccl_device_inline float sin_from_cos | ( | const float | c | ) |
Definition at line 787 of file util/math.h.
References safe_sqrtf(), and sqr().
Referenced by bsdf_hair_chiang_sample(), bsdf_oren_nayar_G(), light_tree_importance(), microfacet_beckmann_sample_vndf(), phase_sample_direction(), sample_uniform_sphere(), and triangle_light_sample().
| ccl_device_inline float sin_sqr_to_one_minus_cos | ( | const float | s_sq | ) |
Definition at line 797 of file util/math.h.
References safe_sqrtf().
Referenced by point_light_sample(), sphere_light_pdf(), spot_light_pdf(), and spot_light_sample().
| ccl_device_inline float smoothminf | ( | float | a, |
| float | b, | ||
| float | k ) |
| ccl_device_inline float smoothstep | ( | float | edge0, |
| float | edge1, | ||
| float | x ) |
Definition at line 394 of file util/math.h.
References result.
| ccl_device_inline float smoothstepf | ( | float | f | ) |
Definition at line 508 of file util/math.h.
Referenced by spot_light_attenuation(), spot_light_tree_parameters(), and svm_brick().
| ccl_device_inline bool solve_quadratic | ( | const float | a, |
| const float | b, | ||
| const float | c, | ||
| ccl_private float & | x1, | ||
| ccl_private float & | x2 ) |
Definition at line 1066 of file util/math.h.
References b, copysignf, fmaxf, fminf, safe_sqrtf(), and sqr().
Referenced by ray_cone_intersect(), and ray_infinite_cylinder_intersect().
| ccl_device_inline float sqr | ( | float | a | ) |
Definition at line 782 of file util/math.h.
Referenced by arc_length(), area_light_rect_sample(), area_light_sample(), area_light_spread_clamp_light(), area_light_valid_ray_segment(), atmosphere_intersection(), bessel_I0(), bsdf_aniso_D(), bsdf_aniso_lambda(), bsdf_D(), bsdf_get_roughness_pass_squared(), bsdf_hair_chiang_eval(), bsdf_hair_chiang_sample(), bsdf_hair_huang_albedo(), bsdf_hair_huang_eval_r(), bsdf_hair_huang_eval_residual(), bsdf_hair_huang_eval_trrt(), bsdf_hair_huang_sample(), bsdf_lambda(), bsdf_microfacet_eval(), bsdf_microfacet_sample(), bsdf_microfacet_setup_fresnel_f82_tint(), bsdf_oren_nayar_G(), bsdf_oren_nayar_setup(), bsdf_sheen_eval(), bsdf_sheen_sample(), bump_shadowing_term(), color_highlight_compress(), compute_v(), computeBindWeights(), cos_from_sin(), cos_theta(), LightManager::device_update_lights(), ensure_valid_specular_reflection(), F0_from_ior(), fresnel_dielectric_polarized(), SkyTextureNode::get_sun_average_radiance(), hair_alpha_angles(), hair_attenuation(), ior_parametrization(), iridescence_airy_summation(), iridescence_lookup_sensitivity(), light_tree_importance(), logistic(), microfacet_beckmann_sample_vndf(), microfacet_fresnel(), microfacet_ggx_sample_vndf(), one_minus_cos(), OVERLAY_light_cache_populate(), phase_draine(), phase_draine_sample_cos(), phase_fournier_forand_delta(), phase_fournier_forand_impl(), phase_fournier_forand_newton(), phase_henyey_greenstein(), phase_henyey_greenstein_sample(), phase_mie(), phase_rayleigh(), phase_rayleigh(), phase_rayleigh_sample(), point_light_mnee_sample_update(), point_light_sample(), point_light_sample_from_intersection(), point_light_tree_parameters(), pow20(), pow22(), precompute_ggx_E(), precompute_ggx_gen_schlick_s(), precompute_ggx_glass_E(), ray_cone_intersect(), ray_disk_intersect(), sin_from_cos(), SKY_nishita_skymodel_precompute_texture(), sky_radiance_nishita(), solve_quadratic(), sphg_dir(), spot_light_mnee_sample_update(), spot_light_sample(), spot_light_sample_from_intersection(), spot_light_tree_parameters(), spot_light_valid_ray_segment(), surface_intersection(), surface_shader_prepare_closures(), svm_node_closure_bsdf(), and svm_node_principled_volume().
| ccl_device_inline float tan_angle | ( | float3 | a, |
| float3 | b ) |
Definition at line 994 of file util/math.h.
References b, cross(), dot(), and len.
Referenced by area_light_spread_attenuation().
| CCL_NAMESPACE_END CCL_NAMESPACE_BEGIN ccl_device_inline float triangle_area | ( | ccl_private const float3 & | v1, |
| ccl_private const float3 & | v2, | ||
| ccl_private const float3 & | v3 ) |
Definition at line 584 of file util/math.h.
References cross(), len, and v2.
Referenced by LightManager::device_update_distribution(), LightTreeEmitter::LightTreeEmitter(), 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 343 of file util/math.h.
References b.
Referenced by __anyhit__kernel_optix_shadow_all_hit().
| ccl_device_inline uint uint16_unpack_from_uint_0 | ( | const uint | i | ) |
Definition at line 348 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 353 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 452 of file util/math.h.
| ccl_device_inline float xor_signmask | ( | float | x, |
| int | y ) |
Definition at line 838 of file util/math.h.
References __float_as_int, and __int_as_float.
Referenced by isect_ray_tri_watertight_v3().