ID Mask
ID Mask hides parts of a mesh without editing the mesh. Each vertex gets a number (its vertex index, or a value stored in a UV channel), and up to eight ranges or bits of those numbers can be switched off. Any triangle touching a hidden vertex disappears.
The feature is meant mainly for tools and scripts, for example avatar build tools that merge several meshes into one and still want to toggle the original parts. The inspector itself warns It is recommended that these properties be set from scripts. The settings are shown with their raw property names, because they are not localized.
Vertex IDs are not available on mobile graphics APIs, so ID Mask does nothing on Android (Quest) and other mobile platforms. Vertex indices also change whenever the mesh is re-exported or modified by a tool, so hand-entered index ranges can silently break.
ID Mask#
_IDMaskCompile#
_IDMaskCompile on / off · default off
Makes sure the ID Mask code is kept in the shader when an avatar is built, even if no part is hidden in the material itself. Turn it on when the hiding is done only by animations. It has no effect at runtime.
_IDMaskFrom#
_IDMaskFrom 0: UV0 … 7: UV7 / 8: VertexID · default 8: VertexID
Where each vertex's ID comes from. 8: VertexID uses the vertex index in the mesh. The UV options use the X coordinate of that UV channel, truncated to a whole number, which lets a tool write stable part numbers into a spare UV channel.
_IDMaskIsBitmap#
_IDMaskIsBitmap on / off · default off
Changes how IDs are read. Off: the ID is compared against the index ranges below. On: the ID is a set of bits, where bit 1 is part 1, bit 2 is part 2, bit 4 is part 3 and so on up to 128 for part 8, so one vertex can belong to several parts. A vertex is then hidden only when every part it belongs to is hidden, which keeps triangles on the border between two parts from being torn. The index fields are not used in this mode.
_IDMask1 – _IDMask8#
_IDMask1 … _IDMask8 on / off · default off
Hide part 1 to 8. These are the values to animate to show and hide parts. Hidden vertices are collapsed in the vertex shader, so the triangles of a hidden part are never rasterized and cost very little.
_IDMaskIndex1 – _IDMaskIndex8#
_IDMaskIndex1 … _IDMaskIndex8 integer · default 0
The first ID of each part. Part n covers IDs from _IDMaskIndexn up to, but not including, _IDMaskIndexn+1; part 8 covers everything from _IDMaskIndex8 upward. The inspector's example: to hide vertices 1000 to 1999, set _IDMask1 = 1, _IDMaskIndex1 = 1000 and _IDMaskIndex2 = 2000. Only used when _IDMaskIsBitmap is off.
Dissolve control#
_IDMaskControlsDissolve#
_IDMaskControlsDissolve on / off · default off
Lets parts appear and disappear with the Dissolve effect instead of vanishing instantly. When on, the _IDMaskPrior toggles below describe the previous state. Parts whose state differs between the prior and current toggles are drawn with Dissolve: parts being hidden dissolve away, parts being shown dissolve in (the dissolve is inverted for them). Parts hidden in both states stay hidden, and the Dissolve effect does not touch parts that are not changing. Dissolve itself must be set up, which also requires a Cutout or Transparent rendering mode.
_IDMaskPrior1 – _IDMaskPrior8#
_IDMaskPrior1 … _IDMaskPrior8 on / off · default off
Shown when _IDMaskControlsDissolve is on. The "before" state of each part, in the same way as _IDMask1 – _IDMask8. One way to run a transition: set the new state in _IDMask, animate the dissolve Border, then copy the new state into _IDMaskPrior.
ID Mask is not part of the Lite shader. When you build an avatar, NekoToon keeps the ID Mask code if any _IDMask, _IDMaskPrior, _IDMaskIsBitmap or _IDMaskCompile value is on in a material, or if an animation on the avatar animates the ID Mask properties.