For the last year I've been building my own engine to research into the new
effects used in the next generation games, i.e. Doom3. One effect I was
interested in was bump-mapping. I decided to give a shot at trying to
reproduce the way that Doom3 calculated it's normal maps from high detailed
models, to then be placed on a much lower resolution model.
My method uses the Object-Orientated normal map approach. Like most
bump-mapping techniques, this approach requires a unique triangle on the
normal map per face, so reusing the UV mapping from any texture mapping
would not always work. So what I needed was to create a separate normal UV
mapping for the model. The normal UV mapping could be created by hand in a
modelling program such as 3DS Max, but I liked the idea of writing an
Unwrapper, so here it is.
Unlike most unwrappers that already exist; the unwrapper does not try to
keep faces that are neighbours on the model as neighbours on the UV map.
Why? Because there's no need to. The UV mapping would only be used
internally, with no need for any human to try and understand which triangle
relates to which face.
So the result is this UV-unwrapper. The method of unwrapping is quite a
complicated one, but is basically an ever growing polygon, which uses a
horrendously complicated edge matching function to find where to place the
next triangle. The white lines you see are the edge of this polygon. By
placing the largest triangles first, any gaps formed in the polygon are
usually pretty well filled by smaller triangles later on, meaning quite an
efficient normal map.
The model in this picture was around 800 polygons, and took about 2 minutes
to unwrap. I feel there is more optimisation to follow!
Thanks for reading.