Skip to content
Lucas Damian Johnson edited this page May 30, 2022 · 4 revisions

In this wiki, each specific step of the workflow will be covered.

Here is a high-level overview of how to use the engine:

  1. Make sure Babylon.Js is loaded on the page or imported.
  2. Import and initialize all the needed classes for each context.
  3. Register any custom voxel shapes.
  4. Register textures and animations.
  5. Create and register voxels.
  6. Populate the world's data with chunks that contain arrays of voxel data.
  7. Request chunks to be built or removed.

How does it work?

Assuming a world that has data already the basic steps for rendering the world is as follows:

  1. Chunk is requested to be built.
  2. The ChunkProcessor goes through the voxel data for the chunk.
  3. It checks to see if the voxel is exposed and if it is it will add it to a template.
  4. It builds a chunk template for each voxel substance type.
  5. It then sends the template data to the mesh builder threads.
  6. The mesh builder threads interpret the data to build the actual mesh data.
  7. The mesh data is transferred to the main thread and then used to create or update a mesh.

All the data that is transferred between threads are typed arrays of numbers. They are all transferable objects. This is to avoid serialization and de-serialization caused by the Worker API.

Clone this wiki locally