Skip to content

Instantly share code, notes, and snippets.

@Davisonpro
Created February 3, 2019 18:32
Show Gist options
  • Save Davisonpro/63076b6bc94279eca21e6c59b5ac7554 to your computer and use it in GitHub Desktop.
Save Davisonpro/63076b6bc94279eca21e6c59b5ac7554 to your computer and use it in GitHub Desktop.
function createLights() {
globalLight = new THREE.AmbientLight(0xffffff, .9);
shadowLight = new THREE.DirectionalLight(0xffffff, 1);
shadowLight.position.set(-30, 40, 20);
shadowLight.castShadow = true;
shadowLight.shadow.camera.left = -400;
shadowLight.shadow.camera.right = 400;
shadowLight.shadow.camera.top = 400;
shadowLight.shadow.camera.bottom = -400;
shadowLight.shadow.camera.near = 1;
shadowLight.shadow.camera.far = 2000;
shadowLight.shadow.mapSize.width = shadowLight.shadow.mapSize.height = 2048;
scene.add(globalLight);
scene.add(shadowLight);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment