After some time looking or it on the internet I can't find the proper answer to my concern.

I'm currently generating 3D textures on a shader for my planets to avoid sphere mapping issues (pole, distortion, ...).

It works great however I'm limited due to algorithm complexity so I'd like to generate my 3D textures on the CPU side. However a fully furnished 3D texture is heavy like crazy (3 dimension remember) so I'd want to store a 3D result in a 2D texture.

I need to find the correct transformation from 3D coordinates to 2D storage. Anyone have a clever thought ?

Edit : not looking for Sphere cube Map, Octohedron or similar, several texture (like in EveOnline).

I'm looking for something that you have in 3D modelers where you can unwrap a sphere on a flat surface (not regularly).

Typically the picture on the bottom:

With a function vec2 map(vec3) which can map a 3D texture and retrieve the correct value on the sphere surface.

  • \$\begingroup\$ I would store it in a cube map. \$\endgroup\$ – msell Jan 13 '14 at 17:31
  • \$\begingroup\$ Well this is in fact a common solution \$\endgroup\$ – StackHola Jan 13 '14 at 17:37
  • \$\begingroup\$ I edited to add what I'm not looking for \$\endgroup\$ – StackHola Jan 13 '14 at 19:00
  • 2
    \$\begingroup\$ Why aren't you looking for those solutions? That's just as important; if you (apparently pointlessly) narrow the set of "acceptable" solutions without explaining why, you can easily render your question unanswerable except with "it's impossible since you have dismissed all the available options." \$\endgroup\$ – user1430 Jan 13 '14 at 19:06
  • 1
    \$\begingroup\$ Even after your edit cube map satisfies all your requirements and is supported by the graphics hardware. Also there is no such thing as a perfect or the most accurate solution for this problem. Different solutions have different pros and cons and introduce different distortion. \$\endgroup\$ – msell Jan 14 '14 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.