> For the complete documentation index, see [llms.txt](https://docs.viverse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.viverse.com/polygon-streaming/integrations-and-plugins/polygon-streaming-unity-sdk/vrm-avatar-streaming.md).

# VRM Avatar Streaming

### Prerequisites

Core VRM features work **without UniVRM**. VRMA animation and MToon shading require UniVRM:

```
https://github.com/vrm-c/UniVRM.git?path=/Assets/UniGLTF#v0.130.1
https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM10#v0.130.1
```

| Feature                            | Without UniVRM   | With UniVRM            |
| ---------------------------------- | ---------------- | ---------------------- |
| Expressions, look-at, spring bones | Supported        | Supported              |
| Humanoid bones & Mecanim           | Supported        | Supported              |
| First-person filtering             | Supported        | Supported              |
| MToon material (toon shading)      | Fallback (unlit) | Full MToon10 rendering |
| VRMA animation                     | Not supported    | Full support           |

***

### MToon Material Support

VRM models using MToon materials (toon/cel-shading) are automatically rendered with the correct MToon10 shader when UniVRM is installed. The SDK reads `VRMC_materials_mtoon` extension data from the XRG file and applies all MToon properties including shade color, shading shift, rim lighting, outline, and UV animation.

The SDK auto-includes MToon shaders in builds via `MToonShaderIncluder`. If rendering appears incorrect (white/unlit), ensure UniVRM packages are installed and the MToon shader is available in your build target.

| Render Pipeline | Shader Used                               |
| --------------- | ----------------------------------------- |
| Built-in (BRP)  | `VRM10/MToon10`                           |
| URP             | `VRM10/Universal Render Pipeline/MToon10` |

***

### Setup

Same as any model — `StreamController` + `StreamingModel` with a VRM-based XRG URL. VRM controllers are **auto-initialized** on load. No manual VRM component setup needed.

For Mecanim animation, drag an `AnimatorController` into **Custom Animator Controller** and press Play.

***

### Quick API Overview

#### Expressions

```csharp
streamingModel.SetVrmHappy(0.8f);
streamingModel.SetVrmBlink(1.0f);
streamingModel.SetVrmAa(0.5f);    // Lip-sync viseme
streamingModel.ResetVrmExpressions();
```

#### Look-At

```csharp
streamingModel.SetVrmLookAtTarget(Camera.main.transform);
```

#### Spring Bones

```csharp
streamingModel.SetVrmSpringBonesEnabled(true);
streamingModel.ResetVrmSpringBones();  // After teleporting
```

#### VRMA (requires UniVRM)

```csharp
bool ok = await streamingModel.LoadVrmaFromUrlAsync("https://example.com/dance.vrma");
if (ok)
{
    streamingModel.SetVrmaLoop(true);
    streamingModel.PlayVrma();
}
```

#### Humanoid Bones

```csharp
Transform head = streamingModel.GetVrmBone(HumanBodyBones.Head);
```

***

### Important

Always check `IsVrm` and wait for load before calling VRM APIs:

```csharp
streamingModel.SetLoadedCallback(() =>
{
    if (streamingModel.IsVrm)
        streamingModel.SetVrmHappy(1.0f);
});
```

***

> For the full API reference (spring bone physics override, first-person setup, VRM meta, VRMA time control, complete examples, troubleshooting), see `USAGE_VRM_STREAMING.md` shipped with the SDK package.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.viverse.com/polygon-streaming/integrations-and-plugins/polygon-streaming-unity-sdk/vrm-avatar-streaming.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
