Blender V5.3
noise_c.cc File Reference
#include <algorithm>
#include <cmath>
#include "BLI_compiler_compat.hh"
#include "BLI_sys_types.hh"
#include "BLI_noise_c.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define VALUE_AT(rx, ry, rz)
#define SURVE(t)

Functions

Improved Perlin Noise Implementation (New)
BLI_INLINE float blender::lerp (float t, float a, float b)
BLI_INLINE float blender::npfade (float t)
BLI_INLINE float blender::grad (int hash_val, float x, float y, float z)
static float blender::newPerlin (float x, float y, float z)
static float blender::newPerlinU (float x, float y, float z)
Voronoi/Worley Implementation
static float blender::dist_Squared (float x, float y, float z, float e)
static float blender::dist_Real (float x, float y, float z, float e)
static float blender::dist_Manhattan (float x, float y, float z, float e)
static float blender::dist_Chebychev (float x, float y, float z, float e)
static float blender::dist_MinkovskyH (float x, float y, float z, float e)
static float blender::dist_Minkovsky4 (float x, float y, float z, float e)
static float blender::dist_Minkovsky (float x, float y, float z, float e)
void blender::BLI_noise_voronoi (float x, float y, float z, float *da, float *pa, float me, int dtype)
static float blender::voronoi_F1 (float x, float y, float z)
static float blender::voronoi_F2 (float x, float y, float z)
static float blender::voronoi_F3 (float x, float y, float z)
static float blender::voronoi_F4 (float x, float y, float z)
static float blender::voronoi_F1F2 (float x, float y, float z)
static float blender::voronoi_Cr (float x, float y, float z)
static float blender::voronoi_F1S (float x, float y, float z)
static float blender::voronoi_F2S (float x, float y, float z)
static float blender::voronoi_F3S (float x, float y, float z)
static float blender::voronoi_F4S (float x, float y, float z)
static float blender::voronoi_F1F2S (float x, float y, float z)
static float blender::voronoi_CrS (float x, float y, float z)
Cell-Noise Implementation
static float blender::BLI_cellNoiseU (float x, float y, float z)
float blender::BLI_noise_cell (float x, float y, float z)
void blender::BLI_noise_cell_v3 (float x, float y, float z, float r_ca[3])
Public API's
float blender::BLI_noise_generic_noise (float noisesize, float x, float y, float z, bool hard, int noisebasis)
float blender::BLI_noise_generic_turbulence (float noisesize, float x, float y, float z, int oct, bool hard, int noisebasis)
float blender::BLI_noise_mg_fbm (float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis)
float blender::BLI_noise_mg_multi_fractal (float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis)
float blender::BLI_noise_mg_hetero_terrain (float x, float y, float z, float H, float lacunarity, float octaves, float offset, int noisebasis)
float blender::BLI_noise_mg_hybrid_multi_fractal (float x, float y, float z, float H, float lacunarity, float octaves, float offset, float gain, int noisebasis)
float blender::BLI_noise_mg_ridged_multi_fractal (float x, float y, float z, float H, float lacunarity, float octaves, float offset, float gain, int noisebasis)
float blender::BLI_noise_mg_variable_lacunarity (float x, float y, float z, float distortion, int nbas1, int nbas2)

Static Data

#define HASHPNT(x, y, z)
#define hash   BLI_noise_hash_uchar_512
static const float blender::hashpntf [768]
static const float blender::hashvectf [768]

Improved Perlin Noise Implementation (Original)

#define SETUP(val, b0, b1, r0, r1)
static const char blender::g_perlin_data_ub [512+2]
static const float blender::g_perlin_data_v3 [512+2][3]
static float blender::noise3_perlin (const float vec[3])
static float blender::orgBlenderNoise (float x, float y, float z)
static float blender::orgBlenderNoiseS (float x, float y, float z)
float blender::BLI_noise_hnoise (float noisesize, float x, float y, float z)
float blender::BLI_noise_turbulence (float noisesize, float x, float y, float z, int nr)
static float blender::orgPerlinNoise (float x, float y, float z)
static float blender::orgPerlinNoiseU (float x, float y, float z)
float blender::BLI_noise_hnoisep (float noisesize, float x, float y, float z)

Macro Definition Documentation

◆ hash

#define hash   BLI_noise_hash_uchar_512

Definition at line 156 of file noise_c.cc.

Referenced by lexit::IdentifierMap::add_after(), LightManager::add_ies(), blender::BKE_cryptomatte_hash(), blender::BKE_cryptomatte_matte_id_to_entries(), blender::BKE_idtype_cache_key_hash(), blender::BKE_modifiers_persistent_uid_init(), blender::BKE_sim_debug_data_add_element(), blender::BKE_sim_debug_data_remove_element(), blender::BKE_viewer_path_hash(), blender::BLI_ghash_ensure_p(), blender::BLI_ghash_ensure_p_ex(), blender::BLI_ghash_popkey(), blender::BLI_ghash_remove(), blender::BLI_ghash_replace_key(), blender::BLI_ghashutil_pairhash(), blender::BLI_ghashutil_uinthash_v4(), blender::BLI_gset_ensure_p_ex(), blender::BLI_gset_insert(), blender::BLI_gset_pop_key(), blender::BLI_hash_pointer_to_color(), btAdjustInternalEdgeContacts(), btGetHash(), btHashString::btHashString(), blender::deg::build_collision_relations(), blender::deg::build_effector_relations(), blender::gpu::VKShaderModule::build_sources_hash(), mikk::Mikktspace< Mesh >::buildNeighbors(), blender::fn::multi_function::MultiFunction::call(), blender::ccd_build_deflector_hash(), blender::ccd_build_deflector_hash_single(), blender::ccd_update_deflector_hash(), blender::ccd_update_deflector_hash_single(), blender::deg::clear_physics_relations(), blender::bke::id_hash::compute_file_hash(), blender::bke::id_hash::compute_file_hash_with_memory_map(), blender::HashedSetSlot< std::string >::contains(), blender::nodes::node_geo_duplicate_elements_cc::copy_hashed_ids(), blender::fn::multi_function::CustomMF_GenericConstant::CustomMF_Constant, blender::DEG_get_collision_relations(), blender::DEG_get_effector_relations(), blender::ed::sculpt_paint::image::do_paint_pixels(), blender::ED_mesh_mirrtopo_init(), blender::fn::FieldHashDeep::ensure(), blender::fn::evaluate_fields(), eevee::cryptomatte::false_color(), blender::animrig::Channelbag::fcurve_create_many(), blender::ed::geometry::find_verbose_log_contexts(), blender::find_verbose_log_contexts(), btHashMap< btHashInt, btTriangleInfo >::findIndex(), btHashedSimplePairCache::findPair(), blender::bke::cryptomatte::manifest::from_manifest(), blender::gpu::shader::GPUCodegen::generate_material_props(), blender::GPUPassCache::get(), draw::ViewLayerAttributes::get(), blender::eevee::Film::get_aov_texture(), blender::ed::space_node::get_compute_context_hash_for_node_editor(), blender::IntrusiveMapSlot< Key *, Value, PointerKeyInfo< Key * > >::get_hash(), blender::IntrusiveSetSlot< Int, TemplatedKeyInfo< Int, EmptyValue, RemovedValue > >::get_hash(), blender::SimpleMapSlot< Key, Value >::get_hash(), blender::SimpleSetSlot< Key >::get_hash(), blender::SimpleVectorSetSlot< Key, IndexT >::get_hash(), blender::ed::space_node::get_nested_previews(), blender::bke::id_hash::get_source_file_hash(), blender::ghash_bucket_index(), blender::ghash_buckets_resize(), blender::ghash_insert(), blender::ghash_insert_safe(), blender::ghash_insert_safe_keyonly(), blender::ghash_lookup_entry(), blender::GPU_material_add_output_link_aov(), grad1(), grad2(), grad3(), grad4(), blender::hash_string(), blender::bke::hash_to_anonymous_attribute_name(), blender::bke::mesh_surface_sample::BaryWeightSampleFn::hash_unique(), blender::bke::mesh_surface_sample::NearestCornerFromPositionFn::hash_unique(), blender::bke::SampleIndexFunction::hash_unique(), blender::fn::multi_function::CustomMF_Constant< T >::hash_unique(), blender::fn::multi_function::CustomMF_GenericConstant::hash_unique(), blender::fn::multi_function::MultiFunction::hash_unique(), blender::nodes::ClampWrapperFunction::hash_unique(), blender::nodes::node_fn_align_rotation_to_vector_cc::AlignRotationToVectorFunction::hash_unique(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::hash_unique(), blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction::hash_unique(), blender::nodes::node_geo_menu_switch_cc::MenuSwitchBoolsFn::hash_unique(), blender::nodes::node_geo_menu_switch_cc::MenuSwitchFn::hash_unique(), blender::nodes::node_geo_proximity_cc::ProximityFunction::hash_unique(), blender::nodes::node_geo_raycast_cc::RaycastFunction::hash_unique(), blender::nodes::node_geo_sample_nearest_cc::SampleNearestFunction::hash_unique(), blender::nodes::node_geo_sample_nearest_surface_cc::SampleNearestSurfaceFunction::hash_unique(), blender::nodes::node_geo_sample_uv_surface_cc::ReverseUVSampleFunction::hash_unique(), blender::nodes::node_sh_mix_cc::MixColorFunction::hash_unique(), blender::nodes::node_shader_color_ramp_cc::ColorBandFunction::hash_unique(), blender::nodes::node_shader_curves_cc::flt::CurveFloatFunction::hash_unique(), blender::nodes::node_shader_curves_cc::rgb::CurveRGBFunction::hash_unique(), blender::nodes::node_shader_curves_cc::vec::CurveVecFunction::hash_unique(), blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction::hash_unique(), blender::nodes::node_shader_tex_brick_cc::BrickFunction::hash_unique(), blender::nodes::node_shader_tex_gabor_cc::GaborNoiseFunction::hash_unique(), blender::nodes::node_shader_tex_gradient_cc::GradientFunction::hash_unique(), blender::nodes::node_shader_tex_magic_cc::MagicFunction::hash_unique(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::hash_unique(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiDistToEdgeFunction::hash_unique(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiMetricFunction::hash_unique(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiNSphereFunction::hash_unique(), blender::nodes::node_shader_tex_wave_cc::WaveFunction::hash_unique(), blender::nodes::node_shader_tex_white_noise_cc::WhiteNoiseFunction::hash_unique(), blender::nodes::SampleIndexFunction::hash_unique(), blender::cpp_type_util::hash_unique_cb(), blender::hash_unique_default(), blender::hash_unique_default(), blender::hash_unique_default(), hash_value_color(), hash_value_float(), hash_value_int(), hash_value_matrix(), hash_value_rotation(), hash_value_vector(), HsiehHash(), blender::bke::id_hash::id_hash_to_hex(), btHashMap< btHashInt, btTriangleInfo >::insert(), integrator_state_lcg_init(), integrator_state_lcg_init(), blender::LinearProbingStrategy::LinearProbingStrategy(), lexit::IdentifierMap::lookup_or_add(), make_string(), blender::workbench::Material::Material(), blender::mesh_calc_edges_mdata(), blender::mirrtopo_vert_sort(), blender::seq::modifier_persistent_uid_init(), blender::newPerlin(), blender::nodes::node_fn_random_value_cc::node_build_multi_function(), blender::bke::node_hash_int_str(), node_output_aov(), blender::nodes::node_shader_output_aov_cc::node_shader_gpu_output_aov(), blender::nodes::eval_log::NodeTreeLog::NodeTreeLog(), noise_grad(), noise_grad(), noise_grad(), noise_grad(), blender::HashedSetSlot< std::string >::occupy(), blender::IntrusiveMapSlot< Key *, Value, PointerKeyInfo< Key * > >::occupy(), blender::SimpleMapSlot< Key, Value >::occupy(), blender::DefaultHash< gpu::VKDescriptorSetLayoutInfo >::operator()(), blender::DefaultHash< Set< Vector< int > > >::operator()(), blender::DefaultHash< T * >::operator()(), blender::DefaultHash< Vector< gpu::shader::SpecializationConstant::Value > >::operator()(), blender::ed::object::DupliObjectHash::operator()(), blender::ed::object::DupliObjectInstancerHash::operator()(), ObjVertexHash::operator()(), blender::orgBlenderNoise(), output_aov(), path_files_md5_hash(), path_files_md5_hash_recursive(), blender::geometry::phash_insert(), blender::geometry::phash_lookup(), blender::geometry::phash_next(), blender::seq::pitchmodifier_get_params_hash(), blender::ui::popup_menu_memory__internal(), blender::fn::preprocess_field_tree(), blender::gpu::Preprocessor::Preprocessor(), btConnectivityProcessor::processTriangle(), blender::PythonProbingStrategy< LinearSteps, PreShuffle >::PythonProbingStrategy(), blender::QuadraticProbingStrategy::QuadraticProbingStrategy(), blender::eevee::random_in_tile(), random_value_int(), blender::ed::sculpt_paint::filter::randomize_factors(), btHashMap< btHashInt, btTriangleInfo >::remove(), btHashedSimplePairCache::removeOverlappingPair(), eevee::film::Film::sample_cryptomatte_accum(), blender::RandomNumberGenerator::seed_random(), blender::nodes::should_log_verbose_in_context(), blender::ShuffleProbingStrategy< LinearSteps, PreShuffle >::ShuffleProbingStrategy(), lexit::IdentifierMap::str_hash(), blender::TEST(), blender::TEST(), blender::thumb_create_ex(), blender::thumb_create_or_fail(), blender::nodes::node_geo_distribute_points_on_faces_cc::update_elimination_mask_based_on_density_factors(), util_hash_to_float(), blender::VectorSet< int, 0, DefaultProbingStrategy, DefaultHash< int >, DefaultEquality< int >, SimpleVectorSetSlot< int, LocalVertMapIndexT >, GuardedAllocator >::VectorSet(), blender::view_layer_bases_hash_create(), blender::gpu::render_graph::VKRenderGraph::VKScheduler, blender::WM_gizmomap_gizmo_hash_new(), blender::wm_gizmomap_select_all_intern(), and blender::render::TilesHighlight::~TilesHighlight().

◆ HASHPNT

#define HASHPNT ( x,
y,
z )
Value:
hashpntf + 3 * hash[(hash[(hash[(z) & 255] + (y)) & 255] + (x)) & 255]
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
#define hash
Definition noise_c.cc:156

Definition at line 32 of file noise_c.cc.

Referenced by blender::BLI_noise_cell_v3(), and blender::BLI_noise_voronoi().

◆ SETUP

#define SETUP ( val,
b0,
b1,
r0,
r1 )
Value:
{ \
t = val + 10000.0f; \
b0 = (int(t)) & 255; \
b1 = (b0 + 1) & 255; \
r0 = t - floorf(t); \
r1 = r0 - 1.0f; \
} \
(void)0
#define floorf

Definition at line 754 of file noise_c.cc.

Referenced by blender::noise3_perlin(), Freestyle::Noise::smoothNoise1(), Freestyle::Noise::smoothNoise2(), and Freestyle::Noise::smoothNoise3().

◆ SURVE

#define SURVE ( t)
Value:
((t) * (t) * (3.0f - 2.0f * (t)))

Referenced by blender::noise3_perlin().

◆ VALUE_AT

#define VALUE_AT ( rx,
ry,
rz )
Value:
((rx) * q[0] + (ry) * q[1] + (rz) * q[2])

Referenced by blender::noise3_perlin().