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.
Decide yourself when you want to show the contents of the viewport.
Adjustments to the positioning of the busy spinner.
The spinner that is used when the viewport is declared as busy can be changed.
Default Material Color Adjustment
For geometry that does not have a material defined, the default material is used. The color of this material can be adjusted.
Ground Plane Shadow
A ground plane shadow can be displayed.
Select between the different available cameras.
Camera Controls Adjustments
Adjust the camera controls which can be used to change the speed of rotation, zooming and much more.
Restrict the position, target, rotation and zooming of the camera.
Camera Rotation Restriction
Specific example to restrict the camera rotation.
Variations of how to zoom to an object.
Environment as Background
Change the environment map and set it as a background.
Busy while loading
Activate the busy mode while loading the environment map.
Adjust the intensity of the environment map.
Adjust the rotation of the environment map.
Adjust the blurriness of the environment map.
Shadow Map Properties
Changing different properties like the shadow map bias and resolution.
Shadow Map Resolution
Examples of different shadow map resolutions.