Crates.io | normal-heights |
lib.rs | normal-heights |
version | 0.1.2 |
source | src |
created_at | 2020-08-16 22:31:55.874027 |
updated_at | 2023-03-11 19:05:02.871607 |
description | Creates normal maps from height maps. |
homepage | |
repository | https://github.com/8bittree/normal_heights |
max_upload_size | |
id | 277368 |
size | 898,611 |
Just a simple (rust) library to create a normal map from a height map.
Also includes a thin CLI wrapper.
let img = image::open(input)?;
let normal_map = normal_heights::map_normals(&img);
normal_map.save(output)?;
let img = image::open(input)?;
let strength = 3.14;
let normal_map = normal_heights::map_normals_with_strength(&img, strength);
normal_map.save(output)?;
For a fully executable example, see src/main.rs.
USAGE:
normal-heights [OPTIONS] <INPUT> <OUTPUT>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-s, --strength <strength>
Strength of the resulting normal map. [default: 6.0]
ARGS:
<INPUT> Input height map image file.
<OUTPUT> Filename to write the normal map to.
normal-heights heightmap.png normalmap.png
See Image crate, version 0.23.7.
Input:
Output (strength 3.14):
Output (strength 8):
Input:
Output (default strength 6):