summaryrefslogtreecommitdiff
path: root/doc/resources.md
blob: 3add075b7642b4f9c1b303bb81cc30433d98557b (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
73
# Resource formats

## Dictionary format

```
[kkkk vvvv KK... VV...]...
 ^    ^    ^     ^
 |    |    |     | value
 |    |    | key
 |    | 16-bit kalue length
 | 16-bit key length
```

## PrefabIndex

| Key      | Value Type |
| -------- | ---------- |
| \<Name\> | Resource   |

## Prefab

| Key         | Value Type              |           |
| ----------- | ----------------------- | --------- |
| mesh        | Matrix3, Vec3, Resource | Multi key |
| light       | Vec3, Resource          | Multi key |
| environment | Resource                |           |

## MeshPart

Combinations of g__, va__ and tex_* are multiplied except normal which is added.
Defaults should be the identity for that operation, so default is 1 / white
except normals are zero.

| Key              | Value Type    |                    |
| ---------------- | ------------- | ------------------ |
| index            | Resource      |                    |
| g_metallic       | f32           |                    |
| g_roughness      | f32           |                    |
| g_albedo         | Vec3          |                    |
| g_transmission   | f32           |                    |
| g_emission       | Vec3          |                    |
| va_position      | [Resource; 3] |                    |
| va_normal        | [Resource; 3] |                    |
| va_texcoord      | [Resource; 2] |                    |
| va_roughness     | Resource      |                    |
| va_metallic      | Resource      |                    |
| va_albedo        | [Resource; 3] |                    |
| va_transmission  | Resource      |                    |
| va_emission      | Resource      |                    |
| tex_normal       | Resource      | Use color channels |
| tex_roughness    | Resource      | Use green channel  |
| tex_metallic     | Resource      | Use blue channel   |
| tex_albedo       | Resource      | Use color channels |
| tex_transmission | Resource      | Use alpha channel  |
| tex_emission     | Resource      | Use color channels |

## LightPart

| Key      | Value Type |
| -------- | ---------- |
| radius   | f32        |
| emission | Vec3       |

## EnvironmentPart

| Key    | Value Type |                  |
| ------ | ---------- | ---------------- |
| skybox | Resource   |                  |
| sun    | Vec3, Vec3 | Direction, Color |

## Texture

WebP