Create a orbiter lunar scenario with real lunar dtm

Hello everybody!
I am approaching the use of Unreal because I should create a lunar scenario starting from the actual digital terrain models of the moon, including lunar material and realistic lighting. The idea is to obtain realistic orbital images of the lunar surface to be used in another environment (Matlab) to implement visual navigation algorithms. So I would like some advice on how to set up the work both for the insertion of customized digital terrain models, and for the insertion of the orbiter on a particular orbital trajectory that looks at the moon at a certain point ( it would be enough to insert a camera that follows a certain trajectory). Thank you so much! : )

How much, proportionally, of the moon’s surface do you need to render? If your lander will follow a prescribed inbound path, landing within a fraction of a full orbit, you may be able to simplify your project by rendering a long strip of flat terrain but simulating a curved horizon with a custom shader.

The Unreal documentation section on Georeferencing Terrain is very relevant to your project, even though technically “terrain” refers to Earth (i.e., “Terra”).

What format is your DTM data, and what (if any) GIS software are you using to manipulate that data? One GIS program you may want to investigate, if this is an open question for you, is QGIS. It’s a little daunting o learn if you’re not already familiar with DTM and GIS standards, but it’s incredibly versatile, widely supported, and free. The GIS software will take care of different DTM coordinate spaces for you, but you may need to do some homework to set this up for lunar data instead of terrestrial.

Since you are working in orbital physics, you will probably find it’s easier in the long run to simulate your orbital mechanics in equations rather than asking the UE physics engine to simulate for you. Your results will be more predictable and repeatable, because game engine physics isn’t really meant to work at orbital scale.

For your scenario, it sounds as if you could implement a scaled-down version of the moon and adjust your physics accordingly, another good reason for modeling the math yourself in Blueprints or C++ instead of using engine physics. (Also, since you’re working in Matlab I’ll assume you’ve got the technical background that the physics is well within your capabilities.)

There are several video tutorials on YouTube for building a simulated (and scaled down) Earth and rendering orbit-to-surface as a continuum. The ones I’m thinking of were created for UE4, but I think most of the content is still UE5 applicable.

Getting the height map into UE, once you have your data turned into a supported raster format, isn’t hard, but UE terrain (like that in other game engines) is built around the idea of a flat projection of the world. +Z is always up, but the horizon doesn’t bend, so +Z never changes direction unless you make that happen in code. Even so, the terrain itself won’t bend. That being the case, you’ll need to either avoid using terrain altogether, or simulate a curved world using a custom effect shader (there are assets in the Marketplace to help, if you wish).

If you model a spherical moon, scaled down, you may want to consider using a very smart shader rather than actual vertex heightmap reflection, then procedurally displace vertices only for the area of the surface that you approach closely.

2 Likes

Sounds like you might be able to make use of this…

MaxQ: Spaceflight Toolkit for Unreal Engine 5 (gamergenic.com)

Excerpt from the landing page…

MaxQ: Spaceflight Toolkit for Unreal Engine 5 empowers anyone to easily build exciting, authentic spaceflight visualizations or cutting edge space-based gameplay, no programming experience or astronautical engineering degree required. The toolkit solves challenging space flight problems in a real-time visualization environment - opening up new opportunities across an exciting spectrum of applications.

A great example of usage can be found here

Call REST API using HTTP & JSON from UE5 C++ | Epic Developer Community (epicgames.com)

2 Likes