Data Schema Cheatsheet
Numeric data types
Schema | JavaScript | WGSL |
---|---|---|
number | f32 | |
number | i32 | |
number | u32 | |
boolean | bool |
Vector and matrix types
Schema | Value constructors | WGSL equivalents |
---|---|---|
vec2u |
| vec2u, vec2<u32> |
vec2f |
| vec2f, vec2<f32> |
vec2i |
| vec2i, vec2<i32> |
vec3u |
| vec3u, vec3<u32> |
vec3f |
| vec3f, vec3<f32> |
vec3i |
| vec3i, vec3<i32> |
vec4u |
| vec4u, vec4<u32> |
vec4f |
| vec4f, vec4<f32> |
vec4i |
| vec4i, vec4<i32> |
mat2x2f |
| mat2x2f, mat2x2<f32> |
mat3x3f |
| mat3x3f, mat3x3<f32> |
mat4x4f |
| mat4x4f, mat4x4<f32> |