-
Notifications
You must be signed in to change notification settings - Fork 23
General Overview
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:
- Make sure Babylon.Js is loaded on the page or imported.
- Import and initialize all the needed classes for each context.
- Register any custom voxel shapes.
- Register textures and animations.
- Create and register voxels.
- Populate the world's data with chunks that contain arrays of voxel data.
- Request chunks to be built or removed.
Assuming a world that has data already the basic steps for rendering the world is as follows:
- Chunk is requested to be built.
- The ChunkProcessor goes through the voxel data for the chunk.
- It checks to see if the voxel is exposed and if it is it will add it to a template.
- It builds a chunk template for each voxel substance type.
- It then sends the template data to the mesh builder threads.
- The mesh builder threads interpret the data to build the actual mesh data.
- 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.