Materialize CLI

March 15, 2026 · View on GitHub

A Rust CLI that generates PBR (Physically Based Rendering) maps from diffuse textures using GPU compute shaders via wgpu. No GUI, no Unity — just one command and six maps.

Inspired by the original Materialize (Unity/Windows). For a Portuguese version, see README_PT.md.

Who is this for? Game developers, 3D artists, and anyone who needs PBR maps from diffuse textures — in engines like Unity, Unreal, Godot, or in Blender, without running a GUI or the Windows-only original.


Generated maps

From a single diffuse/albedo image, the tool outputs six maps:

MapDescription
HeightSurface elevation for parallax/displacement
NormalSurface normals for lighting
MetallicMetallic vs dielectric mask
SmoothnessRoughness/smoothness (base + metallic contribution)
EdgeEdge detection derived from normals
AOAmbient occlusion (cavity-style from height)

Features

  • Minimal — Command-line only; easy to script and automate
  • Fast — GPU compute shaders (wgpu); no CPU-bound image loops
  • Cross-platform — Linux, macOS, Windows (Vulkan, Metal, DirectX 12)
  • Flexible — Output formats: PNG, JPG, TGA, EXR; configurable quality for JPEG

Quick start

Requires Python 3 (installer) and Rust (cargo) to build. The installer compiles and places the binary in ~/.local/bin/materialize (ensure it’s on your PATH).

git clone https://github.com/maikramer/Materialize-CLI.git
cd Materialize-CLI
./install.sh
  • Linux/macOS: ./install.sh | ./install.sh uninstall | ./install.sh reinstall
  • Windows: .\install.ps1 or install.bat

Run

materialize texture.png
# Writes to current directory:
#   texture_height.png, texture_normal.png, texture_metallic.png,
#   texture_smoothness.png, texture_edge.png, texture_ao.png

materialize texture.png -o ./out/ -v
materialize diffuse.png --format png --quiet

Manual build (Cargo)

cargo build --release
cargo install --path .

Usage

Syntax

materialize [OPTIONS] [INPUT] [COMMAND]

Options

OptionShortDefaultDescription
--output-o./Output directory
--format-fpngOutput format: png, jpg, jpeg, tga, exr
--quality-q95JPEG quality (0–100) when using -f jpg
--verbose-vPrint progress and timing
--quietDo not list generated files on success
--help-hShow help
--version-VShow version

Subcommands

  • materialize skill install — Installs the Materialize CLI Cursor skill into the current project’s .cursor/skills/materialize-cli/.

Output naming

For input texture.png, outputs are:

  • texture_height.png
  • texture_normal.png
  • texture_metallic.png
  • texture_smoothness.png
  • texture_edge.png
  • texture_ao.png

(Extension follows --format.)

Exit codes

CodeMeaning
0Success
1Generic error
2Input file not found
3Unsupported input format
4GPU error (no adapter)
5I/O error (permissions, disk full, etc.)
6Image too large for GPU

Examples

# Default: current directory, PNG
materialize brick.png

# Custom output directory and verbose
materialize brick.png -o ./materials/brick/ -v

# EXR for HDR / precision
materialize texture.png -f exr -o ./out/

# Batch (parallel with xargs)
ls *.png | xargs -P 4 -I {} materialize {} -o ./output/

# Script-friendly: quiet, check exit code
materialize texture.png -o ./out/ --quiet
if [ $? -eq 0 ]; then echo "OK"; fi

Getting help


Requirements

  • Rust 1.75+
  • GPU with Vulkan (Linux), Metal (macOS), or DirectX 12 (Windows); up-to-date drivers

Documentation


License

MIT. Based on the original Materialize by Bounding Box Software.