-
-
Notifications
You must be signed in to change notification settings - Fork 63
USDJ JSON representation
Syoyo Fujita edited this page Jul 20, 2025
·
3 revisions
JSON representation of USD.
Since its a JSON, it can be parsed and edited in various tools
USDJ JSON representation is TinyUSDZ specific, and work-in-progress.
A mixture of USDA and USDC(Crate).
For example, "uniform float[] myarray = [...]" can be represented as:
{ "name" : "myarray",
"typeName" : "float[]",
"variability" : "uniform",
"value" : "[1.0, 2.0, 1.0]" # or Base-122/Base64 string for storage efficiency
} Binary and int/float array value can be represented as Base-122(Preferred) and Base-64(for compatibility)
We'd like to support Base-122 (~14%) for smaller inflation than Base64
https://github.com/kevinAlbs/Base122
which is compatible with Web(UTF-8) platform.
Encode USD scene graph with JSON, and store binary data with safetensors format.
JSON
{ "/mesh0" {
"attributes" : [ "points" ]
}
Safetensors
{ "/mesh0/points.default" : OFFSET0,
"/mesh0/points.timeSamples" : OFFSET1
}
- Simpler than glTF's Accessor/BufferView/Buffer
- Can reuse existing safetensors loader/saver, e.g. safetensors-cpp: https://github.com/syoyo/safetensors-cpp
- Need extra data consistency check