The lighting section of the viewer settings gives you full control over the lighting setup of the scene.
Light types
The lights currently in the scene are listed at the top of the section. Each light is accessible through a dropdown menu that can be unrolled using the + button on the right.
In the dropdown menu, you can access each property of the light. The list of properties depends on the light type.
Common properties
All light types include the following properties:
- intensity: The intensity of the light source, with values ranging from 0 (the light is off) to infinity.
- color: The emissive color of the light.
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.
Ambient lights
Ambient lights illuminate all the objects in the scene equally. They don't have any additional properties, and in particular they don't cast shadows in the scene. There is typically one unique ambient light in a 3D scene.
Directional lights
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:
- direction: A vector describing the direction where the light is shining.
- cast shadow: A toggle determining if this light will cast shadows on the objects of the scene or not.
Spot lights
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.
- position: A vector containing the position of the light source.
- target: A vector containing the target location that the light is shining towards.
Spot lights in the ShapeDiver viewer also support all the advanced spotlight parameters of the THREE.js light type:
- distance: When distance is zero, light does not attenuate. When distance is non-zero, light will attenuate linearly from maximum intensity at the light's position down to zero at this distance from the light.
- angle: The extent of the spotlight in radians, along its axis (the axis is defined by target-position).
- penumbra: Percent of the spotlight cone that is attenuated due to penumbra. Takes values between zero and 1.
- decay: Defines how much the lights dims along the distance from its position.
This THREE.js demo explains those parameters very well.
Point lights
Point lights have the same parameters as directional lights, except they emit in all directions, therefore they don't have a target property, only a position.
Hemisphere lights
Hemisphere lights are positioned directly above the scene, with color fading from the sky color to the ground color. Instead of a single color property, they have two sky color and ground color properties which defined a color gradient from the sky to the ground.
Flash lights
Flash lights are spotlights with a fixed position set to the target of the camera and which are always pointing directly at the camera. They are only used in specific cases when they help enhance the contrast of the bump and normal maps.
Adding lights
The "Add light" button opens a dialogue which lets you pick which type of light should be added. It is given a default unique name which can be changed.
Interacting with the lights
All light types with a position property can be positioned in the 3d view using a draggable handle represented by a star .
Additionally, the target property of spot lights can also be edited with another draggable handle represented by a double arrow .
Deleting lights
Simply use the cross (X) button on the left of a light dropdown to remove it from the scene.
Saving a light scene
After adding or modifying the lights of the scene, you can save the changes in a new light scene, or overwrite an existing one. Click on Save light scene and pick a name for the current setup.
Pending scene changes
The changes made to the light scenes will only be applied after clicking on "Apply Settings" at the bottom of the edit mode page.
Loading a light scene
Use the "Load light scene" dropdown menu to see all the default and custom light scenes saved in this model, and pick one of the options to load the corresponding scene. All changes to the individual lights that were not saved in a scene will be lost when loading a different scene.
Default scenes
Each model contains two default light scenes. The default scene is the setup that will be used by default when a model is uploaded on ShapeDiver. The legacy scene was the one used in previous versions of the viewer and is only available for backwards compatibility.
Comments
0 comments
Article is closed for comments.