Search Unity

Earth in the background of my 2D mobile game

Discussion in 'General Graphics' started by Skullek, Nov 23, 2019.

  1. Skullek

    Skullek

    Joined:
    Mar 16, 2018
    Posts:
    22
    Hi,

    I've got really big problem and I need your help guys. I need to make 'space / earth' background for my 2D mobile game.

    Earth needs to spin around, just like clouds but with different speed. There should be stars in the background and earth should glow just a little bit. That's the main concept but...
    Complete one level should take 5-10 min. and then we have another background - more/less zoom, different continent etc. After the player does something significant , the camera sometimes moves away or zooms in.
    but I need constant 60 fps too... How can I achieve that?

    I've got some .psd with earth but it's in FHD resolution and when I add it to the game it looks really bad. The quality get worse, the colors change (I turned off compression and set correct max size) and when it zooms in it looks even worse. When I zoom out I see image borders because it's to small.
    How should I approach this?

    1. Use the sphere with applied cloud and earth textures. But how big the textures are needed to be to be able to zoom in and out freely.
    2. Use multi-layered 2D flat images, but how do I get rotating the earth then?
    3. ???

    If you have any ideas or solutions please send links.

    Example earth from my .psd






    The same image in the game + player.


    Camera is following the player but the background should move just a little bit when player is moving so the player could see more stars, less earth.
     
  2. GuitarBro

    GuitarBro

    Joined:
    Oct 9, 2014
    Posts:
    180
    You'll definitely want to go with #1. You really do want a 3D earth that just looks stylized to fit a 2D game.

    For the texture size, there's technically no way to answer that without more constraints. However, in practice, I would suggest you don't go above 2048x2048 just from a RAM usage standpoint. Even that is probably overkill if you're smart about it.

    Ideally, you'd create a custom shader for your sphere that has a couple of textures, one for the base earth, perhaps two for clouds (to minimize tiling artifacts), and maybe one for emission if you want to simulate city lights on the dark side. There are a bunch of tricks you could use to make the clouds look better such as warping/animating the UVs if you want get away with even lower resolution textures.