This tool can be used to view the space backgrounds from the game Homeworld 2.
What makes backgrounds these special from a technical viewpoint is that they are not background or cubemap textures but tesselated spheres with vertex colors. The geometry is more finely tesselated in places where more precision is needed in the image.
For further information on the way that the Homeworld 2 backgrounds work please refer to these Simon Schreibt articles:
The following dependencies are needed to run the program:
- Python 3.x
- PyOpenGL (apt install python3-opengl)
- numpy (apt install python3-numpy)
Alternatively, Python 2 should still be compatible. The following dependencies are neccessary:
- Python 2.7+
- PyOpenGL (apt-get install python-opengl)
- numpy (apt install python-numpy)
Launch the program with:
python2 ./visualize.py background/m01.hod
Launch the program from the command line with the name of the background to display,
Drag with the left mouse button pressed to rotate the view.
Press 'w' to toggle wireframe mode.
Extracting the data files
The data files in
background/* are part of the original game and cannot be distributed with
Extracting the .hod files can be done in the following way:
Install homeworld 2 from the CD
Apply patch to 1.1 (not sure this is needed)
Extract background/ from homeworld2.big The big file format is described in
doc/big_file_format.htmlin this repository. I used the
UnfBIGtool for this (can be found here ) You just need to extract the files, no deobfuscation of the lua files is needed.
.hodfiles that have associated
_light.hodvariants contain the position of the lights and are not needed at this point.
These are the following:
background/black.hod background/m01.hod background/m02.hod background/m03.hod background/m04.hod background/m05.hod background/m06.hod background/m07.hod background/m08.hod background/m09.hod background/m10.hod background/m11.hod background/m12.hod background/m13.hod background/m14.hod background/m15.hod background/white.hod
The hod files in other directories space ship models and such. These can not currently be viewed with this tool as the vertex format is different.