> [!abstract] Summary
> Advanced Mari workflow — **multi-material / multi-channel texturing** using `Material` and `Multi-Channel` nodes. Instead of painting one flat shader, you **layer several physically distinct materials** (base metal + rust + dust + dry paint…) the same way a lookdev artist stacks sub-shaders. Also covers **PTEX** authoring and advanced node tricks (Vector Split/Combine, bake points, masking strategies).
> [!info] Prerequisite reading
> This note assumes the setup, buffer settings, and single-shader workflow from [[MARI Single channel Practice]]. Only the *multi-material* specifics are covered here.
---
# Part 1 — Why Multiply Materials
When an asset needs **rust, dry paint, dirt, wet patches, varnish wear**, it is far more physically accurate — and far easier to iterate on — to drive each contribution with its **own full material** (albedo + roughness + bump + metalness + SSS…) and blend them with masks, exactly like a layered shader in lookdev.
| Problem with a single-channel approach | Multi-material advantage |
| --- | --- |
| You need to hand-paint *every* channel consistently for each variation | Each material is authored once and reused everywhere via masks |
| Roughness/metallic/bump break apart the moment you tweak base color | A material is a unit — its lobes stay coherent |
| Very hard to re-target between assets | Materials are templates you can copy/paste across projects |
| Expensive re-bakes each time you change a level | Multi-Channel Bake Point caches the final stack |
---
# Part 2 — Multi-Channel Workflow
## 1. Setup
1. Start from a basic Arnold shader, **or** create the export channels as usual (Base Color, Specular, Spec Roughness, Metalness, Bump, Normal, SSS, Opacity…).
2. Create a **Multi-Channel Node** matching the Arnold shader and connect every channel.
3. Create a **Material Node** — leave its color unconnected — and import a material template (see *Generic Material* tip below).
4. Think in **layers**, like in lookdev: **base material first**, then everything that sits on top (rust, dirt, paint, varnish).
5. At the end of the **Material** chain, add a **Multi-Channel Bake Point** and bake the channels to keep the graph light.
![[file-20240824170552789.png|600]]
## 2. Layer Order
| Order | Layer type | Example |
| ----- | ------------------------- | ---------------------------------- |
| 0 | **Base material** | Metal, wood, plastic |
| 1 | **Primary alteration** | Oxidation, rust, patina |
| 2 | **Secondary alteration** | Scratches, edge wear |
| 3 | **Contamination** | Dust, dirt, leaks |
| 4 | **Top coat / final pass** | Varnish, wet patches, fingerprints |
Each layer gets its **own mask** driven either by a paint node, a Geo Channel (curvature, AO, cavity) or a procedural (noise, triplanar).
## 3. Masking Strategies
- **Curvature + Blur + Curve** → isolate edges for edge wear.
- **AO + Curve** → isolate cavities for dirt accumulation.
- **Noise × Position** → large-scale variation (triplanar noise in object space).
- **Paint node (Scalar)** → art-directed masks where procedurals are not enough.
- **Combined masks** → use a `Mask Blend` or a simple multiply/add graph to compose masks from multiple sources.
---
# Part 3 — Generic Material Template
Build a **generic material** once and copy-paste it across projects.
> [!tip] Template content
> - One **Material Node** with every channel wired (Base Color, Spec, Spec Roughness, Metalness, Bump, Normal, SSS Color, SSS Radius, Opacity, Emission).
> - A default set of **procedural inputs** (triplanar noise, tiled pattern, gradient).
> - A neutral **mask input** on top of each channel so you can drop any mask without rewiring.
> - A **color proxy** (solid gray or checker) on each channel for fast debugging.
Save it via **File → Template → Save Project Template** and reuse it in any new project.
---
# Part 4 — Multi-Channel Bake Point
Baking a multi-channel stack collapses the entire upstream material graph into a single cached output per channel. It is **critical** for performance on hero assets.
- Always place a `Multi-Channel Bake Point` at the **output** of each finished material group.
- Re-bake only the materials you are currently iterating on.
- Keep one final bake point at the very end of the stack, feeding the Arnold shader.
> [!warning] Changes upstream of a bake point are invisible until you re-bake. Flag materials as "dirty" when you tweak them.
---
# Part 5 — PTEX Workflow
PTEX (per-face texture) removes the need for UV unwrapping — textures are authored per face directly on the geometry. Useful for **hero characters, organic assets, or props with complex topology**.
## When to use PTEX
| Use PTEX when | Use UDIMs when |
| --- | --- |
| Asset has no usable UVs | UVs are clean and optimized |
| Highly subdivided organic surface (creatures, rocks) | Hard-surface assets |
| Shared across pipelines that understand PTEX | Pipeline is strictly UDIM-based |
| You want to avoid seams at all cost | You want portable, tool-agnostic textures |
Honestly PTEX are less and less used nowadays in my opinion but still doable with engine like renderman
## Setup in Mari
1. When creating the project, select **Ptex** instead of UDIM.
2. Set a **default face resolution** — this acts as the baseline texel density.
3. Increase resolution only on the faces that need it (**Patches → Set Face Size**) to avoid ballooning memory.
4. Work exactly like a UDIM project — nodes and channels behave the same.
5. Export via **Channels → Export** with the `.ptx` format (or bake back to UDIMs if the render pipeline requires it).
> [!warning] Not every renderer supports PTEX natively.
---
# Part 6 — Advanced Node Tricks
## Channel Split
| Node | Purpose |
| --- | --- |
| **Vector Split** | Break an RGB map into three scalar masks — perfect for packed mask maps (R/G/B → three separate masks). |
| **Vector Combine** | The inverse — pack three scalar masks back into a single RGB texture for cheaper export. |
> [!tip] Pack masks into a single RGB map on export to reduce the number of files the lookdev step has to load.
## Graph Hygiene
- Use **Teleport** nodes for long connections (equivalent to Nuke postage stamps).
- Group repeated chains inside a **Node Group** (`.mng`) and save it as a gizmo.
- Keep the graph **left-to-right, top-to-bottom** — read like a book.
- Rename every node that matters. Unnamed nodes are tech debt.
- Color-code node groups by material (base = gray, rust = orange, dust = brown…).
## Debugging
- Connect any node to a **Viewer** to see it in isolation (like a Nuke viewer pipe).
- Toggle the **solo** mode on a material to visualize its contribution only.
- Add a **Bake Point** before a suspect node — if baking "fixes" the look, the upstream chain has a resolution or cache issue.
---
# Part 7 — Mask Authoring Tips
### Edge Wear
1. Geo Channel → **Curvature** bake.
2. **Blur** slightly (via Bake Point + Blur filter).
3. **Curve** to isolate peaks.
4. Multiply with a **procedural noise** to break the line.
### Dirt / Dust
1. Geo Channel → **AO** bake.
2. **Curve** to isolate cavities.
3. Multiply with a **gradient** (object-space Y) so dust accumulates from the top down.
### Leaks
1. Paint a top-edge mask on a Paint node.
2. Add a **Directional Blur** downward.
3. Multiply with a noise for break-up.
### Wet Patches
- Separate mask driving:
- Lower roughness → wet.
- Darker base color → absorption.
- Slightly higher specular.
---
# Part 8 — Copy / Paste Across Projects
- Materials authored against a **generic template** can be exported as `.mng` and imported in any Mari project.
- Keep a personal **Mari material library** (folder of `.mng` files) under version control.
- When copying between projects, match the **channel names exactly** — the import will re-wire automatically when names match.
---
# Part 9 — Export
1. Use **Export Manager** and select the channels to export.
2. Bake the **Multi-Channel Bake Point** first to make the export consistent with the viewport.
3. Pack masks into RGB channels where possible (see *Vector Combine*).
4. Follow the **PROTOCOL texture naming convention** — see `CLAUDE.md` or `PROTOCOL/DOCUMENTATION/PROTOCOL Naming Convention.md`:
- `XXX_[type]_assetName_[variant]_[resolution]_[MAP]_[colorSpace].$UDIM.tif`
5. Confirm color space is correct per map (`ACEScg` for color, `Raw` for data maps).