HighMap library (C++)
Loading...
Searching...
No Matches
carving.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  hmap

Enumerations

enum  hmap::ElevationLongitudinalProfile : int { hmap::ELP_UNCHANGED , hmap::ELP_FLAT , hmap::ELP_DECREASING , hmap::ELP_INCREASING }

Functions

void hmap::carve_river (Array &z, const Graph &graph, float talus, float outlet_width, float headwater_width=0.f, float width_exponent=0.5f, float depth=0.05f, float depth_exponent=0.3f, std::uint32_t seed=0, float talus_noise_ratio=0.f, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP_UPPER, float radial_profile_parameter=2.f, Array *p_river_mask=nullptr, const UvRect &uv_rect=UvRect::unit())
 Carves a continuous river network into a heightmap along a directed flow Graph.
void hmap::dig_path (Array &z, Path &path, int width=1, int decay=2, int flattening_radius=16, bool force_downhill=false, const UvRect &uv_rect=UvRect::unit(), float depth=0.f)
 Dig a path on a heightmap.
void hmap::flatten_around_points (Array &z, const std::vector< float > &xp, const std::vector< float > &yp, const std::vector< float > &zp, const std::vector< float > &radius, float strength=1.0f, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP, float profile_param=1.0f, Array *p_mask=nullptr, const UvRect &uv_rect=UvRect::unit())
 Flattens a heightmap locally around a set of reference points.
void hmap::flatten_around_points (Array &z, const std::vector< float > &xp, const std::vector< float > &yp, const std::vector< float > &zp, float radius=0.2f, float strength=1.0f, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP, float profile_param=1.0f, Array *p_mask=nullptr, const UvRect &uv_rect=UvRect::unit())
 Overload of flatten_around_points with a single radius shared by all points.
void hmap::flatten_around_points_terrain_aware (Array &z, const std::vector< float > &xp, const std::vector< float > &yp, const std::vector< float > &zp, const std::vector< float > &radius, float slope_weight=1.f, float uphill_weight=2.f, float max_height_above=-1.f, float terrain_follow=0.5f, float strength=1.f, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP, float profile_param=1.f, Array *p_mask=nullptr, const UvRect &uv_rect=UvRect::unit())
 Terrain-aware flattening around a set of seed points.
void hmap::flatten_around_points_terrain_aware (Array &z, const std::vector< float > &xp, const std::vector< float > &yp, const std::vector< float > &zp, float radius, float slope_weight=1.f, float uphill_weight=2.f, float max_height_above=-1.f, float terrain_follow=0.5f, float strength=1.f, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP, float profile_param=1.f, Array *p_mask=nullptr, const UvRect &uv_rect=UvRect::unit())
 Overload with a single radius shared by all seeds.
void hmap::flatbed_carve (Array &z, const Path &path, float bottom_extent=32.f, float vmin=0.1f, float depth=0.05f, float falloff_distance=128.f, float outer_slope=0.1f, bool preserve_bedshape=true, RadialProfile radial_profile=RadialProfile::RP_GAIN, float radial_profile_parameter=2.f, Array *p_falloff_mask=nullptr, const Array *p_noise_r=nullptr, const UvRect &uv_rect=UvRect::unit())
 Blends a flatbed carve into an existing heightmap.
void hmap::trench (Array &z, const Path &path, float width, bool enable_width_depth_scaling=true, bool enable_width_distance_scaling=true, bool enable_width_curvature_scaling=false, float curvature_radius_min=1.f, float curv_width_ratio_min=0.5f, float curv_width_ratio_max=2.f, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP_UPPER, float radial_profile_parameter=2.f, ElevationLongitudinalProfile longitudinal_profile=ElevationLongitudinalProfile::ELP_DECREASING, float elevation_shift=-0.05f, float shift_ramp_start_ratio=0.f, float shift_ramp_end_ratio=0.f, float min_slope=0.001f, size_t k_neighbors=8, const Array *p_noise_r=nullptr, Array *p_bending_mask=nullptr, int tile_size=32, const UvRect &uv_rect=UvRect::unit())
 Carves a trench along a given path into a heightmap.
void hmap::trench (Array &z, const std::vector< Path > &paths, float width, bool enable_width_depth_scaling=true, bool enable_width_distance_scaling=true, bool enable_width_curvature_scaling=false, float curvature_radius_min=1.f, float curv_width_ratio_min=0.5f, float curv_width_ratio_max=2.f, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP_UPPER, float radial_profile_parameter=2.f, ElevationLongitudinalProfile longitudinal_profile=ElevationLongitudinalProfile::ELP_DECREASING, float elevation_shift=-0.05f, float shift_ramp_start_ratio=0.f, float shift_ramp_end_ratio=0.f, float min_slope=0.001f, size_t k_neighbors=8, const Array *p_noise_r=nullptr, Array *p_bending_mask=nullptr, int tile_size=32, const UvRect &uv_rect=UvRect::unit())
void hmap::trench (Array &z, const Graph &graph, const std::vector< float > &relative_widths, float width, bool enable_width_depth_scaling=true, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP_UPPER, float radial_profile_parameter=2.f, ElevationLongitudinalProfile longitudinal_profile=ElevationLongitudinalProfile::ELP_DECREASING, float elevation_shift=-0.05f, float min_slope=0.001f, const Array *p_noise_r=nullptr, Array *p_bending_mask=nullptr, int tile_size=32, const UvRect &uv_rect=UvRect::unit())
 Carves river channels for an entire flow network represented by a Graph with per-node relative widths.
void hmap::trench (Array &z, const Graph &graph, float width, float width_exponent=1.0f, bool enable_width_depth_scaling=true, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP_UPPER, float radial_profile_parameter=2.f, ElevationLongitudinalProfile longitudinal_profile=ElevationLongitudinalProfile::ELP_DECREASING, float elevation_shift=-0.05f, float min_slope=0.001f, const Array *p_noise_r=nullptr, Array *p_bending_mask=nullptr, int tile_size=32, const UvRect &uv_rect=UvRect::unit())
 Carves river channels for an entire flow network represented by a Graph, computing relative widths from distance to outlet.