The “Light scenes” section of the viewer settings lets you manage one or several light scene presets for your model. You can define as many light scenes as needed, and choose which one is active by default in your scene. Having several light scenes can be useful for API users who might want to switch the lights during the configuration process. Learn more about how to control light scenes using the API.
Managing light scenes
Each light scene is managed through an accordion item with the following controls:
The radio button on the left can be used to switch the active light scene in the model. The active scene can be identified by the light blue accordion with the radio button activated.
The context menu of the accordion contains two options: “Rename” the light scene to change the title of the accordion and the way the scene is identified in the API. “Delete” the light scene to remove it from the list. You can only delete a scene if it is not currently active in the model.
The dropdown arrow lets you expand the accordion and start configuring the lights setup of the scene.
By default, after uploading a model, it contains a unique light scene named “standard”, which contains two directional lights. You can create a new light scene by clicking on the “+” button at the top right of the panel.
Each scene contains one or several lights which can be individually positioned and configured in the 3d scene. Each light is associated with its own accordion within the scene, with a context menu allowing to “Rename” and “Delete” the light. When expanding the light accordion, all the options related to the light element can be configured. The list of options depends on the type of the light.
Ambient: Ambient lights illuminate all the objects in the scene equally. In particular they don't cast shadows in the scene. There is typically one unique ambient light in a 3D scene. In the case of the ShapeDiver viewer, ambient lighting can be done using environment maps, and therefore an ambient light is not always necessary, unless the luminosity of the environment map needs to be adjusted.
Directional: Directional lights get emitted in a specific direction. They simulate infinitely distant light sources and are typically used to simulate daylight. They are defined by their direction and can cast shadows. Specific properties of the light include:
Hemisphere: Hemisphere lights are positioned directly above the scene, with color fading from the sky color to the ground color.
Spot: This light gets emitted from a single point in one direction, along a cone that increases in size the further from the light it gets.
Point: Point lights are similar to spot lights, except they emit in all directions, therefore they don't have a target property, only a position.
Two properties are common to all the light types:
Intensity: The intensity of the light source, with values ranging from 0 (the light is off) to infinity.
Color: the color emitted by the light. It affects all materials in the scene (even non-reflective).
The other properties are specific to each light type. We don't go into many details regarding illumination concepts here, you will find more information about light types and properties in the THREE.js documentation.
Spot lights in the ShapeDiver viewer also support all the advanced spotlight parameters of the THREE.js light type:
This THREE.js demo explains those parameters very well.
Point lights emit in all directions, therefore they don't have a target property, only a position. Otherwise, they have the same properties as spot lights.
Add a light
Use the button at the bottom of the light scene expanded accordion to add a new light. By default, newly added lights are ambient but their type can be changed afterwards.
An upcoming feature will add the possibility to position and orient lights directly in the 3d scene, rather than using the number inputs in the panel.