The goal here is to create a more realistic model of the Earth using Blender and then import it directly into Unity using the GLTF exchange format
Simply applying a texture does not yield a very accurate result. On the right is a simple texture applied to a sphere; on the left is a more refined Blender model that combines multiple textures for the Earth’s surface and an additional mesh for cloud cover.
In Blender, we start by generating two spheres: the first for the atmosphere and the second for the Earth.
Next, create the following shaders:
For the earth, we'll use the following materials:
For the atmosphere, we'll also use the available image file in the archive:
The result is as follows:
Atmospheric transparency:
Next, we export the earth and the atmosphere separately in the glTF binary format:
To import these files directly into Unity, you need to add an import plugin. There are several available; we’ll install FastGLTF, which supports version 2.0 of the GLTF format.
The project can be found at the following GitHub addresshttps://github.com/atteneder/glTFast
For Unity, importing glTF files requires adding the glTFast package, which is now integrated into Unity:
https://docs.unity3d.com/Packages/com.unity.cloud.gltfast@6.2/manual/installation.html
To install the Unity glTFast package, follow these steps:
com.unity.cloud.gltfast.The Editor installs the latest available version of the package and any dependent packages.
Once the plugin is installed, glTF files can be dragged and dropped into the project's “Assets” folder and will be immediately usable as GameObjects: