Jump to content

Color Modulation: Difference between revisions

From Mii Technical Wiki
Line 55: Line 55:
Single-channel modulation with an opaque background.
Single-channel modulation with an opaque background.


Used by: [[Hat]] (Referred to as ShapeCap here)
Used by: [[Cap]]


<syntaxhighlight lang="c">
<syntaxhighlight lang="c">

Revision as of 09:09, 24 September 2025

Color modulation is the process in which a texture is modified to add color. There are various strategies used by face libraries. In general, textures are split into color channels, and each channel is filled with a respective color.

Modes

There are 6 modes used in FFL.[1]

Constant

For textures where only one color replacement is needed. The red channel is colorized.

Used by: Beard (shape), Nose, Forehead, Hair, Fill

rgb = ColorR
a = 1.0

Texture Direct

For textures where no color modulation is required. The texture is “passed through” the shader with no modifications.

Used by: FaceMake, Faceline, Mask

rgb = TextureRGB
a = TextureA

Rgb Layered

For textures where up to two colors need to be filled.

Used By: Mouth, Eye

rgb = ColorR * TextureR + ColorG * TextureG + ColorB * TextureB
a = TextureA

Alpha

For textures where there is a single color that needs to be filled, and an alpha channel.

Used by: Mustache, Eyebrow, Mole, FaceLine, FaceBeard, Noseline

rgb = ColorR * TextureR
a = TextureR

Luminance Alpha

For textures that need to fill two colours, and alpha

Used by: Glass

r = ColorR * TextureG
a = TextureR

Alpha Opaque

Single-channel modulation with an opaque background.

Used by: Cap

rgb = ColorR * TextureR
a = 1.0

References