blockbench-albedo-to-pbr
Derive height, tangent-space normal and packed MER (metalness, emissive, roughness) maps from an albedo/base-color texture for Blockbench PBR materials, using…
от jasonjgardner★ 30 звёзд на GitHub
Установить blockbench-albedo-to-pbr в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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.
2. Choose the height source
| Source | Flag | Use for |
|---|---|---|
| Luminance (default) | --height-source luminance |
Pixel art and flat-shaded painted textures. Light reads as high; add --invert-height when dark paint is the raised part (dark grout should stay low). |
| Depth Anything V2 | --height-source depth |
Photographic or painterly textures with real structure: bricks, planks, cobble, foliage, machinery. Useless on a two-tone checker. Depth is downloaded on first use. |
| Height file | --height-source file --height-file h.png |
A height painted in Blockbench, from another tool, or a previous _height.png to reshape. |
Depth estimation sees a photo, not a tile: it returns a foreground-to-background ramp that breaks tiling. The script keeps --flatten 1 and normalize on for depth; add --high-pass <texels> (about a quarter of the tile width) for non-linear bias and --seam offset for seamless tiles. Small textures are nearest-neighbour upscaled to at least 1024 px before the model and block-averaged back, so 16× art keeps its edges. Details: references/height-processing.md.
3. Run
# tiling 16x block, pronounced pixel relief
python scripts/albedo_to_normal.py block.png --out ./pbr --wrap --strength 1
node scripts/albedo_to_normal.mjs block.png --out ./pbr --wrap --strength 1
# entity/prop atlas with transparent gutters (islands isolated automatically)
python scripts/albedo_to_normal.py goal_atlas.png --out ./pbr --strength 0.5
# HD tile from a painterly texture, depth-estimated, softened for smooth relief
node scripts/albedo_to_normal.mjs planks.png --out ./pbr --height-source depth --high-pass 32 --seam offset --wrap --soften 1
| Flag | Default | Effect |
|---|---|---|
--wrap |
off | Sample across borders. On for seamless tiles, off for atlases and non-tiling art. |
--strength F |
0.5 | Gradient multiplier. 0.25 subtle, 0.5 default, 1–2 strong pixel relief; halve per doubling of texture density. |
--operator |
sobel | sobel, prewitt (softer), scharr (smooth HD height). |
--convention |
directx | directx green-down (Bedrock RTX assumption) or opengl green-up (Blender, glTF, labPBR). |
--alpha-threshold |
8 | Albedo alpha below this is off-island: no relief bleeds across gutters; gutters get the flat normal. |
--soften M |
0 | Density-scaled Gaussian on the height (≈ shortSide/64 · M texels). Use 1 for ≥64× textures; keep 0 for 16×. |
--levels B,W,G |
0,1,1 | Input black/white/gamma on the height before the kernel. |
--flatten, --high-pass, --normalize/--no-normalize, --invert-height |
depth: 1, 0, on | Depth shaping, also available for file and luminance sources. |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/height-processing.md
- references/mer-inference.md
- references/node-vgpu.md
- references/python-pypbr.md
- scripts/albedo_to_normal.mjs
- scripts/albedo_to_normal.py
- scripts/shaders/height-map.wgsl
- scripts/shaders/mer-map.wgsl
- scripts/shaders/normal-map.wgsl
FAQ
Что делает скилл blockbench-albedo-to-pbr?
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.
Как установить скилл blockbench-albedo-to-pbr?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл blockbench-albedo-to-pbr запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…