Manifest (pack.json)

Every pack.json field - kind (type), required capabilities (requires), inputs, parameters (params / params.ext), groups, textures, material classification, state and passes, look / world blocks.

Manifest overview

pack.json is the JSON file that declares an MMDX Effects pack’s identity, kind, required capabilities, parameters and material classification rules. When scanning packs, MMDX12 reads this file first and validates it.

{
  "format": 1,
  "id": "my_pack",
  "version": "1.0.0",
  "apiVersion": 6,
  "minAppVersion": "1.7.0",
  "type": "surface",
  "name": { "ko": "내 팩", "en": "My Pack", "ja": "マイパック", "zh": "我的着色器" },
  "description": { "ko": "원신 풍 툰 셰이딩입니다.", "en": "Cel shading for anime models." },
  "recommendedFor": { "ko": "Genshin, Star Rail 공식 모델", "en": "Official HoYoverse MMD models" },
  "authors": [ { "name": "YourName", "role": "Shader", "url": "https://github.com/..." } ],
  "license": "MIT",
  "homepage": "https://...",
  "repository": "https://github.com/...",
  "tags": ["toon", "anime"],
  "requires": ["surface.output"],
  "classes": [
    { "class": "eye",  "match": ["目", "眼", "瞳", "eye", "Eye"] },
    { "class": "face", "match": ["顔", "颜", "face", "Face", "表情"] },
    { "class": "hair", "match": ["髪", "髮", "hair", "Hair"] },
    { "class": "skin", "match": ["肌", "皮肤", "skin", "Skin"] }
  ],
  "params": [
    { "key": "softness", "label": { "ko": "경계 부드러움", "en": "Softness" }, "default": 0.1, "min": 0.0, "max": 1.0 }
  ]
}

Field specification

Required fields

  • version (string): the pack’s semantic version (e.g. "1.0.0"). Used for update detection and gallery distribution.
  • name (string or localised object): the pack’s display name.

Identity and compatibility

  • format (integer): manifest format version. The current version is 1.
  • id (string): may contain only lowercase letters a-z, digits 0-9, underscores _ and hyphens -, up to 64 characters. If omitted, the folder name becomes the ID. If an installed pack’s folder name and id disagree, that is an error. In the official gallery the format is [a-z0-9_]{3,40}.
  • apiVersion (integer, default 1): target API version. The app’s current maximum is 6; a higher value is classified as Incompatible and is not compiled. Most new features are declared as requires capabilities rather than raising the version.
  • minAppVersion (string, optional): minimum required MMDX12 version (e.g. "1.7.0").

Kind (type)

  • "type": "surface" (default) / "effect" / "look" / "world".
    • surface: character material shading. Requires surface.hlsl (+ optional pt_surface.hlsl).
    • effect: screen effect. Requires effect.hlsl and uses "stage".
    • world: world effect. Requires world.hlsl and the "world" block.
    • look: look preset. Requires the "look" block and uses no shader file.
  • "stage" (effect only): "post" (default) or "pre-bloom".

Metadata and localisation

  • Localised fields: name, description, recommendedFor and the label of parameters / groups are either a plain string or an object with ko, en, ja and zh keys.
    • Display language order: current app language -> en -> plain string -> ko -> any language that exists.
  • authors (array): each entry has name (required), role (optional) and url (optional, http:// / https:// only). The older plain-string "author": "Name" is still supported for compatibility.
  • license (string): an SPDX licence (e.g. "MIT", "CC-BY-4.0").
  • homepage, repository (strings): only http:// / https:// URLs are allowed.
  • tags (string array): lowercase tags for search (up to 12).

Declares the model data traits a pack suits, e.g. { "additionalUvsMin": 2, "toonMapMaterialsMin": 1 }. Both keys are optional non-negative integers, and all given conditions must hold (toonMapMaterials is the number of materials with a non-ramp image UV-mapped into their own toon slot). Unknown keys and the absence of suggest are ignored. The app marks the pack as “recommended” in the selector and, if a matching model has no shader selection yet, shows a one-time hint, but never applies the pack by itself.

Required capabilities (requires)

requires is the list of engine capabilities a pack needs. If the app does not know even one of them, the pack becomes Incompatible and the status line names the capability. Capabilities are declared independently of apiVersion, and some are satisfied automatically from a certain version on.

CapabilityMinimum apiVersionWhat it enables
textures2"textures" in pack.json and the PackSampleTex / PackFxSampleTex family
effect3"type": "effect" and PackEffect
state4"state": { "floats": N }, PackEffectState, PackState
passes5"passes" intermediate passes and PackPassSample / PackPassLoad / PackPassSize
replaces.dof5"replaces": ["dof"] - the pack draws instead of the built-in depth of field
adduv6PackSurface.uv1 / uv2, PACK_API_ADDUV, PT_PACK_API_ADDUV in PT
pt.lighting6PT_PACK_HAS_LIGHTING / PtPackLighting (PT / GI lighting control)
surface.output0 (declare explicitly)normal / emission / tag in PackResult / PtPackOut
inputs.scene0 (declare explicitly)Scene roles in "inputs" and PackInputValid / PackInputPos / PackInputFrame
inputs.audio0 (declare explicitly)"inputs": ["audio"] and the PackAudio* functions
inputs.id0 (declare explicitly)The ID image (gEffectId) and PackSampleId / PackId*
passes.history0 (declare explicitly)"history": true on passes and PackPassSampleHistory / PackPassLoadHistory
passes.mips0 (declare explicitly)"mips": true on passes and PackPassSampleLevel
params.ext0 (declare explicitly)128 extended parameters with types / groups / PackParamInt etc.

Example:

"requires": ["surface.output", "inputs.scene", "inputs.audio", "params.ext"]

If apiVersion is at least the minimum in the table above, that capability counts as satisfied (e.g. with "apiVersion": 6, state, passes, adduv, textures and effect need not be declared separately).

Inputs (inputs)

inputs requests scene data that the engine fills in. It is separate from params (user sliders).

{
  "requires": ["inputs.scene", "inputs.audio"],
  "inputs": ["performer.head", "performer.center", "light.key", "camera.focus", "audio"]
}
inputs stringRole constantMeaning
performer.headPACK_IN_PERFORMER_HEADThe centre performer’s head bone (頭)
performer.centerPACK_IN_PERFORMER_CENTERThe centre performer’s centre bone (センター)
performer.hand_lPACK_IN_PERFORMER_HAND_LLeft wrist (左手首)
performer.hand_rPACK_IN_PERFORMER_HAND_RRight wrist (右手首)
performer.foot_lPACK_IN_PERFORMER_FOOT_LLeft ankle (左足首)
performer.foot_rPACK_IN_PERFORMER_FOOT_RRight ankle (右足首)
light.keyPACK_IN_LIGHT_KEYKey light (direction is the z axis)
camera.focusPACK_IN_CAMERA_FOCUSThe DoF focus point in world space, on the camera axis
audioPACK_IN_AUDIOMusic analysis input
  • performer.* / light.key / camera.focus require "inputs.scene" in requires.
  • audio requires "inputs.audio"; without analysis every PackAudio* value is 0.
  • Roles are resolved through the humanoid map, so packs never contain bone name strings.

Material classification rules (classes)

MMD models (PMX) name their materials in wildly different ways. MMDX Effects automatically maps materials to one of six standard classes using classes rules:

  1. body (the default: any material matching no rule)
  2. skin
  3. face
  4. eye (pupils)
  5. hair
  6. weapon (weapons and props)

Matching

  • The rule array is evaluated from top to bottom, and the first matching rule wins.
  • Each string in match is checked as a substring of the PMX material’s Japanese or English name.
"classes": [
  { "class": "eye",  "match": ["目", "眼", "瞳", "eye", "Eye"] },
  { "class": "face", "match": ["顔", "颜", "face", "Face", "表情"] },
  { "class": "hair", "match": ["髪", "hair"] },
  { "class": "skin", "match": ["肌", "skin"] }
]

In HLSL, s.materialClass is passed as one of the constants PACK_BODY, PACK_SKIN, PACK_FACE, PACK_EYE, PACK_HAIR, PACK_WEAPON.

Classifying by texture

A classes rule can also match the material’s diffuse texture path with "texture". Game maps follow texture sheets rather than material names, so this is more accurate.

{ "class": "hair", "texture": ["发", "髮", "髪", "hair"] }

A rule matches if a match string is in the material name or a texture string is in the texture path, and the first matching rule still wins.

alphaKey

A classes rule can specify "alphaKey": <0..1>. Pixels whose texture red is below the value are cut out (additive key sprites such as MME eye highlights). It applies to every render path. The key belongs to the class the rule specifies; if several rules for the same class have different keys, the first rule wins.

classes is not supported in look and world packs.

Parameters (params) - 16 by default

Without params.ext in requires, these are floating-point parameters the user adjusts with UI sliders:

  • Maximum count: 16 (PackParam(0) through PackParam(15)).
  • Order: the order listed in the manifest becomes the HLSL index.
  • Properties:
    • key (string): unique key used to save settings. Keep it stable across versions so user settings survive.
    • label (string or localised object): UI display name. Falls back to key.
    • default (real): default value.
    • min, max (real): slider range.
    • step (real): slider step (default 0 = continuous).
  • Saving: only items the user changed from their default are saved by key. Parameters left untouched automatically follow a new default when the pack author changes it.

Extended parameters (params.ext)

Declaring "requires": ["params.ext"] lets you organise up to 128 parameters with types and collapsible groups. Each parameter is passed as one float4 slot.

Types

  • float (default): a single slider.
  • int: integer slider, moving in step increments (default step 1).
  • bool: toggle. The default is true / false or a number (greater than 0.5 = true).
  • color: sRGB colour picker. The JSON value is sRGB and is converted to linear in the shader. "alpha": true includes an alpha component.
  • vec3: three-component vector with a slider per component.

default formats

  • Numeric: a single number.
  • bool: true / false.
  • color: a "#rrggbb" string or an [r, g, b] / [r, g, b, a] array (0..1).
  • vec3: an [x, y, z] array (each component is clamped to min..max).

Groups

"requires": ["params.ext"],
"groups": [
  { "id": "general",   "label": { "ko": "일반", "en": "General" }, "collapsed": false },
  { "id": "color_adj", "label": { "ko": "색상 조정", "en": "Color Adjustments" }, "collapsed": true }
],
"params": [
  { "key": "strength",   "type": "float",  "group": "general",   "label": { "ko": "강도", "en": "Strength" }, "default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01 },
  { "key": "iterations", "type": "int",    "group": "general",   "label": { "ko": "반복", "en": "Iterations" }, "default": 4, "min": 1, "max": 16, "step": 1 },
  { "key": "invert",     "type": "bool",   "group": "general",   "label": { "ko": "반전", "en": "Invert" }, "default": false },
  { "key": "tint",       "type": "color",  "group": "color_adj", "label": { "ko": "색조", "en": "Tint" }, "default": "#ffcc99" },
  { "key": "overlay",    "type": "color",  "group": "color_adj", "alpha": true, "label": { "ko": "오버레이", "en": "Overlay" }, "default": [1.0, 1.0, 1.0, 0.5] },
  { "key": "offset",     "type": "vec3",   "group": "color_adj", "label": { "ko": "오프셋", "en": "Offset" }, "default": [0.0, 0.0, 0.0], "min": -1.0, "max": 1.0, "step": 0.05 }
]
  • groups ids must be unique, and each parameter’s group must be a declared group id.
  • collapsed is the initial collapsed state. The collapsed state is remembered per pack and group.
  • If pack.json lacks params.ext but uses groups or non-float types, that is a manifest error.

HLSL access

Without params.ext you only use float PackParam(uint i) (0..15). Declaring it adds these accessors:

  • float PackParam(uint i) - slot i.x.
  • int PackParamInt(uint i) - rounded integer.
  • bool PackParamBool(uint i) - > 0.5.
  • float3 PackParamColor(uint i) - linear RGB.
  • float4 PackParamColor4(uint i) - linear RGBA.
  • float3 PackParamVec3(uint i) - xyz.
  • uint PackParamCount() - the number of declared parameters.

Pack textures (textures)

"textures": [
  { "file": "textures/body_lightmap.png", "address": "clamp", "srgb": false, "origin": "bundled" },
  { "file": "textures/face_sdf.png",      "address": "clamp", "srgb": false, "origin": "user" }
]
  • file: path relative to the pack folder. Only png, jpg and jpeg are allowed; .. and absolute paths are forbidden.
  • address: "wrap" (default) or "clamp". Ramps must use clamp.
  • srgb (default true): colour textures. They are sampled as _SRGB and return linear values, so do not apply SrgbToLinear again. Data maps such as lightmaps, SDFs and LUTs should be false to return stored values unchanged.
  • origin: "bundled" (included in the pack, the default) or "user" (provided by the user texture folder). If omitted, it is bundled when the file is inside the pack and user otherwise.
  • Limits: 16 by default, 4096 × 4096 per texture, 32 MB per pack. World effects allow 32 textures / 64 MB.
  • Array order is the HLSL index (PackSampleTex(0, uv) is the first entry).

Texture lookup order

  1. User texture folder: the same relative path, the same file name, and finally a file ending in _ + the declared name (case-insensitive, shortest name first).
  2. Pack folder: the same relative path.
  3. A white 1 × 1 fallback texture. The pack still renders, and the Effects screen shows how many textures are missing.

If an origin: "user" texture is missing, the app says “set the texture folder”; a missing bundled texture is treated as a damaged pack. The user folder can also override textures bundled in the pack with the same name.

Per-character folders

A texture folder can be set per pack and per character (the “Texture folder” row in the Library panel, playback bar and Studio inspector). The per-character folder takes priority over the per-pack folder. Declaring only a common suffix lets you keep the original file names: declaring Body_Lightmap.png finds Avatar_Girl_Pole_Hutao_Tex_Body_Lightmap.png.

State (state) - screen effects

{ "apiVersion": 4, "type": "effect", "state": { "floats": 2 } }
  • "floats" is an integer from 1 to 16.
  • It can only be used with "type": "effect" and requires the state capability (apiVersion 4 or later).
  • Declaring it means implementing PackEffectState(PackStateInput i, out float newState[16]) next to PackEffect and reading values with PackState(i). See Screen effects for details.

Passes (passes) - screen effects

{
  "apiVersion": 5,
  "type": "effect",
  "stage": "pre-bloom",
  "passes": [
    { "entry": "Bright",     "scale": 0.25 },
    { "entry": "Blur",       "scale": 0.0625 },
    { "entry": "Accumulate", "scale": 1.0, "history": true, "mips": false }
  ],
  "replaces": ["dof"]
}
  • entry: the name of a float4 Name(PackPassInput i) function. PackEffect / PackEffectState cannot be used.
  • scale: ratio of the output size, 1/64 .. 1 (default 1). Each pass draws to its own RGBA16F target.
  • Maximum count: 8.
  • history (true/false): keeps this pass’s previous frame result in space9. Requires the passes.history capability. It is cleared to zero on camera cuts, scene load / reset and resolution changes.
  • mips (true/false): builds a mip chain down to 1×1 after the pass runs. Requires the passes.mips capability.
  • Packs without passes use the same root signature and PSO as v3 / v4, so they cost nothing extra.
  • passes is supported only in effect packs.

Replacement (replaces) - screen effects

"replaces": ["dof"]
  • Only "dof" is known.
  • Valid only in effect packs with "stage": "pre-bloom".
  • While on, it turns off the built-in depth of field (DofPass and the offline GI thin lens) and the pack draws in their place. Requires the replaces.dof capability (apiVersion 5 or later).

Look block (look) - look packs

"type": "look" stores a preset in the "look" object of pack.json. The app parses this block as LookData, and its main contents are:

  • lighting, exposure, shadows, ssao, ssr, autoLuminous
  • bloom (enabled / intensity / threshold / convolution / radius / blend / depthMask / kernelPreset / kernel)
  • dof (enabled / aperture), volumetric (enabled / density)
  • color (lut, lutFile, intensity) - lutFile only allows a png inside the pack.
  • effects: the screen effect stack (pack id, enabled, params, textureFolder)
  • surface (optional): the surface pack selection to apply to one character (pack, params, textureFolder, materials)
  • packs: every pack this look references (id, minVersion, source)
  • sets: the groups this look actually applies (lighting / effects / color / surface)

Looks cannot use classes, params, state, passes or inputs. See Looks for details.

World block (world) - world effect packs

A "type": "world" pack defines world.hlsl and a "world" object holding simulation settings. The "world" block holds the fixed step and rewind window, particle systems (up to 8), simulation fields (up to 4) and procedural surfaces (up to 2). The World Effects page documents the fields and functions, the lighting helpers, the determinism model and the render limits, with the built-in “Snow” pack as the example.