================================================================================
DRESSMAKER FABRIC MODDING GUIDE
================================================================================

Generated from Dressmaker.

The full runtime dump contains the actual values of every native fabric.
It is regenerated each time the plugin starts:

    BepInEx/config/DressmakerMods/fabric-reference.json


CONTENTS
--------
  1. Complete mod.json example
  2. Fabric fields
  3. Load order, base fabrics and the Modded tag
  4. Allowed category values
  5. Material fields
  6. Shaders and properties in the installed game
  7. References


--------------------------------------------------------------------------------
1. COMPLETE MOD.JSON EXAMPLE
--------------------------------------------------------------------------------

{
  "id": "yourname.fabricpack",
  "author": "Yuuma",
  "version": "1.0.0",
  "fabrics": [
    {
      "id": "sage-weave",
      "name": "Sage Weave",
      "fabricType": "Linen",
      "colors": ["Green"],
      "texture": "sage-weave.png",
      "material": {
        "shader": "$defaultFabricShader",
        "color": "#FFFFFFFF",
        "mainTextureScale": [1, 1],
        "mainTextureOffset": [0, 0],
        "renderQueue": 2000,
        "keywords": [],
        "floats": { "_Smoothness": 0.28 },
        "ints": {},
        "colors": { "_SpecularColor": "#A8B8A7FF" },
        "vectors": {},
        "textures": { "_Detail": "sage-weave.png" },
        "textureScales": { "_Detail": [1, 1] },
        "textureOffsets": { "_Detail": [0, 0] }
      },
      "cost": 18,
      "unlockLevel": 0,
      "tagWeights": [
        { "tag": "Casual", "weight": 70 }
      ],
      "notes": "Optional private note"
    }
  ]
}

This example shows every supported key. It is not a required template.
Remove optional material fields and any texture slot you have no image for.
Change the author to your own name before sharing.

The example reuses "sage-weave.png" for _Detail only to show the syntax.
The baseFabric key is also supported. It is left out here to show a fabric
built from scratch.


--------------------------------------------------------------------------------
2. FABRIC FIELDS
--------------------------------------------------------------------------------

Manifest "id"
    The namespace for the pack and its saved fabric IDs.
    Rules: letters, digits, ".", "_" and "-"; 1 to 64 characters.

name
    The pack name shown in the in-game mod manager. If omitted, it shows
    the pack id instead.

icon
    Optional PNG or JPEG thumbnail for the pack in the mod manager. Put
    the image beside mod.json and write its filename, for example:
        "icon": "pack-icon.png"
    Keep it under 4 MB and at most 2048 by 2048 pixels.

author
    The person or group who made the pack. Workshop shows this next to the
    pack name. One author applies to every fabric in the pack.
    Rules: 1 to 80 characters. Optional for older packs.

version
    The pack's release number. Increase it when you share an update; keep
    the pack id and fabric ids the same so saves still find them.
    Rules: major.minor.patch, such as 1.0.0 or 1.1.0-beta. Optional for
    older packs.

fabrics
    An array of the new fabrics in the pack.
    Rules: each entry must have a unique id.

fabricTypes, fabricTags
    Optional arrays of { "id": "Leather", "name": "Leather" } entries.
    These register new filter choices without changing the game's files.
    The runtime IDs are <modId>.<id>. Keep them stable after release.
    A fabric can use a short ID from its own pack or the full ID from another pack.

Fabric "id"
    A stable key, local to the mod, used in the fabric name and save GUID.
    Rules: same characters as the manifest id. Do not change it after
    release.

name
    The display name shown to players.
    Rules: a non-empty string.

baseFabric
    Optional. The internal ID of a native fabric, or of a custom fabric that
    loaded earlier, to copy from.
    Rules: native IDs are listed in the runtime dump. Custom IDs use the form
    <modId>.<fabricId>. The base must have a material and must load first.

fabricType
    The main fabric category the game uses.
    Rules: a native value from section 4 or a custom fabricTypes ID. Required
    without baseFabric.

colors
    The color categories used by filters and commissions.
    Rules: an array of values from section 4. Required without baseFabric.

texture
    The main visible fabric image, in PNG or JPEG format.
    Rules: required; a relative path inside the mod folder.

material
    Shader and rendering settings (see section 5).
    Rules: shader is required without baseFabric.

cost
    The shop price.
    Rules: an integer from 0 to 2,149,633. Required without baseFabric.

unlockLevel
    The prestige level needed to unlock this fabric.
    Rules: 0 to 50 in the loader. Defaults to 0.

tagWeights
    Style and occasion tags, with a weight for each.
    Rules: native tags from section 4 or custom fabricTags IDs. Required without
    baseFabric. No duplicate tags; weights
    must be finite numbers. Only positive weights count for HasTag.

notes
    An internal note copied into the fabric asset.
    Rules: optional string. This is not the player-facing name.

A generated internal GUID is assigned automatically.

Native fabrics use unlock levels from -1 to 51 and tag weights from -25 to 2525.


--------------------------------------------------------------------------------
3. LOAD ORDER, BASE FABRICS AND THE MODDED TAG
--------------------------------------------------------------------------------

Mods load in alphabetical folder order. Fabrics within a mod load in the order of the manifest array.

The runtime dump is written before custom mods load. It therefore lists native IDs only.

The Workshop's material picker writes baseFabric using one of those native IDs.
It keeps your new texture, name, textile type, color category and price. It copies the chosen fabric's
shader, tint, detail textures and other material settings. It does not override the chosen fabric.

Textile type alone does not select a shader. If the copied tint changes the
colors of your image, try a pale or white in-game fabric of the same type,
or edit the material settings by hand.

The loader registers a "Modded" tag and adds it, with weight 1, to every
custom fabric, including packs written by hand. This lets the game's tag
filter find custom fabrics. Native fabrics keep their original tags without
Modded.


--------------------------------------------------------------------------------
4. ALLOWED CATEGORY VALUES
--------------------------------------------------------------------------------

fabricType (choose one):
    Burlap, Cotton, Lace, Linen, Sequin, Silk, Velvet, Wool
    Or define one in fabricTypes. Example: "Leather".

colors (choose all that apply):
    Blue, Green, Pink, Purple, Red, Yellow, Orange, Black, White, Grey, Brown

tagWeights[].tag (choose all that apply):
    Casual, Cool, Cute, Daywear, Eclectic, Elaborate, Elegant, Eveningwear,
    Flowers, Formal, Glamour, Goth, Patterned, Playful, Professional, Risque,
    Romantic, Shimmering, Simple, Uncomfortable, Warm, Workwear
    Or define one in fabricTags. Example: "Leather".


--------------------------------------------------------------------------------
5. MATERIAL FIELDS
--------------------------------------------------------------------------------

shader
    The exact name of a loaded shader, or $defaultFabricShader for the game's
    MannequinFabric shader. New materials start at the shader's defaults.

color
    The overall material tint, as #RRGGBB or #RRGGBBAA.

mainTextureScale, mainTextureOffset
    Two finite numbers [x, y] for the repeat and offset of the main image.

renderQueue
    Draw order, as an integer from -1 to 5000. See section 6 for native
    queues.

keywords
    An array of shader keyword strings. See section 6 for the native
    keywords on this shader.

floats
    Shader property names mapped to finite numbers. Accepts Float and Range
    properties.

ints
    Shader property names mapped to integers. Accepts Int, Float and Range
    properties.

colors
    Color property names mapped to hex colors.

vectors
    Vector property names mapped to four finite numbers.

textures
    Texture property names mapped to PNG or JPEG paths inside the mod folder.

textureScales, textureOffsets
    Texture property names mapped to two finite numbers.

The loader checks the shader type of each property. The fabric-level
"texture" field sets the material's main texture. Use material.textures for
any additional slots.

Range limits in section 6 come from Unity's shader metadata. The native value
ranges show what native fabrics use. They are not allowed limits or suggested
defaults. The loader does not clamp numbers to shader Range limits.

This shader exposes no Int or Vector properties. The ints and vectors maps
are still supported for other loaded shaders.


--------------------------------------------------------------------------------
6. SHADERS AND PROPERTIES IN THE INSTALLED GAME
--------------------------------------------------------------------------------

472 native fabrics have a material and can be used as a baseFabric. 92 have
no material and cannot be used as a base. Every native material uses the
MannequinFabric shader (472 of 472).

The list below covers every property exposed by that shader in this game
version. A custom shader may expose a different set.

Each entry shows the Unity type, the shader range if one exists, the values
used by native fabrics, and the value on the native fabric Cotton Black.

_EmissionColor (Color)
    Light emitted by the material; black disables visible emission.
    Native: 1 distinct color. Cotton Black: #000000FF

_Color (Color)
    Base tint applied to the fabric texture. Also set by material.color.
    Native: 323 distinct colors. Cotton Black: #2E2E2EFF

_Albedo (Texture)
    Main fabric color texture. Set it with the fabric-level "texture" field.
    Native: assigned on 229 of 472. Cotton Black: none

_Detail (Texture)
    Fine weave or detail color texture layered over the main texture.
    Native: assigned on 321 of 472. Cotton Black: cottonDetail

_AmbientOcclusion (Texture)
    Occlusion texture for darkening recessed areas.
    Native: assigned on 1 of 472. Cotton Black: none

_OcclusionStrength (Range, 0 to 1)
    Strength of ambient occlusion.
    Native: 0.176 to 0.613. Cotton Black: 0.5

_Normal (Texture)
    Main normal map for surface bumps.
    Native: assigned on 0 of 472. Cotton Black: none

_DetailNormal (Texture)
    Fine weave or detail normal map. Also used by the fabric UI preview.
    Native: assigned on 353 of 472. Cotton Black: cottonDetailNormal

_NormalStrength (Range, 0 to 1)
    Strength of the main normal map.
    Native: 0.0001 to 1. Cotton Black: 1

_DetailNormalStrength (Range, 0 to 1)
    Strength of the detail normal map. Also used by the UI preview.
    Native: 0 to 1. Cotton Black: 0

_Smoothness (Range, 0 to 1)
    Surface smoothness and gloss. Also used by the UI preview.
    Native: 0.043 to 0.969. Cotton Black: 0.1

_ReflectionStrength (Range, 0 to 1)
    Strength of reflected light.
    Native: 0.073 to 1. Cotton Black: 1

_AlphaGloss (Float)
    Shader gloss control associated with alpha.
    Native: 0 to 1. Cotton Black: 0

_SpecularColor (Color)
    Color of sharp light reflections. Also used by the UI preview.
    Native: 272 distinct colors. Cotton Black: #FFD6A5FF

_SpecularTint (Range, 0 to 1)
    How much specular highlights inherit a tint. Also used by the UI preview.
    Native: 0 to 1. Cotton Black: 0

_SpecularLightStrength (Float)
    Specular highlight strength. Also used by the UI preview.
    Native: 0.1 to 9.4. Cotton Black: 0.6

_SpecularLightStrengthMax (Float)
    Maximum specular light strength. Also used by the UI preview.
    Native: 0 to 4. Cotton Black: 1

_ExtraSpecularTightness (Float)
    Tightness of extra highlights. Also used by the UI preview.
    Native: 0 to 15.51. Cotton Black: 1

_WrapValue (Range, 0 to 1)
    How far light wraps around the surface. Also used by the UI preview.
    Native: 0.057 to 0.96. Cotton Black: 0.413

_FresPower (Range, 0.0001 to 16)
    Fresnel edge-response power.
    Native: 0.76 to 8.94. Cotton Black: 4

_FresnelBrightness (Float)
    Brightness of the Fresnel edge effect.
    Native: 0.1 to 4.04. Cotton Black: 1

_IndirectStrength (Range, 0 to 1)
    Strength of indirect lighting.
    Native: 0.049 to 0.84. Cotton Black: 0.1

_BackFaceBrightness (Float)
    Brightness of the fabric's reverse-facing surface.
    Native: 0.3 to 5. Cotton Black: 0.8

_BackfaceBias (Float)
    Bias applied to lighting on the reverse-facing surface.
    Native: 0.15 on every fabric. Cotton Black: 0.15

_DiffuseReducesSpecular (Float)
    Switch or amount for reducing specular light under diffuse light.
    Native: 0 to 1. Cotton Black: 1

_Anisotropic (Float)
    Control for direction-dependent highlights.
    Native: 0 to 1. Cotton Black: 0

_AnisoAngle (Float)
    Direction angle for anisotropic highlights.
    Native: 88 to 140. Cotton Black: 105

_AnisoDrift (Float)
    Offset or drift of anisotropic highlights.
    Native: -13.07 to 25. Cotton Black: 0

_texcoord (Texture)
    Texture-coordinate slot for the shader or Unity. Usually leave unset.
    Native: assigned on 0 of 472. Cotton Black: none

_texcoord2 (Texture)
    Second texture-coordinate slot. Usually leave unset.
    Native: assigned on 0 of 472. Cotton Black: none

_QueueOffset (Float)
    Shader render-queue offset. Advanced setting.
    Native: 0 on every fabric. Cotton Black: 0

_QueueControl (Float)
    Shader render-queue control. Advanced setting.
    Native: 0 on every fabric. Cotton Black: 0

unity_Lightmaps (Texture)
    Lightmap slot managed by Unity. Leave unset for ordinary fabric mods.
    Native: assigned on 0 of 472. Cotton Black: none

unity_LightmapsInd (Texture)
    Directional lightmap slot managed by Unity. Leave unset.
    Native: assigned on 0 of 472. Cotton Black: none

unity_ShadowMasks (Texture)
    Shadow-mask slot managed by Unity. Leave unset.
    Native: assigned on 0 of 472. Cotton Black: none

_ReceiveShadows (Float)
    Whether the shader receives shadows (normally 0 or 1).
    Native: 1 on every fabric. Cotton Black: 1

Native material keywords, with the number of fabrics using each:
    _ALPHAGLOSS_ON               86
    _ANISOTROPIC_ON              242
    _DIFFUSEREDUCESSPECULAR_ON   293

A keyword only has an effect if the selected shader implements it.

Native render queues: 2000 (all 472 fabrics).

The game's fabric UI preview reads the following directly:
    _DetailNormal, _DetailNormalStrength, _WrapValue, _Smoothness,
    _ExtraSpecularTightness, _SpecularTint, _SpecularLightStrength,
    _SpecularLightStrengthMax, _SpecularColor, the main texture scale,
    and the _ANISOTROPIC_ON keyword.

Other properties may affect only the 3D garment.

The meanings of internal shader controls are inferred from their names. The
game's compiled shader does not include written documentation.


--------------------------------------------------------------------------------
7. REFERENCES
--------------------------------------------------------------------------------

Full native fabric dump (every native fabric, shader value, tag weight,
material keyword and native ID):
    BepInEx/config/DressmakerMods/fabric-reference.json

Static enum and ID dump (field names and all allowed type, color and tag
names):
    fabric-values.json

Working fabric examples, each with its own material settings:
    examples/textile-field-guide/mod.json

Loader README (installation, compatibility and build instructions):
    README.md

================================================================================

RECOLORING AN IN-GAME FABRIC

In Mod Manager, open Make fabrics and add a fabric.
Choose an in-game fabric under Mimic material properties of.
You can leave Texture empty to use its image, or choose your own image instead.

Edit fabric properties gives you a color wheel and hex color, pattern size, and gloss.
Advanced still has the full shader controls. Both editors change the same fabric.
The tint goes over the original colors, so pale fabrics are easier to recolor.

Add it to the pack, then Make, install and ZIP pack when you're done.
Author and version are needed when saving the pack, not when adding a fabric.
This creates a new item. The original fabric stays as it is.
You can reopen an installed fabric pack with Edit and change it later.

In mod.json, texture is optional when baseFabric is set.
Use material.color for tint, material.mainTextureScale for image repeats,
and material.floats._Smoothness for gloss. Keep the same IDs when updating.
