Skip to content

Utilities

MochiesCode edited this page Sep 30, 2026 · 14 revisions

Mochie's Shaders come with several editor utilities. Most are under Tools > Mochie in Unity's menu bar. The rest are on the Project window's right-click menu or built into the material inspectors.

Utility Where to find it What it does
Global Standard Settings Tools > Mochie > Global Standard Settings Changes settings on many Standard materials at once and swaps them between shader variants.
Texture Packer Pack Textures button in the Standard, Uber, Glass, and Particles inspectors Packs separate occlusion, roughness, metallic, and height maps into one texture.
Convert to Flipbook Asset Right-click a GIF, or Tools > Mochie > Convert to Flipbook Asset Turns an animated GIF into a texture array for flipbook slots.
Create Material Assets > Create > Material (Mochie Standard / Standard Lite / Standard Mobile) Creates a new material that already uses a Standard variant.
Material Upgrader Runs automatically, or Tools > Mochie > Shaders Moves materials made with older versions of Standard and Standard Lite to the current version.
Build Texture Stripper 🚧 Tools > Mochie > Build Texture Stripper Unreleased, work in progress. Removes textures a material doesn't use from builds.

Global Standard Settings

Open it with Tools > Mochie > Global Standard Settings. The window, titled Standard Shader Settings, edits every Standard, Standard Lite, and Standard Mobile material it finds at once. Use it to keep lighting settings consistent across a whole world (for example, setting every material to your Bakery bake's directional mode), or to move a world to Lite or Mobile. Every change it makes can be undone with Ctrl+Z.

Finding Materials

The top of the window controls which materials the tool works on.

  • Scene Materials Only: On by default. Only materials used by renderers in the active scene are affected. Turn it off to affect every material in the project instead, including ones no scene uses.
    • Inactive Objects (Scene Materials Only): Also includes renderers on disabled GameObjects. On by default.
  • Material count: How many Standard, Standard Lite, Standard Mobile, and Unity Standard materials were found. In scene mode it counts material slots, so a material used on five renderers counts five times. The Unity Standard count also includes Unity's Autodesk Interactive shader.
  • Refresh Materials List: Scans for materials again. The list is only built when the window opens and when you change the toggles above, so refresh after adding objects or materials, or after switching scenes.

Tools

These buttons act immediately, without Apply Changes.

  • Restore Default Textures: Reassigns the Standard shader's built-in textures on every found material: the Default Textures (Filament LUT, SSR noise, droplet mask, and rain texture sheet) and the hidden default sampler textures. Use it if materials lose them, such as materials copied from another project, or ones where a built-in texture was swapped by mistake. The textures are loaded from Assets/Mochie/Unity/Textures, so the package must be in its default location.
  • Debug View: Switches every found material to the chosen Debug View and turns on its Debug Mode, so the whole scene shows the same component: base color, normals, roughness, lighting, and so on. It's useful for spotting inconsistent textures or lighting across a scene. Set it back to None to turn debug output off on all of them.

Swap Shaders

Moves every found material from one shader to another.

  • Change from: The shader to swap away from.
    • Unity Standard: Unity's built-in Standard shader, including Standard (Specular setup) and Autodesk Interactive.
    • Filamented: Silent's Filamented shader.
    • Standard, Standard Lite, or Standard Mobile: One of Mochie's Standard variants.
  • To: The Mochie Standard variant to swap to: Standard, Standard Lite, or Standard Mobile.
  • Swap Shaders: Swaps every found material that uses the Change from shader. The material list refreshes afterwards.

Swapping between Mochie's Standard variants keeps every setting, since they share the same properties. Features the new variant doesn't have (see the variant table) are ignored, and come back if you swap back.

Every swap works the same as picking the new shader in the material's inspector: the shader's keywords, blending mode, and render queue are set up right away.

When swapping from Unity Standard, the textures are carried over to Mochie's Standard: the base color map and color (with tiling and offset), alpha cutoff, normal map, metallic map, occlusion map, height map, emission map and color, detail base color, detail normal map, and detail mask. From Autodesk Interactive, its roughness map carries over too. Standard (Specular setup) materials are switched to the Specular workflow with smoothness read from the specular map's alpha, as in Unity, and keep their specular map, specular color, and smoothness value. Values that work differently in Mochie's Standard, like the Metallic and Smoothness sliders of metallic materials, the smoothness stored in the metallic map's alpha, and the rendering mode, aren't carried over, so check each swapped material afterwards.

Settings

The rest of the window holds settings to apply to every found material. Each one has a checkbox on its left: only checked settings are applied, and unchecked settings are left as they are on each material. That lets you change one setting everywhere without flattening the rest.

Nothing changes until you click Apply Changes at the bottom of the window. Settings only apply to Mochie's Standard variants, not to Unity Standard or Filamented materials (swap those first).

Specularity Settings

Matches the Specularity and Shader Variant settings.

  • Shading Model: The Specular Model: Unity Standard or Google Filament.
  • Reflections: Turns Environment Reflections On or Off.
  • Specular Highlights: Turns realtime Specular Highlights On or Off.

Lightmapping Settings

Matches the Lightmap Settings and Light Volumes settings.

  • Directional Mode: The Bakery Mode: None, SH, RNM, or MonoSH. Match it to the directional mode of your Bakery bake.
  • Bicubic Sampling: Turns Bicubic Lightmap Sampling on or off.
  • Non-Linear SH: Turns Non-Linear SH on or off.
  • Lightmap Specular: Turns Bakery Specular Highlights on or off.
  • Additive Light Volumes: Turns Additive Volumes on or off.

Filtering Settings

Matches the Filtering settings.

  • Enable: Turns Filtering on or off.
  • Hue Mode: HSV or Oklab.
  • Hue, Saturation, Brightness, Contrast, and ACES: The Post Processing values.

AreaLit Settings

Matches the AreaLit settings. Handy for assigning a scene's AreaLit textures to every material in one go.

  • Enable: Turns AreaLit on or off.
  • Specular Occlusion: Turns AreaLit specular occlusion on or off.
  • Strength and Roughness Multiplier: The AreaLit values.
  • Light Mesh and Light Texture 0 to Light Texture 2: AreaLit's light mesh and light textures. These accept any 2D texture, including regular textures and Render Textures.
  • Light Texture 3: AreaLit's static light textures. Only accepts a texture array.
  • Occlusion: The AreaLit occlusion texture. Accepts any 2D texture.
  • Occlusion UV Set: Which coordinates the occlusion texture uses: UV0 to UV4, or Lightmap UV.

Texture Packer

The Pack Textures button combines separate grayscale maps into one packed texture, then switches the material to its packed workflow. Packed textures use fewer texture samples and less memory than separate maps (see Packed Maps). The button appears in the Metallic workflow once at least one of the maps is assigned:

  • Standard: In Primary Textures, and in Detail Textures (Standard only).
  • Uber: In Textures > Primary Maps.
  • Glass: In Surface.
  • Particles: In Lighting.

Clicking it:

  1. Packs the maps into these channels:
    • R: Occlusion
    • G: Roughness (a smoothness map stays smoothness, so Standard's Smoothness Mode still applies)
    • B: Metallic
    • A: Height, in Standard and Uber. The texture only gets an alpha channel when a height map is assigned. Standard's detail maps put something else here (see below).
  2. Saves the result as a PNG next to the material, named <Material Name>_PackedMap.png, or <Material Name>_DetailPackedMap.png for Standard's detail maps. It's imported ready to use, with a Max Size that fits the texture, Trilinear filtering, and an Aniso Level of 16. Compression depends on the alpha channel:
    • Without alpha: Normal Quality (DXT1 on PC), which is half the size of High Quality. A 2048Γ—2048 map is about 2.7 MB instead of 5.3 MB.
    • With alpha: High Quality (BC7 on PC). Normal Quality with alpha (DXT5) is the same size, so the cleaner format costs nothing extra.
  3. Assigns it to the packed map slot, switches the workflow to Packed Metallic, sets the channel selectors to match the layout above, and turns on packed height if a height map was included.

Packing again overwrites the texture made last time, as long as it's still assigned to the packed map slot. Otherwise a new file is created, with a number added if the name is taken. Any of the settings above that you changed since the last pack are kept, as are platform overrides. The rest are updated, so an untouched Max Size follows the new resolution and untouched compression follows whether there's an alpha channel. Materials that aren't saved as assets, or that are outside the Assets folder (such as in a read-only package), save their packed texture in Assets.

Multiple materials: With several materials selected, each one is packed into its own texture. The workflow only switches once every material packed successfully. If one fails, the Console says why.

Ctrl+Z undoes the changes to the material, but the packed texture file stays.

Keeping the Same Look

The material should look the same before and after packing:

  • Standard, Glass, and Particles: The Metallic and Roughness values multiply their maps, and the Occlusion value sets how strong the occlusion is. These are baked into the packed texture, and the packed strength values are then reset to 1, so nothing is applied twice.
  • Uber: Maps are packed as they are. The packed workflow still uses the Occlusion Strength and Height Strength values, and the Metallic and Roughness values only fill empty slots.
  • Empty slots are filled with the value. For example, with no metallic map and Metallic at 0, the blue channel is black. An empty occlusion slot is white (no occlusion).
  • Standard's detail maps are packed as they are, since the detail strengths work the same way in both detail workflows. An empty detail slot is filled with the value that leaves the base unchanged under its blend mode. Alpha and Lerp, and the Replace mask mode, have no such value, so that detail's strength is set to 0 instead. It had no effect without a map anyway.
    • Alpha: The packed detail map has one alpha channel, shared by all three maps for the Alpha blend mode. It's taken from the first map that uses Alpha blending (checking occlusion, then roughness, then metallic). If several maps use it with different textures, the Console warns that they'll all blend by that one alpha. With the Replace mask mode, the packed detail map has no alpha.
  • Tiling in Glass and Particles: These give each map its own tiling and offset. If every assigned map uses the same tiling, it moves to the packed map. Otherwise it's baked into the texture at the resolution of the largest map. A map tiled more than once is repeated within that resolution, so it loses detail. Use matching tiling to keep full detail.
  • UV animation in Particles: Scrolling and polar UV settings move to the packed map when every assigned map shares them. When they differ, packing can only bake in the static tiling, so a dialog warns that the UV animation will be dropped, with Pack Anyway and Cancel.

Source Maps

  • One channel is read from each map: green in Standard and Particles, and in Uber's occlusion map; red in Glass and Uber's other maps. That's the same channel each shader reads from the separate maps, so use grayscale maps. Single-channel textures work whichever channel is read.
  • Resolution: The packed texture is the same size as the largest assigned map (the one with the most pixels), and never larger, even when tiling is baked in. Maps are read from their original files at full resolution, ignoring their import settings like Max Size and compression. PNG and JPG files are read directly. Other formats, such as TGA, PSD, TIF, and EXR, are imported as a temporary uncompressed copy in Assets/__MochieTexturePackerTemp, which is deleted afterwards. Textures without an image file of their own are read from the imported texture.
  • Precision: The packed texture has 8 bits per channel, so 16-bit height maps are reduced to 8 bits.
  • The separate maps stay assigned. Switch the Workflow back to Metallic to return to them.

Convert to Flipbook Asset

Converts an animated GIF into a texture array (a .asset file), which is the format flipbook slots use:

To convert a GIF, select it in the Project window, then either right-click it and choose Convert to Flipbook Asset, or use Tools > Mochie > Convert to Flipbook Asset. The option is grayed out unless the selected asset is a GIF. It converts one GIF at a time.

  • Output: A texture array with the GIF's name, saved next to it (Fire.gif becomes Fire.asset). Converting again replaces the existing asset.
  • Frames: Each frame becomes one slice of the array, in order.
  • Size: Every frame is resized to the nearest power of two in each direction, using high-quality bicubic filtering. For example, a 500Γ—280 GIF becomes 512Γ—256.
  • Compression: DXT5 if any pixel in any frame is transparent, otherwise DXT1 (no alpha), for less memory.
  • Filtering: The array has mip maps, trilinear filtering, and 16Γ— anisotropic filtering.
  • Timing: The GIF's frame timing isn't kept. The playback speed and frame count are set on the material.

Large GIFs can take a while, since every pixel of every frame is processed. A progress bar shows each frame's progress, and Cancel stops the conversion without creating anything.

The converter was written by Poiyomi and is included with permission.

Create Material

Adds three entries to Assets > Create (also on the Project window's right-click Create menu):

  • Material (Mochie Standard)
  • Material (Mochie Standard Lite)
  • Material (Mochie Standard Mobile)

Each one creates a material that already uses that variant, so you don't have to create a material and then change its shader. It's saved as New Material (numbered if the name is taken) in the folder currently open in the Project window. The new material is then selected and ready to rename, just like Unity's own Create > Material.

Material Upgrader

Standard and Standard Lite had their properties renamed and their shader files replaced in an update. Materials made before that would otherwise lose their textures and settings. The upgrader moves them to the current shader and carries their settings over. It recognizes old materials by the older shader file they point to, so it also finds materials that show up pink because that file is gone.

Automatic Upgrades

  • When you import or update the package, the upgrader scans the project. If it finds materials made with the older shaders, it asks whether to upgrade them. Choose Upgrade to upgrade them all, or Skip to leave them (you can upgrade them later from the menu).
  • When you import an older material later, such as from an old unitypackage or a model's asset folder, it's upgraded automatically, without asking.

Manual Upgrades

  • Tools > Mochie > Shaders > Upgrade All Materials: Scans every material in the project and upgrades the ones that need it.
  • Tools > Mochie > Shaders > Upgrade Selected Materials (also Mochie > Upgrade Selected Materials on the Project window's right-click menu): Upgrades only the selected materials. Selecting a folder includes every material inside it. Materials that don't need upgrading are skipped.

What an Upgrade Does

  1. Switches the material to the current Standard or Standard Lite shader.
  2. Copies each old setting to its new property: textures, strengths and multipliers, workflow and sampling modes, emission and emission pulse, detail maps, specular occlusion, AreaLit settings, UV sets, rotation, and scrolling, culling, and more.
  3. Assigns any missing built-in textures (the Filament LUT, SSR noise, droplet mask, rain texture sheet, and default samplers). Textures that are already assigned are kept.
  4. Sets up the material's shader keywords and blending mode as the inspector would.

Afterwards, the materials are saved and the Console shows how many were upgraded. Upgrading more than 10 materials shows a progress bar, and Cancel stops after the current material.

Material variants (materials that inherit from a parent material) are skipped, since they take their shader from their parent. Upgrade the parent material instead.

Back up your project before upgrading a large number of materials.

Build Texture Stripper 🚧

Warning

Unreleased and a work in progress. The Build Texture Stripper isn't in any released version yet. Everything below may change before it ships, and it may not work correctly in every project. Back up your project before trying it.

Materials often keep textures they no longer use, such as the separate metallic and roughness maps left behind after switching to a packed workflow, or the textures of a feature that's been turned off. Unity still includes those textures in builds, which makes uploads bigger and uses more memory. The Build Texture Stripper finds these unused textures on Mochie materials and leaves them out of builds, without changing your materials.

Open it with Tools > Mochie > Build Texture Stripper, or right-click an object in the Hierarchy and choose Mochie > Analyze Textures for Build to open it and scan that object straight away.

It works with every Mochie shader. Materials using other shaders are ignored.

How It Works

A texture counts as unused when the shader can't sample it with the material's current settings. The rules follow the shader code rather than the inspector, and they err on the side of keeping a texture. For example, a feature is only treated as off when both its toggle and its shader keyword agree it's off.

When stripping, the tool never edits your material assets. Instead, it swaps each affected material for a copy with the unused textures removed, only on the copy of the scene or avatar that's being built. A material used by several objects gets a single copy, so batching and instancing aren't affected.

Build Pipeline Settings

These settings are saved in the project's ProjectSettings folder, so they apply to everyone who builds the project.

  • Strip Unused Textures on Build: Off by default. When on, unused textures are stripped from:

    • Worlds and player builds: every scene in the build.
    • VRChat avatars: the copy of the avatar the VRChat SDK builds. This runs after VRCFury and Modular Avatar, so the animators they add are included in the animation check. The stripped copies are saved in a temporary Assets/_MochieTextureStripperTemp folder during the build and deleted afterwards. If an error occurs, the avatar build is cancelled instead of uploading with missing materials.

    Play mode is never stripped. Use the test clone to preview the result.

  • Animation Safety Check: On by default. Textures on any material property that an animation changes are never stripped. This covers Animators, Timeline, legacy Animation components, VRChat playable layers, and VRCFury and Modular Avatar components. Animating a texture's tiling or offset also protects that texture.

  • Strip Features Disabled by Zero Strength / Black Color: Off by default. Also treats a feature as off when its strength is 0 or its color is black. Only turn this on if no scripts (such as Udon) or material property blocks change those values while the game is running, since the tool can't see those changes. Animations are still checked.

  • Log Build Summary in Console: On by default. After each build, the Console lists every texture that was stripped and why.

Analyze & Preview

Scans an object without changing anything, so you can check what would be stripped.

  • Target Avatar / Object: The object to scan, including all of its children. Defaults to the selected object when the window opens.
  • Use Selected Object: Sets the target to the object selected in the Hierarchy.
  • Scan Unused Textures: Lists every Mochie material on the target that has unused textures, with each texture slot and the reason it's unused. Ping highlights the material in the Project window.

Slots marked (build only) are the shader's built-in default textures (such as the Filament LUT, SSR noise, and rain textures), or textures for features the shader doesn't currently sample. They're stripped from builds, but Clean In-Place leaves them assigned.

Below the results:

  • Create Non-Destructive Test Clone in Scene: Duplicates the target as <Name>_StrippedTest and strips it the same way a build would, so you can check it still looks right. Your materials are unchanged. Delete the clone when you're done.
  • Clean In-Place (Modify Project Assets): Removes the unused textures from the material assets themselves, after asking you to confirm. Since materials are shared, this affects every object that uses them, and the animation check only covers the target and the open scenes. Materials that can't be edited (materials inside a model or scene file, or in a read-only package) are skipped. It can be undone with Ctrl+Z.

Things to Know

  • If something other than a renderer still references an original material, such as an animation that swaps materials, a Udon script's material list, or a prefab spawned at runtime, the original still ships with all of its textures. The Console warns you and lists those materials. Scripts that compare a renderer's material to the original will also see the stripped copy instead.
  • Textures that scripts assign or change while the game is running aren't detected.

πŸ”’ = Patrons only


Avatar Shaders

Uber
Uber X πŸ”’
Uber X (Outline) πŸ”’
Taken πŸ”’
Avatar Props πŸ”’

Environment Shaders

Standard
Water
Water (Tessellated) πŸ”’
Underwater Visuals
Glass
Splat Mapping πŸ”’
LED Screen

Special Effects Shaders

Particles
Particles X πŸ”’
Screen FX
Screen FX X πŸ”’
Corruption πŸ”’

Links

Clone this wiki locally