Skip to content
07-848 2005

Corona Standalone

CGeo (version 7)

CGeo is an extensible file format for storing mesh data. It can be used to implement proxies or to communicate data between applications that support the Corona renderer.

Last updated 13 January 2026

Overview

CGeo is an extensible file format for storing mesh data. It can be used to implement proxies or to communicate data between applications that support the Corona renderer.

A CGeo file consists of two main chunks, namely the header and the data. All binary data is little-endian.

In the documentation that follows, it is important to distinguish between an animation sample and an animation snapshot. The object stored within a CGeo file is represented as a series of animation snapshots, and a single snapshot consists of one or more animation samples. Samples represent subsamples between snapshots and can be used to store motion blur data.

General Layout

Byte Index

Byte Count

Content Description

Byte Index

Byte Count

Content Description

0

1

The binary magic number indicating cgeo file 0x43

1

4

The size of the header H that follows represented as a binary 4-byte integer

5

H

The header itself in human-readable form (see the following description)

5 + H

Determined by the header

The data section

Let's start with a sample:

<code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">Corona Renderer CGeo file.</span><span data-v-c2b1f83f="" class="line">This file contains an animated Mesh object.</span><span data-v-c2b1f83f="" class="line">This file is BINARY.</span><span data-v-c2b1f83f="" class="line">Version: 4</span><span data-v-c2b1f83f="" class="line">Date created: 2016-01-05/14:10:17</span><span data-v-c2b1f83f="" class="line">Number of faces: 12</span><span data-v-c2b1f83f="" class="line">Number of vertices: 8</span><span data-v-c2b1f83f="" class="line">Number of mapping channels: 2</span><span data-v-c2b1f83f="" class="line">Number of normals: 24</span><span data-v-c2b1f83f="" class="line">Bounding box size (original units) : 21.0804 26.3839 33.2031</span><span data-v-c2b1f83f="" class="line">Bounding box size (millimeters) : 210.804 263.839 332.031</span><span data-v-c2b1f83f="" class="line">Original material name: [none]</span><span data-v-c2b1f83f="" class="line">Original object name: Box001</span><span data-v-c2b1f83f="" class="line">Animation snapshot count: 1</span><span data-v-c2b1f83f="" class="line">Time per animation snapshot [microseconds]: 33333</span><span data-v-c2b1f83f="" class="line">Animation time start: 0</span><span data-v-c2b1f83f="" class="line">Scale: 0.1</span><span data-v-c2b1f83f="" class="line">Compressed: True</span></code>

The header is in plain text, so that it is possible to easily inspect the CGeo file in a text editor. It contains properties describing the data stored in the form:

<code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">PropertyName: PropertyValue</span></code>

Every property shall be on its own line with a line separator being \n. The header can contain an arbitrary number of properties, but there are properties that are mandatory (listed below). Besides properties, the header can contain arbitrary text. It's a good idea to at least state the origin of the file.

List of mandatory properties

Name

Description

Name

Description

“Version”

Currently 7 for Corona v2

“Animation snapshot count”

The number of animation snapshots stored in the data section

“Time per animation snapshot [microseconds]”

As the name suggests

“Animation time start”

In microseconds. Can be used to place the object correctly on the timeline upon loading

“Scale”

The scale of the data stored relative to millimeters (e.g., 10 if data are stored in centimeters). 0 if unknown

“Original material name”

As the name suggests

“Original object name”

As the name suggests

“Compressed”

Can be one of {'True', 'False'}. The comparison is done case-insensitively. If 'False' is specified, then no section of the CGeo file is compressed. In other cases, sections of all snapshots in the data section are compressed (see below). This property was added in version 5, and if it is missing, then 'True' shall be assumed. If at any point in the documentation something is said to be compressed, then it is only if the value of this property is 'True'.

Data Section

The data section contains animated mesh snapshots, along with precomputed auxiliary data such as bounding boxes and point clouds. Auxiliary data are usually smaller in memory footprint than the geometry data, which can be useful when displaying a proxy in the viewport of a 3d application, as we don't have to read a large amount of data from the disk. The format is extensible in the way that everything within the animation snapshot store has its own section. The only mandatory section is the one that holds geometry data; everything else can (but shouldn't) be missing and can be computed on the fly if necessary. The idea is that sections can be added in the future without breaking compatibility.

Tags

Tags are used to identify certain events within the data section. Every tag is a 4-byte integer. Following is the table of currently used tags and the rest of the documentation will be referencing them by their ids.

Tag Id

Tag Value

Tag Id

Tag Value

TAG_ANIMATION_SNAPHOT_START

0xA3CDEF00

TAG_ANIMATION_SNAPHOT_END

0xFED3BA11

TAG_ANIM_TABLE_START

0xFAD0CCA1

TAG_ANIM_TABLE_END

0xE580AC23

TAG_BOUNDING_BOX

0x2F89A8B5

TAG_MESH_DATA

0x35F71EA8

TAG_MESH_VERTICES_END

0x42C342CC

TAG_MESH_NORMALS_END

0xB00B06B0

TAG_MESH_MAP_COORDS_END

0xCAAC04CA

TAG_POINTCLOUD

0x1387EBEB

Layout

The following is the description of the layout of the data section.

Item

Description

Item

Description

Flags

An uncompressed 4-byte integer is described later.

TAG_ANIM_TABLE_START

Offset Table

Uncompressed offset table. There is an entry for every animation snapshot and every entry is the 8-byte offset from the beginning of the file to the beginning of the snapshot's data

TAG_ANIM_TABLE_END

TAG_ANIMATION_SNAPSHOT_START

Tag indicating the beginning of an animation snapshot.

Sections

Individual sections containing the data for the snapshot. Described later.

TAG_ANIMATION_SNAPSHOT_END

Tag indicating the end of an animation snapshot.

Please note that the pair (TAG_ANIMATION_SNAPSHOT_START, TAG_ANIMATION_SNAPSHOT_END) will appear as many times as there are animation snapshots.

Flags

Bit

Name

Description

Bit

Name

Description

1

Changing Topology

Flag indicates that every animation snapshot is stored compressed on it's own as the topology can change from snapshot to snapshot. In case this flag is not specified then it's expected that only the first snapshot contains topological information and all subsequent snapshots are only stored as compressed differences of positions, normals and texcoords from the first snapshot.

Sections

Every snapshot consists of one or more sections, and the offset stored in the offset table points to the first section! Every section begins with a 4-byte identifier and an 8-byte section size. Sections can be in arbitrary order, and the only required section is the one containing geometrical data (TAG_MESH_DATA). It's still recommended to store all documented sections within every animation snapshot. The following is the documentation of all currently supported sections.

Mesh Data - TAG_MESH_DATA

This section holds the geometry data and is the only one required. The first snapshot is always stored completely (including topology). Every subsequent snapshot that has the same topology as the first one is stored as the difference from the first; better compression is expected in such a case. The whole section is compressed.

The following is a description of the section's content when the snapshot is fully stored.

Item

Description

Item

Description

0x1

1 byte of value 0x1 indicating that this is a complete snapshot

Vertex Count

4-byte integer

Normal Count

4-byte integer

Map Channel Count

4-byte integer indicating the number of mapping channels

Triangle Count

4-byte integer

Vertices

Every vertex is represented by 3 IEEE754 single-precision floating-point numbers corresponding to X,Y,Z

TAG_MESH_VERTICES_END

Normals

Every normal is represented by 3 IEEE754 single precision floating point numbers corresponding to X,Y,Z

TAG_MESH_NORMALS_END

Texture Coordinates

Data for all mapping channels. The number of mapping channels is indicated by Map Coord Count. Every mapping channel's data is given as a 4-byte integer storing the number of texture coordinates, followed by the coordinates themselves. Each coordinate is represented by 3 IEEE754 single-precision floating-point numbers corresponding to U,V, and W.

TAG_MESH_MAP_COORDS_END

Triangle Data

Described below.

The following table describes how a single triangle is stored in CGEO version 7 and newer (Corona v2 and newer).

Item

Description

Item

Description

Vertex Indices

3 vertex indices. Every index is represented as a 4-byte integer.

Normal Indices

3 normal indices. Every index is represented as a 4-byte integer.

Map Coordinates Indices

3 indices are stored for each mapping channel, and every index is represented as a 4-byte integer.

Material ID

2-byte material ID.

Edge Visibility

1 byte bitset. Bits 0, 1, 2 represent edges AB, BC, CA. When the corresponding bit for an edge is set, the edge is visible.

The following is a description of the section's content when the snapshot is stored as the difference from the first.

Item

Description

Item

Description

0x0

1 byte of value 0x0, indicating that this is a difference from the first snapshot

Vertex Differences

Every difference is represented by 3 IEEE754 single-precision floating-point numbers corresponding to X,Y,Z

TAG_MESH_VERTICES_END

Normal Differences

Every difference is represented by 3 IEEE754 single-precision floating-point numbers corresponding to X,Y,Z

TAG_MESH_NORMALS_END

Texture Coordinate Differences

Every difference is represented by 3 IEEE754 single-precision floating-point numbers corresponding to U,V, and W. The differences for all map channels are stored subsequently. The number of differences for each channel is given by the first snapshot, which is stored completely.

TAG_MESH_MAP_COORDS_END

Bounding Box - TAG_BOUNDING_BOX

Compressed 6 IEEE754 single-precision floating-point numbers describing the bounding box of the snapshot. The order is: MinX, MinY, MinZ, MaxX, MaxY, MaxZ.

Point Cloud - TAG_POINTCLOUD

This section contains the point cloud that can be used to visualize the animation snapshot in the viewport. The whole section is compressed and contains the following:

Item

Description

Item

Description

Point Count

8 byte unsigned integer telling the number of points that follow.

Points

Every point is represented by 3 IEEE754 single precision floating point numbers corresponding to X,Y,Z coordinates in that order.