Skip to content

Terrain experiments

Notifications You must be signed in to change notification settings

valkum/terrain_tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amethyst_terrain

What is this?

This is an experimental render pass for terrains in Amethyst using Cardinal Neighbor Quadtrees and tesselation for Level-of-Detail.

Example Image

Principles

A terrain heightmap is split based on the distance to the viewer using Cardinal Neighbor Quadtrees. Each leaf is tesselated in regards to its neighbor to avoid T-Junctions.

After that, a basic quad mesh is drawn using instanced attributes for each leaf.

Future

Tries to have comparable performance to major engine solutions. The first step is Unreal and Unity final step would be FarCry5's engine e.g.

Some specific targets are:

  • Asset streaming and thus splitting of the terrain assets (heightmap, etc.) into tiles for each leaf
  • Decals
  • Support in amethyst-atelier and the editor
  • Fallback for lower spec systems without tesselation support

Limitations

This approach uses tesselation and geometry shaders and thus does currently not support Metal or older OpenGL versions

What's in here

  • A cnquadtree crate implementing the algorithm from Safwan W. Qasem and Ameur A.
  • The render pass for Amethyst in the crate amethyst_terrain
  • A simple demonstration crate implementing a game with a simple terrain created with Gaea

Inspiration

This approach was inspired by