Table of Contents

Share project with others

Unity object, asset, prefab, and package

Orbiting/Rotating Earth on a tilted axis

https://www.youtube.com/watch?v=oW9gzkR1yuw

Physically Based Sky Virtual Sky

This page describes how to create a Unity HDRP virtual sky model with the Physically Based Sky from the scratch. I used the hints from https://www.youtube.com/watch?v=tpTzwyiGByE in using the PBS.

It is assumed that there is a separate folder, named “PBR_Tutorial”, in the Project section (under Assets) where the sample scene is to be created and stored. If the folder does not exist, you can create one (or store subsequent items in your folder).

Steps

Make sure that you are using the HDRP rendering pipeline

  1. Download or locate the deepsky images from NASA (https://svs.gsfc.nasa.gov/4851/). Download 16K or 4K.
    1. download the star map, coordinate grid map, constellation boundary, and constellation shape.
    2. store them in “Textures” folder so that other projects can use them as well.
    3. convert the image to the Cube Shape (click the image –> Texture Shape in the Inspector –> select “Cube”. Set the right “Max Size” under “Default”
  2. Delete everything in the current hierarchy.
  3. Create a new scene: Right-click on the Assests folder –> Create –> Scene
  4. Create a Global Volume: Right-click on the hierarchy –> Volume –> Global Volume
    1. Click “New” in the Inspector panel.
    2. Click “Add Override” –> Sky –> Physically Based Sky
      1. Select Model–>Type = Earth (Advanced)
      2. Click Space –> Space Emission Texture and set it to the downloaded deepsky image.
    3. Click “Add Override” –> Visual Environment
      1. Set Sky Type to “Physically Based Sky”
  1. Diurnal rotation of the sky can be simulated by “Gloval Volume” –> “Space” –> “Space Rotation”

Changing the angle of the directional light can simulate the movement of the Sun in the sky. Also, the diurnal rotation can be controlled as shown in the below image.


Improvements to be added

  • Check if multiple textures can be blended (i.e., displaying deep sky map with alpha-channel coordinate grid) =⇒ we may have to use the Shader Graph to blend textures.
  • Script controlling of the Sun and sky rotation
  • Overlay toggleable coordinate grid, constellation maps. How? Is it possible?
  • Add horizon etc.

Inseok Song 2024/11/18 18:38

2024/11/18 18:01 · song

Check SimpleKeplerOrbits

There is a free asset called, SimplerKeplerOrbits, in the Unity asset store. It has three sample scenes and we can use this package as the starting point to create our desired Solar System simulation. Especially, check Example 3 in the included scenes which allows users' tilting and zooming actions in the rendered window (i.e. in the GamePlay mode), and it also allows to set the observing date (set to “now” automatically). There is a UI slider that can speed up and go backward in time as well. Nice! We can recycle most of these in our 3-D model.

We can create a realistic Solar System model with three free Unity assets (Simple Kepler Orbits, Planets of the Solar System, and MilkyWay).

For example, we can create a simple model by following the sequence of operations below.

  1. Start a new 3D Unity project
  2. Set project setting (Edit → Project Settings; pay attention to Graphics [Rendering], Quality etc.)
  3. Import necessary assets (Package Manager: Install assets from My Assets)
  4. In the main camera setting, choose the right Renderer and select “Post Processing”. Choose the MilkyWay skybox (drag one onto the main camera).
  5. Create three objects (two spheres and one object). You can drag and drop Sun and Earth from “Planets of the Solar System”. One sphere is an attractor (i.e., the central star), the other sphere is an orbiting object (e.g., Earth), and the 3rd object is a velocity indicator. This is an easy approach, but in our desired model, we want to calculate orbital motion by solving Kepler equation in conjunction with six orbital elements.
    1. Drag and drop “KeplerOrbitMover” script on the orbiting object. Drop “KeplerOrbitLineDisplay” on the orbiting object as well if orbits need to be displayed with curves.
    2. Then, select the central object as the attractor and set the right mass value.
    3. Set velocity handle, length scale, and time scale.
  6. Render and you can see an animation.

Procedural (Script-based) Sun-Earth-Moon Model Creation

Click here to see detailed step-by-step procedure to create a Sun-Earth-Moon model

2024/04/25 14:16 · song

Sample WebGL model of the Sun-Earth-Moon System

This embedded WebGL rendering of the Sun-Earth-Moon system created with Unity can be played in any modern web browser. The right mouse button can tilt/rotate the scene, the middle mouse button scroll adjusts a zoom level. Click the image below to access the model.

.

Setup VR with a Quest Headset

Detailed step-by-step tutorial (created by Ricky Correia):unity_to_vr.docx

General Steps:

  1. Create a Meta account
  2. Enable Developer mode
  3. Enable Quest Link
  4. Meta Quest Developer Hub (MQDH)

MicroSoft also has this tutorial: MS + Quest


Creating AR

This video describes the steps to create an AR video using Unity. Blender files can be imported to Unity.

This video demonstrates an example AR model.


Render 2+ camera views

Create cameras as you need. Then, change the “Viewport Rect” (Width and Height and X & Y) to set the desired location and size you need. In the render view then, you will have more than one camera views.


Display UI info and tools

You can add many UI components in three different ways in Unity by changing the “Render Mode”: (1) screen overlay (always displayed on screen), (2) camera space (displayed over camera view), and (3) world space (as if they are regular objects).