Sunday, September 27, 2020

ThreeJS what is point light and ambient light

 

A light that gets emitted from a single point in all directions. A common use case for this is to replicate the light emitted from a bare lightbulb.


var light = new THREE.PointLight( 0xff0000, 1, 100 );

light.position.set( 50, 50, 50 );

scene.add( light );


AmbientLight

This light globally illuminates all objects in the scene equally.


This light cannot be used to cast shadows as it does not have a direction.


var light = new THREE.AmbientLight( 0x404040 ); // soft white light

scene.add( light );



References:

https://threejs.org/docs/#api/en/lights/PointLight


No comments:

Post a Comment