I thought I would also start writing about what I'm currently doing on the project. Hopefully I can keep the updates coming steadily and not as technical as this one.
Here we go:
just had a pretty long discussion with guyver6 on how to fix the artifacts and seams on the globe when using the bumpmapping. We think we found a solution, it will require some modification to the icosahedron-tool so we haven't tried it yet.
Here's why it looks messed up and you get artifacts in the non-technical explanation:
Basicly, the problem is that the in order to evenly apply the texture to the globe, the icosahedron mapping mirrors parts of it in the texture images and mirrors it back when applying the texture. This works well for the usual earth texture but not for the normal map. In short, the normals get messed up and you can see this when a mirrored and a non-mirrored texture meet (the seams).
For those more into graphics programming who want to get all the details, here it is (this section is not a must read, so if you get bored or don't understand a word of this geek-talk, just skip it )
As already stated, the icosahedron-mapping assigns some more or less weird uv-coordinates to the vertices in order to apply the texture evenly across the globe. The texture-image is being streched, rotated and mirrored so that it works with those coordinates.
The bumpmapping in the shaders works by transforming all lighting parameters into tangent-space and then using the normal from the normalmap together with the transformed parameters to produce the lighting result (the normal already being in surface-local or tangent-space).
Tangent space is constructed from the vertex normals and tangents. The tangents get calculated by Ogre from the uv-coordinates of the vertices.
The following problem arises now: The tangent space is calculated from the icosahedron-mapping coordinates and the shader assumes that the normals from the normalmap are also in this space. But as those normals have been created for a spherical mapping, they are in tangent-space for a sphere (or also a plane pointing straight up).
So, what we are now trying to do is create a proper tangent for spherical mapping together with the uv's for icosahedron-mapping in the icosahedron preprocessor.
Edited by rincewind, 07 January 2005 - 01:08 PM.