#create #maps #height #graphics #shapes #world #normal-map

bin+lib normal-heights

从高度图创建法线图

3 个版本

0.1.2 2023年3月11日
0.1.1 2020年8月20日
0.1.0 2020年8月16日

#529 in 图像

MIT 许可证

695KB
135

Normal_Heights

只是一个简单的(Rust)库,用于从高度图创建法线图。

还包括一个简单的 CLI 包装器。

库使用示例

    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)?;

对于完整的可执行示例,请参阅 src/main.rs。

CLI 包装器

帮助字符串

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

支持的图像格式

参见 Image crate,版本 0.23.7

输出示例

其他形状

输入

Input shapes heightmap

输出(强度 3.14)

shapes normal map with strength 3.14

输出(强度 8)

shapes normal map with strength 8

世界

输入

Input world heightmap

输出(默认强度 6)

world normal map with default strength 6

依赖项

~14MB
~62K SLoC