CLASSES
TagsA - Z

HemisphericLight

NodeLight

Description

class HemisphericLight extends Light

Hemispheric light represents a simple and easy way to simulate realistic ambient light.

An hemispheric light is defined by a direction to the sky and by 3 colors: one for the diffuse (the sky color), one for the ground (the color when the pixel is not towards the sky) and one for the specular.

A tutorial about lights can be found here : https://doc.babylonjs.com/tutorials/lights

Constructor

new HemisphericLight(name, direction, scene)

Creates a HemisphericLight object in the scene according to the passed direction (Vector3).

The HemisphericLight simulates the ambient environment light, so the passed direction is the light reflection direction, not the incoming direction.

The HemisphericLight can't cast shadows.

Documentation : http://doc.babylonjs.com/tutorials/lights

Parameters

Name Type Description
name string The namme of the light
direction Vector3 The direction of the light
scene Scene The scene to create the light into

Members

groundColor : Color3

The ground color

direction : Vector3

The direction of the light

Methods

getClassName() → string

Returns the string "HemisphericLight".

setDirectionToTarget(target) → Vector3

Sets the HemisphericLight direction towards the passed target (Vector3).

Returns the updated direction.

Parameters

Name Type Description
target Vector3 The given target to lighten

getShadowGenerator() → ShadowGenerator

Returns null

transferToEffect(effect, lightIndex) → HemisphericLight

Sets the passed Effect object with the HemisphericLight normalized direction and color and the passed name (string).

Returns the HemisphericLight.

Parameters

Name Type Description
effect Effect The given effect
lightIndex string

getTypeID() → number

Returns the integer 3.