Skip to main content

Channels and packing

By the end of this page you'll understand why R/G/B/A channels can hold four masks, how different shaders select which channel to read, and how those methods differ.

Four channels = four masks​

One texture pixel holds R · G · B · A four numbers. Color textures read them as "color," but if a shader picks just one channel, each channel becomes an independent mask.

ChannelCan hold
RMask 1
GMask 2
BMask 3
AMask 4

Packing four masks into one file this way is channel packing. File count and texture memory drop to 1/4, and sample-per-draw-call also shrinks.

Three ways shaders pick channels​

This is where shaders differ. Mask Maker's Combiner auto-optimize handles all three methods.

MethodInternal labelShaderBehavior
Channel vectorVector4DotNiloToonA vector like (1,0,0,0) sits beside the mask slot; dot product with pixel selects the channel. Any channel is free
Channel indexFloatIndexPoiyomi 9.xA …Channel property holds 0/1/2/3 to select the channel. Any channel is free
R fixedFixedRlilToonShader always reads only R. Must be placed in the R slot of the pack

Free placement (first two) — Combiner can group and fill from unused channels upward. R fixed (lilToon) — only one per pack, so Combiner prioritizes lilToon slots to R.

lilToon alpha bake

lilToon supports an official method: bake _AlphaMask into the alpha channel of MainTex, freeing the slot itself. Combiner's alpha bake option does this — one mask disappears entirely.

Pre-packed layouts set by shaders​

Some slots demand a packed format from the start. Channel meanings are fixed in the shader, so you must follow that order.

ShaderSlotChannel layout
MingToonPBR ▸ Packed MaskR = Metal / G = AO / B = Reserved / A = Smoothness
MingToonRegion ▸ Region MaskRGBA = four different regions
PoiyomiRGBA Color Masking ▸ MasksRGBA = four independent masks
PoiyomiDecals ▸ RGBA MaskR/G/B/A = Decal 0–3
PoiyomiSubsurface Scattering ▸ Color & ThicknessRGB = Color / A = Thickness

For these slots, channel packing (manual mode) in Combiner is safer — you specify order directly.

Textures you shouldn't pack​

Combiner auto-optimize automatically excludes these. Reason appears in the exclusion list; you can toggle Include if needed.

Exclusion reasonWhy
Already channel packedDifferent data in each channel, can't move to one channel
Not grayscaleUses color information (gradient result, etc.)
Multiple channel referencesOne texture referenced by multiple channels
Alpha channel in useData already in the alpha

Unpacking channels​

Combiner's Channel Split turns a packed texture back into per-channel grayscale PNGs. Use this when you only need to modify one channel of a pack texture you got from someone else.

→ Combiner

Matching channels when assigning​

If you assigned a packed mask to a slot and the effect appeared in the wrong region, the slot's channel selection doesn't match where your data actually is. Use Combiner's Pack + Reassign to auto-fix this value too.

→ Troubleshooting