fluffyfreak / pioneer

space simulation adventure game
http://pioneerspacesim.net/
3 stars 0 forks source link

Flow from CPU to GPU terrain gen #23

Open fluffyfreak opened 11 years ago

fluffyfreak commented 11 years ago

Had dreams about the Pioneer code actually. Kind of have a plan for tackling conversion to GPU based terrain. Odd that I already sort of have that working but cannot integrate it back into Pioneer :/ (https://github.com/fluffyfreak/pioneer/compare/seeNoEvil_00) that branch is a world of hurt.

Plan as it formed in dreamy dreamy lalaland:

  1. thread terrain generation with jobs,
  2. switch heightmapped planets (Earth/Moon/Mars) to use colour maps,
  3. preprocess all heightmapped planets maps into cubemaps/per-face-maps,
  4. make all planets render highest level noise into per-face-heightmap,
  5. unify/simplify terrain gen to all use above high-level heightmap,
  6. switch to generating per-patch heightmaps,
  7. using heightmap offset in vertex shader instead of generating vertices,
  8. use texture splatting (/other) for terrain instead of vertex colour,
  9. ???
  10. Profit!

By step #8 there's nothing to stop me replacing where the heightmap is generated, CPU or GPU. #8 is also at least an immediate 50% speedup since using the noise system for that is horrific. New patch data can come from anywhere off the back of any request since #1 moved that out into a generic "job" system. The rest is a mix of little bits of work and dealing with legacy crap.

fluffyfreak commented 8 years ago

SoA have a nice writeup of their terrain generation system online.