# References

## Example Digital Twins

### Minimum spec example

![Simple Digital Twin in NVidia Omniverse](images/preview_simple.png)

The first example is a Digital Twin that meets the minimum requirements for a OpenUSD Digital Twin as defined [here](../core/README.md).

One can see the USD structure below. It's contains two `UsdMesh` prim for the top and bottom of the can as well as the textured middle part. For each of the meshes the stage contains a `UsdMaterial` using a `UsdPreviewSurface` shader. NVidia Omniverse has good support for `UsdPreviewSurface` shaders so MDL shaders are not required although recommended, also have a look at the [Grip material section](../universalmaterial/README.md).

All nodes are grouped underneath a `Xform` prim without any transformation applied which is also the `defaultPrim` for the USDA file.

![USD hierarchy](images/structure_simple.png)

[Download the example files](files/simple.zip)


### Grip material example

![Grip Material example in NVidia Omniverse](images/grip_material.png)

This extends the simple example by using the [Grip material](../universalmaterial/README.md) for all surfaces. By using the Grip material the file can be properly viewed in all DCCs that support Arnold as renderer for USD files and NVidia Omniverse.

In the screenshot above one can see all the attribute shader nodes that drive the underlying render specific implementations.

[Download the example files](files/grip_material.zip)

### Grip material & artwork example

![Label artwork example in NVidia Omniverse](images/label_artwork.png)

This example is using the [Grip material](../universalmaterial/README.md) for all surfaces and a [interchangeable artworks](../labelartworks/README.md) for the can's body texture. The label artwork texture can be changed in the `param_artwork_texture` attribute of the `/asset/materials/_artwork_controller` shader.

[Download the example files](files/label_artwork.zip)

### Full Grip Digital Twin example

![Complete example in NVidia Omniverse](images/full.png)

Complete example with [Grip material](../universalmaterial/README.md), [interchangeable artworks](../labelartworks/README.md) and [Configuration variants](../variants/README.md).

The stage has 1 Configuration variant set called `Configurations` and 2 shape variant sets called `Cap` and `Droplets`. The Configuration variant set overwrites the two shape variant sets, to select to correct look for each variant in the configuration set.

The main `Configurations` variant set has four variants:
 - `Dry`
    - sets `Cap` to `On`
    - sets `Droplets` to `Off`
 - `Dry_Open`
    - sets `Cap` to `Off`
    - sets `Droplets` to `Off`
 - `Wet`
    - sets `Cap` to `On`
    - sets `Droplets` to `On`
 - `Wet_Open` 
    - sets `Cap` to `Off`
    - sets `Droplets` to `On`

![All variants](images/variants.png)

[Download the example files](files/full.zip)

## Reference Scenes

### White studio scene

![Studio scene in NVidia Omniverse](images/studio_scene.png)

Simple frontal view with a standard white studio lighting.

You have to reference in your Digital Twin under the prim `/root/inserts/__insertionPoint__01_`. That way it will be positioned correctly in the scene. To support Digital Twins with different up-axes defined, the `/root` prim has a variant set called `up_axis` that let one switch between `Y` and `Z`. Set this to the corresponding up axis from your file to config the correct orientation. 

This scene should be used to verify the look of the Digital Twin and make sure its front it facing in the correct direction. To visually check the size of your assets use the hidden prim `/root/measurements/cube_10_cm_height`. When this is made visible a cube with the a width and depth of 1 cm and a height of 10 cm is shown in the stage.

[Download the example files](files/studio_scene.zip)

### Lifestyle scene

![Life style example scene in NVidia Omniverse](images/life_style.png)

This scene is built and tested with Omniverse 106.5.0. It uses Omniverse specific features and therefore will not work properly with other DCCs or USD viewers.

Use the camera `/root/camera/camera_1`.

The scene contains 5 insertion points that can be used to reference Digital Twins for preview.
Each of these insertion points has a variant that switches the transformation using a given up-axis. This is to easily support Digital Twins that have different up axes in the same stage. Just choose the one defined in your file.

![Render settings in Omniverse](images/life_style_variant.png)

[Download the example files](files/lifestyle_scene.zip)


## Troubleshooting

#### The background image is not displayed in lifestyle scene

Omniverse versions earlier than 110.0.2 do not support relative paths for the background compositing image. Consequently, the delivered USD file contains an absolute path that must be updated in Omniverse.

As an intermediate fix go to “Render Settings” -> “Post Processing” -> “Compositing” and select the “Grip_Indoor_NL_BG Cleaned.jpg” from the directory resources/textures.

![Render settings in Omniverse](images/omniverse1.png)

#### The background image doesn’t fit in lifestyle scene

For the background image to align correctly with the 3D scene, the viewport must use a 16:9 aspect ratio.
Open the Viewport settings and set the render resolution to 16:9.

![Render settings in Omniverse](images/omniverse2.png)
