Three.js change light intensity dynamically

javascript, three.js

Solution

To change the intensity for a `DirectionalLight`, `SpotLight`, `PointLight`, or `AmbientLight`, you just set it:

light.intensity = 0.5;

You can change the light color like so:

light.color.setHex( 0xff0000 );

See `Color.js` for other ways to set a color.

three.js r.74

Problem

Is there a way that i have not seen to change the light intensity of directional lights on the fly? Or even ambient light? ``` ambientLight = new THREE.AmbientLight(0xffffff); scene.add(ambientLight); directionalLightL = new THREE.DirectionalLight(0xffffff, dLight, 0); directionalLightL.position.set(dlpX, dlpY, dlpZ); scene.add(directionalLightL); ``` So that is done initially to render, but how can i change just one specific lights intensity afterwards? Remove/re-add the light? Find it in the dom and change it? Something in the API i have not noticed?

Original source