In the last few months, I have been work with Python and PyQt a lot, so I thought why not do a personal project at home to improve my python skills and also learn some OpenGL. I started learning OpenGL and to make a Model Viewer was my realistic goal. This goal was to keep me on track and avoid getting lost in the huge world of OpenGL. I choose the following frame works:

  • Python 2.7
  • PyQt4 – for UI
  • PyOpenGl – OpenGL binding for python
  • FreeImage – for loading Images

Initially I used PIL for loading images in python, but quickly changed to FreeImage as PIL did not have support for loading DDS and HDR Images. FreeImage library was loaded using CTypes in python, which proved to be great for sending image file data to OpenGL. I had a small list of features to be implemented in the viewer and Marmoset Toolbag(link) has been a great inspiration for me during the development. The following features are partly/fully implemented:

  • Loading OBJ file format (WIP).
  • Simple Phong Shading with One Light support.
  • Diffuse, Normal, Specular and Illumination Map support.
  • Image Based Lighting with Vertical Cross Cubemap.
  • DOF, HDR and Bloom (WIP/Basic implementation).

[nggallery id=5]

Imrod model by Dmitriy Parkin(www.parkparkin.com)
Image Probes from Humus.name