summaryrefslogtreecommitdiff
path: root/doc/resources.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/resources.md')
-rw-r--r--doc/resources.md106
1 files changed, 56 insertions, 50 deletions
diff --git a/doc/resources.md b/doc/resources.md
index 9a38215..1c1b43f 100644
--- a/doc/resources.md
+++ b/doc/resources.md
@@ -1,5 +1,11 @@
# Resource formats
+## Common types
+
+- `Matrix3`: 3x3 matrix of `Float` in columns
+- `Vec3`: 3 component `Float` vector
+- `Affine3`: `Matrix3` and `Vec3` translation
+
## Dictionary format
```
@@ -19,12 +25,12 @@
## Prefab
-| Key | Value Type | |
-| ------------- | -------------------------------------- | --------- |
-| `mesh` | `Matrix3`, `Vec3`, `Res<MeshPart>` | Multi key |
-| `collision` | `Matrix3`, `Vec3`, `Res<ColliderPart>` | Multi key |
-| `light` | `Vec3`, `Res<LightPart>` | Multi key |
-| `environment` | `Res<EnvironmentPart>` | |
+| Key | Value Type | |
+| ------------- | ------------------------------ | --------- |
+| `mesh` | `Affine3`, `Res<MeshPart>` | Multi key |
+| `collision` | `Affine3`, `Res<ColliderPart>` | Multi key |
+| `light` | `Vec3`, `Res<LightPart>` | Multi key |
+| `environment` | `Res<EnvironmentPart>` | |
## MeshPart
@@ -33,45 +39,45 @@ array. ombinations 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 | |
-| -------------------- | ----------------- | ------------------ |
-| `name` | `String` | |
-| `index` | `Res<[u32; 3]>` | |
-| `armature` | `Res<Armature>` | |
-| `g_metallic` | `Float` | |
-| `g_roughness` | `Float` | |
-| `g_albedo` | `Vec3` | |
-| `g_alpha` | `Float` | |
-| `g_transmission` | `Float` | |
-| `g_emission` | `Vec3` | |
-| `g_refractive_index` | `Float` | |
-| `g_attenuation` | `Vec3` | |
-| `g_dispersion` | `Float` | |
-| `g_thickness` | `Float` | |
-| `g_unlit` | | |
-| `g_double_sided` | | |
-| `va_position` | `Res<[Vec3]>` | |
-| `va_normal` | `Res<[Vec3]>` | |
-| `va_tangent` | `Res<[Vec3]>` | |
-| `va_texcoord` | `Res<[Vec2]>` | |
-| `va_roughness` | `Res<[Float]>` | |
-| `va_metallic` | `Res<[Float]>` | |
-| `va_albedo` | `Res<[Vec3]>` | |
-| `va_alpha` | `Res<[Float]>` | |
-| `va_transmission` | `Res<[Float]>` | |
-| `va_emission` | `Res<[Vec3]>` | |
-| `va_joint_weight` | `Res<[[f32; 4]]>` | |
-| `va_joint_index` | `Res<[[u16; 4]]>` | |
-| `tex_normal` | `Res<Texture>` | Use color channels |
-| `tex_roughness` | `Res<Texture>` | Use green channel |
-| `tex_metallic` | `Res<Texture>` | Use blue channel |
-| `tex_albedo` | `Res<Texture>` | Use color channels |
-| `tex_alpha` | `Res<Texture>` | Use alpha channel |
-| `tex_transmission` | `Res<Texture>` | Use red channel |
-| `tex_emission` | `Res<Texture>` | Use color channels |
-| `tex_thickness` | `Res<Texture>` | Use green channel |
-| `tex_occlusion` | `Res<Texture>` | Use red channel |
-| `hint_mirror` | | |
+| Key | Value Type | |
+| -------------------- | ------------------- | ------------------ |
+| `name` | `String` | |
+| `index` | `Res<[u32; 3]>` | |
+| `armature` | `Res<Armature>` | |
+| `g_metallic` | `Float` | |
+| `g_roughness` | `Float` | |
+| `g_albedo` | `Vec3` | |
+| `g_alpha` | `Float` | |
+| `g_transmission` | `Float` | |
+| `g_emission` | `Vec3` | |
+| `g_refractive_index` | `Float` | |
+| `g_attenuation` | `Vec3` | |
+| `g_dispersion` | `Float` | |
+| `g_thickness` | `Float` | |
+| `g_unlit` | | |
+| `g_double_sided` | | |
+| `va_position` | `Res<[Vec3]>` | |
+| `va_normal` | `Res<[Vec3]>` | |
+| `va_tangent` | `Res<[Vec3]>` | |
+| `va_texcoord` | `Res<[Vec2]>` | |
+| `va_roughness` | `Res<[Float]>` | |
+| `va_metallic` | `Res<[Float]>` | |
+| `va_albedo` | `Res<[Vec3]>` | |
+| `va_alpha` | `Res<[Float]>` | |
+| `va_transmission` | `Res<[Float]>` | |
+| `va_emission` | `Res<[Vec3]>` | |
+| `va_joint_weight` | `Res<[[Float; 4]]>` | |
+| `va_joint_index` | `Res<[[u16; 4]]>` | |
+| `tex_normal` | `Res<Texture>` | Use color channels |
+| `tex_roughness` | `Res<Texture>` | Use green channel |
+| `tex_metallic` | `Res<Texture>` | Use blue channel |
+| `tex_albedo` | `Res<Texture>` | Use color channels |
+| `tex_alpha` | `Res<Texture>` | Use alpha channel |
+| `tex_transmission` | `Res<Texture>` | Use red channel |
+| `tex_emission` | `Res<Texture>` | Use color channels |
+| `tex_thickness` | `Res<Texture>` | Use green channel |
+| `tex_occlusion` | `Res<Texture>` | Use red channel |
+| `hint_mirror` | | |
- **Attenuation**: Attenuation coefficient for each color channel due to
scattering within the material volume expressed as e-folding distance (m^-1).
@@ -93,11 +99,11 @@ white except normals are zero.
## Armature
-| Key | Value Type | |
-| ----------- | ------------------- | ------------------------------------ |
-| `parent` | `[u32]` | Parent indecies |
-| `transform` | `[(Matrix3, Vec3)]` | |
-| `names` | `[String]` | Each string prefixed with u16 length |
+| Key | Value Type | |
+| ----------- | ----------- | ------------------------------------ |
+| `parent` | `[u16]` | Parent indecies |
+| `transform` | `[Affine3]` | |
+| `name` | `[String]` | Each string prefixed with u16 length |
## LightPart