PathEngine home previous: Choosing Voxel Processing Parametersnext: Performance Considerations
Contents, Programmers Guide, World Representation, 3D Content Processing, Tiled 3D Content Processing

Tiled 3D Content Processing

Why tiled processing?

When working with very large worlds, it can become impractical to process all of the world data in one single 3D processing operation. It can be inconvenient to reprocess all of the world data each time any part of this data is changed. And it is also desirable to be able to speed up the content processing step where multiple cores or multiple machines are available.

For these reasons PathEngine supports a 'tile by tile' processing setup.

Basic idea

With 'tile by tile' processing, 3D content processing source data is split across a horizontal tiling, with ground result pieces generated independantly for each tile, and subsequently recombined to form run-time ground meshes.

Working example

The the 3D Content Processing Demo includes code to demonstrate this tiled process.
You can run the demo to see the tiled process in action, examine the tiled pieces generated by this process, and browse the source code to see a detailed example implementation of the various steps involved in a 'tile by tile' content processing setup.

Defining a tiling

The first step is to define a world range, and horizontal tiling, by creating an instance of Interface iSourceTiling.

(When using BSP processing, iPathEngine::buildRegularSourceTiling() can be used for this purpose. When using voxel processing, use iPathEngine::buildRegularSourceTiling_RoundUpForVoxels() instead, in order to ensure that voxel size and tile size are compatible.)

The tiling object can be queried for things like the number of tiles, and the horizontal range of each tile.

Per tile processing

The next stage in the process is to run the 3D content processing for each tile in the tiling, with a suitable subset of the 3D source data.
All source elements overlapping each tile must be included in the processing for that tile, and where elements overlap multiple tiles, these elements must be presented identically for the processing of each of those tiles (i.e. element geometry and attributes must be identical).
'Element' here means either individual faces, in the case of mesh source data, or individual solid objects, in the case of solid object source data. It's ok to include elements not overlapped by a tile's range, as this will be filtered out. (So the application driving the content processing can choose to filter objects at a coarser level than these elements if desired, e.g. individual scenery objects can be considered based on the total range overlapped by each scenery object.)

Note that elements should be filtered by a slightly expanded range, which can be obtained by calling iSourceTiling::getTileFilterRange(), as opposed to the actual physical range covered by the tile.
This enables PathEngine to ensure that the borders of generated tiles can be matched up correctly.

The processing is performed with the same API methods as standard 'one shot' 3D content processing, but with an additional option passed in to specify the range of the tile being processed.
The source tiling interface includes a method to provide the relevant option, as follows:

iSourceTiling* tiling = SetUpTiling();
const char* options[3];
options[0] = "clipToTile";
options[2] = 0;
int32_t tileIndex;
for(tileIndex = 0; tileIndex != tiling->size(); ++tileIndex)
    options[1] = tiling->getTileRangeAsString(tileIndex);
    //... run 3D content processing for this tile with these options

Combination of tiled result pieces

Tiled result pieces can be combined into one single large run-time world mesh, or they can be combined directly into local run-time 'mesh federation' tile meshes (in which case it is never necessary to represent the entire world in memory at one time).

Use iPathEngine::buildMeshFromGroundTiles() when you want to generate a single run-time ground mesh.
(The 3D content processing demo provides a worked example of this.)

Use the following methods (in Interface iMeshFederation) when you want to generate federation tile meshes:

Refer to this page, in the documentation for the mesh federation functionality, for more details about this second possibility.

Documentation for PathEngine release 6.03 - Copyright © 2002-2021 PathEnginenext: Performance Considerations