A Viewport can exist completely without a Session, as a Session can exist without a Viewport. The Viewport is responsible for rendering and rendering related settings. For example, camera and light management happens here. Additionally, a Viewport has many options, as rendering options can be enabled or disabled (shadows, ambient occlusion, etc.) and scene properties can be adjusted (groundplane, grid, etc.).
By reusing the simple example from the first section, we will now disable the grid and the groundplane. The logic presented can be used for many of the standard properties.
In our next example we change the environment map and remove the lights. We do this by creating a new Light Scene which has no lights in it.
One of the standard adaptions is to change some camera properties. We distinguish here between a Perspective Camera and an Orthographic Camera. In our next example we create an Orthographic Camera, which will be assigned as the default camera automatically.
The camera also has many capabilities that can be used to roam through the scene.
For lights, we always handle a bunch of them at once, that's why we introduce Light Scenes. A Light Scene is a grouping of lights. The lights in a Light Scene can be freely manipulated. Therefore, we now create a new Light Scene and add a few lights to it.
Adjusting (removing or changing) the logo of the viewer and setting the color and opacity of the logo background.