|
Blender V5.3
|
#include "gpu_shader_math_safe.bsl.hh"Go to the source code of this file.
A version of mod that behaves similar to C++ std::modf, and is safe such that it returns 0 when b is also 0.
Definition at line 42 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_mod(), float2::x, and float2::y.
A version of mod that behaves similar to C++ std::modf, and is safe such that it returns 0 when b is also 0.
Definition at line 70 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_mod(), float2::x, and float2::y.
A version of mod that behaves similar to C++ std::modf, and is safe such that it returns 0 when b is also 0.
Definition at line 50 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_mod(), float3::x, float3::y, and float3::z.
A version of mod that behaves similar to C++ std::modf, and is safe such that it returns 0 when b is also 0.
Definition at line 78 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_mod(), float3::x, float3::y, and float3::z.
A version of mod that behaves similar to C++ std::modf, and is safe such that it returns 0 when b is also 0.
Definition at line 58 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_mod(), float4::w, float4::x, float4::y, and float4::z.
A version of mod that behaves similar to C++ std::modf, and is safe such that it returns 0 when b is also 0.
Definition at line 86 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_mod(), float4::w, float4::x, float4::y, and float4::z.
Definition at line 210 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_pow(), float2::x, and float2::y.
Definition at line 214 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_pow(), float3::x, float3::y, and float3::z.
Definition at line 218 of file gpu_shader_math_vector_safe.bsl.hh.
References b, compatible_pow(), float4::w, float4::x, float4::y, and float4::z.
A version of pow that returns a fallback value if the computation is undefined. From the spec: The result is undefined if x < 0 or if x = 0 and y is less than or equal 0.
Definition at line 192 of file gpu_shader_math_vector_safe.bsl.hh.
References b, fallback_pow(), float2::x, and float2::y.
Definition at line 196 of file gpu_shader_math_vector_safe.bsl.hh.
References b, fallback_pow(), float3::x, float3::y, and float3::z.
Definition at line 202 of file gpu_shader_math_vector_safe.bsl.hh.
References b, fallback_pow(), float4::w, float4::x, float4::y, and float4::z.
| VecT normalize_fallback | ( | VecT | vector, |
| VecT | fallback ) |
Return normalized version of the vector or fallback vector if vector is invalid.
Definition at line 162 of file gpu_shader_math_vector_safe.bsl.hh.
References dot(), inversesqrt(), length_squared(), and normalize_fallback().
Referenced by eevee::ltc::detail::form_factor_attenuation(), node_bsdf_principled(), normalize_fallback(), normalize_fallback< float2 >(), normalize_fallback< float3 >(), and normalize_fallback< float4 >().
| template float2 normalize_fallback< float2 > | ( | float2 | , |
| float2 | ) |
References normalize_fallback().
| template float3 normalize_fallback< float3 > | ( | float3 | , |
| float3 | ) |
References normalize_fallback().
| template float4 normalize_fallback< float4 > | ( | float4 | , |
| float4 | ) |
References normalize_fallback().
Safe divide a by b. If b equal 0 the result will be 0.
Definition at line 112 of file gpu_shader_math_vector_safe.bsl.hh.
References b, and safe_divide().
Definition at line 116 of file gpu_shader_math_vector_safe.bsl.hh.
References b, and safe_divide().
Definition at line 120 of file gpu_shader_math_vector_safe.bsl.hh.
References b, and safe_divide().
| VecT safe_divide | ( | VecT | a, |
| VecT | b ) |
Safe divide a by b. If b equal 0 the result will be 0.
Definition at line 98 of file gpu_shader_math_vector_safe.bsl.hh.
References b, notEqual, safe_divide(), and select.
| template float2 safe_divide< float2 > | ( | float2 | , |
| float2 | ) |
References safe_divide().
| template float3 safe_divide< float3 > | ( | float3 | , |
| float3 | ) |
References safe_divide().
| template float4 safe_divide< float4 > | ( | float4 | , |
| float4 | ) |
References safe_divide().
Safe a modulo b. If b equal 0 the result will be 0.
Definition at line 25 of file gpu_shader_math_vector_safe.bsl.hh.
References b, mod, and safe_mod().
Definition at line 29 of file gpu_shader_math_vector_safe.bsl.hh.
References b, mod, and safe_mod().
Definition at line 33 of file gpu_shader_math_vector_safe.bsl.hh.
References b, mod, and safe_mod().
| VecT safe_mod | ( | VecT | a, |
| VecT | b ) |
Safe a modulo b. If b equal 0 the result will be 0.
Definition at line 13 of file gpu_shader_math_vector_safe.bsl.hh.
References b, mod, notEqual, safe_mod(), and select.
| VecT safe_normalize | ( | VecT | vector | ) |
Return normalized version of the vector or a default normalized vector if vector is invalid.
Definition at line 150 of file gpu_shader_math_vector_safe.bsl.hh.
References safe_normalize(), and safe_normalize_and_get_length().
Referenced by apply_corner_normal_delta(), attr_create_pointiness(), attr_load_tangent(), bsdf_hair_chiang_albedo(), bsdf_hair_chiang_eval(), bsdf_hair_chiang_sample(), bsdf_ray_portal_setup(), bxdf_ggx_eval_reflection(), compute_emitter_centroid_and_dir(), eevee::motion_blur::dilate::Resources::compute_motion_line(), AreaLight::copy_to_kernel(), SpotLight::copy_to_kernel(), SunLight::copy_to_kernel(), direction_to_fisheye_equidistant(), direction_to_fisheye_equisolid(), eevee::camera::fisheye_equisolid_from_direction(), eevee::camera::fisheye_lens_polynomial_from_direction(), eevee::forward_lighting_eval(), eevee::lightprobe::planar::display::frag_main(), eevee::init_globals(), eevee::init_globals_curves(), eevee::lightprobe::volume::RayCapture::irradiance_capture_surfel(), LightTreeEmitter::LightTreeEmitter(), make_orthonormals_safe_tangent(), merge(), motion_triangle_smooth_normal(), motion_triangle_smooth_normal(), node_ambient_occlusion(), node_bsdf_diffuse(), node_bsdf_glass(), node_bsdf_glossy(), node_bsdf_metallic(), node_bsdf_refraction(), node_bsdf_sheen(), node_bsdf_toon(), node_bsdf_translucent(), node_eevee_specular(), node_subsurface_scattering(), node_vector_displacement_tangent(), Mesh::SubdFace::normal(), object_inverse_normal_transform(), openpbr_eval_fuzz(), primitive_normal_set_undisplaced(), principled_bsdf_emission(), eevee::surfel::SurfelRay::radiance_transfer_surfel(), safe_normalize(), safe_normalize(), safe_normalize(), safe_normalize(), safe_normalize(), safe_normalize< float2 >(), safe_normalize< float3 >(), safe_normalize< float4 >(), save_pre_displacement_normals(), eevee::shadow_ray_generate_directional(), eevee::shadow_ray_generate_punctual(), eevee::raytracing::denoise::spatial_main(), spot_light_to_local(), store_vertex_normals(), svm_mapping(), svm_node_normal_map(), svm_node_set_bump(), svm_node_tex_coord_derivative(), svm_node_tex_environment_projection(), svm_node_vector_displacement(), svm_vector_math(), triangle_light_pdf(), triangle_light_sample(), triangle_smooth_normal(), triangle_smooth_normal(), triangle_smooth_normal_unnormalized_object_space(), and eevee::lightprobe::volume::RayCapture::validity_capture_surfel().
| template float2 safe_normalize< float2 > | ( | float2 | ) |
References safe_normalize().
| template float3 safe_normalize< float3 > | ( | float3 | ) |
References safe_normalize().
| template float4 safe_normalize< float4 > | ( | float4 | ) |
References safe_normalize().
| VecT safe_normalize_and_get_length | ( | VecT | vector, |
| float & | out_length ) |
Return normalized version of the vector or a default normalized vector if vector is invalid.
Definition at line 128 of file gpu_shader_math_vector_safe.bsl.hh.
References dot(), inversesqrt(), length_squared(), and safe_normalize_and_get_length().
Referenced by safe_normalize(), safe_normalize_and_get_length(), safe_normalize_and_get_length< float2 >(), safe_normalize_and_get_length< float3 >(), safe_normalize_and_get_length< float4 >(), and eevee::lightprobe::sphere::sun_extraction().
| template float2 safe_normalize_and_get_length< float2 > | ( | float2 | , |
| float & | ) |
References safe_normalize_and_get_length().
| template float3 safe_normalize_and_get_length< float3 > | ( | float3 | , |
| float & | ) |
References safe_normalize_and_get_length().
| template float4 safe_normalize_and_get_length< float4 > | ( | float4 | , |
| float & | ) |
References safe_normalize_and_get_length().
| VecT safe_rcp | ( | VecT | a | ) |
Safe reciprocal function. Returns 1/a. If a equal 0 the result will be 0.
Definition at line 180 of file gpu_shader_math_vector_safe.bsl.hh.
References notEqual, safe_rcp(), and select.
References safe_rcp().
References safe_rcp().
References safe_rcp().