Silentor / InfluenceTerrainDemo

Some experiments with zone-based terrain generation
4 stars 2 forks source link

Once more try to generate Blockmap+Heightmap directly #100

Closed Silentor closed 5 years ago

Silentor commented 5 years ago

It looks like I don't need Block height to generate and store, because simulation mostly use a vertex mesh. So I can skip GenerateHeightmap step in Micromap and generate heightmap directly with the blocks. But it means two iterations on zone area :(

Originally posted by @Silentor in https://github.com/Silentor/InfluenceTerrainDemo/issues/97#issuecomment-475443545

Silentor commented 5 years ago

I need copy snapped heightmap for map objects, because original heightmap is corrupted by snapping

Silentor commented 5 years ago

There are two main ways to generate Map Objects: list of blocks/heights and grid of blocks/heights. 1) List is compact and works really good when block contains own height. But now heights stored in separate heightmap, so I need heightmap grid for fast heights access by block position. 2) Grid is not memory-friendly for some objects and code part for avoid double height vertex generation for adjacent blocks is not good. But grid is handy for random position-based access.

I need to invent some nice API for map object generators to generate objects

Silentor commented 5 years ago

Ok, Main map generator and map object generator both rewrited to support Heightmap+Blockmap generation logic. Blocks do not hold theirs heights now. Block height - simply average of neighbors height vertices.