Manuals
Manuals




This translation is community contributed and may not be up to date. We only maintain the English version of the documentation. Read this manual in English

バッファー

バッファーリソース(Buffer resource)は、位置や色などの値を持つ1つ以上のストリーム(stream)を記述するために使用します。各ストリームには、名前、データ型、個数、データそのものが含まれます。例:

[
  {
    "name": "position",
    "type": "float32",
    "count": 3,
    "data": [
      -1.0,
      -1.0,
      -1.0,
      -1.0,
      -1.0,
      1.0,
      ...
    ]
  }
]

上の例は、32ビット浮動小数点数で表した3次元の位置のストリームを記述しています。バッファーファイルの形式は JSON で、ファイルの拡張子は .buffer です。

バッファーリソースは通常、外部ツールやスクリプトを使用して作成します。たとえば、Blender などのモデリングツールからエクスポートするときに作成します。

バッファーリソースは、メッシュコンポーネント(Mesh component) への入力として使用できます。また、buffer.create()関連する API 関数を使用して、実行時にバッファーリソースを作成することもできます。