2. データ スキーマ
このページではVGO 2.0 の データ スキーマの詳細を説明します。
目次
- [全体目次] (https://qiita.com/izayoijiichan/items/5c7004cd87fe31a08414)
- [1. ファイル仕様] (https://qiita.com/izayoijiichan/items/f25acc93cf3a7c46c4bb)
-
- データ スキーマ(現在位置)
2. データ スキーマ仕様
VGO 2.0 では 一部のデータをJSON
またはBSON
として格納しています。
対象のデータは以下の通りです。
|名前|補足|
|:--|:--|:--:|
|アセット情報||
|レイアウト情報||
|リソース アクセサー||
|リソース|チャンクタイプがREPJ
またはREPB
の場合のみ|
2-1. アセット情報 (vgo.assetInfo)
VGOのアセット情報を格納しています。
定義名 | 説明 | データ タイプ | 必須 |
---|---|---|---|
generator | このVGOモデルの生成ツールの情報 | vgo.generatorInfo | |
right | このVGOのコピーライト。 | vgo.right | |
extensions | 拡張定義。 | object | |
extensionsUsed | このアセットで使用されている拡張定義の名前(レイアウトを含む) | string[] |
ジェネレーター情報 (vgo.generatorInfo)
定義名 | 説明 | データ タイプ | 必須 | 値 |
---|---|---|---|---|
name | 生成ツールの名前。 | string | true | UniVGO |
version | 生成ツールのバージョン。 | string | true | 2.0.0 |
ジェネレーターがVGOファイルをエクスポートする際に設定します。
権利情報 (vgo.right)
このVGOモデルに対するコピーライト©です。
定義名 | 説明 | データ タイプ | 必須 | 補足 |
---|---|---|---|---|
title | このワークのタイトル。 | string | ||
author | クリエイターの名前。 | string | ||
organization | クリエイターの所属する組織。 | string | ||
createdDate | このワークの作成日。 | string | 指定のフォーマットはありません。 | |
updatedDate | このワークの更新日。 | string | 指定のフォーマットはありません。 | |
version | このワークのバージョン。 | string | 指定のフォーマットはありません。 | |
distributionUrl | 配布URL。 | string | URLフォーマット | |
licenseUrl | ライセンスを記載したURL。 | string | URLフォーマット |
アセット情報(例)
{
"generator": {
"name": "UniVGO",
"version": "2.0.0"
},
"right": {
"title": "Sample 3D Model",
"author": "Izayoi Jiichan",
"organization": "",
"createdDate": "2020-08-20",
"updatedDate": "2020-08-20",
"version": "1.0.0",
"distributionUrl": "",
"licenseUrl": ""
},
"extensions": [],
"extensionsUsed": []
}
2-2. レイアウト
VGOのレイアウト情報です。
定義名 | 説明 | データ タイプ | 必須 | 補足 |
---|---|---|---|---|
nodes | ノードの一覧です。 | layout.node[] | true | ノードの先頭にはルートを含めます。 |
skins | スキンの一覧です。 | layout.skin[] | ||
meshes | メッシュの一覧です。 | layout.mesh[] | ||
materials | マテリアルの一覧です。 | layout.material[] | ||
textures | テクスチャーの一覧です。 | layout.texture[] | ||
particles | パーティクルの一覧です。 | layout.particle[] | ||
extensions | 拡張定義。 | object |
ノード (layout.node)
ノード ヒエラルキーのノードです。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
name | このノードの名前です。 | string | true | ||
isRoot | ノードがルートかどうか。 | bool | true / false | false | |
isActive | ノードがアクティブ(有効)かどうか。 | bool | true / false | true | |
isStatic | ノードがスタティック(静的)かどうか。 | bool | true / false | false | |
tag | ノードに付与されたタグ。 | string | Untagged | ||
layer | ノードが位置するレイヤー。 | int | [0, 31] | 0 | |
animator | アニメーター。 | node.animator | |||
rigidbody | 剛体。 | node.rigidbody | |||
colliders | コライダーの一覧。 | node.collider[] | |||
skybox | スカイボックス。 | vgo.skybox | |||
light | 光源。 | vgo.light | |||
right | このノードのコピーライト。 | vgo.right | |||
particle | パーティクルのインデックス。 | int | |||
mesh | メッシュのインデックス。 | int | |||
skin | スキンのインデックス。 | int | |||
children | このノードの子ノードの一覧。 | int[] |
アニメーター (node.animator)
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
name | オブジェクトの名前です。 | string | |||
enabled | アニメーターが有効かどうか。 | bool | true / false | true | |
humanAvatar | ヒューマン アバター。 | vgo.humanAvatar | |||
applyRootMotion | ルートモーションを適用するべきかどうか。 | bool | true / false | false | |
updateMode | アニメーターのアップデート モード。 | enum | 0: Normal 1: AnimatePhysics 2: UnscaledTime |
0 | |
cullingMode | アニメーターのカリング モード | enum | 0: AlwaysAnimate 1: CullUpdateTransforms 2: CullCompletely |
0 |
ヒューマン アバター (vgo.humanAvatar)
人型アバターを使用する場合に設定します。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
name | このヒューマン アバターの名前。 | string | |||
humanBones | ヒューマンボーンの一覧。 | vgo.HumanBone[] | true |
ヒューマン ボーン (vgo.humanBone)
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
humanBodyBone | ヒューマン ボディ ボーン | enum | true | [0, 55] | |
nodeIndex | ノードのインデックス。 | int | true |
剛体 (node.rigidbody)
ノードを物理特性によって制御する場合に設定します。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
mass | 物体の質量。(kg単位) | float | [0.0000001, 1000000000] | ||
drag | 力によって動く際に、オブジェクトに影響する空気抵抗の大きさ。 | float | [0.0, infinity] | ||
angularDrag | トルクによって回転する際に、オブジェクトに影響する空気抵抗の大きさ。 | float | [0.0, infinity] | ||
useGravity | オブジェクトが重力の影響を受けるかどうか。 | bool | true / false | true | |
isKinematic | 物理エンジンでなくTransformによって操作するかどうか。 | bool | true / false | false | |
interpolation | 補完タイプ。 | enum | 0: None 1: Interpolate 2: Extrapolate |
0 | |
collisionDetectionMode | 衝突検知モード。 | enum | 0: Discrete 1: Continuous 2: ContinuousDynamic 3: ContinuousSpeculative |
0 | |
constraints | 剛体の動きに関する制限。 | int | FreesePositionX(2) | FreesePositionY(4) | FreesePositionZ(8) | FreeseRotationX(16) | FreeseRotationY(32) | FreeseRotationZ(64) |
0 |
コライダー (node.collider)
オブジェクトが衝突判定を必要とする場合に設定します。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 | Box | Capsule | Sphere |
---|---|---|---|---|---|---|---|---|
enabled | コライダーが有効かどうか。 | bool | true / false | true | * | * | * | |
type | コライダーのタイプ。 | enum | 0: Box 1: Capsule 2: Sphere |
0 | * | * | * | |
isTrigger | コライダーがトリガーかどうか。 | bool | true / false | false | * | * | * | |
center | オブジェクトのローカル空間でのコライダーの位置。(m単位) | float[3] | x, y, z | 0.0, 0.0, 0.0 | * | * | * | |
size | コライダーの大きさ。(m単位) | float[3] | x, y, z | 1.0, 1.0, 1.0 | * | - | - | |
radius | コライダーのローカル座標系における半径。(m単位) | float | [0, infinity] | - | * | * | ||
height | コライダーの高さ。 | float | [0, infinity] | - | * | - | ||
direction | オブジェクトのローカル座標系における長辺方向の軸の向き。 | int | 0: X 1: Y 2: Z |
- | * | - | ||
physicMaterial | 使用する物理特性マテリアル。 | vgo.PhysicMaterial | * | * | * |
物理特性マテリアル (vgo.physicMaterial)
衝突するオブジェクトの摩擦や跳ね返り効果を調整する場合に設定します。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
dynamicFriction | 移動している物体に対する摩擦。 | float | [0.0, 1.0] | ||
staticFriction | 面上で静止しているオブジェクトに使用される摩擦。 | float | [0.0, 1.0] | ||
bounciness | 表面にどれだけ弾性があるか。 | float | [0.0, 1.0] | ||
frictionCombine | 衝突するオブジェクト間の摩擦タイプ。 | enum | 0: Average 1: Multiply 2: Minimum 3: Maximum |
0 | |
bounceCombine | 衝突するオブジェクト間の跳ね返しタイプ。 | enum | 0: Average 1: Multiply 2: Minimum 3: Maximum |
0 |
スカイボックス (vgo.skybox)
スカイボックスを使用したい場合に設定します。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
materialIndex | マテリアルのインデックス。 | int |
スカイボックスは通常は最大で1個まで設定できます。
光源 (vgo.light)
definition name | description | type | required | setting value | default value | Spot | Directional | Point | Rectangle | Disc |
---|---|---|---|---|---|---|---|---|---|---|
enabled | ライトが有効かどうか。 | bool | true / false | true | * | * | * | * | * | |
type | ライトのタイプ。 | enum | 0: Spot 1: Directional 2: Point 3: Rectangle 4: Disc |
0 | * | * | * | * | * | |
shape | ライトの形状。 | enum | 0: Cone 1: Pyramid 2: Box |
0 | * | - | - | - | - | |
range | ライトの到達距離。 | float | [0, infinity] | * | - | * | * | * | ||
spotAngle | スポットライトの円錐形の底面の角度。(度単位) | float | [0, infinity] | * | - | - | - | - | ||
areaSize | エリアライトのサイズ。 | float[2] | x, y | - | - | - | * | - | ||
areaRadius | エリアライトの半径。 | float | [0, infinity] | - | - | - | - | * | ||
color | 光の色。 | float[4] | r, g, b, a | * | * | * | * | * | ||
lightmapBakeType | ライトのベイク タイプ。 | enum | 1: Mixed 2: Baked 4: Realtime |
* | * | * | * | * | ||
intensity | ライトの輝度。 | float | [0, infinity] | * | * | * | * | * | ||
bounceIntensity | バウンス照明の強度を定義する乗数。 | float | [0, infinity] | * | * | * | * | * | ||
shadows | この光がどのように影を落とすか。 | enum | 0: None 1: Hard 2: Soft |
0 | * | * | * | * | * | |
shadowRadius | 影の範囲。 | float | [0, infinity] | * | - | * | - | - | ||
shadowAngle | 影の角度。 | float | [0, infinity] | - | * | - | - | - | ||
shadowStrength | 影の強度。 | float | [0, infinity] | - | * | * | - | - | ||
shadowResolution | シャドウマップの解像度。 | enum | -1: FromQualitySettings 0: Low 1: Medium 2: High 3: VeryHigh |
-1 | - | * | * | - | - | |
shadowBias | 影が現れなくなるライトからの距離。 | float | [0, infinity] | - | * | * | - | - | ||
shadowNormalBias | 影を落す面が、面の法線に沿って縮小されるようになる距離。 | float | [0, infinity] | - | * | * | - | - | ||
shadowNearPlane | シャドウ錐台に使用する平面に近い値。 | float | [0, infinity] | - | * | * | - | - | ||
renderMode | ライトのレンダリング方法。 | enum | 0: Auto 1: ForcePixel 2: ForceVertex |
0 | * | * | * | * | * | |
cullingMask | カリング マスク。 | int | [-1, infinity] | -1 (Everything) | * | * | * | * | * |
Cookie、Flare、Halo はサポートされていません。
JSON example (layout.nodes)
{
"nodes": [
{
"name": "Node1",
"isRoot": true,
"tag": "Player",
"animator": {
"humanAvatar": {
"name": "",
"humanBones": []
}
},
"children": [
1,
2,
3,
4,
5
]
},
{
"name": "Node2",
"layer": 1,
"rigidbody": {
"mass": 1,
"drag": 0,
"angularDrag": 0.05,
"useGravity": true,
"isKinematic": false,
"interpolation": 0,
"collisionDetectionMode": 0,
"constraints": 0
},
"colliders": [
{
"type": 0,
"center": [ 0, 0, 0 ],
"size": [ 1, 1, 1 ]
},
{
"enabled": false,
"type": 1,
"radius": 0.49999997,
"height": 1,
"direction": 1,
"physicMaterial": {
"dynamicFriction": 0.6,
"staticFriction": 0.6,
"bounciness": 0,
"frictionCombine": 0,
"bounceCombine": 0
}
}
],
"mesh": 0
}
]
}
スキン (layout.skin)
スキンを定義するジョイントとマトリックス。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
inverseBindMatrices | 浮動小数点の4x4逆バインド行列を含むアクセサーのインデックス。 | int | |||
skeleton | スケルトン ルートとして使用されるノードのインデックス。 | int | |||
joints | このスキンのジョイントとして使用されるスケルトン ノードのインデックス。 | int[] | true |
メッシュ (layout.mesh)
レンダリングされるプリミティブのセット。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
name | このメッシュの名前。 | string | true | ||
attributes | 辞書マッピング属性。 | mesh.primitive.attributes | true | ||
subMeshes | サブメッシュ インデックスを含むアクセサーのインデックス。 | int[] | |||
materials | レンダリング時にこのプリミティブに適用するマテリアルのインデックスリスト。 | int[] | |||
blendShapeKind | ブレンドシェイプの種類。 | enum | 0: None 1: Face 2: Face_2 3: Kind_3 4: Kind_4 5: Kind_5 |
0 | |
blendShapes | ブレンドシェイプのリスト。 | mesh.blendshape[] | |||
blendShapePesets | ブレンドシェイプ プリセットのリスト。 | mesh.blendshape.preset[] |
メッシュ プリミティブ属性 (mesh.primitive.attributes)
辞書オブジェクト。
データ タイプ | キー | 値 |
---|---|---|
Dictionary | POSITION NORMAL TANGENT COLOR_0 TEXCOORD_0 JOINTS_0 WEIGHTS_0 |
アクセサー インデックス |
キー | アクセサー データ タイプ |
---|---|
POSITION | Vector3 (float) |
NORMAL | Vector3 (float) |
TANGENT | Vector4 (float) |
COLOR_0 | Color4 (ubyte) Color4 (float) |
TEXCOORD_0 | Vector2 (float) |
JOINTS_0 | Vector4 (ubyte) Vector4 (ushort) |
WEIGHTS_0 | Vector4 (float) |
ブレンドシェイプ (mesh.blendshape)
メッシュ ブレンドシェイプ。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
name | ブレンドシェイプの名前。 | string | true | ||
attributes | 辞書マッピング属性。POSITION ,NORMAL ,TANGENT のみ含めることができます。 |
mesh.primitive.attributes | true | ||
facePartsType | 顔パーツのタイプ。 | enum | 0: None 10: Forehead 11: Eyebrow 12: Eyelashes 13: Eyelid 14: Pupil 20: Ear 30: Nose 40: Cheek 50: Mouth 51: Teeth 52: Tongue 60: Hair 61: BackHair 62: SideHair 63: Frizz 64: EarHair 65: NoseHair 66: Mustache 67: Beard 70: Mole |
0 | |
blinkType | まばたきのタイプ。 | enum | 0: None 1: Left 2: Right 3: Both |
0 | |
visemeType | 口形素のタイプ。 | enum | -1: None 0: Silence 1: PP 2: FF 3: TH 4: DD 5: kk 6: CH 7: SS 8: nn 9: RR 10: A 11: E 12: I 13: O 14: U |
-1 |
ブレンドシェイプ プリセット (mesh.blendshape.preset)
ブレンドシェイプのプリセット。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
name | プリセットの名前。 | string | |||
type | プリセットのタイプ。 | enum | true | 0: Custom 1: Neutral 2: Joy 3: Angry 4: Sorrow 5: Fun 6: Confuse 7: Nervous 8: Sleepy 9: Surprise 10: WinkL 11: WinkR 12: Preset_12 13: Preset_13 14: Preset_14 15: Preset_15 |
|
bindings | バインディングのリスト。 | mesh.blendshape.binding[] | true |
ブレンドシェイプ バインディング (mesh.blendshape.binding)
プリセットのブレンドシェイプ バインディング。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
index | ブレンドシェイプのインデックス。 | int | true | ||
weight | このブレンドシェイプのウェイト。 | float | [0.0, 100.0] | 0 |
JSON example (layout.meshes)
{
"meshes": [
{
"name": "face",
"attributes": {
"POSITION": 59,
"NORMAL": 60,
"TEXCOORD_0": 61,
"JOINTS_0": 62,
"WEIGHTS_0": 63
},
"subMeshes": [
64,
65,
66
],
"materials": [
4,
5,
6
],
"blendShapeKind": 1,
"blendShapes": [
{
"name": "face.mouth_a",
"attributes": {
"POSITION": 67,
"NORMAL": 68,
"TANGENT": -1
},
"facePartsType": 50,
"blinkType": 0,
"visemeType": 10
}
],
"blendShapePesets": [
{
"name": "Joy",
"type": 2,
"bindings": [
{
"index": 24,
"weight": 100.0
},
{
"index": 36,
"weight": 100.0
},
{
"index": 44,
"weight": 100.0
}
]
}
]
}
]
}
マテリアル (layout.material)
プリミティブのマテリアルの外観。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
name | マテリアルの名前。 | string | true | ||
shaderName | シェーダー名。 | string | true | ||
renderQueue | レンダー キュー。 | int | |||
isUnlit | マテリアルがライトの影響を受けないかどうか。 | bool | true / false | false | |
intProperties | キーはプロパティ名です。 | Dictionary | |||
floatProperties | キーはプロパティ名です。 | Dictionary | |||
colorProperties | キーはプロパティ名です。 値は color[3] または color[4] です。 |
Dictionary | |||
vectorProperties | キーはプロパティ名です。 値は vector です。 |
Dictionary | |||
matrixProperties | キーはプロパティ名です。 値は matrix です。 |
Dictionary | |||
textureOffsetProperties | キーはプロパティ名です。 値は vector2 です。 |
Dictionary | |||
textureScaleProperties | キーはプロパティ名です。 値は vector2 です。 |
Dictionary | |||
textureIndexProperties | キーはプロパティ名です。 | Dictionary | |||
keywordMap | キーはキーワードです。 | Dictionary | |||
tagMap | キーはタグ名です。 | Dictionary | |||
extensions | 拡張定義。 | object |
JSON example (layout.materials)
{
"materials": [
{
"name": "StandardMaterial",
"shaderName": "Standard",
"renderQueue": 2000,
"intProperties": {
"_Mode": 0,
"_SmoothnessTextureChannel": 0,
"_SpecularHighlights": 1,
"_GlossyReflections": 1,
"_UVSec": 0
},
"floatProperties": {
"_Cutoff": 0.5,
"_Metallic": 0,
"_Glossiness": 0.5,
"_GlossMapScale": 1,
"_BumpScale": 1,
"_Parallax": 0.02,
"_OcclusionStrength": 1,
"_DetailNormalMapScale": 1
},
"colorProperties": {
"_Color": [
0.743349731,
0.4882486,
0.181164235,
1
],
"_EmissionColor": [
0,
0,
0
]
},
"textureScaleProperties": {
"_MainTex": [
5,
5
]
},
"textureIndexProperties": {
"_MainTex": 1
},
"keywordMap": {
"_NORMALMAP": false,
"_PARALLAXMAP": false,
"_EMISSION": false,
"_DETAIL_MULX2": false,
"_METALLICGLOSSMAP": false
}
}
]
}
テクスチャー (layout.texture)
テクスチャー。
定義名 | 説明 | データ タイプ | 必須 | 設定値 | 既定値 |
---|---|---|---|---|---|
name | テクスチャーの名前。 | string | true | ||
source | イメージを格納したアクセサーのインデックス。 | int | |||
dimensionType | テクスチャーの次元タイプ。 | enum | -1: Unknown 0: None 1: Any 2: Tex2D 3: Tex3D 4: Cube 5: Tex2DArray 6: CubeArray |
0 | |
mapType | テクスチャー マップのタイプ。 | enum | -1: Unknown 0: Default 1: NormalMap 2: HeightMap 3: OcclusionMap 4: EmissionMap 5: MetallicRoughnessMap 6: SpecularGlossinessMap 7: CubeMap |
0 | |
colorSpace | イメージ カラー スペース。 | enum | 0: sRGB 1: Linear |
0 | |
mimeType | 画像のMIMEタイプ。 | string | image/jpeg image/png |
||
filterMode | テクスチャーのフィルタリング モード。 | enum | 0: Point 1: Bilinear 2: Trilinear |
0 | |
wrapMode | テクスチャー座標ラッピング モード。 | enum | 0: Repeat 1: Clamp 2: Mirror 3: MirrorOnce |
0 | |
wrapModeU | テクスチャーU座標ラッピング モード。 | enum | 0: Repeat 1: Clamp 2: Mirror 3: MirrorOnce |
0 | |
wrapModeV | テクスチャーV座標ラッピング モード。 | enum | 0: Repeat 1: Clamp 2: Mirror 3: MirrorOnce |
0 | |
metallicRoughness | マテリアルの金属の粗さ。 | float | [0.0, 1.0] | ||
extensions | 拡張定義。 | object |
JSON example (layout.textures)
{
"textures": [
{
"name": "MetallicTexture",
"source": 1,
"dimensionType": 2,
"mapType": 5,
"colorSpace": 1,
"mimeType": "image/png",
"filterMode": 1,
"wrapMode": 0,
"wrapModeU": 0,
"wrapModeV": 0,
"metallicRoughness": 0.5
}
]
}
目次
- [全体目次] (https://qiita.com/izayoijiichan/items/5c7004cd87fe31a08414)
- [1. ファイル仕様] (https://qiita.com/izayoijiichan/items/f25acc93cf3a7c46c4bb)
-
- データ スキーマ(現在位置)