#bevy-game-engine #png #bevy

bevy_heightmap

Create meshes from heightmap PNGs in the Bevy game engine

11 releases (6 breaking)

Uses new Rust 2024

0.7.0 Oct 6, 2025
0.5.0 Aug 11, 2025
0.4.1 Jul 3, 2025
0.3.0 Dec 1, 2024
0.2.1 Jul 15, 2024

#957 in Game dev

Download history 18/week @ 2025-10-14 8/week @ 2025-10-21 1/week @ 2025-10-28 27/week @ 2025-12-16 3/week @ 2025-12-23

655 downloads per month
Used in benthic_ui

MIT/Apache

3MB
269 lines

bevy_heightmap

License Crates.io Docs

Load height map PNGs as meshes in bevy.

Height map Generated
example_image example_image

Usage

Create a height map from a value function:

use bevy::prelude::*;
use bevy_heightmap::*;
let heightmap = ValueFunctionHeightMap(|p: Vec2| ((20. * p.x).sin() + (20. * p.y).sin()) / 2.);
let mesh: Mesh = heightmap.build_mesh(UVec2::new(10, 10));
assert_eq!(mesh.count_vertices(), 4 * 10 * 10);

Load a height map as a mesh from an image (requires .hmp.png extension):

use bevy::prelude::*;
use bevy_heightmap::*;
fn setup(asset_server: Res<AssetServer>) {
    let mesh: Handle<Mesh> = asset_server.load("textures/terrain.hmp.png");
}

Examples

cargo run --example image

Bevy support table

bevy bevy_heightmap
0.17 0.7.0
0.16 0.4.1-0.6.1
0.15 0.3.0
0.14 0.2.0
0.13 0.1.0

Dependencies

~57–96MB
~1.5M SLoC