About/Marking Guide | News | Screenshots | Final Report
The assessment is over, however I took a break from exam study to work on some new functionality: Water reflections. Works very well, however has a large impact on framerate (mainly from rendering the terrain twice).
To compensate, I've started work on Level of Detail mapping, and currently can render any terrain map at half detail (quarter/eigth/etc detail should also work). Plan to use a grid of terrain maps and have LoD based on distance of map centre from the camera.
Also added back in some old smoothing code for terrain loading. This helps
quite a bit, as the bitmaps are only 256 levels of grayscale, so tend to
look a bit stair-stepped/jagged. May look into higher BPP for terrain
height maps.
![]()
This will mostly likely be the final update before submission. Finally
completed uniform grid implementation (using line rasterisation). Improved
cockpit and weapons, added ammunition limit for secondary fire (Mass
Driver) and heat monitoring for primary (LASER). Created a few more
buildings, added a proper building layout. Many other misc.
additions/fixes.
![]()
Fixed font rendering, updated HUD and changed some terrain rendering
somewhat. Added a death sequence.
![]()
Implemented per-voxel collision detection for buildings. Optimised terrain collision checking with uniform grid (still in development). Added cheap cockpit and improved crosshair. Changed missile effects (they now look like Star Wars style lasers).
Unfortunately, the strange artifacts with text rendering have returned.
I believe it's caused by the use of point attenuation. Plan to implement
texture mapping for cockpit and terrain, however I probably will not have
time.
![]()
Finally fixed the building loading functions, so now all of the map data is loaded from disk. Users can make their own buildings, terrain maps and building layouts. Voxel attenuation needs a bit of work, I may have inadvertantly altered in all the code changes over the last month.
Need to implement collision detection for buildings, and
optimisations for the terrain collision checking (Most likely a 2D uniform
grid, due to the dynamic nature of the terrain height).
![]()
Implemented a cheap pausing functionality, so I could take these
screenshots:
![]()
Been a while since the last update. Haven't had much time to work on the project recently, but I've made plenty of modifications. The player controls are now akin to a primitive flight sim, and the player can fire missiles. Per-polygon collision detection is implemented, and missiles explode on impact with terrain. Building collision detection is to come. It's difficult to show these changes in a screenshot, as the 'Pause' button doesn't currently pause all the aspects of the world. I'll try to implement that next, and have some screenshots up here in the next week.
Fairly large update. Mouselook and camera movement implemented. Most of the data now loaded from files, no longer requires recompilation. Premliminary work done on loading voxel buildings from file (not currently functional). Sun now revolves around the world, fog is rendered under the water. Not only is the terrain lighting based on sun position, but the sky colour and other areas change as the sun moves.
Code has been cleaned up a lot, many hard coded effects have been made
dynamic. Once I have voxel file loading and user controlled explosions in
place, I'll probably aim for more performance improvements: Terrain LOD
and culling (possibly using horizons).
![]()
Slight update. I'm now precalculating the lighting for the buildings (as
they aren't lit properly by OpenGL's lighting model), and I've added some
simple details. This screenshot also uses a slightly higher voxel
resolution. Will need to tweak against resultant frame rate.
![]()
Fixed the attenuation issue, it seems the way I was setting up my camera
position was messing with the distance calculations OpenGL was
performing. Anyhow, the buildings are very primitive for now, but basic
destruction is working. Yes, they are green. That will change.
![]()
Added voxel based buildings and implemented destructability. Unfortunately, renderding cubes for each voxel is far too costly (at least on my machine), so I've decided to use hardware accelerated point sprites. However it seems that point sprite attenuation is reversed (i.e. sprites that are further away get larger instead of smaller), at least with my ATI Radeon under linux. Will have to test under a different environment to determine the cause.
Implemented height map loading from BMP files. Reworked seabed
rendering.
Minor update: Altered terrain generation to use spherical base,
implemented pseudo-fog effects for surrounding sea and added a quick 'sun'
to the world. Fiddling with colour schemes.
Converted the rendering engine to use vertex arrays and triangle strips.
This gave a massive performance boost overall and reduced the FPS drops,
as I no longer need to recreate the display list every time the terrain is
deformed. As such, I've been able to increase the ground resolution
without much performance loss. The screenshot shows a 200x200 grid
terrain, as opposed to the 100x100 seen in the previous screenshot.
Mainly graphical tweaks this week, no major alerations to the algorithms.
Development stifled slightly by other projects/assignments that were
due this week.
Did some more work on terrain deformation, mainly to allow smooth shading. Unfortunately this means recalculating vertex normals every time the geometry changes. I've used booleans to tell me which vertices need to be updated, to minimise framerate impact.
In order to speed up rendering I've used display lists. However, these
also need updating whenever the environment changes, and that's a fairly
costly exercise. I've managed to get around 100 FPS constantly with a fair
high resolution terrain map (obviously needs further optimisation),
but this drops drastically for a frame or three when geometry is deformed,
mainly due to display list updating. Will look into alternate
optimisations.
Just a quick update. Now have some preliminary terrain deformation. The scene starts completely flat, and random explosions start occuring at ground level. These soon turn into mid-air explosions, as there isn't any collision detection as of yet. The alpha blended red sphere you can see on the right is part of some basic explosion effects I've been toying with. I've added a sea level threshold, and thanks to vertex shading it blends it well with the surrounding ground.
Needless to say, very little progress on the CSG side of things so
far.
Lots more work. Completely reworked the code into OOP style, using operator overloading for vectors to simplify writing algorithms. Did some research into Constructive Solid Geometry (CSG), and plan to use subtraction modelling for destructible buildings. Terrain destruction will be done with simple height maps, or perhaps by destorting the mesh (vector based: pushing vertices away from explosion). Will investigate both methods soon.
I've implemented box-based intersection checking as a precursor to CSG work, however my main hitch has been working out an algorithm for bisecting polygons that overlap between the target building and the explosion model. So far, doesn't look too promising. If CSG proves too difficult, I'll at least get Voxel-style building destruction happening. (Using polygonal cubes, if 'true' voxels prove to be too taxing)
Did some work on the project over the last few days. Implemented some initial design ideas and basic data structures. Started looking into terrain mapping and octrees. (Will not bother with terrain generation for now, as the 'city' will be located on a plain for simplicities sake.)
I have an idea of how to deform complex structures arbitrarily, hopefully will test this within the next week.