Blender V5.3
gpu_shader_math_matrix_compare.bsl.hh File Reference

Go to the source code of this file.

Functions

Compare / Test
bool is_zero (float3x3 a)
bool is_zero (float4x4 a)
bool is_negative (float3x3 mat)
bool is_negative (float4x4 mat)
bool is_equal (float2x2 a, float2x2 b, float epsilon)
bool is_equal (float3x3 a, float3x3 b, float epsilon)
bool is_equal (float4x4 a, float4x4 b, float epsilon)
bool is_orthogonal (float3x3 mat)
bool is_orthogonal (float4x4 mat)
bool is_orthonormal (float3x3 mat)
bool is_orthonormal (float4x4 mat)
bool is_uniformly_scaled (float3x3 mat)
bool is_uniformly_scaled (float4x4 mat)
bool is_unit_scale (float4x4 m)
bool is_unit_scale (float3x3 m)
bool is_unit_scale (float2x2 m)

Function Documentation

◆ is_equal() [1/3]

bool is_equal ( float2x2 a,
float2x2 b,
float epsilon )

Returns true if matrices are equal within the given epsilon.

Definition at line 65 of file gpu_shader_math_matrix_compare.bsl.hh.

References b, and is_equal().

◆ is_equal() [2/3]

bool is_equal ( float3x3 a,
float3x3 b,
float epsilon )

Returns true if matrices are equal within the given epsilon.

Definition at line 77 of file gpu_shader_math_matrix_compare.bsl.hh.

References b, and is_equal().

◆ is_equal() [3/3]

bool is_equal ( float4x4 a,
float4x4 b,
float epsilon )

Returns true if matrices are equal within the given epsilon.

Definition at line 91 of file gpu_shader_math_matrix_compare.bsl.hh.

References b, and is_equal().

◆ is_negative() [1/2]

bool is_negative ( float3x3 mat)

◆ is_negative() [2/2]

bool is_negative ( float4x4 mat)

Returns true if matrix has inverted handedness.

Note
It doesn't use determinant(mat4x4) as only the 3x3 components are needed when the matrix is used as a transformation to represent location/scale/rotation.

Definition at line 57 of file gpu_shader_math_matrix_compare.bsl.hh.

References is_negative().

◆ is_orthogonal() [1/2]

bool is_orthogonal ( float3x3 mat)

Test if the X, Y and Z axes are perpendicular with each other.

Definition at line 107 of file gpu_shader_math_matrix_compare.bsl.hh.

References abs, dot(), and is_orthogonal().

Referenced by gpu_math_test_main(), is_orthogonal(), is_orthogonal(), is_orthonormal(), is_uniformly_scaled(), and blender::tests::TEST().

◆ is_orthogonal() [2/2]

bool is_orthogonal ( float4x4 mat)

Test if the X, Y and Z axes are perpendicular with each other.

Definition at line 123 of file gpu_shader_math_matrix_compare.bsl.hh.

References is_orthogonal().

◆ is_orthonormal() [1/2]

bool is_orthonormal ( float3x3 mat)

Test if the X, Y and Z axes are perpendicular with each other and unit length.

Definition at line 131 of file gpu_shader_math_matrix_compare.bsl.hh.

References abs, dot(), is_orthogonal(), and is_orthonormal().

Referenced by gpu_math_test_main(), is_orthonormal(), is_orthonormal(), and blender::tests::TEST().

◆ is_orthonormal() [2/2]

bool is_orthonormal ( float4x4 mat)

Test if the X, Y and Z axes are perpendicular with each other and unit length.

Definition at line 150 of file gpu_shader_math_matrix_compare.bsl.hh.

References is_orthonormal().

◆ is_uniformly_scaled() [1/2]

bool is_uniformly_scaled ( float3x3 mat)

Test if the X, Y and Z axes are perpendicular with each other and the same length.

Definition at line 158 of file gpu_shader_math_matrix_compare.bsl.hh.

References abs, dot(), eps, is_orthogonal(), is_uniformly_scaled(), x, y, and z().

Referenced by gpu_math_test_main(), is_uniformly_scaled(), is_uniformly_scaled(), and blender::tests::TEST().

◆ is_uniformly_scaled() [2/2]

bool is_uniformly_scaled ( float4x4 mat)

Test if the X, Y and Z axes are perpendicular with each other and the same length.

Definition at line 172 of file gpu_shader_math_matrix_compare.bsl.hh.

References is_uniformly_scaled().

◆ is_unit_scale() [1/3]

bool is_unit_scale ( float2x2 m)

Definition at line 204 of file gpu_shader_math_matrix_compare.bsl.hh.

References is_unit_scale().

◆ is_unit_scale() [2/3]

bool is_unit_scale ( float3x3 m)

Definition at line 192 of file gpu_shader_math_matrix_compare.bsl.hh.

References is_unit_scale().

◆ is_unit_scale() [3/3]

◆ is_zero() [1/2]

bool is_zero ( float3x3 a)

Returns true if all of the matrices components are strictly equal to 0.

Definition at line 16 of file gpu_shader_math_matrix_compare.bsl.hh.

References is_zero().

Referenced by eevee::film::accumulate_or_display_frag(), align_rotation_to_vector_auto_pivot(), align_rotation_to_vector_fixed_pivot(), axes_to_rotation(), bsdf_dielectric_tint_setup(), bsdf_eval_is_zero(), bsdf_microfacet_setup_fresnel_generalized_schlick(), bsdf_ray_portal_setup(), bsdf_thin_glass_fresnel(), bsdf_thin_subsurface_setup(), camera_sample_custom(), camera_sample_panorama(), blender::gpu::convert_float_formats(), ShaderManager::device_update_common(), direction_to_equirectangular_range(), direction_to_equirectangular_range(), Shader::estimate_emission(), ImageMetaData::finalize(), workbench::volume::flag_to_color(), flatten_closure_tree(), gpu_math_test_main(), Light::has_contribution(), integrate_light_forward(), integrate_light_nee(), integrate_sun_lights(), integrator_init_from_camera(), OrientationBounds::is_empty(), is_zero(), is_zero(), is_zero(), is_zero(), is_zero(), is_zero(), is_zero(), is_zero(), is_zero(), is_zero< float2 >(), is_zero< float3 >(), is_zero< float4 >(), iszero(), light_sample_terminate(), light_tree_to_local_space(), motion_triangle_smooth_normal(), motion_triangle_smooth_normal(), blender::nodes::node_geo_tool_set_face_set_cc::node_geo_exec(), osl_closure_generalized_schlick_bsdf_setup(), osl_closure_thin_glass_setup(), eevee::film::Film::panoramic_sample_get(), eevee::film::Film::panoramic_texel_is_owned_by_view(), principled_bsdf_emission(), quaternion_to_rotation(), safe_normalize(), eevee::light::VisibleLightIterator::should_skip(), surface_shader_ao(), surface_shader_average_normal(), svm_node_normal_map(), svm_node_set_bump(), svm_node_volume_coefficients(), eevee::shadow::usage::tag_usage_volume(), blender::tests::TEST(), to_axis_angle(), to_quaternion(), lexit::TokenBuffer::tokenize(), transform_motion_decompose(), blender::ed::transform::transform_orientations_create_from_axis(), triangle_smooth_normal(), triangle_smooth_normal(), triangle_smooth_normal_unnormalized_object_space(), builtin::nodelink::vert(), and eevee::debug::irradiance_grid::vert_main().

◆ is_zero() [2/2]

bool is_zero ( float4x4 a)

Returns true if all of the matrices components are strictly equal to 0.

Definition at line 30 of file gpu_shader_math_matrix_compare.bsl.hh.

References is_zero().