summaryrefslogtreecommitdiff
path: root/doc/resources.md
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-10 19:13:07 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-10 19:13:07 +0100
commit2746fce8d943325f34b188a67b7039453d8484d1 (patch)
treefac714c26355b17ffa94ac78f68ce86677d3942a /doc/resources.md
parent249ce84a4138d084c77c7caf40b57adec8582803 (diff)
downloadweareserver-2746fce8d943325f34b188a67b7039453d8484d1.tar
weareserver-2746fce8d943325f34b188a67b7039453d8484d1.tar.bz2
weareserver-2746fce8d943325f34b188a67b7039453d8484d1.tar.zst
Use interleaved vertex attributes
Diffstat (limited to 'doc/resources.md')
-rw-r--r--doc/resources.md119
1 files changed, 60 insertions, 59 deletions
diff --git a/doc/resources.md b/doc/resources.md
index c11813b..86f874a 100644
--- a/doc/resources.md
+++ b/doc/resources.md
@@ -15,16 +15,16 @@
| Key | Value Type |
| -------- | ---------- |
-| \<Name\> | Resource |
+| \<Name\> | `Res` |
## Prefab
-| Key | Value Type | |
-| ----------- | -------------------------------- | --------- |
-| mesh | Matrix3, Vec3, Res<MeshPart> | Multi key |
-| collider | Matrix3, Vec3, Res<ColliderPart> | Multi key |
-| light | Vec3, Res<LightPart> | Multi key |
-| environment | Res<EnvironmentPart> | |
+| Key | Value Type | |
+| ------------- | -------------------------------------- | --------- |
+| `mesh` | `Matrix3`, `Vec3`, `Res<MeshPart>` | Multi key |
+| `collider` | `Matrix3`, `Vec3`, `Res<ColliderPart>` | Multi key |
+| `light` | `Vec3`, `Res<LightPart>` | Multi key |
+| `environment` | `Res<EnvironmentPart>` | |
## MeshPart
@@ -33,39 +33,39 @@ 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 | Resource | |
-| 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 | | |
-| va_position | [Resource; 3] | |
-| va_normal | [Resource; 3] | |
-| va_texcoord | [Resource; 2] | |
-| va_roughness | Resource | |
-| va_metallic | Resource | |
-| va_albedo | [Resource; 3] | |
-| va_alpha | Resource | |
-| 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_alpha | Resource | Use alpha channel |
-| tex_transmission | Resource | Use red channel |
-| tex_emission | Resource | Use color channels |
-| tex_thickness | Resource | Use green channel |
-| tex_occlusion | Resource | Use red channel |
+| Key | Value Type | |
+| -------------------- | -------------- | ------------------ |
+| `name` | `String` | |
+| `index` | `Res` | |
+| `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` | | |
+| `va_position` | `Res<[Vec3]>` | |
+| `va_normal` | `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<Float>` | |
+| `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 |
- **Attenuation**: Attenuation coefficient for each color channel due to
scattering within the material volume expressed as e-folding distance (m^-1).
@@ -82,11 +82,11 @@ white except normals are zero.
## LightPart
-| Key | Value Type |
-| -------- | ------------------ |
-| radius | Float |
-| emission | Vec3 |
-| spot | Vec3, Float, Float |
+| Key | Value Type |
+| ---------- | ------------------------ |
+| `radius` | `Float` |
+| `emission` | `Vec3` |
+| `spot` | `Vec3`, `Float`, `Float` |
- **Emission**: Luminous intensity in candela per channel. Equivalent of `color`
multiplied with `intensity` of [KHR_lights_punctual].
@@ -98,10 +98,10 @@ white except normals are zero.
## EnvironmentPart
-| Key | Value Type | |
-| ------ | ---------- | ---------------- |
-| skybox | Resource | |
-| sun | Vec3, Vec3 | Direction, Color |
+| Key | Value Type | |
+| -------- | -------------- | ---------------- |
+| `skybox` | `Res` | |
+| `sun` | `Vec3`, `Vec3` | Direction, Color |
## Texture
@@ -111,16 +111,17 @@ WebP
Only one key for shape should be set.
-| Key | Value Type | |
-| ---------------- | --------------------------------- | ---------------------------------------- |
-| friction_kinetic | Float | Friction coeffient for kinectic friction |
-| friction_static | Float | Friction coeffient for static friction |
-| sh_box | Vec3 | Side lengths |
-| sh_sphere | Float | Radius |
-| sh_cylinder | Float, Float, Float | Bottom/Top Radius, Height |
-| sh_capsule | Float, Float, Float | Bottom/Top Radius, Height |
-| sh_convex_hull | Resource<\[Vec3\]> | Convex hull points |
-| sh_mesh | Resource<u32>, Resource<\[Vec3\]> | Mesh index + vertex buffer |
+| Key | Value Type | |
+| ------------------- | ------------------------- | -------------------------- |
+| `restitution_coeff` | `Float` | |
+| `friction_kinetic` | `Float` | Coeffient |
+| `friction_static` | `Float` | Coeffient |
+| `sh_box` | `Vec3` | Side lengths |
+| `sh_sphere` | `Float` | Radius |
+| `sh_cylinder` | `Float`, `Float`, `Float` | Bottom/Top Radius, Height |
+| `sh_capsule` | `Float`, `Float`, `Float` | Bottom/Top Radius, Height |
+| `sh_convex_hull` | `Res<[Vec3]>` | Convex hull points |
+| `sh_mesh` | `Res<u32>`, `Res<[Vec3]>` | Mesh index + vertex buffer |
[KHR_materials_transmission]: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_transmission
[KHR_materials_ior]: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_ior