Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit098ece8e9e

README.md

toonOutline

The registry of MToon-style outlines: each entity drawn again as a shell of its mesh pushed out along its normals and seen from inside, a line around its silhouette and creases. The toonOutline render feature draws every entry, one front-culled geometry pass per distinct outline, with @builtin::shaders.mtoon_outline. A VRM's MToon materials put a ToonOutline component on each mesh entity that wears one, and the component keeps its entry.

local toonOutline = require("@builtin::modules.toonOutline")
toonOutline.set(meshId, { color = { 0.1, 0.05, 0.05, 1 }, width = 0.002, mode = "world", lightingMix = 1 })
print(toonOutline.get(meshId).width)
toonOutline.clear(meshId)
  • width is metres in world mode and a share of the screen's height in screen mode.
  • widthTexture (a texture) scales the width by its red channel at each vertex's UV, through uvScale and uvOffset.
  • lightingMix is how much the line takes the light falling on it, 0 none to 1 all.