grack.com

The Landscape engine was a project I had started to learn about writing real-time 3D games. I managed to get to a point where you could run around the landscape and fly around (like in Tribes), but not much further. I had trouble with my subdivision algorithm - I think I tried to make it too complicated.

This project was a great way to learn about how to write a game loop and event system. I hadn’t written something that didn’t involve menus and dialogs for so long that I had forgotten how to structure the program. It’s pretty straight-forward once you crack the mental block.

Changelog

September 30, 2000:

  • Texture mapping is now enabled.
  • The program is now building under both Win32 and Linux.
  • There are no fractal algorithms running right yet - just a regular grid.
  • I think this screenshot caught the window in mid redraw (you can see the line as it draws the landscape from a new perspective)

October 2, 2000:

  • Added fog through OpenGL.
  • Moved the source code to SDL, making it even easier to move back and forth between Win32 and Linux.
  • Rewrote the texture routines to use SDL_LoadBMP() rather than using a hacked one for Linux and the aux…() method for Win32
  • Fixed a bug where I had loaded all the textures with mode GL_CLAMP rather than GL_REPEAT. On an ATI card, this caused ugly black borders around every landscape tile.
  • Added the textured sky dome (which is surprisingly light on the 3D accelerator), using a Perlin noise algorithm. Looks good, but I really need to increase the texture size. The texture is generated while the program is run, not pregenerated and stored in an image file.

October 3, 2000:

  • Upped the resolution of the sky texture - looks a little better now. A few bugs on the side you can’t see though.
  • I’m going to try implementing dynamic LOD for the clouds - depending on the accelerator you have, you can pick a higher resolution/use a sky box instead/etc.

October 4, 2000:

  • More work on the sky texture - changed the shape of the dome and made the texture resolution comfigurable.
  • Added a screenshot of the new clouds and the Win32 version.

October 6, 2000:

  • Landscape is now fractal based.
  • Worked on distance-based culling a bit (very simplistic right now).
  • Two screenshots: one looking into a valley and the other up a hill.
  • Running everything at 800x600 - the FPS count has dropped a bit since I started rendering about four times as much detail in the landscape. Some work on distance-based LOD will fix that.

October 8, 2000:

  • New texture-mapped font console; I think the glBitmap() calls were crashing voodoo3 cards hard (when in fullscreen mode). The framerate suffered heavily with them as well. Need to work on blending the font into the framebuffer, rather than drawing it with a black background.
  • Voodoo3 people are reporting that the hardware-accelerated fogging doesn’t work. Perhaps the card doesn’t support GL_LINEAR as a fog mode?
  • Added player physics! You can now run around the landscape, jump and jetpack. Since I can’t really take a motion capture of this, the second screenshot shows the landing event.

October 12, 2000:

  • Added basic sound support to the engine using the QSound QMDX library. It still doesn’t work perfectly yet, but I’m not sure if this will be my final choice for sound under Windows, so I haven’t put much effort into fixing it.
  • Going to start on the dynamic LOD soon.

October 22, 2000:

  • Implemented dynamic LOD for the terrain. Closer polygons are now subdivided more than future ones.
  • Increased both the range of sight and FPS rate

Read full post