Archive for the ‘fog’ tag
Nothing technically astounding to report: only some regular progress.
I’ve been moving away from OGRE and towards coding my own OpenGL-based renderer. Why? Because I realized that, as much as I want LxEngine to utilize the work of others and avoid reinventing the wheel, this is also currently a hobby project and, bottom-line, I enjoy writing custom graphics code.
That out of the way, I’ve been very interested in terrain lately. Between the Lithosphere demo (see earlier blog entry) and unfortunately downloading and instantly getting a minor addiction to Minecraft, I’m fascinated by what a procedural terrain engine theoretically could do.
Step 1: Height maps. These seem to have a nice balance between simplicity (e.g. path-finding and collision detection) and capacity to display something interesting. Here’s a heightmap generated from a sin + cos wave with a checker pattern and fake diffuse lighting:
Video was probably overkill for such a simple example, but I thought I’d use this as an excuse to try out CamStudio (a free, open source screen recording app). Pretty simple to use. I recommend it.
A bit more work and some head-scratching to really understand Perlin noise, and the result is this heightmap:
Thanks to these pages for the information on Perlin noise:
- Malcolm Kesson’s page on Improved Perlin noise
- NVidia’s GPU Gems Chapter 5 (authored by Ken Perlin)
- Ken Perlin’s slides on Noise Machine
Perlin Noise And Turbulence by Paul Bourke
Added automatic generation of additional tiles and a cheap GLSL fog effect: