BSP Reader test

Date
Spring 2008
Tech
OpenGL, Win32, C++

After a few weeks of following OpenGL tutorials and getting as far as texturing and basic level geometry, I had a go at reading Quake BSP files.

BSP files are binary, so reading the data involves finding the file spec, determining what each byte in the file refers to, and using that to piece together the actual data we need. Being honest, I struggled, but most errors were down to not correctly understanding the different variable types at the time (such as short vs unsigned short, char vs unsigned char).

It only went as far as lines, faces, sectors, colours, and texture coordinates, but didn't get as far as loading and rendering the textures. The codebase is in a very early state of "New Reality Engine", so all I could dig out were a few surviving screenshots. An intention is to port this to WebGL at some point.

I had further success reading MD2 files (for the models) which also included animations and texturing.

Q3DM11 view from outside the level geometry.
Q3DM11 view from outside the level geometry.

Other screenshots

Looking down one of the corridors.
Looking down one of the corridors.
Very early shot, rendering using GL_LINES.
Very early shot, rendering using GL_LINES.

Back to projects