Saturday, November 5, 2016

Nigthfall

Night fell, midnight rolled passed, and once more I find myself bedward bound with no book review. Saturday sounds more promising.  I did make a bit of progress with the program.  The geometric seam problem at page borders has been resolved (bug), though there's still a visible seam in terms of the color/texture at the borders, because the normal calculations there are wrong (another bug).  I'll have to handle that (literal) edge case later.  I finished some code so that the trees are back again.

Geometry matches up now, but bad normals at the edge negatively impact the texture.

I tried out three algorithms from a chapter by F. Kenton Musgrave.  His warped fBm, hybrid multifractal, and ridged multifractal all produced interesting results.  Also, I ported Ian Parberry's exponential noise algorithm from his article in the Journal of Computer Graphics Techniques; the source code to accompany the article is on GitHub.

An example terrain created using the hybrid multifractal algorithm

All these algorithms work fairly well to produce terrain ranging from gently rolling to outright mountainous, but few produce more than one such result given the same set of parameters.  That is, the terrain generated with them may be almost flat, gently rolling, hilly, or mountainous, but it will not be gently rolling and mountain.  The main exception is heterogeneous fBm (hfBm), which produces flat and mountainous though not much in between.  Exponential noise is a little different, as well, but doesn't seem to produce major mountains.

Maybe tomorrow I'll experiment with combining Parberry's exponential noise and hfBm.  Or maybe I'll take a look at instanced drawing.  As it is, I can't add more than around fifteen thousand trees without frame rate seriously dropping.  Hopefully instanced drawing will speed things up.  Or maybe something else entirely.

No comments:

Post a Comment