Skip to content
Snippets Groups Projects
Commit e88021f6 authored by Robert Long's avatar Robert Long
Browse files

Tweak lights

parent 406f484b
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ AFRAME.registerComponent("directional-light", {
const el = this.el;
this.light = new THREE.DirectionalLight();
this.light.target.position.set(0, 0, 1);
this.light.add(this.light.target);
this.el.setObject3D("directional-light", this.light);
this.el.sceneEl.systems.light.registerLight(el);
},
......
......@@ -14,7 +14,7 @@ AFRAME.registerComponent("hemisphere-light", {
update(prevData) {
if (this.data.skyColor !== prevData.skyColor) {
this.light.skyColor.set(this.data.skyColor);
this.light.color.set(this.data.skyColor);
}
if (this.data.groundColor !== prevData.groundColor) {
......
......@@ -12,6 +12,7 @@ AFRAME.registerComponent("spot-light", {
const el = this.el;
this.light = new THREE.SpotLight();
this.light.target.position.set(0, 0, 1);
this.light.add(this.light.target);
this.light.decay = 2;
this.el.setObject3D("spot-light", this.light);
this.el.sceneEl.systems.light.registerLight(el);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment