blob: 90eba6c4fef01473ec31ebc0f549657daeb17b1c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
## Protocol packets
Vec is stored as `len:u8 *(data:T)`
```rs
type Obj = [u8; 16]
type Res = [u8; 32]
len 00 connect(identity: u128)
len ff disconnect()
len 01 request_resource(name: Res)
len 02 respond_resource(data: Vec<u8>)
len 03 add(id: Obj, prefab: Res)
len 04 remove(id: Obj)
len 05 position(id: Obj, pos: Vec3, rot: Vec3)
len 06 pose(id: Obj, params: Vec<f32>)
len 07 parent(parent: Obj, child: Obj)
len 08 sound(id: Obj, data: Vec<u8>)
```
## Resource formats
### Prefab
```
Prefab = *(pos:f32x3 mat:f32_3x3 part:Res<Part>)
```
### Part
```
Part = *(len_key:u16 len_value:u16 *(key:u8) *(value:u8))
Attribute = 0x01 constant:f32 / 0x02 buffer:Res / 0x03 texture:Res<Texture>
NewAttribute = flag:u8 constant:f32 buffer:Res texture:Res<Texture>
```
| Key | Value Type |
| -------------------- | ------------- |
| index | Resource |
| g_metallic | f32 |
| g_roughness | f32 |
| g_albedo | Vec3A |
| g_transmission | f32 |
| va_position | [Resource; 3] |
| va_normal | [Resource; 3] |
| va_texcoord | [Resource; 2] |
| va_pbr_roughness | Resource |
| va_pbr_metallic | Resource |
| va_pbr_albedo | [Resource; 3] |
| va_pbr_transmission | Resource |
| tex_normal | Resource |
| tex_pbr_roughness | Resource |
| tex_pbr_metallic | Resource |
| tex_pbr_albedo | Resource |
| tex_pbr_transmission | Resource |
### Texture
WebP
### Shader
glsl source, todo
## Player tree
- LowerTorso (2x leg tilt)
- FootL
- FootR
- UpperTorso (2x arm tilt)
- HandL (5x finger, 5x tilt)
- HandR (5x finger, 5x tilt)
- Head (2x brow, 2x eyelid, 2x eye, 3x mouth)
|