Graphics Reference
In-Depth Information
1. You first need to instantiate a THREE.HemisphereLight instance:
var hemiLight = new
THREE.HemisphereLight(0xffffff, 0xffffff,
0.6 );
The first parameter sets the color of the sky, and the second color sets
the color reflected from the floor. In both these cases, we just set a white
light. With the last property, you can control the intensity of
THREE.HemisphereLight object. In this case, we dampen the light by set-
ting it to 0.6 .
2. Next, we need to position the light:
hemiLight.position.set( 0, 500, 0 );
When you position THREE.HemisphereLight , it's best to position it directly
above the scene for the best effect.
3. Finally, with the position set, the last step is to add the light to the scene:
scene.add( hemiLight );
You could use THREE.HemisphereLight as the main light source of your scene,
but most often, this light source is used together with a different light source. For the
best outdoor effect, use it with THREE.DirectionalLight , which can cast shad-
ows.
How it works...
THREE.HemisphereLight pretty much acts as two THREE.DirectionalLight
objects: one positioned at the specified position and another one in exactly the op-
posite position. So, when a scene is rendered, THREE.HemisphereLight lights an
object from the top and from the opposite direction to create a natural-looking effect.
Search WWH ::




Custom Search