Geometries

Geometries for Predict Engine are defined just like geometries for the Unity scene. See the Unity interface overview for details on the Unity components. Predict Unity supports every geometry format that is supported by Unity.


At the moment, Predict Engine does not support animated meshes. For this reason, Unity's "Skinned Mesh Renderers" are not supported with Predict Unity : geometries defined with a "Skinned Mesh Renderer" will be ignored in Predict Engine.

When using geometries in the OBJ format, 2 files are required to define correctly the geometry : a *.obj file and a *.mtl file. The MTL file defines the different materials (submeshes) in the geometry. Without this file, the geometry won't be transmitted correctly from Unity to Predict Engine.

In Unity, you can import geometries that are defined in any forward/up/right framework.

Unity's framework is : Y up, Z forward, X right.

If the geometry you imported is in a different framework, you can convert its Transform to Unity's framework via the right click menu "GameObject/PredictSuite/Transform/Convert Transform to Unity Framework". A popup window enables you to define the imported geometry up and forward axis.

Normals

The normals of a geometry are the directions perpendicular to the surface at each position on the geometry. In Predict Engine, normals indicate the exterior side of the geometry. When setting a material on a geometry, the material is placed on the internal side of the geometry.

Figure A : Visualisation of the normal vectors of a surface

https://en.wikipedia.org/wiki/Normal_(geometry)

By default, opaque materials are considered to be "double sided" in Predict Engine. That means the normal direction is ignored and the material is applied on both sides of the geometry (see example 1a).

You can choose to disable this option in the PredictSuite Preferences, section Matter Settings. When the double sided option is disabled, the internal side of opaque materials are displayed in black (see example 1b).


NB : the double sided option only affects opaque materials, it does not affect transmissive materials.

example 1a : both cubes are made of a blue coloured diffuse material (Lambert). 

The cube on the left has normals facing outwards (correct). The cube on the right has normals facing inwards (incorrect).

Double-sided option is enabled.

example 1b : same scene as example 1a.

Double-sided option is disabled.

Specular materials can be transmissive : the light is not only reflected by the material but it can be transmitted and go through the material. In these situations, the normals of the geometry are very important, they define which material should be set on each side of the geometry : the external material (air by default) is used on the side pointed by the normals, the internal material is used on the other side

When the normals of a geometry are not defined correctly (the normals are pointing inside the physical geometry), the external material is used inside the physical geometry. This can lead to incorrect rendering (see example 2).

example 2 : both spheres are made of a blue coloured glass (Fresnel transmissive material). 

The sphere on the left has normals facing outwards (correct). The sphere on the right has normals facing inwards (incorrect).

In Predict Engine, the default external medium is air : it is the external material for every opaque material and for "Specular" materials. Using "Interface" materials, it is possible to create complex interfaces where the external material of a geometry is not air but some glass, liquid, or gas for instance.