Skip to main content

Manual Bake and Restore

This page is for people using a manual Bake for the first time. Most people never need to read it. It takes about 5 minutes.

First: most distributions do not need this​

SituationWhat to use
VRChat uploadAutomatic optimization. Nothing to do
WARUDO mod buildAutomatic optimization. Nothing to do
General Player buildAutomatic optimization. Nothing to do
Handing over baked shader and material assets as filesManual Bake
Comparing and approving optimization results in the sceneManual Bake
An external pipeline that cannot use the automatic hooksManual Bake
The difference in one line

Automatic optimization changes things only during the build and reverts them. A manual Bake creates new assets and actually changes the Renderer slots.

→ Automatic Optimization On Build

Face normal UV7, outline UV8 and character height UV4 are mesh channel bakes. They are separate from the shader Bake on this page. → Mesh UV Bakes


Before you run it​

  1. Record the original .mat, Animator Controllers and AnimationClips in version control.
  2. See that the target is already MingToon materials. A copy made by the Setup Wizard is already in that state. If you switched them by hand, finish the manual conversion first. Run the Bake from the copy's Manager.
  3. In the Manager's Look tab, check the look and the mesh channel bake results in the Outline, face and height setup section. The wizard does not bake mesh channels, so bake what you need here.
  4. Mark values that a runtime script changes with Keep Editable At Bake on that row.

AnimationClips are analyzed automatically. You do not have to mark them.

Features currently off disappear from the code

Features that are off at bake time are removed from the code. Layer counts, Alpha Mask, Emission and Occlusion are among them. If they are not found as something to preserve, turning them on later will not work.

Running the Bake​

Expand the Lightweight Shader Bake (Editor Only) section in the Manager's Look tab. At its top is This avatar's manual bake optimization mode. To preview what an upload produces, match it to This avatar's build and upload optimization mode in Automatic Optimization On Build. This choice applies only to the manual Bake. Then press Bake Child MingToon Materials to Lightweight Shaders.

The MingToon Manager's Look tab showing the lightweight shader bake section, its button and the warning above it

  • Shaders, materials, textures and a manifest are created under Assets/StudioRaming/MingToonGenerated.
  • The Renderer's current slots are changed to the baked materials.
  • If you cancel or it fails partway, the assets and slot changes that run created are reverted.
  • Check the number of materials processed in the Console's MingToon bake: summary.

Run it on a Prefab instance and the changes remain as instance overrides. To apply them to the Prefab asset, use Unity's Overrides > Apply All separately.


Restoring​

Reverting one baked material​

Select the baked material and press Restore Editable Material near the top of the inspector.

It uses the original GUID and Renderer slot recorded in the manifest.

Cleaning up every manual Bake in the project​

Run StudioRaming > MingToon > Advanced > Restore And Clean Bake Output.

This command guarantees an order.

  1. It follows the manifest and returns Renderer slots to the original editing materials.
  2. It saves the restored scene and Prefab references.
  3. It re-verifies that every recorded slot points at the real original.
  4. It deletes the generated assets only after restoration is proven.

If restoring or saving fails, it does not delete the generated folder. It leaves the failed items in the Console and asks for confirmation.

Conversion restore and Bake restore are different

Undo Conversion (back to pre-MingToon materials) returns to the pre-conversion shaders. Restore And Clean Bake Output returns from baked materials to editing MingToon materials.

The Undo Conversion (back to pre-MingToon materials) button is in the Convert / restore existing target section of the Manager's Start tab. A copy made by the Setup Wizard did not change the original, so to discard the wizard's result, delete the copy and switch the original back on.

When the restore button is disabled​

  • Check whether the bake manifest is still there.
  • Check whether the original editing material's GUID is still alive.
  • Check whether the Renderer hierarchy or material slots changed after the Bake.
  • Check the Console for stale manual bake warnings.

Texture handling policy​

A manual Bake is a preview of the upload. So the texture policy uses the same values as upload.

The only reference is Reviewed Texture Rewrites On Build (Opt-In) on the Automatic upload optimization card of the MingToon Manager's Optimize tab. If the first switch on that card (Optimize On Build / Upload (Applies To Everything)) is off, this toggle is not shown, but a Manual Bake still reads the stored value.

Lossless only (LosslessOnly) — the default​

This is the behavior with the opt-in off. It does not rewrite the pixels of the original textures.

It only permits mathematically identity mask removal and sharing of the same texture with the same UV expression.

Reviewed high quality (ReviewedHighQuality)​

This is the behavior with the opt-in on. It permits surface and normal flattening and mask repacking.

Turn it on only for reviewed static materials

Reading, color space, mip regeneration and platform compression can change the pixels. Compare the results before and after the bake on your target platform yourself.

Mask repacking merges several masks into one texture. It does not always reduce the shader's texture sample count.

Keep Editable At Bake​

Keep Editable At Bake is a per-material record.

AnimationClips are analyzed automatically, so they do not need marking.

Use it on values that a runtime script changes, or that an external system accesses by name.

To exclude a whole group at once, use Keep This Group Editable At Bake.

Next​

Automatic Optimization On Build · VRChat · Warudo · Troubleshooting