Generate normal maps for ZX 3D meshes using Python + NumPy. **Triggers:** "generate normal map", "normal map", "bump map", "surface detail", "height to normal". **Before generating:** Check `.studio/visual-style.md` for relief intensity. **Load references when:** - Height-to-normal algorithms → `references/normal-map-generation.md` - Pattern generators (bricks, tiles, scratches) → `references/pattern-generators.md` - BC5 format, 2-channel encoding → `references/bc5-format.md` - Mesh integration, FFI usage → `references/integration-guide.md` **Related skills:** - ALBEDO/MRE/SSE: `procedural-textures` - MESH with tangents: `procedural-meshes`
/plugin marketplace add nethercore-systems/nethercore-ai-plugins/plugin install zx-procgen@nethercore-ai-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/bricks.normal.spec.pyexamples/tiles.normal.spec.pyreferences/bc5-format.mdreferences/integration-guide.mdreferences/normal-map-generation.mdreferences/pattern-generators.mdGenerate tangent-space normal maps for surface detail without increasing geometry.
pip install pillow numpy pyfastnoiselite
*_normal.png (triggers auto-BC5 compression)| Benefit | Cost |
|---|---|
| Per-pixel lighting detail | +4 bytes/vertex (tangents) |
| Scratches, pores, fabric weave | Texture slot 3 |
| Enhanced specular/shadows | BC5: (w*h)/2 bytes |
| Channel | Axis | Range | Meaning |
|---|---|---|---|
| R | X (tangent) | 0-255 → [-1, 1] | Left/Right |
| G | Y (bitangent) | 0-255 → [-1, 1] | Up/Down |
| B | Z (normal) | Reconstructed | Forward |
Neutral: RGB(128, 128, 255) = no deviation
Z reconstructed in shader: z = sqrt(1 - x² - y²)
Create .spec.py in .studio/specs/normals/:
NORMAL = {
"normal": {
"name": "brick_wall",
"size": [256, 256],
"method": "from_pattern",
"pattern": {
"type": "bricks",
"brick_size": [64, 32],
"mortar_depth": 0.35
},
"processing": {"strength": 1.2}
}
}
Run: python .studio/generate.py --only normals
Pattern types: bricks, tiles, hexagons, noise, scratches, rivets, weave
import numpy as np
from PIL import Image
def height_to_normal(height_map: np.ndarray, strength: float = 1.0) -> np.ndarray:
dx = np.roll(height_map, -1, axis=1) - np.roll(height_map, 1, axis=1)
dy = np.roll(height_map, -1, axis=0) - np.roll(height_map, 1, axis=0)
dx *= strength; dy *= strength
normal = np.zeros((*height_map.shape, 3), dtype=np.float32)
normal[:, :, 0] = -dx
normal[:, :, 1] = -dy
normal[:, :, 2] = 1.0
length = np.maximum(np.sqrt(np.sum(normal**2, axis=2, keepdims=True)), 1e-8)
normal /= length
return ((normal + 1.0) * 0.5 * 255).astype(np.uint8)
See references/pattern-generators.md for brick, tile, scratch, rivet patterns.
| Material | Strength |
|---|---|
| Smooth plastic | 0.3 |
| Fabric/cloth | 0.5-0.8 |
| Stone/concrete | 1.0 |
| Brick/tile | 1.0-1.5 |
| Metal scratches | 1.5-2.5 |
| Resolution | BC5 Size |
|---|---|
| 64x64 | 2 KB |
| 128x128 | 8 KB |
| 256x256 | 32 KB |
| 512x512 | 128 KB |
export_tangents=True)*_normal.pngSee references/integration-guide.md for complete workflow.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.