Tiled Terrain Manager

Recommended Posts


This is a template project, for PlayCanvas, that provides a complete tiled terrain system based on heightmaps and colormaps.


Example build:

Some of its features:
- Terrain generator from tiled heightmaps. The heightmaps and colormaps (splatmaps) have to be provided in a specific named notion. Included there are two sample terrain projects created with WorldMachine.
- Texture generator from tiled colormaps (splatmaps). The user can provide up to 4 textures and the shader mixes them on the terrain based on the channels of the colormap (R,G,B and Alpha).
- All methods included in the generators are run using an async loop, which splits them between the frames. This allows generation, rendering and texturing to be done during run-time creating only momentary pauses.
- A special collision mesh can be created if required with a smaller subdivision count than the rendered model for physics/collisions.
- Normals are fixed and re-calculated on border, during generation to avoid seams between the tiles.
- A visibility manager can be configured to render only a specific number of tiles based on the active camera. The tiles get visible/hidden based on the position of the camera on the terrain. If memory is managed correctly this allows for infinite terrain size/tiles.
- A sample actor is provided in the project (named Aj), with a simple 3rd person controller.
- A random terrain distribution script is provided based on distribution maps which can be painted per tile or per the complete terrain.

PlayCanvas has a batching API in the works which will allow combining multiple meshes to reduce draw calls, this will increase greatly performance especially when objects like flora are distributed on the terrain.

Current version is v1.15 and the project can be found here.

A tutorial on how to use this can be studied here.








Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.