Baking a sphere map problem

Using sphere maps for my game engine I had the idea that I could misuse Blender to render those sphere maps for me. I’m using the simple Mercator system. I made a small script to obtain a proper unwrap of the sphere ( since Blender fails at unwrapping the sphere correctly ). I then set up a test scene around the sphere and used texture baking with full rendering. In principal this works but there is a nasty problem and this is that Blender messes up a couple of pixels along the road.

Image showing what happens ( LARGE ! )

Anybody knows a way to reduce this baking errors in Blender?

Or would it be possible to render the scene using a camera and using nodes or scripts to calculate the ray-direction for each image point ( to implement a sort of sphere-renderer )?

Any other ideas how such a thing could work? Using a mirror or something else?

First of all… d you really need so many faces? especially since you said this is going into a game engine, presumably as a skysphere… I’d try cutting out those edgeloops and triming at least half of those faces out of there as the user will never be close enough to see and abnormalites on them. This will simplify your bake work and might just fix the abnormality wthout any further messing needed.

It is required since I use an shader calculating the sky pixel-precise ( nullifying all the rendering artifacts existing sphere mapping techniques do have ). The high tessellation simply reduces the error. I though found out what the problem is. The ocean below I faked using a large plane bent in the middle and subdived two times. I added a SubSurf modifier and set it 3 or 4 and this additional tessellation of the bent plane mesh made the artifacts vanish. The poles suck ( blender is unable to bake those triangles correctly ) but those can be fixed with a paint app.