Unity Beginner Interface overview
If you are new to Unity, read the sections bellow. Otherwise you can go directly to the next step :
Unity Tutorial : Unity Essentials
Unity3D Interface Overview
The Unity interface is made of a toolbar and multiple tabs that all have a specific use.
The toolbar (A) contains the essential working features (manipulating, play/pause,...),
The “Hierarchy” tab (B) contains a list of the scenes loaded in the project with details on every object contained within each scene,
The “Game” tab (C) contains the application final render. The view and resolution settings are also defined here,
The “Scene” tab (D) contains an interactive render to navigate and edit the scenes,
The “Inspector” tab (E) contains details on the currently selected object,
The “Project” tab (F) contains the library of available assets. The contents of this library is defined in the project “/Assets” folder.
Unity Tutorial : Using the Unity Interface
Scenes
In Unity, the objects are organized by scenes. A scene is a group of camera(s), geometries and lights that can be animated, modified, added or removed when the application is running. The scene can also contain UI or other interface and settings elements.
The scene is defined in the “Hierarchy” tab and saved in the “Project” as a *.unity file. Several scenes can be loaded at the same time : their content is merged and can be visualized in the Scene and Game views.
Unity Tutorial : Scenes
Scenes can be created via the menu "File/New Scene".
Scenes can be opened via the menu "File/Open Scene", by double clicking on their file in the Project tab, or by being dragged from the Project tab to the Hierarchy tab.
Scenes can be removed by right-clicking on their name in the Hierarchy tab.
GameObjects and Components workflow
In Unity, every element in the scene is called a GameObject.
Every GameObject is positioned in the scene with a “Transform” (A) that defines its position, rotation and scale.
In addition to a “Transform”, every GameObject contains specific components. A component is a script that defines a behaviour : for example, a GameObject with the “Camera” component (B) will behave as a camera in the scene. Components can be added, edited or removed on every GameObject via the “Inspector” tab.
Unity Tutorial : GameObjects
GameObjects can be related via a “Parent-Child” relationship. The parent GameObject holds a series of child GameObject : in the example below, the “Object 1” is the parent of “Object 2” and “Object 3”.
NB : child GameObjects can also have children, yielding a tree structure hierarchy.
When a GameObject is parented to another GameObject, the child will move, rotate, and scale exactly as its parent does. A good example of this relationship is the relation between your arms and your body.
NB : changing the scale of a parent GameObject affects the position of the children.
Unity Tutorial : Transforms
GameObjects can be enabled/disabled using the checkbox next to the GameObject name in the Inspector. A disabled GameObject won't be loaded in the 3D scene. All its children are also affected and won't be loaded either.
Unity Tutorial : Deactivate Object
Editing Transforms
The Transform component of a GameObject defines its position, rotation and scale. The Transform can be edited in several ways :
Edition of the Transform directly in the Transform component : you can edit the position, rotation and scale manually,
Copy and Past Transforms : by right-clicking on the Transform component, you can access copy and past functions,
Reset Transforms : by right-clicking on the Transform component, you can reset its values (this work for all types of components),
Use the transform gizmos : when a GameObject is selected in the Hierarchy, gizmos appear at its origin in the Scene view, these gizmos enable you to move, rotate or scale the GameObject from within the Scene view. You can switch between move, rotate, and scale mode in the main Unity toolbar.
Unity Tutorial : Transforms
Cameras
When you create a new scene in Unity, a camera is created by default in the scene.
You can add a new camera in the scene via the right-click menu “Camera” in the Hierarchy tab ,
The created camera can be set-up by editing the “Camera” component in the “Inspector” tab. See the Unity documentation for more details on the camera settings : https://docs.unity3d.com/Manual/class-Camera.html.
Unity Tutorial : Working with Unity Cameras
In Predictive Engine, only the following “Camera” component’s settings are taken into account :
Clear Flags and Background Color (environment)
Field Of View
Culling Mask (layers)
You can align a camera to the current scene view by selecting the camera GameObject in the Hierarchy and calling the menu "GameObject/Align With View" (shortcut : Ctrl+Shift+F).
Unity offers a good camera controller in the Scene view. You can choose to fit the Game view camera to the Scene view camera by adding a "Scene Camera" component to your camera.
As long as the camera is selected in the Hierarchy, the Game view camera will be configured and positioned exactly like the Scene view camera.
You can define preset camera positions using Unity's presets system :
Select the GameObject from which you want to reuse settings : when you select it, it appears in the Inspector window,
In the Inspector window, configure the properties as you want to save them,
Click the Preset selector (the slider icon) at the top-right of the Inspector window,
In the Select Preset window, click Save current to : A File Save dialog appears,
Choose the location of your new Preset, enter its name, and click Save.
To re-use predefined presets, use the Preset selector icon on the Transform component.
Set up multiple views for stereo
Using Predict Unity enables you to create stunning realistic VR scenes or stereo rendering. To render the two eye views from Unity, you just need to define the two corresponding cameras.
In Unity, you can choose where the camera should render on the screen. There are two main ways of having several cameras rendering at the same time :
Assign a display to each camera in the scene : on the “Camera” component, you can define a “Target Display” (1) for each camera. Once in the “Game” view, you can then choose which display you want to have on screen (2).
Assign a different viewport on the screen to each camera in the scene : on the “Camera” component, you can define a “Viewport Rect” (3). The viewport is the rectangle on the screen in which the camera view will be rendered. By changing the “Viewport Rect”, you can display several camera views on the same screen.
Geometries
In Unity, a 3D model is instantiated in the scene by creating a GameObject with the following components :
a “Mesh Filter” in charge of placing the geometry triangles in the scene
a “Mesh Renderer” in charge of attributing materials to the geometry triangles
See the Unity documentation for more details on the geometry settings :
Unity Tutorial : Explore meshes and rendering
You can add a preset geometry in the scene via the right-click menu “3D Object/*” in the Hierarchy tab.
You can add a custom geometry in the scene by dragging a geometry file (*.obj, *.fbx,...) from the Project tab into the Hierarchy tab.
Lights
When you create a new scene in Unity, a default directional light is created by default in the new scene.
You can add a new light in the scene via the right-click menu “Light/*” in the Hierarchy tab.
See the Unity documentation for more details on the light settings : https://docs.unity3d.com/Manual/class-Light.html.
Unity Tutorial : Introduction to Lighting and rendering (Section 9 : Light types)
In Predict Engine, only the following settings from the “Light” component are taken into account :
Type
Color
Intensity
When using the HDRP pipeline, the following settings are also taken into account :
Diameter (for directional lights)
Temperature
Reflection Probe and Light Probe Groups are not supported by Predict Engine and will be ignored.
Environments
The skybox (also called envmap or HDRI) is a texture that defines the background of the 3D scene.
The skybox is defined on the camera. The “Clear Flags” variable of the Camera component defines how the background is computed :
Solid Color : the background is a plain color (Figure A),
Skybox : the background is an environment texture (Figure B), the environment texture is defined by a material using a “Skybox” shader.
figure A
figure B
Unity Tutorial : Introduction to Lighting and rendering (Section 8 : Ambient Lighting)
Standard Pipeline
In the Unity standard pipeline, the environment of a camera is defined by a material with a "Skybox" shader.
Unity Tutorial : Using Skyboxes
The first step to add an environment on a camera is to create the skybox material :
Create a new material : menu Assets/Create/Material,
Set a valid skybox shader on the material and fill in the required textures and fields.
Unity supports 4 types of skybox shader :
procedural : the environment is generated procedurally (Image 1),
6 sided : the 6 sides of the environment box are given separately,
cubemap : the 6 sides of the environment box are given in a single file (Image 2 or Image 3),
panoramic : the environment is stored in a single panoramic texture (Image 4).
(Image 1)
(Image 2)
(Image 3)
(Image 4)
Predict Engine only supports skyboxes of type "Panoramic". Other types of Unity skyboxes are converted to "Panoramic" when the scene is loaded. This conversion can result in a loss of resolution or contrast.
In the example here against, the same envmap is given in the cubemap format (left) and the panoramic format (right). Both envmaps are given in the same resolution (4K). A detail of the result in OMEN is given above each envmap.
Panoramic environments should be defined using the NESWN convention.
Once you created the skybox material, you must assign it to the camera :
Make sure the camera's "Clear Flags" are set to "Skybox",
Add a "Skybox" component to the camera if there isn't one already,
Set the skybox material on the "Custom Skybox" field.
You can define default skybox settings in the "Environment" section of the Lighting Settings (menu Window/Rendering/Lighting Settings). These settings will be used on every camera in your project that doesn't have a "Skybox" component with a valid material.
HDRP Pipeline
In the Unity HDRP pipeline, the environment of a camera is defined by a texture with a "Cube" shape.
Unity Tutorial : HDRP Volumes
The first step to add an environment on a camera is to set up the texture shape :
Import the texture in your project and select it in the Project tab,
Set the "Texture Shape" to "Cube",
Apply the changes (button at the bottom of the inspector).
Once you set up the texture, you must assign it to the camera :
Add a “Volume” component to the camera,
On the “Volume” component, create a new Profile,
Add a new Override of type Visual Environment :
Enable the "type" property override,
Set the "type" property to “HDRI Sky”.
Add a new Override of type HDRI Sky :
Enable the "Hdri Sky" property override,
Set the "Hdri Sky" property with the Cubemap texture,
You can also enable and set the "Rotation" property in this component.
You can define default volume settings for the HDRP rendering pipeline in the Project Settings (menu Edit/Project Settings...), in the "Volume Components" section of the "HDRP Default Settings". These settings will be used on every camera in your project that doesn't have a "Volume" component with the corresponding overrides.
There are several ways of defining volumes in Unity HDRP. More details on HDRP volumes can be found in the HDRP documentation :
https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@7.1/manual/Volumes.html .
Unity HDRP Volumes can be defined locally or globally, not necessarily on the Camera GameObject. The environment used in Predict Engine is, by order of priority :
The volume defined on the Camera GameObject (whether it is local or global),
The global volume with the highest priority in the scene.
Local volumes that are not defined on the camera will be ignored.
Materials
In Unity, materials are assets (*.mat files) that are found in the Project tab.
You can create a material via the menu “Assets/Create/Material” or via the right-click menu “Create/Material” in the Project tab.
You can edit a material in the Inspector tab by selecting it in the Project tab. A material is defined by its shader (the program that defines how the material is lit/shadowed by a light) and some shader-specific settings.
To set a material on a geometry, you can :
drag the material from the Project tab to the Mesh Renderer component of the geometry in the Inspector tab,
drag the material directly on the geometry in the Scene view,
select a material using the material field selection window (see example here against).
Unity Tutorial : Explore meshes and rendering
Unity Tutorial : Manage materials in a project
Tags : Ignore a GameObject in Predict Engine
It can sometimes be useful to add elements in the Unity scene that we want to ignore in the Predict Engine render.
For instance, Predict Engine always uses the environment (skybox or solid colors) as a global illuminant : if there is a sun in the skybox, the scene will be lightened by the sun. In Unity, environment lighting is optional and can be replaced by a directional light in the scene, in which case you will want to ignore this directional light in Predict Engine.
To ignore an element (geometry, light, camera or other) in Predictive Engine, you just have to set its GameObject’s tag to “IgnoreInUVR”. The tag can be set on the top section of the “Inspector” tab.
Unity Tutorial : Tags