0% found this document useful (0 votes)
2 views81 pages

Unity Developer Instructions

The document outlines the requirements for a Unity developer tasked with implementing the Avatar Visualization Layer for the Sita Hologram Avatar System. It details the backend services provided, including a complete REST API and WebSocket server, and specifies the necessary components to be built in Unity, such as 3D models, shaders, and material profiles. The document also includes specific instructions for setting up the avatar model, implementing shaders, and creating material profiles for both normal and hologram rendering modes.

Uploaded by

badmuswadud123
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views81 pages

Unity Developer Instructions

The document outlines the requirements for a Unity developer tasked with implementing the Avatar Visualization Layer for the Sita Hologram Avatar System. It details the backend services provided, including a complete REST API and WebSocket server, and specifies the necessary components to be built in Unity, such as 3D models, shaders, and material profiles. The document also includes specific instructions for setting up the avatar model, implementing shaders, and creating material profiles for both normal and hologram rendering modes.

Uploaded by

badmuswadud123
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

UNITY DEVELOPER INSTRUCTIONS

# 🎯 UNITY DEVELOPER - COMPLETE REQUIREMENTS & DELIVERABLES

## Everything You Received & Exactly What to Deliver

**Project:** Sita Hologram Avatar System

**Date:** January 15, 2026

**Status:** Backend Complete ✅ | Unity Integration Ready ✅

**Your Task:** Implement the Avatar Visualization Layer in Unity

---

## 📊 EXECUTIVE SUMMARY FOR YOUR DEVELOPER

You are receiving a **production-ready backend system** with:

- ✅ Complete REST API (authentication, user management, sessions, content)

- ✅ Real-time WebSocket server (presence, avatar state, room management)

- ✅ Job queue system with Redis (asynchronous content generation)

- ✅ Complete type definitions and OpenAPI specification

- ✅ Docker orchestration (all services containerized)

- ✅ Protocol schemas (validation + TypeScript generation)

**Your responsibility:** Implement the **Unity visualization layer**


that connects to this backend and displays interactive 3D avatars with
material switching, emotional expressions, and real-time synchronization.

---
## WHAT YOU'RE BUILDING

### The Complete System Architecture

```

┌──────────────────────────────────────────────────────────┐

│ UNITY APPLICATION │

│ (What the developer implements) │

├──────────────────────────────────────────────────────────┤

│ • Avatar 3D Model (FBX imported) │

│ • Shaders (Skin SSS, Eye Parallax, Hair Anisotropic) │

│ • Material Profiles (Normal & Hologram modes) │

│ • Animation Controller (Blendshapes, Idle animations) │

│ • UI Controls (Token input, toggles, emotion slider) │

│ • Networking Bridge (WebSocket client) │

│ • Demo Scene (Camera, lighting, prefabs) │

└──────────────────────────────────────────────────────────┘

↕ HTTP & WebSocket

┌──────────────────────────────────────────────────────────┐

│ BACKEND SERVICES │

│ (Already built & ready to use) │

├──────────────────────────────────────────────────────────┤

│ API Server (Port 4000) │

│ - Authentication (/auth/token) │

│ - User Management (/users/me) │

│ - Device Registration (/devices) │

│ - Session Lifecycle (/sessions) │


│ - Content Management (/content) │

│ - Job Enqueuing (/jobs/generate) │

│ - Audit Receipts (/receipts) │

│ - Metrics & Analytics (/metrics) │

│ │

│ WebSocket Server (Port 4001) │

│ - Authentication on connect │

│ - Presence updates (online/offline) │

│ - Avatar state fanout (emotion, gaze, gesture) │

│ - Room-based scoping │

│ - Rate limiting & validation │

│ │

│ Job Queue (Redis + BullMQ) │

│ - Enqueue content generation jobs │

│ - Dead-letter queue for failed jobs │

│ - Receipt logging for audit trail │

└──────────────────────────────────────────────────────────┘

```

---

## 🚀 WHAT'S ALREADY BUILT (BACKEND)

### REST API Server (`apps/api/`)

**Status:** ✅ Complete and tested

**Port:** 4000

**Type:** [Link] + TypeScript


**Endpoints:**

| Endpoint | Method | Purpose | Auth Required |

|----------|--------|---------|---|

| `/auth/token` | POST | Issue JWT token for user | No |

| `/users/me` | GET | Get current user info + devices list | Yes |

| `/devices` | POST/GET | Register device / list devices | Yes |

| `/sessions` | POST/GET/DELETE | Create/list/close sessions | Yes |

| `/content` | GET/POST | Get lessons/programs, create content | Yes |

| `/receipts` | GET | Audit trail of all actions | Yes |

| `/artifacts` | GET/POST | Screenshots, recordings, proof | Yes |

| `/metrics` | GET | KPIs (NPS, completion, session time) | Yes |

| `/jobs/generate` | POST | Enqueue content generation job | Yes |

**Request/Response Format:** All JSON with standardized envelopes

**Authentication:** JWT tokens in `Authorization: Bearer <token>` header

**Rate Limiting:** 100 requests per minute per user

### WebSocket Server (`apps/realtime/`)

**Status:** ✅ Complete and tested

**Port:** 4001

**Type:** [Link] ([Link] WebSocket library)

**Features:**

- JWT validation on connect

- Presence updates (user online/offline events)


- Avatar state fanout (broadcast emotion, gaze, gesture changes)

- Room-based message scoping (only room members see updates)

- Rate limiting (20 messages/sec per client)

- Ajv schema validation (validates all incoming messages)

**Message Types:**

```typescript

// Client connects

type: "presence",

payload: {

userId: "user123",

deviceId: "device456",

status: "online"

// Avatar emotion change broadcast

type: "avatar-state",

payload: {

emotion: "happy",

emotionIntensity: 0.8,

gazeDirection: { x: 0.1, y: 0.2, z: 0.9 },

gestureType: "wave",

timestamp: 1673481234567
}

// Join room

type: "join-room",

payload: {

roomId: "class123"

```

### Job Queue System (`apps/agent-runtime/`)

**Status:** ✅ Complete and tested

**Queue Engine:** BullMQ + Redis

**Type:** [Link] background worker

**Jobs Supported:**

- `generate-content` - Create educational content

- `evaluate-content` - Score content (stub ready)

- `publish-content` - Publish to channels (stub ready)

- `safety-check` - Content filtering (stub ready)

**Features:**

- Automatic retry on failure (exponential backoff)

- Dead-letter queue for permanently failed jobs

- Receipt logging (job completion → audit trail)


- Event emission for real-time progress tracking

### Protocol & Type Definitions (`packages/protocol/`)

**Status:** ✅ Complete

**Type:** JSON Schema + TypeScript generation

**Schemas Defined:**

- `[Link]` - Avatar state (emotion, gaze, gesture)

- `[Link]` - User presence (online/offline)

- `[Link]` - Session data (user, device, timing)

- `[Link]` - Content metadata (title, program)

- `[Link]` - Audit trail (actor, action, target, timestamp)

**Generated Artifacts:**

- TypeScript type definitions (runtime safe)

- Ajv validators (JSON Schema validation)

- OpenAPI TypeScript client (REST API client library)

### Docker Orchestration (`[Link]`)

**Status:** ✅ Complete

**Includes:**

- API service (port 4000)

- WebSocket server (port 4001)

- Redis instance (port 6379)

- Job worker (connected to Redis)

- Volume mounts for hot reload in development


---

## 🎮 WHAT THE UNITY DEVELOPER MUST BUILD

### 1. AVATAR 3D MODEL SETUP

**What:** Import and configure a 3D avatar model (FBX format)

**Where:** `Assets/Game/Models/[Link]`

**Steps:**

1. **Obtain 3D Model**

- Download from Sketchfab, CGTrader, or create in Blender

- Format: FBX (.fbx)

- Quality: 10K-50K triangles recommended

- Include: Base geometry, materials, rigging (humanoid skeleton)

- Reference guide: See [REALISTIC_FEMALE_AVATAR_GUIDE.md]


(REALISTIC_FEMALE_AVATAR_GUIDE.md) for detailed sources

2. **Import FBX into Unity**

```

1. Copy FBX to Assets/Game/Models/

2. Select FBX in Project view

3. In Inspector, configure:

- Model tab:

* Animation Type: Humanoid


* Avatar Definition: Create From Model

* Rig: Configure Avatar

- Materials tab:

* Location: Embedded Materials

* Naming: By Texture

- Click Apply

```

3. **Verify Humanoid Rig**

- In Avatar Inspector, check that all bones are mapped:

- Head, Spine, Chest, Neck

- LeftShoulder, LeftArm, LeftForeArm, LeftHand

- RightShoulder, RightArm, RightForeArm, RightHand

- LeftUpLeg, LeftLeg, LeftFoot, LeftToes

- RightUpLeg, RightLeg, RightFoot, RightToes

- Click "Configure Avatar" button and verify T-pose alignment

4. **Create Avatar Prefab**

- Create prefab: `Assets/Game/Prefabs/[Link]`

- Drag imported FBX model into scene

- Add components (see next section)

- Drag resulting GameObject to Prefabs folder to create prefab

- Delete from scene

**Expected Deliverable:**

- ✅ FBX imported with correct humanoid rig

- ✅ Avatar prefab created in `Assets/Game/Prefabs/[Link]`


- ✅ All bones visible and correctly positioned

---

### 2. SHADER IMPLEMENTATION

**What:** Implement physically-based shaders for realistic avatar rendering

**Where:** `Assets/Game/Shaders/`

**Four Shaders Required:**

#### A. Skin Shader (`[Link]`)

**Properties:**

```c

// Input colors

BaseColor (Albedo)

NormalMap

SpecularMap

// Skin specific

SubsurfaceColor (scattered light color)

SubsurfaceScale (strength of light penetration)

ThicknessMap (skin thickness for SSS simulation)

// UV settings
UVTiling = (1, 1)

UVOffset = (0, 0)

// Output

Smoothness = 0.35 (skin is slightly matte)

Metallic = 0.0 (non-metallic)

```

**Algorithm:**

1. Sample Base Color texture

2. Sample Normal Map and apply normal mapping

3. Implement Subsurface Scattering (SSS):

- Thickness sampled from grayscale map

- Back-lighting creates SSS effect

- Transmit light through thin areas (ears, fingers)

4. Sample Specular Map for highlights

5. Output final color to URP master node

**Target Result:** Realistic human skin with light penetration effect

**Reference:** URP Lit shader → add SSS pass

#### B. Eye Shader (`[Link]`)

**Properties:**

```c

// Iris
IrisColor

IrisScale = 0.6

IrisDepth = 0.5

// Cornea (transparent wet layer)

CornealRoughness = 0.1

CornealWetness = 1.0

SpecularIntensity = 1.2

// Sclera (white part)

ScleraColor = (0.95, 0.95, 0.95)

ScleraRoughness = 0.5

// Parallax offset (makes iris pop)

ParallaxStrength = 0.3

ParallaxHeightMap

// Output

Smoothness = 0.9 (glossy)

Metallic = 0.0

```

**Algorithm:**

1. Create UV that isolates iris region

2. Apply parallax offset to iris based on view direction

3. Layer iris on top of sclera

4. Add specular highlight (corneal reflection)


5. Modulate roughness for corneal wetness effect

**Target Result:** Glossy, dimensional eyes with depth perception

**Reference:** StandardAssets → EyeShader, or custom parallax


implementation

#### C. Hair Shader (`[Link]`)

**Properties:**

```c

// Base

HairColor

NormalMap

// Anisotropic highlights

HairDirection (tangent vector)

AnisotropicStrength = 0.8

SpecularColor = (1, 1, 1)

SpecularRotation = 0.0

// Strand detail

StrandTangentMap

ShiftAmount = 0.5

// Output

Smoothness = 0.4
Metallic = 0.0

```

**Algorithm:**

1. Sample hair base color

2. Create strand tangent vectors (hair direction)

3. Calculate anisotropic specular highlight:

- Use shifted normals for multiple specular lobes

- First lobe along hair direction

- Secondary lobe at offset angle

4. Blend together for realistic hair specularity

**Target Result:** Hair with visible strand direction and natural highlights

**Reference:** Hair anisotropic shaders (search "URP anisotropic hair")

#### D. Hologram Shader (`[Link]`)

**Properties:**

```c

// Base

BaseColor

UVTiling = (2, 2)

// Hologram effects

ScanlineFrequency = 50.0 (vertical lines per second)

ScanlineWidth = 0.3
ScanlineIntensity = 0.7

// Fresnel edge glow

FresnelPower = 2.0

FresnelColor = (0.0, 1.0, 1.0) (cyan)

FresnelIntensity = 1.5

// Dissolve/fade

DissolveAmount = 0.0 (0 = opaque, 1 = invisible)

NoiseTex (for dissolve pattern)

// Output

Smoothness = 0.8

Metallic = 0.1

Emission = FresnelColor + Scanlines

AlphaClip = true (for partial transparency)

```

**Algorithm:**

1. Sample base color

2. Add animated scanlines (move with time)

3. Add Fresnel edge glow (rim light effect)

4. Apply dissolve effect using noise texture

5. Output with emission for glowing appearance

**Target Result:** Glowing, semi-transparent hologram with scanline


animation
**Reference:** Custom shader or asset store hologram shaders

**Testing Checklist:**

- [ ] All 4 shaders compile without errors

- [ ] Skin shader shows subsurface scattering on ears/fingers

- [ ] Eye shader renders glossy with specular highlights

- [ ] Hair shader shows anisotropic highlights along strand direction

- [ ] Hologram shader glows and has visible scanlines

---

### 3. MATERIAL PROFILES

**What:** Create material presets for Normal and Hologram rendering


modes

**Where:**

- `Assets/Game/MaterialProfiles/Normal/` (realistic materials)

- `Assets/Game/MaterialProfiles/Hologram/` (glowing variants)

**Structure:**

```

MaterialProfiles/

├── Normal/

│ ├── [Link] (uses [Link])


│ ├── [Link] (uses [Link])

│ └── [Link] (uses [Link])

└── Hologram/

├── Skin_Hologram.mat (uses [Link])

├── Eyes_Hologram.mat (uses [Link])

└── Hair_Hologram.mat (uses [Link])

```

**Material Configuration - Normal Skin:**

```

Shader: [Link]

Textures:

Base Color Map: [Link]

Normal Map: [Link]

Specular Map: [Link]

Thickness Map: [Link]

Values:

Base Color: white (multiplied with texture)

Subsurface Color: (255, 200, 180) [warm peachy tone]

Subsurface Scale: 0.5

Tiling: (1, 1)

Offset: (0, 0)

```

**Material Configuration - Normal Eyes:**


```

Shader: [Link]

Textures:

Normal Map: [Link]

Values:

Iris Color: (101, 67, 33) [brown] or your choice

Iris Scale: 0.6

Iris Depth: 0.5

Sclera Color: (243, 243, 243)

Corneal Wetness: 1.0

Specular Intensity: 1.2

```

**Material Configuration - Normal Hair:**

```

Shader: [Link]

Textures:

Hair Color Map: [Link]

Normal Map: [Link]

Strand Tangent Map: [Link]

Values:

Hair Direction: (1, 0, 0) [direction along length]

Anisotropic Strength: 0.8


Specular Rotation: 0.0

Shift Amount: 0.5

```

**Material Configuration - Hologram Skin:**

```

Shader: [Link]

Textures:

Base Color: [Link] (will glow)

Noise Texture: [Link]

Values:

Base Color: (0, 255, 255) [cyan tint]

Scanline Frequency: 50.0

Scanline Intensity: 0.7

Fresnel Color: (0, 255, 255)

Fresnel Intensity: 1.5

Dissolve Amount: 0.0

```

**Material Configuration - Hologram Eyes & Hair:**

```

Same as Hologram Skin but adjusted:

- Eyes: Higher Fresnel Intensity (2.0)

- Hair: Lower Scanline Frequency (30.0)

```
**Scriptable Asset - [Link]:**

```csharp

[CreateAssetMenu(fileName = "AvatarProfile", menuName = "Avatar/Material


Profile")]

public class AvatarMaterialProfile : ScriptableObject

[[Link]]

public class MaterialSet

public Material skinMaterial;

public Material eyeMaterial;

public Material hairMaterial;

public string profileName; // "Normal" or "Hologram"

public MaterialSet materials;

public void ApplyToRenderer(SkinnedMeshRenderer renderer)

Material[] mats = [Link];

// Match materials to renderer slots (skin, eyes, hair)

// Apply from this profile

```
**Create Asset:**

1. Right-click in Assets folder → Create → Avatar → Material Profile

2. Name it "[Link]"

3. Drag Normal materials into Normal section

4. Duplicate and create Hologram version with Hologram materials

**Testing Checklist:**

- [ ] Normal profile has 3 materials assigned

- [ ] Hologram profile has 3 materials assigned

- [ ] Materials use correct shaders

- [ ] Avatar prefab looks realistic with Normal profile

- [ ] Avatar prefab glows with Hologram profile

---

### 4. ANIMATION SETUP

**What:** Configure avatar animations and facial expressions

**Where:** `Assets/Game/Animations/`

**Components Needed:**

#### A. Humanoid Idle Animation

**Create:**
```

1. In Blender/Maya: Create simple idle animation

- Slight breathing motion (chest up/down)

- Weight shift (side to side)

- Duration: 3-4 seconds, looping

2. Export as FBX with animation

3. Import to Unity: Assets/Game/Animations/[Link]

4. Verify animation plays on avatar

```

**Or Use Asset Store:**

- Search "Free Humanoid Animations"

- Download Idle animation set

- Extract and place in `Assets/Game/Animations/`

#### B. Animator Controller

**Create:**

```

1. Right-click in Assets → Create → Animator Controller

2. Name: "[Link]"

3. Create states:

- Idle (default state)

* Motion: Idle animation

- Wave (gesture)

* Motion: Wave animation

- Emotion_Happy
- Emotion_Sad

- Emotion_Angry

- etc.

4. Create parameters:

- triggerGesture (type: Trigger)

- emotion (type: String)

- intensity (type: Float)

5. Create transitions:

- Any → Emotion_X (when emotion parameter changes)

- Idle → Wave (when triggerGesture fires)

```

#### C. Blendshapes Configuration

**What are Blendshapes?** Facial expression morphs (smiling, frowning,


blinking, etc.)

**Setup:**

```

1. Verify imported FBX has blendshapes

- Select FBX → Inspector → Mesh tab

- See list under "Blend Shapes"

2. Common blendshapes needed:

- EyeBlink_Left / EyeBlink_Right

- EyeWideOpen_Left / EyeWideOpen_Right

- EyeLookDown / EyeLookUp / EyeLookLeft / EyeLookRight

- MouthSmile_Left / MouthSmile_Right
- MouthFrown_Left / MouthFrown_Right

- MouthOpen

- BrowRaise_Left / BrowRaise_Right

- BrowFurrow_Left / BrowFurrow_Right

- NoseSneer_Left / NoseSneer_Right

3. Test by manually moving slider in Inspector

```

**C# Script - [Link]:**

```csharp

public class AvatarFacialDriver : MonoBehaviour

private SkinnedMeshRenderer faceMesh;

private Dictionary<string, int> blendshapeMap;

void Awake()

faceMesh = GetComponent<SkinnedMeshRenderer>();

InitializeBlendshapeMap();

void InitializeBlendshapeMap()

blendshapeMap = new Dictionary<string, int>();

Mesh mesh = [Link];


for (int i = 0; i < [Link]; i++)

string name = [Link](i);

blendshapeMap[name] = i;

public void SetEmotion(string emotion, float intensity)

// Set blendshape weights based on emotion

// intensity: 0-100 (0 = neutral, 100 = maximum emotion)

ResetAll();

switch (emotion)

case "happy":

SetBlendshape("MouthSmile_Left", intensity * 0.5f);

SetBlendshape("MouthSmile_Right", intensity * 0.5f);

SetBlendshape("EyeWideOpen_Left", intensity * 0.3f);

SetBlendshape("EyeWideOpen_Right", intensity * 0.3f);

break;

case "sad":

SetBlendshape("MouthFrown_Left", intensity * 0.5f);

SetBlendshape("MouthFrown_Right", intensity * 0.5f);

SetBlendshape("BrowFurrow_Left", intensity * 0.4f);

SetBlendshape("BrowFurrow_Right", intensity * 0.4f);


break;

case "angry":

SetBlendshape("BrowFurrow_Left", intensity);

SetBlendshape("BrowFurrow_Right", intensity);

SetBlendshape("NoseSneer_Left", intensity * 0.3f);

SetBlendshape("NoseSneer_Right", intensity * 0.3f);

break;

// Add more emotions

private void SetBlendshape(string name, float weight)

if ([Link](name, out int index))

[Link](index, Mathf.Clamp01(weight) *
100f);

private void ResetAll()

for (int i = 0; i < [Link]; i++)

[Link](i, 0);

}
}

```

**Testing Checklist:**

- [ ] Idle animation plays on avatar

- [ ] Animator Controller transitions work

- [ ] Blendshapes respond to SetBlendShapeWeight calls

- [ ] AvatarFacialDriver script correctly maps emotions to blendshapes

- [ ] Facial expressions update smoothly

---

### 5. NETWORKING INTEGRATION

**What:** Connect Unity to the backend services (REST API + WebSocket)

**Where:** `Assets/Game/Scripts/Networking/`

**Components Needed:**

#### A. REST API Client

**Setup:**

```csharp

// Assets/Game/Scripts/Networking/[Link]
public class RestApiClient

private const string API_BASE = "[Link]

private string authToken;

public async Task<string> GetAuthToken(string userId)

// POST /auth/token

var request = new HttpRequestMessage([Link],


$"{API_BASE}/auth/token");

[Link] = new StringContent(

[Link](new { userId }),

Encoding.UTF8,

"application/json"

);

var client = new HttpClient();

var response = await [Link](request);

var json = await [Link]();

var data = [Link]<dynamic>(json);

authToken = [Link];

return authToken;

public async Task<UserInfo> GetCurrentUser()

{
// GET /users/me

var client = new HttpClient();

[Link] =

new [Link]("Bearer",
authToken);

var response = await [Link]($"{API_BASE}/users/me");

var json = await [Link]();

return [Link]<UserInfo>(json);

public async Task<SessionInfo> CreateSession(string deviceId)

// POST /sessions

var request = new HttpRequestMessage([Link],


$"{API_BASE}/sessions");

[Link] =

new [Link]("Bearer",
authToken);

[Link] = new StringContent(

[Link](new { deviceId }),

Encoding.UTF8,

"application/json"

);

var client = new HttpClient();

var response = await [Link](request);


var json = await [Link]();

return [Link]<SessionInfo>(json);

```

**Or use Generated SDK:**

```

The OpenAPI spec at apps/api/src/openapi/[Link]

can be auto-generated to TypeScript/C# with openapi-typescript-codegen

This is better than manual implementation!

```

#### B. WebSocket Connection Manager

**File:** `Assets/Game/Scripts/Networking/[Link]`

**Purpose:** WebSocket client that receives avatar state updates from


backend

```csharp

using WebSocketSharp;

using UnityEngine;

using [Link];

public class RealtimeAvatarBridge : MonoBehaviour


{

[SerializeField] private string wsUrl = "[Link]

[SerializeField] private AvatarFacialDriver facialDriver;

private WebSocket ws;

private string authToken;

public void Connect(string token)

authToken = token;

ws = new WebSocket(wsUrl);

[Link] += () =>

[Link]("WebSocket connected");

// Send auth message

var authMsg = new

type = "auth",

token = token

};

[Link]([Link](authMsg));

};

[Link] += (sender, e) =>


{

HandleWebSocketMessage([Link]);

};

[Link] += (sender, e) =>

[Link]($"WebSocket error: {[Link]}");

};

[Link] += (sender, e) =>

[Link]("WebSocket disconnected");

};

[Link]();

private void HandleWebSocketMessage(string json)

var msg = [Link]<dynamic>(json);

string type = [Link];

switch (type)

case "avatar-state":

UpdateAvatarState(msg);

break;
case "presence":

HandlePresence(msg);

break;

default:

[Link]($"Unknown message type: {type}");

break;

private void UpdateAvatarState(dynamic msg)

// Extract emotion data

string emotion = [Link];

float intensity = [Link];

// Update facial expressions

[Link](emotion, intensity);

// Extract gaze data

float gazeX = [Link].x;

float gazeY = [Link].y;

float gazeZ = [Link].z;

// Update eye gaze (implement eye look direction)

SetEyeGaze(new Vector3(gazeX, gazeY, gazeZ));

}
private void SetEyeGaze(Vector3 gazeDirection)

// Implement eye gaze based on direction vector

// Rotate eye bones or use blendshapes for look-up/down/left/right

private void HandlePresence(dynamic msg)

string status = [Link];

[Link]($"User presence: {status}");

public void SendAvatarState(string emotion, float intensity)

var msg = new

type = "avatar-state",

payload = new

emotion,

emotionIntensity = intensity,

gazeDirection = new { x = 0f, y = 0f, z = 1f },

timestamp = [Link]

};

[Link]([Link](msg));
}

void OnDestroy()

if (ws != null)

[Link]();

```

**Dependencies:**

- WebSocketSharp (NuGet package)

- [Link] (NuGet package)

**Installation:**

```

Install via NuGet Package Manager in Visual Studio

or use UPM (Unity Package Manager)

```

**Testing Checklist:**

- [ ] WebSocket connects without errors

- [ ] Token authentication succeeds

- [ ] Avatar state messages received from server

- [ ] Emotion slider updates trigger emotion messages


- [ ] Console shows "WebSocket connected" on play

---

### 6. MATERIAL SWITCHING

**What:** Toggle between Normal and Hologram rendering modes at


runtime

**Where:** `Assets/Game/Scripts/Avatar/[Link]`
(already provided)

**How it works:**

```csharp

public class AvatarMaterialController : MonoBehaviour

[SerializeField] private AvatarMaterialProfile normalProfile;

[SerializeField] private AvatarMaterialProfile hologramProfile;

[SerializeField] private SkinnedMeshRenderer avatarRenderer;

private AvatarMaterialProfile currentProfile;

void Start()

ApplyProfile(normalProfile);

}
public void ToggleHologram()

if (currentProfile == normalProfile)

ApplyProfile(hologramProfile);

else

ApplyProfile(normalProfile);

private void ApplyProfile(AvatarMaterialProfile profile)

currentProfile = profile;

[Link](avatarRenderer);

```

**Usage in UI:**

```csharp

// From [Link]

[Link]((isOn) =>

if (isOn)
[Link](hologramProfile);

else

[Link](normalProfile);

});

```

**Testing Checklist:**

- [ ] Avatar starts with Normal materials

- [ ] Toggling hologram switch swaps materials

- [ ] Hologram version glows and shows scanlines

- [ ] Materials switch smoothly without flicker

---

### 7. UI & DEMO SCENE

**What:** Create a simple demo scene with UI controls

**Where:** `Assets/Game/Scenes/[Link]`

**Scene Setup:**

```

DemoScene

├── Camera (Main)

│ └── FOV: 60

│ └── Position: (0, 1.5, 2)


│ └── Rotation: (0, 0, 0)

├── Lighting

│ ├── Directional Light (Key light)

│ │ └── Rotation: (45, 45, 0)

│ │ └── Intensity: 1.0

│ ├── Directional Light (Fill light)

│ │ └── Rotation: (225, 45, 0)

│ │ └── Intensity: 0.3

│ └── Directional Light (Back light)

│ └── Rotation: (180, 0, 180)

│ └── Intensity: 0.4

├── Avatar (instance of Avatar prefab)

│ └── Position: (0, 0, 0)

├── Ground Plane (optional visual reference)

│ └── Mesh: Plane

│ └── Scale: (4, 1, 4)

└── UI Canvas

├── Panel (dark background)

├── TokenInput (InputField)

│ └── Placeholder: "Enter JWT token"

├── ConnectButton (Button)

│ └── Text: "Connect"

├── StatusText (Text)

│ └── Text: "Disconnected"

├── HologramToggle (Toggle)

│ └── Label: "Hologram Mode"

├── TierBToggle (Toggle)


│ └── Label: "Performance Tier"

├── EmotionSlider (Slider)

│ └── Min: 0, Max: 100

│ └── Label: "Emotion Intensity"

└── EmotionDropdown (Dropdown)

└── Options: Happy, Sad, Angry, Neutral

```

**Lighting Configuration:**

```

3-Point Lighting Setup:

1. Key Light (bright, main)

- Intensity: 1.0

- Angle: 45° from avatar

- Color: White (255, 255, 255)

2. Fill Light (soften shadows)

- Intensity: 0.3-0.5

- Angle: Opposite side

- Color: Slightly warm

3. Back Light (rim/separation)

- Intensity: 0.2-0.4

- Angle: Behind avatar

- Color: Slightly cool or white

```
**UI Script - [Link]:**

```csharp

public class AvatarDemoController : MonoBehaviour

[SerializeField] private InputField tokenInput;

[SerializeField] private Button connectButton;

[SerializeField] private Text statusText;

[SerializeField] private Toggle hologramToggle;

[SerializeField] private Toggle tierBToggle;

[SerializeField] private Slider emotionSlider;

[SerializeField] private Dropdown emotionDropdown;

[SerializeField] private RealtimeAvatarBridge realtimebridge;

[SerializeField] private AvatarMaterialController materialController;

void Start()

[Link](OnConnectClicked);

[Link](OnHologramToggled);

[Link](OnTierToggled);

[Link](OnEmotionChanged);

[Link](OnEmotionTypeChanged);

UpdateStatus("Ready. Enter token and click Connect.");


}

private void OnConnectClicked()

string token = [Link];

if ([Link](token))

UpdateStatus("Error: Token required");

return;

[Link](token);

UpdateStatus("Connecting...");

private void OnHologramToggled(bool isOn)

// Switch material profile

private void OnTierToggled(bool isOn)

// Switch material quality tier

private void OnEmotionChanged(float value)

{
// Send emotion intensity to backend

string emotion = [Link];

[Link](emotion, value);

private void OnEmotionTypeChanged(int index)

// Update emotion type (happy, sad, etc)

string emotion = [Link][index].text;

[Link](emotion, [Link]);

private void UpdateStatus(string message)

[Link] = message;

```

**Testing Checklist:**

- [ ] Scene loads without errors

- [ ] Avatar renders in center of screen

- [ ] Lighting reveals 3D form clearly

- [ ] UI elements are visible and interactable

- [ ] Token input accepts text

- [ ] Connect button is clickable


---

## 📋 DETAILED DELIVERABLE CHECKLIST

### Phase 1: Avatar Model & Rigging (Week 1)

- [ ] 3D avatar model obtained (FBX format)

- [ ] Model imported into Unity

- [ ] Humanoid rig configured and verified

- [ ] All bones present and correctly positioned

- [ ] Avatar prefab created in `Assets/Game/Prefabs/[Link]`

### Phase 2: Shaders & Materials (Week 1-2)

- [ ] Skin shader implemented (SSS support)

- [ ] Eye shader implemented (parallax + glossy)

- [ ] Hair shader implemented (anisotropic highlights)

- [ ] Hologram shader implemented (scanlines + glow)

- [ ] Normal material profile created (3 materials)

- [ ] Hologram material profile created (3 materials)

- [ ] Materials applied to avatar and look realistic

### Phase 3: Animation Setup (Week 2)

- [ ] Idle animation created/imported

- [ ] Animator Controller configured with states

- [ ] Blendshapes verified in avatar model

- [ ] AvatarFacialDriver script implemented

- [ ] Facial expressions respond to emotion values

- [ ] Multiple emotions supported (happy, sad, angry, etc.)


### Phase 4: Networking Integration (Week 2-3)

- [ ] REST API client implemented or SDK generated

- [ ] Authentication flow working (get token)

- [ ] RealtimeAvatarBridge script implemented

- [ ] WebSocket connection establishes on play

- [ ] Token validation successful

- [ ] Avatar state messages received from server

- [ ] Emotion messages sent from UI to server

### Phase 5: UI & Demo Scene (Week 3)

- [ ] DemoScene created with proper hierarchy

- [ ] Lighting configured (3-point setup)

- [ ] Camera positioned for avatar viewing

- [ ] UI Canvas with all controls

- [ ] AvatarDemoController script attached and wired

- [ ] All UI interactions functional

- [ ] Status text updates correctly

### Phase 6: Integration Testing (Week 3-4)

- [ ] Backend services running (API, WebSocket, Worker)

- [ ] Unity connects to backend successfully

- [ ] Token authentication works

- [ ] Emotion slider triggers avatar expressions

- [ ] Hologram toggle switches materials smoothly

- [ ] All emotions render correctly

- [ ] No console errors
- [ ] Performance acceptable (60+ FPS on target platform)

### Phase 7: Documentation & Handoff (Week 4)

- [ ] All scripts documented with XML comments

- [ ] Scene setup documented

- [ ] Material settings documented

- [ ] Known issues logged

- [ ] Performance optimization notes provided

- [ ] Instructions for deploying to WebGL/Mobile provided

---

## 🔧 TECHNICAL REQUIREMENTS

### Development Environment

- **Unity Version:** 2021 LTS or 2022 LTS

- **Render Pipeline:** URP (Universal Render Pipeline)

- **Scripting:** C# 8.0+

- **.NET:** .NET 4.x

- **Platform Target:** Initially Windows/Mac, later WebGL/Mobile

### Dependencies (to install via NuGet/Package Manager)

- **[Link]** (JSON serialization)

- **WebSocketSharp** (WebSocket client)

- **UniTask** (async/await in Unity) - optional but recommended

- **DOTween** (animation tweening) - optional for polish


### Supported Devices

- **Primary:** Windows PC, Mac

- **Secondary:** WebGL (browser)

- **Tertiary:** Android/iOS (mobile)

### Performance Targets

- **Desktop (Windows/Mac):** 60+ FPS at 1080p

- **WebGL:** 30+ FPS at 1080p

- **Mobile:** 30 FPS with Tier B materials

- **Avatar Triangle Budget:** 50K triangles max

- **Texture Budget:** 50MB max

### API Endpoints (Already Built)

- Base URL: `[Link] (dev) or production URL

- WebSocket: `[Link] (dev) or production URL

- Authentication: JWT Bearer token in `Authorization` header

- Rate Limit: 100 req/min per user

---

## 📚 REFERENCE DOCUMENTATION

### What's Available to the Developer

1. **[START_HERE_INDEX.md](START_HERE_INDEX.md)** - Navigation
guide

2. **[QUICK_START.md](QUICK_START.md)** - 30-minute setup checklist

3. **[UNITY_SETUP.md](UNITY_SETUP.md)** - Detailed step-by-step guide


4. **[REALISTIC_FEMALE_AVATAR_GUIDE.md]
(REALISTIC_FEMALE_AVATAR_GUIDE.md)** - Ultra-detailed avatar creation

5. **[FEMALE_AVATAR_SETTINGS_REFERENCE.md]
(FEMALE_AVATAR_SETTINGS_REFERENCE.md)** - Copy-paste material values

6. **[VSCODE_UNITY_COPILOT_GUIDE.md]
(VSCODE_UNITY_COPILOT_GUIDE.md)** - Development workflow

7. **[TROUBLESHOOTING_AUTOMATION.md]
(TROUBLESHOOTING_AUTOMATION.md)** - Problem solving

8. **[MINIMIZE_UNITY_WORK.md](MINIMIZE_UNITY_WORK.md)** -
Automation strategies

### Backend API Reference

- **OpenAPI Spec:** `apps/api/src/openapi/[Link]`

- **Protocol Schemas:** `packages/protocol/src/schemas/`

- **SDK Examples:** `packages/sdk/examples/`

### Code Examples

- **REST API Usage:** `packages/sdk/examples/[Link]`

- **WebSocket Client:** `packages/sdk/examples/[Link]`

- **Job Queue:** `apps/agent-runtime/src/[Link]`

---

## EXPECTED TIMELINE

### Week 1-2: Foundation

- Avatar model import and rig setup

- Shader implementation
- Material profile creation

- **Deliverable:** Avatar renders with realistic materials

### Week 2-3: Animation & Interaction

- Animation setup and blendshapes

- Networking integration (REST + WebSocket)

- Demo scene creation

- **Deliverable:** Avatar responds to emotion commands

### Week 3-4: Polish & Testing

- Performance optimization

- UI refinement

- Integration testing

- **Deliverable:** Production-ready demo scene

### Total: 4 weeks (one developer)

---

## 🚀 HOW TO START

### Step 1: Setup Backend (30 minutes)

```bash

# Terminal in workspace root

docker run -d -p 6379:6379 --name redis redis:7

cd apps/api
npm install

npm run dev

# Should see: "API listening on port 4000"

# In new terminal

cd apps/realtime

npm install

npm run dev

# Should see: "WebSocket listening on port 4001"

```

### Step 2: Prepare Unity Project (15 minutes)

```

1. Open Unity Editor

2. Open project: unity/SitaHologram/

3. Wait for import/compile

4. Create folder: Assets/Game/Models/

5. Create folder: Assets/Game/Scripts/

6. Create folder: Assets/Game/Shaders/

7. Create folder: Assets/Game/MaterialProfiles/

```

### Step 3: Start Implementation

Follow the phase breakdown above, starting with Phase 1.

# 👶 ULTRA-REALISTIC FEMALE AVATAR CREATION

## Explained Like You're 5 Years Old


---

## 🎯 WHAT WE'RE MAKING

We're making a **beautiful 3D woman** that moves and talks in your


game.

Think of it like **building a doll**:

- **Body**: The skeleton (bones)

- **Skin**: What it looks like

- **Clothes**: What she wears

- **Hair**: What's on her head

- **Face**: Eyes, nose, mouth that move

---

## 📋 BEFORE YOU START

You need **3 things**:

### 1. A 3D Model File (FBX)

```

What it is: A file that has the doll's shape

Where to get it:

- [Link] (free 3D models)

- [Link] (paid, better quality)

- Unity Asset Store (some free)


What to look for:

✅ "Humanoid rig" (the doll has bones)

✅ "PBR materials" (realistic looking)

✅ ".fbx format"

✅ HD or 4K textures (for beautiful skin)

```

### 2. Texture Files (Like Clothes)

```

These are pictures that wrap around the 3D shape

You need:

- Skin texture (photos of human skin)

└─ Normal map (makes bumps)

└─ Roughness map (shiny or matte)

- Hair texture (strands and color)

- Eye texture (real-looking eyes)

- Clothing textures (fabric)

Usually come WITH the FBX, but if not:

→ [Link] (free textures)

→ [Link] (free)

```

### 3. Software (You Have This!)

```
✅ Unity (you have it)

✅ VSCode (you have it)

✅ Blender (free, if you need to edit)

```

---

## 🚀 STEP-BY-STEP GUIDE

### PHASE 1: DOWNLOAD & IMPORT (15 minutes)

#### Step 1: Get a Realistic Female Model

```

Go to: [Link]

Search: "realistic female character humanoid"

Look for:

- HD/4K detailed face

- Body proportions that look real

- Rigged (has bones inside)

Click: [Download]

Wait for .fbx file to download

```

**EXAMPLE MODELS TO DOWNLOAD:**

```

1. "Kate" by Keiiwolf (free, very realistic)


2. "Victoria Female Character" by Dan_Moran

3. "Realistic Woman" by SketchFab Pro

```

#### Step 2: Prepare FBX File

```

Create folder:

Assets/

└─ Game/

└─ Avatars/

└─ MyWoman/

Drag the FBX file into this folder

→ Unity imports it automatically

```

**What you'll see:**

```

[Link] (the model)

└─ Materials folder (auto-created)

└─ Textures folder (auto-created)

```

#### Step 3: Check if Rigged Correctly

```

In Project > Right-click FBX > Open With > FBX Importer
Click: "Rig" tab

Set: Animation Type = "Humanoid"

Check: "Copy Avatar" ✓

Then: Apply

Why? So Unity understands the doll has a skeleton.

```

---

### PHASE 2: UNITY SETUP (20 minutes)

#### Step 4: Import Into Scene

```

File > New Scene

Save as: MyWoman_Demo.unity

Drag [Link] into scene

→ You should see the woman!

If she's facing wrong direction:

Select in Hierarchy

Inspector > Transform > Rotation Y = 180

```
#### Step 5: Add Animation Controller

```

Right-click in Assets/Game/Animation:

Create > Animator Controller > WomanAnimator

Select WomanAnimator

Inspector:

- Add a new layer

- Set default state to "Idle"

Select Woman in Hierarchy:

Animator component > Controller = WomanAnimator

Avatar = MyWoman Avatar

```

#### Step 6: Fix the Body Size

```

Woman usually imports too big or too small

Select Woman

Inspector > Transform > Scale

Change to:

X: 1

Y: 1

Z: 1

If still wrong size:


X: 0.01 (if too big)

or

X: 100 (if too small)

Test: Should be ~1.8 units tall (person height)

```

---

### PHASE 3: MATERIALS & SKIN (25 minutes)

#### Step 7: Apply Realistic Skin Shader

```

Click: Woman > Skinned Mesh Renderer

Materials: Select skin material

Inspector > Material:

Shader = Universal Render Pipeline > Lit

Now you need to set properties:

```

#### Step 8: Import and Apply Textures

```

Find these texture files from your download:

- Diffuse or Albedo (base color)

- Normal Map (makes skin bumpy)


- Roughness Map (shiny/matte)

- AO Map (darkness in crevices)

FOR EACH TEXTURE:

1. Drag into Assets/Game/Avatars/MyWoman/Textures/

2. Click the texture

3. Inspector > Texture Type = "Default" ✓

4. Inspector > sRGB = ON ✓

5. Apply

Then assign to material:

Material Inspector:

Base Map = [Drag skin albedo here]

Normal Map = [Drag normal map here]

```

#### Step 9: Make Skin Realistic

```

Select skin material

Inspector settings:

Base Color: White (if using texture)

Metallic: 0 (skin isn't shiny metal)

Smoothness: 0.3 (skin has pores)

Then adjust based on appearance:

- Looks too shiny? Lower Smoothness to 0.1


- Looks too matte? Raise Smoothness to 0.5

- Looks too red? Adjust Base Color tint

```

#### Step 10: Setup Eye Material

```

Eyes are SEPARATE material usually

Find eye material in Woman

Set Shader: Universal Render Pipeline > Lit

Assign eye texture (white + iris + pupil)

Metallic: 0.2 (eyes are slightly wet/shiny)

Smoothness: 0.8 (glossy surface)

That's it! Eyes will look wet and alive.

```

#### Step 11: Setup Hair

```

Find hair material

Shader: Universal Render Pipeline > Lit (or Hair if available)

Drag hair texture to Base Map

Metallic: 0

Smoothness: 0.3 (hair is matte)


If hair looks flat:

Add Hair Physics > Inspector:

Random Damping: 0.2

→ Hair will move when character moves!

```

---

### PHASE 4: CLOTHING & ACCESSORIES (15 minutes)

#### Step 12: Apply Clothing Materials

```

For each piece (dress, shoes, etc):

1. Find material in Inspector

2. Assign texture

3. Set correct shader

4. Adjust settings:

- Fabric: Smoothness 0.2

- Leather: Smoothness 0.5

- Metal: Smoothness 0.8

```

#### Step 13: Add Physics to Cloth

```

Select cloth object (like dress)


Inspector > Add Component > Cloth

Then configure:

Use Gravity: ✓

Drag: 0.1 (hangs down)

Damping: 0.5 (bounces less)

→ Dress will sway when she walks!

```

---

### PHASE 5: FACE & EXPRESSIONS (20 minutes)

#### Step 14: Enable Blendshapes

```

Select head mesh

Skinned Mesh Renderer > Blend Shapes

You'll see expressions like:

- Smile

- Blink

- Surprise

- Angry

These are "morph targets" - ways to change face

```
#### Step 15: Test Face Animations

```

Create test script in Assets/Game/Scripts:

```csharp

using UnityEngine;

public class FaceTest : MonoBehaviour

public SkinnedMeshRenderer head;

void Update()

// Make her smile when you press S

if ([Link](KeyCode.S))

[Link](0, 100); // Smile

else

[Link](0, 0);

// Blink with B

if ([Link](KeyCode.B))

{
[Link](1, 100); // Blink

else

[Link](1, 0);

```

Add to Woman

Drag head mesh to the field

Press Play > Press S to smile, B to blink!

```

---

### PHASE 6: ANIMATION (20 minutes)

#### Step 16: Add Idle Animation

```

Right-click Assets/Game/Animation:

Create > Animation > WomanIdle

Open it (double-click)

Your woman should appear in animation view


Drag her to ~0.5 seconds in timeline

Move her slightly for breathing effect

Save (Ctrl+S)

```

#### Step 17: Create Animation Controller Logic

```

In Animator window:

1. Right-click > Add State > Motion

2. Motion = WomanIdle animation

3. Set as Default State (right-click > Set as Layer Default)

Now drag Woman to scene and play!

→ She'll play idle animation

Add more states:

- Walk

- Run

- Talk

- Stand

```

#### Step 18: Connect Animations to Events

```

Script for Woman (AvatarController):

```csharp
public class AvatarController : MonoBehaviour

private Animator animator;

void Start()

animator = GetComponent<Animator>();

void Update()

// Play walk when W pressed

if ([Link](KeyCode.W))

[Link]("isWalking", true);

else

[Link]("isWalking", false);

```

In Animator:

- Create transitions from Idle → Walk

- Add condition: isWalking = true


```

---

### PHASE 7: SETUP IN YOUR GAME (15 minutes)

#### Step 19: Convert to Prefab

```

Select Woman in Hierarchy

Drag to Assets/Game/Prefabs/

→ Becomes prefab (reusable blueprint)

Now you can spawn her from code:

```csharp

var woman = Instantiate(

[Link]<GameObject>("Prefabs/Woman"),

new Vector3(0, 0, 0),

[Link]

);

```

```

#### Step 20: Create Scene Setup

```

In your scene:

1. Create empty GameObject > "AvatarManager"

2. Add script [Link]:


```csharp

public class AvatarManager : MonoBehaviour

void Start()

// Spawn woman

var woman = Instantiate(

[Link]<GameObject>("Prefabs/Woman"),

transform

);

// Setup camera to look at her

[Link] = new Vector3(0, 1.7f, 1);

[Link]([Link]);

// Add lighting

var light = new GameObject("Directional


Light").AddComponent<Light>();

[Link] = [Link];

[Link] = 1.5f;

[Link] = [Link](50, 50, 0);

```

```
---

## 🎨 ADVANCED: MAKING HER LOOK ULTRA-REALISTIC

### Skin Quality Tips

```

Real skin has:

✓ Pores and wrinkles (Normal Map)

✓ Some red in cheeks (Albedo color)

✓ Subsurface scattering (light goes through skin)

✓ Not shiny (Smoothness 0.2-0.4)

Script to apply skin shader:

```csharp

public class SkinShader : MonoBehaviour

public Material skinMat;

void Start()

// Realistic skin settings

[Link]("_Metallic", 0);

[Link]("_Smoothness", 0.35f);

[Link]("_BaseColor", new Color(0.95f, 0.85f, 0.8f)); // Warm


tone

}
```

```

### Hair Quality Tips

```

Realistic hair needs:

✓ Multiple strands (texture with strand detail)

✓ Wisps that catch light (use glossy shader)

✓ Physics to move naturally

✓ Shadows between strands (darker normal map)

Hair shader setup:

```csharp

public class HairShader : MonoBehaviour

public Material hairMat;

void Start()

[Link]("_Smoothness", 0.3f);

[Link]("_NormalScale", 1.2f); // Emphasize details

```

```

### Eyes - The Most Important


```

Real eyes need:

✓ Specular highlight (glossy surface)

✓ Pupil depth (iris pushes forward)

✓ Eye white slight yellow (not pure white)

✓ Light reflections

Eye script:

```csharp

public class EyeShader : MonoBehaviour

public Material eyeMat;

void Start()

[Link]("_Smoothness", 0.85f); // Very shiny

[Link]("_BaseColor", [Link]);

// Add reflection probes for catchlights

var probe = [Link]<ReflectionProbe>();

[Link] = [Link];

```

```

---
## 🐛 COMMON PROBLEMS & FIXES

### Problem 1: Woman Looks Plastic/Fake

```

Cause: Smoothness too high, normal map not applied

Fix:

1. Check material has Normal Map assigned

2. Lower Smoothness to 0.3

3. Add slight color variation to Base Color

```

### Problem 2: Skin Looks Too Dark

```

Cause: Textures are in linear color space (needs gamma correction)

Fix:

1. Select texture

2. Inspector > sRGB (Color Texture) = ON

3. Apply

```

### Problem 3: Hair Looks Flat

```

Cause: Normal map missing or wrong shader

Fix:

1. Assign normal map to hair material

2. Increase Normal Scale to 1.5


3. Try "Lit Detail" shader instead of basic Lit

```

### Problem 4: Mesh Deforms Weirdly

```

Cause: Rigging issue (bones not weighted correctly)

Fix:

1. Open in Blender

2. Weight Paint > Fix skin weights

3. Re-export FBX

4. Reimport into Unity

```

### Problem 5: She's Way Too Big/Small

```

Cause: FBX was created in different scale

Fix:

Select Woman

Inspector > Transform > Scale

Set to 0.01 or 100 depending on import size

```

### Problem 6: Animation Looks Jittery

```

Cause: Animation FPS mismatch

Fix:

FBX Inspector > Animations


Baked Animation

Check "Enable: Baked Animation"

Apply

```

---

## ⚡ USING AUTOMATION (EASIER!)

You don't have to do all this manually. Use this:

```csharp

// Go to Window > Avatar Automation Manager

// 1. Drag FBX file here

// 2. Click [CREATE EVERYTHING]

// 3. Done! Everything auto-configured

```

This does steps 4-17 in **10 seconds**.

---

## 📱 MAKING REALISTIC WOMAN PERFORM WELL

### For Desktop (High Quality)

```

Settings in AvatarMaterialController:
→ materialsProfile = Tier_A_HighQuality

→ enableHighResTextures = true

→ maxPolyCount = 50000

Result: Ultra-realistic, 60 FPS

```

### For Mobile (Fast)

```

Settings:

→ materialsProfile = Tier_B_Balanced

→ autoDownscaleTextures = true

→ maxPolyCount = 20000

Result: Still beautiful, 30+ FPS

```

### For VR (Real-time)

```

Settings:

→ materialsProfile = Tier_C_Performance

→ enableSSAO = false

→ useSimpleSkinShader = true

Result: Smooth 90 FPS in headset

```
---

## 🎬 NEXT: CONNECT TO YOUR GAME

Once woman looks perfect:

```csharp

// Use RealtimeAvatarBridge to control her from backend

public class MyGame : MonoBehaviour

void Start()

// Connect to server

var bridge = [Link]<RealtimeAvatarBridge>();

[Link] = "[Link]

[Link] = "MyWoman";

// Now server can control her!

// Server sends: {"emotion": "happy", "gesture": "wave"}

// She automatically does it!

```

---

## ✅ CHECKLIST: IS YOUR WOMAN REALISTIC?


- [ ] Skin has pores and color variation

- [ ] Eyes are glossy and wet-looking

- [ ] Hair has strand detail and moves

- [ ] Clothes look like fabric, not plastic

- [ ] Face can make expressions (smile, blink)

- [ ] Body moves smoothly

- [ ] No weird skin deformations

- [ ] Materials look lifelike in shadows

- [ ] Performance is smooth (60+ FPS)

---

## 🎓 YOU NOW KNOW

✅ How to download realistic female models

✅ How to import into Unity with correct rigging

✅ How to make skin, hair, eyes, clothing look real

✅ How to add expressions and animation

✅ How to optimize for different platforms

✅ How to automate everything with one click!

**You're a 3D avatar expert now!** 🎉

---

## 🆘 STILL STUCK?
```

Problem? Check:

1. UNITY_SETUP.md - Basic setup

2. Assets/Game/Scripts/Editor/[Link] - One-click setup

3. [Link] - How materials work

4. [Link] - How to control avatar

5. Discord / Forum with model name you're using

```

---

## 🚀 FINAL POWER-UP: AUTO-EVERYTHING

Don't do this manually. Use automation:

```

Window > Avatar Automation Manager

```

Then just:

1. Import FBX

2. Drag here

3. Click "CREATE EVERYTHING"

Your realistic woman is **ready in 30 seconds**.


Human developers can focus on game logic, not 3D setup! 🎯

## ✅ FINAL DELIVERABLES

### Code Assets

- ✅ [Link] with all components

- ✅ 4 shadergraph files (Skin, Eye, Hair, Hologram)

- ✅ 6 material files (Normal × 3, Hologram × 3)

- ✅ [Link]

- ✅ [Link]

- ✅ [Link]

- ✅ [Link] or SDK integration

- ✅ [Link]

- ✅ [Link]

### Scene Assets

- ✅ [Link] (fully configured)

- ✅ Animator Controller

- ✅ UI Canvas with all controls

### Documentation

- ✅ Setup instructions

- ✅ Material configuration notes

- ✅ Performance optimization tips

- ✅ Troubleshooting guide

- ✅ API integration guide


### Tested & Verified

- ✅ Avatar renders correctly

- ✅ Materials apply without errors

- ✅ Animations play smoothly

- ✅ WebSocket connects to backend

- ✅ Emotion slider updates avatar

- ✅ Hologram toggle switches materials

- ✅ No console errors

- ✅ 60+ FPS on target hardware

---

## 📞 SUPPORT & ESCALATION

### If Developer Gets Stuck

1. **Check:** [TROUBLESHOOTING_AUTOMATION.md]
(TROUBLESHOOTING_AUTOMATION.md)

3. **Example:** Check `packages/sdk/examples/` for API usage

4. **Backend:** Verify backend is running: `curl


[Link]

### Common Issues & Solutions

| Issue | Solution |

|-------|----------|

| Avatar bones don't align | Reimport FBX with correct humanoid settings |
| Materials look wrong | Check texture paths and UV coordinates |

| WebSocket won't connect | Verify backend running on correct port |

| Expressions don't work | Verify blendshapes exist on model |

| Performance is poor | Switch to Tier B materials, reduce lights |

| Shader compilation error | Ensure URP is installed and selected |

---

## 🎯 SUCCESS CRITERIA

The Unity developer has successfully completed the task when:

1. ✅ Avatar model displays in demo scene

2. ✅ Materials render realistically (or as hologram)

3. ✅ Facial expressions respond to emotion slider

4. ✅ Material mode toggles between Normal and Hologram

5. ✅ WebSocket connection established and maintained

6. ✅ Real-time messages received from backend

7. ✅ All UI controls functional

8. ✅ 60+ FPS performance achieved

9. ✅ No console errors

10. ✅ Scene ready for deployment

Once all criteria are met, the integration is **COMPLETE** and ready for
further development, testing, or deployment.

---
## 🎉 CONCLUSION

You have everything needed to build a production-quality avatar visualization


system in Unity. The backend is complete and tested. The architecture is
scalable and secure. All that remains is implementing the visual presentation
layer—and this document provides a detailed roadmap for exactly how to do
that.

You might also like