blockbench-albedo-to-pbr
Albedo to Normal and MER for Blockbench
PBR channels are derived, not painted: albedo → height field → tangent-space normal, then metalness, emissive and roughness inferred from the albedo, the height and the normal's curvature and packed into one MER image. Two scripts share one CLI and the same maths; pick by runtime. Load blockbench-use first for discovery and verification, and blockbench-pbr-materials to assign the results. This skill produces the image files only.
| Runtime | Script | Install | Height estimation |
|---|---|---|---|
| Python | scripts/albedo_to_normal.py |
pip install pypbr (+ transformers for depth) |
Depth Anything V2 through transformers, CUDA when available |
| Node.js | scripts/albedo_to_normal.mjs |
npm install vgpu pngjs (+ @huggingface/transformers for depth) |
Depth Anything V2 ONNX through transformers.js, CPU or WebGPU |
Both write <name>_height.png (grayscale, light = high), <name>_normal.png (RGB, opaque) and <name>_mer.png (R metalness, G emissive, B roughness) and print a JSON report. Runtime setup, API notes and troubleshooting: references/python-pypbr.md, references/node-vgpu.md. Node needs the script's scripts/ folder reachable from a project that has the dependencies installed; Python only needs the packages.
Workflow
1. Get the color texture as a file
Run list_textures and note the target texture's UUID, bitmap_size and uv_size; it does not report a file path. If the texture was imported from a file you wrote (for example the downscaled atlas from the GPT image workflow), use that file. Otherwise fetch the image with get_texture and save the returned PNG to disk, or have Blockbench save the texture. Work on the atlas at its native texel size, not on an upscaled generation canvas, so the maps share the texel grid with the color map.
Check the atlas before deriving anything: relief scale must be consistent across faces, so apply UV scale and distortion guidance to the color map first. A normal map inherits every stretch in the UV layout.