Zolo101 / normal_heights_labpbr

Creates normal (labPBR) maps from height maps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Normal_Heights_LabPBR

Just a simple (rust) library to create a normal LabPBR map from a height map.

See LabPBR Docs for more information.

Material AO (Blue channel) not implemented yet.

Also includes a thin CLI wrapper.

Example Library Usage

    let img = image::open(input)?;
    let normal_map = normal_heights_labpbr::map_normals(&img);
    normal_map.save(output)?;
    let img = image::open(input)?;
    let strength = 3.14;
    let normal_map = normal_heights_labpbr::map_normals_with_strength(&img, strength);
    normal_map.save(output)?;

For a fully executable example, see src/main.rs.

CLI Wrapper

Help String

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.

Example Usage

    normal-heights-labpr heightmap.png normalmap.png

Supported Image Formats

See Image crate, version ^0.25.2.

Example Output

Misc shapes:

Input:

Input shapes heightmap

Output (strength 3.14):

shapes normal map with strength 3.14

Output (strength 8):

shapes normal map with strength 8

World:

Input:

Input world heightmap

Output (default strength 6):

world normal map with default strength 6

About

Creates normal (labPBR) maps from height maps.

License:MIT License


Languages

Language:Rust 100.0%