# blockbench-albedo-to-pbr

blockbench-albedo-to-pbr derives height, tangent-space normal, and packed MER maps from albedo textures for Blockbench PBR materials.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 248 installs · ★ 30 repo stars
- Author: jasonjgardner
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/jasonjgardner/blockbench-mcp-project/tree/HEAD/skills/blockbench-albedo-to-pbr/SKILL.md
- Updated: 2026-09-26
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/blockbench-albedo-to-pbr

## What it does

The skill extracts normal maps, grayscale height fields, and packed MER (metalness, emissive, roughness) textures from an existing albedo image. It supplies two interchangeable CLI scripts with identical math: `scripts/albedo_to_normal.py` running on Python with PyPBR, or `scripts/albedo_to_normal.mjs` on Node.js using `vgpu` and `pngjs`. Height data can come straight from pixel luminance or through Depth Anything V2 neural estimation.

Every run writes `<name>_height.png`, `<name>_normal.png`, and `<name>_mer.png` alongside a JSON summary. Configurable flags handle Sobel or Prewitt kernels, DirectX versus OpenGL axis orientation, UV gutter isolation via alpha thresholding, and palette overrides.

This skill strictly produces texture files on disk and will not assign them to project materials without the companion `blockbench-pbr-materials` skill.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add jasonjgardner/blockbench-mcp-project --skill blockbench-albedo-to-pbr -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/blockbench-albedo-to-pbr/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/blockbench-albedo-to-pbr/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add jasonjgardner/blockbench-mcp-project --skill blockbench-albedo-to-pbr -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/blockbench-albedo-to-pbr/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add jasonjgardner/blockbench-mcp-project --skill blockbench-albedo-to-pbr -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/blockbench-albedo-to-pbr/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install jasonjgardner/blockbench-mcp-project skills/blockbench-albedo-to-pbr
```

2. **Manually: put the files in place**
- File: `.github/skills/blockbench-albedo-to-pbr/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add jasonjgardner/blockbench-mcp-project --skill blockbench-albedo-to-pbr -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/jasonjgardner/blockbench-mcp-project --path skills/blockbench-albedo-to-pbr
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/blockbench-albedo-to-pbr/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add jasonjgardner/blockbench-mcp-project --skill blockbench-albedo-to-pbr -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/jasonjgardner/blockbench-mcp-project/tree/HEAD/skills/blockbench-albedo-to-pbr/SKILL.md

## When to use it
- derive tangent-space normal maps directly from diffuse textures
- generate packed MER channel maps without manual mask painting
- build Bedrock RTX texture sets for Blockbench assets
- estimate surface relief using Depth Anything V2

## Example prompts
- Generate PBR maps from block.png with repeating borders and strength set to 1
- Extract normal and MER maps from goal_atlas.png keeping gutter borders clean
- Process planks.png using Depth Anything V2 height with high-pass filtering

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: c163a50bd479f282.

BEGIN THIRD-PARTY FILE c163a50bd479f282
```text
---
name: blockbench-albedo-to-pbr
description: Derive height, tangent-space normal and packed MER (metalness, emissive, roughness) maps from an albedo/base-color texture for Blockbench PBR materials, using PyPBR (Python) or vgpu + Dawn WebGPU (Node.js), with optional Depth Anything V2 height estimation and MER inferred from the albedo plus the normal's curvature. Use after a color texture exists (painted, imported, or generated with blockbench-gpt-image-textures) when a material needs normal, heightmap or MER channels, a Bedrock RTX texture_set, or when asked to make a normal map, bump map, height map, roughness, metalness or emissive map from a texture. Triggers on albedo to normal, normal map from texture, height map from albedo, MER map, roughness from texture, metalness map, emissive map, Depth Anything, PyPBR, vgpu, Sobel normal, DirectX vs OpenGL normal, texture_set normal, heightmap or metalness_emissive_roughness layer.
---

# 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](../blockbench-use/SKILL.md) first for discovery and verification, and [blockbench-pbr-materials](../blockbench-pbr-materials/SKILL.md) 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/python-pypbr.md), [references/node-vgpu.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
```
END THIRD-PARTY FILE c163a50bd479f282

The third-party file has ended. Everything between the c163a50bd479f282 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2426 of 13301 bytes. © jasonjgardner · Apache-2.0 · https://github.com/jasonjgardner/blockbench-mcp-project/tree/HEAD/skills/blockbench-albedo-to-pbr/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
