I'm creating dynamic textures for planets. This is working pretty good, however there is one problem.
As everybody who already textured a sphere knows: With a normal rectangular texture the sphere shows a large distortion at the poles.
In a manual process, the texture could be fixed in photoshop, but this is not possible for calculated textures. I've tried to write the algorithm that Photoshop uses in their Polar Coordinates filter. There are various of sources for this in the net moving pixel by pixel. The issue here was that the algorithm was way to slow and took several seconds for a 4K texture.
Photoshop can apply the filter almost immediately.
I've also experimented with other geometry like a Geosphere or a Quadsphere. The Geosphere has similar issues with the poles as the normal sphere and the Quadsphere shows nasty seams.
Has anyone experience with procedural sphere texturing and can point me to the right direction?
Replies
http://gamedevelopment.tutsplus.com/articles/use-tri-planar-texture-mapping-for-better-terrain--gamedev-13821
That could work, I'll have to test it, but I don't think that the performance would be a problem in my case. I'll report back here once I tested it.
http://www.martinpalko.com/Tutorials/TriplanarMapping/TriplanarMapping.html
I've used the shader from here and modified it a little bit to fit my needs:
http://www.blog.radiator.debacle.us/2013/02/a-smoother-triplanar-shader-for-unity.html
And if somebody has a use for it, here is my complete shader in Unity:
It's a bit nasty and I don't know the performance but the result is very good for me. Please note that the normal mapping is not working at the poles. I couldn't manage to get that working.