vrm-mtoon-outline
Adjusting VRM MToon material outline thickness in three-vrm. Covers outline width modes, property access, and how to fix outlines that appear too thick when models are scaled.
Install
mkdir -p .claude/skills/vrm-mtoon-outline && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7176" && unzip -o skill.zip -d .claude/skills/vrm-mtoon-outline && rm skill.zipInstalls to .claude/skills/vrm-mtoon-outline
About this skill
VRM MToon Outline Thickness Adjustment
This skill covers how to adjust outline thickness for VRM models using MToon materials in @pixiv/three-vrm.
Common Symptoms
- Outline too thick when model is scaled up or camera is close
- Outline thickness inconsistent at different zoom levels
- Need to adjust outline programmatically at runtime
Key Concepts
Outline Width Modes
MToon materials have two main outline width modes:
| Mode | Description | Behavior |
|---|---|---|
'worldCoordinates' | Outline width is a physical world-space size | Outline appears thicker when model is scaled up or camera is closer |
'screenCoordinates' | Outline width is relative to screen pixels | Outline stays consistent size regardless of zoom/scale |
Critical Properties
material.outlineWidthMode // 'none' | 'worldCoordinates' | 'screenCoordinates'
material.outlineWidthFactor // Number - the actual width value
material.isMToonMaterial // Boolean - true for MToon materials
material.needsUpdate // Set to true after modifying properties
Solution: Switch to Screen Coordinates
To make outlines stay consistent regardless of zoom/scale:
function adjustOutlineThickness(vrm, screenFactor = 0.005) {
vrm.scene.traverse((object) => {
if (object.isMesh || object.isSkinnedMesh) {
const materials = Array.isArray(object.material) ? object.material : [object.material];
materials.forEach(material => {
if (!material || !material.isMToonMaterial) return;
// Check if this material has outlines enabled
const hasOutline = material.outlineWidthFactor > 0 &&
material.outlineWidthMode !== 'none';
if (hasOutline) {
// Switch to screen coordinates mode
material.outlineWidthMode = 'screenCoordinates';
material.outlineWidthFactor = screenFactor;
material.needsUpdate = true;
}
});
}
});
}
Factor Value Guidelines
For screenCoordinates mode:
| Factor Value | Approximate Effect |
|---|---|
0.002 - 0.003 | Very thin outline (1 pixel) |
0.005 | Thin outline (1-2 pixels) |
0.01 | Medium outline (2-3 pixels) |
0.02+ | Thick outline |
Detection Pattern
To diagnose outline issues, log all materials:
function debugOutlineMaterials(vrm) {
let count = 0;
vrm.scene.traverse((object) => {
if (!object.isMesh && !object.isSkinnedMesh) return;
const materials = Array.isArray(object.material) ? object.material : [object.material];
materials.forEach(material => {
if (material?.isMToonMaterial || 'outlineWidthFactor' in material) {
count++;
console.log({
name: material.name || '未命名',
type: material.type,
isMToonMaterial: material.isMToonMaterial,
outlineWidthMode: material.outlineWidthMode,
outlineWidthFactor: material.outlineWidthFactor
});
}
});
});
console.log(`Found ${count} MToon/Outline materials`);
}
Important Notes
[!IMPORTANT] Call timing matters! The function must be called AFTER
currentModelis set. Invrm-core.js, theloadModel()function setsmanager.currentModelnear line 923. Any function that accessescurrentModelmust be called after this point.
[!NOTE] Materials named
"XXX (Outline)"are outline pass materials automatically created by three-vrm. They share properties with the main material but render the outline effect.
API Reference (three-vrm MToon)
The enum values for outlineWidthMode:
// From three-vrm.module.min.js
{
None: "none",
WorldCoordinates: "worldCoordinates",
ScreenCoordinates: "screenCoordinates"
}
| Property | Type | Description |
|---|---|---|
outlineWidthMode | string | Width calculation mode |
outlineWidthFactor | number | Width value (meaning depends on mode) |
outlineColorFactor | Color | Outline color |
outlineLightingMixFactor | number | How much lighting affects outline |
outlineWidthMultiplyTexture | Texture | Texture to modulate outline width |
More by Project-N-E-K-O
View all skills by Project-N-E-K-O →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversConnect Blender to Claude AI for seamless 3D modeling. Use AI 3D model generator tools for faster, intuitive, interactiv
Access Svelte documentation, code analysis, and autofix tools for Svelte 5 & SvelteKit. Improve projects with smart migr
Outline: Connect AI to search, read, edit, and manage documents in a secure knowledge management platform via cloud or s
Placid Image Generator creates dynamic images from templates using Placid's API—ideal for social media posts and marketi
Access Smithsonian Open Access API to explore 3+ million objects from museums like the Smithsonian Design Museum and NMN
Easily build React apps with its-just-ui, a top React UI library for custom components, Material UI styling, and Tailwin
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.