cannontwo / cannon

Lifetime repository
https://cannontwo.com/cannon/
MIT License
0 stars 0 forks source link

Implement Terrain Geometry and Manipulation #54

Open cannontwo opened 3 years ago

cannontwo commented 3 years ago

Really just an editable triangulated plane, perhaps with initialization from some sort of planar noise.

Various 3D brushes are common, and can be seen as manipulating an array of vertices. See https://docs.unity3d.com/2019.3/Documentation/Manual/terrain-Tools.html for inspiration.

Basic version would use a hardcoded terrain resolution, but the fancy way to implement this would be to use a KDTree and dynamically generate new vertices based on the resolution necessary to make local changes using the brushes implemented. With a smoothness assumption, this can be done in a relatively principled way using a maximum allowable height differential between adjacent vertices and adding new vertices when it is violated.

cannontwo commented 3 years ago

The implementation of actual terrain editing implies mouse interaction with the 3D scene, which is not yet implemented. This will likely spawn a new issue.

cannontwo commented 3 years ago

Shading terrain should be done with a tri-planar shader. See

cannontwo commented 3 years ago

A more complex version of this is described here: https://www.decarpentier.nl/?s=scape