|
Blender V5.3
|
#include "gpu_shader_compat.hh"Go to the source code of this file.
Macros | |
| #define | atan2 _atan2 |
Functions | |
| float | endvalue_preserving_mix (float a, float b, float t) |
| float | pow2f (float x) |
| float | pow3f (float x) |
| float | pow4f (float x) |
| float | pow5f (float x) |
| float | pow6f (float x) |
| float | pow7f (float x) |
| float | pow8f (float x) |
| float | square (float v) |
| float2 | square (float2 v) |
| float3 | square (float3 v) |
| float4 | square (float4 v) |
| float | hypot (float x, float y) |
| float | _atan2 (float y, float x) |
| int | ceil_to_multiple (int a, int b) |
| uint | ceil_to_multiple (uint a, uint b) |
| int | divide_ceil (int a, int b) |
| uint | divide_ceil (uint a, uint b) |
| void | min_max (float value, float &min_v, float &max_v) |
| bool | is_equal (float a, float b, const float epsilon) |
| float | sin_from_cos (float c) |
| float | cos_from_sin (float s) |
| float | cos_from_tan (float t) |
| int | midpoint (int a, int b) |
| #define atan2 _atan2 |
Definition at line 85 of file gpu_shader_math_base.bsl.hh.
Referenced by Freestyle::angle_from_cotan(), blender::area_element(), blender::armature_finalize_restpose(), atan2(), atan2(), blender::BLI_convexhull_aabb_fit_points_2d(), ComputeTwist(), direction_to_equirectangular_range(), EulerAngleFromMatrix(), KDL::Rotation::GetRot(), map_to_sphere(), map_to_tube(), and blender::valuefn().
| int ceil_to_multiple | ( | int | a, |
| int | b ) |
Returns a if it is a multiple of b or the next multiple or b after a . In other words, it is equivalent to divide_ceil(a, b) * b. It is undefined if a is negative or b is not strictly positive.
Definition at line 92 of file gpu_shader_math_base.bsl.hh.
References b, and ceil_to_multiple().
Referenced by ceil_to_multiple(), ceil_to_multiple(), ceil_to_multiple(), ceil_to_multiple< int2 >(), ceil_to_multiple< int3 >(), ceil_to_multiple< int4 >(), ceil_to_multiple< uint2 >(), ceil_to_multiple< uint3 >(), and ceil_to_multiple< uint4 >().
| uint ceil_to_multiple | ( | uint | a, |
| uint | b ) |
Definition at line 96 of file gpu_shader_math_base.bsl.hh.
References b, and ceil_to_multiple().
Definition at line 136 of file gpu_shader_math_base.bsl.hh.
References cos_from_sin(), max, sqrt, and square().
Referenced by bsdf_hair_chiang_albedo(), bsdf_hair_chiang_eval(), bsdf_hair_chiang_sample(), bsdf_hair_huang_albedo(), bsdf_hair_huang_sample(), cos_from_sin(), cos_from_sin(), hair_alpha_angles(), point_light_tree_parameters(), spot_light_tree_parameters(), draw::gsplat::AxisTuple::unpack(), and overlay::unpack_line_data().
Definition at line 141 of file gpu_shader_math_base.bsl.hh.
References cos_from_tan(), inversesqrt(), and square().
Referenced by cos_from_tan(), eevee::shadow_ray_generate_directional(), and eevee::light::shape_display_frag().
| int divide_ceil | ( | int | a, |
| int | b ) |
Integer division that returns the ceiling, instead of flooring like normal C division. It is undefined if a is negative or b is not strictly positive.
Definition at line 105 of file gpu_shader_math_base.bsl.hh.
References b, and divide_ceil().
Referenced by divide_ceil(), divide_ceil(), divide_ceil(), divide_ceil< int2 >(), divide_ceil< int3 >(), divide_ceil< int4 >(), divide_ceil< uint2 >(), divide_ceil< uint3 >(), divide_ceil< uint4 >(), eevee::lightprobe::volume::grid_brick_index_get(), blender::eevee::Film::init(), eevee::cryptomatte::Resources::load_samples(), blender::eevee::RayTraceModule::render(), eevee::light::culling::sort_main(), eevee::cryptomatte::Resources::store_samples(), eevee::hiz::update_main(), eevee::velocity::vertex_copy(), and eevee::light::culling::zbin_main().
| uint divide_ceil | ( | uint | a, |
| uint | b ) |
Definition at line 109 of file gpu_shader_math_base.bsl.hh.
References b, and divide_ceil().
Definition at line 20 of file gpu_shader_math_base.bsl.hh.
References b, and endvalue_preserving_mix().
Referenced by endvalue_preserving_mix(), endvalue_preserving_mix(), endvalue_preserving_mix(), endvalue_preserving_mix(), endvalue_preserving_mix(), endvalue_preserving_mix(), endvalue_preserving_mix(), endvalue_preserving_mix(), endvalue_preserving_mix(), endvalue_preserving_mix< float2, float >(), endvalue_preserving_mix< float2, float2 >(), endvalue_preserving_mix< float3, float >(), endvalue_preserving_mix< float3, float3 >(), endvalue_preserving_mix< float4, float >(), endvalue_preserving_mix< float4, float4 >(), node_mix_blend(), node_mix_blend(), node_mix_float(), node_mix_vector(), node_mix_vector_non_uniform(), svm_mix_blend(), svm_node_mix_float(), svm_node_mix_vector(), and svm_node_mix_vector_non_uniform().
Definition at line 73 of file gpu_shader_math_base.bsl.hh.
References hypot(), sqrt, x, and y.
Referenced by hypot(), blender::ed::transform::InputCustomRatioFlip(), blender::ed::transform::InputSpring(), node_tex_environment_equirectangular(), and detail::normalized_to_eul2().
Return true if the difference betweena and b is below the epsilon value.
Definition at line 126 of file gpu_shader_math_base.bsl.hh.
References abs, b, and is_equal().
Referenced by bxdf_ggx_eval_refraction(), blender::HashedSetSlot< std::string >::contains(), blender::IntrusiveMapSlot< Key *, Value, PointerKeyInfo< Key * > >::contains(), blender::IntrusiveSetSlot< Int, TemplatedKeyInfo< Int, EmptyValue, RemovedValue > >::contains(), blender::SimpleMapSlot< Key, Value >::contains(), blender::SimpleSetSlot< Key >::contains(), blender::SimpleVectorSetSlot< Key, IndexT >::contains(), blender::bke::curves::poly::direction_bisect(), gpu_math_test_main(), is_equal(), is_equal(), is_equal(), is_equal(), is_equal(), is_equal< float2 >(), is_equal< float3 >(), is_equal< float4 >(), blender::tests::TEST(), blender::tests::TEST(), blender::VectorSet< int, 0, DefaultProbingStrategy, DefaultHash< int >, DefaultEquality< int >, SimpleVectorSetSlot< int, LocalVertMapIndexT >, GuardedAllocator >::VectorSet(), and blender::view3d_panel_curve_data().
| int midpoint | ( | int | a, |
| int | b ) |
Matches std::midpoint from C++20.
Definition at line 149 of file gpu_shader_math_base.bsl.hh.
References b, max, midpoint(), min, and sign().
Referenced by blender::ed::transform::create_trans_seq_clamp_data(), midpoint(), midpoint(), midpoint< float2 >(), midpoint< float3 >(), midpoint< float4 >(), blender::seq::retiming_transition_key_frame_set(), solve_least_squares(), blender::eevee::IrradianceBake::surfel_raster_views_sync(), and eevee::shadow::usage::tag_usage_vert().
Component wise, use vector to replace min if it is smaller and max if bigger.
Definition at line 117 of file gpu_shader_math_base.bsl.hh.
References max, min, and min_max().
Referenced by min_max(), min_max(), min_max< float2 >(), min_max< float3 >(), and min_max< float4 >().
Definition at line 39 of file gpu_shader_math_base.bsl.hh.
References pow4f(), pow5f(), and x.
Referenced by eevee::lut::burley_sss_translucency(), eevee::lut::GGXBrdfClosure::eval(), eevee::lut::GGXBsdfClosure::eval(), eevee::lut::GGXBtdfGt1Closure::eval(), pow5f(), and eevee::lut::random_walk_sss_translucency().
Definition at line 43 of file gpu_shader_math_base.bsl.hh.
References pow2f(), pow3f(), pow6f(), and x.
Referenced by eevee::lut::GGXBrdfClosure::eval(), pow6f(), and pow7f().
Definition at line 51 of file gpu_shader_math_base.bsl.hh.
References pow2f(), pow4f(), pow8f(), and x.
Referenced by filters::angle_weight(), and pow8f().
Definition at line 131 of file gpu_shader_math_base.bsl.hh.
References max, sin_from_cos(), sqrt, and square().
Referenced by bsdf_hair_chiang_sample(), bsdf_oren_nayar_G(), bxdf_translucent_sample(), workbench::prepass::hair_random_normal(), eevee::init_globals_curves(), light_tree_importance(), microfacet_beckmann_sample_vndf(), mnee_compute_transfer_matrix(), node_tex_sky_nishita(), sample_cos_hemisphere(), sample_uniform_sphere(), eevee::shadow_normal_offset(), eevee::shadow_pcf_offset(), draw::Curves::shape_point_get(), sin_from_cos(), sin_from_cos(), spherical_cos_to_direction(), and triangle_light_sample().
Definition at line 56 of file gpu_shader_math_base.bsl.hh.
References square().
Referenced by eevee::lut::burley_sss_translucency(), bxdf_ggx_D(), bxdf_ggx_dominant_direction_reflection(), bxdf_ggx_dominant_direction_transmission(), bxdf_ggx_eval_reflection(), bxdf_ggx_eval_refraction(), bxdf_ggx_sample_reflection(), bxdf_ggx_sample_refraction(), bxdf_ggx_sample_vndf(), bxdf_ggx_smith_G1(), eevee::motion_blur::clamp_motion_and_get_length(), closure_evaluate_pdf(), eevee::deferred::combine_frag(), eevee::film::Film::combined_neighbor_boundbox(), eevee::lightprobe::sphere::cone_cosine_from_roughness(), cos_from_sin(), cos_from_tan(), eevee::dof::Accumulator::dof_gather_accumulate_center_sample(), eevee::dof::Accumulator::dof_gather_accumulator(), eevee::dof::resolve::Resources::dof_neighborhood_clamp(), dof_sample_weight(), dof_sample_weight(), eevee::dof::Accumulator::dof_slight_focus_gather(), eevee::fast_gi::eval(), eevee::ltc::evaluate_disk(), F0_from_f0(), F0_from_ior(), eevee::lightprobe::volume::VolumeOffset::find_closest_surfel(), eevee::ltc::detail::form_factor_attenuation(), eevee::dof::scatter::frag_main(), eevee::lut::GGXBrdfClosure::from_coords(), eevee::lut::GGXBsdfClosure::from_coords(), eevee::lut::GGXBtdfGt1Closure::from_coords(), from_up_axis(), filters::gaussian_factor(), eevee::lightprobe::volume::grid_bias_sample_coord(), intersect(), light_influence_attenuation(), light_point_light(), light_sphere_disk_radius(), eevee::lightprobe::volume::load_grid(), eevee::raytracing::denoise::DenoiseTemporal::local_statistics_get(), eevee::lightprobe::sphere::lod_to_roughness(), eevee::lut::GGXBsdfData::lut_coords_get(), eevee::camera::mirror_ball_to_direction(), eevee::deferred::planar_eval_frag(), filters::planar_weight(), principled_eval_translucent(), blender::eevee::random_in_tile(), eevee::ray_generate_direction(), eevee::lightprobe::sphere::roughness_to_mix_fac(), sample_circle(), sample_hemisphere(), sample_uniform_cone(), eevee::lightprobe::sphere::sample_weight(), eevee::shadow_map_trace(), sin_from_cos(), slab_transmittance_at_angle(), eevee::raytracing::denoise::spatial_main(), eevee::deferred::sphere_eval_frag(), square(), square(), square(), square(), eevee::lightprobe::sphere::sun_extraction(), eevee::raytracing::denoise::temporal_main(), blender::tests::TEST(), thin_glass_transmission_roughness(), and eevee::volume::volume_light().
Definition at line 60 of file gpu_shader_math_base.bsl.hh.
References square().
Definition at line 64 of file gpu_shader_math_base.bsl.hh.
References square().
Definition at line 68 of file gpu_shader_math_base.bsl.hh.
References square().