News - terrain demo, large engine layout changes

December 21, 2009
Terrain from noise
Terrain from SRTM file
  1. There's a new demo in engine SVN sources: terrain (look inside kambi_vrml_game_engine/examples/vrml/terrain/ directory). It shows basic procedural terrain generation. Uses cosine interpolated noise, summed by Fractional Brownian Motion (which is a fancy way of saying "sum a few scaled noise functions" :) ).

    It can also load a terrain data from SRTM (.hgt files) (for example, sample files for Europe are here). And it can display a terrain defined by mathematical expression, like sin(x*10) * sin(y*10) (see KambiScript language reference for full syntax and functions available for math expressions).

    If you're interested in some background, this is the simplest introduction to "making noise" (although beware that it's actually not about Perlin noise :), Perlin noise is a "gradient noise", not covered there).

    I would like to extend this terrain demo to something much larger (infinite terrain rendering, render with normals, cover with a couple layers of textures, add water surface, maybe render with Precomputed Radiance Transfer (taken from my other demo) etc.). For now, it's a start :)

  2. Developers will note large changes in the layout of kambi_vrml_game_engine archive (and SVN directory).

    1. All "core" sources are moved to the src/ subdirectory, to keep them separate from other stuff (packages, doc, tests etc.).
    2. examples/ subdirectory was moved to the top. I should have done this a long time ago. If you want to look at VRML demos, now you just go to examples/vrml/ subdirectory, which is hopefully obvious to new developers. (Previously, you had to dig into cryptically-named
    3. Also, some subdirectory names changes, and some units moved around.
      • We have new subdirectory for glwindow specific stuff (since the distinction what is for GLWindow, and what is not, is important to many developers; e.g. if you always want to use Lazarus OpenGL control, then GLWindow isn't really useful for you).
      • We have new subdirectory for ui This contains now the navigator and GLMenu — both things were available already, but now are implemented as TUIControl descendants, handled in more uniform fashion. In the future, I want to extend this, to make more OpenGL controls this way. The very scene manager may be treated as such "control" one day.
      • I noticed that the most important directories of our engine had a little cryptic naming: 3dgraph, 3dmodels, After a little shuffling, the new names are 3d, vrml, vrml/opengl/ — this should make things much clearer.
    4. A minor thing is also that units Glw_Navigated, Glw_Win, Glw_Demo are gone, along with the one-unit package kambi_glwindow_navigated. I never liked these units, they were just handy shortcuts for simple demo programs. All normal programs should declare and explicitly create TGLWindow instance themselves, this is just 2 more lines of code but gives you better understanding what TGLWindow is and is more clean IMO.
    5. Also, new kambi_vrml_game_engine*.tar.gz archives will contain offline HTML docs by pasdoc (the same ones as available online).