HighMap library (C++)
|
Functions | |
Array | blend_gradients (const Array &array1, const Array &array2, int ir=4) |
See hmap::blend_gradients. | |
Array | blend_poisson_bf (const Array &array1, const Array &array2, const int iterations=500, const Array *p_mask=nullptr) |
Blends two arrays using Poisson blending with a brute-force solver. | |
Array | accumulation_curvature (const Array &z, int ir) |
See hmap::accumulation_curvature. | |
Array | curvature_horizontal_cross_sectional (const Array &z, int ir) |
See hmap::curvature_horizontal_cross_sectional. | |
Array | curvature_horizontal_plan (const Array &z, int ir) |
See hmap::curvature_horizontal_plan. | |
Array | curvature_horizontal_tangential (const Array &z, int ir) |
See hmap::curvature_horizontal_tangential. | |
Array | curvature_ring (const Array &z, int ir) |
See hmap::curvature_ring. | |
Array | curvature_rotor (const Array &z, int ir) |
See hmap::curvature_rotor. | |
Array | curvature_vertical_longitudinal (const Array &z, int ir) |
See hmap::curvature_vertical_longitudinal. | |
Array | curvature_vertical_profile (const Array &z, int ir) |
See hmap::curvature_vertical_profile. | |
Array | shape_index (const Array &z, int ir) |
See hmap::shape_index. | |
Array | unsphericity (const Array &z, int ir) |
See hmap::unsphericity. | |
void | hydraulic_particle (Array &z, int nparticles, int seed, Array *p_bedrock=nullptr, Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, float c_capacity=10.f, float c_erosion=0.05f, float c_deposition=0.05f, float c_inertia=0.3f, float drag_rate=0.001f, float evap_rate=0.001f, bool post_filtering=false) |
See hmap::hydraulic_particle. | |
void | hydraulic_particle (Array &z, Array *p_mask, int nparticles, int seed, Array *p_bedrock=nullptr, Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, float c_capacity=10.f, float c_erosion=0.05f, float c_deposition=0.05f, float c_inertia=0.3f, float drag_rate=0.001f, float evap_rate=0.001f, bool post_filtering=false) |
See hmap::hydraulic_particle. | |
void | hydraulic_schott (Array &z, int iterations, const Array &talus, float c_erosion=1.f, float c_thermal=0.1f, float c_deposition=0.2f, float flow_acc_exponent=0.8f, float flow_acc_exponent_depo=0.8f, float flow_routing_exponent=1.3f, float thermal_weight=1.5f, float deposition_weight=2.5f, Array *p_flow=nullptr) |
Simulates hydraulic erosion and deposition on a heightmap using the Schott method. | |
void | hydraulic_schott (Array &z, int iterations, const Array &talus, Array *p_mask, float c_erosion=1.f, float c_thermal=0.1f, float c_deposition=0.2f, float flow_acc_exponent=0.8f, float flow_acc_exponent_depo=0.8f, float flow_routing_exponent=1.3f, float thermal_weight=1.5f, float deposition_weight=2.5f, Array *p_flow=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | hydraulic_stream_log (Array &z, float c_erosion, float talus_ref, int deposition_ir=32, float deposition_scale_ratio=1.f, float gradient_power=0.8f, float gradient_scaling_ratio=1.f, int gradient_prefilter_ir=16, float saturation_ratio=1.f, Array *p_bedrock=nullptr, Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, Array *p_flow_map=nullptr) |
See hmap::hydraulic_stream_log. | |
void | hydraulic_stream_log (Array &z, float c_erosion, float talus_ref, Array *p_mask, int deposition_ir=32, float deposition_scale_ratio=1.f, float gradient_power=0.8f, float gradient_scaling_ratio=1.f, int gradient_prefilter_ir=16, float saturation_ratio=1.f, Array *p_bedrock=nullptr, Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, Array *p_flow_map=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | thermal (Array &z, const Array &talus, int iterations=10, Array *p_bedrock=nullptr, Array *p_deposition_map=nullptr) |
See hmap::thermal. | |
void | thermal (Array &z, Array *p_mask, const Array &talus, int iterations=10, Array *p_bedrock=nullptr, Array *p_deposition_map=nullptr) |
See hmap::thermal. | |
void | thermal (Array &z, float talus, int iterations=10, Array *p_bedrock=nullptr, Array *p_deposition_map=nullptr) |
See hmap::thermal. | |
void | thermal_auto_bedrock (Array &z, const Array &talus, int iterations=10, Array *p_deposition_map=nullptr) |
See hmap::thermal_auto_bedrock. | |
void | thermal_auto_bedrock (Array &z, Array *p_mask, const Array &talus, int iterations=10, Array *p_deposition_map=nullptr) |
See hmap::thermal_auto_bedrock. | |
void | thermal_auto_bedrock (Array &z, float, int iterations=10, Array *p_deposition_map=nullptr) |
See hmap::thermal_auto_bedrock. | |
void | thermal_inflate (Array &z, const Array &talus, int iterations=10) |
Apply thermal weathering erosion to give a scree like effect. | |
void | thermal_inflate (Array &z, const Array *p_mask, const Array &talus, int iterations=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | thermal_rib (Array &z, int iterations, Array *p_bedrock=nullptr) |
See hmap::thermal_rib. | |
void | thermal_ridge (Array &z, const Array &talus, int iterations=10, Array *p_deposition_map=nullptr) |
Apply thermal weathering erosion to give a ridge like effect. | |
void | thermal_ridge (Array &z, const Array *p_mask, const Array &talus, int iterations=10, Array *p_deposition_map=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | thermal_scree (Array &z, const Array &talus, const Array &zmax, int iterations=10, bool talus_constraint=true, Array *p_deposition_map=nullptr) |
Performs thermal scree erosion on a heightmap. | |
void | thermal_scree (Array &z, const Array *p_mask, const Array &talus, const Array &zmax, int iterations=10, bool talus_constraint=true, Array *p_deposition_map=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Array | local_median_deviation (const Array &array, int ir) |
See hmap::local_median_deviation. | |
Array | mean_local (const Array &array, int ir) |
See hmap::mean_local. | |
Array | relative_elevation (const Array &array, int ir) |
See hmap::relative_elevation. | |
Array | ruggedness (const Array &array, int ir) |
See hmap::ruggedness. | |
Array | rugosity (const Array &z, int ir, bool convex=true) |
See hmap::rugosity. | |
Array | std_local (const Array &array, int ir) |
See hmap::std_local. | |
Array | z_score (const Array &array, int ir) |
See hmap::z_score. | |
void | expand (Array &array, int ir, int iterations=1) |
See hmap::expand. | |
void | expand (Array &array, int ir, const Array *p_mask, int iterations=1) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | expand (Array &array, const Array &kernel, int iterations=1) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | expand (Array &array, const Array &kernel, const Array *p_mask, int iterations=1) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | gamma_correction_local (Array &array, float gamma, int ir, float k=0.1f) |
See hmap::gamma_correction_local. | |
void | gamma_correction_local (Array &array, float gamma, int ir, const Array *p_mask, float k=0.1f) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | laplace (Array &array, float sigma=0.2f, int iterations=3) |
See hmap::laplace. | |
void | laplace (Array &array, const Array *p_mask, float sigma=0.2f, int iterations=3) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Array | maximum_local (const Array &array, int ir) |
See hmap::maximum_local. | |
Array | maximum_local_disk (const Array &array, int ir) |
See hmap::maximum_local_disk. | |
Array | mean_shift (const Array &array, int ir, float talus, int iterations=1, bool talus_weighted=true) |
See hmap::mean_shift. | |
Array | mean_shift (const Array &array, int ir, float talus, const Array *p_mask, int iterations=1, bool talus_weighted=true) |
void | median_3x3 (Array &array) |
See hmap::median_3x3. | |
void | median_3x3 (Array &array, const Array *p_mask) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Array | median_pseudo (const Array &array, int ir) |
See hmap::median_pseudo. | |
Array | minimum_local (const Array &array, int ir) |
See hmap::minimum_local. | |
Array | minimum_local_disk (const Array &array, int ir) |
See hmap::minimum_local_disk. | |
void | normal_displacement (Array &array, float amount=0.1f, int ir=0, bool reverse=false) |
See hmap::normal_displacement. | |
void | normal_displacement (Array &array, const Array *p_mask, float amount=0.1f, int ir=0, bool reverse=false) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | plateau (Array &array, const Array *p_mask, int ir, float factor) |
See hmap::plateau. | |
void | plateau (Array &array, int ir, float factor) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | shrink (Array &array, int ir, int iterations=1) |
See hmap::shrink. | |
void | shrink (Array &array, int ir, const Array *p_mask, int iterations=1) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | shrink (Array &array, const Array &kernel, int iterations=1) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | shrink (Array &array, const Array &kernel, const Array *p_mask, int iterations=1) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | smooth_cpulse (Array &array, int ir) |
See hmap::smooth_cpulse. | |
void | smooth_cpulse (Array &array, int ir, const Array *p_mask) |
See hmap::smooth_cpulse. | |
void | smooth_fill (Array &array, int ir, float k=0.1f, Array *p_deposition_map=nullptr) |
See hmap::smooth_fill. | |
void | smooth_fill (Array &array, int ir, const Array *p_mask, float k=0.1f, Array *p_deposition_map=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | smooth_fill_holes (Array &array, int ir) |
See hmap::smooth_fill_holes. | |
void | smooth_fill_holes (Array &array, int ir, const Array *p_mask) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | smooth_fill_smear_peaks (Array &array, int ir) |
See hmap::smooth_fill_smear_peaks. | |
void | smooth_fill_smear_peaks (Array &array, int ir, const Array *p_mask) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Array | gradient_norm (const Array &array) |
See hmap::gradient_norm. | |
Array | flow_direction_d8 (const Array &z) |
See hmap::flow_direction_d8. | |
Array | generate_riverbed (const Path &path, Vec2< int > shape, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, bool bezier_smoothing=false, float depth_start=0.01f, float depth_end=1.f, float slope_start=64.f, float slope_end=32.f, float shape_exponent_start=1.f, float shape_exponent_end=10.f, float k_smoothing=0.5f, int post_filter_ir=0, Array *p_noise_x=nullptr, Array *p_noise_y=nullptr, Array *p_noise_r=nullptr) |
See hmap::generate_riverbed. | |
void | interpolate_array_bicubic (const Array &source, Array &target) |
void | interpolate_array_bicubic (const Array &source, Array &target, const Vec4< float > &bbox_source, const Vec4< float > &bbox_target) |
void | interpolate_array_bilinear (const Array &source, Array &target) |
void | interpolate_array_bilinear (const Array &source, Array &target, const Vec4< float > &bbox_source, const Vec4< float > &bbox_target) |
void | interpolate_array_lagrange (const Array &source, Array &target, int order) |
void | interpolate_array_nearest (const Array &source, Array &target) |
void | interpolate_array_nearest (const Array &source, Array &target, const Vec4< float > &bbox_source, const Vec4< float > &bbox_target) |
Array | border (const Array &array, int ir) |
See hmap::border. | |
Array | closing (const Array &array, int ir) |
See hmap::closing. | |
Array | dilation (const Array &array, int ir) |
See hmap::dilation. | |
Array | erosion (const Array &array, int ir) |
See hmap::erosion. | |
Array | morphological_black_hat (const Array &array, int ir) |
See hmap::morphological_black_hat. | |
Array | morphological_gradient (const Array &array, int ir) |
See hmap::morphological_gradient. | |
Array | morphological_top_hat (const Array &array, int ir) |
See hmap::morphological_top_hat. | |
Array | opening (const Array &array, int ir) |
See hmap::opening. | |
Array | relative_distance_from_skeleton (const Array &array, int ir_search, bool zero_at_borders=true, int ir_erosion=1) |
See hmap::relative_distance_from_skeleton. | |
Array | skeleton (const Array &array, bool zero_at_borders=true) |
See hmap::skeleton. | |
void | helper_bind_optional_buffer (clwrapper::Run &run, const std::string &id, const Array *p_array) |
bool | init_opencl () |
Array | basalt_field (Vec2< int > shape, Vec2< float > kw, uint seed, float warp_kw=4.f, float large_scale_warp_amp=0.2f, float large_scale_gain=6.f, float large_scale_amp=0.2f, float medium_scale_kw_ratio=3.f, float medium_scale_warp_amp=1.f, float medium_scale_gain=7.f, float medium_scale_amp=0.08f, float small_scale_kw_ratio=10.f, float small_scale_amp=0.1f, float small_scale_overlay_amp=0.002f, float rugosity_kw_ratio=1.f, float rugosity_amp=1.f, bool flatten_activate=true, float flatten_kw_ratio=1.f, float flatten_amp=0.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Generates a synthetic procedural terrain resembling basaltic landforms. | |
Array | gabor_wave (Vec2< int > shape, Vec2< float > kw, uint seed, const Array &angle, float angle_spread_ratio=1.f, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Return an array filled with coherence Gabor noise. | |
Array | gabor_wave (Vec2< int > shape, Vec2< float > kw, uint seed, float angle=0.f, float angle_spread_ratio=1.f, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Array | gabor_wave_fbm (Vec2< int > shape, Vec2< float > kw, uint seed, const Array &angle, float angle_spread_ratio=1.f, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Return an array filled with coherence Gabor noise. | |
Array | gabor_wave_fbm (Vec2< int > shape, Vec2< float > kw, uint seed, float angle=0.f, float angle_spread_ratio=1.f, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Array | gavoronoise (Vec2< int > shape, Vec2< float > kw, uint seed, const Array &angle, float amplitude=0.05f, float angle_spread_ratio=1.f, Vec2< float > kw_multiplier={4.f, 4.f}, float slope_strength=1.f, float branch_strength=2.f, float z_cut_min=0.2f, float z_cut_max=1.f, int octaves=8, float persistence=0.4f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Generates a 2D array using the GavoroNoise algorithm, which is a procedural noise technique for terrain generation and other applications. | |
Array | gavoronoise (Vec2< int > shape, Vec2< float > kw, uint seed, float angle=0.f, float amplitude=0.05f, float angle_spread_ratio=1.f, Vec2< float > kw_multiplier={4.f, 4.f}, float slope_strength=1.f, float branch_strength=2.f, float z_cut_min=0.2f, float z_cut_max=1.f, int octaves=8, float persistence=0.4f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Array | gavoronoise (const Array &base, Vec2< float > kw, uint seed, float amplitude=0.05f, Vec2< float > kw_multiplier={4.f, 4.f}, float slope_strength=1.f, float branch_strength=2.f, float z_cut_min=0.2f, float z_cut_max=1.f, int octaves=8, float persistence=0.4f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Array | mountain_range_radial (Vec2< int > shape, Vec2< float > kw, uint seed, float half_width=0.2f, float angle_spread_ratio=0.5f, float core_size_ratio=1.f, Vec2< float > center={0.5f, 0.5f}, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_angle=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Generates a heightmap representing a radial mountain range. | |
Array | noise (NoiseType noise_type, Vec2< int > shape, Vec2< float > kw, uint seed, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
See hmap::noise. | |
Array | noise_fbm (NoiseType noise_type, Vec2< int > shape, Vec2< float > kw, uint seed, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
See hmap::noise_fbm. | |
Array | polygon_field (Vec2< int > shape, Vec2< float > kw, uint seed, float rmin=0.05f, float rmax=0.8f, float clamping_dist=0.1f, float clamping_k=0.1f, int n_vertices_min=3, int n_vertices_max=16, float density=0.5f, hmap::Vec2< float > jitter={0.5f, 0.5f}, float shift=0.1f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_noise_distance=nullptr, const Array *p_density_multiplier=nullptr, const Array *p_size_multiplier=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Generates a scalar field representing the signed distance to randomly generated polygons. | |
Array | polygon_field_fbm (Vec2< int > shape, Vec2< float > kw, uint seed, float rmin=0.05f, float rmax=0.8f, float clamping_dist=0.1f, float clamping_k=0.1f, int n_vertices_min=3, int n_vertices_max=16, float density=0.1f, hmap::Vec2< float > jitter={0.5f, 0.5f}, float shift=0.1f, int octaves=8, float persistence=0.5f, float lacunarity=2.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_noise_distance=nullptr, const Array *p_density_multiplier=nullptr, const Array *p_size_multiplier=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Generates a scalar field representing the signed distance to randomly generated polygons combined with fractal Brownian motion (fBm) noise modulation. | |
Array | vorolines (Vec2< int > shape, float density, uint seed, float k_smoothing=0.f, float exp_sigma=0.f, float alpha=0.f, float alpha_span=M_PI, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, Vec4< float > bbox_points={0.f, 1.f, 0.f, 1.f}) |
Generates a Voronoi-based pattern where cells are defined by proximity to random lines. | |
Array | vorolines_fbm (Vec2< int > shape, float density, uint seed, float k_smoothing=0.f, float exp_sigma=0.f, float alpha=0.f, float alpha_span=M_PI, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, Vec4< float > bbox_points={0.f, 1.f, 0.f, 1.f}) |
Generates a Voronoi-based pattern using distances to lines defined by random points and angles, with additional fractal Brownian motion (fBm) noise modulation. | |
Array | voronoi (Vec2< int > shape, Vec2< float > kw, uint seed, Vec2< float > jitter={0.5f, 0.5f}, float k_smoothing=0.f, float exp_sigma=0.f, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Generates a Voronoi diagram in a 2D array with configurable properties. | |
Array | voronoi_fbm (Vec2< int > shape, Vec2< float > kw, uint seed, Vec2< float > jitter={0.5f, 0.5f}, float k_smoothing=0.f, float exp_sigma=0.f, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Generates a Voronoi diagram in a 2D array with configurable properties. | |
Array | voronoi_edge_distance (Vec2< int > shape, Vec2< float > kw, uint seed, Vec2< float > jitter={0.5f, 0.5f}, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Computes the Voronoi edge distance. | |
Array | voronoise (Vec2< int > shape, Vec2< float > kw, float u_param, float v_param, uint seed, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Generates a 2D Voronoi noise array. | |
Array | voronoise_fbm (Vec2< int > shape, Vec2< float > kw, float u_param, float v_param, uint seed, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Return an array filled with coherence Voronoise. | |
Array | vororand (Vec2< int > shape, float density, float variability, uint seed, float k_smoothing=0.f, float exp_sigma=0.f, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, Vec4< float > bbox_points={0.f, 1.f, 0.f, 1.f}) |
Generates a 2D Voronoi-based scalar field using OpenCL. | |
Array | vororand (Vec2< int > shape, const std::vector< float > &xp, const std::vector< float > &yp, float k_smoothing=0.f, float exp_sigma=0.f, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}) |
Array | maximum_smooth (const Array &array1, const Array &array2, float k=0.2f) |
See hmap::maximum_smooth. | |
Array | minimum_smooth (const Array &array1, const Array &array2, float k=0.2f) |
See hmap::minimum_smooth. | |
Array | sdf_2d_polyline (const Path &path, Vec2< int > shape, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr) |
See hmap::sdf_2d_polyline. | |
Array | sdf_2d_polyline_bezier (const Path &path, Vec2< int > shape, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr) |
See hmap::sdf_2d_polyline_bezier. | |
Array | select_valley (const Array &z, int ir, bool zero_at_borders=true, bool ridge_select=false) |
See hmap::select_valley. | |
void | rotate (Array &array, float angle, bool zoom_in=true) |
See hmap::rotate. | |
void | warp (Array &array, const Array *p_dx, const Array *p_dy) |
See hmap::warp. | |
Vec4< float > | helper_transform_bbox (const Vec4< float > &bbox_source, const Vec4< float > &bbox_target) |
void | helper_bind_optional_buffers (clwrapper::Run &run, const Array *p_noise_x, const Array *p_noise_y) |
Array hmap::gpu::blend_poisson_bf | ( | const Array & | array1, |
const Array & | array2, | ||
const int | iterations = 500 , |
||
const Array * | p_mask = nullptr |
||
) |
Blends two arrays using Poisson blending with a brute-force solver.
This function performs Poisson blending between array1
and array2
over a specified number of iterations. Optionally, a mask can be provided to control the blending regions.
array1 | The first input array. |
array2 | The second input array. |
iterations | The number of iterations for the blending process (default: 500). |
p_mask | Optional pointer to an array defining the blending mask. If null, blending is applied globally. |
Example
Result
See hmap::curvature_ring.
See hmap::shape_index.
See hmap::unsphericity.
void hmap::gpu::hydraulic_particle | ( | Array & | z, |
int | nparticles, | ||
int | seed, | ||
Array * | p_bedrock = nullptr , |
||
Array * | p_moisture_map = nullptr , |
||
Array * | p_erosion_map = nullptr , |
||
Array * | p_deposition_map = nullptr , |
||
float | c_capacity = 10.f , |
||
float | c_erosion = 0.05f , |
||
float | c_deposition = 0.05f , |
||
float | c_inertia = 0.3f , |
||
float | drag_rate = 0.001f , |
||
float | evap_rate = 0.001f , |
||
bool | post_filtering = false |
||
) |
void hmap::gpu::hydraulic_particle | ( | Array & | z, |
Array * | p_mask, | ||
int | nparticles, | ||
int | seed, | ||
Array * | p_bedrock = nullptr , |
||
Array * | p_moisture_map = nullptr , |
||
Array * | p_erosion_map = nullptr , |
||
Array * | p_deposition_map = nullptr , |
||
float | c_capacity = 10.f , |
||
float | c_erosion = 0.05f , |
||
float | c_deposition = 0.05f , |
||
float | c_inertia = 0.3f , |
||
float | drag_rate = 0.001f , |
||
float | evap_rate = 0.001f , |
||
bool | post_filtering = false |
||
) |
void hmap::gpu::hydraulic_schott | ( | Array & | z, |
int | iterations, | ||
const Array & | talus, | ||
float | c_erosion = 1.f , |
||
float | c_thermal = 0.1f , |
||
float | c_deposition = 0.2f , |
||
float | flow_acc_exponent = 0.8f , |
||
float | flow_acc_exponent_depo = 0.8f , |
||
float | flow_routing_exponent = 1.3f , |
||
float | thermal_weight = 1.5f , |
||
float | deposition_weight = 2.5f , |
||
Array * | p_flow = nullptr |
||
) |
Simulates hydraulic erosion and deposition on a heightmap using the Schott method.
This function performs hydraulic erosion on the given heightmap z
over a specified number of iterations. It includes parameters for controlling erosion, deposition, and flow routing. Optional flow accumulation can also be computed and stored in the p_flow
array.
[in,out] | z | The heightmap array to be modified. Heights are updated in-place. |
[in] | iterations | The number of iterations for the hydraulic erosion process. |
[in] | talus | An array defining the slope threshold for erosion. |
[in] | c_erosion | Erosion coefficient (default: 1.0f). |
[in] | c_thermal | Thermal erosion coefficient (default: 0.1f). |
[in] | c_deposition | Deposition coefficient (default: 0.2f). |
[in] | flow_acc_exponent | Exponent controlling the influence of flow accumulation on erosion (default: 0.8f). |
[in] | flow_acc_exponent_depo | Exponent controlling the influence of flow accumulation on deposition (default: 0.8f). |
[in] | flow_routing_exponent | Exponent controlling flow routing behavior (default: 1.3f). |
[in] | thermal_weight | Weight of thermal erosion effects (default: 1.5f). |
[in] | deposition_weight | Weight of deposition effects (default: 2.5f). |
[out] | p_flow | Optional pointer to an array for storing flow accumulation data. If null, flow data is not returned (default: nullptr). |
Example
Result
void hmap::gpu::hydraulic_schott | ( | Array & | z, |
int | iterations, | ||
const Array & | talus, | ||
Array * | p_mask, | ||
float | c_erosion = 1.f , |
||
float | c_thermal = 0.1f , |
||
float | c_deposition = 0.2f , |
||
float | flow_acc_exponent = 0.8f , |
||
float | flow_acc_exponent_depo = 0.8f , |
||
float | flow_routing_exponent = 1.3f , |
||
float | thermal_weight = 1.5f , |
||
float | deposition_weight = 2.5f , |
||
Array * | p_flow = nullptr |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::hydraulic_stream_log | ( | Array & | z, |
float | c_erosion, | ||
float | talus_ref, | ||
int | deposition_ir = 32 , |
||
float | deposition_scale_ratio = 1.f , |
||
float | gradient_power = 0.8f , |
||
float | gradient_scaling_ratio = 1.f , |
||
int | gradient_prefilter_ir = 16 , |
||
float | saturation_ratio = 1.f , |
||
Array * | p_bedrock = nullptr , |
||
Array * | p_moisture_map = nullptr , |
||
Array * | p_erosion_map = nullptr , |
||
Array * | p_deposition_map = nullptr , |
||
Array * | p_flow_map = nullptr |
||
) |
void hmap::gpu::hydraulic_stream_log | ( | Array & | z, |
float | c_erosion, | ||
float | talus_ref, | ||
Array * | p_mask, | ||
int | deposition_ir = 32 , |
||
float | deposition_scale_ratio = 1.f , |
||
float | gradient_power = 0.8f , |
||
float | gradient_scaling_ratio = 1.f , |
||
int | gradient_prefilter_ir = 16 , |
||
float | saturation_ratio = 1.f , |
||
Array * | p_bedrock = nullptr , |
||
Array * | p_moisture_map = nullptr , |
||
Array * | p_erosion_map = nullptr , |
||
Array * | p_deposition_map = nullptr , |
||
Array * | p_flow_map = nullptr |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::thermal | ( | Array & | z, |
const Array & | talus, | ||
int | iterations = 10 , |
||
Array * | p_bedrock = nullptr , |
||
Array * | p_deposition_map = nullptr |
||
) |
See hmap::thermal.
void hmap::gpu::thermal | ( | Array & | z, |
Array * | p_mask, | ||
const Array & | talus, | ||
int | iterations = 10 , |
||
Array * | p_bedrock = nullptr , |
||
Array * | p_deposition_map = nullptr |
||
) |
See hmap::thermal.
void hmap::gpu::thermal | ( | Array & | z, |
float | talus, | ||
int | iterations = 10 , |
||
Array * | p_bedrock = nullptr , |
||
Array * | p_deposition_map = nullptr |
||
) |
See hmap::thermal.
Apply thermal weathering erosion to give a scree like effect.
z | Input array. |
talus | Talus limit. |
p_deposition_map | [out] Reference to the deposition map, provided as an output field. |
iterations | Number of iterations. |
Example
Result
void hmap::gpu::thermal_inflate | ( | Array & | z, |
const Array * | p_mask, | ||
const Array & | talus, | ||
int | iterations = 10 |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
See hmap::thermal_rib.
void hmap::gpu::thermal_ridge | ( | Array & | z, |
const Array & | talus, | ||
int | iterations = 10 , |
||
Array * | p_deposition_map = nullptr |
||
) |
Apply thermal weathering erosion to give a ridge like effect.
z | Input array. |
talus | Talus limit. |
p_deposition_map | [out] Reference to the deposition map, provided as an output field. |
iterations | Number of iterations. |
Example
Result
void hmap::gpu::thermal_ridge | ( | Array & | z, |
const Array * | p_mask, | ||
const Array & | talus, | ||
int | iterations = 10 , |
||
Array * | p_deposition_map = nullptr |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::thermal_scree | ( | Array & | z, |
const Array & | talus, | ||
const Array & | zmax, | ||
int | iterations = 10 , |
||
bool | talus_constraint = true , |
||
Array * | p_deposition_map = nullptr |
||
) |
Performs thermal scree erosion on a heightmap.
This function applies a thermal erosion process that redistributes material from steeper slopes to flatter areas, simulating talus formation. The process iterates a given number of times to achieve a more stable terrain profile.
[out] | z | The heightmap to be modified in-place by the erosion process. |
[in] | talus | The threshold slope angles that determine where material is moved. |
[in] | zmax | The maximum allowed elevation for erosion effects. |
[in] | iterations | The number of erosion iterations to apply (default: 10). |
[in] | talus_constraint | Whether to enforce a constraint on the talus slope (default: true). |
[out] | p_deposition_map | Optional pointer to an array that stores the deposited material per cell. |
void hmap::gpu::thermal_scree | ( | Array & | z, |
const Array * | p_mask, | ||
const Array & | talus, | ||
const Array & | zmax, | ||
int | iterations = 10 , |
||
bool | talus_constraint = true , |
||
Array * | p_deposition_map = nullptr |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
See hmap::mean_local.
See hmap::ruggedness.
See hmap::rugosity.
See hmap::std_local.
See hmap::z_score.
void hmap::gpu::expand | ( | Array & | array, |
int | ir, | ||
int | iterations = 1 |
||
) |
See hmap::expand.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::expand | ( | Array & | array, |
const Array & | kernel, | ||
const Array * | p_mask, | ||
int | iterations = 1 |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::gamma_correction_local | ( | Array & | array, |
float | gamma, | ||
int | ir, | ||
const Array * | p_mask, | ||
float | k = 0.1f |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
See hmap::laplace.
void hmap::gpu::laplace | ( | Array & | array, |
const Array * | p_mask, | ||
float | sigma = 0.2f , |
||
int | iterations = 3 |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
See hmap::maximum_local.
Array hmap::gpu::mean_shift | ( | const Array & | array, |
int | ir, | ||
float | talus, | ||
int | iterations = 1 , |
||
bool | talus_weighted = true |
||
) |
See hmap::mean_shift.
Array hmap::gpu::mean_shift | ( | const Array & | array, |
int | ir, | ||
float | talus, | ||
const Array * | p_mask, | ||
int | iterations = 1 , |
||
bool | talus_weighted = true |
||
) |
void hmap::gpu::median_3x3 | ( | Array & | array | ) |
See hmap::median_3x3.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
See hmap::median_pseudo.
See hmap::minimum_local.
void hmap::gpu::normal_displacement | ( | Array & | array, |
const Array * | p_mask, | ||
float | amount = 0.1f , |
||
int | ir = 0 , |
||
bool | reverse = false |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
See hmap::plateau.
void hmap::gpu::plateau | ( | Array & | array, |
int | ir, | ||
float | factor | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::shrink | ( | Array & | array, |
int | ir, | ||
int | iterations = 1 |
||
) |
See hmap::shrink.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::shrink | ( | Array & | array, |
const Array & | kernel, | ||
const Array * | p_mask, | ||
int | iterations = 1 |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::smooth_cpulse | ( | Array & | array, |
int | ir | ||
) |
See hmap::smooth_cpulse.
See hmap::smooth_cpulse.
void hmap::gpu::smooth_fill | ( | Array & | array, |
int | ir, | ||
float | k = 0.1f , |
||
Array * | p_deposition_map = nullptr |
||
) |
See hmap::smooth_fill.
void hmap::gpu::smooth_fill | ( | Array & | array, |
int | ir, | ||
const Array * | p_mask, | ||
float | k = 0.1f , |
||
Array * | p_deposition_map = nullptr |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::smooth_fill_holes | ( | Array & | array, |
int | ir | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::gpu::smooth_fill_smear_peaks | ( | Array & | array, |
int | ir | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
See hmap::gradient_norm.
Array hmap::gpu::generate_riverbed | ( | const Path & | path, |
Vec2< int > | shape, | ||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} , |
||
bool | bezier_smoothing = false , |
||
float | depth_start = 0.01f , |
||
float | depth_end = 1.f , |
||
float | slope_start = 64.f , |
||
float | slope_end = 32.f , |
||
float | shape_exponent_start = 1.f , |
||
float | shape_exponent_end = 10.f , |
||
float | k_smoothing = 0.5f , |
||
int | post_filter_ir = 0 , |
||
Array * | p_noise_x = nullptr , |
||
Array * | p_noise_y = nullptr , |
||
Array * | p_noise_r = nullptr |
||
) |
void hmap::gpu::interpolate_array_bicubic | ( | const Array & | source, |
Array & | target, | ||
const Vec4< float > & | bbox_source, | ||
const Vec4< float > & | bbox_target | ||
) |
void hmap::gpu::interpolate_array_bilinear | ( | const Array & | source, |
Array & | target, | ||
const Vec4< float > & | bbox_source, | ||
const Vec4< float > & | bbox_target | ||
) |
void hmap::gpu::interpolate_array_nearest | ( | const Array & | source, |
Array & | target, | ||
const Vec4< float > & | bbox_source, | ||
const Vec4< float > & | bbox_target | ||
) |
See hmap::border.
See hmap::closing.
See hmap::dilation.
See hmap::erosion.
See hmap::opening.
See hmap::skeleton.
void hmap::gpu::helper_bind_optional_buffer | ( | clwrapper::Run & | run, |
const std::string & | id, | ||
const Array * | p_array | ||
) |
bool hmap::gpu::init_opencl | ( | ) |
Array hmap::gpu::basalt_field | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
float | warp_kw = 4.f , |
||
float | large_scale_warp_amp = 0.2f , |
||
float | large_scale_gain = 6.f , |
||
float | large_scale_amp = 0.2f , |
||
float | medium_scale_kw_ratio = 3.f , |
||
float | medium_scale_warp_amp = 1.f , |
||
float | medium_scale_gain = 7.f , |
||
float | medium_scale_amp = 0.08f , |
||
float | small_scale_kw_ratio = 10.f , |
||
float | small_scale_amp = 0.1f , |
||
float | small_scale_overlay_amp = 0.002f , |
||
float | rugosity_kw_ratio = 1.f , |
||
float | rugosity_amp = 1.f , |
||
bool | flatten_activate = true , |
||
float | flatten_kw_ratio = 1.f , |
||
float | flatten_amp = 0.f , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a synthetic procedural terrain resembling basaltic landforms.
This function creates a multi-scale procedural field combining large, medium, and small-scale Voronoi-based patterns, noise warping, and optional flattening, simulating the morphology of fractured basalt or volcanic terrains. The terrain is constructed using a combination of Voronoi diagrams (via voronoi_fbm
) and fractal noise (noise_fbm
), layered with frequency-domain manipulations and amplitude/gain controls at each scale.
The final output is a heightmap represented as an Array
, normalized and composed of:
shape | Output resolution (width x height) of the field. |
kw | Base wave numbers (frequency) for the terrain features. |
seed | Initial seed used for deterministic random generation. |
warp_kw | Frequency of the warping noise that displaces Voronoi positions. |
large_scale_warp_amp | Amplitude of displacement for large-scale Voronoi warping. |
large_scale_gain | Gain adjustment applied to the large-scale features. |
large_scale_amp | Final amplitude of the large-scale height contribution. |
medium_scale_kw_ratio | Scaling factor for the frequency of the medium-scale patterns. |
medium_scale_warp_amp | Amplitude of warping for the medium-scale displacement. |
medium_scale_gain | Gain control for medium-scale modulation. |
medium_scale_amp | Amplitude of the medium-scale heightmap. |
small_scale_kw_ratio | Frequency ratio for small-scale details. |
small_scale_amp | Amplitude of small-scale pattern contribution. |
small_scale_overlay_amp | Additional overlay strength for repeating the small-scale pattern. |
rugosity_kw_ratio | Frequency ratio for high-frequency noise applied as fine roughness. |
rugosity_amp | Strength of the rugosity (high-frequency modulation). |
flatten_activate | Enables or disables the final flattening operation. |
flatten_kw_ratio | Frequency scaling of the flattening noise field. |
flatten_amp | Amplitude control of the flattening operation. |
p_noise_x | Optional pointer to a noise field used to displace grid coordinates in X. |
p_noise_y | Optional pointer to a noise field used to displace grid coordinates in Y. |
bbox | The 2D bounding box ({xmin, xmax, ymin, ymax}) over which the terrain is generated. |
Array
representing the synthetic basalt-like terrain field.gpu::
namespace.seed
, warp_kw
, and the gain/amplitude values can produce a wide variety of terrain features.Example
Result
Array hmap::gpu::gabor_wave | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
const Array & | angle, | ||
float | angle_spread_ratio = 1.f , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Return an array filled with coherence Gabor noise.
shape | Array shape. |
kw | Noise wavenumbers {kx, ky} for each directions. |
seed | Random seed number. |
angle | Base orientation angle for the Gabor wavelets (in radians). Defaults to 0. |
angle_spread_ratio | Ratio that controls the spread of wave orientations around the base angle. Defaults to 1. |
bbox | Domain bounding box. |
Example
Result
Array hmap::gpu::gabor_wave | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
float | angle = 0.f , |
||
float | angle_spread_ratio = 1.f , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Array hmap::gpu::gabor_wave_fbm | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
const Array & | angle, | ||
float | angle_spread_ratio = 1.f , |
||
int | octaves = 8 , |
||
float | weight = 0.7f , |
||
float | persistence = 0.5f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Return an array filled with coherence Gabor noise.
shape | Array shape. |
kw | Noise wavenumbers {kx, ky} for each directions. |
seed | Random seed number. |
angle | Base orientation angle for the Gabor wavelets (in radians). Defaults to 0. |
angle_spread_ratio | Ratio that controls the spread of wave orientations around the base angle. Defaults to 1. |
octaves | Number of octaves. |
weigth | Octave weighting. |
persistence | Octave persistence. |
lacunarity | Defines the wavenumber ratio between each octaves. |
p_ctrl_param | Reference to the control parameter array (acts as a multiplier for the weight parameter). |
p_noise_x,p_noise_y | Reference to the input noise arrays. |
bbox | Domain bounding box. |
Example
Result
Array hmap::gpu::gabor_wave_fbm | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
float | angle = 0.f , |
||
float | angle_spread_ratio = 1.f , |
||
int | octaves = 8 , |
||
float | weight = 0.7f , |
||
float | persistence = 0.5f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Array hmap::gpu::gavoronoise | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
const Array & | angle, | ||
float | amplitude = 0.05f , |
||
float | angle_spread_ratio = 1.f , |
||
Vec2< float > | kw_multiplier = {4.f, 4.f} , |
||
float | slope_strength = 1.f , |
||
float | branch_strength = 2.f , |
||
float | z_cut_min = 0.2f , |
||
float | z_cut_max = 1.f , |
||
int | octaves = 8 , |
||
float | persistence = 0.4f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a 2D array using the GavoroNoise algorithm, which is a procedural noise technique for terrain generation and other applications.
shape | Dimensions of the output array. |
kw | Wave number vector controlling the noise frequency. |
seed | Seed value for random number generation. |
amplitude | Amplitude of the noise. |
kw_multiplier | Multiplier for wave numbers in the noise function. |
slope_strength | Strength of slope-based directional erosion in the noise. |
branch_strength | Strength of branch-like structures in the generated noise. |
z_cut_min | Minimum cutoff for Z-value in the noise. |
z_cut_max | Maximum cutoff for Z-value in the noise. |
octaves | Number of octaves for fractal Brownian motion (fBm). |
persistence | Amplitude scaling factor between noise octaves. |
lacunarity | Frequency scaling factor between noise octaves. |
p_ctrl_param | Optional array for control parameters, can modify the Z cutoff dynamically. |
p_noise_x | Optional array for X-axis noise perturbation. |
p_noise_y | Optional array for Y-axis noise perturbation. |
bbox | Bounding box for mapping grid coordinates to world space. |
This function leverages an OpenCL kernel to compute the GavoroNoise values on the GPU, allowing for efficient large-scale generation. The kernel applies a combination of fractal Brownian motion (fBm), directional erosion, and other procedural techniques to generate intricate noise patterns.
The optional p_ctrl_param
, p_noise_x
, and p_noise_y
buffers provide additional flexibility for dynamically adjusting noise parameters and perturbations.
Example
Result
Array hmap::gpu::gavoronoise | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
float | angle = 0.f , |
||
float | amplitude = 0.05f , |
||
float | angle_spread_ratio = 1.f , |
||
Vec2< float > | kw_multiplier = {4.f, 4.f} , |
||
float | slope_strength = 1.f , |
||
float | branch_strength = 2.f , |
||
float | z_cut_min = 0.2f , |
||
float | z_cut_max = 1.f , |
||
int | octaves = 8 , |
||
float | persistence = 0.4f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Array hmap::gpu::gavoronoise | ( | const Array & | base, |
Vec2< float > | kw, | ||
uint | seed, | ||
float | amplitude = 0.05f , |
||
Vec2< float > | kw_multiplier = {4.f, 4.f} , |
||
float | slope_strength = 1.f , |
||
float | branch_strength = 2.f , |
||
float | z_cut_min = 0.2f , |
||
float | z_cut_max = 1.f , |
||
int | octaves = 8 , |
||
float | persistence = 0.4f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Array hmap::gpu::mountain_range_radial | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
float | half_width = 0.2f , |
||
float | angle_spread_ratio = 0.5f , |
||
float | core_size_ratio = 1.f , |
||
Vec2< float > | center = {0.5f, 0.5f} , |
||
int | octaves = 8 , |
||
float | weight = 0.7f , |
||
float | persistence = 0.5f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
const Array * | p_angle = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a heightmap representing a radial mountain range.
This function creates a heightmap that simulates a mountain range emanating radially from a specified center. The mountain range is influenced by various noise parameters and control attributes.
shape | The dimensions of the output heightmap as a 2D vector. |
kw | The wave numbers (frequency components) as a 2D vector. |
seed | The seed for random noise generation. |
half_width | The half-width of the radial mountain range, controlling its spread. Default is 0.2f. |
angle_spread_ratio | The ratio controlling the angular spread of the mountain range. Default is 0.5f. |
center | The center point of the radial mountain range as normalized coordinates within [0, 1]. Default is {0.5f, 0.5f}. |
octaves | The number of octaves for fractal noise generation. Default is 8. |
weight | The initial weight for noise contribution. Default is 0.7f. |
persistence | The amplitude scaling factor for subsequent noise octaves. Default is 0.5f. |
lacunarity | The frequency scaling factor for subsequent noise octaves. Default is 2.0f. |
p_ctrl_param | Optional pointer to an array of control parameters influencing the terrain generation. |
p_noise_x | Optional pointer to a precomputed noise array for the X-axis. |
p_noise_y | Optional pointer to a precomputed noise array for the Y-axis. |
p_angle | Optional pointer to an array to output the angle. |
bbox | The bounding box of the output heightmap in normalized coordinates [xmin, xmax, ymin, ymax]. Default is {0.0f, 1.0f, 0.0f, 1.0f}. |
Example
Result
Array hmap::gpu::noise | ( | NoiseType | noise_type, |
Vec2< int > | shape, | ||
Vec2< float > | kw, | ||
uint | seed, | ||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
const Array * | p_stretching = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
See hmap::noise.
Array hmap::gpu::noise_fbm | ( | NoiseType | noise_type, |
Vec2< int > | shape, | ||
Vec2< float > | kw, | ||
uint | seed, | ||
int | octaves = 8 , |
||
float | weight = 0.7f , |
||
float | persistence = 0.5f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
const Array * | p_stretching = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
See hmap::noise_fbm.
Array hmap::gpu::polygon_field | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
float | rmin = 0.05f , |
||
float | rmax = 0.8f , |
||
float | clamping_dist = 0.1f , |
||
float | clamping_k = 0.1f , |
||
int | n_vertices_min = 3 , |
||
int | n_vertices_max = 16 , |
||
float | density = 0.5f , |
||
hmap::Vec2< float > | jitter = {0.5f, 0.5f} , |
||
float | shift = 0.1f , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
const Array * | p_noise_distance = nullptr , |
||
const Array * | p_density_multiplier = nullptr , |
||
const Array * | p_size_multiplier = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a scalar field representing the signed distance to randomly generated polygons.
This function procedurally generates a field where each pixel stores the signed distance to the nearest polygon, using a smooth signed distance function (SDF) with optional clamping. The polygons are generated randomly within the specified bounding box, with configurable vertex counts, sizes, jitter, and density. Optionally, displacement noise fields can be applied to polygon positions.
shape | Resolution of the output field (width, height). |
kw | Scaling factor for field coordinates (world units per pixel). |
seed | Random seed for polygon generation. |
rmin | Minimum polygon radius (relative to bbox size). |
rmax | Maximum polygon radius (relative to bbox size). |
clamping_dist | Distance threshold for clamping the SDF value (used to soften edges). |
clamping_k | Smoothness parameter for clamping. |
n_vertices_min | Minimum number of vertices per polygon. |
n_vertices_max | Maximum number of vertices per polygon. |
density | Fraction of pixels covered by polygons (approximate). |
jitter | Random displacement factor applied to polygon vertices. |
shift | Random position shift applied to polygon center. |
p_noise_x | Optional displacement noise field in the X direction (nullptr to disable). |
p_noise_y | Optional displacement noise field in the Y direction (nullptr to disable). |
bbox | Bounding box in normalized coordinates {xmin, xmax, ymin, ymax}. |
Example
Result
Array hmap::gpu::polygon_field_fbm | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
float | rmin = 0.05f , |
||
float | rmax = 0.8f , |
||
float | clamping_dist = 0.1f , |
||
float | clamping_k = 0.1f , |
||
int | n_vertices_min = 3 , |
||
int | n_vertices_max = 16 , |
||
float | density = 0.1f , |
||
hmap::Vec2< float > | jitter = {0.5f, 0.5f} , |
||
float | shift = 0.1f , |
||
int | octaves = 8 , |
||
float | persistence = 0.5f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
const Array * | p_noise_distance = nullptr , |
||
const Array * | p_density_multiplier = nullptr , |
||
const Array * | p_size_multiplier = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a scalar field representing the signed distance to randomly generated polygons combined with fractal Brownian motion (fBm) noise modulation.
Similar to polygon_field(), but the generated SDF is modulated by an fBm noise function to create more natural, irregular shapes. The fBm parameters allow control over the noise persistence, lacunarity, and number of octaves.
shape | Resolution of the output field (width, height). |
kw | Scaling factor for field coordinates (world units per pixel). |
seed | Random seed for polygon generation and fBm noise. |
rmin | Minimum polygon radius (relative to bbox size). |
rmax | Maximum polygon radius (relative to bbox size). |
clamping_dist | Distance threshold for clamping the SDF value (used to soften edges). |
clamping_k | Smoothness parameter for clamping. |
n_vertices_min | Minimum number of vertices per polygon. |
n_vertices_max | Maximum number of vertices per polygon. |
density | Fraction of pixels covered by polygons (approximate). |
jitter | Random displacement factor applied to polygon vertices. |
shift | Random position shift applied to polygon center. |
octaves | Number of fBm octaves. |
persistence | Amplitude decay per octave in fBm. |
lacunarity | Frequency multiplier per octave in fBm. |
p_noise_x | Optional displacement noise field in the X direction (nullptr to disable). |
p_noise_y | Optional displacement noise field in the Y direction (nullptr to disable). |
bbox | Bounding box in normalized coordinates {xmin, xmax, ymin, ymax}. |
Example
Result
Array hmap::gpu::vorolines | ( | Vec2< int > | shape, |
float | density, | ||
uint | seed, | ||
float | k_smoothing = 0.f , |
||
float | exp_sigma = 0.f , |
||
float | alpha = 0.f , |
||
float | alpha_span = M_PI , |
||
VoronoiReturnType | return_type = VoronoiReturnType::F1_SQUARED , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} , |
||
Vec4< float > | bbox_points = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a Voronoi-based pattern where cells are defined by proximity to random lines.
This function generates an OpenCL-accelerated Voronoi-like pattern based on the distance from each pixel to a set of randomly oriented lines. Each line is defined by a random point and a direction sampled from a uniform distribution around a given angle.
shape | The resolution of the resulting 2D array (width, height). |
density | Number of base points per unit area used to define lines. |
seed | Seed for the random number generator used to generate base points and directions. |
k_smoothing | Kernel smoothing factor; controls how sharp or soft the distance fields are. |
exp_sigma | Exponential smoothing parameter applied to the computed distance field. |
alpha | Base angle (in radians) used to orient the generated lines. |
alpha_span | Maximum angular deviation from alpha ; controls line orientation variability. |
return_type | Type of Voronoi output to return (e.g., F1, F2, edge distance, smoothed field, etc.). |
p_noise_x | Optional pointer to an input noise field applied to the X coordinates (can be nullptr). |
p_noise_y | Optional pointer to an input noise field applied to the Y coordinates (can be nullptr). |
bbox | Bounding box in normalized coordinates (min_x, max_x, min_y, max_y) of the final array. |
bbox_points | Bounding box within which random base points are sampled. |
theta = alpha + rand * alpha_span
. Example
Result
Array hmap::gpu::vorolines_fbm | ( | Vec2< int > | shape, |
float | density, | ||
uint | seed, | ||
float | k_smoothing = 0.f , |
||
float | exp_sigma = 0.f , |
||
float | alpha = 0.f , |
||
float | alpha_span = M_PI , |
||
VoronoiReturnType | return_type = VoronoiReturnType::F1_SQUARED , |
||
int | octaves = 8 , |
||
float | weight = 0.7f , |
||
float | persistence = 0.5f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} , |
||
Vec4< float > | bbox_points = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a Voronoi-based pattern using distances to lines defined by random points and angles, with additional fractal Brownian motion (fBm) noise modulation.
This function extends the standard vorolines
generation by introducing fBm-based warping of the coordinate space, resulting in more organic and fractal-like structures. It creates a Voronoi distance field based on proximity to oriented line segments and distorts the result using multi-octave procedural noise.
shape | Output resolution of the 2D array (width, height). |
density | Number of base points per unit area used to define lines. |
seed | Seed value for the random number generator. |
k_smoothing | Kernel smoothing coefficient to soften distance values (e.g., for blending). |
exp_sigma | Sigma value for optional exponential smoothing on the final field. |
alpha | Base orientation angle (in radians) of lines generated from random points. |
alpha_span | Maximum angle deviation from alpha , determining directional randomness of lines. |
return_type | Type of output to return (e.g., F1, F2, distance to edge, smoothed version). |
octaves | Number of noise octaves used in the fBm modulation. |
weight | Weight of each octave's contribution to the total noise. |
persistence | Amplitude decay factor for each successive octave (commonly 0.5–0.8). |
lacunarity | Frequency multiplier for each successive octave (commonly 2.0). |
p_noise_x | Optional pointer to an external noise field applied to X coordinates (can be nullptr). |
p_noise_y | Optional pointer to an external noise field applied to Y coordinates (can be nullptr). |
bbox | Bounding box for the final image domain (min_x, max_x, min_y, max_y). |
bbox_points | Bounding box from which the initial set of points are sampled. |
Array
representing the Voronoi-fBm field, distorted by noise and influenced by distance to random lines.p_noise_x
, p_noise_y
) are provided. Example
Result
Array hmap::gpu::voronoi | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
Vec2< float > | jitter = {0.5f, 0.5f} , |
||
float | k_smoothing = 0.f , |
||
float | exp_sigma = 0.f , |
||
VoronoiReturnType | return_type = VoronoiReturnType::F1_SQUARED , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a Voronoi diagram in a 2D array with configurable properties.
shape | The dimensions of the output array as a 2D vector of integers. |
kw | The frequency scale factors for the Voronoi cells, given as a 2D vector of floats. |
seed | A seed value for random number generation, ensuring reproducibility. |
jitter | (Optional) The amount of random variation in the positions of Voronoi cell sites, given as a 2D vector of floats. Defaults to {0.5f, 0.5f}. |
return_type | (Optional) The type of value to compute for the Voronoi diagram. Defaults to VoronoiReturnType::F1_SQUARED . |
p_ctrl_param | (Optional) A pointer to an Array used to control the Voronoi computation. Used here as a multiplier for the jitter. If nullptr, no control is applied. |
p_noise_x | (Optional) A pointer to an Array providing additional noise in the x-direction for cell positions. If nullptr, no x-noise is applied. |
p_noise_y | (Optional) A pointer to an Array providing additional noise in the y-direction for cell positions. If nullptr, no y-noise is applied. |
bbox | (Optional) The bounding box for the Voronoi computation, given as a 4D vector of floats representing {min_x, max_x, min_y, max_y}. Defaults to {0.f, 1.f, 0.f, 1.f}. |
Example
Result
Array hmap::gpu::voronoi_fbm | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
Vec2< float > | jitter = {0.5f, 0.5f} , |
||
float | k_smoothing = 0.f , |
||
float | exp_sigma = 0.f , |
||
VoronoiReturnType | return_type = VoronoiReturnType::F1_SQUARED , |
||
int | octaves = 8 , |
||
float | weight = 0.7f , |
||
float | persistence = 0.5f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a Voronoi diagram in a 2D array with configurable properties.
shape | The dimensions of the output array as a 2D vector of integers. |
kw | The frequency scale factors for the base Voronoi cells, given as a 2D vector of floats. |
seed | A seed value for random number generation, ensuring reproducibility. |
jitter | (Optional) The amount of random variation in the positions of Voronoi cell sites, given as a 2D vector of floats. Defaults to {0.5f, 0.5f}. |
return_type | (Optional) The type of value to compute for the Voronoi diagram. Defaults to VoronoiReturnType::F1_SQUARED . |
octaves | (Optional) The number of layers (octaves) in the fractal Brownian motion. Defaults to 8. |
weight | (Optional) The initial weight of the base layer in the FBM computation. Defaults to 0.7f. |
persistence | (Optional) The persistence factor that controls the amplitude reduction between octaves. Defaults to 0.5f. |
lacunarity | (Optional) The lacunarity factor that controls the frequency increase between octaves. Defaults to 2.f. |
p_ctrl_param | (Optional) A pointer to an Array used to control the Voronoi computation. If nullptr, no control is applied. |
p_noise_x | (Optional) A pointer to an Array providing additional noise in the x-direction for cell positions. If nullptr, no x-noise is applied. |
p_noise_y | (Optional) A pointer to an Array providing additional noise in the y-direction for cell positions. If nullptr, no y-noise is applied. |
bbox | (Optional) The bounding box for the Voronoi computation, given as a 4D vector of floats representing {min_x, max_x, min_y, max_y}. Defaults to {0.f, 1.f, 0.f, 1.f}. |
Example
Result
Array hmap::gpu::voronoi_edge_distance | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
uint | seed, | ||
Vec2< float > | jitter = {0.5f, 0.5f} , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Computes the Voronoi edge distance.
shape | The shape of the grid as a 2D vector (width, height). |
kw | The weights for the Voronoi kernel as a 2D vector. |
seed | The random seed used for generating Voronoi points. |
jitter | Optional parameter for controlling jitter in Voronoi point placement (default is {0.5f, 0.5f}). |
p_ctrl_param | Optional pointer to an Array specifying control parameters for Voronoi grid jitter (default is nullptr). |
p_noise_x,p_noise_y | Reference to the input noise arrays. |
bbox | The bounding box for the Voronoi diagram as {x_min, x_max, y_min, y_max} (default is {0.f, 1.f, 0.f, 1.f}). |
Array hmap::gpu::voronoise | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
float | u_param, | ||
float | v_param, | ||
uint | seed, | ||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a 2D Voronoi noise array.
This function computes a Voronoi noise pattern based on the input parameters and returns it as a 2D array. The noise is calculated in the OpenCL kernel noise_voronoise
, which uses a combination of hashing and smoothstep functions to generate a weighted Voronoi noise field.
shape | The dimensions of the 2D output array as a vector (width and height). |
kw | Wave numbers for scaling the noise pattern, represented as a 2D vector. |
u_param | A control parameter for the noise, adjusting the contribution of random offsets. |
v_param | A control parameter for the noise, affecting the smoothness of the pattern. |
p_ctrl_param | Optional pointer to an Array specifying control parameters for Voronoi grid jitter (default is nullptr). |
p_noise_x,p_noise_y | Reference to the input noise arrays. |
seed | A seed value for random number generation, ensuring reproducibility. |
Array
object containing the generated 2D Voronoi noise values.Example
Result
Array hmap::gpu::voronoise_fbm | ( | Vec2< int > | shape, |
Vec2< float > | kw, | ||
float | u_param, | ||
float | v_param, | ||
uint | seed, | ||
int | octaves = 8 , |
||
float | weight = 0.7f , |
||
float | persistence = 0.5f , |
||
float | lacunarity = 2.f , |
||
const Array * | p_ctrl_param = nullptr , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
Return an array filled with coherence Voronoise.
shape | Array shape. |
kw | Noise wavenumbers {kx, ky} for each directions. |
seed | Random seed number. |
octaves | Number of octaves. |
weigth | Octave weighting. |
persistence | Octave persistence. |
lacunarity | Defines the wavenumber ratio between each octaves. |
p_ctrl_param | Reference to the control parameter array (acts as a multiplier for the weight parameter). |
p_noise_x,p_noise_y | Reference to the input noise arrays. |
bbox | Domain bounding box. |
Example
Result
Array hmap::gpu::vororand | ( | Vec2< int > | shape, |
float | density, | ||
float | variability, | ||
uint | seed, | ||
float | k_smoothing = 0.f , |
||
float | exp_sigma = 0.f , |
||
VoronoiReturnType | return_type = VoronoiReturnType::F1_SQUARED , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} , |
||
Vec4< float > | bbox_points = {0.f, 1.f, 0.f, 1.f} |
||
) |
Generates a 2D Voronoi-based scalar field using OpenCL.
This function computes a Voronoi diagram or derived metric (such as F1, F2, or edge distances) on a grid of given shape. A set of random points is generated within an extended bounding box, based on the desired density and variability, to reduce edge artifacts. Optionally, per-pixel displacement can be applied through noise fields.
The result is stored in an Array
object representing a 2D scalar field.
shape | Dimensions of the output array (width x height). |
density | Number of random points per unit area for Voronoi diagram. |
variability | Amount of randomness added to the point generation bounding box. |
seed | Seed for random number generation used in point sampling. |
k_smoothing | Smoothing factor used in soft minimum/maximum Voronoi distance computations. |
exp_sigma | Standard deviation used in exponential falloff for edge distance computation. |
return_type | Type of Voronoi computation to perform (e.g., F1, F2, F2-F1, edge distance). |
p_noise_x | Optional pointer to a noise field applied to X coordinates of grid points. |
p_noise_y | Optional pointer to a noise field applied to Y coordinates of grid points. |
bbox | Bounding box of the domain in which the field is computed: {xmin, xmax, ymin, ymax}. |
bbox_points | Bounding box for point generation, usually larger than bbox to avoid edge effects. |
Array
object containing the computed scalar field."vororand"
must be compiled and available in the OpenCL context.p_noise_x
or p_noise_y
are provided, they must match the shape of the output array.bbox
to reduce border artifacts.Example
Result
Array hmap::gpu::vororand | ( | Vec2< int > | shape, |
const std::vector< float > & | xp, | ||
const std::vector< float > & | yp, | ||
float | k_smoothing = 0.f , |
||
float | exp_sigma = 0.f , |
||
VoronoiReturnType | return_type = VoronoiReturnType::F1_SQUARED , |
||
const Array * | p_noise_x = nullptr , |
||
const Array * | p_noise_y = nullptr , |
||
Vec4< float > | bbox = {0.f, 1.f, 0.f, 1.f} |
||
) |
See hmap::maximum_smooth.
See hmap::minimum_smooth.
Array hmap::gpu::select_valley | ( | const Array & | z, |
int | ir, | ||
bool | zero_at_borders = true , |
||
bool | ridge_select = false |
||
) |
See hmap::select_valley.
void hmap::gpu::rotate | ( | Array & | array, |
float | angle, | ||
bool | zoom_in = true |
||
) |
See hmap::rotate.
See hmap::warp.
Vec4< float > hmap::gpu::helper_transform_bbox | ( | const Vec4< float > & | bbox_source, |
const Vec4< float > & | bbox_target | ||
) |