Ceci est une ancienne révision du document !


From Blender to Unity : Earth V2.0

Earth V2.0

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.

Modeling Our Earth 2.0

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.

FastGLTF for importing GLTF files into Unity

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

Install the Unity glTFast package using the Unity Package Manager

To install the Unity glTFast package, follow these steps:

  1. In your Unity project, go to Windows > Package Manager.
  2. On the status bar, select the Add (+) button.
  3. From the Add menu, select Add + package by name. The Name and Version fields appear.
  4. In the Name field, enter com.unity.cloud.gltfast.
  5. Select Add.

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:

Fly to the Moon

Now it's your turn to create the moon in glTF format using Blender and import it into Unity:

1024

brasil/courses/blender_unity/unity/3_from_blender_to_unity.1787086012.txt.gz · Dernière modification : de yann
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0