3
\$\begingroup\$

I'm making a 4x space game. I have a procedurally generated galaxy with planets in 3D space. The view is above the planet plane at -45 dec y-up i.e 45 deg isometric. I procedurally generate the planet surfaces on a hex grid which can be viewed 2D / 2.5D when clicking on the planets, ala GalCiv etc by placing meshes for mountains, seas, forest and so on on the hex grid.

For realism, I'd like the textures of the planets when viewed from space to (at least roughly) mirror the view you get in the surface view. I'm struggling to think how this might be achieved in Unity.

I figure I could create a render texture after generating the planet's surface and store it on the users HD. This has a few problems though - taking up HD space and not mapping well to a sphere (unless I always make the poles a uniform colour, which doesn't look good as the rest of the surface is quite highly detailed).

Another idea would be to create many generic textures for the space view of roughly each type of planet generated (blue / green / large continent / archipelago etc) and select a texture which most closely fits the procedurally generated map at run time. As long as the same texture isn't used for planets close to each other and the user doesn't compare the 3D view with the 2D view to closely then hopefully they won't notice!

So, any other ideas of how this might be achieved? I'm not looking for code, just a brainstorm of how I might get a procedural 2D map to be represented on a 3D sphere, or at least create a convincing illusion.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Can you include an example of what your planet surfaces look like in your hex grid form? This might help inspire some solutions. \$\endgroup\$
    – DMGregory
    Jan 5, 2018 at 22:54

1 Answer 1

1
\$\begingroup\$

If you are content to not allow full 3D motion around the planet (ie, fly a ship around the planet to arbitrary locations), you might take the approach outlined in this post I did a long time ago...

3D Illusion of a 2D Planet Texture

It creates somewhat the illusion of 3D from a 2D map texture and works fairly well if your camera view is at the equator. If you want to be able to actually fly around the planet it's not so useful. You could simulate orbiting around the equator of the planet pretty well, but not pole to pole.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks, I should have mentioned the view is -45 deg y-up isometric. I'll update the post. Maybe though I could billboard the planet sphere to the camera.... \$\endgroup\$
    – user87997
    Jan 5, 2018 at 22:10
  • 1
    \$\begingroup\$ @Absinthe I'll also point out DMGregory's answer from a while back. It's side-on as well, but has some different approaches and animated comparisons. \$\endgroup\$ Jul 5, 2018 at 15:01

You must log in to answer this question.