Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 1.45 KB

README.md

File metadata and controls

13 lines (8 loc) · 1.45 KB

Endless Voxel Terrain Example

This is a small example illustrating the basics of an endless terrain generation in the Xenko Game Engine. It has been made as concise as possible, to transport the basic idea.

It is based on the ThirdPerson template. It has mainly two parts: The visible voxel management in the WorldGenerator class and the terrain generation in the TerrainGenerator class.

Especially the terrain generation is nothing more than a simple placeholder for an adequate logic. But it illustrates the concept of a generator function, which returns a height for a given space in the voxel grid. Here it is a mixture of overlapping sine and cosine waves with different wavelengths and amplitudes.

Its output is used in the WorldGenerator component. It tracks the player's position and inserts and removes single voxels, so that they are only displayed, when they are in a square zone around the player.

Feel free to experiment with the code and have fun with it! :)