Apps Code Links Gallery  

Normal Mapper

This little app generates normal maps from heightmaps (well, any image really).

I wrote this app to demo my convolution code. It produces output comparable to the nvidia photoshop plugin and the gimp plugin, at comparable speeds. There's still a lot of room for optimisation, but it seems fast enough.

I used wxPython to do the gui, binding my C++ image processing code to Python using boost.python. DevIL is used for file IO. OpenGL is used for the lighting preview - a GLSL compatible video card / driver combination is required.

It uses the Sobel operator to calculate per-pixel horizontal and vertical 2d gradients, which are used to create a 3d normal vector. The block of memory the image is in is traversed using my interleaved array iterator, allowing me to use the same code to generate floating point normals (e.g. for a terrain mesh) or unsigned char (with sign encoded) normals for normal maps.


Download Windows Installer (5.3 megabytes) version history:
  • 0.6 fixed start menu shortcut
  • 0.5 initial release