Pixel Render 3D (three.js scenes as true pixel art)
/pixel-render-3d
A GameSkill original that renders a three.js scene as true pixel art for browser games: a small render target, a depth-edge outline, a palette lock of up to 32 colours with optional Bayer dither and a whole-number nearest upscale, with three.js r181 (MIT) bundled. A headless Chrome checker proves the canvas is real pixel art: whole-number scale, every block one colour, palette only, outline present.
- 许可证
- MIT
- 出品
- GameSkill 出品
我们测过
在 three.js r181 (WebGL2) in headless Chrome + Node 22 上通过 24/24 项检查(2026-11-09):能触发、有可运行示例、有截图和自检清单、单一职责、中英文文档齐全。触发检查是把提示词和 skill 描述做匹配,不是真实 agent 运行。
测试报告GameSkill 测过的版本
GameSkill 为 gameskill.dev 原创编写并测过。ZIP 里是完整的 skill:SKILL.md 及中文版、脚本、可运行示例、测试、自检清单和我们的测试报告。
GameSkill 原创,协议 MIT。ZIP 保留 LICENSE 和 CREDITS.md,里面列出了流程灵感来源、CC0 测试素材和第三方库及其协议。
自检清单
- 画布是美术尺寸的整数倍,像素比 1,关闭抗锯齿 / Canvas a whole multiple of the art size, pixel ratio 1, antialias off
- pixel_check.mjs 对定格帧全部通过 / pixel_check.mjs passes on a frozen frame
- 屏幕上只有约定调色板的颜色 / Only the agreed palette colours on screen
推荐搭配
中文指南
这个 skill 做什么
GameSkill 原创(MIT)。把 three.js 场景渲染成真正的像素画,用于网页游戏:先画到小尺寸渲染目标,再加深度边缘描边、锁定最多 32 色的调色板(可选 Bayer 抖动),最后按整数倍最近邻放大;内置 three.js r181(MIT)。配套的无界面 Chrome 检查器证明画布是真像素画:整数倍缩放、每个块一个颜色、只有调色板颜色、有描边。
什么时候用
- 用 3D 模型但要像像素画的网页游戏
- 把低多边形 three.js 场景做成固定调色板的复古风格
- 证明一个 WebGL"像素"游戏没有偷偷变平滑或跑出调色板
怎么装
下载本页的 ZIP,把 pixel-render-3d/ 文件夹放进 .claude/skills/(Claude Code)或 .agents/skills/(Codex、Cursor),重启 agent。three.js 已内置;检查器需要 Node 22 以上和 Chrome/Chromium。
最小示例
node tools/pixel_check.mjs "demo/index.html?t=0.6" --root . --art 160x120 --palette page --outline 1a1c2c,6 项全过。- 换成
?t=0.6&direct=1(同一场景的普通渲染),块检查和调色板检查失败——这就是区别。
我们怎么测的
示例是我们自己做的「风车山」(Windmill Hill):低多边形山丘、风车、两棵树,160x120、Sweetie 16 调色板、深色描边,放大 4 倍。test/run_tests.mjs 共 12 项检查,在无界面 Chrome(SwiftShader WebGL)里跑:19200 个 4x4 块全部单色;只用了 9 种调色板颜色;描边存在;两次渲染像素一致;另一时刻的画面也通过且不同;开启抖动仍然通过;关掉调色板或描边时正好对应那一项失败;普通全分辨率渲染出现 914 个混色块被判失败;报错的页面和不存在的页面分别判失败和退出码 2。结果在 gameskill/test-report.json。
致谢
three.js r181(MIT,原样内置并保留 LICENSE)。"把 3D 场景渲染成像素画"的思路参考了 danieljan-design 的 Noxe Pixel Engine(MIT,只放链接,没有使用其代码或文字)。示例调色板是 GrafxKid 的 Sweetie 16。渲染器和示例初稿由 DeepSeek 起草,经我们审查、修正和测试。
搭配
pixel-snap-cleanup:清理 AI 生成的 2D 像素画style-cards:先定调色板和风格
安装
告诉你的 AI
Install the skill from https://gameskill.dev/skills/pixel-render-3d/install.md
GameSkill 测过的版本
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/pixel-render-3d.zip -o /tmp/gameskill-pixel-render-3d.zip
unzip -oq /tmp/gameskill-pixel-render-3d.zip -d .claude/skills
rm /tmp/gameskill-pixel-render-3d.zip包含内容
- pixel-render.js: PixelRenderer(renderer, { width, height, palette, outline, outlineDepth, dither }) with render(scene, camera)
- vendor/three: three.js r181 module build, unchanged, with its MIT licence
- tools/pixel_check.mjs: whole-number scale, block-clean, palette-only, outline and error checks in headless Chrome
- Windmill Hill, our own demo scene with palette, outline, dither and plain-render switches, and 12 checks in test/run_tests.mjs
适合
- Browser games that use 3D models but should look like pixel art
- Turning a low-poly three.js scene into a retro look with a fixed palette
- Proving a WebGL pixel-art game is not secretly smooth or off-palette
不适合
- Cleaning AI-generated 2D sprites: use pixel-snap-cleanup
- Godot or Unity projects (the renderer is three.js; the checker works on any web canvas)
- Photo-real or high-resolution rendering
试试这条提示词
My three.js game should look like 160x120 pixel art in the Sweetie 16 palette with dark outlines. Set up the renderer and prove the canvas is real pixel art.关于这个 Skill
A GameSkill original. Rendering 3D at full resolution and calling it pixel art gives soft edges, hundreds of colours and uneven pixels. pixel-render.js does it the way that works: it draws the scene into a small target, adds a depth-edge outline on the near side, locks every pixel to a palette of up to 32 exact sRGB colours (optional Bayer dither) and blits it at a whole-number scale with nearest filtering. three.js r181 (MIT) is bundled. tools/pixel_check.mjs loads the page in headless Chrome and proves the canvas is real pixel art.
Agent steps
- Agree the art resolution, the palette and the outline colour.
- Wire
PixelRendererinto the game loop with a canvas that is a whole multiple of the art size. - Check a frozen frame with
pixel_check.mjsuntil every check passes.
Common problems it catches
- Pixels of different sizes from a non-integer scale or a linear filter.
- Colours off the palette because of colour management or tone mapping.
- A "pixel" game that actually renders at full resolution with smooth edges.
Credits
three.js r181 (MIT) is bundled unchanged with its licence. The idea of a 3D-to-pixel-art engine comes from Noxe Pixel Engine by danieljan-design (MIT; link only, no code or text used). The renderer, the Windmill Hill demo and the text are ours.
环境要求
- A browser with WebGL2; three.js r181 is bundled
- Node 22+ and Google Chrome or Chromium for tools/pixel_check.mjs (headless); no npm packages
相关主题
常见问题
AI 2D 美术与序列帧管线 Sprite Asset Pipeline
把 AI 生成的原始视频直接变成商业级透明 2D 游戏序列帧:绿幕/溢色消除命令、0px 脚底锚点锁死排版、动作非线性重定时(4.33s → ~1.88s 含打击顿帧)与 Phaser / Godot 4 图集一键导出。
基于 three.js (作者 three.js authors,MIT; r181 module build shipped unchanged)。原作者的代码原样打包进 ZIP,附带其许可证;skill 文字、测试和示例由 GameSkill 编写,ZIP 里的 CREDITS.md 列出所有来源。 · 基于 Noxe Pixel Engine (idea only) (作者 danieljan-design,MIT; idea only, no code or text used)的思路。代码和文字由 GameSkill 编写,ZIP 里的 CREDITS.md 列出所有来源。
搭配使用
作者标注的相关 Skills,或更适合相邻任务的 Skills。
Pixel Snap Cleanup (AI fake pixels to true pixel art)
A GameSkill original that turns AI "fake pixel" art into true pixel art at the grid you choose: snap to a real grid with the bundled Pixel Snapper (MIT), force 0/255 alpha and a fixed palette, hit the exact size, then check it is CLEAN and imports crisp into Godot 4. Works on single sprites and on animation frames, which share one grid.
Style Cards (one art style as hard limits, switch looks by switching cards)
A GameSkill original that writes a game's art style down as a card of measurable limits (canvas, colours and palette, alpha, triangles, shading, materials, textures, voxel grid), pastes it into every asset request and checks every asset against it. Ships 16 cards from pixel (including fixed PICO-8, CGA, four-greens LCD and Endesga 32 palettes) and one-bit to low-poly, voxel and toon, a no-dependency PNG checker, a Blender GLB checker and a palette locker; switch the whole look by switching the card.
Pixel Diorama Game (tiny isometric pixel games with seamless ambience)
A GameSkill original for making a small browser game as an isometric pixel diorama: one place floating on white, a fixed 30-degree camera, a 360x280 canvas scaled by whole pixels, hue-shifted shading, long hard shadows and one physical action, plus rain, ripples, smoke, embers and lamp flicker drawn by code in loops that wrap without a seam. Ships the Pixel Plays renderer (MIT), our ambience kit and a tested example game.
相似 skills
Godogen
Autonomous game development with Claude Code and Codex. Publishes a ready game repo for Godot, Bevy, Babylon.js or three.js.
pixelfx
244 pixel-art effects written as code (fire, explosions, magic, weather, UI, pickups, critters) plus a draft, render, look, refine loop for making new ones; every effect exports a sprite sheet with Aseprite-style JSON for Godot, Unity, Phaser or any engine.
Three.js Game Skills
Nine Agent Skills for Codex and Claude Code that build playable Three.js browser games, with a director skill, a Vite scaffold and Playwright QA.
3AGameFactory (GameFactory-3A)
An Apache-2.0 framework of agent skills and pipelines that turns a game requirement into assets (image, 3D, motion, audio, CG video) and engine-ready code for UE5, Blender, Unity, Godot 4 and three.js.