How to use the LightShadow function from three

Find comprehensive JavaScript three.LightShadow code examples handpicked from public code repositorys.

82
83
84
85
86
87
88
89
90
91

scene.add( new THREE.AmbientLight( 0xf0f0f0 ) );
var light = new THREE.SpotLight( 0xffffff, 1.5 );
light.position.set( 0, 1500, 200 );
light.castShadow = true;
light.shadow = new THREE.LightShadow( new THREE.PerspectiveCamera( 70, 1, 200, 2000 ) );
light.shadow.bias = -0.000222;
light.shadow.mapSize.width = 1024;
light.shadow.mapSize.height = 1024;
scene.add( light );
fork icon16
star icon39
watch icon8

65
66
67
68
69
70
71
72
73
74
renderer.setClearColor('#ffffff', 1);

var light = new THREE.SpotLight(0xff2200, 1, 0);
light.position.set(-50, 120, 45);
light.penumbra = 0.5;
light.shadow = new THREE.LightShadow( new THREE.PerspectiveCamera( 50, winResWidth / winResHeight, 20, 200 ) );
light.castShadow = true;
light.shadow.mapSize.width = 4000;
light.shadow.mapSize.height = 4000;
light.shadow.radius = 1;
fork icon0
star icon1
watch icon0

83
84
85
86
87
88
89
90
91
92
renderer.setClearColor('#ddeeff', 1);

var light = new THREE.SpotLight(0xff2200, 1, 0);
light.position.set(-50, 120, 45);
light.penumbra = 0.5;
light.shadow = new THREE.LightShadow(new THREE.PerspectiveCamera(50, 1, 0.5, 200));
light.castShadow = true;
light.shadow.mapSize.width = 4000;
light.shadow.mapSize.height = 4000;
light.shadow.radius = 1;
fork icon0
star icon1
watch icon0

205
206
207
208
209
210
211
212
213
addLights () {
  var directionalLight = new THREE.SpotLight(0xffffff, 1.2);
  directionalLight.position.set(1, 1, 1).multiplyScalar(100);
  directionalLight.target.position.set(0, 0, 0);
  directionalLight.castShadow = true;
  directionalLight.shadow = new THREE.LightShadow(new THREE.PerspectiveCamera(25, 1, 10, 500));
  directionalLight.shadow.bias = -0.00001;

  var resolution;
fork icon0
star icon0
watch icon0

+ 7 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)