Creating Globe / Earth in Unreal Engine

New to Unreal Engine - trying to see what’s the easiest way to create a Globe view in Unreal Engine (and make markings of locations on the Globe based on Latitude / Longitude information).

Appreciate any help / directions on this.

Forget lon/lat and make the markings on a texture.

Really it all.mostly depends on the resolution and what the map needs to do.
if you are after something like what most of us did for the last game jam, it’s rather simple.
get the globe night/day images from NASA along with the matching heightmap,
turn the heightmap into a normal map, and that’s basically it.
you won’t need geometry if the whole globe is visible.

If you are after something like google earth, where you can expand the map, not so much.

Thanks MostHost LA.

I won’t be needing google earth features - just the globe where I can point some locations as pins (and color them red / yellow / green based on some calculations that depend on elevation and distance from particular location or boundary).

will below suffice for the image you were mentioning?

Can you please provide some details on how can this can be turned into what I was looking for above?

Because I can’t find the same link, I’ll just share with you the images used for the project here

Please update this topic to let me know when you have them downloaded, so I can remove them from the server.

You can probably find the original Nasa files by converting the TGA to jpg and searching for the image with a reverse image search.

Thanks - I’ve downloaded them.

Can you please provide steps to use these on what I’m looking for (Globe / Flat Earth view with some locations pinned)

Make a sphere in any 3d app and unwrap it to the size of the image (note it’s not power of 2, so you have to take care of that with the unwrap).
Edit the images to have them in a power of 2 (so they can mip later) - copy the texture to the area you unwrapped.

Test the image in the 3d app by applying it in the material - better safe then sorry sort of thing, it will let you know if the UVs are flipped or whatever else.

Export the sphere to FBX, and import to UE4.

Create the material shader for it within the editor.

At a base level - UV > Panner on X only with a scalar to control it - texture > output of base color.

Repeat for the grayscale ones which is actually an elevation map. You can convert it to a normal map beforehand in photoshop. It may in fact be better - however - if you just multiply 0,0,1 (blue) by one of the channels, you should get a good enough result for the normal map to work.

That’s that. At a base level you’ll have the round sphere masked to look like the globe.

For the marking of places, just make an overlaying texture in photoshop, export it in the same format, and overlay it by adding it to the base material.
Make sure you mask it properly/export with the right alpha.

That’s basically all.

I’m working on above - but me being new, it’s taking little time.

Meanwhile, trying to make a prototype on what it’s going to look like - took a basic Sphere StaticMeshActor and applied the T_D_Earth as Textured Material and added the RotatingMovement component to make it look like rotating globe.

  • It looks fine, except that the texture is not scaled properly on the sphere (ex: North America & Europe are looking very small, and there is lot of blue/water on the other side of the sphere). Is there a way to correct this?
  • And, If I’ve to add pins or show some kind of heat map (Color code parts of U.S states to Red) - how can this be achieved?

For the FlatView - tried adding this texture material to a plane, it’s not working (the image is atleast mirrored). What should I change to make it correct view and add pins on this ?

How the texture is applied is dependent on the UV map. If you want it to be applied differently, you’ll need to do some funky material black magickry, or much more easily, create a sphere with a different UV map.

Actually, that might be more accurate than you think.

I’m fairly (90%) certain that the file is fine as it is and will display correctly even on an engine made sphere.

what you should note is that the file resolution is not a power of 2 square.

For mips to work correctly you need to edit the image and make it a square.

For the subsequent stuff/material to work with the square file you will need to set up the UVs to match the area of the map.

The reason it currently should be accurate is that the UV is taking in the full size of the image without the dead space you would get from having a squared texture.

there probably is some amount of lateral stretching on it too.

For the rotations use the material panner node instead of a rotator.

the idea is that you can keep the “sun” constant like a spotlight, and automatically get the Night/Day effect at less of an overall cost then rotating the object (it can be static baked that way without issues, which is practically how I managed to get 60fps on android within the homescreen).

For the pins and all of that.
just export to photoshop. Make a layer with the pins in it.
Save it as TGA with alpha transparency import it back in engine, and ADD the RGB channels of the 2 textures.

0+0 is 0, so the areas without pins writing or whatever else, won’t be added to the material.

And last bust not least. What do you mean by “flat view” exaclty?