Builtin Library
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)
widthis metres inworldmode and a share of the screen's height inscreenmode.widthTexture(a texture) scales the width by its red channel at each vertex's UV, throughuvScaleanduvOffset.lightingMixis how much the line takes the light falling on it, 0 none to 1 all.