diff --git a/docs/en/en.json b/docs/en/en.json index d97e2274..783a6afa 100644 --- a/docs/en/en.json +++ b/docs/en/en.json @@ -745,6 +745,10 @@ "path": "/manuals/atlas", "name": "Atlas" }, + { + "path": "/manuals/buffer", + "name": "Buffer" + }, { "path": "/manuals/font", "name": "Font" diff --git a/docs/en/manuals/buffer.md b/docs/en/manuals/buffer.md new file mode 100644 index 00000000..bb23a035 --- /dev/null +++ b/docs/en/manuals/buffer.md @@ -0,0 +1,33 @@ +--- +title: Buffer manual +brief: This manual explains how Buffer resources work in Defold. +--- + +# Buffer + +The Buffer resource is used to describe one or more streams of values, for instance positions or colours. Each stream has a name, data type, count and the data itself. Example: + +``` +[ + { + "name": "position", + "type": "float32", + "count": 3, + "data": [ + -1.0, + -1.0, + -1.0, + -1.0, + -1.0, + 1.0, + ... + ] + } +] +``` + +The above example describes a stream of positions in three dimensions, represented as 32-bit floating point numbers. The format of a Buffer file is JSON, with file extension `.buffer`. + +Buffer resources are typically created using external tools or scripts, for instance when exporting from modeling tools such as Blender. + +A Buffer resource can be used as input to a [Mesh component](/manuals/mesh). Buffers resources can also be created at runtime using the `buffer.create()` and [related API functions](/ref/stable/buffer/#buffer.create:element_count-declaration). \ No newline at end of file