|
HighMap library (C++)
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | McDonaldParams |
| Parameters for McDonald particle-based hydraulic erosion solver. More... | |
Enumerations | |
| enum | LocalMetrics : int { LM_LOCAL_ASPECT_VARIANCE , LM_LOCAL_MAX , LM_LOCAL_MEDIAN_DEVIATION , LM_LOCAL_MIN , LM_LOCAL_RELIEF , LM_LOCAL_VARIANCE , LM_LOCAL_MEAN , LM_LOCAL_SKEWNESS , LM_LOCAL_Z_SCORE , LM_TOPOGRAPHIC_POSITION_INDEX , LM_TOPOGRAPHIC_WETNESS_INDEX , LM_RELATIVE_ELEVATION , LM_ROUGHNESS , LM_RUGGEDNESS , LM_RUGOSITY_CONCAVE , LM_RUGOSITY_CONVEX , LM_TOPOGRAPHIC_RESIDUAL } |
| Types of local metrics. More... | |
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. | |
| Texture | blend_poisson_bf (const Texture &texture1, const Texture &texture2, const int iterations=500, const Array *p_mask=nullptr) |
| Blends two textures using Poisson blending with a brute-force solver. | |
| Array | transfer (const Array &source, const Array &target, int ir, float amplitude, bool target_prefiltering=false) |
| See hmap::transfer. | |
| Array | level_set_curvature (const Array &array, int prefilter_ir) |
| See hmap::level_set_curvature. | |
| Array | curvature_quadric (const Array &z, int ir, CurvatureType curvature_type, bool approx_algo=false) |
| See hmap::curvature_quadric. | |
| void | hydraulic_musgrave (Array &z, Array &moisture_map, int iterations=100, float c_capacity=1.f, float c_erosion=0.1f, float c_deposition=0.1f, float water_level=0.01f, float evap_rate=0.01f) |
| Apply cell-based hydraulic erosion/deposition of Musgrave et al. (1989) on GPU. | |
| void | hydraulic_musgrave (Array &z, int iterations=100, float c_capacity=1.f, float c_erosion=0.1f, float c_deposition=0.1f, float water_level=0.01f, float evap_rate=0.01f) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | deposition_fill_holes (Array &z, int deposition_ir, float deposition_strength, int iterations=1) |
| Fill holes using Gaussian-based deposition. | |
| void | deposition_fill_holes (Array &z, int deposition_ir, float deposition_strength, 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 | hydraulic_particle (Array &z, int nparticles, std::uint32_t seed, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const Array *p_moisture_map=nullptr, const Array *p_elevation_shift=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.01f, float c_gravity=1.f, float drag_rate=0.001f, float evap_rate=0.001f, float talus_slope=2.f, float collapse_rate=0.1f, int iterations=1) |
| Simulates hydraulic erosion on a heightmap using particle-based flow. | |
| void | hydraulic_particle (Array &z, const Array *p_mask, int nparticles, std::uint32_t seed, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const Array *p_moisture_map=nullptr, const Array *p_elevation_shift=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.01f, float c_gravity=1.f, float drag_rate=0.001f, float evap_rate=0.001f, float talus_slope=2.f, float collapse_rate=0.1f, int iterations=1) |
| void | hydraulic_particle_multiscale (Array &z, std::uint32_t seed, const std::vector< int > &steps_per_level={4, 2, 1}, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const Array *p_moisture_map=nullptr, const Array *p_elevation_shift=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, float particles_ratio=0.5f, float c_capacity=10.f, float c_erosion=0.05f, float c_deposition=0.05f, float c_inertia=0.01f, float c_gravity=1.f, float drag_rate=0.001f, float evap_rate=0.001f, float talus_slope=2.f, float collapse_rate=0.1f, float mix=1.f, float warp=0.35f) |
| Multiscale particle-based hydraulic erosion cascade. | |
| void | hydraulic_particle_multiscale (Array &z, const Array *p_mask, std::uint32_t seed, const std::vector< int > &steps_per_level={4, 2, 1}, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const Array *p_moisture_map=nullptr, const Array *p_elevation_shift=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, float particles_ratio=0.5f, float c_capacity=10.f, float c_erosion=0.05f, float c_deposition=0.05f, float c_inertia=0.01f, float c_gravity=1.f, float drag_rate=0.001f, float evap_rate=0.001f, float talus_slope=2.f, float collapse_rate=0.1f, float mix=1.f, float warp=0.35f) |
| void | hydraulic_mcdonald (Array &z, int steps, std::uint32_t seed, const McDonaldParams ¶ms, const Array *p_moisture_map=nullptr, Array *p_sediment_map=nullptr, Array *p_discharge_map=nullptr) |
| Particle-based hydraulic erosion with flow-field coupling (McDonald's model). | |
| void | hydraulic_mcdonald (Array &z, int steps, std::uint32_t seed, const Array *p_moisture_map=nullptr, Array *p_sediment_map=nullptr, Array *p_discharge_map=nullptr, float world_extent_km=40.f, float z_scale_km=4.f, int samples=8192, int maxage=512, float lrate=0.2f, float time_step=10.f, float rainfall=1.f, float evap_rate=1e-4f, float gravity=9.81f, float viscosity=0.025f, float bed_shear=0.01f, float crit_slope=0.57f, float settle_rate=0.1f, float thermal_rate=2.5e-3f, float deposition_rate=5e-3f, float suspension_rate=2.5e-4f, float exit_slope=0.01f) |
| void | hydraulic_mcdonald_multiscale (Array &z, std::uint32_t seed, const std::vector< int > &steps_per_level, const McDonaldParams ¶ms, const Array *p_moisture_map=nullptr, Array *p_sediment_map=nullptr, Array *p_discharge_map=nullptr) |
| Multiscale driver for hydraulic_mcdonald. | |
| void | hydraulic_mcdonald_multiscale (Array &z, std::uint32_t seed, const std::vector< int > &steps_per_level={512, 256, 128}, const Array *p_moisture_map=nullptr, Array *p_sediment_map=nullptr, Array *p_discharge_map=nullptr, float world_extent_km=40.f, float z_scale_km=4.f, int samples=8192, int maxage=512, float lrate=0.2f, float time_step=10.f, float rainfall=1.f, float evap_rate=1e-4f, float gravity=9.81f, float viscosity=0.025f, float bed_shear=0.01f, float crit_slope=0.57f, float settle_rate=0.1f, float thermal_rate=2.5e-3f, float deposition_rate=5e-3f, float suspension_rate=2.5e-4f, float exit_slope=0.01f) |
| void | hydraulic_procedural (Array &z, float kp_global, float c_erosion, std::uint32_t seed, ErosionProfile erosion_profile=ErosionProfile::EP_TRIANGLE_GRENIER, float erosion_profile_parameter=0.01f, float angle_shift=0.f, float phase_smoothing=0.1f, float talus_ref=0.001f, float gradient_scaling_ratio=1.f, float gradient_power=0.8f, bool exclude_ridges=true, bool apply_deposition=false, float deposition_strength=1.f, bool enable_default_noise=true, float noise_amp=0.01f, const Array *p_kp_multiplier=nullptr, const Array *p_angle_shift=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Array *p_ridge_mask=nullptr, const UvRect &uv_rect=UvRect{}) |
| Apply phase-guided hydraulic procedural erosion to a heightmap. | |
| void | hydraulic_procedural_fbm (Array &z, float kp_global, float c_erosion, std::uint32_t seed, ErosionProfile erosion_profile=ErosionProfile::EP_TRIANGLE_GRENIER, int octaves=3, float persistence=0.5f, float lacunarity=2.f, float erosion_profile_parameter=0.01f, float angle_shift=0.f, float phase_smoothing=0.1f, float talus_ref=0.001f, float gradient_scaling_ratio=1.f, float gradient_power=0.8f, bool exclude_ridges=true, bool apply_deposition=false, float deposition_strength=1.f, bool enable_default_noise=true, float noise_amp=0.01f, const Array *p_kp_multiplier=nullptr, const Array *p_angle_shift=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Array *p_ridge_mask=nullptr, const UvRect &uv_rect=UvRect{}) |
| Multi-octave (fBm) variant of hydraulic_procedural(). | |
| void | hydraulic_procedural_fbm (Array &z, float kp_global, float c_erosion, std::uint32_t seed, const Array *p_mask, ErosionProfile erosion_profile=ErosionProfile::EP_TRIANGLE_GRENIER, int octaves=3, float persistence=0.5f, float lacunarity=2.f, float erosion_profile_parameter=0.01f, float angle_shift=0.f, float phase_smoothing=0.1f, float talus_ref=0.001f, float gradient_scaling_ratio=1.f, float gradient_power=0.8f, bool exclude_ridges=true, bool apply_deposition=false, float deposition_strength=1.f, bool enable_default_noise=true, float noise_amp=0.01f, const Array *p_kp_multiplier=nullptr, const Array *p_angle_shift=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Array *p_ridge_mask=nullptr, const UvRect &uv_rect=UvRect{}) |
| 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 Schott method. | |
| void | hydraulic_schott (Array &z, const Array *p_mask, 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) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | hydraulic_schott_erosion (Array &z, int iterations, float c_erosion=1.f, float flow_acc_exponent=0.8f, float flow_routing_exponent=1.3f, const Array *p_moisture_map=nullptr, Array *p_flow=nullptr) |
| See hmap::gpu::hydraulic_schott. | |
| 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, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const 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, const 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, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const 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 | hydraulic_stream_log_multiscale (Array &z, float c_erosion, float talus_ref, int levels=3, 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, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, Array *p_flow_map=nullptr, float mix=1.f, float warp=0.35f, std::uint32_t seed=1) |
| See hmap::hydraulic_stream_log_multiscale. | |
| void | hydraulic_stream_log_multiscale (Array &z, float c_erosion, float talus_ref, const Array *p_mask, int levels=3, 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, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, Array *p_flow_map=nullptr, float mix=1.f, float warp=0.35f, std::uint32_t seed=1) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | hydraulic_vpipes (Array &z, float water_height=1e-2f, bool maintain_water_volume=true, float evap_rate=0.1f, int iterations=50, float dt=0.5f, float k_capacity=0.5f, float k_erode=0.001f, float k_depose=0.01f, float k_discharge_exp=1.f, float downcutting_max_depth_ratio=10.f, bool flux_diffusion=true, float flux_diffusion_strength=0.01f, Array *p_rain_map=nullptr, Array *p_water_depth=nullptr, Array *p_sediment=nullptr, Array *p_vel_u=nullptr, Array *p_vel_v=nullptr) |
| See hmap::gpu::hydraulic_vpipes. | |
| void | mudslide (Array &z, const Array &landslide_mask, float depth, int iterations, float depth_map_exponent=0.5f, float viscosity_law_power=1.5f, Array *p_depth_end=nullptr, Array *p_depth_init=nullptr) |
| Simulate a mudslide (landslide-driven material redistribution) on a height field. | |
| void | mudslide (Array &z, float talus_limit, float depth, int iterations, float depth_map_exponent=0.5f, float viscosity_law_power=1.5f, Array *p_depth_end=nullptr, Array *p_depth_init=nullptr) |
| See hmap::gpu::mudslide. | |
| void | rifts (Array &z, const glm::vec2 &kw, float angle, float amplitude, std::uint32_t seed, float elevation_noise_shift=0.f, float k_smooth_bottom=0.05f, float k_smooth_top=0.05f, float radial_spread_amp=0.2f, float elevation_noise_amp=0.1f, float clamp_vmin=0.f, float remap_vmin=0.f, bool apply_mask=true, bool reverse_mask=false, float mask_gamma=1.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_mask=nullptr, const glm::vec2 ¢er={0.5f, 0.5f}, const UvRect &uv_rect={0.f, 1.f, 0.f, 1.f}) |
| Applies a "rift" deformation effect to a heightmap array. | |
| void | sediment_deposition (Array &z, const Array *p_mask, const Array &talus, Array *p_deposition_map=nullptr, float max_deposition=0.01, int iterations=5, int thermal_subiterations=10) |
| Perform sediment deposition combined with thermal erosion. | |
| void | sediment_deposition (Array &z, const Array &talus, Array *p_deposition_map=nullptr, float max_deposition=0.01, int iterations=5, int thermal_subiterations=10) |
| void | sediment_layer (Array &z, const Array &talus_layer, const Array &talus_upper_limit, int iterations, bool apply_post_filter=true, Array *p_deposition_map=nullptr) |
| Applies a talus-based sediment deposition layer. | |
| void | strata (Array &z, float angle, float slope, float gamma, std::uint32_t seed, bool linear_gamma=true, float kz=1.f, int octaves=4, float lacunarity=2.f, float gamma_noise_ratio=0.5f, float noise_amp=0.4f, const glm::vec2 &noise_kw={4.f, 4.f}, bool enable_ridge_noise=true, const glm::vec2 &ridge_noise_kw={4.f, 1.2f}, float ridge_angle_shift=45.f, float ridge_noise_amp=0.5f, float ridge_clamp_vmin=0.f, float ridge_remap_vmin=0.f, bool apply_elevation_mask=true, bool apply_ridge_mask=true, float mask_gamma=0.4f, const Array *p_mask=nullptr, const UvRect &uv_rect={0.f, 1.f, 0.f, 1.f}) |
| Applies stratification to a heightfield using directional noise and multiscale gamma transformations. | |
| void | strata_cells (Array &z, glm::vec2 kw, float amp, std::uint32_t seed, float gamma=0.5f, float gamma_lateral=0.4f, float angle=0.f, float noise_amp=0.5f, bool absolute_displacement=true, float occurence_probability=0.5f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Applies procedural stratified cell displacement to a heightmap. | |
| void | strata_cells (Array &z, glm::vec2 kw, float amp, std::uint32_t seed, const Array *p_mask, float gamma=0.5f, float gamma_lateral=0.4f, float angle=0.f, float noise_amp=0.5f, bool absolute_displacement=true, float occurence_probability=0.5f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| void | strata_cells_fbm (Array &z, glm::vec2 kw, float amp, std::uint32_t seed, float gamma=0.5f, float gamma_lateral=0.4f, float angle=0.f, bool enable_default_noise=true, float default_noise_amp=0.05f, bool absolute_displacement=true, float occurence_probability=0.5f, int octaves=8, float persistence=0.4f, float lacunarity=2.2f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Applies multi-octave (fBm) stratified cell displacement. | |
| void | strata_cells_fbm (Array &z, glm::vec2 kw, float amp, std::uint32_t seed, const Array *p_mask, float gamma=0.5f, float gamma_lateral=0.4f, float angle=0.f, bool enable_default_noise=true, float default_noise_amp=0.05f, bool absolute_displacement=true, float occurence_probability=0.5f, int octaves=8, float persistence=0.4f, float lacunarity=2.2f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| void | strata_plates (Array &z, const Array &talus, int direction_offset=0, int direction_count=3, bool random_directions=false, std::uint32_t seed=0, float vmin=-FLT_MAX, float skew=0.f, float mix_ratio=0.9f, const Array *p_mask=nullptr, const Array *p_dx=nullptr, const Array *p_dy=nullptr) |
| Apply stratified talus projection along multiple directions. | |
| void | strata_terrace (Array &z, float gamma, std::uint32_t seed, float kz=4.f, bool linear_gamma=true, float gamma_noise_ratio=0.5f, float slope=0.f, float angle=0.f, const Array *p_noise=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Applies a terrace (stratification) filter to a heightmap. | |
| void | strata_terrace (Array &z, float gamma, std::uint32_t seed, const Array *p_mask, float kz=4.f, bool linear_gamma=true, float gamma_noise_ratio=0.5f, float slope=0.f, float angle=0.f, const Array *p_noise=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| void | valley_fill (Array &z, const Array &talus, int iterations=100, float gamma=2.f, float ratio=0.8f, float zmin=0.f, float zmax=0.f, float elevation_max_ratio=1.f, bool preserve_elevation_range=true, const Array *p_noise=nullptr, Array *p_deposition_map=nullptr) |
| Fill valleys using thermal scree deposition and height-based blending. | |
| void | valley_fill (Array &z, const Array *p_mask, const Array &talus, int iterations=100, float gamma=2.f, float ratio=0.8f, float zmin=0.f, float zmax=0.f, float elevation_max_ratio=1.f, bool preserve_elevation_range=true, const Array *p_noise=nullptr, Array *p_deposition_map=nullptr) |
| Array | watershed_ridge (const Array &z, float amplitude=0.2f, float width=32.f, float edt_exponent=0.5f, int prefilter_ir=0, bool fast_approx=false, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_scaling=nullptr) |
| Carves watershed ridges using basin-wise distance transforms. | |
| Array | watershed_ridge (const Array &z, const Array *p_mask, float amplitude=0.2f, float width=32.f, float edt_exponent=0.5f, int prefilter_ir=0, bool fast_approx=false, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_scaling=nullptr) |
| void | thermal (Array &z, const Array &talus, int iterations=10, const Array *p_bedrock=nullptr, Array *p_deposition_map=nullptr) |
| Apply thermal weathering erosion. | |
| void | thermal (Array &z, const Array *p_mask, const Array &talus, int iterations=10, const Array *p_bedrock=nullptr, 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 (Array &z, float talus, int iterations=10, const Array *p_bedrock=nullptr, 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_auto_bedrock (Array &z, const Array &talus, int iterations=10, Array *p_deposition_map=nullptr) |
| Apply thermal weathering erosion with automatic determination of the bedrock. | |
| void | thermal_auto_bedrock (Array &z, const Array *p_mask, const Array &talus, int iterations=10, Array *p_deposition_map=nullptr) |
| void | thermal_auto_bedrock (Array &z, float, 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_conserve (Array &z, const Array &talus, int iterations=10, float rate=0.5f, const Array *p_bedrock=nullptr, Array *p_deposition_map=nullptr) |
| Apply mass-preserving thermal weathering erosion. | |
| void | thermal_conserve (Array &z, const Array *p_mask, const Array &talus, int iterations=10, float rate=0.5f, const Array *p_bedrock=nullptr, 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_conserve (Array &z, float talus, int iterations=10, float rate=0.5f, const Array *p_bedrock=nullptr, 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_flatten (Array &z, const Array &talus, int iterations, float sigma_inf=0.5f, float sigma_sup=0.f) |
| Apply iterative thermal flattening erosion on a heightmap. | |
| void | thermal_flatten (Array &z, const Array *p_mask, const Array &talus, int iterations, float sigma_inf=0.5f, float sigma_sup=0.f) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | thermal_olsen (Array &z, const Array &talus, int iterations) |
| Apply thermal weathering erosion (Olsen model). | |
| void | thermal_olsen (Array &z, const Array *p_mask, const Array &talus, int iterations) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| 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) |
| Apply thermal erosion using a 'rib' algorithm. | |
| void | thermal_rib (Array &z, const Array *p_mask, int iterations) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| 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_schott (Array &z, const Array &talus, int iterations=10, float intensity=0.2f, Array *p_deposition_map=nullptr) |
| Applies the thermal erosion process with a uniform slope threshold (Schott model). | |
| void | thermal_schott (Array &z, const Array *p_mask, const Array &talus, int iterations=10, float intensity=0.2f, 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, 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, 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 | bilateral_filter (const Array &array, const Array &kernel2d, const Array &kernel1d, float kernel1d_value_scaling) |
| Apply a bilateral filter to an array. | |
| Array | bilateral_filter (const Array &array, int ir, float kernel1d_value_scaling) |
| Apply a bilateral filter to an array using a radius-based Gaussian kernel. | |
| void | directional_blur (Array &array, float radius, const Array &angle, int steps=32) |
| Applies a directional blur to the input array. | |
| void | directional_blur (Array &array, float radius, const Array &angle, const Array *p_mask, int steps=32) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Array | distance_shaper (const Array &array, float falloff=0.05f, int directions=8, float skew=0.f, float angle=0.f, DistanceMode mode=DistanceMode::PYRAMID, DistanceMethod method=DistanceMethod::RT, float angular_jitter=0.f, float falloff_jitter=0.f, float threshold=0.f, bool invert_input=false, bool invert_output=false, float mix_ratio=1.f, std::uint32_t seed=0, const Array *p_mask=nullptr, const Array *p_dx=nullptr, const Array *p_dy=nullptr) |
| See hmap::distance_shaper. | |
| 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, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::gamma_correction_local. | |
| void | gamma_correction_local (Array &array, float gamma, int ir, const Array *p_mask, float k=0.1f, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Array | jagged (const Array &array, glm::vec2 kw, float amp=0.1f, std::uint32_t seed=0, glm::vec2 jitter={0.5f, 0.5f}, float gamma=1.f, float angle=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a Voronoi-based jagged bubble dome filter to an array. | |
| Array | jagged (const Array &array, float kw, float amp=0.1f, std::uint32_t seed=0, glm::vec2 jitter={0.5f, 0.5f}, float gamma=1.f, float angle=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a Voronoi-based jagged bubble dome filter using an isotropic frequency. | |
| Array | jagged_fbm (const Array &array, glm::vec2 kw, float amp=0.1f, std::uint32_t seed=0, int octaves=8, float persistence=0.5f, float lacunarity=2.f, bool switch_kx_ky=false, glm::vec2 jitter={0.5f, 0.5f}, float gamma=1.f, float angle=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a fractal Brownian motion (fBm) version of the Voronoi-based jagged bubble dome filter to an array. | |
| Array | jagged_fbm (const Array &array, float kw, float amp=0.1f, std::uint32_t seed=0, int octaves=8, float persistence=0.5f, float lacunarity=2.f, bool switch_kx_ky=false, glm::vec2 jitter={0.5f, 0.5f}, float gamma=1.f, float angle=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a fractal Brownian motion (fBm) version of the Voronoi-based jagged bubble dome filter using an isotropic frequency. | |
| 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 | 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, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::median_pseudo. | |
| 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, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::plateau. | |
| void | plateau (Array &array, int ir, float factor, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Array | project_talus_along_direction (const Array &array, const Array &talus, int direction=0, float vmin=-FLT_MAX) |
| Projects array values along a given direction using talus attenuation. | |
| Array | project_talus_along_direction (const Array &array, const Array &talus, const Array *p_mask, int direction=0, float vmin=-FLT_MAX) |
| void | recast_cliff (Array &array, float talus, int ir, float amplitude, float gain=2.f, int iterations=500, Array *p_cliff_mask=nullptr, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| Transform heightmap to add cliffs where gradients are steep enough using Poisson gradient amplification. | |
| void | recast_cliff (Array &array, float talus, int ir, float amplitude, const Array *p_mask, float gain=2.f, int iterations=500, Array *p_cliff_mask=nullptr, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | recast_cliff_directional (Array &array, float talus, int ir, float amplitude, float angle, float gain=2.f, int iterations=500, Array *p_cliff_mask=nullptr, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| Transform heightmap to add directional cliffs where gradients are steep enough using Poisson gradient amplification. | |
| void | recast_cliff_directional (Array &array, float talus, int ir, float amplitude, float angle, const Array *p_mask, float gain=2.f, int iterations=500, Array *p_cliff_mask=nullptr, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | recast_cliff_directional (Array &array, float talus, int ir, float amplitude, const Array &angle, float gain=2.f, int iterations=500, Array *p_cliff_mask=nullptr, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | recast_cliff_directional (Array &array, float talus, int ir, float amplitude, const Array &angle, const Array *p_mask, float gain=2.f, int iterations=500, Array *p_cliff_mask=nullptr, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | ridge_accentuate (Array &array, float strength=0.1f, int ir=0, bool reverse=false) |
| See hmap::ridge_accentuate. | |
| void | ridge_accentuate (Array &array, const Array *p_mask, float strength=0.1f, int ir=0, bool reverse=false) |
| See hmap::ridge_accentuate. | |
| 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, const Array *p_mask=nullptr, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| See hmap::smooth_cpulse. | |
| void | smooth_cpulse_edge_removing (Array &array, float talus, float talus_width, int ir) |
| See hmap::smooth_cpulse_edge_removing. | |
| 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 | spectral_equalizer (const Array &array, const std::vector< float > &weights, int ir_min, int ir_max) |
| Spectral equalizer for 2D fields using a multiscale Gaussian pyramid. | |
| Array | spectral_equalizer (const Array &array, const std::vector< float > &weights, int ir_min, int ir_max, 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 | voronoi_shrink (const Array &array, glm::vec2 kw, float shrink_factor=0.8f, float fill_value=0.f, std::uint32_t seed=0, glm::vec2 jitter={0.5f, 0.5f}, float angle=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a Voronoi shrinker filter to an input heightmap. | |
| Array | voronoi_shrink (const Array &array, float kw, float shrink_factor=0.8f, float fill_value=0.f, std::uint32_t seed=0, glm::vec2 jitter={0.5f, 0.5f}, float angle=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a Voronoi shrinker filter using an isotropic frequency. | |
| Array | voronoi_shrink (const Array &array, const Cloud &cloud, float shrink_factor=0.8f, float fill_value=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a Voronoi shrinker filter using a custom cloud of points. | |
| Array | voronoi_shrink (const Array &array, const std::vector< Point > &points, float shrink_factor=0.8f, float fill_value=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a Voronoi shrinker filter using a list of Point objects. | |
| Array | voronoi_shrink (const Array &array, const std::vector< glm::vec2 > &points, float shrink_factor=0.8f, float fill_value=0.f, const Array *p_mask=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Apply a Voronoi shrinker filter using a list of glm::vec2 coordinates. | |
| Array | path_sdf_bezier_to_array (const Path &path, glm::ivec2 shape, const UvRect &uv_rect_array=UvRect::unit(), const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr) |
| See hmap::path_sdf_bezier_to_array. | |
| Array | path_sdf_to_array (const Path &path, glm::ivec2 shape, const UvRect &uv_rect_array=UvRect::unit(), const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr) |
| See hmap::path_sdf_to_array. | |
| Array | gradient_angle_circular_smoothing (const Array &array, int ir, bool downward=false) |
| See hmap::gradient_angle_circular_smoothing. | |
| Array | laplacian_fract (const Array &array, float s, int ir) |
| Compute the fractional Laplacian of an array. | |
| void | phase_averaging (Array &field_real, Array &field_imag, int ir) |
| Apply phase averaging on real and imaginary fields using a GPU kernel. | |
| Array | phase_field (const Array &array, const glm::vec2 &kw, std::uint32_t seed, float kp, bool rotate90=false, float normalization=1.f, const glm::vec2 &jitter={0.5f, 0.5f}, int angle_filter_ir=8, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Array *p_modulus=nullptr, Array *p_angle_jump_mask=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Compute a phase field from an input array using local orientation and noise. | |
| Array | phase_field (const Array &array, std::uint32_t seed, float kp_global, bool rotate90=false, float normalization=1.f, const glm::vec2 &jitter={0.5f, 0.5f}, int angle_filter_ir=8, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Array *p_modulus=nullptr, Array *p_angle_jump_mask=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Compute a phase field using a global isotropic kp value. | |
| Array | phase_field_angle (const Array &angle, const glm::vec2 &kw, std::uint32_t seed, float kp, float normalization=1.f, const glm::vec2 &jitter={0.5f, 0.5f}, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Array *p_modulus=nullptr, Array *p_angle_jump_mask=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Array | coastal_fetch (const Array &z, int ndirections, const Array *p_compute_mask=nullptr) |
| Computes the omnidirectional coastal fetch for each cell. | |
| Array | coastal_fetch_directional (const Array &z, float angle, float directional_exp, int ndirections, const Array *p_compute_mask=nullptr) |
| Computes directional coastal fetch weighted by alignment with a prevailing wind or wave direction. | |
| Array | flow_accumulation_from_velocity_field (const Array &u, const Array &v, int iterations) |
| Approximates flow accumulation from a 2D velocity field. | |
| Array | flow_accumulation_stochastic (const Array &z, int n_samples=1<< 19, std::uint32_t seed=0, const Array *p_source=nullptr, const Array *p_decay=nullptr) |
| GPU (OpenCL) variant of hmap::flow_accumulation_stochastic — see the CPU declaration for the algorithm description and parameters. | |
| Array | flow_direction_d8 (const Array &z) |
| See hmap::flow_direction_d8. | |
| Array | flow_simulation (const Array &z, float water_depth, const Array &depth_map, int iterations, float dt=0.5f, bool flux_diffusion=true, float flux_diffusion_strength=0.01f, float dry_out_ratio=0.f, const Array *p_rain_map=nullptr, float rain_rate=0.f, float evap_rate=0.f, bool outflow_boundaries=false, Array *p_vel_u=nullptr, Array *p_vel_v=nullptr, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| GPU hydraulic flow simulation using a virtual-pipes model; simulates shallow-water transport over a height field using iterative flux computation and water transport passes, with optional flux diffusion and post-simulation dry-out. The whole iteration loop runs on the device: the terrain is uploaded once, depth and fluxes ping-pong between device images, and only the final depth (and velocity, if requested) are read back. | |
| Array | flow_simulation_viscous (const Array &z, float water_depth, const Array &depth_map, int iterations, float dt=-1.f, float dry_out_ratio=0.f, float viscosity=1.f, float power=2.5f, float evap_rate=0.f, bool outflow_boundaries=false, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| GPU viscous shallow-water flow simulation using non-linear thin-film diffusion with upwind mobility. | |
| Array | generate_riverbed (const Path &path, glm::ivec2 shape, const UvRect &uv_rect=UvRect::unit(), 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. | |
| Array | snow_mantle (const Array &z, float strength=0.1f, float snowline=0.5f, float falloff=0.1f, int prefilter_ir=8, float talus_coverage=0.8f, float talus_threshold=0.001f, float directional=0.f, float wind_direction=0.f, float peaks=0.2f, float melt=0.f, float sun_azimuth=180.f, float sun_zenith=45.f, int thermal_iterations=15, float thermal_talus=0.15f, float coverage=0.5f, const Array *p_existing_snow=nullptr, const Array *p_mask=nullptr, const Array *p_noise=nullptr) |
| Generates fine-scale snow mantle accumulation over terrain. | |
| Array | snow_simulation (const Array &z, float snow_depth, const Array &fall_map, const Array &melting_map, const Array &talus, int iterations, float dt=0.5f, float fall_iterations_ratio=1.f, float k_snow=0.5f, float k_visc=0.1f, float k_melt_factor=0.8f, float k_depth_ratio=1.f, float k_depth_slope_ratio=1.f, float k_creep=0.1f, bool post_filter=true, float thermal_talus_ratio=0.2f, bool outflow_boundaries=true, float clamp_smin=0.f, bool rebase_snow_depth_to_zero=true, int sync_interval=0, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| Simulate snow accumulation and redistribution over a terrain. | |
| void | water_depth_filter (Array &depth, const Array &z, int ir, const Array *p_water_mask=nullptr, bool smooth_contour=false, float transition_ratio=0.1f) |
| Filters water depth values using elevation data and a given radius. | |
| Array | water_frontier_curvature (const Array &water_depth, int prefilter_ir, bool extend_values_from_interface=false) |
| See hmap::water_frontier_curvature. | |
| Array | water_depth_from_mask (const Array &z, const Array &mask, float mask_threshold=0.f, int iterations_max=10000, float tolerance=1e-2f) |
| See hmap::water_depth_from_mask. | |
| Array | harmonic_interpolation (const Array &array, const Array &mask_fixed_values, int iterations_max=500, float tolerance=1e-5f, float omega=0.f, int sync_interval=0, const UvTile ®ion=UvTile::unit(), ICommunicator &comm=SingleArrayComm::instance(), const Array *p_rhs=nullptr, bool fix_domain_borders=true) |
| Perform harmonic interpolation on GPU using Red-Black Successive Over-Relaxation (RB-SOR). | |
| Array | harmonic_interpolation (const Array &array, const Array &mask_fixed_values, const Array &dx, const Array &dy, int iterations_max=500, float tolerance=1e-5f, float omega=0.f, int sync_interval=0, const UvTile ®ion=UvTile::unit(), ICommunicator &comm=SingleArrayComm::instance()) |
| Perform harmonic interpolation on GPU with 2D variable diffusion coefficients (Dx, Dy) using Red-Black SOR. | |
| Array | biharmonic_interpolation (const Array &array, const Array &mask_fixed_values, int iterations_max=1000, float tolerance=1e-5f, float omega=0.5f, int sync_interval=0, const UvTile ®ion=UvTile::unit(), ICommunicator &comm=SingleArrayComm::instance()) |
| void | interpolate_array_bicubic (const Array &source, Array &target) |
| void | interpolate_array_bicubic (const Array &source, Array &target, const UvRect &uv_rect_source, const UvRect &uv_rect_target) |
| void | interpolate_array_bilinear (const Array &source, Array &target) |
| void | interpolate_array_bilinear (const Array &source, Array &target, const UvRect &uv_rect_source, const UvRect &uv_rect_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 UvRect &uv_rect_source, const UvRect &uv_rect_target) |
| Array | local_aspect_variance (const Array &array, int ir) |
| Compute the average local aspect variance of an array. | |
| Array | local_max (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| Compute the local maximum using the specified kernel footprint. | |
| Array | local_max_disk (const Array &array, int ir) |
| Compute the local maximum using a disk kernel. | |
| Array | local_max_octagon (const Array &array, int ir) |
| Compute the local maximum using an octagonal kernel approximation via 4 separable 1D passes (horizontal, vertical, and two diagonals). | |
| Array | local_max_square (const Array &array, int ir) |
| Compute the local maximum using a square kernel with a 2-pass separable implementation. | |
| Array | local_median_deviation (const Array &array, int ir) |
| See hmap::local_median_deviation. | |
| Array | local_min (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| Compute the local minimum using the specified kernel footprint. | |
| Array | local_min_disk (const Array &array, int ir) |
| Compute the local minimum using a disk kernel. | |
| Array | local_min_octagon (const Array &array, int ir) |
| Compute the local minimum using an octagonal kernel approximation via 4 separable 1D passes (horizontal, vertical, and two diagonals). | |
| Array | local_min_square (const Array &array, int ir) |
| Compute the local minimum using a square kernel with a 2-pass separable implementation. | |
| Array | local_relief (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| Compute the local relief of an array. | |
| Array | local_variance (const Array &array, int ir) |
| Compute the average local variance of an array. | |
| Array | local_mean (const Array &array, int ir) |
| See hmap::local_mean. | |
| Array | local_skewness (const Array &array, int ir) |
| Array | local_z_score (const Array &array, int ir) |
| Compute the local z-score of an array. | |
| Array | topographic_position_index (const Array &array, int ir) |
| Compute the Topographic Position Index (TPI). | |
| Array | relative_elevation (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::relative_elevation. | |
| Array | relative_elevation_square_kernel (const Array &array, int ir) |
| See hmap::relative_elevation. | |
| Array | roughness (const Array &array, int ir) |
| See hmap::roughness. | |
| Array | ruggedness (const Array &array, int ir) |
| See hmap::ruggedness. | |
| Array | rugosity (const Array &z, int ir, bool convex=true) |
| See hmap::rugosity. | |
| Array | topographic_residual (const Array &z, int ir, bool normalize_output=false) |
| See hmap::topographic_residual. | |
| Array | valley_width (const Array &z, int ir=0, bool ridge_select=false) |
| See hmap::valley_width. | |
| Array | local_metrics (const Array &array, int ir, LocalMetrics metric, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| Compute a local metric on the input array using a square neighborhood. | |
| Array | sparse_max_convolution (const Array &array, const Array &kernel, bool scale_kernel_with_value=true, float k_smoothmax=0.f) |
| Apply a sparse max-convolution. | |
| Array | sparse_max_convolution (const Array &array_values, const Array &array_sizes, const Array &kernel, float k_smoothmax=0.f) |
| Array | border (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::border. | |
| Array | closing (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::closing. | |
| Array | closing_by_reconstruction (const Array &array, int ir, float k_smooth_max=0.f, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::closing_by_reconstruction. | |
| Array | contour_smoothing (const Array &array, int ir, float transition_ratio=0.1f) |
| See hmap::contour_smoothing. | |
| Array | dilation (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::dilation. | |
| Array | dilation_expand_border_only (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::dilation_expand_border_only. | |
| Array | distance_transform_jfa (const Array &array, bool return_squared_distance=false) |
| Return the Euclidean distance transform. | |
| Array | erosion (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::erosion. | |
| Array | morphological_black_hat (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::morphological_black_hat. | |
| Array | morphological_gradient (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::morphological_gradient. | |
| Array | morphological_laplacian (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::morphological_laplacian. | |
| Array | morphological_top_hat (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::morphological_top_hat. | |
| Array | opening (const Array &array, int ir, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::opening. | |
| Array | opening_by_reconstruction (const Array &array, int ir, float k_smooth_min=0.f, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::opening_by_reconstruction. | |
| Array | reconstruction_by_dilation (const Array &marker, const Array &mask, int ir, float k_smooth_min=0.f, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::reconstruction_by_dilation. | |
| Array | reconstruction_by_erosion (const Array &marker, const Array &mask, int ir, float k_smooth_max=0.f, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| See hmap::reconstruction_by_erosion. | |
| 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 | relative_distance_from_skeleton (const Array &array, const Array &skeleton, int ir_search, int ir_erosion=1) |
| See hmap::relative_distance_from_skeleton. | |
| Array | signed_curvature_from_distance (const Array &array, int prefilter_ir=0) |
| See hmap::signed_curvature_from_distance. | |
| Array | signed_distance_transform (const Array &array, int prefilter_ir=0) |
| See hmap::signed_distance_transform. | |
| Array | skeleton (const Array &array, bool zero_at_borders=true) |
| See hmap::skeleton. | |
| Array | morphological_operators (const Array &array, int ir, hmap::MorphologyOperation operation, MinMaxKernel kernel_type=MinMaxKernel::DISK) |
| Apply a morphological operation to the input array using a square kernel. | |
| void | helper_bind_optional_buffer (clwrapper::Run &run, const std::string &id, const Array *p_array) |
| bool | init_opencl () |
| Array | gabor_wave (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, const Array &angle, float angle_spread_ratio=1.f, const UvRect &uv_rect=UvRect::unit()) |
| Return an array filled with coherence Gabor noise. | |
| Array | gabor_wave (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float angle=0.f, float angle_spread_ratio=1.f, const UvRect &uv_rect=UvRect::unit()) |
| Array | gabor_wave_fbm (glm::ivec2 shape, glm::vec2 kw, std::uint32_t 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, const UvRect &uv_rect=UvRect::unit()) |
| Return an array filled with coherence Gabor noise. | |
| Array | gabor_wave_fbm (glm::ivec2 shape, glm::vec2 kw, std::uint32_t 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, const UvRect &uv_rect=UvRect::unit()) |
| Array | gavoronoise (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, const Array &angle, float amplitude=0.05f, float angle_spread_ratio=1.f, glm::vec2 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, const UvRect &uv_rect=UvRect::unit()) |
| Generates a 2D array using the GavoroNoise algorithm, which is a procedural noise technique for terrain generation and other applications. | |
| Array | gavoronoise (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float angle=0.f, float amplitude=0.05f, float angle_spread_ratio=1.f, glm::vec2 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, const UvRect &uv_rect=UvRect::unit()) |
| Array | gavoronoise (const Array &base, glm::vec2 kw, std::uint32_t seed, float amplitude=0.05f, glm::vec2 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, const UvRect &uv_rect=UvRect::unit()) |
| Array | noise (NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit(), glm::ivec2 period={0, 0}, float angle=0.f, float stretch=1.f) |
See hmap::noise. period sets the tiling period in lattice cells. For the heightmap to be periodic with respect to the full domain, period must be equal to the wavenumber kw, i.e. period = {round(kw.x), round(kw.y)}; a smaller period makes the pattern repeat within the domain. A component <= 0 disables wrapping on that axis (default {0, 0}: non-periodic). Tiling is exact only for lattice noise types with integer kw; simplex is never wrapped. | |
| Array | noise_fbm (NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, std::uint32_t 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 UvRect &uv_rect=UvRect::unit(), glm::ivec2 period={0, 0}, float angle=0.f, float stretch=1.f, float stretch_decay=0.f) |
See hmap::noise_fbm. period sets the tiling period in lattice cells for the base octave. For the heightmap to be periodic with respect to the full domain, period must be equal to the wavenumber kw, i.e. period = {round(kw.x), round(kw.y)}; a smaller period makes the pattern repeat within the domain. A component <= 0 disables wrapping on that axis (default {0, 0}: non-periodic). Seamless tiling additionally requires an integer lacunarity (the default 2); simplex is never wrapped. | |
| Array | noise_slope (NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, float gradient_scale=0.5f, float slope_power=2.f, float octave_blend=0.5f, float bias_angle=0.f, float bias_strength=0.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit(), glm::ivec2 period={0, 0}, float angle=0.f, float stretch=1.f, float stretch_decay=0.f) |
See hmap::noise_slope. period sets the tiling period in lattice cells for the base octave. | |
| Array | phasor (PhasorProfile phasor_profile, glm::ivec2 shape, float kp_global, std::uint32_t seed, float angle_shift=0.f, float normalization=1.f, const glm::vec2 jitter={1.f, 1.f}, float delta=0.01f, float phase_smoothing=10.f, const Array *p_angle=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a procedural phasor-based pattern. | |
| Array | phasor_fbm (PhasorProfile phasor_profile, glm::ivec2 shape, float kp_global, std::uint32_t seed, float angle_shift=0.f, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, float normalization=1.f, const glm::vec2 jitter={1.f, 1.f}, float delta=0.01f, float phase_smoothing=10.f, const Array *p_angle=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a multi-octave (fBm) phasor-based pattern. | |
| Array | vorolines (glm::ivec2 shape, float density, std::uint32_t seed, float k_smoothing=0.f, float exp_sigma=0.f, float alpha=0.f, float alpha_span=cte::pi, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit(), const UvRect &uv_rect_points=UvRect::unit()) |
| Generates a Voronoi-based pattern where cells are defined by proximity to random lines. | |
| Array | vorolines_fbm (glm::ivec2 shape, float density, std::uint32_t seed, float k_smoothing=0.f, float exp_sigma=0.f, float alpha=0.f, float alpha_span=cte::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, const UvRect &uv_rect=UvRect::unit(), const UvRect &uv_rect_points=UvRect::unit()) |
| 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 (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, glm::vec2 jitter={0.5f, 0.5f}, float bias=0.f, 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, const UvRect &uv_rect=UvRect::unit()) |
| Generates a Voronoi diagram in a 2D array with configurable properties. | |
| Array | voronoi_fbm (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, glm::vec2 jitter={0.5f, 0.5f}, float bias=0.f, 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, const UvRect &uv_rect=UvRect::unit()) |
| Generates a Voronoi diagram in a 2D array with configurable properties. | |
| Array | voronoi_edge_distance (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, glm::vec2 jitter={0.5f, 0.5f}, float bias=0.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Computes the Voronoi edge distance. | |
| Array | voronoise (glm::ivec2 shape, glm::vec2 kw, float u_param, float v_param, std::uint32_t seed, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a 2D Voronoi noise array. | |
| Array | voronoise_fbm (glm::ivec2 shape, glm::vec2 kw, float u_param, float v_param, std::uint32_t 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 UvRect &uv_rect=UvRect::unit()) |
| Return an array filled with coherence Voronoise. | |
| Array | vororand (glm::ivec2 shape, float density, float variability, std::uint32_t 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, const UvRect &uv_rect=UvRect::unit(), const UvRect &uv_rect_points=UvRect::unit()) |
| Generates a 2D Voronoi-based scalar field using OpenCL. | |
| Array | vororand (glm::ivec2 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, const UvRect &uv_rect=UvRect::unit()) |
| Array | wavelet_noise (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float kw_multiplier=2.f, float vorticity=0.f, float density=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, const UvRect &uv_rect=UvRect::unit()) |
| Generates 2D wavelet noise using an OpenCL kernel. | |
| Array | hemisphere_field (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float rmin=0.05f, float rmax=0.8f, float amplitude_random_ratio=1.f, float density=0.1f, glm::vec2 jitter={1.f, 1.f}, float shift=0.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, const UvRect &uv_rect=UvRect::unit()) |
| Generates a scalar field representing the signed distance to randomly generated hemispheres. | |
| Array | hemisphere_field_fbm (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float rmin=0.05f, float rmax=0.8f, float amplitude_random_ratio=1.f, float density=0.1f, glm::vec2 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, const UvRect &uv_rect=UvRect::unit()) |
| See hmap::hemisphere_field. | |
| Array | multisteps (glm::ivec2 shape, float angle, std::uint32_t seed, glm::vec2 kw={2.f, 2.f}, float noise_amp=0.1f, float noise_rugosity=0.f, bool noise_inflate=true, float r=1.2f, int nsteps=8, float elevation_exponent=0.7f, float shape_gain=4.f, float scale=0.5f, float outer_slope=0.1f, const Array *p_ctrl_param=nullptr, const glm::vec2 ¢er={0.5f, 0.5f}, const BBox2D &bbox=BBox2D::unit()) |
| GPU-accelerated multi-step height generation with procedural noise. | |
| Array | polygon_field (glm::ivec2 shape, glm::vec2 kw, std::uint32_t 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, glm::vec2 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, const UvRect &uv_rect=UvRect::unit()) |
| Generates a scalar field representing the signed distance to randomly generated polygons. | |
| Array | polygon_field_fbm (glm::ivec2 shape, glm::vec2 kw, std::uint32_t 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, glm::vec2 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, const UvRect &uv_rect=UvRect::unit()) |
| Generates a scalar field representing the signed distance to randomly generated polygons combined with fractal Brownian motion (fBm) noise modulation. | |
| Array | badlands (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, int octaves=8, float rugosity=0.2f, float angle=30.f, float bias=0.f, float k_smoothing=0.1f, float base_noise_amp=0.2f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a synthetic "badlands" terrain heightmap. | |
| Array | basalt_field (glm::ivec2 shape, glm::vec2 kw, std::uint32_t 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, float bias=0.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a synthetic procedural terrain resembling basaltic landforms. | |
| Array | island (const Array &land_mask, const Array *p_noise_r=nullptr, float apex_elevation=1.f, bool filter_distance=true, int filter_ir=32, float slope_min=0.1f, float slope_max=8.f, float slope_start=0.5f, float slope_end=1.f, float slope_noise_intensity=0.5f, float k_smooth=0.05f, float radial_noise_intensity=0.3f, float radial_profile_gain=2.f, float water_decay=0.05f, float water_depth=0.3f, float lee_angle=30.f, float lee_amp=0.f, float uplift_amp=0.f, Array *p_water_depth=nullptr, Array *p_inland_mask=nullptr) |
| Generates an island heightmap from a land mask using radial profiles, slope shaping, optional noise, and water attenuation. | |
| Array | island (const Array &land_mask, std::uint32_t seed, float noise_amp=0.07f, glm::vec2 noise_kw={4.f, 4.f}, int noise_octaves=8, float noise_rugosity=0.7f, float noise_angle=45.f, float noise_k_smoothing=0.05f, float apex_elevation=1.f, bool filter_distance=true, int filter_ir=32, float slope_min=0.1f, float slope_max=8.f, float slope_start=0.5f, float slope_end=1.f, float slope_noise_intensity=0.5f, float k_smooth=0.05f, float radial_noise_intensity=0.3f, float radial_profile_gain=2.f, float water_decay=0.05f, float water_depth=0.3f, float lee_angle=30.f, float lee_amp=0.f, float uplift_amp=0.f, Array *p_water_depth=nullptr, Array *p_inland_mask=nullptr) |
| Generates an island heightmap from a land mask using internally generated FBM noise for radial perturbation and slope modulation. | |
| Array | mountain_cone (glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float peak_kw=4.f, float rugosity=0.f, float angle=45.f, float bias=0.f, float k_smoothing=0.f, float gamma=0.5f, float cone_alpha=1.f, float ridge_amp=0.4f, float base_noise_amp=0.05f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a procedural "mountain cone" heightmap using fractal noise and Voronoi patterns. | |
| Array | mountain_inselberg (glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float rugosity=0.2f, float angle=45.f, float gamma=1.1f, bool round_shape=false, bool add_deposition=true, float bulk_amp=0.2f, float base_noise_amp=0.2f, float bias=0.f, float k_smoothing=0.1f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a synthetic mountain-like inselberg (isolated hill) heightmap. | |
| Array | mountain_range_radial (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float half_width=0.2f, float angle_spread_ratio=0.5f, float core_size_ratio=1.f, glm::vec2 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, const UvRect &uv_rect=UvRect::unit()) |
| Generates a heightmap representing a radial mountain range. | |
| Array | mountain_stump (glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float peak_kw=6.f, float rugosity=0.f, float angle=45.f, float k_smoothing=0.f, float gamma=0.25f, bool add_deposition=true, float ridge_amp=0.75f, float base_noise_amp=0.1f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a mountain-like heightmap with a flattened (stump-shaped) peak. | |
| Array | mountain_tibesti (glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float peak_kw=20.f, float rugosity=0.f, float angle=30.f, float angle_spread_ratio=0.25f, float gamma=1.f, bool add_deposition=true, float bulk_amp=1.f, float base_noise_amp=0.1f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a synthetic "Tibesti" mountain heightmap. | |
| Array | plates (glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float talus, int direction=0, float mix_ratio=0.9f, float bias=0.f, float base_noise_amp=0.05f, float kw_multiplier=2.f, int octaves=8, float rugosity=0.f, const UvRect &uv_rect=UvRect::unit()) |
| Generate a tectonic plate–like heightfield using Voronoi FBM and directional talus projection. | |
| Array | shattered_peak (glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float peak_kw=4.f, float rugosity=0.f, float angle=30.f, float gamma=1.f, bool add_deposition=true, float bulk_amp=0.3f, float base_noise_amp=0.1f, float bias=0.f, float k_smoothing=0.f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit()) |
| Generates a synthetic "shattered peak" terrain heightmap. | |
| Array | sdf_2d_polyline (const Path &path, glm::ivec2 shape, const UvRect &uv_rect=UvRect::unit(), 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, glm::ivec2 shape, const UvRect &uv_rect=UvRect::unit(), const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr) |
| See hmap::sdf_2d_polyline_bezier. | |
| Array | select_cavities (const Array &array, int ir, bool concave=true, bool normalize=false, ICommunicator &comm=SingleArrayComm::instance()) |
| See hmap::select_cavities. | |
| Array | select_soil_flow (const Array &z, int ir_gradient=1, float gradient_weight=1.f, float gradient_scaling_factor=0.f, float flow_weight=0.05f, float talus_ref=0.f, float clipping_ratio=50.f, float flow_gamma=1.f, float k_smooth=0.01f, bool normalize=false, ICommunicator &comm=SingleArrayComm::instance()) |
| Computes a soil–flow selection map based on terrain gradient, river mask, and smoothing parameters. | |
| Array | select_soil_rocks (const Array &z, int ir_max=64, int ir_min=0, int steps=4, float smaller_scales_weight=1.f, ClampMode curvature_clamp_mode=ClampMode::POSITIVE_ONLY, float curvature_clamping=1.f, bool normalize=false, ICommunicator &comm=SingleArrayComm::instance()) |
| Computes a multi-scale soil/rock selector using curvature analysis. | |
| Array | select_soil_weathered (const Array &z, int ir_curvature=0, int ir_gradient=4, ClampMode curvature_clamp_mode=ClampMode::POSITIVE_ONLY, float curvature_clamping=10.f, float curvature_weight=1.f, float gradient_weight=1.f, float gradient_scaling_factor=0.f, bool normalize=false, ICommunicator &comm=SingleArrayComm::instance()) |
| Computes a soil weathering selection map based on curvature and gradient analysis. | |
| Array | select_soil_weathered (const Array &z, const Array &gradient_norm, int ir_curvature, ClampMode curvature_clamp_mode, float curvature_clamping, float curvature_weight, float gradient_weight, float gradient_scaling_factor, bool normalize=false, ICommunicator &comm=SingleArrayComm::instance()) |
| Array | select_slope (const Array &z, int ir=0, bool normalize=false, MinMaxKernel kernel_type=MinMaxKernel::OCTAGON, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) |
| Selects terrain slope. | |
| Array | select_valley (const Array &z, int ir, bool ridge_select=false, bool normalize=false, ICommunicator &comm=SingleArrayComm::instance()) |
| See hmap::select_valley. | |
| void | fill_masked_holes (Array &z, const Array &mask, int iterations_max=500, float tolerance=1e-5f, float omega=0.f, float detail_amplitude=1.f, int patch_size=16, std::uint32_t seed=0, int sync_interval=1, const UvTile ®ion=UvTile::unit(), ICommunicator &comm=SingleArrayComm::instance()) |
| Fill masked holes in a heightmap by reconstructing the masked regions from the surrounding terrain using GPU biharmonic interpolation. | |
| Array | advection_particle (const Array &z, const Array &advected_field, int iterations, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| Performs particle-based advection on a scalar field. | |
| std::vector< Array > | advection_particle (const Array &z, const std::vector< const Array * > &advected_fields, int iterations, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::vector< Array > | advection_particle (const Array &z, const std::vector< Array > &advected_fields, int iterations, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Array | advection_particle (const Array &z, const Array &advected_field, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::vector< Array > | advection_particle (const Array &z, const std::vector< const Array * > &advected_fields, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::vector< Array > | advection_particle (const Array &z, const std::vector< Array > &advected_fields, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Array | advection_particle (const Array &dx, const Array &dy, const Array &advected_field, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::vector< Array > | advection_particle (const Array &dx, const Array &dy, const std::vector< const Array * > &advected_fields, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::vector< Array > | advection_particle (const Array &dx, const Array &dy, const std::vector< Array > &advected_fields, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Texture | advection_particle (const Array &z, const Texture &texture, int iterations, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Texture | advection_particle (const Array &z, const Texture &texture, int nparticles, std::uint32_t seed, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Array | advection_particle_multiscale (const Array &z, const Array &advected_field, std::uint32_t seed, const std::vector< int > &steps_per_level={4, 2, 1}, float particles_ratio=0.5f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, float mix=1.f, float warp=0.f, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| Performs multiscale particle-based advection on a scalar field. | |
| std::vector< Array > | advection_particle_multiscale (const Array &z, const std::vector< const Array * > &advected_fields, std::uint32_t seed, const std::vector< int > &steps_per_level={4, 2, 1}, float particles_ratio=0.5f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, float mix=1.f, float warp=0.f, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::vector< Array > | advection_particle_multiscale (const Array &z, const std::vector< Array > &advected_fields, std::uint32_t seed, const std::vector< int > &steps_per_level={4, 2, 1}, float particles_ratio=0.5f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, float mix=1.f, float warp=0.f, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Texture | advection_particle_multiscale (const Array &z, const Texture &texture, std::uint32_t seed, const std::vector< int > &steps_per_level={4, 2, 1}, float particles_ratio=0.5f, float advection_length=0.1f, float value_persistence=0.99f, float inertia=0.f, float mix=1.f, float warp=0.f, bool reverse=false, bool post_filter=true, float post_filter_sigma=0.125f, const Array *p_advection_mask=nullptr, const Array *p_mask=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| 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. | |
| float | helper_vflow_compute_adaptive_dt (const Array &h, float viscosity, float power) |
| glm::vec4 | helper_transform_bbox (const UvRect &uv_rect_source, const UvRect &uv_rect_target) |
| void | helper_bind_optional_buffers (clwrapper::Run &run, const Array *p_noise_x, const Array *p_noise_y) |
| float | helper_radial_profile (float r, float slope_start, float slope_end, float apex_elevation, float k_smooth, float radial_gain) |
| float | helper_apply_leeward (float h, float r, float hs, float slope_max, float k_smooth, float lee_amp, float alpha, float lee_alpha) |
| float | helper_apply_uplift (float h, float r, float slope_max, float uplift_amp, float k_smooth) |
| enum hmap::gpu::LocalMetrics : int |
Types of local metrics.
| 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
| Texture hmap::gpu::blend_poisson_bf | ( | const Texture & | texture1, |
| const Texture & | texture2, | ||
| const int | iterations = 500, | ||
| const Array * | p_mask = nullptr ) |
Blends two textures using Poisson blending with a brute-force solver.
This function performs Poisson blending between texture1 and texture2 channel by channel over a specified number of iterations. Optionally, a mask can be provided to control the blending regions.
| texture1 | The first input texture. |
| texture2 | The second input texture. |
| 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. |
| Array hmap::gpu::transfer | ( | const Array & | source, |
| const Array & | target, | ||
| int | ir, | ||
| float | amplitude, | ||
| bool | target_prefiltering = false ) |
See hmap::transfer.
| Array hmap::gpu::curvature_quadric | ( | const Array & | z, |
| int | ir, | ||
| CurvatureType | curvature_type, | ||
| bool | approx_algo = false ) |
| void hmap::gpu::hydraulic_musgrave | ( | Array & | z, |
| Array & | moisture_map, | ||
| int | iterations = 100, | ||
| float | c_capacity = 1.f, | ||
| float | c_erosion = 0.1f, | ||
| float | c_deposition = 0.1f, | ||
| float | water_level = 0.01f, | ||
| float | evap_rate = 0.01f ) |
Apply cell-based hydraulic erosion/deposition of Musgrave et al. (1989) on GPU.
Example
Result
| void hmap::gpu::hydraulic_musgrave | ( | Array & | z, |
| int | iterations = 100, | ||
| float | c_capacity = 1.f, | ||
| float | c_erosion = 0.1f, | ||
| float | c_deposition = 0.1f, | ||
| float | water_level = 0.01f, | ||
| float | evap_rate = 0.01f ) |
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::deposition_fill_holes | ( | Array & | z, |
| int | deposition_ir, | ||
| float | deposition_strength, | ||
| int | iterations = 1 ) |
Fill holes using Gaussian-based deposition.
Applies a smoothing/deposition pass that fills local depressions while preserving overall terrain shape through gradient-aware blending.
| z | Heightmap to modify (in-place). |
| deposition_ir | Influence radius of the Gaussian filter. |
| deposition_strength | Blending factor controlling deposition intensity. |
| iterations | Number of successive deposition passes. |
| void hmap::gpu::deposition_fill_holes | ( | Array & | z, |
| int | deposition_ir, | ||
| float | deposition_strength, | ||
| 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::hydraulic_particle | ( | Array & | z, |
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| const Array * | p_bedrock = nullptr, | ||
| const Array * | p_erodibility = nullptr, | ||
| const Array * | p_moisture_map = nullptr, | ||
| const Array * | p_elevation_shift = 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.01f, | ||
| float | c_gravity = 1.f, | ||
| float | drag_rate = 0.001f, | ||
| float | evap_rate = 0.001f, | ||
| float | talus_slope = 2.f, | ||
| float | collapse_rate = 0.1f, | ||
| int | iterations = 1 ) |
Simulates hydraulic erosion on a heightmap using particle-based flow.
Particles traverse the heightmap z, eroding and depositing material according to local slope, capacity, inertia, and optional directional bias.
| z | Heightmap array to modify. |
| nparticles | Number of erosion particles to simulate. |
| seed | Random seed for particle initialization. |
| p_bedrock | Optional bedrock array to limit erosion. |
| p_erodibility | Optional spatial erodibility multiplier array. |
| p_moisture_map | Optional moisture map affecting erosion/deposition. |
| p_elevation_shift | Optional elevation shift map. |
| p_erosion_map | Optional output array recording total erosion. |
| p_deposition_map | Optional output array recording deposition. |
| c_capacity | Sediment capacity of each particle. |
| c_erosion | Erosion rate coefficient. |
| c_deposition | Deposition rate coefficient. |
| c_inertia | Particle inertia factor. |
| c_gravity | Gravity effect on particle movement. |
| drag_rate | Particle velocity damping per step. |
| evap_rate | Sediment evaporation rate. |
| talus_slope | Talus slope angle. |
| collapse_rate | Collapse rate. |
| iterations | Number of multi-pass iterations. |
Example
Result
| void hmap::gpu::hydraulic_particle | ( | Array & | z, |
| const Array * | p_mask, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| const Array * | p_bedrock = nullptr, | ||
| const Array * | p_erodibility = nullptr, | ||
| const Array * | p_moisture_map = nullptr, | ||
| const Array * | p_elevation_shift = 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.01f, | ||
| float | c_gravity = 1.f, | ||
| float | drag_rate = 0.001f, | ||
| float | evap_rate = 0.001f, | ||
| float | talus_slope = 2.f, | ||
| float | collapse_rate = 0.1f, | ||
| int | iterations = 1 ) |
| void hmap::gpu::hydraulic_particle_multiscale | ( | Array & | z, |
| std::uint32_t | seed, | ||
| const std::vector< int > & | steps_per_level = {4, 2, 1}, | ||
| const Array * | p_bedrock = nullptr, | ||
| const Array * | p_erodibility = nullptr, | ||
| const Array * | p_moisture_map = nullptr, | ||
| const Array * | p_elevation_shift = nullptr, | ||
| Array * | p_erosion_map = nullptr, | ||
| Array * | p_deposition_map = nullptr, | ||
| float | particles_ratio = 0.5f, | ||
| float | c_capacity = 10.f, | ||
| float | c_erosion = 0.05f, | ||
| float | c_deposition = 0.05f, | ||
| float | c_inertia = 0.01f, | ||
| float | c_gravity = 1.f, | ||
| float | drag_rate = 0.001f, | ||
| float | evap_rate = 0.001f, | ||
| float | talus_slope = 2.f, | ||
| float | collapse_rate = 0.1f, | ||
| float | mix = 1.f, | ||
| float | warp = 0.35f ) |
Multiscale particle-based hydraulic erosion cascade.
Runs particle erosion over a geometric resolution ladder (coarsest first, up to z.shape). Coarse levels carve broad continental valleys and major river corridors, while fine levels carve detailed tributaries and gullies.
| z | Heightmap array to modify. |
| seed | Random seed. |
| steps_per_level | Number of iteration steps per level. |
| p_bedrock | Optional bedrock array. |
| p_erodibility | Optional spatial erodibility multiplier array. |
| p_moisture_map | Optional moisture map. |
| p_elevation_shift | Optional elevation shift map. |
| p_erosion_map | Optional output erosion map. |
| p_deposition_map | Optional output deposition map. |
| particles_ratio | Particles per level as a multiple of resolution. |
| c_capacity | Sediment capacity factor. |
| c_erosion | Erosion rate coefficient. |
| c_deposition | Deposition rate coefficient. |
| c_inertia | Inertia factor. |
| c_gravity | Gravity factor. |
| drag_rate | Velocity damping. |
| evap_rate | Evaporation rate. |
| talus_slope | Domain-normalized talus slope threshold. |
| collapse_rate | Bank collapse rate. |
| mix | Interpolation blend factor. |
| warp | Domain warp amplitude during upsampling. |
| void hmap::gpu::hydraulic_particle_multiscale | ( | Array & | z, |
| const Array * | p_mask, | ||
| std::uint32_t | seed, | ||
| const std::vector< int > & | steps_per_level = {4, 2, 1}, | ||
| const Array * | p_bedrock = nullptr, | ||
| const Array * | p_erodibility = nullptr, | ||
| const Array * | p_moisture_map = nullptr, | ||
| const Array * | p_elevation_shift = nullptr, | ||
| Array * | p_erosion_map = nullptr, | ||
| Array * | p_deposition_map = nullptr, | ||
| float | particles_ratio = 0.5f, | ||
| float | c_capacity = 10.f, | ||
| float | c_erosion = 0.05f, | ||
| float | c_deposition = 0.05f, | ||
| float | c_inertia = 0.01f, | ||
| float | c_gravity = 1.f, | ||
| float | drag_rate = 0.001f, | ||
| float | evap_rate = 0.001f, | ||
| float | talus_slope = 2.f, | ||
| float | collapse_rate = 0.1f, | ||
| float | mix = 1.f, | ||
| float | warp = 0.35f ) |
| void hmap::gpu::hydraulic_mcdonald | ( | Array & | z, |
| int | steps, | ||
| std::uint32_t | seed, | ||
| const McDonaldParams & | params, | ||
| const Array * | p_moisture_map = nullptr, | ||
| Array * | p_sediment_map = nullptr, | ||
| Array * | p_discharge_map = nullptr ) |
Particle-based hydraulic erosion with flow-field coupling (McDonald's model).
| z | Input/output heightmap. |
| steps | Number of erosion iterations. |
| seed | Random seed number. |
| params | Parameters structure. |
| p_moisture_map | Optional moisture map. |
| p_sediment_map | Optional output: final sediment layer. |
| p_discharge_map | Optional output: water discharge field. |
Example
Result
| void hmap::gpu::hydraulic_mcdonald | ( | Array & | z, |
| int | steps, | ||
| std::uint32_t | seed, | ||
| const Array * | p_moisture_map = nullptr, | ||
| Array * | p_sediment_map = nullptr, | ||
| Array * | p_discharge_map = nullptr, | ||
| float | world_extent_km = 40.f, | ||
| float | z_scale_km = 4.f, | ||
| int | samples = 8192, | ||
| int | maxage = 512, | ||
| float | lrate = 0.2f, | ||
| float | time_step = 10.f, | ||
| float | rainfall = 1.f, | ||
| float | evap_rate = 1e-4f, | ||
| float | gravity = 9.81f, | ||
| float | viscosity = 0.025f, | ||
| float | bed_shear = 0.01f, | ||
| float | crit_slope = 0.57f, | ||
| float | settle_rate = 0.1f, | ||
| float | thermal_rate = 2.5e-3f, | ||
| float | deposition_rate = 5e-3f, | ||
| float | suspension_rate = 2.5e-4f, | ||
| float | exit_slope = 0.01f ) |
| void hmap::gpu::hydraulic_mcdonald_multiscale | ( | Array & | z, |
| std::uint32_t | seed, | ||
| const std::vector< int > & | steps_per_level, | ||
| const McDonaldParams & | params, | ||
| const Array * | p_moisture_map = nullptr, | ||
| Array * | p_sediment_map = nullptr, | ||
| Array * | p_discharge_map = nullptr ) |
Multiscale driver for hydraulic_mcdonald.
Example
Result
| void hmap::gpu::hydraulic_mcdonald_multiscale | ( | Array & | z, |
| std::uint32_t | seed, | ||
| const std::vector< int > & | steps_per_level = {512, 256, 128}, | ||
| const Array * | p_moisture_map = nullptr, | ||
| Array * | p_sediment_map = nullptr, | ||
| Array * | p_discharge_map = nullptr, | ||
| float | world_extent_km = 40.f, | ||
| float | z_scale_km = 4.f, | ||
| int | samples = 8192, | ||
| int | maxage = 512, | ||
| float | lrate = 0.2f, | ||
| float | time_step = 10.f, | ||
| float | rainfall = 1.f, | ||
| float | evap_rate = 1e-4f, | ||
| float | gravity = 9.81f, | ||
| float | viscosity = 0.025f, | ||
| float | bed_shear = 0.01f, | ||
| float | crit_slope = 0.57f, | ||
| float | settle_rate = 0.1f, | ||
| float | thermal_rate = 2.5e-3f, | ||
| float | deposition_rate = 5e-3f, | ||
| float | suspension_rate = 2.5e-4f, | ||
| float | exit_slope = 0.01f ) |
| void hmap::gpu::hydraulic_procedural | ( | Array & | z, |
| float | kp_global, | ||
| float | c_erosion, | ||
| std::uint32_t | seed, | ||
| ErosionProfile | erosion_profile = ErosionProfile::EP_TRIANGLE_GRENIER, | ||
| float | erosion_profile_parameter = 0.01f, | ||
| float | angle_shift = 0.f, | ||
| float | phase_smoothing = 0.1f, | ||
| float | talus_ref = 0.001f, | ||
| float | gradient_scaling_ratio = 1.f, | ||
| float | gradient_power = 0.8f, | ||
| bool | exclude_ridges = true, | ||
| bool | apply_deposition = false, | ||
| float | deposition_strength = 1.f, | ||
| bool | enable_default_noise = true, | ||
| float | noise_amp = 0.01f, | ||
| const Array * | p_kp_multiplier = nullptr, | ||
| const Array * | p_angle_shift = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| Array * | p_ridge_mask = nullptr, | ||
| const UvRect & | uv_rect = UvRect{} ) |
Apply phase-guided hydraulic procedural erosion to a heightmap.
Example
Result
| void hmap::gpu::hydraulic_procedural_fbm | ( | Array & | z, |
| float | kp_global, | ||
| float | c_erosion, | ||
| std::uint32_t | seed, | ||
| ErosionProfile | erosion_profile = ErosionProfile::EP_TRIANGLE_GRENIER, | ||
| int | octaves = 3, | ||
| float | persistence = 0.5f, | ||
| float | lacunarity = 2.f, | ||
| float | erosion_profile_parameter = 0.01f, | ||
| float | angle_shift = 0.f, | ||
| float | phase_smoothing = 0.1f, | ||
| float | talus_ref = 0.001f, | ||
| float | gradient_scaling_ratio = 1.f, | ||
| float | gradient_power = 0.8f, | ||
| bool | exclude_ridges = true, | ||
| bool | apply_deposition = false, | ||
| float | deposition_strength = 1.f, | ||
| bool | enable_default_noise = true, | ||
| float | noise_amp = 0.01f, | ||
| const Array * | p_kp_multiplier = nullptr, | ||
| const Array * | p_angle_shift = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| Array * | p_ridge_mask = nullptr, | ||
| const UvRect & | uv_rect = UvRect{} ) |
Multi-octave (fBm) variant of hydraulic_procedural().
Example
Result
| void hmap::gpu::hydraulic_procedural_fbm | ( | Array & | z, |
| float | kp_global, | ||
| float | c_erosion, | ||
| std::uint32_t | seed, | ||
| const Array * | p_mask, | ||
| ErosionProfile | erosion_profile = ErosionProfile::EP_TRIANGLE_GRENIER, | ||
| int | octaves = 3, | ||
| float | persistence = 0.5f, | ||
| float | lacunarity = 2.f, | ||
| float | erosion_profile_parameter = 0.01f, | ||
| float | angle_shift = 0.f, | ||
| float | phase_smoothing = 0.1f, | ||
| float | talus_ref = 0.001f, | ||
| float | gradient_scaling_ratio = 1.f, | ||
| float | gradient_power = 0.8f, | ||
| bool | exclude_ridges = true, | ||
| bool | apply_deposition = false, | ||
| float | deposition_strength = 1.f, | ||
| bool | enable_default_noise = true, | ||
| float | noise_amp = 0.01f, | ||
| const Array * | p_kp_multiplier = nullptr, | ||
| const Array * | p_angle_shift = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| Array * | p_ridge_mask = nullptr, | ||
| const UvRect & | uv_rect = UvRect{} ) |
| 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 Schott method.
Example
Result
| void hmap::gpu::hydraulic_schott | ( | Array & | z, |
| const Array * | p_mask, | ||
| 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 ) |
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, | ||
| const Array * | p_bedrock = nullptr, | ||
| const Array * | p_erodibility = nullptr, | ||
| const 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, | ||
| const 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, | ||
| const Array * | p_bedrock = nullptr, | ||
| const Array * | p_erodibility = nullptr, | ||
| const 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::hydraulic_stream_log_multiscale | ( | Array & | z, |
| float | c_erosion, | ||
| float | talus_ref, | ||
| int | levels = 3, | ||
| 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, | ||
| const Array * | p_bedrock = nullptr, | ||
| const Array * | p_erodibility = nullptr, | ||
| const Array * | p_moisture_map = nullptr, | ||
| Array * | p_erosion_map = nullptr, | ||
| Array * | p_deposition_map = nullptr, | ||
| Array * | p_flow_map = nullptr, | ||
| float | mix = 1.f, | ||
| float | warp = 0.35f, | ||
| std::uint32_t | seed = 1 ) |
| void hmap::gpu::hydraulic_stream_log_multiscale | ( | Array & | z, |
| float | c_erosion, | ||
| float | talus_ref, | ||
| const Array * | p_mask, | ||
| int | levels = 3, | ||
| 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, | ||
| const Array * | p_bedrock = nullptr, | ||
| const Array * | p_erodibility = nullptr, | ||
| const Array * | p_moisture_map = nullptr, | ||
| Array * | p_erosion_map = nullptr, | ||
| Array * | p_deposition_map = nullptr, | ||
| Array * | p_flow_map = nullptr, | ||
| float | mix = 1.f, | ||
| float | warp = 0.35f, | ||
| std::uint32_t | seed = 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::hydraulic_vpipes | ( | Array & | z, |
| float | water_height = 1e-2f, | ||
| bool | maintain_water_volume = true, | ||
| float | evap_rate = 0.1f, | ||
| int | iterations = 50, | ||
| float | dt = 0.5f, | ||
| float | k_capacity = 0.5f, | ||
| float | k_erode = 0.001f, | ||
| float | k_depose = 0.01f, | ||
| float | k_discharge_exp = 1.f, | ||
| float | downcutting_max_depth_ratio = 10.f, | ||
| bool | flux_diffusion = true, | ||
| float | flux_diffusion_strength = 0.01f, | ||
| Array * | p_rain_map = nullptr, | ||
| Array * | p_water_depth = nullptr, | ||
| Array * | p_sediment = nullptr, | ||
| Array * | p_vel_u = nullptr, | ||
| Array * | p_vel_v = nullptr ) |
| void hmap::gpu::mudslide | ( | Array & | z, |
| const Array & | landslide_mask, | ||
| float | depth, | ||
| int | iterations, | ||
| float | depth_map_exponent = 0.5f, | ||
| float | viscosity_law_power = 1.5f, | ||
| Array * | p_depth_end = nullptr, | ||
| Array * | p_depth_init = nullptr ) |
Simulate a mudslide (landslide-driven material redistribution) on a height field.
| [in,out] | z | Input/output height field modified in place. |
| [in] | landslide_mask | Mask defining affected areas (non-zero = active). |
| [in] | depth | Maximum erosion/deposition depth. |
| [in] | iterations | Number of simulation iterations. |
| [in] | depth_map_exponent | Exponent applied to depth influence (default 0.5f). |
| [in] | viscosity_law_power | Power exponent controlling viscosity response (default 1.5f). |
| [out] | p_depth_end | Optional pointer to store resulting depth map. |
| [out] | p_depth_init | Optional pointer to store initial depth map. |
Example
Result
| void hmap::gpu::mudslide | ( | Array & | z, |
| float | talus_limit, | ||
| float | depth, | ||
| int | iterations, | ||
| float | depth_map_exponent = 0.5f, | ||
| float | viscosity_law_power = 1.5f, | ||
| Array * | p_depth_end = nullptr, | ||
| Array * | p_depth_init = nullptr ) |
See hmap::gpu::mudslide.
| void hmap::gpu::rifts | ( | Array & | z, |
| const glm::vec2 & | kw, | ||
| float | angle, | ||
| float | amplitude, | ||
| std::uint32_t | seed, | ||
| float | elevation_noise_shift = 0.f, | ||
| float | k_smooth_bottom = 0.05f, | ||
| float | k_smooth_top = 0.05f, | ||
| float | radial_spread_amp = 0.2f, | ||
| float | elevation_noise_amp = 0.1f, | ||
| float | clamp_vmin = 0.f, | ||
| float | remap_vmin = 0.f, | ||
| bool | apply_mask = true, | ||
| bool | reverse_mask = false, | ||
| float | mask_gamma = 1.f, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const Array * | p_mask = nullptr, | ||
| const glm::vec2 & | center = {0.5f, 0.5f}, | ||
| const UvRect & | uv_rect = {0.f, 1.f, 0.f, 1.f} ) |
Applies a "rift" deformation effect to a heightmap array.
| z | Reference to the heightmap array to be modified in-place. |
| kw | Frequency vector (kx, ky) scaling deformation. |
| angle | Orientation of rift in degrees. |
| amplitude | Strength of rift deformation. |
| seed | Random seed. |
| elevation_noise_shift | Vertical offset applied to base noise. |
| k_smooth_bottom | Lower smoothing factor for Voronoi noise. |
| k_smooth_top | Upper smoothing factor for Voronoi noise. |
| radial_spread_amp | Amplitude controlling radial spreading. |
| elevation_noise_amp | Amplitude scaling elevation influence. |
| clamp_vmin | Minimum clamp value. |
| remap_vmin | Minimum remap value. |
| apply_mask | If true, applies power-based blending mask. |
| reverse_mask | Reverse mask blending. |
| mask_gamma | Gamma exponent for blending mask. |
| p_noise_x | Optional X noise array. |
| p_noise_y | Optional Y noise array. |
| p_mask | Optional mask array. |
| center | 2D center point. |
| bbox | Bounding box (xmin, xmax, ymin, ymax). |
Example
Result
| void hmap::gpu::sediment_deposition | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| Array * | p_deposition_map = nullptr, | ||
| float | max_deposition = 0.01, | ||
| int | iterations = 5, | ||
| int | thermal_subiterations = 10 ) |
Perform sediment deposition combined with thermal erosion.
| z | Input array. |
| p_mask | Intensity mask, expected in [0, 1]. |
| talus | Talus limit. |
| p_deposition_map | Reference to deposition map output. |
| max_deposition | Maximum height of sediment deposition. |
| iterations | Number of iterations. |
| thermal_subiterations | Number of thermal erosion iterations per pass. |
Example
Result
| void hmap::gpu::sediment_deposition | ( | Array & | z, |
| const Array & | talus, | ||
| Array * | p_deposition_map = nullptr, | ||
| float | max_deposition = 0.01, | ||
| int | iterations = 5, | ||
| int | thermal_subiterations = 10 ) |
| void hmap::gpu::sediment_layer | ( | Array & | z, |
| const Array & | talus_layer, | ||
| const Array & | talus_upper_limit, | ||
| int | iterations, | ||
| bool | apply_post_filter = true, | ||
| Array * | p_deposition_map = nullptr ) |
Applies a talus-based sediment deposition layer.
| [in,out] | z | Heightmap to modify. |
| [in] | talus_layer | Base talus values for erosion. |
| [in] | talus_upper_limit | Upper talus threshold used for masking. |
| [in] | iterations | Number of erosion iterations. |
| [in] | apply_post_filter | Enable post smoothing and blending. |
| [out] | p_deposition_map | Optional output deposition map. |
Example
Result
| void hmap::gpu::strata | ( | Array & | z, |
| float | angle, | ||
| float | slope, | ||
| float | gamma, | ||
| std::uint32_t | seed, | ||
| bool | linear_gamma = true, | ||
| float | kz = 1.f, | ||
| int | octaves = 4, | ||
| float | lacunarity = 2.f, | ||
| float | gamma_noise_ratio = 0.5f, | ||
| float | noise_amp = 0.4f, | ||
| const glm::vec2 & | noise_kw = {4.f, 4.f}, | ||
| bool | enable_ridge_noise = true, | ||
| const glm::vec2 & | ridge_noise_kw = {4.f, 1.2f}, | ||
| float | ridge_angle_shift = 45.f, | ||
| float | ridge_noise_amp = 0.5f, | ||
| float | ridge_clamp_vmin = 0.f, | ||
| float | ridge_remap_vmin = 0.f, | ||
| bool | apply_elevation_mask = true, | ||
| bool | apply_ridge_mask = true, | ||
| float | mask_gamma = 0.4f, | ||
| const Array * | p_mask = nullptr, | ||
| const UvRect & | uv_rect = {0.f, 1.f, 0.f, 1.f} ) |
Applies stratification to a heightfield using directional noise and multiscale gamma transformations.
| z | Reference to heightfield array, MUST BE NORMALIZED in [0, 1]. |
| angle | Horizontal orientation of strata in degrees. |
| slope | Vertical slope of strata. |
| gamma | Gamma exponent for non-linear remapping. |
| seed | Seed for deterministic noise generation. |
| linear_gamma | Linear or smooth gamma mapping. |
| kz | Base scaling factor for frequency. |
| octaves | Number of iterative passes. |
| lacunarity | Frequency multiplier per octave. |
| gamma_noise_ratio | Noise influence ratio on gamma. |
| noise_amp | Amplitude of base Perlin noise. |
| noise_kw | Frequency vector for Perlin noise. |
| enable_ridge_noise | Enable Voronoi ridge noise. |
| ridge_noise_kw | Frequency vector for ridge noise. |
| ridge_angle_shift | Angular shift for ridge direction. |
| ridge_noise_amp | Amplitude of ridge noise. |
| ridge_clamp_vmin | Minimum clamp value for ridge noise. |
| ridge_remap_vmin | Minimum remap value for ridge noise. |
| apply_elevation_mask | Apply elevation mask. |
| apply_ridge_mask | Apply ridge mask. |
| mask_gamma | Mask gamma exponent. |
| p_mask | Optional filter mask. |
| bbox | Domain bounding box. |
Example
Result
| void hmap::gpu::strata_cells | ( | Array & | z, |
| glm::vec2 | kw, | ||
| float | amp, | ||
| std::uint32_t | seed, | ||
| float | gamma = 0.5f, | ||
| float | gamma_lateral = 0.4f, | ||
| float | angle = 0.f, | ||
| float | noise_amp = 0.5f, | ||
| bool | absolute_displacement = true, | ||
| float | occurence_probability = 0.5f, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Applies procedural stratified cell displacement to a heightmap.
Example
Result
| void hmap::gpu::strata_cells | ( | Array & | z, |
| glm::vec2 | kw, | ||
| float | amp, | ||
| std::uint32_t | seed, | ||
| const Array * | p_mask, | ||
| float | gamma = 0.5f, | ||
| float | gamma_lateral = 0.4f, | ||
| float | angle = 0.f, | ||
| float | noise_amp = 0.5f, | ||
| bool | absolute_displacement = true, | ||
| float | occurence_probability = 0.5f, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| void hmap::gpu::strata_cells_fbm | ( | Array & | z, |
| glm::vec2 | kw, | ||
| float | amp, | ||
| std::uint32_t | seed, | ||
| float | gamma = 0.5f, | ||
| float | gamma_lateral = 0.4f, | ||
| float | angle = 0.f, | ||
| bool | enable_default_noise = true, | ||
| float | default_noise_amp = 0.05f, | ||
| bool | absolute_displacement = true, | ||
| float | occurence_probability = 0.5f, | ||
| int | octaves = 8, | ||
| float | persistence = 0.4f, | ||
| float | lacunarity = 2.2f, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Applies multi-octave (fBm) stratified cell displacement.
Example
Result
| void hmap::gpu::strata_cells_fbm | ( | Array & | z, |
| glm::vec2 | kw, | ||
| float | amp, | ||
| std::uint32_t | seed, | ||
| const Array * | p_mask, | ||
| float | gamma = 0.5f, | ||
| float | gamma_lateral = 0.4f, | ||
| float | angle = 0.f, | ||
| bool | enable_default_noise = true, | ||
| float | default_noise_amp = 0.05f, | ||
| bool | absolute_displacement = true, | ||
| float | occurence_probability = 0.5f, | ||
| int | octaves = 8, | ||
| float | persistence = 0.4f, | ||
| float | lacunarity = 2.2f, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| void hmap::gpu::strata_plates | ( | Array & | z, |
| const Array & | talus, | ||
| int | direction_offset = 0, | ||
| int | direction_count = 3, | ||
| bool | random_directions = false, | ||
| std::uint32_t | seed = 0, | ||
| float | vmin = -FLT_MAX, | ||
| float | skew = 0.f, | ||
| float | mix_ratio = 0.9f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_dx = nullptr, | ||
| const Array * | p_dy = nullptr ) |
Apply stratified talus projection along multiple directions.
Example
Result
| void hmap::gpu::strata_terrace | ( | Array & | z, |
| float | gamma, | ||
| std::uint32_t | seed, | ||
| float | kz = 4.f, | ||
| bool | linear_gamma = true, | ||
| float | gamma_noise_ratio = 0.5f, | ||
| float | slope = 0.f, | ||
| float | angle = 0.f, | ||
| const Array * | p_noise = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Applies a terrace (stratification) filter to a heightmap.
Example
Result
| void hmap::gpu::strata_terrace | ( | Array & | z, |
| float | gamma, | ||
| std::uint32_t | seed, | ||
| const Array * | p_mask, | ||
| float | kz = 4.f, | ||
| bool | linear_gamma = true, | ||
| float | gamma_noise_ratio = 0.5f, | ||
| float | slope = 0.f, | ||
| float | angle = 0.f, | ||
| const Array * | p_noise = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| void hmap::gpu::valley_fill | ( | Array & | z, |
| const Array & | talus, | ||
| int | iterations = 100, | ||
| float | gamma = 2.f, | ||
| float | ratio = 0.8f, | ||
| float | zmin = 0.f, | ||
| float | zmax = 0.f, | ||
| float | elevation_max_ratio = 1.f, | ||
| bool | preserve_elevation_range = true, | ||
| const Array * | p_noise = nullptr, | ||
| Array * | p_deposition_map = nullptr ) |
Fill valleys using thermal scree deposition and height-based blending.
Example
Result
| void hmap::gpu::valley_fill | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| int | iterations = 100, | ||
| float | gamma = 2.f, | ||
| float | ratio = 0.8f, | ||
| float | zmin = 0.f, | ||
| float | zmax = 0.f, | ||
| float | elevation_max_ratio = 1.f, | ||
| bool | preserve_elevation_range = true, | ||
| const Array * | p_noise = nullptr, | ||
| Array * | p_deposition_map = nullptr ) |
| Array hmap::gpu::watershed_ridge | ( | const Array & | z, |
| float | amplitude = 0.2f, | ||
| float | width = 32.f, | ||
| float | edt_exponent = 0.5f, | ||
| int | prefilter_ir = 0, | ||
| bool | fast_approx = false, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const Array * | p_scaling = nullptr ) |
Carves watershed ridges using basin-wise distance transforms.
Example
Result
| Array hmap::gpu::watershed_ridge | ( | const Array & | z, |
| const Array * | p_mask, | ||
| float | amplitude = 0.2f, | ||
| float | width = 32.f, | ||
| float | edt_exponent = 0.5f, | ||
| int | prefilter_ir = 0, | ||
| bool | fast_approx = false, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const Array * | p_scaling = nullptr ) |
| void hmap::gpu::thermal | ( | Array & | z, |
| const Array & | talus, | ||
| int | iterations = 10, | ||
| const Array * | p_bedrock = nullptr, | ||
| Array * | p_deposition_map = nullptr ) |
Apply thermal weathering erosion.
Based on https://www.shadertoy.com/view/XtKSWh
| z | Input array. |
| p_mask | Filter mask, expected in [0, 1]. |
| talus | Talus limit. |
| p_bedrock | Lower elevation 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 | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| int | iterations = 10, | ||
| const Array * | p_bedrock = nullptr, | ||
| 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 | ( | Array & | z, |
| float | talus, | ||
| int | iterations = 10, | ||
| const Array * | p_bedrock = nullptr, | ||
| 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_auto_bedrock | ( | Array & | z, |
| const Array & | talus, | ||
| int | iterations = 10, | ||
| Array * | p_deposition_map = nullptr ) |
Apply thermal weathering erosion with automatic determination of the bedrock.
| z | Input array. |
| talus | Local talus limit. |
| iterations | Number of iterations. |
| p_deposition_map | [out] Reference to the deposition map, provided as an output field. |
Example
Result
| void hmap::gpu::thermal_auto_bedrock | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| int | iterations = 10, | ||
| Array * | p_deposition_map = nullptr ) |
| void hmap::gpu::thermal_auto_bedrock | ( | Array & | z, |
| float | 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_conserve | ( | Array & | z, |
| const Array & | talus, | ||
| int | iterations = 10, | ||
| float | rate = 0.5f, | ||
| const Array * | p_bedrock = nullptr, | ||
| Array * | p_deposition_map = nullptr ) |
Apply mass-preserving thermal weathering erosion.
| z | Input array. |
| talus | Talus limit. |
| iterations | Number of iterations. |
| rate | Erosion rate factor. |
| p_bedrock | Lower elevation limit. |
| p_deposition_map | [out] Reference to the deposition map, provided as an output field. |
| void hmap::gpu::thermal_conserve | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| int | iterations = 10, | ||
| float | rate = 0.5f, | ||
| const Array * | p_bedrock = nullptr, | ||
| 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_conserve | ( | Array & | z, |
| float | talus, | ||
| int | iterations = 10, | ||
| float | rate = 0.5f, | ||
| const Array * | p_bedrock = nullptr, | ||
| 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_flatten | ( | Array & | z, |
| const Array & | talus, | ||
| int | iterations, | ||
| float | sigma_inf = 0.5f, | ||
| float | sigma_sup = 0.f ) |
Apply iterative thermal flattening erosion on a heightmap.
| [in,out] | z | Heightmap modified in-place. |
| [in] | talus | Per-cell talus threshold. |
| [in] | iterations | Number of iterations. |
| [in] | sigma_inf | Relaxation factor for slopes below talus. |
| [in] | sigma_sup | Relaxation factor for slopes above talus. |
| void hmap::gpu::thermal_flatten | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| int | iterations, | ||
| float | sigma_inf = 0.5f, | ||
| float | sigma_sup = 0.f ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Apply thermal weathering erosion (Olsen model).
| z | Input array. |
| talus | Talus limit. |
| iterations | Number of iterations. |
| void hmap::gpu::thermal_olsen | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| int | iterations ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Apply thermal weathering erosion to give a scree like effect.
| z | Input array. |
| talus | Talus limit. |
| 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.
| void hmap::gpu::thermal_rib | ( | Array & | z, |
| int | iterations ) |
Apply thermal erosion using a 'rib' algorithm.
| z | Input heightmap. |
| iterations | Number of iterations. |
Example
Result
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_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. |
| iterations | Number of iterations. |
| p_deposition_map | Optional deposition map output. |
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_schott | ( | Array & | z, |
| const Array & | talus, | ||
| int | iterations = 10, | ||
| float | intensity = 0.2f, | ||
| Array * | p_deposition_map = nullptr ) |
Applies the thermal erosion process with a uniform slope threshold (Schott model).
| z | Reference to elevation array. |
| talus | Constant threshold slope value or talus array. |
| iterations | Number of erosion iterations to apply. |
| intensity | Intensity factor controlling amount of change. |
| p_deposition_map | Optional deposition map output. |
Example
Result
| void hmap::gpu::thermal_schott | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| int | iterations = 10, | ||
| float | intensity = 0.2f, | ||
| 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, | ||
| Array * | p_deposition_map = nullptr ) |
Performs thermal scree erosion on a heightmap.
| [out] | z | The heightmap modified in-place. |
| [in] | talus | Threshold slope angles. |
| [in] | zmax | Maximum allowed elevation. |
| [in] | iterations | Number of iterations. |
| [out] | p_deposition_map | Optional deposition map output. |
| void hmap::gpu::thermal_scree | ( | Array & | z, |
| const Array * | p_mask, | ||
| const Array & | talus, | ||
| const Array & | zmax, | ||
| 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.
| Array hmap::gpu::bilateral_filter | ( | const Array & | array, |
| const Array & | kernel2d, | ||
| const Array & | kernel1d, | ||
| float | kernel1d_value_scaling ) |
Apply a bilateral filter to an array.
This function performs edge-preserving smoothing by combining a spatial kernel (2D) and a value-domain kernel (1D). The spatial kernel controls the influence of neighboring samples based on their position, while the value kernel weights samples according to their value difference.
| array | Input array to be filtered. |
| kernel2d | 2D spatial kernel defining neighborhood weights. |
| kernel1d | 1D kernel applied in the value domain. |
| kernel1d_value_scaling | Scaling factor applied to value differences before sampling the 1D kernel. |
Example
Result
Apply a bilateral filter to an array using a radius-based Gaussian kernel.
This overload builds the spatial kernel implicitly from the given radius. The value-domain kernel behavior is controlled by the same scaling factor as the main overload.
| array | Input array to be filtered. |
| ir | Radius of the spatial neighborhood. |
| kernel1d_value_scaling | Scaling factor applied to value differences before computing value-domain weights. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Example
Result
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::directional_blur | ( | Array & | array, |
| float | radius, | ||
| const Array & | angle, | ||
| int | steps = 32 ) |
Applies a directional blur to the input array.
Blurs values along a direction specified per element by the angle array, using a given radius and number of sampling steps.
| array | Input array to be blurred (modified in place). |
| radius | Blur radius. |
| angle | Array of angles (in radians) defining blur direction per element. |
| steps | Number of samples along the blur direction (default: 32). |
Example
Result
| void hmap::gpu::directional_blur | ( | Array & | array, |
| float | radius, | ||
| const Array & | angle, | ||
| const Array * | p_mask, | ||
| int | steps = 32 ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::distance_shaper | ( | const Array & | array, |
| float | falloff = 0.05f, | ||
| int | directions = 8, | ||
| float | skew = 0.f, | ||
| float | angle = 0.f, | ||
| hmap::DistanceMode | mode = DistanceMode::PYRAMID, | ||
| hmap::DistanceMethod | method = DistanceMethod::RT, | ||
| float | angular_jitter = 0.f, | ||
| float | falloff_jitter = 0.f, | ||
| float | threshold = 0.f, | ||
| bool | invert_input = false, | ||
| bool | invert_output = false, | ||
| float | mix_ratio = 1.f, | ||
| std::uint32_t | seed = 0, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_dx = nullptr, | ||
| const Array * | p_dy = nullptr ) |
| 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, | ||
| float | k = 0.1f, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| void hmap::gpu::gamma_correction_local | ( | Array & | array, |
| float | gamma, | ||
| int | ir, | ||
| const Array * | p_mask, | ||
| float | k = 0.1f, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::jagged | ( | const Array & | array, |
| glm::vec2 | kw, | ||
| float | amp = 0.1f, | ||
| std::uint32_t | seed = 0, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | gamma = 1.f, | ||
| float | angle = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a Voronoi-based jagged bubble dome filter to an array.
For each Voronoi cell, computes a smooth dome profile vanishing at cell boundaries and peaking at the cell center, added to the input elevation:
\[\tau = \frac{d_{\text{edge}}}{d_{\text{center}} + d_{\text{edge}}} \]
\[Z_{\text{out}}(x) = Z(x) + \text{amp} \cdot \left( \sin\left(\frac{\pi}{2} \tau\right) \right)^\gamma \]
| array | Input array to be filtered. |
| kw | Frequency / wave numbers for Voronoi cells. |
| amp | Amplitude of the bubble dome elevation (default: 0.1f). |
| seed | Seed for random jitter of Voronoi cell centers. |
| jitter | Jitter amount controlling cell randomness (default: {0.5f, 0.5f}). |
| gamma | Shape exponent for the dome curvature (default: 1.0f). |
| angle | Orientation angle in degrees for rotating the Voronoi pattern around (0, 0) (default: 0.0f). |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
Example
Result
| Array hmap::gpu::jagged | ( | const Array & | array, |
| float | kw, | ||
| float | amp = 0.1f, | ||
| std::uint32_t | seed = 0, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | gamma = 1.f, | ||
| float | angle = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a Voronoi-based jagged bubble dome filter using an isotropic frequency.
| array | Input array to be filtered. |
| kw | Isotropic frequency / wave number for Voronoi cells. |
| amp | Amplitude of the bubble dome elevation (default: 0.1f). |
| seed | Seed for random jitter of Voronoi cell centers. |
| jitter | Jitter amount controlling cell randomness (default: {0.5f, 0.5f}). |
| gamma | Shape exponent for the dome curvature (default: 1.0f). |
| angle | Orientation angle in degrees for rotating the Voronoi pattern around (0, 0) (default: 0.0f). |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::jagged_fbm | ( | const Array & | array, |
| glm::vec2 | kw, | ||
| float | amp = 0.1f, | ||
| std::uint32_t | seed = 0, | ||
| int | octaves = 8, | ||
| float | persistence = 0.5f, | ||
| float | lacunarity = 2.f, | ||
| bool | switch_kx_ky = false, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | gamma = 1.f, | ||
| float | angle = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a fractal Brownian motion (fBm) version of the Voronoi-based jagged bubble dome filter to an array.
Applies sequential jagged filters across multiple octaves, scaling the frequency by lacunarity and the amplitude by persistence at each iteration.
| array | Input array to be filtered. |
| kw | Frequency / wave numbers for Voronoi cells. |
| amp | Initial amplitude of the bubble dome elevation (default: 0.1f). |
| seed | Seed for random jitter of Voronoi cell centers. |
| octaves | Number of fBm octaves (default: 8). |
| persistence | Amplitude multiplier per octave (default: 0.5f). |
| lacunarity | Frequency multiplier per octave (default: 2.0f). |
| switch_kx_ky | If true, swaps kx and ky at each octave (default: false). |
| jitter | Jitter amount controlling cell randomness (default: {0.5f, 0.5f}). |
| gamma | Shape exponent for the dome curvature (default: 1.0f). |
| angle | Orientation angle in degrees for rotating the Voronoi pattern around (0, 0) (default: 0.0f). |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
Example
Result
| Array hmap::gpu::jagged_fbm | ( | const Array & | array, |
| float | kw, | ||
| float | amp = 0.1f, | ||
| std::uint32_t | seed = 0, | ||
| int | octaves = 8, | ||
| float | persistence = 0.5f, | ||
| float | lacunarity = 2.f, | ||
| bool | switch_kx_ky = false, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | gamma = 1.f, | ||
| float | angle = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a fractal Brownian motion (fBm) version of the Voronoi-based jagged bubble dome filter using an isotropic frequency.
| array | Input array to be filtered. |
| kw | Isotropic frequency / wave number for Voronoi cells. |
| amp | Initial amplitude of the bubble dome elevation (default: 0.1f). |
| seed | Seed for random jitter of Voronoi cell centers. |
| octaves | Number of fBm octaves (default: 8). |
| persistence | Amplitude multiplier per octave (default: 0.5f). |
| lacunarity | Frequency multiplier per octave (default: 2.0f). |
| switch_kx_ky | If true, swaps kx and ky at each octave (default: false). |
| jitter | Jitter amount controlling cell randomness (default: {0.5f, 0.5f}). |
| gamma | Shape exponent for the dome curvature (default: 1.0f). |
| angle | Orientation angle in degrees for rotating the Voronoi pattern around (0, 0) (default: 0.0f). |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
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.
| 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.
| Array hmap::gpu::median_pseudo | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::median_pseudo.
| 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.
| void hmap::gpu::plateau | ( | Array & | array, |
| const Array * | p_mask, | ||
| int | ir, | ||
| float | factor, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::plateau.
| void hmap::gpu::plateau | ( | Array & | array, |
| int | ir, | ||
| float | factor, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::project_talus_along_direction | ( | const Array & | array, |
| const Array & | talus, | ||
| int | direction = 0, | ||
| float | vmin = -FLT_MAX ) |
Projects array values along a given direction using talus attenuation.
Applies a directional propagation (D8 convention) where values decay with distance according to a talus coefficient. The computation is performed on the GPU using an OpenCL kernel.
| array | Input 2D array. |
| talus | Talus coefficient controlling distance-based attenuation. |
| direction | Propagation direction (D8 convention, range [0–7]). |
Example
Result
| Array hmap::gpu::project_talus_along_direction | ( | const Array & | array, |
| const Array & | talus, | ||
| const Array * | p_mask, | ||
| int | direction = 0, | ||
| float | vmin = -FLT_MAX ) |
| void hmap::gpu::recast_cliff | ( | Array & | array, |
| float | talus, | ||
| int | ir, | ||
| float | amplitude, | ||
| float | gain = 2.f, | ||
| int | iterations = 500, | ||
| Array * | p_cliff_mask = nullptr, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Transform heightmap to add cliffs where gradients are steep enough using Poisson gradient amplification.
| array | Input array representing the heightmap to be modified. |
| talus | Reference talus angle / slope threshold. |
| ir | Filter radius used to smooth the heightmap before applying the cliff effect. |
| amplitude | Amplitude of the cliffs. |
| gain | Gain factor influencing the steepness of the cliffs. |
| iterations | Number of Poisson solver iterations (default: 500). |
| p_cliff_mask | [out] Optional pointer to an array that receives the cliff mask. |
Example
Result
| void hmap::gpu::recast_cliff | ( | Array & | array, |
| float | talus, | ||
| int | ir, | ||
| float | amplitude, | ||
| const Array * | p_mask, | ||
| float | gain = 2.f, | ||
| int | iterations = 500, | ||
| Array * | p_cliff_mask = nullptr, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
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::recast_cliff_directional | ( | Array & | array, |
| float | talus, | ||
| int | ir, | ||
| float | amplitude, | ||
| float | angle, | ||
| float | gain = 2.f, | ||
| int | iterations = 500, | ||
| Array * | p_cliff_mask = nullptr, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Transform heightmap to add directional cliffs where gradients are steep enough using Poisson gradient amplification.
| array | Input array representing the heightmap to be modified. |
| talus | Reference talus angle / slope threshold. |
| ir | Filter radius used to smooth the heightmap before applying the cliff effect. |
| amplitude | Amplitude of the cliffs. |
| angle | Angle (in degrees) determining the direction of the cliffs. |
| gain | Gain factor influencing the steepness of the cliffs. |
| iterations | Number of Poisson solver iterations (default: 500). |
| p_mask | Optional filter mask. |
| p_cliff_mask | [out] Optional pointer to an array that receives the cliff mask. |
| sync_interval | Number of iterations between communicator tile syncs. |
| region | Tile region geometry metadata. |
| comm | Tiled communicator instance. |
Example
Result
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::recast_cliff_directional | ( | Array & | array, |
| float | talus, | ||
| int | ir, | ||
| float | amplitude, | ||
| float | angle, | ||
| const Array * | p_mask, | ||
| float | gain = 2.f, | ||
| int | iterations = 500, | ||
| Array * | p_cliff_mask = nullptr, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
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::recast_cliff_directional | ( | Array & | array, |
| float | talus, | ||
| int | ir, | ||
| float | amplitude, | ||
| const Array & | angle, | ||
| float | gain = 2.f, | ||
| int | iterations = 500, | ||
| Array * | p_cliff_mask = nullptr, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
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::recast_cliff_directional | ( | Array & | array, |
| float | talus, | ||
| int | ir, | ||
| float | amplitude, | ||
| const Array & | angle, | ||
| const Array * | p_mask, | ||
| float | gain = 2.f, | ||
| int | iterations = 500, | ||
| Array * | p_cliff_mask = nullptr, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
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, | ||
| const Array * | p_mask = nullptr, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
See hmap::smooth_cpulse.
| void hmap::gpu::smooth_cpulse_edge_removing | ( | Array & | array, |
| float | talus, | ||
| float | talus_width, | ||
| int | ir ) |
| 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.
| Array hmap::gpu::spectral_equalizer | ( | const Array & | array, |
| const std::vector< float > & | weights, | ||
| int | ir_min, | ||
| int | ir_max ) |
Spectral equalizer for 2D fields using a multiscale Gaussian pyramid.
Decomposes the input array into log-spaced frequency bands using Gaussian smoothing, then recombines them using normalized user-defined weights.
| array | Input 2D field. |
| weights | Spectral gains (mapped from low to high frequencies). |
| ir_min | Minimum Gaussian radius. |
| ir_max | Maximum Gaussian radius. |
Example
Result
| Array hmap::gpu::spectral_equalizer | ( | const Array & | array, |
| const std::vector< float > & | weights, | ||
| int | ir_min, | ||
| int | ir_max, | ||
| 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 hmap::gpu::voronoi_shrink | ( | const Array & | array, |
| glm::vec2 | kw, | ||
| float | shrink_factor = 0.8f, | ||
| float | fill_value = 0.f, | ||
| std::uint32_t | seed = 0, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | angle = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a Voronoi shrinker filter to an input heightmap.
Within each Voronoi cell, the input elevation field is shrunk towards the cell center, preserving the shape within the cell while creating rifts or gaps between adjacent Voronoi cells filled with fill_value.
| array | Input array representing the heightmap to be filtered. |
| kw | Frequency / wave numbers for the Voronoi grid. |
| shrink_factor | Linear shrinking factor in (0, 1] towards cell centers. |
| fill_value | Value used to fill the rifts/gaps between shrunken cells. |
| seed | Seed for random jitter of Voronoi cell centers. |
| jitter | Jitter amount controlling cell randomness (default: {0.5f, 0.5f}). |
| angle | Orientation angle in degrees for rotating the Voronoi pattern (default: 0.0f). |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
| Array hmap::gpu::voronoi_shrink | ( | const Array & | array, |
| float | kw, | ||
| float | shrink_factor = 0.8f, | ||
| float | fill_value = 0.f, | ||
| std::uint32_t | seed = 0, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | angle = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a Voronoi shrinker filter using an isotropic frequency.
| array | Input array representing the heightmap to be filtered. |
| kw | Isotropic frequency / wave number for the Voronoi grid. |
| shrink_factor | Linear shrinking factor in (0, 1] towards cell centers. |
| fill_value | Value used to fill the rifts/gaps between shrunken cells. |
| seed | Seed for random jitter of Voronoi cell centers. |
| jitter | Jitter amount controlling cell randomness (default: {0.5f, 0.5f}). |
| angle | Orientation angle in degrees for rotating the Voronoi pattern (default: 0.0f). |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::voronoi_shrink | ( | const Array & | array, |
| const Cloud & | cloud, | ||
| float | shrink_factor = 0.8f, | ||
| float | fill_value = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a Voronoi shrinker filter using a custom cloud of points.
| array | Input array representing the heightmap to be filtered. |
| cloud | Cloud of 2D points defining the Voronoi cell centers. |
| shrink_factor | Linear shrinking factor in (0, 1] towards cell centers. |
| fill_value | Value used to fill the rifts/gaps between shrunken cells. |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
| Array hmap::gpu::voronoi_shrink | ( | const Array & | array, |
| const std::vector< Point > & | points, | ||
| float | shrink_factor = 0.8f, | ||
| float | fill_value = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a Voronoi shrinker filter using a list of Point objects.
| array | Input array representing the heightmap to be filtered. |
| points | Vector of Point objects defining Voronoi cell centers. |
| shrink_factor | Linear shrinking factor in (0, 1] towards cell centers. |
| fill_value | Value used to fill the rifts/gaps between shrunken cells. |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::voronoi_shrink | ( | const Array & | array, |
| const std::vector< glm::vec2 > & | points, | ||
| float | shrink_factor = 0.8f, | ||
| float | fill_value = 0.f, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Apply a Voronoi shrinker filter using a list of glm::vec2 coordinates.
| array | Input array representing the heightmap to be filtered. |
| points | Vector of glm::vec2 coordinates defining Voronoi cell centers. |
| shrink_factor | Linear shrinking factor in (0, 1] towards cell centers. |
| fill_value | Value used to fill the rifts/gaps between shrunken cells. |
| p_mask | Optional mask array for blending. |
| p_noise_x | Optional noise array for X perturbation. |
| p_noise_y | Optional noise array for Y perturbation. |
| bbox | Bounding box for domain mapping (default: {0.f, 1.f, 0.f, 1.f}). |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Compute the fractional Laplacian of an array.
Approximates a non-local Laplacian of order s using a neighborhood of radius ir. The result is unnormalized.
| array | Input scalar field. |
| s | Fractional order (> 0 and 1 is the standard Laplacian). |
| ir | Neighborhood radius. |
array.Example
Result
Apply phase averaging on real and imaginary fields using a GPU kernel.
| field_real | Real component (input/output). |
| field_imag | Imaginary component (input/output). |
| ir | Averaging radius. |
| Array hmap::gpu::phase_field | ( | const Array & | array, |
| const glm::vec2 & | kw, | ||
| std::uint32_t | seed, | ||
| float | kp, | ||
| bool | rotate90 = false, | ||
| float | normalization = 1.f, | ||
| const glm::vec2 & | jitter = {0.5f, 0.5f}, | ||
| int | angle_filter_ir = 8, | ||
| const Array * | p_ctrl_param = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| Array * | p_modulus = nullptr, | ||
| Array * | p_angle_jump_mask = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Compute a phase field from an input array using local orientation and noise.
| array | Input scalar field. |
| kw | Wave vector. |
| seed | Random seed. |
| kp | Phase gain. |
| rotate90 | Rotate local angle by 90 degrees if true. |
| normalization | Degree of normalization applied [0, 1]. |
| jitter | Jitter applied to sampling. |
| angle_filter_ir | Radius for angle filtering. |
| p_ctrl_param | Optional control parameter field. |
| p_noise_x | Optional noise field (x). |
| p_noise_y | Optional noise field (y). |
| p_modulus | Optional output. |
| bbox | Bounding box for evaluation. |
Result
| Array hmap::gpu::phase_field | ( | const Array & | array, |
| std::uint32_t | seed, | ||
| float | kp_global, | ||
| bool | rotate90 = false, | ||
| float | normalization = 1.f, | ||
| const glm::vec2 & | jitter = {0.5f, 0.5f}, | ||
| int | angle_filter_ir = 8, | ||
| const Array * | p_ctrl_param = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| Array * | p_modulus = nullptr, | ||
| Array * | p_angle_jump_mask = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Compute a phase field using a global isotropic kp value.
| array | Input scalar field. |
| seed | Random seed. |
| kp_global | Global phase gain. |
| rotate90 | Rotate local angle by 90 degrees if true. |
| normalization | Degree of normalization applied [0, 1]. |
| jitter | Jitter applied to sampling. |
| angle_filter_ir | Radius for angle filtering. |
| p_ctrl_param | Optional control parameter field. |
| p_noise_x | Optional noise field (x). |
| p_noise_y | Optional noise field (y). |
| p_modulus | Optional output. |
| bbox | Bounding box for evaluation. |
Result
| Array hmap::gpu::phase_field_angle | ( | const Array & | angle, |
| const glm::vec2 & | kw, | ||
| std::uint32_t | seed, | ||
| float | kp, | ||
| float | normalization = 1.f, | ||
| const glm::vec2 & | jitter = {0.5f, 0.5f}, | ||
| const Array * | p_ctrl_param = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| Array * | p_modulus = nullptr, | ||
| Array * | p_angle_jump_mask = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| Array hmap::gpu::coastal_fetch | ( | const Array & | z, |
| int | ndirections, | ||
| const Array * | p_compute_mask = nullptr ) |
Computes the omnidirectional coastal fetch for each cell.
Casts ndirections evenly-spaced rays from each cell and averages the distance to the first land obstacle (or domain boundary) across all directions. High values indicate open, wave-exposed coastline; low values indicate sheltered or enclosed areas such as harbors.
| z | Input elevation array. |
| ndirections | Number of ray directions (uniformly distributed over 2Ï€). Higher values improve accuracy at the cost of performance. |
| p_compute_mask | Optional boolean mask; fetch is only evaluated where the mask is true. Pass nullptr to process the entire domain. |
Example
Result
| Array hmap::gpu::coastal_fetch_directional | ( | const Array & | z, |
| float | angle, | ||
| float | directional_exp, | ||
| int | ndirections, | ||
| const Array * | p_compute_mask = nullptr ) |
Computes directional coastal fetch weighted by alignment with a prevailing wind or wave direction.
Each ray's fetch contribution is weighted by \( \max(0,\, \cos(\theta - \alpha))^e \), where \(\theta\) is the ray azimuth, \(\alpha\) is angle, and \(e\) is directional_exp. Rays in the back hemisphere are discarded. Increasing directional_exp narrows the effective lobe around the prevailing direction.
| z | Input elevation array. |
| angle | Prevailing direction (radians, trigonometric convention: 0 = East, π/2 = North). |
| directional_exp | Exponent applied to the cosine weight. Use 1 for a full cosine lobe, 2 to approximate wind-energy weighting, or higher values for a narrower directional response. |
| ndirections | Number of ray directions sampled over 2Ï€. |
| p_compute_mask | Optional boolean mask. Pass nullptr to process the entire domain. |
Example
Result
| Array hmap::gpu::flow_accumulation_from_velocity_field | ( | const Array & | u, |
| const Array & | v, | ||
| int | iterations ) |
Approximates flow accumulation from a 2D velocity field.
Advects a scalar accumulation field using an Eulerian transport scheme driven by the velocity components (u, v). Repeated iterations approximate upstream contributing area and highlight flow convergence (thalwegs).
| u | X-component of the flow velocity field. |
| v | Y-component of the flow velocity field. |
| iterations | Number of transport iterations to perform. |
| Array hmap::gpu::flow_accumulation_stochastic | ( | const Array & | z, |
| int | n_samples = 1 << 19, | ||
| std::uint32_t | seed = 0, | ||
| const Array * | p_source = nullptr, | ||
| const Array * | p_decay = nullptr ) |
GPU (OpenCL) variant of hmap::flow_accumulation_stochastic — see the CPU declaration for the algorithm description and parameters.
| Array hmap::gpu::flow_simulation | ( | const Array & | z, |
| float | water_depth, | ||
| const Array & | depth_map, | ||
| int | iterations, | ||
| float | dt = 0.5f, | ||
| bool | flux_diffusion = true, | ||
| float | flux_diffusion_strength = 0.01f, | ||
| float | dry_out_ratio = 0.f, | ||
| const Array * | p_rain_map = nullptr, | ||
| float | rain_rate = 0.f, | ||
| float | evap_rate = 0.f, | ||
| bool | outflow_boundaries = false, | ||
| Array * | p_vel_u = nullptr, | ||
| Array * | p_vel_v = nullptr, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
GPU hydraulic flow simulation using a virtual-pipes model; simulates shallow-water transport over a height field using iterative flux computation and water transport passes, with optional flux diffusion and post-simulation dry-out. The whole iteration loop runs on the device: the terrain is uploaded once, depth and fluxes ping-pong between device images, and only the final depth (and velocity, if requested) are read back.
| z | Terrain height field. |
| water_height | Global water scaling factor. |
| depth_map | Initial relative water distribution. |
| iterations | Number of simulation steps. |
| dt | Time step size. |
| flux_diffusion | Enables flux smoothing. |
| flux_diffusion_strength | Strength of flux diffusion. |
| dry_out_ratio | Ratio for removing thin remaining water layers. |
| p_rain_map | Optional spatial precipitation map. |
| rain_rate | Continuous precipitation rate added per timestep. |
| evap_rate | Evaporation rate per timestep. |
| outflow_boundaries | Allows water to freely discharge outside the domain at boundaries. |
| p_vel_u | Optional output array for horizontal velocity field. |
| p_vel_v | Optional output array for vertical velocity field. |
| Array hmap::gpu::flow_simulation_viscous | ( | const Array & | z, |
| float | water_depth, | ||
| const Array & | depth_map, | ||
| int | iterations, | ||
| float | dt = -1.f, | ||
| float | dry_out_ratio = 0.f, | ||
| float | viscosity = 1.f, | ||
| float | power = 2.5f, | ||
| float | evap_rate = 0.f, | ||
| bool | outflow_boundaries = false, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
GPU viscous shallow-water flow simulation using non-linear thin-film diffusion with upwind mobility.
| z | Terrain height field. |
| water_depth | Global initial water scaling factor. |
| depth_map | Initial relative water distribution. |
| iterations | Number of simulation steps. |
| dt | Time step size (-1 for adaptive). |
| dry_out_ratio | Ratio for removing thin remaining water layers. |
| viscosity | Fluid dynamic viscosity. |
| power | Non-linear mobility depth exponent. |
| evap_rate | Evaporation rate per timestep. |
| outflow_boundaries | Allows fluid to freely discharge outside domain at boundaries. |
| sync_interval | Number of iterations between communicator tile syncs. |
| region | Tile region geometry metadata. |
| comm | Tiled communicator instance. |
| Array hmap::gpu::generate_riverbed | ( | const Path & | path, |
| glm::ivec2 | shape, | ||
| const UvRect & | uv_rect = UvRect::unit(), | ||
| 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 ) |
| Array hmap::gpu::snow_mantle | ( | const Array & | z, |
| float | strength = 0.1f, | ||
| float | snowline = 0.5f, | ||
| float | falloff = 0.1f, | ||
| int | prefilter_ir = 8, | ||
| float | talus_coverage = 0.8f, | ||
| float | talus_threshold = 0.001f, | ||
| float | directional = 0.f, | ||
| float | wind_direction = 0.f, | ||
| float | peaks = 0.2f, | ||
| float | melt = 0.f, | ||
| float | sun_azimuth = 180.f, | ||
| float | sun_zenith = 45.f, | ||
| int | thermal_iterations = 15, | ||
| float | thermal_talus = 0.15f, | ||
| float | coverage = 0.5f, | ||
| const Array * | p_existing_snow = nullptr, | ||
| const Array * | p_mask = nullptr, | ||
| const Array * | p_noise = nullptr ) |
Generates fine-scale snow mantle accumulation over terrain.
Distinct from hydrodynamic snow simulation, this function computes a lightweight, natural surface snow coating influenced by altitude, slope, wind exposure, ridge accumulation, solar melting, micro-texture, and downhill redistribution via mass-preserving GPU thermal transport.
| z | Underlying terrain heightmap. |
| strength | Overall snow depth/thickness scaling. |
| snowline | Altitude above which snow begins to accumulate. |
| falloff | Transition width around the snowline. |
| talus_coverage | Exclusion factor for steep slopes (0 = sticks to all slopes, 1 = excluded). |
| talus_threshold | Talus slope threshold above which snow begins shedding. |
| directional | Wind exposure accumulation factor (leeward gain, windward loss). |
| wind_direction | Wind azimuth in degrees. |
| peaks | Extra accumulation factor on ridges and convex peaks. |
| melt | Solar melting factor. |
| sun_azimuth | Sun azimuth in degrees for melting. |
| sun_zenith | Sun zenith in degrees for melting. |
| thermal_iterations | Iterations of GPU mass-preserving thermal transport (0 disables flow). |
| thermal_talus | Repose talus for snow downhill flow. |
| coverage | Coverage expansion/contraction via thresholding. |
| p_existing_snow | Optional existing snow layer to accumulate upon. |
| p_mask | Optional spatial accumulation mask. |
| p_noise | Optional external noise array to modulate snow accumulation. |
Example
Result
| Array hmap::gpu::snow_simulation | ( | const Array & | z, |
| float | snow_depth, | ||
| const Array & | fall_map, | ||
| const Array & | melting_map, | ||
| const Array & | talus, | ||
| int | iterations, | ||
| float | dt = 0.5f, | ||
| float | fall_iterations_ratio = 1.f, | ||
| float | k_snow = 0.5f, | ||
| float | k_visc = 0.1f, | ||
| float | k_melt_factor = 0.8f, | ||
| float | k_depth_ratio = 1.f, | ||
| float | k_depth_slope_ratio = 1.f, | ||
| float | k_creep = 0.1f, | ||
| bool | post_filter = true, | ||
| float | thermal_talus_ratio = 0.2f, | ||
| bool | outflow_boundaries = true, | ||
| float | clamp_smin = 0.f, | ||
| bool | rebase_snow_depth_to_zero = true, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Simulate snow accumulation and redistribution over a terrain.
Models snow fall, depth-dependent avalanching (above repose angle) and thermal creep smoothing (below repose angle), with optional melting and post-filtering. Snow progressively stabilizes into smooth, rounded forms.
| z | Heightfield of the underlying terrain. |
| snow_depth | Total amount of snow to deposit. |
| fall_map | Spatial modulation of snow deposition. |
| melting_map | Spatial melting factor in [0,1]. |
| talus | Local repose angle (talus slope). |
| iterations | Number of simulation steps. |
| dt | Time step. |
| fall_iterations_ratio | Fraction of iterations used for snowfall. |
| k_snow | Avalanche transport coefficient. |
| k_visc | Thermal creep (sub-repose smoothing) coefficient. |
| k_melt_factor | Global melting strength. |
| k_depth_ratio | Controls snow stiffening with depth. |
| k_depth_slope_ratio | Depth influence on repose angle. |
| post_filter | Apply final smoothing pass if true. |
| thermal_talus_ratio | Controls creep strength relative to talus. |
| outflow_boundaries | Allows snow to freely discharge outside the domain at boundaries. |
Example
Result
| void hmap::gpu::water_depth_filter | ( | Array & | depth, |
| const Array & | z, | ||
| int | ir, | ||
| const Array * | p_water_mask = nullptr, | ||
| bool | smooth_contour = false, | ||
| float | transition_ratio = 0.1f ) |
Filters water depth values using elevation data and a given radius.
| depth | Water depth array to filter (in/out). |
| z | Elevation array used for filtering. |
| ir | Filter radius. |
Example
Result
| Array hmap::gpu::harmonic_interpolation | ( | const Array & | array, |
| const Array & | mask_fixed_values, | ||
| int | iterations_max = 500, | ||
| float | tolerance = 1e-5f, | ||
| float | omega = 0.f, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::unit(), | ||
| ICommunicator & | comm = SingleArrayComm::instance(), | ||
| const Array * | p_rhs = nullptr, | ||
| bool | fix_domain_borders = true ) |
Perform harmonic interpolation on GPU using Red-Black Successive Over-Relaxation (RB-SOR).
| array | Input 2D array providing the initial guess. |
| mask_fixed_values | Mask array where values > 0 are fixed boundary constraints. |
| iterations_max | Maximum number of iterations. |
| tolerance | Convergence tolerance for early exit (default: 1e-5). If the maximum update in an iteration check falls below this threshold, the algorithm stops. |
| omega | Relaxation parameter (1.0 < omega < 2.0). If set to 0.0f (default), the optimal analytical relaxation factor for the grid shape is automatically computed. |
| Array hmap::gpu::harmonic_interpolation | ( | const Array & | array, |
| const Array & | mask_fixed_values, | ||
| const Array & | dx, | ||
| const Array & | dy, | ||
| int | iterations_max = 500, | ||
| float | tolerance = 1e-5f, | ||
| float | omega = 0.f, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::unit(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Perform harmonic interpolation on GPU with 2D variable diffusion coefficients (Dx, Dy) using Red-Black SOR.
| array | Input 2D array providing the initial guess. |
| mask_fixed_values | Mask where values > 0 are fixed boundary constraints. |
| dx | Array of diffusion coefficients in x-direction. |
| dy | Array of diffusion coefficients in y-direction. |
| iterations_max | Maximum number of iterations. |
| tolerance | Convergence tolerance. |
| omega | Relaxation factor (0 = auto-computed optimal). |
| Array hmap::gpu::biharmonic_interpolation | ( | const Array & | array, |
| const Array & | mask_fixed_values, | ||
| int | iterations_max = 1000, | ||
| float | tolerance = 1e-5f, | ||
| float | omega = 0.5f, | ||
| int | sync_interval = 0, | ||
| const UvTile & | region = UvTile::unit(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
| void hmap::gpu::interpolate_array_bicubic | ( | const Array & | source, |
| Array & | target, | ||
| const UvRect & | uv_rect_source, | ||
| const UvRect & | uv_rect_target ) |
| void hmap::gpu::interpolate_array_bilinear | ( | const Array & | source, |
| Array & | target, | ||
| const UvRect & | uv_rect_source, | ||
| const UvRect & | uv_rect_target ) |
| void hmap::gpu::interpolate_array_nearest | ( | const Array & | source, |
| Array & | target, | ||
| const UvRect & | uv_rect_source, | ||
| const UvRect & | uv_rect_target ) |
Compute the average local aspect variance of an array.
| array | Input array. |
| ir | Radius of the local window. |
Example
Result
| Array hmap::gpu::local_max | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
Compute the local maximum using the specified kernel footprint.
| array | Input array. |
| ir | Radius of the kernel footprint. |
| kernel_type | Kernel footprint type (default: MinMaxKernel::DISK). |
Compute the local maximum using a disk kernel.
For each cell, returns the maximum value within a neighborhood of radius ir defined by a disk-shaped kernel.
| array | Input array. |
| ir | Radius of the disk kernel. |
Example
Result
Compute the local maximum using an octagonal kernel approximation via 4 separable 1D passes (horizontal, vertical, and two diagonals).
| array | Input array. |
| ir | Radius of the octagonal neighborhood footprint. |
Example
Result
Compute the local maximum using a square kernel with a 2-pass separable implementation.
| array | Input array. |
| ir | Radius of the square kernel footprint. |
Example
Result
| Array hmap::gpu::local_min | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
Compute the local minimum using the specified kernel footprint.
| array | Input array. |
| ir | Radius of the kernel footprint. |
| kernel_type | Kernel footprint type (default: MinMaxKernel::DISK). |
Compute the local minimum using a disk kernel.
For each cell, returns the minimum value within a neighborhood of radius ir defined by a disk-shaped kernel.
| array | Input array. |
| ir | Radius of the disk kernel. |
Example
Result
Compute the local minimum using an octagonal kernel approximation via 4 separable 1D passes (horizontal, vertical, and two diagonals).
| array | Input array. |
| ir | Radius of the octagonal neighborhood footprint. |
Example
Result
Compute the local minimum using a square kernel with a 2-pass separable implementation.
| array | Input array. |
| ir | Radius of the square kernel footprint. |
Example
Result
| Array hmap::gpu::local_relief | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
Compute the local relief of an array.
The local relief is defined as the difference between the maximum and minimum values within a neighborhood of radius ir around each element. This provides a measure of local variation in the array (e.g., terrain ruggedness).
| array | Input array representing scalar values (e.g., elevation map). |
| ir | Radius of the neighborhood (in pixels) used to compute local extrema. |
| kernel_type | Kernel footprint type (default: MinMaxKernel::DISK). |
array, where each element contains the difference between the local maximum and minimum within the specified neighborhood.Example
Result
Compute the average local variance of an array.
Local variance is defined as the standard deviation within a window of radius ir centered on each cell. The function computes this value for every cell, then returns the average over the entire domain.
| array | Input array. |
| ir | Radius of the local window. |
Example
Result
See hmap::local_mean.
Compute the local z-score of an array.
For each cell, computes the normalized difference between its value and the mean of a neighborhood of radius ir.
| array | Input array. |
| ir | Radius of the local window. |
Example
Result
Compute the Topographic Position Index (TPI).
TPI measures the elevation difference between each cell and the mean elevation within a neighborhood of radius ir.
| array | Input elevation array. |
| ir | Radius of the neighborhood. |
Example
Result
| Array hmap::gpu::relative_elevation | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::roughness.
See hmap::ruggedness.
See hmap::rugosity.
See hmap::valley_width.
| Array hmap::gpu::local_metrics | ( | const Array & | array, |
| int | ir, | ||
| LocalMetrics | metric, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
Compute a local metric on the input array using a square neighborhood.
Applies the selected local statistic or terrain descriptor (e.g. mean, variance, ruggedness) over a neighborhood of radius ir.
| array | Input array to analyze. |
| ir | Radius of the square neighborhood. |
| metric | Local metric to compute. |
Example
Result
See unit tests: test_local_metrics.cpp
| Array hmap::gpu::sparse_max_convolution | ( | const Array & | array, |
| const Array & | kernel, | ||
| bool | scale_kernel_with_value = true, | ||
| float | k_smoothmax = 0.f ) |
Apply a sparse max-convolution.
This operator propagates the non-zero values of the input array through a spatial kernel using a max-reduction instead of a summation. For each non-zero value of the input array, the kernel is centered at the sample position and contributes to the output through a weighted maximum.
The operation is conceptually similar to a sparse morphological dilation or a max-convolution.
| array | Input sparse scalar field. |
| kernel | Propagation kernel. |
| scale_kernel_with_value | If true, the effective kernel size is scaled according to the local input value. Larger values propagate over a larger neighborhood, while smaller values use a reduced kernel support. If false, the full kernel size is used everywhere. |
| k_smoothmax | Smooth maximum factor. |
Example
Result
| Array hmap::gpu::sparse_max_convolution | ( | const Array & | array_values, |
| const Array & | array_sizes, | ||
| const Array & | kernel, | ||
| float | k_smoothmax = 0.f ) |
| Array hmap::gpu::border | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::border.
| Array hmap::gpu::closing | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::closing.
| Array hmap::gpu::closing_by_reconstruction | ( | const Array & | array, |
| int | ir, | ||
| float | k_smooth_max = 0.f, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| Array hmap::gpu::dilation | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::dilation.
| Array hmap::gpu::dilation_expand_border_only | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| Array hmap::gpu::distance_transform_jfa | ( | const Array & | array, |
| bool | return_squared_distance = false ) |
Return the Euclidean distance transform.
(Almost) exact transform based on the jump flooding algorithm.
| array | Input array to be transformed, will be converted into binary: 1 wherever input is greater than 0, 0 elsewhere. |
| return_squared_distance | Whether the distance returned is squared or not. |
Example
Result
| Array hmap::gpu::erosion | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::erosion.
| Array hmap::gpu::morphological_black_hat | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| Array hmap::gpu::morphological_gradient | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| Array hmap::gpu::morphological_laplacian | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| Array hmap::gpu::morphological_top_hat | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| Array hmap::gpu::opening | ( | const Array & | array, |
| int | ir, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::opening.
| Array hmap::gpu::opening_by_reconstruction | ( | const Array & | array, |
| int | ir, | ||
| float | k_smooth_min = 0.f, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| Array hmap::gpu::reconstruction_by_dilation | ( | const Array & | marker, |
| const Array & | mask, | ||
| int | ir, | ||
| float | k_smooth_min = 0.f, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
| Array hmap::gpu::reconstruction_by_erosion | ( | const Array & | marker, |
| const Array & | mask, | ||
| int | ir, | ||
| float | k_smooth_max = 0.f, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
See hmap::skeleton.
| Array hmap::gpu::morphological_operators | ( | const Array & | array, |
| int | ir, | ||
| hmap::MorphologyOperation | operation, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::DISK ) |
Apply a morphological operation to the input array using a square kernel.
Dispatches to the selected morphological operator (e.g. erosion, dilation, opening, closing, gradient, etc.).
| array | Input array to process. |
| ir | Radius of the square structuring element. |
| operation | Morphological operation to apply. |
| 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::gabor_wave | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| const Array & | angle, | ||
| float | angle_spread_ratio = 1.f, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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 | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| float | angle = 0.f, | ||
| float | angle_spread_ratio = 1.f, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| Array hmap::gpu::gabor_wave_fbm | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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 | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| Array hmap::gpu::gavoronoise | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| const Array & | angle, | ||
| float | amplitude = 0.05f, | ||
| float | angle_spread_ratio = 1.f, | ||
| glm::vec2 | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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 | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| float | angle = 0.f, | ||
| float | amplitude = 0.05f, | ||
| float | angle_spread_ratio = 1.f, | ||
| glm::vec2 | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| Array hmap::gpu::gavoronoise | ( | const Array & | base, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| float | amplitude = 0.05f, | ||
| glm::vec2 | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| Array hmap::gpu::noise | ( | NoiseType | noise_type, |
| glm::ivec2 | shape, | ||
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit(), | ||
| glm::ivec2 | period = {0, 0}, | ||
| float | angle = 0.f, | ||
| float | stretch = 1.f ) |
See hmap::noise. period sets the tiling period in lattice cells. For the heightmap to be periodic with respect to the full domain, period must be equal to the wavenumber kw, i.e. period = {round(kw.x), round(kw.y)}; a smaller period makes the pattern repeat within the domain. A component <= 0 disables wrapping on that axis (default {0, 0}: non-periodic). Tiling is exact only for lattice noise types with integer kw; simplex is never wrapped.
| Array hmap::gpu::noise_fbm | ( | NoiseType | noise_type, |
| glm::ivec2 | shape, | ||
| glm::vec2 | kw, | ||
| std::uint32_t | 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 UvRect & | uv_rect = UvRect::unit(), | ||
| glm::ivec2 | period = {0, 0}, | ||
| float | angle = 0.f, | ||
| float | stretch = 1.f, | ||
| float | stretch_decay = 0.f ) |
See hmap::noise_fbm. period sets the tiling period in lattice cells for the base octave. For the heightmap to be periodic with respect to the full domain, period must be equal to the wavenumber kw, i.e. period = {round(kw.x), round(kw.y)}; a smaller period makes the pattern repeat within the domain. A component <= 0 disables wrapping on that axis (default {0, 0}: non-periodic). Seamless tiling additionally requires an integer lacunarity (the default 2); simplex is never wrapped.
| Array hmap::gpu::noise_slope | ( | NoiseType | noise_type, |
| glm::ivec2 | shape, | ||
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| int | octaves = 8, | ||
| float | weight = 0.7f, | ||
| float | persistence = 0.5f, | ||
| float | lacunarity = 2.f, | ||
| float | gradient_scale = 0.5f, | ||
| float | slope_power = 2.f, | ||
| float | octave_blend = 0.5f, | ||
| float | bias_angle = 0.f, | ||
| float | bias_strength = 0.f, | ||
| const Array * | p_ctrl_param = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit(), | ||
| glm::ivec2 | period = {0, 0}, | ||
| float | angle = 0.f, | ||
| float | stretch = 1.f, | ||
| float | stretch_decay = 0.f ) |
See hmap::noise_slope. period sets the tiling period in lattice cells for the base octave.
| Array hmap::gpu::phasor | ( | PhasorProfile | phasor_profile, |
| glm::ivec2 | shape, | ||
| float | kp_global, | ||
| std::uint32_t | seed, | ||
| float | angle_shift = 0.f, | ||
| float | normalization = 1.f, | ||
| const glm::vec2 | jitter = {1.f, 1.f}, | ||
| float | delta = 0.01f, | ||
| float | phase_smoothing = 10.f, | ||
| const Array * | p_angle = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a procedural phasor-based pattern.
Produces a directional, phase-driven field using a selected profile, optional angle control, and spatial distortion noise.
| phasor_profile | Phasor shaping profile. |
| shape | Output array dimensions. |
| kp_global | Global frequency factor. |
| seed | Random seed. |
| angle_shift | Global phase angle offset (degrees). |
| n_kernel_samples | Number of kernel samples. |
| jitter | Sampling jitter (x,y). |
| delta | Finite difference step. |
| phase_smoothing | Phase smoothing factor. |
| p_angle | Optional external angle field. |
| p_noise_x | Optional X distortion field. |
| p_noise_y | Optional Y distortion field. |
| bbox | Domain bounding box. |
Example
Result
| Array hmap::gpu::phasor_fbm | ( | PhasorProfile | phasor_profile, |
| glm::ivec2 | shape, | ||
| float | kp_global, | ||
| std::uint32_t | seed, | ||
| float | angle_shift = 0.f, | ||
| int | octaves = 8, | ||
| float | weight = 0.7f, | ||
| float | persistence = 0.5f, | ||
| float | lacunarity = 2.f, | ||
| float | normalization = 1.f, | ||
| const glm::vec2 | jitter = {1.f, 1.f}, | ||
| float | delta = 0.01f, | ||
| float | phase_smoothing = 10.f, | ||
| const Array * | p_angle = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a multi-octave (fBm) phasor-based pattern.
Accumulates several scaled phasor layers using persistence and lacunarity for richer multi-scale structure.
| phasor_profile | Phasor shaping profile. |
| shape | Output array dimensions. |
| kp_global | Base frequency factor. |
| seed | Random seed. |
| angle_shift | Global phase angle offset (degrees). |
| octaves | Number of fBm layers. |
| weight | Initial octave weight. |
| persistence | Amplitude multiplier per octave. |
| lacunarity | Frequency multiplier per octave. |
| normalization | Degree of normalization applied [0, 1]. |
| jitter | Sampling jitter (x,y). |
| delta | Finite difference step. |
| phase_smoothing | Phase smoothing factor. |
| p_angle | Optional external angle field. |
| p_noise_x | Optional X distortion field. |
| p_noise_y | Optional Y distortion field. |
| bbox | Domain bounding box. |
Example
Result
| Array hmap::gpu::vorolines | ( | glm::ivec2 | shape, |
| float | density, | ||
| std::uint32_t | seed, | ||
| float | k_smoothing = 0.f, | ||
| float | exp_sigma = 0.f, | ||
| float | alpha = 0.f, | ||
| float | alpha_span = cte::pi, | ||
| VoronoiReturnType | return_type = VoronoiReturnType::F1_SQUARED, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit(), | ||
| const UvRect & | uv_rect_points = UvRect::unit() ) |
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. |
Example
Result
| Array hmap::gpu::vorolines_fbm | ( | glm::ivec2 | shape, |
| float | density, | ||
| std::uint32_t | seed, | ||
| float | k_smoothing = 0.f, | ||
| float | exp_sigma = 0.f, | ||
| float | alpha = 0.f, | ||
| float | alpha_span = cte::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, | ||
| const UvRect & | uv_rect = UvRect::unit(), | ||
| const UvRect & | uv_rect_points = UvRect::unit() ) |
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. |
Example
Result
| Array hmap::gpu::voronoi | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | bias = 0.f, | ||
| 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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}. |
| bias | (Optional) Reach bonus bias for additively weighted Voronoi partitioning. Defaults to 0.f. |
| 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 | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | bias = 0.f, | ||
| 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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}. |
| bias | (Optional) Reach bonus bias for additively weighted Voronoi partitioning. Defaults to 0.f. |
| 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 | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| glm::vec2 | jitter = {0.5f, 0.5f}, | ||
| float | bias = 0.f, | ||
| const Array * | p_ctrl_param = nullptr, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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}). |
| bias | Optional reach bonus bias for weighted Voronoi partitioning (default is 0.f). |
| 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 | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| float | u_param, | ||
| float | v_param, | ||
| std::uint32_t | seed, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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. |
Example
Result
| Array hmap::gpu::voronoise_fbm | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| float | u_param, | ||
| float | v_param, | ||
| std::uint32_t | 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 UvRect & | uv_rect = UvRect::unit() ) |
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 | ( | glm::ivec2 | shape, |
| float | density, | ||
| float | variability, | ||
| std::uint32_t | 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, | ||
| const UvRect & | uv_rect = UvRect::unit(), | ||
| const UvRect & | uv_rect_points = UvRect::unit() ) |
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. |
Example
Result
| Array hmap::gpu::vororand | ( | glm::ivec2 | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
| Array hmap::gpu::wavelet_noise | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| float | kw_multiplier = 2.f, | ||
| float | vorticity = 0.f, | ||
| float | density = 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates 2D wavelet noise using an OpenCL kernel.
This function creates a 2D noise field of the given shape using multi-octave wavelet turbulence. The noise is computed on the GPU via the "wavelet_noise" OpenCL kernel. Various parameters control the frequency evolution, amplitude decay, vorticity injection, and optional modulation using additional input arrays.
| shape | Resolution of the output noise array (width, height). |
| kw | Base wave number (frequency) in each axis. Controls the initial spatial frequency of the wavelet field. |
| seed | Integer seed used by the random hashing functions inside the kernel. |
| kw_multiplier | Multiplier applied to the wave number per octave (similar to gain). Higher values increase frequency growth across octaves. |
| vorticity | Amount of rotational distortion injected into the noise. When > 0, the kernel applies additional angular perturbations to produce turbulent flow-like patterns. |
| density | Global scaling factor controlling the overall contrast or amplitude of the generated noise. |
| octaves | Number of wavelet noise layers combined. Higher octaves yield more detail but increase computational cost. |
| weight | Weight applied to the base octave, used as a global intensity multiplier before persistence attenuation is applied. |
| persistence | Amplitude decay factor per octave. Values in (0,1) produce the classic fractal noise falloff; higher values retain more high-frequency detail. |
| lacunarity | Frequency multiplier per octave. Controls how rapidly frequency increases at each octave, with typical values in the range [1.5, 3.0]. |
| p_ctrl_param | Optional pointer to a control-parameter array. When provided, values inside this array modulate the generated noise spatially. Pass nullptr to disable this feature. |
| p_noise_x | Optional pointer to an auxiliary noise array used to perturb sampling positions horizontally. Pass nullptr to disable. |
| p_noise_y | Optional pointer to an auxiliary noise array used to perturb sampling positions vertically. Pass nullptr to disable. |
| bbox | Bounding-box mapping (xmin, ymin, xmax, ymax). Converts pixel-space indices into world-space coordinates for spatially consistent noise. |
Example
Result
| Array hmap::gpu::hemisphere_field | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| float | rmin = 0.05f, | ||
| float | rmax = 0.8f, | ||
| float | amplitude_random_ratio = 1.f, | ||
| float | density = 0.1f, | ||
| glm::vec2 | jitter = {1.f, 1.f}, | ||
| float | shift = 0.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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a scalar field representing the signed distance to randomly generated hemispheres.
| shape | Resolution of the output field (width, height). |
| kw | Scaling factor for field coordinates (world units per pixel). |
| seed | Random seed generation. |
| rmin | Minimum sphere radius (relative to bbox size). |
| rmax | Maximum sphere radius (relative to bbox size). |
| density | Fraction of pixels covered by polygons (approximate). |
| jitter | Random displacement factor applied to sphere vertices. |
| shift | Random position shift applied to sphere 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::hemisphere_field_fbm | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| float | rmin = 0.05f, | ||
| float | rmax = 0.8f, | ||
| float | amplitude_random_ratio = 1.f, | ||
| float | density = 0.1f, | ||
| glm::vec2 | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
See hmap::hemisphere_field.
| Array hmap::gpu::multisteps | ( | glm::ivec2 | shape, |
| float | angle, | ||
| std::uint32_t | seed, | ||
| glm::vec2 | kw = {2.f, 2.f}, | ||
| float | noise_amp = 0.1f, | ||
| float | noise_rugosity = 0.f, | ||
| bool | noise_inflate = true, | ||
| float | r = 1.2f, | ||
| int | nsteps = 8, | ||
| float | elevation_exponent = 0.7f, | ||
| float | shape_gain = 4.f, | ||
| float | scale = 0.5f, | ||
| float | outer_slope = 0.1f, | ||
| const Array * | p_ctrl_param = nullptr, | ||
| const glm::vec2 & | center = {0.5f, 0.5f}, | ||
| const BBox2D & | bbox = BBox2D::unit() ) |
GPU-accelerated multi-step height generation with procedural noise.
Builds the same multi-step profile as the CPU version but injects a Voronoi-FBM noise field to modulate the step positions. Noise can be inflated or deflated and is projected onto the step axis before being passed to the CPU multisteps() implementation.
| shape | Output array resolution. |
| angle | Rotation angle in degrees. |
| seed | Noise seed. |
| kw | Base wave numbers for noise. |
| noise_amp | Amplitude of injected noise. |
| noise_rugosity | Roughness of the FBM noise. |
| noise_inflate | Whether to invert noise direction. |
| r | Geometric ratio between steps. |
| nsteps | Number of steps. |
| elevation_exponent | Exponent shaping step heights. |
| shape_gain | Gain used to reshape intra-step transitions. |
| scale | Scale of the step axis. |
| outer_slope | Slope outside the [0,1] axis interval. |
| p_ctrl_param | Optional control parameter array. |
| center | Center of the step axis. |
| bbox | Bounding box of the domain. |
Example
Result
| Array hmap::gpu::polygon_field | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | 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, | ||
| glm::vec2 | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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 | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | 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, | ||
| glm::vec2 | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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::badlands | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| int | octaves = 8, | ||
| float | rugosity = 0.2f, | ||
| float | angle = 30.f, | ||
| float | bias = 0.f, | ||
| float | k_smoothing = 0.1f, | ||
| float | base_noise_amp = 0.2f, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a synthetic "badlands" terrain heightmap.
This function procedurally creates a 2D elevation field resembling badlands (highly eroded terrain with sharp ridges and valleys). It combines fractal noise (FBM) with a Voronoi-based primitive, displaced along a specified orientation.
| shape | Output array shape (resolution in x and y). |
| kw | Frequency vector controlling the scale of the features. |
| seed | Random seed used for noise and Voronoi generation. |
| rugosity | Controls roughness of the fractal noise (higher = more irregular). |
| angle | Orientation angle (degrees) of terrain displacements. |
| bias | Reach bonus bias for weighted Voronoi partitioning. |
| k_smoothing | Voronoi smoothing parameter (controls ridge sharpness). |
| base_noise_amp | Amplitude of the base displacement noise. |
| p_noise_x | Optional pointer to external displacement noise field (X-axis). |
| p_noise_y | Optional pointer to external displacement noise field (Y-axis). |
| bbox | Bounding box of the generation domain in normalized coordinates. |
Example
Result
| Array hmap::gpu::basalt_field | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | 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, | ||
| float | bias = 0.f, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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. |
| bias | Reach bonus bias for weighted Voronoi partitioning. |
| 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. |
Example
Result
| Array hmap::gpu::island | ( | const Array & | land_mask, |
| const Array * | p_noise_r = nullptr, | ||
| float | apex_elevation = 1.f, | ||
| bool | filter_distance = true, | ||
| int | filter_ir = 32, | ||
| float | slope_min = 0.1f, | ||
| float | slope_max = 8.f, | ||
| float | slope_start = 0.5f, | ||
| float | slope_end = 1.f, | ||
| float | slope_noise_intensity = 0.5f, | ||
| float | k_smooth = 0.05f, | ||
| float | radial_noise_intensity = 0.3f, | ||
| float | radial_profile_gain = 2.f, | ||
| float | water_decay = 0.05f, | ||
| float | water_depth = 0.3f, | ||
| float | lee_angle = 30.f, | ||
| float | lee_amp = 0.f, | ||
| float | uplift_amp = 0.f, | ||
| Array * | p_water_depth = nullptr, | ||
| Array * | p_inland_mask = nullptr ) |
Generates an island heightmap from a land mask using radial profiles, slope shaping, optional noise, and water attenuation.
Applies elevation shaping inside the land mask using distance-based profiles, slope controls, optional radial and slope noise, and water-depth modeling.
| land_mask | Binary mask defining the island shape. |
| p_noise_r | Optional radial noise field (same size as mask). |
| apex_elevation | Maximum elevation at island center. |
| filter_distance | Enable smoothing of the distance transform. |
| filter_ir | Radius of the distance filter. |
| slope_min | Minimum slope. |
| slope_max | Maximum slope. |
| slope_start | Start of slope ramp (0–1). |
| slope_end | End of slope ramp (0–1). |
| slope_noise_intensity | Intensity of slope noise modulation. |
| k_smooth | Smoothing factor for the final profile. |
| radial_noise_intensity | Intensity of radial displacement noise. |
| radial_profile_gain | Exponent for radial falloff. |
| water_decay | Transition sharpness to water level. |
| water_depth | Water depth below the shoreline. |
| lee_angle | Angle for lee-side (wind shadow) erosion. |
| lee_amp | Amplitude of lee-side erosion. |
| uplift_amp | Amplitude of uplift (orographic) effect. |
| p_water_depth | Optional output: per-pixel water depth. |
| p_inland_mask | Optional output: mask of inland pixels. |
Example
Result
| Array hmap::gpu::island | ( | const Array & | land_mask, |
| std::uint32_t | seed, | ||
| float | noise_amp = 0.07f, | ||
| glm::vec2 | noise_kw = {4.f, 4.f}, | ||
| int | noise_octaves = 8, | ||
| float | noise_rugosity = 0.7f, | ||
| float | noise_angle = 45.f, | ||
| float | noise_k_smoothing = 0.05f, | ||
| float | apex_elevation = 1.f, | ||
| bool | filter_distance = true, | ||
| int | filter_ir = 32, | ||
| float | slope_min = 0.1f, | ||
| float | slope_max = 8.f, | ||
| float | slope_start = 0.5f, | ||
| float | slope_end = 1.f, | ||
| float | slope_noise_intensity = 0.5f, | ||
| float | k_smooth = 0.05f, | ||
| float | radial_noise_intensity = 0.3f, | ||
| float | radial_profile_gain = 2.f, | ||
| float | water_decay = 0.05f, | ||
| float | water_depth = 0.3f, | ||
| float | lee_angle = 30.f, | ||
| float | lee_amp = 0.f, | ||
| float | uplift_amp = 0.f, | ||
| Array * | p_water_depth = nullptr, | ||
| Array * | p_inland_mask = nullptr ) |
Generates an island heightmap from a land mask using internally generated FBM noise for radial perturbation and slope modulation.
Same as the other overload but creates a noise field procedurally from a seed, including frequency, octaves, orientation, and smoothing controls.
| land_mask | Binary mask defining the island shape. |
| seed | Noise seed. |
| noise_amp | Amplitude of generated noise. |
| noise_kw | Noise frequencies (x, y). |
| noise_octaves | Number of FBM octaves. |
| noise_rugosity | Persistence-like roughness control. |
| noise_angle | Rotation of the noise field (radians). |
| noise_k_smoothing | Smoothing applied to the noise field. |
| apex_elevation | Maximum elevation at island center. |
| filter_distance | Enable smoothing of the distance transform. |
| filter_ir | Radius of distance filter. |
| slope_min | Minimum slope. |
| slope_max | Maximum slope. |
| slope_start | Start of slope ramp (0–1). |
| slope_end | End of slope ramp (0–1). |
| slope_noise_intensity | Intensity of slope noise modulation. |
| k_smooth | Smoothing factor for final profile. |
| radial_noise_intensity | Intensity of radial displacement noise. |
| radial_profile_gain | Exponent for radial falloff. |
| water_decay | Transition sharpness to water level. |
| water_depth | Water depth below the shoreline. |
| lee_angle | Angle for lee-side erosion. |
| lee_amp | Amplitude for lee-side erosion. |
| uplift_amp | Amplitude of uplift (orographic) effect. |
| p_water_depth | Optional output: per-pixel water depth. |
| p_inland_mask | Optional output: mask of inland pixels. |
Example
Result
| Array hmap::gpu::mountain_cone | ( | glm::ivec2 | shape, |
| std::uint32_t | seed, | ||
| float | scale = 1.f, | ||
| int | octaves = 8, | ||
| float | peak_kw = 4.f, | ||
| float | rugosity = 0.f, | ||
| float | angle = 45.f, | ||
| float | bias = 0.f, | ||
| float | k_smoothing = 0.f, | ||
| float | gamma = 0.5f, | ||
| float | cone_alpha = 1.f, | ||
| float | ridge_amp = 0.4f, | ||
| float | base_noise_amp = 0.05f, | ||
| glm::vec2 | center = {0.5f, 0.5f}, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a procedural "mountain cone" heightmap using fractal noise and Voronoi patterns.
This function synthesizes a terrain-like array shaped as a cone with noise-based ridges and surface roughness. The generation combines a cone-shaped envelope (cone_sigmoid), a fractal base noise (gpu::noise_fbm), and a Voronoi ridge structure (voronoi_fbm), producing a mountain with controlled smoothness, angular distortion, and noise-based displacements.
| shape | The output array dimensions (width, height). |
| seed | The random seed for noise generation. |
| scale | Global scaling factor for the mountain size. |
| octaves | Number of fractal noise octaves for both FBM and Voronoi. |
| peak_kw | Controls the base frequency (inverse wavelength) of the peak noise. |
| rugosity | Controls the amplitude decay across octaves (higher = rougher surface). |
| angle | Direction (in degrees) for the displacement noise distortion. |
| bias | Reach bonus bias for weighted Voronoi partitioning. |
| k_smoothing | Smoothing factor applied in Voronoi blending. |
| gamma | Gamma correction exponent applied at the end. |
| cone_alpha | Controls the cone envelope steepness (higher = sharper peak). |
| ridge_amp | Controls the amplitude of ridge enhancement in the Voronoi term. |
| base_noise_amp | Amplitude multiplier for the displacement noise. |
| center | The 2D position (in normalized coordinates) of the mountain cone center. |
| p_noise_x | Optional pointer to an external X displacement noise field (can be nullptr). |
| p_noise_y | Optional pointer to an external Y displacement noise field (can be nullptr). |
| bbox | The bounding box (min_x, min_y, max_x, max_y) defining the spatial extent of the map. |
Example
Result
| Array hmap::gpu::mountain_inselberg | ( | glm::ivec2 | shape, |
| std::uint32_t | seed, | ||
| float | scale = 1.f, | ||
| int | octaves = 8, | ||
| float | rugosity = 0.2f, | ||
| float | angle = 45.f, | ||
| float | gamma = 1.1f, | ||
| bool | round_shape = false, | ||
| bool | add_deposition = true, | ||
| float | bulk_amp = 0.2f, | ||
| float | base_noise_amp = 0.2f, | ||
| float | bias = 0.f, | ||
| float | k_smoothing = 0.1f, | ||
| glm::vec2 | center = {0.5f, 0.5f}, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a synthetic mountain-like inselberg (isolated hill) heightmap.
This function procedurally creates a 2D elevation field resembling an inselberg, using a combination of fractal noise (FBM), Gaussian pulses, and Voronoi-based structures. It allows control over scale, shape, orientation, rugosity, and optional geological-like effects such as bulk uplift and deposition smoothing.
| shape | Output array shape (resolution in x and y). |
| seed | Random seed used for noise and Voronoi generation. |
| scale | Global scaling factor for the inselberg width and structure. |
| rugosity | Controls roughness of the fractal noise (higher = more irregular). |
| angle | Orientation angle (degrees) for directional displacements. |
| gamma | Gamma correction factor applied to the final heightmap. |
| round_shape | If true, generates a symmetric round shape; if false, adds directional displacement. |
| add_deposition | If true, applies a smoothing fill step simulating sediment deposition. |
| bulk_amp | Amplitude of bulk uplift applied to the base pulse (0 = none, >0 = raises and normalizes the feature). |
| base_noise_amp | Amplitude of the base displacement noise. |
| bias | Reach bonus bias for weighted Voronoi partitioning. |
| k_smoothing | Voronoi smoothing parameter (controls ridge sharpness). |
| center | Center of the inselberg in normalized coordinates. |
| p_noise_x | Optional pointer to external displacement noise field (X-axis). |
| p_noise_y | Optional pointer to external displacement noise field (Y-axis). |
| bbox | Bounding box of the generation domain in normalized coordinates. |
Example
Result**
| Array hmap::gpu::mountain_range_radial | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| float | half_width = 0.2f, | ||
| float | angle_spread_ratio = 0.5f, | ||
| float | core_size_ratio = 1.f, | ||
| glm::vec2 | 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, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
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::mountain_stump | ( | glm::ivec2 | shape, |
| std::uint32_t | seed, | ||
| float | scale = 1.f, | ||
| int | octaves = 8, | ||
| float | peak_kw = 6.f, | ||
| float | rugosity = 0.f, | ||
| float | angle = 45.f, | ||
| float | k_smoothing = 0.f, | ||
| float | gamma = 0.25f, | ||
| bool | add_deposition = true, | ||
| float | ridge_amp = 0.75f, | ||
| float | base_noise_amp = 0.1f, | ||
| glm::vec2 | center = {0.5f, 0.5f}, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a mountain-like heightmap with a flattened (stump-shaped) peak.
This function procedurally creates a terrain resembling a broad mountain with a smooth, truncated summit. The result combines layered fractal noise (FBM), Gaussian shaping, and Voronoi-based ridge formation to produce natural-looking geomorphological features. The shape can be modulated by directional displacement noise, smoothed using deposition simulation, and refined through gamma and smoothing parameters.
| shape | Dimensions of the output heightmap (width, height). |
| seed | Random seed for noise generation. |
| scale | Global scale factor controlling the size of features. |
| octaves | Number of noise octaves used in FBM generation. |
| peak_kw | Base spatial frequency of the main ridge/peak structure. |
| rugosity | Controls the roughness of base noise displacements. |
| angle | Orientation angle (in degrees) of the main ridge direction. |
| k_smoothing | Smoothing coefficient applied to the Voronoi FBM ridges. |
| gamma | Gamma correction applied to the ridge intensity. |
| add_deposition | If true, applies an additional smoothing pass to simulate sediment deposition. |
| ridge_amp | Amplitude scaling factor for ridge prominence. |
| base_noise_amp | Amplitude scaling factor for base displacement noise. |
| center | Normalized coordinates of the mountain’s center (default domain: [0, 1]²). |
| p_noise_x | Optional pointer to horizontal displacement noise (nullptr for none). |
| p_noise_y | Optional pointer to vertical displacement noise (nullptr for none). |
| bbox | Bounding box of the generated region (xmin, xmax, ymin, ymax). |
Example
Result
| Array hmap::gpu::mountain_tibesti | ( | glm::ivec2 | shape, |
| std::uint32_t | seed, | ||
| float | scale = 1.f, | ||
| int | octaves = 8, | ||
| float | peak_kw = 20.f, | ||
| float | rugosity = 0.f, | ||
| float | angle = 30.f, | ||
| float | angle_spread_ratio = 0.25f, | ||
| float | gamma = 1.f, | ||
| bool | add_deposition = true, | ||
| float | bulk_amp = 1.f, | ||
| float | base_noise_amp = 0.1f, | ||
| glm::vec2 | center = {0.5f, 0.5f}, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a synthetic "Tibesti" mountain heightmap.
This function procedurally creates a 2D elevation field inspired by the Tibesti mountains, a desert volcanic range. The terrain is built by combining Gabor wavelets, fractal simplex noise, and a Gaussian envelope, producing sharp volcanic peaks modulated by erosion-like patterns.
| shape | Output array shape (resolution in x and y). |
| seed | Random seed used for noise and wavelet generation. |
| scale | Global scaling factor controlling the overall mountain size. |
| octaves | Number of octaves used in the fractal noise and Gabor FBM. |
| peak_kw | Base frequency of the peak features (scaled internally by scale). |
| rugosity | Controls roughness of the fractal noise (higher = more irregular). |
| angle | Orientation angle (degrees) for Gabor waves. |
| angle_spread_ratio | Spread ratio of the Gabor wave orientation (controls anisotropy). |
| gamma | Gamma correction factor applied to auxiliary noise fields. |
| add_deposition | If true, applies a smoothing fill step simulating sediment deposition. |
| bulk_amp | Amplitude of bulk uplift applied to the peaks (affects normalization with noise weighting). |
| base_noise_amp | Amplitude of the base displacement noise. |
| center | Center of the mountain in normalized coordinates. |
| p_noise_x | Optional pointer to external displacement noise field (X-axis). |
| p_noise_y | Optional pointer to external displacement noise field (Y-axis). |
| bbox | Bounding box of the generation domain in normalized coordinates. |
Example
Result
| Array hmap::gpu::plates | ( | glm::ivec2 | shape, |
| glm::vec2 | kw, | ||
| std::uint32_t | seed, | ||
| float | talus, | ||
| int | direction = 0, | ||
| float | mix_ratio = 0.9f, | ||
| float | bias = 0.f, | ||
| float | base_noise_amp = 0.05f, | ||
| float | kw_multiplier = 2.f, | ||
| int | octaves = 8, | ||
| float | rugosity = 0.f, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generate a tectonic plate–like heightfield using Voronoi FBM and directional talus projection.
Combines Voronoi edge-distance FBM with a base noise displacement, then applies a talus projection along a given direction and blends the result with the original field.
| shape | Grid resolution. |
| kw | Base wavelength/frequency. |
| seed | Random seed. |
| talus | Talus strength for directional projection. |
| direction | Projection direction. |
| mix_ratio | Blend factor between raw Voronoi and projected plates. |
| bias | Reach bonus bias for weighted Voronoi partitioning. |
| base_noise_amp | Amplitude of the displacement noise. |
| kw_multiplier | Frequency multiplier for base noise. |
| rugosity | Noise roughness. |
| bbox | Bounding box for noise evaluation. |
Example
Result
| Array hmap::gpu::shattered_peak | ( | glm::ivec2 | shape, |
| std::uint32_t | seed, | ||
| float | scale = 1.f, | ||
| int | octaves = 8, | ||
| float | peak_kw = 4.f, | ||
| float | rugosity = 0.f, | ||
| float | angle = 30.f, | ||
| float | gamma = 1.f, | ||
| bool | add_deposition = true, | ||
| float | bulk_amp = 0.3f, | ||
| float | base_noise_amp = 0.1f, | ||
| float | bias = 0.f, | ||
| float | k_smoothing = 0.f, | ||
| glm::vec2 | center = {0.5f, 0.5f}, | ||
| const Array * | p_noise_x = nullptr, | ||
| const Array * | p_noise_y = nullptr, | ||
| const UvRect & | uv_rect = UvRect::unit() ) |
Generates a synthetic "shattered peak" terrain heightmap.
This function procedurally creates a 2D elevation field resembling a sharp, fractured mountain peak. It combines a Gaussian pulse envelope, fractal noise displacements, and Voronoi-based primitives with edge-distance shaping. The result is a rugged peak structure with broken ridges and steep slopes.
| shape | Output array shape (resolution in x and y). |
| seed | Random seed used for noise and Voronoi generation. |
| scale | Global scaling factor controlling the overall peak size. |
| peak_kw | Base frequency of the peak features (scaled internally by scale). |
| rugosity | Controls roughness of the fractal noise (higher = more irregular). |
| angle | Orientation angle (degrees) for directional displacements. |
| gamma | Gamma correction factor applied to the final heightmap. |
| add_deposition | If true, applies a smoothing fill step simulating sediment deposition. |
| bulk_amp | Amplitude of bulk uplift applied to the peak (internally overridden to 0.5f for normalization). |
| base_noise_amp | Amplitude of the base displacement noise. |
| bias | Reach bonus bias for weighted Voronoi partitioning. |
| k_smoothing | Voronoi smoothing parameter (controls ridge sharpness). |
| center | Center of the peak in normalized coordinates. |
| p_noise_x | Optional pointer to external displacement noise field (X-axis). |
| p_noise_y | Optional pointer to external displacement noise field (Y-axis). |
| bbox | Bounding box of the generation domain in normalized coordinates. |
Example
Result
| Array hmap::gpu::select_cavities | ( | const Array & | array, |
| int | ir, | ||
| bool | concave = true, | ||
| bool | normalize = false, | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
| Array hmap::gpu::select_soil_flow | ( | const Array & | z, |
| int | ir_gradient = 1, | ||
| float | gradient_weight = 1.f, | ||
| float | gradient_scaling_factor = 0.f, | ||
| float | flow_weight = 0.05f, | ||
| float | talus_ref = 0.f, | ||
| float | clipping_ratio = 50.f, | ||
| float | flow_gamma = 1.f, | ||
| float | k_smooth = 0.01f, | ||
| bool | normalize = false, | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Computes a soil–flow selection map based on terrain gradient, river mask, and smoothing parameters.
| z | Input heightmap. |
| ir_gradient | Radius used for the morphological gradient. |
| gradient_weight | Weight applied to the gradient magnitude. |
| gradient_scaling_factor | Scaling factor applied to the gradient; defaults to z.shape.x if <= 0. |
| talus_ref | Reference talus value for river extraction; defaults to 1.f / z.shape.x if <= 0. |
| clipping_ratio | Clipping ratio used in the river selection step. |
| flow_gamma | Gamma correction exponent applied to the river mask; 1.0 disables correction. |
| k_smooth | Smoothing parameter for the maximum blending. |
| normalize | If true, normalize and clip output to [0, 1] using standard deviation with a smooth transition. |
| comm | Communicator for collective normalization. |
Example
Result
| Array hmap::gpu::select_soil_rocks | ( | const Array & | z, |
| int | ir_max = 64, | ||
| int | ir_min = 0, | ||
| int | steps = 4, | ||
| float | smaller_scales_weight = 1.f, | ||
| ClampMode | curvature_clamp_mode = ClampMode::POSITIVE_ONLY, | ||
| float | curvature_clamping = 1.f, | ||
| bool | normalize = false, | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Computes a multi-scale soil/rock selector using curvature analysis.
Applies progressively increasing smoothing radii in logarithmic steps (handling ir_min = 0), computes the mean curvature at each scale, clamps it, and accumulates the maximum response across all scales.
| z | Input heightmap or scalar field. |
| ir_max | Maximum smoothing radius (log-scale upper bound). |
| ir_min | Minimum smoothing radius (0 allowed; replaced by 1 for log scale). |
| steps | Number of logarithmic scales to evaluate. |
| smaller_scales_weight | Weight factor applied when descending scales. |
| curvature_clamp_mode | Mode used to clamp curvature values. |
| curvature_clamping | Curvature clamp threshold. |
| normalize | If true, normalize and clip output to [0, 1] using standard deviation with a smooth transition. |
| comm | Communicator for collective normalization. |
Example
Result
| Array hmap::gpu::select_soil_weathered | ( | const Array & | z, |
| int | ir_curvature = 0, | ||
| int | ir_gradient = 4, | ||
| ClampMode | curvature_clamp_mode = ClampMode::POSITIVE_ONLY, | ||
| float | curvature_clamping = 10.f, | ||
| float | curvature_weight = 1.f, | ||
| float | gradient_weight = 1.f, | ||
| float | gradient_scaling_factor = 0.f, | ||
| bool | normalize = false, | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Computes a soil weathering selection map based on curvature and gradient analysis.
This function generates a combined array representing the degree of soil weathering using two main components:
| z | Input heightmap or scalar field. |
| ir_curvature | Radius (in pixels or samples) for curvature smoothing. If zero, curvature smoothing is skipped. |
| ir_gradient | Radius (in pixels or samples) for gradient computation. |
| curvature_clamp_mode | Clamping mode applied to curvature values (see ::ClampMode). |
| curvature_clamping | Maximum absolute value used for curvature clamping. |
| curvature_weight | Weight applied to the curvature component in the final mix. |
| gradient_weight | Weight applied to the gradient component in the final mix. |
| gradient_scaling_factor | Empirical scaling factor for both curvature and gradient terms. If non-positive, defaults to z.shape.x. |
| normalize | If true, normalize and clip output to [0, 1] using standard deviation with a smooth transition. |
| comm | Communicator for collective normalization. |
Example
Result
| Array hmap::gpu::select_soil_weathered | ( | const Array & | z, |
| const Array & | gradient_norm, | ||
| int | ir_curvature, | ||
| ClampMode | curvature_clamp_mode, | ||
| float | curvature_clamping, | ||
| float | curvature_weight, | ||
| float | gradient_weight, | ||
| float | gradient_scaling_factor, | ||
| bool | normalize = false, | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
| Array hmap::gpu::select_slope | ( | const Array & | z, |
| int | ir = 0, | ||
| bool | normalize = false, | ||
| MinMaxKernel | kernel_type = MinMaxKernel::OCTAGON, | ||
| const UvTile & | region = UvTile::dummy(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Selects terrain slope.
Computes slope from heightmap. If ir == 0, uses gradient norm; if ir > 0, uses morphological gradient with kernel radius ir.
| z | Input heightmap. |
| ir | Kernel radius. If 0, uses gradient norm; if > 0, uses morphological gradient. |
| normalize | If true, normalize and clip output to [0, 1] using standard deviation with a smooth transition. |
| kernel_type | Kernel footprint type (default: MinMaxKernel::OCTAGON). |
| comm | Communicator for collective normalization. |
| Array hmap::gpu::select_valley | ( | const Array & | z, |
| int | ir, | ||
| bool | ridge_select = false, | ||
| bool | normalize = false, | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
See hmap::select_valley.
| void hmap::gpu::fill_masked_holes | ( | Array & | z, |
| const Array & | mask, | ||
| int | iterations_max = 500, | ||
| float | tolerance = 1e-5f, | ||
| float | omega = 0.f, | ||
| float | detail_amplitude = 1.f, | ||
| int | patch_size = 16, | ||
| std::uint32_t | seed = 0, | ||
| int | sync_interval = 1, | ||
| const UvTile & | region = UvTile::unit(), | ||
| ICommunicator & | comm = SingleArrayComm::instance() ) |
Fill masked holes in a heightmap by reconstructing the masked regions from the surrounding terrain using GPU biharmonic interpolation.
Uses tileable GPU biharmonic interpolation to smoothly reconstruct the masked holes with $C^1$ continuity while preserving the original terrain outside the mask.
| z | Heightmap to modify in-place. |
| mask | Hole mask in [0, 1] (> 0 = holes to fill, <= 0 = preserved terrain). |
| iterations_max | Maximum number of iterations. |
| tolerance | Convergence tolerance for biharmonic interpolation. |
| omega | Relaxation factor (0 = auto-computed default 0.5). |
| detail_amplitude | Amplitude of gradient-patch detail injected inside the hole (0.f = pure smooth harmonic fill). |
| patch_size | Side length of gradient patches harvested from the unmasked terrain (if < 4, detail transfer is skipped). |
| seed | Random seed for deterministic patch selection. |
| sync_interval | Halo synchronization interval for tiled execution. |
| region | Tile descriptor for tiled execution. |
| comm | Communicator for tiled execution. |
| Array hmap::gpu::advection_particle | ( | const Array & | z, |
| const Array & | advected_field, | ||
| int | iterations, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
Performs particle-based advection on a scalar field.
This function advects particles through a velocity field (or gradient field) derived from the input array z. Each particle carries a value from the advected_field and evolves over a number of iterations according to advection parameters such as inertia and persistence. Optionally, advection and masking fields can be applied to control which areas are affected.
| z | Input scalar field defining the base flow or gradient field used for particle advection. |
| advected_field | The scalar field whose values are transported along particle trajectories. |
| iterations | Number of advection iterations to perform per particle. |
| nparticles | Number of particles to simulate during advection. |
| seed | Random seed used for initializing particle positions and stochastic behavior. |
| reverse | If true, reverses the advection direction (useful for backtracing or inverse advection). |
| post_filter | If true, applies a smoothing or filtering operation after advection to reduce artifacts. |
| advection_length | Maximum advection step length per iteration (controls particle displacement scale). |
| value_persistence | Controls how much of a particle’s advected value is preserved between iterations (1.0 means full preservation, lower values introduce decay). |
| inertia | Controls how much a particle’s previous velocity affects its next step (simulates momentum). |
| p_advection_mask | Optional mask array controlling where advection occurs (nullptr to disable). |
| p_mask | Optional general mask restricting where output values are written (nullptr to disable). |
advected_field after applying particle advection.Example
Result
| std::vector< Array > hmap::gpu::advection_particle | ( | const Array & | z, |
| const std::vector< const Array * > & | advected_fields, | ||
| int | iterations, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| std::vector< Array > hmap::gpu::advection_particle | ( | const Array & | z, |
| const std::vector< Array > & | advected_fields, | ||
| int | iterations, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::advection_particle | ( | const Array & | z, |
| const Array & | advected_field, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| std::vector< Array > hmap::gpu::advection_particle | ( | const Array & | z, |
| const std::vector< const Array * > & | advected_fields, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| std::vector< Array > hmap::gpu::advection_particle | ( | const Array & | z, |
| const std::vector< Array > & | advected_fields, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::advection_particle | ( | const Array & | dx, |
| const Array & | dy, | ||
| const Array & | advected_field, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| std::vector< Array > hmap::gpu::advection_particle | ( | const Array & | dx, |
| const Array & | dy, | ||
| const std::vector< const Array * > & | advected_fields, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| std::vector< Array > hmap::gpu::advection_particle | ( | const Array & | dx, |
| const Array & | dy, | ||
| const std::vector< Array > & | advected_fields, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Texture hmap::gpu::advection_particle | ( | const Array & | z, |
| const Texture & | texture, | ||
| int | iterations, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Texture hmap::gpu::advection_particle | ( | const Array & | z, |
| const Texture & | texture, | ||
| int | nparticles, | ||
| std::uint32_t | seed, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Array hmap::gpu::advection_particle_multiscale | ( | const Array & | z, |
| const Array & | advected_field, | ||
| std::uint32_t | seed, | ||
| const std::vector< int > & | steps_per_level = {4, 2, 1}, | ||
| float | particles_ratio = 0.5f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| float | mix = 1.f, | ||
| float | warp = 0.f, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
Performs multiscale particle-based advection on a scalar field.
This function advects particles through a gradient field derived from the input heightmap z across a geometric hierarchy of resolution levels, applying coarse-to-fine delta upsampling with optional domain warping.
| z | Input scalar field defining the base flow. |
| advected_field | The scalar field whose values are transported. |
| seed | Random seed for particle positions and warping. |
| steps_per_level | Number of particle steps / iterations per level. |
| particles_ratio | Ratio of particles relative to grid cells. |
| advection_length | Maximum advection step length per iteration. |
| value_persistence | Controls how much of the advected value is preserved. |
| inertia | Momentum factor for particle velocity. |
| mix | Blend factor for coarse advection deltas into the field. |
| warp | Domain warp amplitude during delta upsampling. |
| reverse | If true, reverses the advection direction. |
| post_filter | If true, applies Laplace smoothing post-filter. |
| post_filter_sigma | Laplace smoothing sigma parameter. |
| p_advection_mask | Optional mask controlling where advection occurs. |
| p_mask | Optional general mask restricting output values. |
| std::vector< Array > hmap::gpu::advection_particle_multiscale | ( | const Array & | z, |
| const std::vector< const Array * > & | advected_fields, | ||
| std::uint32_t | seed, | ||
| const std::vector< int > & | steps_per_level = {4, 2, 1}, | ||
| float | particles_ratio = 0.5f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| float | mix = 1.f, | ||
| float | warp = 0.f, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| std::vector< Array > hmap::gpu::advection_particle_multiscale | ( | const Array & | z, |
| const std::vector< Array > & | advected_fields, | ||
| std::uint32_t | seed, | ||
| const std::vector< int > & | steps_per_level = {4, 2, 1}, | ||
| float | particles_ratio = 0.5f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| float | mix = 1.f, | ||
| float | warp = 0.f, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Texture hmap::gpu::advection_particle_multiscale | ( | const Array & | z, |
| const Texture & | texture, | ||
| std::uint32_t | seed, | ||
| const std::vector< int > & | steps_per_level = {4, 2, 1}, | ||
| float | particles_ratio = 0.5f, | ||
| float | advection_length = 0.1f, | ||
| float | value_persistence = 0.99f, | ||
| float | inertia = 0.f, | ||
| float | mix = 1.f, | ||
| float | warp = 0.f, | ||
| bool | reverse = false, | ||
| bool | post_filter = true, | ||
| float | post_filter_sigma = 0.125f, | ||
| const Array * | p_advection_mask = nullptr, | ||
| const Array * | p_mask = 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::rotate | ( | Array & | array, |
| float | angle, | ||
| bool | zoom_in = true ) |
See hmap::rotate.
See hmap::warp.
| float hmap::gpu::helper_vflow_compute_adaptive_dt | ( | const Array & | h, |
| float | viscosity, | ||
| float | power ) |
| glm::vec4 hmap::gpu::helper_transform_bbox | ( | const UvRect & | uv_rect_source, |
| const UvRect & | uv_rect_target ) |
| void hmap::gpu::helper_bind_optional_buffers | ( | clwrapper::Run & | run, |
| const Array * | p_noise_x, | ||
| const Array * | p_noise_y ) |
|
inline |
|
inline |
|
inline |