relight-painted-surfaces
БесплатноЗапускает вложенные скриптыНе проверенAdd pointer-driven lighting to a 2D painting, sprite, or holographic card using separate depth, normal, and roughness maps. Use for moving highlights on…
от MengTo★ 8 824 звезды на GitHubОб этом скилле
Relight painted surfaces
Steer one directional light across the entire illustration. A pointer over empty space should turn the reflection on a distant knuckle. The normal at the knuckle chooses which way it reflects, and its roughness determines how wide that reflection looks.
This technique works on a flat painted layer with an existing light baked into its colour. For a modeled object with geometry and a material under scene lighting, use the 3D Metal Material skill. For texel density, UVs and filtering of an existing PBR texture set, see 3D High-Resolution Textures.
Extracted from the articulated steel hand in Folvra’s Commission hero, with the pointer-controlled studio light from Meng To’s Dark Souls Holo Card. The local demo runs Three.js r187, WebGL 2 and a custom GLSL shader. Select Depth, Normals or Roughness to inspect the inputs under the hand.
Prepare the surface
Use matching crops, orientation and aspect ratios for all four textures. Their resolutions may differ. Keep the original paint and alpha for the resting image.
| Texture | Interpretation | Detail to check |
|---|---|---|
| Paint | sRGB colour and a straight-alpha silhouette | Keep the wrist and gaps between fingers transparent where the illustration is cut out. |
| Depth | Linear grayscale, white nearer the viewer | Shape large forms first. A painted black joint can be close to the viewer. |
| Normal | Linear tangent-space RGB, +Y up, neutral around (128,128,255) | Round the raised plates. Fine seams perturb the reflection without carving deep trenches. |
| Roughness | Linear grayscale, white matte | Separate glass, polished metal, tarnish, skin and cloth. Bright paint alone cannot distinguish these materials. |
Use existing authored maps when available. To bake a set from a painting, install Pillow, NumPy and OpenCV in the working Python environment. Give the helper an aligned relative-depth image and, when available, a painted roughness mask.
python scripts/bake_maps.py palm.webp --depth palm-depth.png \
--roughness palm-roughness.png --material metal --out maps/
For a painting without depth, install ONNX Runtime and pass --model path/to/model.onnx in place of --depth. The helper accepts the dynamic-input Depth Anything V2 Small ONNX model. Its output is an estimate from the image. Inspect fingers, overlapping parts and holes before using it. The helper writes three lossless WebPs with separate 8-bit channels and leaves the painting intact. Use a distinct output directory when the inputs share those filenames.
Wire the light
Copy the three modules from assets into a project with Three.js. Set the stage to the whole interaction area. Give each paint image a positioned wrapper of its own, with the image displayed as a block that fills it. Keep any rotation, scale or scroll transform on that wrapper so the overlay and its coordinate probes follow together. For a cropped portrait, crop the wrapper around a proportionally sized image so the four textures use identical image coordinates.
import { createPaintLighting } from "./paint-light.js";
const lighting = createPaintLighting(stage, [
{ image: steelImage, normal: steelNormal, depth: steelDepth, roughness: steelRoughness, metal: 1 },
{ image: clothImage, normal: clothNormal, depth: clothDepth, roughness: clothRoughness, metal: 0 }
]);
// Optional keyboard, touch or fixed-camera inspection pose, with x and y in [-1, 1].
lighting.setLight(-0.65, 0.35);
// On teardown, call lighting.dispose().
Reference the fragment shader when porting to another renderer and the studio light when tuning the finish. The Folvra starting values are:
- Map the horizontal and inverted vertical pointer coordinates to
[-1, 1]once per stage. Aim the key alongnormalize(vec3(1.15*x, .48+.85*y, .9)). Project the diagonal reflection band in stage coordinates so it crosses adjacent layers continuously. - Decode paint through sRGB once, read all three data textures as linear values, and normalize the sampled normal. Use the depth to offset only interior samples by up to 4.2 CSS pixels. Anchor transparent boundaries and sample five points towards the light for shallow self-shadowing.
- Use reflected view direction for steel, a broad studio reflector and a warm bounce. Let roughness broaden the specular lobe. Attenuate reflection in dark tarnished recesses to preserve the separation between plates. Use
metal: 0for skin and cloth. A mixed object benefits from an authored material mask. - Composite the signed colour difference over the original painting. This can darken one side of a joint as the other side catches light. A low-resolution replacement blurs brushwork, and an additive-only pass makes the whole hand brighter.
- Reuse one rendere
Установить relight-painted-surfaces в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл relight-painted-surfaces?
Add pointer-driven lighting to a 2D painting, sprite, or holographic card using separate depth, normal, and roughness maps. Use for moving highlights on illustrated metal, skin, cloth, or paper while the painted silhouette stays registered.
Как установить скилл relight-painted-surfaces?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл relight-painted-surfaces запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
agent-skill-stack
Find, evaluate, and assemble the smallest compatible set of AI Agent Skills for an end-to-end natural-language goal. Use when a user wants Skills for a…
от GitHubbuild-evidence-map
Build an auditable evidence map for a contested technical choice, research synthesis, proposal review, or consequential decision. Use when Copilot must…
от GitHubpinecone-rag
Build production RAG pipelines and persistent agent memory using Pinecone as the vector database backend. ALWAYS USE THIS SKILL when the user mentions…
от GitHubqdrant-monitoring-debugging
Diagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high'…
от GitHub